CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Sun Aug 15 10:04:53 UTC 2021 Modified Files: src/doc [netbsd-8]: CHANGES-8.3 Log Message: Ticket #1691 To generate a diff of this commit: cvs rdiff -u -r1.1.2.95 -r1.1.2.96 src/doc/CHANGES-8.3 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.3 diff -u src/doc/CHANGES-8.3:1.1.2.95 src/doc/CHANGES-8.3:1.1.2.96 --- src/doc/CHANGES-8.3:1.1.2.95 Wed Aug 11 17:25:54 2021 +++ src/doc/CHANGES-8.3 Sun Aug 15 10:04:53 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.3,v 1.1.2.95 2021/08/11 17:25:54 martin Exp $ +# $NetBSD: CHANGES-8.3,v 1.1.2.96 2021/08/15 10:04:53 martin Exp $ A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3 release: @@ -1994,3 +1994,10 @@ sys/netinet6/in6_src.c1.88 mapped address. [kardel, ticket #1690] +sys/compat/common/vfs_syscalls_30.c 1.42 +sys/compat/common/vfs_syscalls_43.c 1.67 +sys/compat/common/vfs_syscalls_50.c 1.26 + + Fix compat stat(2) syscall kernel memory disclosure. + [christos, ticket #1691] +
CVS commit: [netbsd-8] src/sys/compat/common
Module Name:src Committed By: martin Date: Sun Aug 15 10:03:46 UTC 2021 Modified Files: src/sys/compat/common [netbsd-8]: vfs_syscalls_30.c vfs_syscalls_43.c vfs_syscalls_50.c Log Message: Pull up following revision(s) (requested by christos in ticket #1691): sys/compat/common/vfs_syscalls_43.c: revision 1.67 sys/compat/common/vfs_syscalls_50.c: revision 1.26 sys/compat/common/vfs_syscalls_30.c: revision 1.42 - memset struct stat to avoid kernel memory disclosure of padded fields (thanks Trend Micro for the report) - use do_fhstat - consistency in argument order of compat functions To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.36.12.1 src/sys/compat/common/vfs_syscalls_30.c cvs rdiff -u -r1.59.8.2 -r1.59.8.3 src/sys/compat/common/vfs_syscalls_43.c cvs rdiff -u -r1.18 -r1.18.12.1 src/sys/compat/common/vfs_syscalls_50.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/compat/common/vfs_syscalls_30.c diff -u src/sys/compat/common/vfs_syscalls_30.c:1.36 src/sys/compat/common/vfs_syscalls_30.c:1.36.12.1 --- src/sys/compat/common/vfs_syscalls_30.c:1.36 Mon Oct 20 11:58:01 2014 +++ src/sys/compat/common/vfs_syscalls_30.c Sun Aug 15 10:03:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_30.c,v 1.36 2014/10/20 11:58:01 christos Exp $ */ +/* $NetBSD: vfs_syscalls_30.c,v 1.36.12.1 2021/08/15 10:03:46 martin Exp $ */ /*- * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.36 2014/10/20 11:58:01 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.36.12.1 2021/08/15 10:03:46 martin Exp $"); #include #include @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls #include #include -static void cvtstat(struct stat13 *, const struct stat *); /* * Convert from a new to an old stat structure. @@ -64,6 +63,8 @@ static void cvtstat(struct stat13 *ost, const struct stat *st) { + /* Handle any padding. */ + memset(ost, 0, sizeof(*ost)); ost->st_dev = st->st_dev; ost->st_ino = (uint32_t)st->st_ino; ost->st_mode = st->st_mode; @@ -101,8 +102,7 @@ compat_30_sys___stat13(struct lwp *l, co if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, ub), sizeof(osb)); } @@ -125,8 +125,7 @@ compat_30_sys___lstat13(struct lwp *l, c if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, ub), sizeof(osb)); } /* ARGSUSED */ @@ -140,33 +139,12 @@ compat_30_sys_fhstat(struct lwp *l, cons struct stat sb; struct stat13 osb; int error; - struct compat_30_fhandle fh; - struct mount *mp; - struct vnode *vp; - - /* - * Must be super user - */ - if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE, - 0, NULL, NULL, NULL))) - return (error); - if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fh))) != 0) - return (error); - - if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL) - return (ESTALE); - if (mp->mnt_op->vfs_fhtovp == NULL) - return EOPNOTSUPP; - if ((error = VFS_FHTOVP(mp, (struct fid*)&fh.fh_fid, &vp))) - return (error); - error = vn_stat(vp, &sb); - vput(vp); + error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), &sb); if (error) - return (error); + return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, sb), sizeof(sb)); - return (error); + return copyout(&osb, SCARG(uap, sb), sizeof(osb)); } /* @@ -188,8 +166,7 @@ compat_30_sys___fstat13(struct lwp *l, c if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, sb), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, sb), sizeof(osb)); } /* @@ -265,7 +242,7 @@ again: bdp = (struct dirent *)inp; reclen = bdp->d_reclen; if (reclen & _DIRENT_ALIGN(bdp)) - panic("netbsd30_getdents: bad reclen %d", reclen); + panic("%s: bad reclen %d", __func__, reclen); if (cookie) off = *cookie++; /* each entry points to the next */ else @@ -368,9 +345,8 @@ compat_30_sys_getfh(struct lwp *l, const error = EINVAL; } if (error) - return (error); - error = copyout(&fh, SCARG(uap, fhp), sizeof(struct compat_30_fhandle)); - return (error); + return error; + return copyout(&fh, SCARG(uap, fhp), sizeof(fh)); } /* @@ -407,8 +383,7 @@ compat_30_sys___fhstat30(struct lwp *l, if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap_30, sb), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap_30, sb), sizeof(osb)); } /* ARGSUSED */ Index: src/sys/compat/common/vfs_syscalls_43.c diff -u src/sys/compat/common/vfs_syscalls_43.c:1.59.8.2 src/sys/compat/common/vfs_syscalls_43.c:1.59.8.3
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Sun Aug 15 09:30:14 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1334 - #1337 To generate a diff of this commit: cvs rdiff -u -r1.1.2.21 -r1.1.2.22 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.21 src/doc/CHANGES-9.3:1.1.2.22 --- src/doc/CHANGES-9.3:1.1.2.21 Wed Aug 11 17:23:19 2021 +++ src/doc/CHANGES-9.3 Sun Aug 15 09:30:14 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.21 2021/08/11 17:23:19 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.22 2021/08/15 09:30:14 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -562,3 +562,34 @@ sys/netinet6/in6_src.c1.88 mapped address. [kardel, ticket #1332] +distrib/notes/hp300/hardware 1.25,1.26 + + Improve HP9000/360 and disk related information, mention + working emulated disks. + [tsutsui, ticket #1334] + +distrib/sun2/miniroot/install.md 1.8,1.9 +distrib/sun3/miniroot/install.md 1.8,1.9 + + Don't try to add swap on miniroot. + [tsutsui, ticket #1335] + +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc 1.6 +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc 1.7,1.8 +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc 1.8 +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc 1.1,1.2 +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc 1.5 +crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc 1.7 +crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc 1.3 + + PR 56318: fix openssl arch specific usage of optimized asm code + for mips and sparc. + [tsutsui, ticket #1336] + +sys/compat/common/vfs_syscalls_30.c 1.42 +sys/compat/common/vfs_syscalls_43.c 1.67 +sys/compat/common/vfs_syscalls_50.c 1.26 + + Fix compat stat(2) syscall kernel memory disclosure. + [christos, ticket #1337] +
CVS commit: [netbsd-9] src/sys/compat/common
Module Name:src Committed By: martin Date: Sun Aug 15 09:27:50 UTC 2021 Modified Files: src/sys/compat/common [netbsd-9]: vfs_syscalls_30.c vfs_syscalls_43.c vfs_syscalls_50.c Log Message: Pull up following revision(s) (requested by christos in ticket #1337): sys/compat/common/vfs_syscalls_43.c: revision 1.67 sys/compat/common/vfs_syscalls_50.c: revision 1.26 sys/compat/common/vfs_syscalls_30.c: revision 1.42 - memset struct stat to avoid kernel memory disclosure of padded fields (thanks Trend Micro for the report) - use do_fhstat - consistency in argument order of compat functions To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.38.4.1 src/sys/compat/common/vfs_syscalls_30.c cvs rdiff -u -r1.64.4.1 -r1.64.4.2 src/sys/compat/common/vfs_syscalls_43.c cvs rdiff -u -r1.23.2.1 -r1.23.2.2 src/sys/compat/common/vfs_syscalls_50.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/compat/common/vfs_syscalls_30.c diff -u src/sys/compat/common/vfs_syscalls_30.c:1.38 src/sys/compat/common/vfs_syscalls_30.c:1.38.4.1 --- src/sys/compat/common/vfs_syscalls_30.c:1.38 Sun Jan 27 02:08:39 2019 +++ src/sys/compat/common/vfs_syscalls_30.c Sun Aug 15 09:27:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls_30.c,v 1.38 2019/01/27 02:08:39 pgoyette Exp $ */ +/* $NetBSD: vfs_syscalls_30.c,v 1.38.4.1 2021/08/15 09:27:50 martin Exp $ */ /*- * Copyright (c) 2005, 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.38 2019/01/27 02:08:39 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_30.c,v 1.38.4.1 2021/08/15 09:27:50 martin Exp $"); #if defined(_KERNEL_OPT) #include "opt_compat_netbsd.h" @@ -61,8 +61,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_syscalls #include #include -static void cvtstat(struct stat13 *, const struct stat *); - static const struct syscall_package vfs_syscalls_30_syscalls[] = { { SYS_compat_30___fhstat30, 0, (sy_call_t *)compat_30_sys___fhstat30 }, { SYS_compat_30___fstat13, 0, (sy_call_t *)compat_30_sys___fstat13 }, @@ -83,6 +81,8 @@ static void cvtstat(struct stat13 *ost, const struct stat *st) { + /* Handle any padding. */ + memset(ost, 0, sizeof(*ost)); ost->st_dev = st->st_dev; ost->st_ino = (uint32_t)st->st_ino; ost->st_mode = st->st_mode; @@ -121,8 +121,7 @@ compat_30_sys___stat13(struct lwp *l, if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, ub), sizeof(osb)); } @@ -146,8 +145,7 @@ compat_30_sys___lstat13(struct lwp *l, if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, ub), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, ub), sizeof(osb)); } /* ARGSUSED */ @@ -162,33 +160,12 @@ compat_30_sys_fhstat(struct lwp *l, struct stat sb; struct stat13 osb; int error; - struct compat_30_fhandle fh; - struct mount *mp; - struct vnode *vp; - - /* - * Must be super user - */ - if ((error = kauth_authorize_system(l->l_cred, KAUTH_SYSTEM_FILEHANDLE, - 0, NULL, NULL, NULL))) - return (error); - if ((error = copyin(SCARG(uap, fhp), &fh, sizeof(fh))) != 0) - return (error); - - if ((mp = vfs_getvfs(&fh.fh_fsid)) == NULL) - return (ESTALE); - if (mp->mnt_op->vfs_fhtovp == NULL) - return EOPNOTSUPP; - if ((error = VFS_FHTOVP(mp, (struct fid*)&fh.fh_fid, &vp))) - return (error); - error = vn_stat(vp, &sb); - vput(vp); + error = do_fhstat(l, SCARG(uap, fhp), sizeof(*SCARG(uap, fhp)), &sb); if (error) - return (error); + return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, sb), sizeof(sb)); - return (error); + return copyout(&osb, SCARG(uap, sb), sizeof(osb)); } /* @@ -211,8 +188,7 @@ compat_30_sys___fstat13(struct lwp *l, if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap, sb), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap, sb), sizeof(osb)); } /* @@ -289,7 +265,7 @@ again: bdp = (struct dirent *)inp; reclen = bdp->d_reclen; if (reclen & _DIRENT_ALIGN(bdp)) - panic("netbsd30_getdents: bad reclen %d", reclen); + panic("%s: bad reclen %d", __func__, reclen); if (cookie) off = *cookie++; /* each entry points to the next */ else @@ -393,9 +369,8 @@ compat_30_sys_getfh(struct lwp *l, const error = EINVAL; } if (error) - return (error); - error = copyout(&fh, SCARG(uap, fhp), sizeof(struct compat_30_fhandle)); - return (error); + return error; + return copyout(&fh, SCARG(uap, fhp), sizeof(fh)); } /* @@ -434,8 +409,7 @@ compat_30_sys___fhstat30(struct lwp *l, if (error) return error; cvtstat(&osb, &sb); - error = copyout(&osb, SCARG(uap_30, sb), sizeof (osb)); - return error; + return copyout(&osb, SCARG(uap_30, sb), sizeo
CVS commit: [netbsd-9] src/crypto/external/bsd/openssl/lib/libcrypto/arch
Module Name:src Committed By: martin Date: Sun Aug 15 08:58:56 UTC 2021 Modified Files: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips [netbsd-9]: aes.inc bn.inc crypto.inc poly1305.inc sha.inc src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc [netbsd-9]: bn.inc Added Files: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips [netbsd-9]: mips.inc Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1336): crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc: revision 1.1 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc: revision 1.2 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc: revision 1.7 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc: revision 1.5 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc: revision 1.8 crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc: revision 1.3 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc: revision 1.8 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc: revision 1.6 crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc: revision 1.7 Centralize the logic for endian and 64 bit availability. Handle the compat builds and both the n64 and non n64 variants PR/56318: Izumi Tsutsui: Limit bn-sparcv8.S to sparc64; breaks on sparcstation 2 (sun4c) PR/56318: Izumi Tsutsui: Don't include mips.S for 32 bit mips because it does not work for mips1 To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.4.1 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc cvs rdiff -u -r1.6 -r1.6.4.1 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc cvs rdiff -u -r1.7 -r1.7.2.1 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc cvs rdiff -u -r0 -r1.2.6.2 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/mips.inc cvs rdiff -u -r1.4 -r1.4.4.1 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/poly1305.inc cvs rdiff -u -r1.1.38.1 -r1.1.38.2 \ src/crypto/external/bsd/openssl/lib/libcrypto/arch/sparc/bn.inc Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5.4.1 --- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc:1.5 Fri Mar 9 21:49:55 2018 +++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/aes.inc Sun Aug 15 08:58:56 2021 @@ -1,7 +1,8 @@ -.if empty(MACHINE_ARCH:M*eb) +.include "mips.inc" +.if ${MIPS_LE} .PATH.S: ${.PARSEDIR} -#AES_SRCS = aes-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S +#AES_SRCS = aes-mips${MIPS_64}.S #AESCPPFLAGS = -DAES_ASM .endif Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6.4.1 --- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc:1.6 Fri Mar 9 21:49:55 2018 +++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/bn.inc Sun Aug 15 08:58:56 2021 @@ -1,7 +1,10 @@ -.if empty(MACHINE_ARCH:M*eb) +.include "mips.inc" + +# Don't include mips.S for 32 bit mips because it does not work for mips1 +.if ${MIPS_LE} && ${MIPS_64} == "64" .PATH.S: ${.PARSEDIR} -BN_SRCS = mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S +BN_SRCS = mips${MIPS_64}.S .endif .include "../../bn.inc" Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6.4.1 --- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc:1.6 Fri Mar 9 21:49:55 2018 +++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/sha.inc Sun Aug 15 08:58:56 2021 @@ -1,9 +1,12 @@ -.if empty(MACHINE_ARCH:M*eb) +.include "mips.inc" + +.if ${MIPS_LE} .PATH.S: ${.PARSEDIR} -SHA_SRCS += sha1-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S -SHA_SRCS += sha512-mips${"${COPTS:M*-mabi=64*}" == "":?:64}.S +SHA_SRCS += sha1-mips${MIPS_64}.S +SHA_SRCS += sha512-mips${MIPS_64}.S SHACPPFLAGS = -DSHA1_ASM .endif + .include "../../sha.inc" Index: src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc diff -u src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7 src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7.2.1 --- src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc:1.7 Mon Sep 24 11:03:40 2018 +++ src/crypto/external/bsd/openssl/lib/libcrypto/arch/mips/crypto.inc Sun A
CVS commit: [netbsd-9] src/distrib
Module Name:src Committed By: martin Date: Sun Aug 15 08:44:39 UTC 2021 Modified Files: src/distrib/sun2/miniroot [netbsd-9]: install.md src/distrib/sun3/miniroot [netbsd-9]: install.md Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1335): distrib/sun3/miniroot/install.md: revision 1.8 distrib/sun3/miniroot/install.md: revision 1.9 distrib/sun2/miniroot/install.md: revision 1.8 distrib/sun2/miniroot/install.md: revision 1.9 Don't try to add swap on miniroot. Check if /tmp is writable to see whether the rootdev is already mounted. Creating a dummy /tmp/root_writable file and after mountroot and checking it on the second installation could be problematic if users retry to installation after reboot without reinstalling miniroot. Taken from amiga. To generate a diff of this commit: cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/distrib/sun2/miniroot/install.md cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/distrib/sun3/miniroot/install.md Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/sun2/miniroot/install.md diff -u src/distrib/sun2/miniroot/install.md:1.5.2.1 src/distrib/sun2/miniroot/install.md:1.5.2.2 --- src/distrib/sun2/miniroot/install.md:1.5.2.1 Mon Dec 14 17:26:37 2020 +++ src/distrib/sun2/miniroot/install.md Sun Aug 15 08:44:39 2021 @@ -1,4 +1,4 @@ -# $NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $ +# $NetBSD: install.md,v 1.5.2.2 2021/08/15 08:44:39 martin Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -49,12 +49,10 @@ md_set_term() { md_makerootwritable() { # Just remount the root device read-write. - if [ ! -e /tmp/root_writable ]; then + if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then echo "Remounting root read-write..." mi_mount_kernfs mount -u -t ffs /kern/rootdev / - swapctl -a /kern/rootdev - cp /dev/null /tmp/root_writable fi } Index: src/distrib/sun3/miniroot/install.md diff -u src/distrib/sun3/miniroot/install.md:1.5.2.1 src/distrib/sun3/miniroot/install.md:1.5.2.2 --- src/distrib/sun3/miniroot/install.md:1.5.2.1 Mon Dec 14 17:26:37 2020 +++ src/distrib/sun3/miniroot/install.md Sun Aug 15 08:44:39 2021 @@ -1,4 +1,4 @@ -# $NetBSD: install.md,v 1.5.2.1 2020/12/14 17:26:37 martin Exp $ +# $NetBSD: install.md,v 1.5.2.2 2021/08/15 08:44:39 martin Exp $ # # # Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -49,12 +49,10 @@ md_set_term() { md_makerootwritable() { # Just remount the root device read-write. - if [ ! -e /tmp/root_writable ]; then + if ! cp /dev/null /tmp/.root_writable >/dev/null 2>&1; then echo "Remounting root read-write..." mi_mount_kernfs mount -u /kern/rootdev / - swapctl -a /kern/rootdev - cp /dev/null /tmp/root_writable fi }
CVS commit: [netbsd-9] src/distrib/notes/hp300
Module Name:src Committed By: martin Date: Sun Aug 15 08:41:47 UTC 2021 Modified Files: src/distrib/notes/hp300 [netbsd-9]: hardware Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1334): distrib/notes/hp300/hardware: revision 1.25 distrib/notes/hp300/hardware: revision 1.26 HP9000/360 can have up to 16 MB RAM, not 48 MB. Per Service Information Manual HP 9000 Series 300 Computers Models 360/370. Mention that emulated disks by HPDisk and HPDrive work. Also add more HP-IB disk models per recent changes. To generate a diff of this commit: cvs rdiff -u -r1.20.14.1 -r1.20.14.2 src/distrib/notes/hp300/hardware 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/hp300/hardware diff -u src/distrib/notes/hp300/hardware:1.20.14.1 src/distrib/notes/hp300/hardware:1.20.14.2 --- src/distrib/notes/hp300/hardware:1.20.14.1 Mon Dec 28 20:15:16 2020 +++ src/distrib/notes/hp300/hardware Sun Aug 15 08:41:47 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: hardware,v 1.20.14.1 2020/12/28 20:15:16 martin Exp $ +.\" $NetBSD: hardware,v 1.20.14.2 2021/08/15 08:41:47 martin Exp $ . .Nx*M \*V will run on most HP 9000/300- and 400-series machines. @@ -31,7 +31,7 @@ CPUs .br .Em "Requires Human Interface board" .It -360 (25 MHz 68030, with 4 MB RAM built-in, up to 48 MB RAM) +360 (25 MHz 68030, with 4 MB RAM built-in, up to 16 MB RAM) .br .Em "Requires System Interface board" .It @@ -73,8 +73,14 @@ up to 128 MB RAM) HP-IB devices .(bullet -compact .Em rd ; -CS80 disks: 2200, 2203, 7912, 7914, 7933, 7936, 7937, 7945, 7946, -7957, 7958, and 7959 +CS80 disks: 2200, 2202, 2203, 7908, 7911, 7912, 7914, 7933, 7936, 7937, 7941, +7945, 7946, 7957, 7958, and 7959 +.br +.Em "Emulated CS80 disks by" +.Lk http://www.dalton.ax/hpdisk/ HPDisk +.Em and +.Lk https://www.hp9845.net/9845/projects/hpdrive/ HPDrive +.Em "also work." .It .Em rd ; CS80 floppy disks: 9122, 9134 (possibly others)
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: martin Date: Thu Aug 12 15:06:39 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi Log Message: add directory for debug data for mkdep tests To generate a diff of this commit: cvs rdiff -u -r1.1110 -r1. 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.1110 src/distrib/sets/lists/tests/mi:1. --- src/distrib/sets/lists/tests/mi:1.1110 Wed Aug 11 20:42:26 2021 +++ src/distrib/sets/lists/tests/mi Thu Aug 12 15:06:39 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1110 2021/08/11 20:42:26 rillig Exp $ +# $NetBSD: mi,v 1. 2021/08/12 15:06:39 martin Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -197,6 +197,7 @@ ./usr/libdata/debug/usr/tests/usr.bin tests-usr.bin-debug compattestfile,atf ./usr/libdata/debug/usr/tests/usr.bin/cpio tests-usr.bin-debug compattestfile,atf ./usr/libdata/debug/usr/tests/usr.bin/id tests-usr.bin-debug compattestfile,atf +./usr/libdata/debug/usr/tests/usr.bin/mkdep tests-usr.bin-debug compattestfile,atf ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify tests-usr.bin-debug compattestfile,atf ./usr/libdata/debug/usr/tests/usr.bin/tar tests-usr.bin-debug compattestfile,atf ./usr/libdata/debug/usr/tests/usr.sbin tests-usr.sbin-debug compattestfile,atf
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: martin Date: Thu Aug 12 13:27:42 UTC 2021 Modified Files: src/distrib/sets/lists/debug: mi Log Message: h_findcc.debug is not obsolete To generate a diff of this commit: cvs rdiff -u -r1.358 -r1.359 src/distrib/sets/lists/debug/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/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.358 src/distrib/sets/lists/debug/mi:1.359 --- src/distrib/sets/lists/debug/mi:1.358 Thu Aug 12 12:51:25 2021 +++ src/distrib/sets/lists/debug/mi Thu Aug 12 13:27:42 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.358 2021/08/12 12:51:25 martin Exp $ +# $NetBSD: mi,v 1.359 2021/08/12 13:27:42 martin Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2487,10 +2487,10 @@ ./usr/libdata/debug/usr/tests/syscall/t_unlink.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/usr.bin/cpio/h_cpio.debug tests-usr.bin-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/usr.bin/id/h_id.debug tests-usr.bin-debug debug,atf,compattestfile +./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug tests-usr.bin-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug tests-usr.bin-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/util/df/h_df.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/id/h_id.debug tests-obsolete obsolete,compattestfile -./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug tests-obsolete obsolete,compattestfile ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a comp-c-debuglib atf,debuglib,compattestfile ./var/db/obsolete/debugbase-sys-root debug
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: martin Date: Thu Aug 12 12:51:25 UTC 2021 Modified Files: src/distrib/sets/lists/debug: mi Log Message: oops, fix h_findcc entry To generate a diff of this commit: cvs rdiff -u -r1.357 -r1.358 src/distrib/sets/lists/debug/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/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.357 src/distrib/sets/lists/debug/mi:1.358 --- src/distrib/sets/lists/debug/mi:1.357 Thu Aug 12 11:57:07 2021 +++ src/distrib/sets/lists/debug/mi Thu Aug 12 12:51:25 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.357 2021/08/12 11:57:07 martin Exp $ +# $NetBSD: mi,v 1.358 2021/08/12 12:51:25 martin Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2490,7 +2490,7 @@ ./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug tests-usr.bin-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/util/df/h_df.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/id/h_id.debug tests-obsolete obsolete,compattestfile -./usr/tests/usr.bin/mkdep/h_findcc.debugtests-obsolete obsolete,compattestfile +./usr/libdata/debug/usr/tests/usr.bin/mkdep/h_findcc.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug tests-obsolete obsolete,compattestfile ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a comp-c-debuglib atf,debuglib,compattestfile ./var/db/obsolete/debugbase-sys-root debug
CVS commit: src/distrib/sets/lists/debug
Module Name:src Committed By: martin Date: Thu Aug 12 11:57:07 UTC 2021 Modified Files: src/distrib/sets/lists/debug: mi Log Message: Add new mkdep test helper h_findcc To generate a diff of this commit: cvs rdiff -u -r1.356 -r1.357 src/distrib/sets/lists/debug/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/debug/mi diff -u src/distrib/sets/lists/debug/mi:1.356 src/distrib/sets/lists/debug/mi:1.357 --- src/distrib/sets/lists/debug/mi:1.356 Wed Jul 14 03:19:24 2021 +++ src/distrib/sets/lists/debug/mi Thu Aug 12 11:57:07 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.356 2021/07/14 03:19:24 ozaki-r Exp $ +# $NetBSD: mi,v 1.357 2021/08/12 11:57:07 martin Exp $ ./etc/mtree/set.debug comp-sys-root ./usr/lib comp-sys-usr compatdir ./usr/lib/i18n/libBIG5_g.a comp-c-debuglib debuglib,compatfile @@ -2490,6 +2490,7 @@ ./usr/libdata/debug/usr/tests/usr.bin/tar/h_tar.debug tests-usr.bin-debug debug,atf,compattestfile ./usr/libdata/debug/usr/tests/util/df/h_df.debug tests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/id/h_id.debug tests-obsolete obsolete,compattestfile +./usr/tests/usr.bin/mkdep/h_findcc.debugtests-obsolete obsolete,compattestfile ./usr/libdata/debug/usr/tests/util/systrace/h_have_systrace.debug tests-obsolete obsolete,compattestfile ./usr/tests/lib/libc/tls/libh_tls_dynamic_g.a comp-c-debuglib atf,debuglib,compattestfile ./var/db/obsolete/debugbase-sys-root debug
CVS commit: src/etc/mtree
Module Name:src Committed By: martin Date: Thu Aug 12 11:50:42 UTC 2021 Modified Files: src/etc/mtree: NetBSD.dist.tests Log Message: Add directory for new mkdep test binaries To generate a diff of this commit: cvs rdiff -u -r1.186 -r1.187 src/etc/mtree/NetBSD.dist.tests Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/mtree/NetBSD.dist.tests diff -u src/etc/mtree/NetBSD.dist.tests:1.186 src/etc/mtree/NetBSD.dist.tests:1.187 --- src/etc/mtree/NetBSD.dist.tests:1.186 Thu Aug 5 22:36:07 2021 +++ src/etc/mtree/NetBSD.dist.tests Thu Aug 12 11:50:42 2021 @@ -1,4 +1,4 @@ -# $NetBSD: NetBSD.dist.tests,v 1.186 2021/08/05 22:36:07 rillig Exp $ +# $NetBSD: NetBSD.dist.tests,v 1.187 2021/08/12 11:50:42 martin Exp $ ./usr/libdata/debug/usr/tests ./usr/libdata/debug/usr/tests/atf @@ -177,6 +177,7 @@ ./usr/libdata/debug/usr/tests/usr.bin/cpio ./usr/libdata/debug/usr/tests/usr.bin/id ./usr/libdata/debug/usr/tests/usr.bin/tar +./usr/libdata/debug/usr/tests/usr.bin/mkdep ./usr/libdata/debug/usr/tests/usr.bin/netpgpverify ./usr/libdata/debug/usr/tests/usr.sbin ./usr/tests
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Thu Aug 12 09:33:59 UTC 2021 Modified Files: src/usr.sbin/sysinst: defs.h disks.c upgrade.c Log Message: PR 56354: all actions to set up swap space are not guaranteed to gain us enough virtual memory anyway, so drop return codes from set_swap*. The state for cleanup (which swap dev to unuse) has been made global some time ago anyway. Previously use of the return values was inconsistent. Error reporting will only confuse users and sometimes the situation is hard to fix or even impossible (like in miniroots copide to swap space for booting). To generate a diff of this commit: cvs rdiff -u -r1.71 -r1.72 src/usr.sbin/sysinst/defs.h cvs rdiff -u -r1.74 -r1.75 src/usr.sbin/sysinst/disks.c cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/sysinst/upgrade.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/sysinst/defs.h diff -u src/usr.sbin/sysinst/defs.h:1.71 src/usr.sbin/sysinst/defs.h:1.72 --- src/usr.sbin/sysinst/defs.h:1.71 Tue Jul 13 09:13:00 2021 +++ src/usr.sbin/sysinst/defs.h Thu Aug 12 09:33:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.71 2021/07/13 09:13:00 martin Exp $ */ +/* $NetBSD: defs.h,v 1.72 2021/08/12 09:33:59 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -713,13 +713,8 @@ void disp_cur_fspart(int, int); int make_filesystems(struct install_partition_desc *); int make_fstab(struct install_partition_desc *); int mount_disks(struct install_partition_desc *); -/* - * set_swap_if_low_ram and set_swap return -1 on error, - * 0 if no swap was added on purpose and - * 1 if swap has been added (and needs to be cleared later). - */ -int set_swap_if_low_ram(struct install_partition_desc *); -int set_swap(struct install_partition_desc *); +void set_swap_if_low_ram(struct install_partition_desc *); +void set_swap(struct install_partition_desc *); void clear_swap(void); int check_swap(const char *, int); char *bootxx_name(struct install_partition_desc *); Index: src/usr.sbin/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.74 src/usr.sbin/sysinst/disks.c:1.75 --- src/usr.sbin/sysinst/disks.c:1.74 Sun Aug 8 21:50:10 2021 +++ src/usr.sbin/sysinst/disks.c Thu Aug 12 09:33:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.74 2021/08/08 21:50:10 andvar Exp $ */ +/* $NetBSD: disks.c,v 1.75 2021/08/12 09:33:59 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1921,16 +1921,15 @@ mount_disks(struct install_partition_des static char swap_dev[PATH_MAX]; -int +void set_swap_if_low_ram(struct install_partition_desc *install) { swap_dev[0] = 0; if (get_ramsize() <= TINY_RAM_SIZE) - return set_swap(install); - return 0; + set_swap(install); } -int +void set_swap(struct install_partition_desc *install) { size_t i; @@ -1942,20 +1941,16 @@ set_swap(struct install_partition_desc * break; } if (i >= install->num) - return 0; + return; if (!install->infos[i].parts->pscheme->get_part_device( install->infos[i].parts, install->infos[i].cur_part_id, swap_dev, sizeof swap_dev, NULL, plain_name, true, true)) - return -1; + return; rval = swapctl(SWAP_ON, swap_dev, 0); - if (rval != 0) { + if (rval != 0) swap_dev[0] = 0; - return -1; - } - - return 1; } void Index: src/usr.sbin/sysinst/upgrade.c diff -u src/usr.sbin/sysinst/upgrade.c:1.17 src/usr.sbin/sysinst/upgrade.c:1.18 --- src/usr.sbin/sysinst/upgrade.c:1.17 Wed Nov 4 14:29:40 2020 +++ src/usr.sbin/sysinst/upgrade.c Thu Aug 12 09:33:59 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: upgrade.c,v 1.17 2020/11/04 14:29:40 martin Exp $ */ +/* $NetBSD: upgrade.c,v 1.18 2021/08/12 09:33:59 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -81,8 +81,7 @@ do_upgrade(void) install.cur_system = true; } - if (set_swap_if_low_ram(&install) < 0) - return; + set_swap_if_low_ram(&install); if (md_pre_update(&install) < 0) goto free_install;
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Wed Aug 11 17:25:54 UTC 2021 Modified Files: src/doc [netbsd-8]: CHANGES-8.3 Log Message: Ticket #1690 To generate a diff of this commit: cvs rdiff -u -r1.1.2.94 -r1.1.2.95 src/doc/CHANGES-8.3 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.3 diff -u src/doc/CHANGES-8.3:1.1.2.94 src/doc/CHANGES-8.3:1.1.2.95 --- src/doc/CHANGES-8.3:1.1.2.94 Wed Jul 14 17:55:18 2021 +++ src/doc/CHANGES-8.3 Wed Aug 11 17:25:54 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.3,v 1.1.2.94 2021/07/14 17:55:18 martin Exp $ +# $NetBSD: CHANGES-8.3,v 1.1.2.95 2021/08/11 17:25:54 martin Exp $ A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3 release: @@ -1988,3 +1988,9 @@ sys/arch/hppa/dev/sti_sgc.c 1.3 PR 52162: Fix silent freeze on probing sti(4) framebuffer on 712/60. [tsutsui, ticket #1689] +sys/netinet6/in6_src.c1.88 + + PR 56348: MTU discovery fails with IPv6 sockets bound to IPv4 + mapped address. + [kardel, ticket #1690] +
CVS commit: [netbsd-8] src/sys/netinet6
Module Name:src Committed By: martin Date: Wed Aug 11 17:24:43 UTC 2021 Modified Files: src/sys/netinet6 [netbsd-8]: in6_src.c Log Message: Pull up following revision(s) (requested by kardel in ticket #1690): sys/netinet6/in6_src.c: revision 1.88 PR kern/56348 MTU discovery fails with IPv6 sockets bound to IPv4 mapped address pick up the IPv4 route for IPv4 mapped IPv6 address to get the correct MTU and not any unrelated/inappropriate MTU from IPv6 routes. IPv4 mapped IPv6 addresses are always handled by the IPv4 stack and MTU discovery is solely handled with the IPv4 routing table. To generate a diff of this commit: cvs rdiff -u -r1.79.6.2 -r1.79.6.3 src/sys/netinet6/in6_src.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/netinet6/in6_src.c diff -u src/sys/netinet6/in6_src.c:1.79.6.2 src/sys/netinet6/in6_src.c:1.79.6.3 --- src/sys/netinet6/in6_src.c:1.79.6.2 Sun Dec 10 09:24:30 2017 +++ src/sys/netinet6/in6_src.c Wed Aug 11 17:24:42 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_src.c,v 1.79.6.2 2017/12/10 09:24:30 snj Exp $ */ +/* $NetBSD: in6_src.c,v 1.79.6.3 2021/08/11 17:24:42 martin Exp $ */ /* $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $ */ /* @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.79.6.2 2017/12/10 09:24:30 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.79.6.3 2021/08/11 17:24:42 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -608,6 +608,7 @@ in6_selectroute(struct sockaddr_in6 *dst struct rtentry *rt = NULL; union { struct sockaddr dst; + struct sockaddr_in dst4; struct sockaddr_in6 dst6; } u; @@ -674,9 +675,17 @@ in6_selectroute(struct sockaddr_in6 *dst * Use a cached route if it exists and is valid, else try to allocate * a new one. Note that we should check the address family of the * cached destination, in case of sharing the cache with IPv4. + * + * for V4 mapped addresses we want to pick up the v4 route + * see PR kern/56348 */ - u.dst6 = *dstsock; - u.dst6.sin6_scope_id = 0; + if (IN6_IS_ADDR_V4MAPPED(&dstsock->sin6_addr)) { + in6_sin6_2_sin(&u.dst4, dstsock); + } else { + u.dst6 = *dstsock; + u.dst6.sin6_scope_id = 0; + } + rt = rtcache_lookup1(*ro, &u.dst, 1); if (rt == NULL)
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Wed Aug 11 17:23:19 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1330 - #1332 To generate a diff of this commit: cvs rdiff -u -r1.1.2.20 -r1.1.2.21 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.20 src/doc/CHANGES-9.3:1.1.2.21 --- src/doc/CHANGES-9.3:1.1.2.20 Sun Aug 8 10:23:51 2021 +++ src/doc/CHANGES-9.3 Wed Aug 11 17:23:19 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.20 2021/08/08 10:23:51 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.21 2021/08/11 17:23:19 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -463,3 +463,102 @@ sys/external/bsd/compiler_rt/dist/lib/bu arm: align stack pointer to 8-byte boundary as required by EABI. [skrll, ticket #1329] +common/lib/libc/arch/arm/atomic/atomic_add_16.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_add_32.S 1.9,1.10 +common/lib/libc/arch/arm/atomic/atomic_add_64.S 1.13,1.14 +common/lib/libc/arch/arm/atomic/atomic_add_8.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_and_16.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_and_32.S 1.9,1.10 +common/lib/libc/arch/arm/atomic/atomic_and_64.S 1.12,1.13 +common/lib/libc/arch/arm/atomic/atomic_and_8.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_cas_16.S 1.3 +common/lib/libc/arch/arm/atomic/atomic_cas_32.S 1.8 +common/lib/libc/arch/arm/atomic/atomic_cas_64.S 1.12 +common/lib/libc/arch/arm/atomic/atomic_cas_8.S 1.9 +common/lib/libc/arch/arm/atomic/atomic_cas_up.S 1.8 +common/lib/libc/arch/arm/atomic/atomic_dec_32.S 1.6 +common/lib/libc/arch/arm/atomic/atomic_dec_32.S 1.7 +common/lib/libc/arch/arm/atomic/atomic_dec_64.S 1.8,1.9 +common/lib/libc/arch/arm/atomic/atomic_inc_32.S 1.8,1.9 +common/lib/libc/arch/arm/atomic/atomic_inc_64.S 1.10,1.11 +common/lib/libc/arch/arm/atomic/atomic_nand_16.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_nand_32.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_nand_64.S 1.6,1.7 +common/lib/libc/arch/arm/atomic/atomic_nand_8.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_op_asm.h 1.9,1.10 +common/lib/libc/arch/arm/atomic/atomic_or_16.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_or_32.S 1.9,1.10 +common/lib/libc/arch/arm/atomic/atomic_or_64.S 1.13,1.14 +common/lib/libc/arch/arm/atomic/atomic_or_8.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_sub_64.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_swap.S 1.18,1.19 +common/lib/libc/arch/arm/atomic/atomic_swap_16.S 1.6,1.7 +common/lib/libc/arch/arm/atomic/atomic_swap_64.S 1.14 +common/lib/libc/arch/arm/atomic/atomic_xor_16.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_xor_32.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/atomic_xor_64.S 1.6,1.7 +common/lib/libc/arch/arm/atomic/atomic_xor_8.S 1.4,1.5 +common/lib/libc/arch/arm/atomic/membar_ops.S 1.8,1.9 +common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_1.S 1.4 +common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_2.S 1.4 +common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_4.S 1.4 +common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_8.S 1.5 +common/lib/libc/arch/arm/atomic/sync_fetch_and_add_8.S 1.6 +common/lib/libc/arch/arm/atomic/sync_fetch_and_and_8.S 1.6 +common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S 1.6 +common/lib/libc/arch/arm/atomic/sync_fetch_and_or_8.S 1.6 +common/lib/libc/arch/arm/atomic/sync_fetch_and_sub_8.S 1.6 +common/lib/libc/arch/arm/atomic/sync_fetch_and_xor_8.S 1.6 + + arm: various fixes for atomic ops. + [skrll, ticket #1330] + +common/lib/libc/arch/aarch64/atomic/atomic_add_16.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_add_32.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_add_64.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_add_8.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_and_16.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_and_32.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_and_64.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_and_8.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S 1.2,1.4 +common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S 1.2,1.4 +common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S 1.4,1.6 +common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S 1.2,1.4 +common/lib/libc/arch/aarch64/atomic/atomic_dec_32.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_dec_64.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_inc_32.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_inc_64.S 1.2 +common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S 1.2,1.5 +common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S 1.2,1.5 +common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S 1.2,1.5 +common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S 1.2,1.5 +common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h 1.5 +common/lib/libc/arch/aarch64/atomic/atomic_op_as
CVS commit: [netbsd-9] src/sys/netinet6
Module Name:src Committed By: martin Date: Wed Aug 11 17:22:17 UTC 2021 Modified Files: src/sys/netinet6 [netbsd-9]: in6_src.c Log Message: Pull up following revision(s) (requested by kardel in ticket #1332): sys/netinet6/in6_src.c: revision 1.88 PR kern/56348 MTU discovery fails with IPv6 sockets bound to IPv4 mapped address pick up the IPv4 route for IPv4 mapped IPv6 address to get the correct MTU and not any unrelated/inappropriate MTU from IPv6 routes. IPv4 mapped IPv6 addresses are always handled by the IPv4 stack and MTU discovery is solely handled with the IPv4 routing table. To generate a diff of this commit: cvs rdiff -u -r1.85 -r1.85.6.1 src/sys/netinet6/in6_src.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/netinet6/in6_src.c diff -u src/sys/netinet6/in6_src.c:1.85 src/sys/netinet6/in6_src.c:1.85.6.1 --- src/sys/netinet6/in6_src.c:1.85 Tue May 1 07:21:39 2018 +++ src/sys/netinet6/in6_src.c Wed Aug 11 17:22:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: in6_src.c,v 1.85 2018/05/01 07:21:39 maxv Exp $ */ +/* $NetBSD: in6_src.c,v 1.85.6.1 2021/08/11 17:22:17 martin Exp $ */ /* $KAME: in6_src.c,v 1.159 2005/10/19 01:40:32 t-momose Exp $ */ /* @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.85 2018/05/01 07:21:39 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: in6_src.c,v 1.85.6.1 2021/08/11 17:22:17 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -612,6 +612,7 @@ in6_selectroute(struct sockaddr_in6 *dst struct rtentry *rt = NULL; union { struct sockaddr dst; + struct sockaddr_in dst4; struct sockaddr_in6 dst6; } u; @@ -678,9 +679,17 @@ in6_selectroute(struct sockaddr_in6 *dst * Use a cached route if it exists and is valid, else try to allocate * a new one. Note that we should check the address family of the * cached destination, in case of sharing the cache with IPv4. + * + * for V4 mapped addresses we want to pick up the v4 route + * see PR kern/56348 */ - u.dst6 = *dstsock; - u.dst6.sin6_scope_id = 0; + if (IN6_IS_ADDR_V4MAPPED(&dstsock->sin6_addr)) { + in6_sin6_2_sin(&u.dst4, dstsock); + } else { + u.dst6 = *dstsock; + u.dst6.sin6_scope_id = 0; + } + rt = rtcache_lookup1(*ro, &u.dst, 1); if (rt == NULL)
CVS commit: [netbsd-9] src/common/lib/libc/arch/aarch64/atomic
Module Name:src Committed By: martin Date: Wed Aug 11 17:19:01 UTC 2021 Modified Files: src/common/lib/libc/arch/aarch64/atomic [netbsd-9]: atomic_add_16.S atomic_add_32.S atomic_add_64.S atomic_add_8.S atomic_and_16.S atomic_and_32.S atomic_and_64.S atomic_and_8.S atomic_cas_16.S atomic_cas_32.S atomic_cas_64.S atomic_cas_8.S atomic_dec_32.S atomic_dec_64.S atomic_inc_32.S atomic_inc_64.S atomic_nand_16.S atomic_nand_32.S atomic_nand_64.S atomic_nand_8.S atomic_op_asm.h atomic_or_16.S atomic_or_32.S atomic_or_64.S atomic_or_8.S atomic_sub_16.S atomic_sub_32.S atomic_sub_64.S atomic_sub_8.S atomic_swap_16.S atomic_swap_32.S atomic_swap_64.S atomic_swap_8.S atomic_xor_16.S atomic_xor_32.S atomic_xor_64.S atomic_xor_8.S membar_ops.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1331): common/lib/libc/arch/aarch64/atomic/atomic_add_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_sub_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_sub_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_swap_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_swap_64.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_inc_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_or_64.S: revision 1.3 common/lib/libc/arch/aarch64/atomic/atomic_and_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_xor_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_and_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_add_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_swap_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_op_asm.h: revision 1.6 common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_sub_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_64.S: revision 1.6 common/lib/libc/arch/aarch64/atomic/atomic_swap_8.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_sub_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_swap_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_swap_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_xor_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_swap_32.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_or_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_swap_16.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_or_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_or_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_xor_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_16.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/atomic_add_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_xor_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_dec_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_32.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/atomic_add_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_cas_8.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/membar_ops.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S: revision 1.5 common/lib/libc/arch/aarch64/atomic/atomic_inc_64.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_dec_32.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_and_8.S: revision 1.2 common/lib/libc/arch/aarch64/atomic/atomic_and_64.S: revision 1.2 Part I of ad@'s performance improvements for aarch64 - Remove memory barriers from the atomic ops. I don't understand why thos= e are there. Is it some architectural thing, or for a CPU bug, or just over-caution maybe? They're not needed for correc
CVS commit: [netbsd-9] src/common/lib/libc/arch/arm/atomic
Module Name:src Committed By: martin Date: Wed Aug 11 17:05:42 UTC 2021 Modified Files: src/common/lib/libc/arch/arm/atomic [netbsd-9]: atomic_add_16.S atomic_add_32.S atomic_add_64.S atomic_add_8.S atomic_and_16.S atomic_and_32.S atomic_and_64.S atomic_and_8.S atomic_cas_16.S atomic_cas_32.S atomic_cas_64.S atomic_cas_8.S atomic_cas_up.S atomic_dec_32.S atomic_dec_64.S atomic_inc_32.S atomic_inc_64.S atomic_nand_16.S atomic_nand_32.S atomic_nand_64.S atomic_nand_8.S atomic_op_asm.h atomic_or_16.S atomic_or_32.S atomic_or_64.S atomic_or_8.S atomic_sub_64.S atomic_swap.S atomic_swap_16.S atomic_swap_64.S atomic_xor_16.S atomic_xor_32.S atomic_xor_64.S atomic_xor_8.S membar_ops.S sync_bool_compare_and_swap_1.S sync_bool_compare_and_swap_2.S sync_bool_compare_and_swap_4.S sync_bool_compare_and_swap_8.S sync_fetch_and_add_8.S sync_fetch_and_and_8.S sync_fetch_and_nand_8.S sync_fetch_and_or_8.S sync_fetch_and_sub_8.S sync_fetch_and_xor_8.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1330): common/lib/libc/arch/arm/atomic/atomic_swap.S: revision 1.18 common/lib/libc/arch/arm/atomic/atomic_and_16.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_swap.S: revision 1.19 common/lib/libc/arch/arm/atomic/atomic_xor_64.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_inc_32.S: revision 1.8 common/lib/libc/arch/arm/atomic/atomic_and_32.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_add_8.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_xor_64.S: revision 1.7 common/lib/libc/arch/arm/atomic/atomic_inc_32.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_cas_up.S: revision 1.8 common/lib/libc/arch/arm/atomic/atomic_add_8.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_op_asm.h: revision 1.9 common/lib/libc/arch/arm/atomic/membar_ops.S: revision 1.8 common/lib/libc/arch/arm/atomic/membar_ops.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_op_asm.h: revision 1.10 common/lib/libc/arch/arm/atomic/atomic_and_32.S: revision 1.10 common/lib/libc/arch/arm/atomic/atomic_cas_16.S: revision 1.3 common/lib/libc/arch/arm/atomic/sync_fetch_and_and_8.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_xor_32.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_xor_32.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_nand_64.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_xor_16.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_swap_16.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_nand_64.S: revision 1.7 common/lib/libc/arch/arm/atomic/atomic_cas_32.S: revision 1.8 common/lib/libc/arch/arm/atomic/atomic_xor_16.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_swap_16.S: revision 1.7 common/lib/libc/arch/arm/atomic/atomic_add_32.S: revision 1.10 common/lib/libc/arch/arm/atomic/sync_fetch_and_add_8.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_dec_64.S: revision 1.8 common/lib/libc/arch/arm/atomic/atomic_add_16.S: revision 1.4 common/lib/libc/arch/arm/atomic/sync_fetch_and_sub_8.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_xor_8.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_dec_64.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_add_16.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_xor_8.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_or_64.S: revision 1.13 common/lib/libc/arch/arm/atomic/atomic_add_32.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_or_64.S: revision 1.14 common/lib/libc/arch/arm/atomic/atomic_or_16.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_or_16.S: revision 1.5 common/lib/libc/arch/arm/atomic/sync_fetch_and_nand_8.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_nand_16.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_nand_16.S: revision 1.5 common/lib/libc/arch/arm/atomic/sync_fetch_and_or_8.S: revision 1.6 common/lib/libc/arch/arm/atomic/atomic_nand_32.S: revision 1.4 common/lib/libc/arch/arm/atomic/atomic_or_32.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_nand_32.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_cas_8.S: revision 1.9 common/lib/libc/arch/arm/atomic/atomic_inc_64.S: revision 1.10 common/lib/libc/arch/arm/atomic/atomic_inc_64.S: revision 1.11 common/lib/libc/arch/arm/atomic/atomic_cas_64.S: revision 1.12 common/lib/libc/arch/arm/atomic/sync_bool_compare_and_swap_8.S: revision 1.5 common/lib/libc/arc
CVS commit: src/sbin/devpubd/hooks
Module Name:src Committed By: martin Date: Sun Aug 8 10:48:35 UTC 2021 Modified Files: src/sbin/devpubd/hooks: 02-wedgenames Log Message: Fix obvious editor mishap in previous To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sbin/devpubd/hooks/02-wedgenames Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sbin/devpubd/hooks/02-wedgenames diff -u src/sbin/devpubd/hooks/02-wedgenames:1.7 src/sbin/devpubd/hooks/02-wedgenames:1.8 --- src/sbin/devpubd/hooks/02-wedgenames:1.7 Thu Aug 5 12:52:47 2021 +++ src/sbin/devpubd/hooks/02-wedgenames Sun Aug 8 10:48:35 2021 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: 02-wedgenames,v 1.7 2021/08/05 12:52:47 kre Exp $ +# $NetBSD: 02-wedgenames,v 1.8 2021/08/08 10:48:35 martin Exp $ # # Try to maintain symlinks to wedge devices # @@ -160,4 +160,4 @@ for device do esac ;; esac -ce-attach +done
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Sun Aug 8 10:23:51 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1327 - #1329 To generate a diff of this commit: cvs rdiff -u -r1.1.2.19 -r1.1.2.20 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.19 src/doc/CHANGES-9.3:1.1.2.20 --- src/doc/CHANGES-9.3:1.1.2.19 Tue Aug 3 16:14:21 2021 +++ src/doc/CHANGES-9.3 Sun Aug 8 10:23:51 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.19 2021/08/03 16:14:21 snj Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.20 2021/08/08 10:23:51 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -394,3 +394,72 @@ share/man/man4/man4.x86/amdccp.4 1.1 Add a man page for amdccp(4) [nia, ticket #1326] +sys/external/bsd/drm2/linux/linux_reservation.c 1.13,1.14 + + drm: fix more drm memory leaks. + [riastradh, ticket #1327] + +lib/libc/compiler_rt/Makefile.inc 1.40 +lib/libm/compiler_rt/Makefile.inc 1.11 +sys/external/bsd/compiler_rt/abi.mk 1.1 +sys/external/bsd/compiler_rt/dist/lib/builtins/adddf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/addsf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cdcmpeq_check_nan.c 1.2 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c 1.2 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_div0.c 1.2 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_drsub.c 1.2 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c 1.2 +sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/comparedf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/divsf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/extendsfdf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfdi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfdi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixsfsi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfdi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfdi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/fixunssfsi.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c 1.3-1.5 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatdisf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatundidf.c 1.3,1.4 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatundisf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h 1.2-1.6 +sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/muldi3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/mulsf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/negdf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/subsf3.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/truncsfhf2.c 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/udivsi3.c 1.2,1.3 +sys/lib/libkern/Makefile.compiler-rt 1.13 + + arm: PR 55897: fix various complex arithmetics issues by cherry + picking the relevant upstream changes. + [skrll, ticket #1328] + +lib/libc/arch/arm/gen/swapcontext.S 1.16-1.18 +lib/libc/arch/arm/sys/__clone.S 1.10-1.14 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S 1.2,1.3 +sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S 1.2,1.3 + + arm: align stack pointer to 8-byte boundary as required by EABI. + [skrll, ticket #1329] +
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Sun Aug 8 10:22:04 UTC 2021 Modified Files: src/lib/libc/arch/arm/gen [netbsd-9]: swapcontext.S src/lib/libc/arch/arm/sys [netbsd-9]: __clone.S src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm [netbsd-9]: aeabi_cfcmp.S divmodsi4.S divsi3.S modsi3.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1329): lib/libc/arch/arm/gen/swapcontext.S: revision 1.18 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S: revision 1.3 lib/libc/arch/arm/sys/__clone.S: revision 1.10 lib/libc/arch/arm/sys/__clone.S: revision 1.11 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.2 lib/libc/arch/arm/sys/__clone.S: revision 1.12 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S: revision 1.3 lib/libc/arch/arm/sys/__clone.S: revision 1.13 lib/libc/arch/arm/sys/__clone.S: revision 1.14 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S: revision 1.3 lib/libc/arch/arm/gen/swapcontext.S: revision 1.16 lib/libc/arch/arm/gen/swapcontext.S: revision 1.17 Align sp to 8-byte boundary as required by EABI. This is especially important for non-leaf functions; GCC optimizes codes based on assumption that sp is aligned properly. Mostly fix broken earmv5 userland compiled by GCC10 due to alignment faults in ld.elf_so, where {ld,st}rd are used for [sp, #8x]. No regression for ATF is observed for earmv[67]{,hf}{,eb}. Align sp to 8-byte boundary as required by EABI. IIUC, this change only affects libc compiled for ``Thumb-mode userland'', which we've not officially supported yet. Fix previous. For Thumb-1: - sp cannot be manipulated directly - {add,sub}s should be used instead of {add,sub} Trailing whitespace The _INVOKE_CERROR macro deals with thumb so simplify the code (at the expense of a couple more instructions). Do previous differently by pushing even number of registers and remove strange r7 usage. Do previous differtly by pushing two registers in the same way as the _INVOKE_CERROR macro To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.2.1 src/lib/libc/arch/arm/gen/swapcontext.S cvs rdiff -u -r1.9 -r1.9.28.1 src/lib/libc/arch/arm/sys/__clone.S cvs rdiff -u -r1.1.1.1 -r1.1.1.1.26.1 \ src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmp.S cvs rdiff -u -r1.1.1.4 -r1.1.1.4.22.1 \ src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divmodsi4.S \ src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/divsi3.S \ src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm/modsi3.S 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/arch/arm/gen/swapcontext.S diff -u src/lib/libc/arch/arm/gen/swapcontext.S:1.15 src/lib/libc/arch/arm/gen/swapcontext.S:1.15.2.1 --- src/lib/libc/arch/arm/gen/swapcontext.S:1.15 Wed Nov 21 21:01:41 2018 +++ src/lib/libc/arch/arm/gen/swapcontext.S Sun Aug 8 10:22:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $ */ +/* $NetBSD: swapcontext.S,v 1.15.2.1 2021/08/08 10:22:04 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #include "assym.h" #if defined(LIBC_SCCS) && !defined(lint) -RCSID("$NetBSD: swapcontext.S,v 1.15 2018/11/21 21:01:41 skrll Exp $") +RCSID("$NetBSD: swapcontext.S,v 1.15.2.1 2021/08/08 10:22:04 martin Exp $") #endif /* LIBC_SCCS && !lint */ ENTRY(swapcontext) @@ -84,9 +84,9 @@ ENTRY(swapcontext) #if !defined(__thumb__) || defined(_ARM_ARCH_T2) b PLT_SYM(_C_LABEL(setcontext)) #else - push {lr} + push {r3, lr} bl PLT_SYM(_C_LABEL(setcontext)) - pop {pc} + pop {r3, pc} #endif #if defined(__ARM_EABI__) && defined(__UNWIND_TABLES__) .cfi_endproc Index: src/lib/libc/arch/arm/sys/__clone.S diff -u src/lib/libc/arch/arm/sys/__clone.S:1.9 src/lib/libc/arch/arm/sys/__clone.S:1.9.28.1 --- src/lib/libc/arch/arm/sys/__clone.S:1.9 Sat Nov 30 20:20:42 2013 +++ src/lib/libc/arch/arm/sys/__clone.S Sun Aug 8 10:22:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: __clone.S,v 1.9 2013/11/30 20:20:42 joerg Exp $ */ +/* $NetBSD: __clone.S,v 1.9.28.1 2021/08/08 10:22:04 martin Exp $ */ /* * Copyright (c) 2001 Christopher Gilbert @@ -55,21 +55,17 @@ ENTRY(__clone) /* place the func and its arg onto the child's stack */ #if !defined(__thumb__) || defined(_ARM_ARCH_T2) - stmfd r1!, {r0, r3} + stmfd r1!, {r0, r3} #else subs r1, r1, #8 - stmia r1!,
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Sun Aug 8 10:11:40 UTC 2021 Modified Files: src/lib/libc/compiler_rt [netbsd-9]: Makefile.inc src/lib/libm/compiler_rt [netbsd-9]: Makefile.inc src/sys/external/bsd/compiler_rt/dist/lib/builtins [netbsd-9]: adddf3.c addsf3.c ashldi3.c ashrdi3.c comparedf2.c comparesf2.c divdf3.c divsf3.c divsi3.c extendhfsf2.c extendsfdf2.c fixdfdi.c fixdfsi.c fixsfdi.c fixsfsi.c fixunsdfdi.c fixunsdfsi.c fixunssfdi.c fixunssfsi.c floatdidf.c floatdisf.c floatsidf.c floatsisf.c floatundidf.c floatundisf.c floatunsidf.c floatunsisf.c int_lib.h lshrdi3.c muldf3.c muldi3.c mulsf3.c negdf2.c negsf2.c subdf3.c subsf3.c truncdfhf2.c truncdfsf2.c truncsfhf2.c udivsi3.c src/sys/external/bsd/compiler_rt/dist/lib/builtins/arm [netbsd-9]: aeabi_cdcmpeq_check_nan.c aeabi_cfcmpeq_check_nan.c aeabi_div0.c aeabi_drsub.c aeabi_frsub.c src/sys/lib/libkern [netbsd-9]: Makefile.compiler-rt Added Files: src/sys/external/bsd/compiler_rt [netbsd-9]: abi.mk Log Message: Pull up following revision(s) (requested by skrll in ticket #1328): sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/negsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/muldf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfhf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.4 sys/external/bsd/compiler_rt/dist/lib/builtins/floatdidf.c: revision 1.5 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.2 sys/external/bsd/compiler_rt/abi.mk: revision 1.1 sys/external/bsd/compiler_rt/dist/lib/builtins/divdf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/comparesf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.4 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.5 sys/external/bsd/compiler_rt/dist/lib/builtins/ashrdi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/ashldi3.c: revision 1.3 sys/lib/libkern/Makefile.compiler-rt: revision 1.13 sys/external/bsd/compiler_rt/dist/lib/builtins/truncdfsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/subdf3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/int_lib.h: revision 1.6 sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/lshrdi3.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsisf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/extendhfsf2.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatunsidf.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixdfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/arm/aeabi_frsub.c: revision 1.2 lib/libm/compiler_rt/Makefile.inc: revision 1.11 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/floatsidf.c: revision 1.2 sys/external/bsd/compiler_rt/dist/lib/builtins/fixunsdfsi.c: revision 1.3 sys/external/bsd/compiler_rt/dist/lib/builtins/divsi3.c: revision 1.2 sys/external
CVS commit: [netbsd-9] src/sys/external/bsd/drm2/linux
Module Name:src Committed By: martin Date: Sun Aug 8 10:00:16 UTC 2021 Modified Files: src/sys/external/bsd/drm2/linux [netbsd-9]: linux_reservation.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1327): sys/external/bsd/drm2/linux/linux_reservation.c: revision 1.13 sys/external/bsd/drm2/linux/linux_reservation.c: revision 1.14 drm: Release fence if we're about to return too. Should fix another fence leak. XXX pullup-9 - drm: Plug another fence leak. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.11.8.1 -r1.11.8.2 \ src/sys/external/bsd/drm2/linux/linux_reservation.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/external/bsd/drm2/linux/linux_reservation.c diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.1 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.2 --- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.1 Thu Jul 8 11:23:28 2021 +++ src/sys/external/bsd/drm2/linux/linux_reservation.c Sun Aug 8 10:00:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $ */ +/* $NetBSD: linux_reservation.c,v 1.11.8.2 2021/08/08 10:00:16 martin Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11.8.2 2021/08/08 10:00:16 martin Exp $"); #include #include @@ -794,9 +794,9 @@ wait: KASSERT(fence != NULL); rcu_read_unlock(); ret = fence_wait_timeout(fence, intr, timeout); + fence_put(fence); if (ret <= 0) return ret; - fence_put(fence); KASSERT(ret <= timeout); timeout = ret; goto top; @@ -1003,6 +1003,7 @@ top: * assume the event is not ready. */ if (!claimed || callback) { + fence_put(fence); revents = 0; break; }
CVS commit: src/distrib/sets/lists/tests
Module Name:src Committed By: martin Date: Fri Aug 6 08:44:31 UTC 2021 Modified Files: src/distrib/sets/lists/tests: mi Log Message: Fix copy+pasto (wrong dir for t_lint2) To generate a diff of this commit: cvs rdiff -u -r1.1104 -r1.1105 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.1104 src/distrib/sets/lists/tests/mi:1.1105 --- src/distrib/sets/lists/tests/mi:1.1104 Thu Aug 5 22:36:07 2021 +++ src/distrib/sets/lists/tests/mi Fri Aug 6 08:44:31 2021 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1104 2021/08/05 22:36:07 rillig Exp $ +# $NetBSD: mi,v 1.1105 2021/08/06 08:44:31 martin Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7064,7 +7064,7 @@ ./usr/tests/usr.bin/xlint/lint2/msg_017.ln tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/msg_018.exp tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint2/msg_018.ln tests-usr.bin-tests compattestfile,atf -./usr/tests/usr.bin/xlint/lint1/t_lint2tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint2/t_lint2tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztesttests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Atffile tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/ztest/Kyuafile tests-usr.bin-tests compattestfile,atf,kyua
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Aug 3 13:40:33 UTC 2021 Modified Files: src/usr.sbin/sysinst: util.c Log Message: Cleanup alarm(3) handling in the timezone selection menu for error cases, pointed out by RVP. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/sysinst/util.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/sysinst/util.c diff -u src/usr.sbin/sysinst/util.c:1.58 src/usr.sbin/sysinst/util.c:1.59 --- src/usr.sbin/sysinst/util.c:1.58 Tue Jul 20 16:40:12 2021 +++ src/usr.sbin/sysinst/util.c Tue Aug 3 13:40:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.58 2021/07/20 16:40:12 martin Exp $ */ +/* $NetBSD: util.c,v 1.59 2021/08/03 13:40:33 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1881,25 +1881,26 @@ set_timezone(void) tzm_set_names, NULL, NULL, "\nPlease consult the install documents.", MSG_exit_menu_generic); - if (menu_no < 0) - goto done; /* error - skip timezone setting */ + if (menu_no >= 0) { + time_menu = menu_no; + process_menu(menu_no, NULL); + time_menu = -1; - time_menu = menu_no; - process_menu(menu_no, NULL); - time_menu = -1; - - free_menu(menu_no); + free_menu(menu_no); + } + alarm(0); signal(SIGALRM, SIG_IGN); - snprintf(localtime_target, sizeof(localtime_target), - "/usr/share/zoneinfo/%s", tz_selected); - strlcpy(localtime_link, target_expand("/etc/localtime"), - sizeof localtime_link); - unlink(localtime_link); - symlink(localtime_target, localtime_link); + if (menu_no >= 0) { + snprintf(localtime_target, sizeof(localtime_target), + "/usr/share/zoneinfo/%s", tz_selected); + strlcpy(localtime_link, target_expand("/etc/localtime"), + sizeof localtime_link); + unlink(localtime_link); + symlink(localtime_target, localtime_link); + } -done: return 1; }
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Aug 3 13:34:04 UTC 2021 Modified Files: src/usr.sbin/sysinst: run.c Log Message: When reading output from a program we don't know how much it will be - so scale the buffer (within reasonable limits). Problem pointed out by RVP, triggered e.g. by disks with lots of GPT partitions. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/sysinst/run.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/sysinst/run.c diff -u src/usr.sbin/sysinst/run.c:1.13 src/usr.sbin/sysinst/run.c:1.14 --- src/usr.sbin/sysinst/run.c:1.13 Sat Nov 16 20:26:59 2019 +++ src/usr.sbin/sysinst/run.c Tue Aug 3 13:34:04 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: run.c,v 1.13 2019/11/16 20:26:59 martin Exp $ */ +/* $NetBSD: run.c,v 1.14 2021/08/03 13:34:04 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -176,6 +176,7 @@ collect(int kind, char **buffer, const c { size_t nbytes; /* Number of bytes in buffer. */ size_t fbytes; /* Number of bytes in file. */ + size_t abytes; /* allocated size of buffer */ struct stat st; /* stat information. */ int ch; FILE *f; @@ -198,6 +199,9 @@ collect(int kind, char **buffer, const c /* Open the file. */ f = fopen(fileorcmd, "r"); if (f == NULL) { + if (logfp) +fprintf(logfp, "%s: failed to open %s\n", +__func__, fileorcmd); *buffer = NULL; return -1; } @@ -205,25 +209,47 @@ collect(int kind, char **buffer, const c /* Open the program. */ f = popen(fileorcmd, "r"); if (f == NULL) { + if (logfp) +fprintf(logfp, "%s: failed to open %s\n", +__func__, fileorcmd); *buffer = NULL; return -1; } - fbytes = BUFSIZE; + fbytes = 0; } if (fbytes == 0) - fbytes = BUFSIZE; + abytes = BUFSIZE; + else + abytes = fbytes+1; /* Allocate the buffer size. */ - *buffer = cp = malloc(fbytes + 1); + *buffer = cp = malloc(abytes); if (!cp) nbytes = -1; else { /* Read the buffer. */ nbytes = 0; - while (nbytes < fbytes && (ch = fgetc(f)) != EOF) + while ((ch = fgetc(f)) != EOF) { + if (nbytes >= abytes-1) { +if (fbytes > 0 || abytes >= 512*BUFSIZE) { + free(cp); + *buffer = cp = NULL; + nbytes = -1; + break; +} +abytes *= 2; +*buffer = cp = realloc(cp, abytes); +if (!cp) { + nbytes = -1; + break; +} + + } cp[nbytes++] = ch; - cp[nbytes] = 0; + } + if (cp) + cp[nbytes] = 0; } if (kind == T_FILE) @@ -231,6 +257,9 @@ collect(int kind, char **buffer, const c else pclose(f); + if (nbytes <= 0 && logfp) + fprintf(logfp, "%s: failed for %s\n", __func__, fileorcmd); + return nbytes; }
CVS commit: src/usr.bin/ldd
Module Name:src Committed By: martin Date: Fri Jul 23 04:20:05 UTC 2021 Modified Files: src/usr.bin/ldd: ldd.c Log Message: gcc hates strncpy() To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.bin/ldd/ldd.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.bin/ldd/ldd.c diff -u src/usr.bin/ldd/ldd.c:1.24 src/usr.bin/ldd/ldd.c:1.25 --- src/usr.bin/ldd/ldd.c:1.24 Thu Jul 22 17:39:52 2021 +++ src/usr.bin/ldd/ldd.c Fri Jul 23 04:20:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $ */ +/* $NetBSD: ldd.c,v 1.25 2021/07/23 04:20:05 martin Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ #include #ifndef lint -__RCSID("$NetBSD: ldd.c,v 1.24 2021/07/22 17:39:52 christos Exp $"); +__RCSID("$NetBSD: ldd.c,v 1.25 2021/07/23 04:20:05 martin Exp $"); #endif /* not lint */ #include @@ -161,10 +161,13 @@ main(int argc, char **argv) for (; argc != 0; argc--, argv++) { int fd; - if (**argv != '/') - snprintf(path, sizeof(path), "%s/%s", cwd, *argv); - else + if (**argv != '/') { + strcpy(path, cwd); + strlcat(path, "/", sizeof(path)); + strlcat(path, *argv, sizeof(path)); + } else { strlcpy(path, *argv, sizeof(path)); + } fd = open(*argv, O_RDONLY); if (fd == -1) { exit_status = EXIT_FAILURE;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jul 20 16:41:27 UTC 2021 Modified Files: src/usr.sbin/sysinst: bsddisklabel.c Log Message: PR 56303: do not borrow from the default swap allocation if we are in tiny ram conditions and will need to enable swap early. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/sysinst/bsddisklabel.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/sysinst/bsddisklabel.c diff -u src/usr.sbin/sysinst/bsddisklabel.c:1.58 src/usr.sbin/sysinst/bsddisklabel.c:1.59 --- src/usr.sbin/sysinst/bsddisklabel.c:1.58 Sat Feb 13 15:31:35 2021 +++ src/usr.sbin/sysinst/bsddisklabel.c Tue Jul 20 16:41:27 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: bsddisklabel.c,v 1.58 2021/02/13 15:31:35 martin Exp $ */ +/* $NetBSD: bsddisklabel.c,v 1.59 2021/07/20 16:41:27 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -1153,7 +1153,8 @@ fill_defaults(struct partition_usage_set continue; free_space -= wanted->infos[i].size; } - if (free_space < 0 && swap < wanted->num) { + if (free_space < 0 && swap < wanted->num && + get_ramsize() > TINY_RAM_SIZE) { /* steel from swap partition */ daddr_t d = wanted->infos[swap].size; daddr_t inc = roundup(-free_space, align);
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jul 20 16:40:12 UTC 2021 Modified Files: src/usr.sbin/sysinst: util.c Log Message: RAM size will not change during installation, do the sysctl() dance only once. To generate a diff of this commit: cvs rdiff -u -r1.57 -r1.58 src/usr.sbin/sysinst/util.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/sysinst/util.c diff -u src/usr.sbin/sysinst/util.c:1.57 src/usr.sbin/sysinst/util.c:1.58 --- src/usr.sbin/sysinst/util.c:1.57 Sun Jan 31 22:45:47 2021 +++ src/usr.sbin/sysinst/util.c Tue Jul 20 16:40:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: util.c,v 1.57 2021/01/31 22:45:47 rillig Exp $ */ +/* $NetBSD: util.c,v 1.58 2021/07/20 16:40:12 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -264,11 +264,14 @@ file_mode_match(const char *path, unsign uint64_t get_ramsize(void) { - uint64_t ramsize; - size_t len = sizeof ramsize; - int mib[2] = {CTL_HW, HW_PHYSMEM64}; + static uint64_t ramsize; - sysctl(mib, 2, &ramsize, &len, NULL, 0); + if (ramsize == 0) { + size_t len = sizeof ramsize; + int mib[2] = {CTL_HW, HW_PHYSMEM64}; + + sysctl(mib, 2, &ramsize, &len, NULL, 0); + } /* Find out how many Megs ... round up. */ return (ramsize + MEG - 1) / MEG;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Sat Jul 17 19:27:23 UTC 2021 Modified Files: src/usr.sbin/sysinst: gpt.c Log Message: Use strlcpy() to copy the wedge device name (the code still assumes the string is short enough and 0 terminated, but now gcc is happy). To generate a diff of this commit: cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/sysinst/gpt.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/sysinst/gpt.c diff -u src/usr.sbin/sysinst/gpt.c:1.25 src/usr.sbin/sysinst/gpt.c:1.26 --- src/usr.sbin/sysinst/gpt.c:1.25 Sat Jul 17 18:07:22 2021 +++ src/usr.sbin/sysinst/gpt.c Sat Jul 17 19:27:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.c,v 1.25 2021/07/17 18:07:22 martin Exp $ */ +/* $NetBSD: gpt.c,v 1.26 2021/07/17 19:27:22 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -1380,7 +1380,7 @@ gpt_sanitize(int diskfd, const struct gp if (found) continue; memset(&delw, 0, sizeof(delw)); - strncpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname)); + strlcpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname)); (void)ioctl(diskfd, DIOCDWEDGE, &delw); }
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Sat Jul 17 18:07:23 UTC 2021 Modified Files: src/usr.sbin/sysinst: gpt.c Log Message: PR 56310: if we fail to create a wedge this either means there is a bug here (and we requested something nonsensial), or there are pre- existing "foreign" wedges which disturb our work. So remove all wedges on this disk that we do not know about and retry to add our new wedge. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/usr.sbin/sysinst/gpt.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/sysinst/gpt.c diff -u src/usr.sbin/sysinst/gpt.c:1.24 src/usr.sbin/sysinst/gpt.c:1.25 --- src/usr.sbin/sysinst/gpt.c:1.24 Sat Jul 17 11:32:50 2021 +++ src/usr.sbin/sysinst/gpt.c Sat Jul 17 18:07:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.c,v 1.24 2021/07/17 11:32:50 martin Exp $ */ +/* $NetBSD: gpt.c,v 1.25 2021/07/17 18:07:22 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -32,6 +32,7 @@ #include "md.h" #include "gpt_uuid.h" #include +#include #include #include #include @@ -1325,8 +1326,71 @@ bsdlabel_fstype_to_str(uint8_t fstype) return (str); } +/* + * diskfd is an open file descriptor for a disk we had trouble with + * creating some new wedges. + * Go through all wedges actually on that disk, check if we have a + * record for them and remove all others. + * This should sync our internal model of partitions with the real state. + */ +static void +gpt_sanitize(int diskfd, const struct gpt_disk_partitions *parts, +struct gpt_part_entry *ignore) +{ + struct dkwedge_info *dkw, delw; + struct dkwedge_list dkwl; + size_t bufsize; + u_int i; + + dkw = NULL; + dkwl.dkwl_buf = dkw; + dkwl.dkwl_bufsize = 0; + + /* get a list of all wedges */ + for (;;) { + if (ioctl(diskfd, DIOCLWEDGES, &dkwl) == -1) + return; + if (dkwl.dkwl_nwedges == dkwl.dkwl_ncopied) + break; + bufsize = dkwl.dkwl_nwedges * sizeof(*dkw); + if (dkwl.dkwl_bufsize < bufsize) { + dkw = realloc(dkwl.dkwl_buf, bufsize); + if (dkw == NULL) +return; + dkwl.dkwl_buf = dkw; + dkwl.dkwl_bufsize = bufsize; + } + } + + /* try to remove all the ones we do not know about */ + for (i = 0; i < dkwl.dkwl_nwedges; i++) { + bool found = false; + const char *devname = dkw[i].dkw_devname; + + for (struct gpt_part_entry *pe = parts->partitions; + pe != NULL; pe = pe->gp_next) { + if (pe == ignore) +continue; + if ((pe->gp_flags & GPEF_WEDGE) && + strcmp(pe->gp_dev_name, devname) == 0) { +found = true; +break; + } + } + if (found) + continue; + memset(&delw, 0, sizeof(delw)); + strncpy(delw.dkw_devname, devname, sizeof(delw.dkw_devname)); + (void)ioctl(diskfd, DIOCDWEDGE, &delw); + } + + /* cleanup */ + free(dkw); +} + static bool -gpt_add_wedge(const char *disk, struct gpt_part_entry *p) +gpt_add_wedge(const char *disk, struct gpt_part_entry *p, +const struct gpt_disk_partitions *parts) { struct dkwedge_info dkw; const char *tname; @@ -1355,9 +1419,16 @@ gpt_add_wedge(const char *disk, struct g if (fd < 0) return false; if (ioctl(fd, DIOCAWEDGE, &dkw) == -1) { + if (errno == EINVAL) { + /* sanitize existing wedges and try again */ + gpt_sanitize(fd, parts, p); + if (ioctl(fd, DIOCAWEDGE, &dkw) == 0) +goto ok; + } close(fd); return false; } +ok: close(fd); strlcpy(p->gp_dev_name, dkw.dkw_devname, sizeof(p->gp_dev_name)); @@ -1405,10 +1476,8 @@ gpt_get_part_device(const struct disk_pa if (usage == plain_name || usage == raw_dev_name) life = true; if (!(p->gp_flags & GPEF_WEDGE) && life && - !gpt_add_wedge(arg->disk, p)) { - devname[0] = 0; + !gpt_add_wedge(arg->disk, p, parts)) return false; - } switch (usage) { case logical_name:
CVS commit: src/tests/lib/libc/sys
Module Name:src Committed By: martin Date: Sat Jul 17 14:03:36 UTC 2021 Modified Files: src/tests/lib/libc/sys: t_wait.c Log Message: PR 56313: fix eroneous = that was meant to be == To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/sys/t_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/tests/lib/libc/sys/t_wait.c diff -u src/tests/lib/libc/sys/t_wait.c:1.9 src/tests/lib/libc/sys/t_wait.c:1.10 --- src/tests/lib/libc/sys/t_wait.c:1.9 Mon Feb 4 09:35:11 2019 +++ src/tests/lib/libc/sys/t_wait.c Sat Jul 17 14:03:35 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: t_wait.c,v 1.9 2019/02/04 09:35:11 mrg Exp $ */ +/* $NetBSD: t_wait.c,v 1.10 2021/07/17 14:03:35 martin Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__RCSID("$NetBSD: t_wait.c,v 1.9 2019/02/04 09:35:11 mrg Exp $"); +__RCSID("$NetBSD: t_wait.c,v 1.10 2021/07/17 14:03:35 martin Exp $"); #include #include @@ -85,7 +85,7 @@ ATF_TC_BODY(wait6_exited, tc) default: ATF_REQUIRE(wait6(P_PID, pid, &st, WEXITED, &wru, &si) == pid); ATF_REQUIRE(WIFEXITED(st) && WEXITSTATUS(st) == 0x5a); - ATF_REQUIRE(si.si_status = 0x5a5a5a5a); + ATF_REQUIRE(si.si_status == 0x5a5a5a5a); ATF_REQUIRE(si.si_pid == pid); ATF_REQUIRE(si.si_uid == getuid()); ATF_REQUIRE(si.si_code == CLD_EXITED);
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Sat Jul 17 11:32:50 UTC 2021 Modified Files: src/usr.sbin/sysinst: gpt.c partman.c Log Message: PR 56310: avoid assert() failures (or crashes) when the runtime addition of a wedge fails (for whatever reasons). To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.sbin/sysinst/gpt.c cvs rdiff -u -r1.51 -r1.52 src/usr.sbin/sysinst/partman.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/sysinst/gpt.c diff -u src/usr.sbin/sysinst/gpt.c:1.23 src/usr.sbin/sysinst/gpt.c:1.24 --- src/usr.sbin/sysinst/gpt.c:1.23 Sun Jan 31 22:45:46 2021 +++ src/usr.sbin/sysinst/gpt.c Sat Jul 17 11:32:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: gpt.c,v 1.23 2021/01/31 22:45:46 rillig Exp $ */ +/* $NetBSD: gpt.c,v 1.24 2021/07/17 11:32:50 martin Exp $ */ /* * Copyright 2018 The NetBSD Foundation, Inc. @@ -1404,8 +1404,11 @@ gpt_get_part_device(const struct disk_pa usage = plain_name; if (usage == plain_name || usage == raw_dev_name) life = true; - if (!(p->gp_flags & GPEF_WEDGE) && life) - gpt_add_wedge(arg->disk, p); + if (!(p->gp_flags & GPEF_WEDGE) && life && + !gpt_add_wedge(arg->disk, p)) { + devname[0] = 0; + return false; + } switch (usage) { case logical_name: Index: src/usr.sbin/sysinst/partman.c diff -u src/usr.sbin/sysinst/partman.c:1.51 src/usr.sbin/sysinst/partman.c:1.52 --- src/usr.sbin/sysinst/partman.c:1.51 Sun Jan 31 22:45:46 2021 +++ src/usr.sbin/sysinst/partman.c Sat Jul 17 11:32:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: partman.c,v 1.51 2021/01/31 22:45:46 rillig Exp $ */ +/* $NetBSD: partman.c,v 1.52 2021/07/17 11:32:50 martin Exp $ */ /* * Copyright 2012 Eugene Lozovoy @@ -2847,13 +2847,13 @@ pm_menufmt(menudesc *m, int opt, void *a dev_status); break; case PM_PART: - if (parts->pscheme->get_part_device != NULL) -parts->pscheme->get_part_device( -parts, part_num, -dev, sizeof dev, NULL, plain_name, false, -true); - else -strcpy(dev, "-"); + if (parts->pscheme->get_part_device == NULL || + !parts->pscheme->get_part_device( +parts, part_num, +dev, sizeof dev, NULL, plain_name, false, +true)) + strcpy(dev, "-"); + parts->pscheme->get_part_info(parts, part_num, &info); if (pm_cur->mounted != NULL &&
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Wed Jul 14 18:56:05 UTC 2021 Modified Files: src/usr.sbin/sysinst: disks.c Log Message: When converting partitions from one scheme to another, never fail without providing (if requested) a proper error message. To generate a diff of this commit: cvs rdiff -u -r1.72 -r1.73 src/usr.sbin/sysinst/disks.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/sysinst/disks.c diff -u src/usr.sbin/sysinst/disks.c:1.72 src/usr.sbin/sysinst/disks.c:1.73 --- src/usr.sbin/sysinst/disks.c:1.72 Sun Jan 31 22:45:46 2021 +++ src/usr.sbin/sysinst/disks.c Wed Jul 14 18:56:05 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: disks.c,v 1.72 2021/01/31 22:45:46 rillig Exp $ */ +/* $NetBSD: disks.c,v 1.73 2021/07/14 18:56:05 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -754,17 +754,23 @@ convert_scheme(struct pm_devs *p, bool i new_scheme = select_part_scheme(p, old_parts->pscheme, false, MSG_select_other_partscheme); - if (new_scheme == NULL) + if (new_scheme == NULL) { + if (err_msg) + *err_msg = INTERNAL_ERROR; return false; + } new_parts = new_scheme->create_new_for_disk(p->diskdev, 0, p->dlsize, is_boot_drive, NULL); - if (new_parts == NULL) + if (new_parts == NULL) { + if (err_msg) + *err_msg = MSG_out_of_memory; return false; + } convert_copy(old_parts, new_parts); - if (new_parts->num_part == 0) { + if (new_parts->num_part == 0 && old_parts->num_part != 0) { /* need to cleanup */ new_parts->pscheme->free(new_parts); return false;
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Wed Jul 14 18:05:25 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1322 and #1323 To generate a diff of this commit: cvs rdiff -u -r1.1.2.16 -r1.1.2.17 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.16 src/doc/CHANGES-9.3:1.1.2.17 --- src/doc/CHANGES-9.3:1.1.2.16 Fri Jul 9 17:53:05 2021 +++ src/doc/CHANGES-9.3 Wed Jul 14 18:05:25 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.16 2021/07/09 17:53:05 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.17 2021/07/14 18:05:25 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -354,3 +354,25 @@ sys/rump/librump/rumpvfs/vm_vfs.c (appl Adapt the uvm pageout changes to the branch. [chs, ticket #1321] +sys/arch/hppa/dev/sti_sgc.c 1.3 + + PR 52162: Fix silent freeze on probing sti(4) framebuffer on 712/60. + [tsutsui, ticket #1322] + +etc/etc.hp300/MAKEDEV.conf 1.15 +sys/arch/hp300/dev/ct.c1.62,1.63 +sys/arch/hp300/dev/ctreg.h 1.11 +sys/arch/hp300/dev/hpib.c 1.43 (patch) +sys/arch/hp300/dev/hpibvar.h 1.22-1.24 +sys/arch/hp300/dev/mt.c1.55 +sys/arch/hp300/dev/rd.c1.103-1.109 +sys/arch/hp300/dev/rdreg.h 1.14-1.17 +sys/arch/hp300/dev/rdvar.h 1.24-1.26 +sys/arch/hp300/stand/Makefile.buildboot 1.37 +sys/arch/hp300/stand/common/ct.c 1.8 +sys/arch/hp300/stand/common/hpibvar.h 1.6 +sys/arch/hp300/stand/common/rd.c 1.11 + + hp300: various rd(4) improvements. + [tsutsui, ticket #1323] +
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Wed Jul 14 18:04:05 UTC 2021 Modified Files: src/etc/etc.hp300 [netbsd-9]: MAKEDEV.conf src/sys/arch/hp300/dev [netbsd-9]: ct.c ctreg.h hpib.c hpibvar.h mt.c rd.c rdreg.h rdvar.h src/sys/arch/hp300/stand [netbsd-9]: Makefile.buildboot src/sys/arch/hp300/stand/common [netbsd-9]: ct.c hpibvar.h rd.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1323): sys/arch/hp300/dev/rd.c: revision 1.109 sys/arch/hp300/stand/Makefile.buildboot: revision 1.37 sys/arch/hp300/stand/common/ct.c: revision 1.8 sys/arch/hp300/dev/hpibvar.h: revision 1.22 sys/arch/hp300/dev/ct.c: revision 1.62 sys/arch/hp300/dev/hpibvar.h: revision 1.23 sys/arch/hp300/dev/ct.c: revision 1.63 sys/arch/hp300/dev/hpibvar.h: revision 1.24 sys/arch/hp300/dev/mt.c: revision 1.55 sys/arch/hp300/dev/rdreg.h: revision 1.14 sys/arch/hp300/dev/hpib.c: revision 1.43 (via patch) sys/arch/hp300/dev/rdreg.h: revision 1.15 sys/arch/hp300/dev/rdreg.h: revision 1.16 sys/arch/hp300/dev/rdreg.h: revision 1.17 etc/etc.hp300/MAKEDEV.conf: revision 1.15 sys/arch/hp300/stand/common/hpibvar.h: revision 1.6 sys/arch/hp300/stand/common/rd.c: revision 1.11 sys/arch/hp300/dev/ctreg.h: revision 1.11 sys/arch/hp300/dev/rdvar.h: revision 1.24 sys/arch/hp300/dev/rdvar.h: revision 1.25 sys/arch/hp300/dev/rdvar.h: revision 1.26 sys/arch/hp300/dev/rd.c: revision 1.103 sys/arch/hp300/dev/rd.c: revision 1.104 sys/arch/hp300/dev/rd.c: revision 1.105 sys/arch/hp300/dev/rd.c: revision 1.106 sys/arch/hp300/dev/rd.c: revision 1.107 sys/arch/hp300/dev/rd.c: revision 1.108 Consistently use #define here. Consistently use #define as rdreg.h. No need to bother to use aprint_debug(9) inside #ifdef DEBUG block. Pull HP-IB probe fixes from OpenBSD/hp300. https://marc.info/?l=openbsd-cvs&m=113217630426615&w=2 Overhaul the way HP-IB devices are probed. We will now do an exhaustive probe of the (slave, punit) tuple space, since this is the only way we can get a dual disk or dual tape enclosure to attach two devices of the same kind. This allows using multiple rd(4) disk images on the same slave emulated by HPDisk (and probably the real 9122D with dual floppy disk drives). Thanks to Miod Vallat for suggesting this fix. Move attach messages from common rdident() to explicit rdattach(). Cleanup duplicated CS/80 indentify structures. From OpenBSD. https://marc.info/?l=openbsd-cvs&m=113227249626888&w=2 Define the CS/80 identify structure only once and correctly, instead of duplicating it in every CS/80 driver and using an hardcoded number for its size. No functional change. https://marc.info/?l=openbsd-cvs&m=113273001020159&w=2 Pick HP-IB describe structures changes from main kernel code here as well. Add support of multiple rd(4) disks on all punits for HPDisk. Special thanks to Anders Gustafsson, the author of "HPDisk" (GPIB disk emulator) http://www.dalton.ax/hpdisk/ for providing bare boards and improving firmwares for NetBSD/hp300. Specify -fno-unwind-tables to shrink binaries. Before: textdata bss dec hex filename 779024328 137120 219350 358d6 uboot After: textdata bss dec hex filename 641864328 137120 205634 32342 uboot Create rd3 device nodes, for HPDisk. Add Device and drive info of 2202A, 7908A, 7911A, and 7941A. Geometries and description info are taken from hpdrive.ini.sample in HPDrive. Briefly tested on HPDisk. Print rd(4) capacity and geometry info as sd(4) and wd(4) do. Before: rd0 at hpibbus1 slave 0 punit 0: 7937H rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block After: rd0 at hpibbus1 slave 0 punit 0: 7937H rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.14.32.1 src/etc/etc.hp300/MAKEDEV.conf cvs rdiff -u -r1.61 -r1.61.32.1 src/sys/arch/hp300/dev/ct.c cvs rdiff -u -r1.10 -r1.10.170.1 src/sys/arch/hp300/dev/ctreg.h cvs rdiff -u -r1.39 -r1.39.42.1 src/sys/arch/hp300/dev/hpib.c cvs rdiff -u -r1.21 -r1.21.42.1 src/sys/arch/hp300/dev/hpibvar.h cvs rdiff -u -r1.54 -r1.54.32.1 src/sys/arch/hp300/dev/mt.c cvs rdiff -u -r1.101 -r1.101.22.1 src/sys/arch/hp300/dev/rd.c cvs rdiff -u -r1.13 -r1.13.60.1 src/sys/arch/hp300/dev/rdreg.h cvs rdiff -u -r1.23 -r1.23.22.1 src/sys/arch/hp300/dev/rdvar.h cvs rdiff -u -r1.36 -r1.36.18.1 src/sys/arch/hp300/stand/Makefile.buildboot cvs rdiff -u -r1.7 -r1.7.58.1 src/sys/arch/hp300/stand/common/ct.c cvs rdiff -u -r1.5 -r1.5.154.1 src/sys/arch/hp300/stand/common/hpibvar.h cvs rdiff -u -r1.10 -r1.10.58.1 src/sys/arch/hp300/stand/common/rd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Wed Jul 14 17:55:18 UTC 2021 Modified Files: src/doc [netbsd-8]: CHANGES-8.3 Log Message: Ticket #1689 To generate a diff of this commit: cvs rdiff -u -r1.1.2.93 -r1.1.2.94 src/doc/CHANGES-8.3 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.3 diff -u src/doc/CHANGES-8.3:1.1.2.93 src/doc/CHANGES-8.3:1.1.2.94 --- src/doc/CHANGES-8.3:1.1.2.93 Fri Jun 25 19:14:29 2021 +++ src/doc/CHANGES-8.3 Wed Jul 14 17:55:18 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.3,v 1.1.2.93 2021/06/25 19:14:29 martin Exp $ +# $NetBSD: CHANGES-8.3,v 1.1.2.94 2021/07/14 17:55:18 martin Exp $ A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3 release: @@ -1983,3 +1983,8 @@ distrib/sun3/miniroot/Makefile 1.50 - The modules and rescue sets are also required on upgrade. [tsutsui, ticket #1686] +sys/arch/hppa/dev/sti_sgc.c 1.3 + + PR 52162: Fix silent freeze on probing sti(4) framebuffer on 712/60. + [tsutsui, ticket #1689] +
CVS commit: [netbsd-8] src/sys/arch/hppa/dev
Module Name:src Committed By: martin Date: Wed Jul 14 17:53:50 UTC 2021 Modified Files: src/sys/arch/hppa/dev [netbsd-8]: sti_sgc.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1689): sys/arch/hppa/dev/sti_sgc.c: revision 1.3 Fix silent freeze on probing sti(4) framebuffer on 712/60. PR/52162 Ok'ed by skrll@. Should be pulled up to netbsd-9 and netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.28.1 src/sys/arch/hppa/dev/sti_sgc.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/hppa/dev/sti_sgc.c diff -u src/sys/arch/hppa/dev/sti_sgc.c:1.1 src/sys/arch/hppa/dev/sti_sgc.c:1.1.28.1 --- src/sys/arch/hppa/dev/sti_sgc.c:1.1 Mon Feb 24 07:23:43 2014 +++ src/sys/arch/hppa/dev/sti_sgc.c Wed Jul 14 17:53:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sti_sgc.c,v 1.1 2014/02/24 07:23:43 skrll Exp $ */ +/* $NetBSD: sti_sgc.c,v 1.1.28.1 2021/07/14 17:53:50 martin Exp $ */ /* $OpenBSD: sti_sgc.c,v 1.38 2009/02/06 22:51:04 miod Exp $ */ @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.1 2014/02/24 07:23:43 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.1.28.1 2021/07/14 17:53:50 martin Exp $"); #include "opt_cputype.h" @@ -73,6 +73,16 @@ extern int stidebug; #define STI_ROMSIZE (sizeof(struct sti_dd) * 4) #define STI_ID_FDDI 0x280b31af /* Medusa FDDI ROM id */ +/* + * hpa addresses to check on-board variants + * XXX should check via device_register(9)? + * + * 0xf400: HPA1991AC19 on 715/33, 715/50 + * 0xf800: HPA1439A on 735/99, HPA208LCxxx on 715/80, 715/100, 712 + */ +#define STI_ONBOARD_HPA0 0xf400 +#define STI_ONBOARD_HPA1 0xf800 + /* gecko optional graphics */ #define STI_GOPT1_REV 0x17 #define STI_GOPT2_REV 0x70 @@ -118,7 +128,9 @@ sti_sgc_getrom(struct confargs *ca) rom = PAGE0->pd_resv2[1]; hppa_pagezero_unmap(pagezero_cookie); - if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC) { + if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC && + ca->ca_hpa != STI_ONBOARD_HPA0 && + ca->ca_hpa != STI_ONBOARD_HPA1) { int i; for (i = sizeof(sti_sgc_opt); i--; ) if (sti_sgc_opt[i] == ca->ca_type.iodc_revision)
CVS commit: [netbsd-9] src/sys/arch/hppa/dev
Module Name:src Committed By: martin Date: Wed Jul 14 17:52:32 UTC 2021 Modified Files: src/sys/arch/hppa/dev [netbsd-9]: sti_sgc.c Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1322): sys/arch/hppa/dev/sti_sgc.c: revision 1.3 Fix silent freeze on probing sti(4) framebuffer on 712/60. PR/52162 Ok'ed by skrll@. Should be pulled up to netbsd-9 and netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/hppa/dev/sti_sgc.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/hppa/dev/sti_sgc.c diff -u src/sys/arch/hppa/dev/sti_sgc.c:1.2 src/sys/arch/hppa/dev/sti_sgc.c:1.2.4.1 --- src/sys/arch/hppa/dev/sti_sgc.c:1.2 Mon Apr 15 20:40:37 2019 +++ src/sys/arch/hppa/dev/sti_sgc.c Wed Jul 14 17:52:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: sti_sgc.c,v 1.2 2019/04/15 20:40:37 skrll Exp $ */ +/* $NetBSD: sti_sgc.c,v 1.2.4.1 2021/07/14 17:52:31 martin Exp $ */ /* $OpenBSD: sti_sgc.c,v 1.38 2009/02/06 22:51:04 miod Exp $ */ @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.2 2019/04/15 20:40:37 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.2.4.1 2021/07/14 17:52:31 martin Exp $"); #include "opt_cputype.h" @@ -73,6 +73,16 @@ extern int stidebug; #define STI_ROMSIZE (sizeof(struct sti_dd) * 4) #define STI_ID_FDDI 0x280b31af /* Medusa FDDI ROM id */ +/* + * hpa addresses to check on-board variants + * XXX should check via device_register(9)? + * + * 0xf400: HPA1991AC19 on 715/33, 715/50 + * 0xf800: HPA1439A on 735/99, HPA208LCxxx on 715/80, 715/100, 712 + */ +#define STI_ONBOARD_HPA0 0xf400 +#define STI_ONBOARD_HPA1 0xf800 + /* gecko optional graphics */ #define STI_GOPT1_REV 0x17 #define STI_GOPT2_REV 0x70 @@ -118,7 +128,9 @@ sti_sgc_getrom(struct confargs *ca) rom = PAGE0->pd_resv2[1]; hppa_pagezero_unmap(pagezero_cookie); - if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC) { + if (ca->ca_type.iodc_sv_model == HPPA_FIO_GSGC && + ca->ca_hpa != STI_ONBOARD_HPA0 && + ca->ca_hpa != STI_ONBOARD_HPA1) { int i; for (i = sizeof(sti_sgc_opt); i--; ) if (sti_sgc_opt[i] == ca->ca_type.iodc_revision)
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Tue Jul 13 09:13:00 UTC 2021 Modified Files: src/usr.sbin/sysinst: Makefile.inc defs.h Log Message: PR install/56303: when using xz files enable swap during set extraction if the machine does not have more than 256MB of RAM. To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/usr.sbin/sysinst/Makefile.inc cvs rdiff -u -r1.70 -r1.71 src/usr.sbin/sysinst/defs.h 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/sysinst/Makefile.inc diff -u src/usr.sbin/sysinst/Makefile.inc:1.40 src/usr.sbin/sysinst/Makefile.inc:1.41 --- src/usr.sbin/sysinst/Makefile.inc:1.40 Tue Apr 13 07:53:19 2021 +++ src/usr.sbin/sysinst/Makefile.inc Tue Jul 13 09:13:00 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.40 2021/04/13 07:53:19 mrg Exp $ +# $NetBSD: Makefile.inc,v 1.41 2021/07/13 09:13:00 martin Exp $ # # Makefile for sysinst @@ -94,6 +94,10 @@ CPPFLAGS+= -I. -I${.CURDIR}/../.. -I${.C ${NODISKLABEL:D-DNO_DISKLABEL} \ ${NOPARTMAN:D-DNO_PARTMAN} +.if ${USE_XZ_SETS:Uno} != "no" +CPPFLAGS+= -DEXTRACT_NEEDS_BIG_RAM +.endif + .if ${RELEASEMACHINEDIR} != ${MACHINE} CPPFLAGS+= -DARCH_SUBDIR="\"${RELEASEMACHINEDIR}\"" CPPFLAGS+= -DPKG_ARCH_SUBDIR="\"${MACHINE_ARCH}\"" Index: src/usr.sbin/sysinst/defs.h diff -u src/usr.sbin/sysinst/defs.h:1.70 src/usr.sbin/sysinst/defs.h:1.71 --- src/usr.sbin/sysinst/defs.h:1.70 Sun Jan 31 22:45:46 2021 +++ src/usr.sbin/sysinst/defs.h Tue Jul 13 09:13:00 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: defs.h,v 1.70 2021/01/31 22:45:46 rillig Exp $ */ +/* $NetBSD: defs.h,v 1.71 2021/07/13 09:13:00 martin Exp $ */ /* * Copyright 1997 Piermont Information Systems Inc. @@ -68,7 +68,12 @@ const char *getfslabelname(uint, uint); * if a system does not have more ram (in MB) than this, swap will be enabled * very early (as soon as the swap partition has been created) */ +#ifdef EXTRACT_NEEDS_BIG_RAM /* we use an expensive decompressor */ +#define TINY_RAM_SIZE 256 +#else #define TINY_RAM_SIZE 32 +#endif + /* * if a system has less ram (in MB) than this, we will not create a * tmpfs /tmp by default (to workaround PR misc/54886)
CVS commit: src/tests/lib/libc/stdio
Module Name:src Committed By: martin Date: Sat Jul 10 13:22:01 UTC 2021 Modified Files: src/tests/lib/libc/stdio: t_fmemopen.c Log Message: Use intmax_t to printf an off_t To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/stdio/t_fmemopen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/stdio/t_fmemopen.c diff -u src/tests/lib/libc/stdio/t_fmemopen.c:1.5 src/tests/lib/libc/stdio/t_fmemopen.c:1.6 --- src/tests/lib/libc/stdio/t_fmemopen.c:1.5 Sat Jul 10 07:50:33 2021 +++ src/tests/lib/libc/stdio/t_fmemopen.c Sat Jul 10 13:22:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: t_fmemopen.c,v 1.5 2021/07/10 07:50:33 christos Exp $ */ +/* $NetBSD: t_fmemopen.c,v 1.6 2021/07/10 13:22:01 martin Exp $ */ /*- * Copyright (c)2010 Takehiko NOZAKI, @@ -965,7 +965,8 @@ ATF_TC_BODY(test19, tc) /* don't accept non nul character at end of buffer */ ATF_CHECK(fputc(0x1, fp) == EOF); ATF_CHECK_MSG(ftello(fp) == (off_t)t->n, -"%td != %td", ftello(fp), (off_t)t->n); +"%jd != %jd", (intmax_t)ftello(fp), +(intmax_t)t->n); ATF_CHECK(feof(fp) == 0); /* accept nul character at end of buffer */
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Fri Jul 9 17:53:05 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Ticket #1321 To generate a diff of this commit: cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.15 src/doc/CHANGES-9.3:1.1.2.16 --- src/doc/CHANGES-9.3:1.1.2.15 Thu Jul 8 11:24:41 2021 +++ src/doc/CHANGES-9.3 Fri Jul 9 17:53:05 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.15 2021/07/08 11:24:41 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.16 2021/07/09 17:53:05 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -349,3 +349,8 @@ sys/external/bsd/drm2/linux/linux_reserv drm: Release fence after use. [riastradh, ticket #1320] +sys/rump/librump/rumpvfs/vm_vfs.c (apply patch) + + Adapt the uvm pageout changes to the branch. + [chs, ticket #1321] +
CVS commit: [netbsd-9] src/sys/rump/librump/rumpvfs
Module Name:src Committed By: martin Date: Fri Jul 9 17:51:17 UTC 2021 Modified Files: src/sys/rump/librump/rumpvfs [netbsd-9]: vm_vfs.c Log Message: Apply patch, requested by chs in ticket #1321: sys/rump/librump/rumpvfs/vm_vfs.c (apply patch) Adapt the changes from ticket #1317 (the uvm_pageqlock does not exist any more in HEAD) To generate a diff of this commit: cvs rdiff -u -r1.34.34.1 -r1.34.34.2 src/sys/rump/librump/rumpvfs/vm_vfs.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/rump/librump/rumpvfs/vm_vfs.c diff -u src/sys/rump/librump/rumpvfs/vm_vfs.c:1.34.34.1 src/sys/rump/librump/rumpvfs/vm_vfs.c:1.34.34.2 --- src/sys/rump/librump/rumpvfs/vm_vfs.c:1.34.34.1 Tue Jul 6 04:22:34 2021 +++ src/sys/rump/librump/rumpvfs/vm_vfs.c Fri Jul 9 17:51:17 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vm_vfs.c,v 1.34.34.1 2021/07/06 04:22:34 martin Exp $ */ +/* $NetBSD: vm_vfs.c,v 1.34.34.2 2021/07/09 17:51:17 martin Exp $ */ /* * Copyright (c) 2008-2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.34.34.1 2021/07/06 04:22:34 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_vfs.c,v 1.34.34.2 2021/07/09 17:51:17 martin Exp $"); #include @@ -44,6 +44,7 @@ uvm_aio_aiodone_pages(struct vm_page **p int i; mutex_enter(uobj->vmobjlock); + mutex_enter(&uvm_pageqlock); for (i = 0; i < npages; i++) { pg = pgs[i]; KASSERT((pg->flags & PG_PAGEOUT) == 0 || @@ -59,6 +60,7 @@ uvm_aio_aiodone_pages(struct vm_page **p } uvm_page_unbusy(pgs, npages); + mutex_exit(&uvm_pageqlock); mutex_exit(uobj->vmobjlock); }
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Thu Jul 8 11:24:41 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1319 and #1320 To generate a diff of this commit: cvs rdiff -u -r1.1.2.14 -r1.1.2.15 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.14 src/doc/CHANGES-9.3:1.1.2.15 --- src/doc/CHANGES-9.3:1.1.2.14 Tue Jul 6 04:23:55 2021 +++ src/doc/CHANGES-9.3 Thu Jul 8 11:24:41 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.14 2021/07/06 04:23:55 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.15 2021/07/08 11:24:41 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -339,3 +339,13 @@ tests/rump/rumpkern/t_vm.c 1.5,1.6 (pa PR 55702, PR 55945: fix uvm pageout crashes. [riastradh, ticket #1317] +common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S 1.4 + + Cosmetics (to help later additional pullups) + [skrll, ticket #1319] + +sys/external/bsd/drm2/linux/linux_reservation.c 1.12 + + drm: Release fence after use. + [riastradh, ticket #1320] +
CVS commit: [netbsd-9] src/sys/external/bsd/drm2/linux
Module Name:src Committed By: martin Date: Thu Jul 8 11:23:29 UTC 2021 Modified Files: src/sys/external/bsd/drm2/linux [netbsd-9]: linux_reservation.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1320): sys/external/bsd/drm2/linux/linux_reservation.c: revision 1.12 drm: Release fence after use. May plug the dreaded radeon kmem memory leak. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.11.8.1 \ src/sys/external/bsd/drm2/linux/linux_reservation.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/external/bsd/drm2/linux/linux_reservation.c diff -u src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11 src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11.8.1 --- src/sys/external/bsd/drm2/linux/linux_reservation.c:1.11 Mon Sep 3 18:02:11 2018 +++ src/sys/external/bsd/drm2/linux/linux_reservation.c Thu Jul 8 11:23:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $ */ +/* $NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $ */ /*- * Copyright (c) 2018 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11 2018/09/03 18:02:11 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: linux_reservation.c,v 1.11.8.1 2021/07/08 11:23:28 martin Exp $"); #include #include @@ -796,6 +796,7 @@ wait: ret = fence_wait_timeout(fence, intr, timeout); if (ret <= 0) return ret; + fence_put(fence); KASSERT(ret <= timeout); timeout = ret; goto top;
CVS commit: [netbsd-9] src/common/lib/libc/arch/aarch64/atomic
Module Name:src Committed By: martin Date: Thu Jul 8 11:22:01 UTC 2021 Modified Files: src/common/lib/libc/arch/aarch64/atomic [netbsd-9]: atomic_nand_16.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1319): common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S: revision 1.4 One more s/pte/ptr/ To generate a diff of this commit: cvs rdiff -u -r1.1.28.1 -r1.1.28.2 \ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1.28.1 src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1.28.2 --- src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1.28.1 Tue Jul 6 04:13:50 2021 +++ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S Thu Jul 8 11:22:01 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_16.S,v 1.1.28.1 2021/07/06 04:13:50 martin Exp $ */ +/* $NetBSD: atomic_nand_16.S,v 1.1.28.2 2021/07/08 11:22:01 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ ENTRY_NP(_atomic_nand_16) mov x4, x0 1: ldxrh w0, [x4] /* load old value (*ptr) */ and w3, w0, w1 /* w3 = (*ptr & value) */ - mvn w3, w3 /* w3 = ~(*pte & value) */ + mvn w3, w3 /* w3 = ~(*ptr & value) */ stxrh w2, w3, [x4] /* try to store */ cbnz w2, 1b /* succeed? no, try again */ dmb st @@ -58,7 +58,7 @@ ENTRY_NP(_atomic_nand_16_nv) mov x4, x0 /* need r0 for return value */ 1: ldxrh w0, [x4] /* load old value (*ptr) */ and w0, w0, w1 /* w0 = (*ptr & value) */ - mvn w0, w0 /* w0 = ~(*pte & value), return value */ + mvn w0, w0 /* w0 = ~(*ptr & value), return value */ stxrh w2, w0, [x4] /* try to store */ cbnz w2, 1b /* succeed? no, try again? */ dmb st
CVS commit: src
Module Name:src Committed By: martin Date: Wed Jul 7 11:51:46 UTC 2021 Modified Files: src/sys/rump: Makefile.rump src/tests: Makefile.inc src/tests/rump/modautoload: Makefile src/usr.bin/rump_allserver: Makefile src/usr.bin/rump_dhcpclient: Makefile src/usr.bin/rump_halt: Makefile src/usr.bin/rump_server: Makefile src/usr.sbin/npf/npftest: Makefile src/usr.sbin/puffs: Makefile.inc Log Message: Allow to set sanitizer flags for the rump build from the build.sh command line, like: -V RUMP_SANITIZE=address To generate a diff of this commit: cvs rdiff -u -r1.132 -r1.133 src/sys/rump/Makefile.rump cvs rdiff -u -r1.9 -r1.10 src/tests/Makefile.inc cvs rdiff -u -r1.12 -r1.13 src/tests/rump/modautoload/Makefile cvs rdiff -u -r1.13 -r1.14 src/usr.bin/rump_allserver/Makefile cvs rdiff -u -r1.3 -r1.4 src/usr.bin/rump_dhcpclient/Makefile cvs rdiff -u -r1.3 -r1.4 src/usr.bin/rump_halt/Makefile cvs rdiff -u -r1.14 -r1.15 src/usr.bin/rump_server/Makefile cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/npf/npftest/Makefile cvs rdiff -u -r1.17 -r1.18 src/usr.sbin/puffs/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/sys/rump/Makefile.rump diff -u src/sys/rump/Makefile.rump:1.132 src/sys/rump/Makefile.rump:1.133 --- src/sys/rump/Makefile.rump:1.132 Sun Apr 25 15:16:56 2021 +++ src/sys/rump/Makefile.rump Wed Jul 7 11:51:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.rump,v 1.132 2021/04/25 15:16:56 christos Exp $ +# $NetBSD: Makefile.rump,v 1.133 2021/07/07 11:51:45 martin Exp $ # .if !defined(_RUMP_MK) @@ -24,6 +24,11 @@ CPPFLAGS+= -D_RUMPKERNEL -I${RUMPTOP}/li # aborts after kern_assert on NULL pointer checks. CFLAGS+=${${ACTIVE_CC} == "gcc":? -fno-delete-null-pointer-checks :} +.if ${RUMP_SANITIZE:Uno} != "no" +CFLAGS+= -fsanitize=${RUMP_SANITIZE} +LDFLAGS+= -fsanitize=${RUMP_SANITIZE} +.endif + # NULL + 0 arithmetic raises LLVM UBSan warnings, specially in sys/pslist.h # in the type-safe macros _PSLIST_VALIDATE_PTRS and _PSLIST_VALIDATE_CONTAINER. .if ${MKSANITIZER:Uno} == "yes" || ${MKLIBCSANITIZER:Uno} == "yes" Index: src/tests/Makefile.inc diff -u src/tests/Makefile.inc:1.9 src/tests/Makefile.inc:1.10 --- src/tests/Makefile.inc:1.9 Sun May 17 18:52:43 2020 +++ src/tests/Makefile.inc Wed Jul 7 11:51:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.9 2020/05/17 18:52:43 christos Exp $ +# $NetBSD: Makefile.inc,v 1.10 2021/07/07 11:51:45 martin Exp $ WARNS ?= 4 CWARNFLAGS+= -Wno-missing-noreturn TOOLSSRCDIR:= ${.PARSEDIR} @@ -9,3 +9,6 @@ LIBRUMPFIFO_PRE = -lrumpvfs_fifofs -lrum LIBRUMPFIFO = -lrumpvfs_nofifofs LIBRUMPBASE = ${LIBRUMPFIFO_PRE} -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrumpuser -lrump -lpthread +.if ${RUMP_SANITIZE:Uno} != "no" +LIBRUMPBASE+= -fsanitize=${RUMP_SANITIZE} +.endif Index: src/tests/rump/modautoload/Makefile diff -u src/tests/rump/modautoload/Makefile:1.12 src/tests/rump/modautoload/Makefile:1.13 --- src/tests/rump/modautoload/Makefile:1.12 Tue May 26 18:52:29 2020 +++ src/tests/rump/modautoload/Makefile Wed Jul 7 11:51:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.12 2020/05/26 18:52:29 christos Exp $ +# $NetBSD: Makefile,v 1.13 2021/07/07 11:51:45 martin Exp $ # .include @@ -25,6 +25,10 @@ LDADD+= \ LDADD+= -lrumpuser -lpthread DPADD+= ${LIBRUMPVFS} ${LIBRUMP} ${LIBRUMPUSER} +.if ${RUMP_SANITIZE:Uno} != "no" +LDADD+= -fsanitize=${RUMP_SANITIZE} +.endif + WARNS= 4 # To include a rump version of sysctlbyname() Index: src/usr.bin/rump_allserver/Makefile diff -u src/usr.bin/rump_allserver/Makefile:1.13 src/usr.bin/rump_allserver/Makefile:1.14 --- src/usr.bin/rump_allserver/Makefile:1.13 Sun May 17 19:37:15 2020 +++ src/usr.bin/rump_allserver/Makefile Wed Jul 7 11:51:45 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2020/05/17 19:37:15 christos Exp $ +# $NetBSD: Makefile,v 1.14 2021/07/07 11:51:45 martin Exp $ # PROG= rump_allserver @@ -14,4 +14,8 @@ RUMPTOP=${.CURDIR}/../../sys/rump LDADD+= ${RUMPDEVLDADD} ${RUMPFSLDADD} ${RUMPKERNLDADD} ${RUMPNETLDADD} LDADD+= -lrumpdev -lrumpnet -lrumpvfs -lrump -lrumpvfs -lrumpvfs_nofifofs -lrump -lrumpuser -lpthread +.if ${RUMP_SANITIZE:Uno} != "no" +LDADD+= -fsanitize=${RUMP_SANITIZE} +.endif + .include Index: src/usr.bin/rump_dhcpclient/Makefile diff -u src/usr.bin/rump_dhcpclient/Makefile:1.3 src/usr.bin/rump_dhcpclient/Makefile:1.4 --- src/usr.bin/rump_dhcpclient/Makefile:1.3 Thu May 11 13:20:02 2017 +++ src/usr.bin/rump_dhcpclient/Makefile Wed Jul 7 11:51:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2017/05/11 13:20:02 sevan Exp $ +# $NetBSD: Makefile,v 1.4 2021/07/07 11:51:46 martin Exp $ # PROG= rump.dhcpclient @@ -6,4 +6,8 @@ SRCS= main.c bpf.c common.c configure.c LDADD+= -lrumpclient +.if ${RUMP_SANITIZE:Uno} != "no" +LDADD+= -fsanitize=${RUMP_SANITIZE} +.endif + .include Inde
CVS commit: [netbsd-9] src
Module Name:src Committed By: martin Date: Tue Jul 6 04:22:35 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/fs/zfs [netbsd-9]: zfs_vnops.c src/sys/rump/librump/rumpkern [netbsd-9]: vm.c src/sys/rump/librump/rumpvfs [netbsd-9]: vm_vfs.c src/sys/uvm [netbsd-9]: uvm_anon.c uvm_page.c uvm_pager.c src/tests/rump/rumpkern [netbsd-9]: t_vm.c Log Message: Pull up following revision(s) - all via patch - (requested by riastradh in ticket #1317): sys/uvm/uvm_page.c: revision 1.248 sys/uvm/uvm_anon.c: revision 1.80 sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.40 sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.41 sys/rump/librump/rumpkern/vm.c: revision 1.191 sys/uvm/uvm_pager.c: revision 1.130 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c: revision 1.71 tests/rump/rumpkern/t_vm.c: revision 1.5 tests/rump/rumpkern/t_vm.c: revision 1.6 sys/rump/librump/rumpvfs/vm_vfs.c: revision 1.39 Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to handle this flag separately. Split out the pages part of uvm_aio_aiodone() into uvm_aio_aiodone_pages() in rump just like in the real kernel. In ZFS functions that can fail to copy data between the ARC and VM pages, use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can handle these "I/O" errors. Fixes PR 55702. fix an incorrect assertion in the previous commit. Handle PG_PAGEOUT in uvm_anon_release() too. Commit the ZFS file that I forgot in this previous commit: Move the handling of PG_PAGEOUT from uvm_aio_aiodone_pages() to uvm_page_unbusy() so that all callers of uvm_page_unbusy() don't need to handle this flag separately. Split out the pages part of uvm_aio_aiodone() into uvm_aio_aiodone_pages() in rump just like in the real kernel. In ZFS functions that can fail to copy data between the ARC and VM pages, use uvm_aio_aiodone_pages() rather than uvm_page_unbusy() so that we can handle these "I/O" errors. Fixes PR 55702. update the rump copy of uvm_page_unbusy() to match the real version, in particular handle PG_PAGEOUT. fixes a few atf tests. the busypage test is buggy, expect it to fail. make rump's uvm_aio_aiodone_pages() look more like the kernel version. fixes some more rumpy assertions. for the busypage test, replace atf_tc_expect_fail() with atf_tc_skip() because atf apparently has no way to expect a test program to crash. fixes PR 55945. To generate a diff of this commit: cvs rdiff -u -r1.50.2.9 -r1.50.2.10 \ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c cvs rdiff -u -r1.173 -r1.173.14.1 src/sys/rump/librump/rumpkern/vm.c cvs rdiff -u -r1.34 -r1.34.34.1 src/sys/rump/librump/rumpvfs/vm_vfs.c cvs rdiff -u -r1.64 -r1.64.8.1 src/sys/uvm/uvm_anon.c cvs rdiff -u -r1.199 -r1.199.4.1 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.111.8.1 -r1.111.8.2 src/sys/uvm/uvm_pager.c cvs rdiff -u -r1.4 -r1.4.16.1 src/tests/rump/rumpkern/t_vm.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/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c diff -u src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.50.2.9 src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.50.2.10 --- src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c:1.50.2.9 Wed May 13 12:41:43 2020 +++ src/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c Tue Jul 6 04:22:34 2021 @@ -6007,6 +6007,12 @@ zfs_netbsd_getpages(void *v) va, DMU_READ_PREFETCH); zfs_unmap_page(pg, va); + if (err != 0) { + uvm_aio_aiodone_pages(ap->a_m, npages, false, err); + memset(ap->a_m, 0, sizeof(ap->a_m[0]) * + npages); + goto out; + } mutex_enter(mtx); pg->flags &= ~(PG_FAKE); pmap_clear_modify(pg); @@ -6023,6 +6029,7 @@ zfs_netbsd_getpages(void *v) mutex_exit(mtx); ap->a_m[ap->a_centeridx] = pg; +out: ZFS_EXIT(zfsvfs); fstrans_done(mp); @@ -6039,14 +6046,13 @@ zfs_putapage(vnode_t *vp, page_t **pp, i voff_t len, klen; int err; - bool async = (flags & PGO_SYNCIO) == 0; bool *cleanedp; struct uvm_object *uobj = &vp->v_uobj; kmutex_t *mtx = uobj->vmobjlock; if (zp->z_sa_hdl == NULL) { err = 0; - goto out_unbusy; + goto out; } /* @@ -6120,14 +6126,8 @@ zfs_putapage(vnode_t *vp, page_t **pp, i } dmu_tx_commit(tx); -out_unbusy: - mutex_enter(mtx); - mutex_enter(&uvm_pageqlock); - uvm_page_unbusy(pp, count); - mutex_exit(&uvm_pageqlock); - mutex_exit(mtx); - out: + uvm_aio_aiodone_pages(pp, count, true, err); return (err); } Index: src/sys/rump/librump/rumpkern/vm.c diff -u src/sys/rump/librump/rumpkern/vm.c:1.173 src/sys/rump/librump/rumpkern/vm.c:1.173.14.1 --- src/sys/rump/librump/rumpkern/vm.c:1.173 Sun May 14 13:49:55 2017 +++ src/sys/rump/librump/rumpkern/
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Tue Jul 6 04:23:55 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1312 - #1317 To generate a diff of this commit: cvs rdiff -u -r1.1.2.13 -r1.1.2.14 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.13 src/doc/CHANGES-9.3:1.1.2.14 --- src/doc/CHANGES-9.3:1.1.2.13 Tue Jul 6 03:46:24 2021 +++ src/doc/CHANGES-9.3 Tue Jul 6 04:23:55 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.13 2021/07/06 03:46:24 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.14 2021/07/06 04:23:55 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -289,3 +289,53 @@ sys/miscfs/kernfs/kernfs_vnops.c 1.169, Fix permissons on /kern/{r,}rootdev. [dholland, ticket #1318] +sys/arch/hppa/hppa/intr.c 1.4 + + Fix off by one which resulted in all idle time reported as interrupt + time. + [macallan, ticket #1312] + +common/lib/libc/arch/arm/atomic/atomic_add_64.S 1.12 +common/lib/libc/arch/arm/atomic/atomic_and_64.S 1.11 +common/lib/libc/arch/arm/atomic/atomic_cas_8.S 1.8 +common/lib/libc/arch/arm/atomic/atomic_nand_64.S 1.5 +common/lib/libc/arch/arm/atomic/atomic_or_64.S 1.12 +common/lib/libc/arch/arm/atomic/atomic_sub_64.S 1.3 +common/lib/libc/arch/arm/atomic/atomic_swap_64.S 1.13 +common/lib/libc/arch/arm/atomic/atomic_xor_64.S 1.5 + + Whitespace fixes to help later pullups. + [skrll, ticket #1313] + +common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S 1.3 +common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S 1.3 +common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S 1.4 +common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S 1.3 +common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S 1.4 +common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S 1.3 +common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S 1.4 + + Fix the logic operation for atomic_nand_{8,16,32,64}. + [skrll, ticket #1314] + +external/cddl/osnet/sys/kern/printf.c 1.3 + + Use vpanic, not vprintf and then panic. + [riastradh, ticket #1315] + +external/cddl/osnet/dist/uts/common/dtrace/dtrace.c 1.41 + + Remove a pointless printf. + [riastradh, ticket #1316] + +external/cddl/osnet/dist/uts/common/fs/zfs/zfs_vnops.c 1.71 (patch) +sys/rump/librump/rumpkern/vm.c 1.191 (patch) +sys/rump/librump/rumpvfs/vm_vfs.c 1.39-1.41 (patch) +sys/uvm/uvm_anon.c1.80 (patch) +sys/uvm/uvm_page.c1.248 (patch) +sys/uvm/uvm_pager.c1.130 (patch) +tests/rump/rumpkern/t_vm.c 1.5,1.6 (patch) + + PR 55702, PR 55945: fix uvm pageout crashes. + [riastradh, ticket #1317] +
CVS commit: [netbsd-9] src/external/cddl/osnet/dist/uts/common/dtrace
Module Name:src Committed By: martin Date: Tue Jul 6 04:17:03 UTC 2021 Modified Files: src/external/cddl/osnet/dist/uts/common/dtrace [netbsd-9]: dtrace.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1316): external/cddl/osnet/dist/uts/common/dtrace/dtrace.c: revision 1.41 Remove a pointless printf. To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.39.2.1 \ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.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/cddl/osnet/dist/uts/common/dtrace/dtrace.c diff -u src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.39 src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.39.2.1 --- src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c:1.39 Fri Jul 5 08:28:52 2019 +++ src/external/cddl/osnet/dist/uts/common/dtrace/dtrace.c Tue Jul 6 04:17:03 2021 @@ -13840,7 +13840,6 @@ doferr: return (NULL); #endif /* __FreeBSD__ */ #ifdef __NetBSD__ - printf("dtrace: XXX %s not implemented (name=%s)\n", __func__, name); return (NULL); #endif /* __NetBSD__ */ }
CVS commit: [netbsd-9] src/external/cddl/osnet/sys/kern
Module Name:src Committed By: martin Date: Tue Jul 6 04:15:27 UTC 2021 Modified Files: src/external/cddl/osnet/sys/kern [netbsd-9]: printf.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1315): external/cddl/osnet/sys/kern/printf.c: revision 1.3 Use vpanic, not vprintf and then panic. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.4.1 src/external/cddl/osnet/sys/kern/printf.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/cddl/osnet/sys/kern/printf.c diff -u src/external/cddl/osnet/sys/kern/printf.c:1.2 src/external/cddl/osnet/sys/kern/printf.c:1.2.4.1 --- src/external/cddl/osnet/sys/kern/printf.c:1.2 Mon May 28 21:05:09 2018 +++ src/external/cddl/osnet/sys/kern/printf.c Tue Jul 6 04:15:26 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: printf.c,v 1.2 2018/05/28 21:05:09 chs Exp $ */ +/* $NetBSD: printf.c,v 1.2.4.1 2021/07/06 04:15:26 martin Exp $ */ /* * CDDL HEADER START @@ -41,10 +41,8 @@ vcmn_err(int ce, const char *fmt, va_lis char buf[256]; size_t len; - if (ce == CE_PANIC) { - vprintf(fmt, adx); - panic("panic"); - } + if (ce == CE_PANIC) + vpanic(fmt, adx); if ((uint_t)ce < CE_IGNORE) { strcpy(buf, ce_prefix[ce]);
CVS commit: [netbsd-9] src/common/lib/libc/arch/aarch64/atomic
Module Name:src Committed By: martin Date: Tue Jul 6 04:13:50 UTC 2021 Modified Files: src/common/lib/libc/arch/aarch64/atomic [netbsd-9]: atomic_nand_16.S atomic_nand_32.S atomic_nand_64.S atomic_nand_8.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1314): common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S: revision 1.3 common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S: revision 1.3 common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S: revision 1.4 common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S: revision 1.3 common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S: revision 1.3 common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S: revision 1.4 Fix the logic operation for atomic_nand_{8,16,32,64} From the gcc docs the operations are as follows { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } // nand { tmp = ~(*ptr & value); *ptr = tmp; return *ptr; } // nand yes, this is really rather strange. typo in comment s/pte/ptr/ To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.1.28.1 \ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S \ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S \ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_64.S \ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_8.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1 src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1.28.1 --- src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S:1.1 Sun Aug 10 05:47:35 2014 +++ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_16.S Tue Jul 6 04:13:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_16.S,v 1.1 2014/08/10 05:47:35 matt Exp $ */ +/* $NetBSD: atomic_nand_16.S,v 1.1.28.1 2021/07/06 04:13:50 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,11 +31,14 @@ #include "atomic_op_asm.h" +/* + * { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } // nand + */ ENTRY_NP(_atomic_nand_16) mov x4, x0 -1: ldxrh w0, [x4] /* load old value (to be returned) */ - mvn w3, w0 /* complement source */ - and w3, w3, w1 /* calculate new value */ +1: ldxrh w0, [x4] /* load old value (*ptr) */ + and w3, w0, w1 /* w3 = (*ptr & value) */ + mvn w3, w3 /* w3 = ~(*pte & value) */ stxrh w2, w3, [x4] /* try to store */ cbnz w2, 1b /* succeed? no, try again */ dmb st @@ -47,11 +50,15 @@ ATOMIC_OP_ALIAS(atomic_nand_ushort,_atom STRONG_ALIAS(__sync_fetch_and_nand_2,_atomic_nand_16) STRONG_ALIAS(_atomic_nand_ushort,_atomic_nand_16) + +/* + * { tmp = ~(*ptr & value); *ptr = tmp; return *ptr; } // nand + */ ENTRY_NP(_atomic_nand_16_nv) mov x4, x0 /* need r0 for return value */ -1: ldxrh w0, [x4] /* load old value */ - mvn w0, w0 /* complement source */ - and w0, w0, w1 /* calculate new value (return value) */ +1: ldxrh w0, [x4] /* load old value (*ptr) */ + and w0, w0, w1 /* w0 = (*ptr & value) */ + mvn w0, w0 /* w0 = ~(*pte & value), return value */ stxrh w2, w0, [x4] /* try to store */ cbnz w2, 1b /* succeed? no, try again? */ dmb st Index: src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S diff -u src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S:1.1 src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S:1.1.28.1 --- src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S:1.1 Sun Aug 10 05:47:35 2014 +++ src/common/lib/libc/arch/aarch64/atomic/atomic_nand_32.S Tue Jul 6 04:13:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_nand_32.S,v 1.1 2014/08/10 05:47:35 matt Exp $ */ +/* $NetBSD: atomic_nand_32.S,v 1.1.28.1 2021/07/06 04:13:50 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,11 +31,14 @@ #include "atomic_op_asm.h" +/* + * { tmp = *ptr; *ptr = ~(tmp & value); return tmp; } // nand + */ ENTRY_NP(_atomic_nand_32) mov x4, x0 1: ldxr w0, [x4] /* load old value (to be returned) */ - mvn w3, w0 /* complement source */ - and w3, w3, w1 /* calculate new value */ + and w3, w0, w1 /* w3 = (*ptr & value) */ + mvn w3, w3 /* x3 = ~(*ptr & value) */ stxr w2, w3, [x4] /* try to store */ cbnz w2, 1b /* succeed? no, try again */ dmb st @@ -47,11 +50,15 @@ ATOMIC_OP_ALIAS(atomic_nand_uint,_atomic STRONG_ALIAS(__sync_fetch_and_nand_4,_atomic_nand_32) STRONG_ALIAS(_atomic_nand_uint,_atomic_nand_32) + +/* + * { tmp = ~(*ptr & value); *ptr = tmp; return *ptr; } // nand + */ ENTRY_NP(_atomic_nand_32_nv) mov x4, x0 /* need r0 for return value */ -1: ldxr w0, [x4] /* load old value */ - mvn w0, w0 /* complement source */ - and w0, w0, w1 /* calculate new value (return value) */ +1: ldxr w0, [x4]
CVS commit: [netbsd-9] src/common/lib/libc/arch/arm/atomic
Module Name:src Committed By: martin Date: Tue Jul 6 04:11:31 UTC 2021 Modified Files: src/common/lib/libc/arch/arm/atomic [netbsd-9]: atomic_add_64.S atomic_and_64.S atomic_cas_8.S atomic_nand_64.S atomic_or_64.S atomic_sub_64.S atomic_swap_64.S atomic_xor_64.S Log Message: Pull up following revision(s) (requested by skrll in ticket #1313): common/lib/libc/arch/arm/atomic/atomic_xor_64.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_nand_64.S: revision 1.5 common/lib/libc/arch/arm/atomic/atomic_or_64.S: revision 1.12 common/lib/libc/arch/arm/atomic/atomic_cas_8.S: revision 1.8 common/lib/libc/arch/arm/atomic/atomic_sub_64.S: revision 1.3 common/lib/libc/arch/arm/atomic/atomic_and_64.S: revision 1.11 common/lib/libc/arch/arm/atomic/atomic_swap_64.S: revision 1.13 common/lib/libc/arch/arm/atomic/atomic_add_64.S: revision 1.12 Whitespace To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.11.28.1 \ src/common/lib/libc/arch/arm/atomic/atomic_add_64.S cvs rdiff -u -r1.10 -r1.10.28.1 \ src/common/lib/libc/arch/arm/atomic/atomic_and_64.S cvs rdiff -u -r1.7 -r1.7.28.1 \ src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S cvs rdiff -u -r1.4 -r1.4.18.1 \ src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S cvs rdiff -u -r1.10.28.1 -r1.10.28.2 \ src/common/lib/libc/arch/arm/atomic/atomic_or_64.S cvs rdiff -u -r1.2 -r1.2.32.1 \ src/common/lib/libc/arch/arm/atomic/atomic_sub_64.S cvs rdiff -u -r1.10.18.2 -r1.10.18.3 \ src/common/lib/libc/arch/arm/atomic/atomic_swap_64.S cvs rdiff -u -r1.3.32.1 -r1.3.32.2 \ src/common/lib/libc/arch/arm/atomic/atomic_xor_64.S Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/common/lib/libc/arch/arm/atomic/atomic_add_64.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.11 src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.11.28.1 --- src/common/lib/libc/arch/arm/atomic/atomic_add_64.S:1.11 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_add_64.S Tue Jul 6 04:11:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_add_64.S,v 1.11 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_add_64.S,v 1.11.28.1 2021/07/06 04:11:31 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -33,7 +33,7 @@ #ifdef _ARM_ARCH_6 ENTRY_NP(_atomic_add_64_nv) - push {r3,r4} /* save temporary */ + push {r3, r4} /* save temporary */ mov ip, r0 /* need r0 for return value */ #ifndef __ARM_EABI__ mov r3, r2 @@ -50,7 +50,7 @@ ENTRY_NP(_atomic_add_64_nv) #else mcr p15, 0, r4, c7, c10, 5 /* data memory barrier */ #endif - pop {r3,r4} /* restore temporary */ + pop {r3, r4} /* restore temporary */ RET/* return new value */ END(_atomic_add_64_nv) Index: src/common/lib/libc/arch/arm/atomic/atomic_and_64.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.10 src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.10.28.1 --- src/common/lib/libc/arch/arm/atomic/atomic_and_64.S:1.10 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_and_64.S Tue Jul 6 04:11:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_and_64.S,v 1.10 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_and_64.S,v 1.10.28.1 2021/07/06 04:11:31 martin Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -33,7 +33,7 @@ #ifdef _ARM_ARCH_6 ENTRY_NP(_atomic_and_64_nv) - push {r3,r4} /* save temporary */ + push {r3, r4} /* save temporary */ #ifndef __ARM_EABI__ mov r3, r2 mov r2, r1 @@ -50,7 +50,7 @@ ENTRY_NP(_atomic_and_64_nv) #else mcr p15, 0, r4, c7, c10, 5 /* data memory barrier */ #endif - pop {r3,r4} /* restore temporary */ + pop {r3, r4} /* restore temporary */ RET/* return new value */ END(_atomic_and_64_nv) Index: src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.7 src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.7.28.1 --- src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S:1.7 Tue Mar 4 16:15:28 2014 +++ src/common/lib/libc/arch/arm/atomic/atomic_cas_8.S Tue Jul 6 04:11:31 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: atomic_cas_8.S,v 1.7 2014/03/04 16:15:28 matt Exp $ */ +/* $NetBSD: atomic_cas_8.S,v 1.7.28.1 2021/07/06 04:11:31 martin Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -55,7 +55,7 @@ ENTRY_NP(_atomic_cas_8) mcr p15, 0, r3, c7, c10, 4 /* data synchronization barrier */ #endif 2: RET/* return. */ - END(_atomic_cas_8) +END(_atomic_cas_8) ATOMIC_OP_ALIAS(atomic_cas_8,_atomic_cas_8) STRONG_ALIAS(_atomic_cas_char,_atomic_cas_8) Index: src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S diff -u src/common/lib/libc/arch/arm/atomic/atomic_nand_64.S:1.4 src/common/lib/libc/arch/arm/atomic/atomic_nand_6
CVS commit: [netbsd-9] src/sys/arch/hppa/hppa
Module Name:src Committed By: martin Date: Tue Jul 6 04:05:14 UTC 2021 Modified Files: src/sys/arch/hppa/hppa [netbsd-9]: intr.c Log Message: Pull up following revision(s) (requested by macallan in ticket #1312): sys/arch/hppa/hppa/intr.c: revision 1.4 fix off by one which resulted in all idle time reported as interrupt time final fix from nick@ To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.2.1 src/sys/arch/hppa/hppa/intr.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/hppa/hppa/intr.c diff -u src/sys/arch/hppa/hppa/intr.c:1.3 src/sys/arch/hppa/hppa/intr.c:1.3.2.1 --- src/sys/arch/hppa/hppa/intr.c:1.3 Sat May 4 13:04:36 2019 +++ src/sys/arch/hppa/hppa/intr.c Tue Jul 6 04:05:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $ */ +/* $NetBSD: intr.c,v 1.3.2.1 2021/07/06 04:05:14 martin Exp $ */ /* $OpenBSD: intr.c,v 1.27 2009/12/31 12:52:35 jsing Exp $ */ /* @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3 2019/05/04 13:04:36 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.3.2.1 2021/07/06 04:05:14 martin Exp $"); #define __MUTEX_PRIVATE @@ -435,7 +435,7 @@ hppa_intr_dispatch(int ncpl, int eiem, s ib->ib_evcnt.ev_count++; arg = ib->ib_arg; if (arg == NULL) { - clkframe.cf_flags = (ci->ci_intr_depth ? + clkframe.cf_flags = (ci->ci_intr_depth > 1 ? TFF_INTR : 0); clkframe.cf_spl = ncpl; if (frame != NULL) {
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Tue Jul 6 03:46:24 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Ticket #1318 To generate a diff of this commit: cvs rdiff -u -r1.1.2.12 -r1.1.2.13 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.12 src/doc/CHANGES-9.3:1.1.2.13 --- src/doc/CHANGES-9.3:1.1.2.12 Sat Jul 3 10:20:00 2021 +++ src/doc/CHANGES-9.3 Tue Jul 6 03:46:24 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.12 2021/07/03 10:20:00 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.13 2021/07/06 03:46:24 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -283,3 +283,9 @@ sys/dev/ic/dp8390.c1.99 so that the media-related ioctls work. [thorpej, ticket #1311] +sys/miscfs/kernfs/kernfs_vnops.c 1.169,1.170 + + Add missing VOP_KQFILTER to kernfs. + Fix permissons on /kern/{r,}rootdev. + [dholland, ticket #1318] +
CVS commit: [netbsd-9] src/sys/miscfs/kernfs
Module Name:src Committed By: martin Date: Tue Jul 6 03:45:11 UTC 2021 Modified Files: src/sys/miscfs/kernfs [netbsd-9]: kernfs_vnops.c Log Message: Pull up following revision(s) (requested by dholland in ticket #1318): sys/miscfs/kernfs/kernfs_vnops.c: revision 1.169 sys/miscfs/kernfs/kernfs_vnops.c: revision 1.170 Add missing VOP_KQFILTER to kernfs. Not sure if lack of it can be used for local DoS or not, but best to fix. - Fix perms on /kern/{r,}rootdev. To generate a diff of this commit: cvs rdiff -u -r1.160.4.2 -r1.160.4.3 src/sys/miscfs/kernfs/kernfs_vnops.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/miscfs/kernfs/kernfs_vnops.c diff -u src/sys/miscfs/kernfs/kernfs_vnops.c:1.160.4.2 src/sys/miscfs/kernfs/kernfs_vnops.c:1.160.4.3 --- src/sys/miscfs/kernfs/kernfs_vnops.c:1.160.4.2 Wed Feb 12 19:59:22 2020 +++ src/sys/miscfs/kernfs/kernfs_vnops.c Tue Jul 6 03:45:11 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kernfs_vnops.c,v 1.160.4.2 2020/02/12 19:59:22 martin Exp $ */ +/* $NetBSD: kernfs_vnops.c,v 1.160.4.3 2021/07/06 03:45:11 martin Exp $ */ /* * Copyright (c) 1992, 1993 @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.160.4.2 2020/02/12 19:59:22 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kernfs_vnops.c,v 1.160.4.3 2021/07/06 03:45:11 martin Exp $"); #include #include @@ -91,8 +91,8 @@ const struct kern_target kern_targets[] #if 0 { DT_DIR, N("root"), 0,KFSnull,VDIR, DIR_MODE }, #endif - { DT_BLK, N("rootdev"), &rootdev, KFSdevice, VBLK, READ_MODE }, - { DT_CHR, N("rrootdev"), &rrootdev,KFSdevice, VCHR, READ_MODE }, + { DT_BLK, N("rootdev"), &rootdev, KFSdevice, VBLK, UREAD_MODE }, + { DT_CHR, N("rrootdev"), &rrootdev,KFSdevice, VCHR, UREAD_MODE }, { DT_REG, N("time"), 0,KFStime,VREG, READ_MODE }, /* XXXUNCONST */ { DT_REG, N("version"), __UNCONST(version), @@ -197,6 +197,7 @@ const struct vnodeopv_entry_desc kernfs_ { &vop_fcntl_desc, kernfs_fcntl }, /* fcntl */ { &vop_ioctl_desc, kernfs_ioctl }, /* ioctl */ { &vop_poll_desc, kernfs_poll }, /* poll */ + { &vop_kqfilter_desc, genfs_kqfilter }, /* kqfilter */ { &vop_revoke_desc, kernfs_revoke }, /* revoke */ { &vop_fsync_desc, kernfs_fsync }, /* fsync */ { &vop_seek_desc, kernfs_seek }, /* seek */ @@ -245,6 +246,7 @@ const struct vnodeopv_entry_desc kernfs_ { &vop_fcntl_desc, spec_fcntl }, /* fcntl */ { &vop_ioctl_desc, spec_ioctl }, /* ioctl */ { &vop_poll_desc, spec_poll }, /* poll */ + { &vop_kqfilter_desc, genfs_kqfilter }, /* kqfilter */ { &vop_revoke_desc, spec_revoke }, /* revoke */ { &vop_fsync_desc, spec_fsync }, /* fsync */ { &vop_seek_desc, spec_seek }, /* seek */
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Sat Jul 3 10:20:00 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Ticket #1311 To generate a diff of this commit: cvs rdiff -u -r1.1.2.11 -r1.1.2.12 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.11 src/doc/CHANGES-9.3:1.1.2.12 --- src/doc/CHANGES-9.3:1.1.2.11 Fri Jun 25 19:09:53 2021 +++ src/doc/CHANGES-9.3 Sat Jul 3 10:20:00 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.11 2021/06/25 19:09:53 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.12 2021/07/03 10:20:00 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -275,3 +275,11 @@ distrib/sun3/miniroot/Makefile 1.50 - The modules and rescue sets are also required on upgrade. [tsutsui, ticket #1310] +sys/dev/ic/ax88190.c1.18 +sys/dev/ic/dl10019.c1.17 +sys/dev/ic/dp8390.c1.99 + + Make sure the media / mii members in struct ethercom are initialized + so that the media-related ioctls work. + [thorpej, ticket #1311] +
CVS commit: [netbsd-9] src/sys/dev/ic
Module Name:src Committed By: martin Date: Sat Jul 3 10:18:16 UTC 2021 Modified Files: src/sys/dev/ic [netbsd-9]: ax88190.c dl10019.c dp8390.c Log Message: Pull up following revision(s) (requested by thorpej in ticket #1311): sys/dev/ic/dp8390.c: revision 1.99 sys/dev/ic/dl10019.c: revision 1.17 sys/dev/ic/ax88190.c: revision 1.18 Make sure the media / mii members in struct ethercom are initialized so that the media-related ioctls work. Problem reported by Bj�rn Johannesson on current-users@. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.2.1 src/sys/dev/ic/ax88190.c cvs rdiff -u -r1.14 -r1.14.2.1 src/sys/dev/ic/dl10019.c cvs rdiff -u -r1.95 -r1.95.2.1 src/sys/dev/ic/dp8390.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/ic/ax88190.c diff -u src/sys/dev/ic/ax88190.c:1.15 src/sys/dev/ic/ax88190.c:1.15.2.1 --- src/sys/dev/ic/ax88190.c:1.15 Wed May 29 06:17:28 2019 +++ src/sys/dev/ic/ax88190.c Sat Jul 3 10:18:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ax88190.c,v 1.15 2019/05/29 06:17:28 msaitoh Exp $ */ +/* $NetBSD: ax88190.c,v 1.15.2.1 2021/07/03 10:18:16 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.15 2019/05/29 06:17:28 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ax88190.c,v 1.15.2.1 2021/07/03 10:18:16 martin Exp $"); #include #include @@ -86,6 +86,8 @@ ax88190_media_init(struct dp8390_softc * struct ifnet *ifp = &sc->sc_ec.ec_if; struct mii_data *mii = &sc->sc_mii; + sc->sc_ec.ec_mii = mii; + mii->mii_ifp = ifp; mii->mii_readreg = ax88190_mii_readreg; mii->mii_writereg = ax88190_mii_writereg; Index: src/sys/dev/ic/dl10019.c diff -u src/sys/dev/ic/dl10019.c:1.14 src/sys/dev/ic/dl10019.c:1.14.2.1 --- src/sys/dev/ic/dl10019.c:1.14 Wed May 29 06:17:28 2019 +++ src/sys/dev/ic/dl10019.c Sat Jul 3 10:18:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dl10019.c,v 1.14 2019/05/29 06:17:28 msaitoh Exp $ */ +/* $NetBSD: dl10019.c,v 1.14.2.1 2021/07/03 10:18:16 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.14 2019/05/29 06:17:28 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dl10019.c,v 1.14.2.1 2021/07/03 10:18:16 martin Exp $"); #include #include @@ -119,6 +119,8 @@ dl10019_media_init(struct dp8390_softc * struct ifnet *ifp = &sc->sc_ec.ec_if; struct mii_data *mii = &sc->sc_mii; + sc->sc_ec.ec_mii = mii; + mii->mii_ifp = ifp; mii->mii_readreg = dl10019_mii_readreg; mii->mii_writereg = dl10019_mii_writereg; Index: src/sys/dev/ic/dp8390.c diff -u src/sys/dev/ic/dp8390.c:1.95 src/sys/dev/ic/dp8390.c:1.95.2.1 --- src/sys/dev/ic/dp8390.c:1.95 Wed May 29 10:07:29 2019 +++ src/sys/dev/ic/dp8390.c Sat Jul 3 10:18:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dp8390.c,v 1.95 2019/05/29 10:07:29 msaitoh Exp $ */ +/* $NetBSD: dp8390.c,v 1.95.2.1 2021/07/03 10:18:16 martin Exp $ */ /* * Device driver for National Semiconductor DS8390/WD83C690 based ethernet @@ -14,7 +14,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.95 2019/05/29 10:07:29 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dp8390.c,v 1.95.2.1 2021/07/03 10:18:16 martin Exp $"); #include "opt_inet.h" @@ -66,7 +66,6 @@ void dp8390_media_init(struct dp8390_softc *sc) { - sc->sc_ec.ec_ifmedia = &sc->sc_media; ifmedia_init(&sc->sc_media, 0, dp8390_mediachange, dp8390_mediastatus); ifmedia_add(&sc->sc_media, IFM_ETHER | IFM_MANUAL, 0, NULL); ifmedia_set(&sc->sc_media, IFM_ETHER | IFM_MANUAL); @@ -131,7 +130,13 @@ dp8390_config(struct dp8390_softc *sc) aprint_normal_dev(sc->sc_dev, "Ethernet address %s\n", ether_sprintf(sc->sc_enaddr)); - /* Initialize media goo. */ + /* + * Initialize media structures. We'll default to pointing ec_ifmedia + * at our embedded media structure. A card front-end can initialize + * ec_mii if it has an MII interface. (Note that sc_media is an + * alias of sc_mii.mii_media in dp8390_softc.) + */ + sc->sc_ec.ec_ifmedia = &sc->sc_media; (*sc->sc_media_init)(sc); /* We can support 802.1Q VLAN-sized frames. */
CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86
Module Name:xsrc Committed By: martin Date: Sat Jul 3 09:43:29 UTC 2021 Modified Files: xsrc/external/mit/xorg-server/dist/hw/xfree86/common: compiler.h xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd: ppc_video.c Log Message: Add missing include of compiler.h and make all declarations of IOPortBase consistent. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 \ xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h cvs rdiff -u -r1.13 -r1.14 \ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.17 xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.18 --- xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h:1.17 Mon May 31 21:44:19 2021 +++ xsrc/external/mit/xorg-server/dist/hw/xfree86/common/compiler.h Sat Jul 3 09:43:29 2021 @@ -525,7 +525,7 @@ xf86WriteMmio32Le(__volatile__ void *bas #define PORT_SIZE short #endif -extern unsigned int IOPortBase; /* Memory mapped I/O port area */ +extern unsigned PORT_SIZE IOPortBase; /* Memory mapped I/O port area */ static __inline__ void outb(unsigned PORT_SIZE port, unsigned char val) Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.13 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.14 --- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c:1.13 Fri Jul 2 19:31:47 2021 +++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bsd/ppc_video.c Sat Jul 3 09:43:29 2021 @@ -36,6 +36,7 @@ #include "xf86_OSlib.h" #include "xf86OSpriv.h" +#include "compiler.h" #include "bus/Pci.h" /***/
CVS commit: src/sys/kern
Module Name:src Committed By: martin Date: Thu Jul 1 15:53:20 UTC 2021 Modified Files: src/sys/kern: vfs_vnops.c Log Message: gcc (with some options) eroneously claims we would use "vp" uninitialized, so initialize it as NULL. To generate a diff of this commit: cvs rdiff -u -r1.219 -r1.220 src/sys/kern/vfs_vnops.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/vfs_vnops.c diff -u src/sys/kern/vfs_vnops.c:1.219 src/sys/kern/vfs_vnops.c:1.220 --- src/sys/kern/vfs_vnops.c:1.219 Thu Jul 1 04:25:51 2021 +++ src/sys/kern/vfs_vnops.c Thu Jul 1 15:53:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $ */ +/* $NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.219 2021/07/01 04:25:51 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.220 2021/07/01 15:53:20 martin Exp $"); #include "veriexec.h" @@ -164,7 +164,7 @@ vn_open(struct vnode *at_dvp, struct pat struct vnode **ret_vp, bool *ret_domove, int *ret_fd) { struct nameidata nd; - struct vnode *vp; + struct vnode *vp = NULL; struct lwp *l = curlwp; kauth_cred_t cred = l->l_cred; struct vattr va;
CVS commit: src/sys/arch/powerpc/oea
Module Name:src Committed By: martin Date: Sun Jun 27 12:26:33 UTC 2021 Modified Files: src/sys/arch/powerpc/oea: pmap.c Log Message: PR 55325: unify both pvo pools (for managed and unmanaged pages). Analyzis by rin, fix suggested by chs. To generate a diff of this commit: cvs rdiff -u -r1.105 -r1.106 src/sys/arch/powerpc/oea/pmap.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/powerpc/oea/pmap.c diff -u src/sys/arch/powerpc/oea/pmap.c:1.105 src/sys/arch/powerpc/oea/pmap.c:1.106 --- src/sys/arch/powerpc/oea/pmap.c:1.105 Fri Mar 12 18:10:00 2021 +++ src/sys/arch/powerpc/oea/pmap.c Sun Jun 27 12:26:33 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.105 2021/03/12 18:10:00 thorpej Exp $ */ +/* $NetBSD: pmap.c,v 1.106 2021/06/27 12:26:33 martin Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. * All rights reserved. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.105 2021/03/12 18:10:00 thorpej Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.106 2021/06/27 12:26:33 martin Exp $"); #define PMAP_NOOPNAMES @@ -172,8 +172,7 @@ static u_int mem_cnt, avail_cnt; #define pmap_procwr PMAPNAME(procwr) #define pmap_pool PMAPNAME(pool) -#define pmap_upvo_pool PMAPNAME(upvo_pool) -#define pmap_mpvo_pool PMAPNAME(mpvo_pool) +#define pmap_pvo_pool PMAPNAME(pvo_pool) #define pmap_pvo_table PMAPNAME(pvo_table) #if defined(DEBUG) || defined(PMAPCHECK) || defined(DDB) #define pmap_pte_print PMAPNAME(pte_print) @@ -333,8 +332,7 @@ static struct pvo_head pmap_pvo_kunmanag static struct pvo_head pmap_pvo_unmanaged = LIST_HEAD_INITIALIZER(pmap_pvo_unmanaged); /* list of unmanaged pages */ struct pool pmap_pool; /* pool for pmap structures */ -struct pool pmap_upvo_pool; /* pool for pvo entries for unmanaged pages */ -struct pool pmap_mpvo_pool; /* pool for pvo entries for managed pages */ +struct pool pmap_pvo_pool; /* pool for pvo entries */ /* * We keep a cache of unmanaged pages to be used for pvo entries for @@ -344,28 +342,16 @@ struct pvo_page { SIMPLEQ_ENTRY(pvo_page) pvop_link; }; SIMPLEQ_HEAD(pvop_head, pvo_page); -static struct pvop_head pmap_upvop_head = SIMPLEQ_HEAD_INITIALIZER(pmap_upvop_head); -static struct pvop_head pmap_mpvop_head = SIMPLEQ_HEAD_INITIALIZER(pmap_mpvop_head); -static u_long pmap_upvop_free; -static u_long pmap_upvop_maxfree; -static u_long pmap_mpvop_free; -static u_long pmap_mpvop_maxfree; - -static void *pmap_pool_ualloc(struct pool *, int); -static void *pmap_pool_malloc(struct pool *, int); - -static void pmap_pool_ufree(struct pool *, void *); -static void pmap_pool_mfree(struct pool *, void *); - -static struct pool_allocator pmap_pool_mallocator = { - .pa_alloc = pmap_pool_malloc, - .pa_free = pmap_pool_mfree, - .pa_pagesz = 0, -}; - -static struct pool_allocator pmap_pool_uallocator = { - .pa_alloc = pmap_pool_ualloc, - .pa_free = pmap_pool_ufree, +static struct pvop_head pmap_pvop_head = SIMPLEQ_HEAD_INITIALIZER(pmap_pvop_head); +static u_long pmap_pvop_free; +static u_long pmap_pvop_maxfree; + +static void *pmap_pool_alloc(struct pool *, int); +static void pmap_pool_free(struct pool *, void *); + +static struct pool_allocator pmap_pool_allocator = { + .pa_alloc = pmap_pool_alloc, + .pa_free = pmap_pool_free, .pa_pagesz = 0, }; @@ -1101,14 +1087,8 @@ pmap_real_memory(paddr_t *start, psize_t void pmap_init(void) { - pool_init(&pmap_mpvo_pool, sizeof(struct pvo_entry), - sizeof(struct pvo_entry), 0, 0, "pmap_mpvopl", - &pmap_pool_mallocator, IPL_NONE); - - pool_setlowat(&pmap_mpvo_pool, 1008); pmap_initialized = 1; - } /* @@ -1532,13 +1512,6 @@ pmap_pvo_reclaim(struct pmap *pm) return NULL; } -static struct pool * -pmap_pvo_pl(struct pvo_entry *pvo) -{ - - return PVO_MANAGED_P(pvo) ? &pmap_mpvo_pool : &pmap_upvo_pool; -} - /* * This returns whether this is the first mapping of a page. */ @@ -1603,9 +1576,7 @@ pmap_pvo_enter(pmap_t pm, struct pool *p --pmap_pvo_enter_depth; #endif pmap_interrupts_restore(msr); - if (pvo) { - KASSERT(pmap_pvo_pl(pvo) == pl); - } else { + if (pvo == NULL) { pvo = pool_get(pl, poolflags); } KASSERT((vaddr_t)pvo < VM_MIN_KERNEL_ADDRESS); @@ -1811,7 +1782,7 @@ void pmap_pvo_free(struct pvo_entry *pvo) { - pool_put(pmap_pvo_pl(pvo), pvo); + pool_put(&pmap_pvo_pool, pvo); } void @@ -1883,7 +1854,6 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ struct mem_region *mp; struct pvo_head *pvo_head; struct vm_page *pg; - struct pool *pl; register_t pte_lo; int error; u_int was_exec = 0; @@ -1892,12 +1862,10 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_ if (__predict_false(!pmap_initialized)) { pvo_head = &pmap_pvo_kunmanaged; - pl = &pmap_upvo_pool; pg = NULL; was_exec = PTE_EXEC; } else { pvo_head = pa_to_pvoh(pa, &pg); - pl = &pmap_mpvo_pool; } DPRINTFN(ENTER, @@ -1961,7 +1929,7 @@
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Fri Jun 25 19:14:30 UTC 2021 Modified Files: src/doc [netbsd-8]: CHANGES-8.3 Log Message: Ticket #1686 To generate a diff of this commit: cvs rdiff -u -r1.1.2.92 -r1.1.2.93 src/doc/CHANGES-8.3 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.3 diff -u src/doc/CHANGES-8.3:1.1.2.92 src/doc/CHANGES-8.3:1.1.2.93 --- src/doc/CHANGES-8.3:1.1.2.92 Mon Jun 21 17:46:13 2021 +++ src/doc/CHANGES-8.3 Fri Jun 25 19:14:29 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.3,v 1.1.2.92 2021/06/21 17:46:13 martin Exp $ +# $NetBSD: CHANGES-8.3,v 1.1.2.93 2021/06/25 19:14:29 martin Exp $ A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3 release: @@ -1972,3 +1972,14 @@ compat/arm/oabi/bsd.oabi.mk (apply patc Fix PR 50192. [mrg, ticket #1684] +distrib/miniroot/install.sub 1.61,1.62 (patch) +distrib/sun2/miniroot/Makefile 1.40 +distrib/sun3/miniroot/Makefile 1.50 + + Fixes to sun2 and sun3 miniroot upgrade scripts: + - Replace RELEASE and VERSION strings proplery. + - Remove netstat(1) calls to print resolver info on upgrade using + miniroot, the binary is not available. + - The modules and rescue sets are also required on upgrade. + [tsutsui, ticket #1686] +
CVS commit: [netbsd-8] src/distrib
Module Name:src Committed By: martin Date: Fri Jun 25 19:13:20 UTC 2021 Modified Files: src/distrib/miniroot [netbsd-8]: install.sub src/distrib/sun2/miniroot [netbsd-8]: Makefile src/distrib/sun3/miniroot [netbsd-8]: Makefile Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1686): distrib/sun3/miniroot/Makefile: revision 1.50 distrib/miniroot/install.sub: revision 1.61 distrib/miniroot/install.sub: revision 1.62 (patch) distrib/sun2/miniroot/Makefile: revision 1.40 Replace RELEASE and VERSION strings proplery. sun2 and sun3 don't use MI src/distrib/miniroot/list so this should have been sync'ed with it. http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.36 > Use proper release version strings ("9.1" rather than "91") in banners. > > Also define and use "MACHINE" variable to describe port names > (no uname(1) or sysctl(8) in miniroot binary list by default). Should be pulled up to netbsd-9. Remove netstat(1) calls to print resolver info on upgrade using miniroot. netstat(1) was removed from miniroot 25 years ago. http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.5 The modules and rescue sets are also required on upgrade. Should be pulled up to netbsd-9 and netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.45.56.3 -r1.45.56.4 src/distrib/miniroot/install.sub cvs rdiff -u -r1.36 -r1.36.4.1 src/distrib/sun2/miniroot/Makefile cvs rdiff -u -r1.46 -r1.46.4.1 src/distrib/sun3/miniroot/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/miniroot/install.sub diff -u src/distrib/miniroot/install.sub:1.45.56.3 src/distrib/miniroot/install.sub:1.45.56.4 --- src/distrib/miniroot/install.sub:1.45.56.3 Sat Jun 5 10:41:20 2021 +++ src/distrib/miniroot/install.sub Fri Jun 25 19:13:20 2021 @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: install.sub,v 1.45.56.3 2021/06/05 10:41:20 martin Exp $ +# $NetBSD: install.sub,v 1.45.56.4 2021/06/25 19:13:20 martin Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. @@ -40,7 +40,7 @@ RELEASE=# filled in automatically (s export RELEASE ALLSETS="base comp etc games man misc modules text" # default install sets -UPGRSETS="base comp games man misc text" # default upgrade sets +UPGRSETS="base comp games man misc modules text" # default upgrade sets THESETS= # one of the above local_sets_dir="" # Path searched for sets by install_sets @@ -606,12 +606,8 @@ fi echo "" if [ "${_resolver_enabled:-FALSE}" = "TRUE" ]; then - netstat -r - echo "" echo "Resolver enabled." else - netstat -rn - echo "" echo "Resolver not enabled." fi Index: src/distrib/sun2/miniroot/Makefile diff -u src/distrib/sun2/miniroot/Makefile:1.36 src/distrib/sun2/miniroot/Makefile:1.36.4.1 --- src/distrib/sun2/miniroot/Makefile:1.36 Tue Jan 24 18:04:05 2017 +++ src/distrib/sun2/miniroot/Makefile Fri Jun 25 19:13:20 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.36 2017/01/24 18:04:05 christos Exp $ +# $NetBSD: Makefile,v 1.36.4.1 2021/06/25 19:13:20 martin Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -50,7 +50,9 @@ HACKSRC= ${DISTRIBDIR}/utils/libhack ${CRUNCHBIN}: libhack.o install.sub: ${DISTRIBDIR}/miniroot/install.sub - ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@ + ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \ + -e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \ + -e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@ CLEANFILES+= install.sub Index: src/distrib/sun3/miniroot/Makefile diff -u src/distrib/sun3/miniroot/Makefile:1.46 src/distrib/sun3/miniroot/Makefile:1.46.4.1 --- src/distrib/sun3/miniroot/Makefile:1.46 Tue Jan 24 18:04:05 2017 +++ src/distrib/sun3/miniroot/Makefile Fri Jun 25 19:13:20 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.46 2017/01/24 18:04:05 christos Exp $ +# $NetBSD: Makefile,v 1.46.4.1 2021/06/25 19:13:20 martin Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -50,7 +50,9 @@ HACKSRC= ${DISTRIBDIR}/utils/libhack ${CRUNCHBIN}: libhack.o install.sub: ${DISTRIBDIR}/miniroot/install.sub - ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@ + ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \ + -e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \ + -e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@ CLEANFILES+= install.sub
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Fri Jun 25 19:09:53 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Ticket #1310 To generate a diff of this commit: cvs rdiff -u -r1.1.2.10 -r1.1.2.11 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.10 src/doc/CHANGES-9.3:1.1.2.11 --- src/doc/CHANGES-9.3:1.1.2.10 Tue Jun 22 05:12:27 2021 +++ src/doc/CHANGES-9.3 Fri Jun 25 19:09:53 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.10 2021/06/22 05:12:27 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.11 2021/06/25 19:09:53 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -263,3 +263,15 @@ compat/arm/oabi/bsd.oabi.mk (apply patc Fix PR 50192. [mrg, ticket #1309] + +distrib/miniroot/install.sub 1.61,1.62 +distrib/sun2/miniroot/Makefile 1.40 +distrib/sun3/miniroot/Makefile 1.50 + + Fixes to sun2 and sun3 miniroot upgrade scripts: + - Replace RELEASE and VERSION strings proplery. + - Remove netstat(1) calls to print resolver info on upgrade using + miniroot, the binary is not available. + - The modules and rescue sets are also required on upgrade. + [tsutsui, ticket #1310] +
CVS commit: [netbsd-9] src/distrib
Module Name:src Committed By: martin Date: Fri Jun 25 19:08:46 UTC 2021 Modified Files: src/distrib/miniroot [netbsd-9]: install.sub src/distrib/sun2/miniroot [netbsd-9]: Makefile src/distrib/sun3/miniroot [netbsd-9]: Makefile Log Message: Pull up following revision(s) (requested by tsutsui in ticket #1310): distrib/sun3/miniroot/Makefile: revision 1.50 distrib/miniroot/install.sub: revision 1.61 distrib/miniroot/install.sub: revision 1.62 distrib/sun2/miniroot/Makefile: revision 1.40 Replace RELEASE and VERSION strings proplery. sun2 and sun3 don't use MI src/distrib/miniroot/list so this should have been sync'ed with it. http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.36 > Use proper release version strings ("9.1" rather than "91") in banners. > > Also define and use "MACHINE" variable to describe port names > (no uname(1) or sysctl(8) in miniroot binary list by default). Should be pulled up to netbsd-9. Remove netstat(1) calls to print resolver info on upgrade using miniroot. netstat(1) was removed from miniroot 25 years ago. http://cvsweb.netbsd.org/bsdweb.cgi/src/distrib/miniroot/list#rev1.5 The modules and rescue sets are also required on upgrade. Should be pulled up to netbsd-9 and netbsd-8. To generate a diff of this commit: cvs rdiff -u -r1.48.2.5 -r1.48.2.6 src/distrib/miniroot/install.sub cvs rdiff -u -r1.36 -r1.36.14.1 src/distrib/sun2/miniroot/Makefile cvs rdiff -u -r1.47 -r1.47.2.1 src/distrib/sun3/miniroot/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/miniroot/install.sub diff -u src/distrib/miniroot/install.sub:1.48.2.5 src/distrib/miniroot/install.sub:1.48.2.6 --- src/distrib/miniroot/install.sub:1.48.2.5 Sat Jun 5 10:40:08 2021 +++ src/distrib/miniroot/install.sub Fri Jun 25 19:08:46 2021 @@ -1,5 +1,5 @@ #!/bin/sh -# $NetBSD: install.sub,v 1.48.2.5 2021/06/05 10:40:08 martin Exp $ +# $NetBSD: install.sub,v 1.48.2.6 2021/06/25 19:08:46 martin Exp $ # # Copyright (c) 1996 The NetBSD Foundation, Inc. # All rights reserved. @@ -40,7 +40,7 @@ RELEASE=10.0# updated by distrib/min export RELEASE ALLSETS="base comp etc games man misc modules rescue text" # default install sets -UPGRSETS="base comp games man misc text" # default upgrade sets +UPGRSETS="base comp games man misc modules rescue text" # default upgrade sets THESETS= # one of the above local_sets_dir="" # Path searched for sets by install_sets @@ -606,12 +606,8 @@ fi echo "" if [ "${_resolver_enabled:-FALSE}" = "TRUE" ]; then - netstat -r - echo "" echo "Resolver enabled." else - netstat -rn - echo "" echo "Resolver not enabled." fi Index: src/distrib/sun2/miniroot/Makefile diff -u src/distrib/sun2/miniroot/Makefile:1.36 src/distrib/sun2/miniroot/Makefile:1.36.14.1 --- src/distrib/sun2/miniroot/Makefile:1.36 Tue Jan 24 18:04:05 2017 +++ src/distrib/sun2/miniroot/Makefile Fri Jun 25 19:08:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.36 2017/01/24 18:04:05 christos Exp $ +# $NetBSD: Makefile,v 1.36.14.1 2021/06/25 19:08:46 martin Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -50,7 +50,9 @@ HACKSRC= ${DISTRIBDIR}/utils/libhack ${CRUNCHBIN}: libhack.o install.sub: ${DISTRIBDIR}/miniroot/install.sub - ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@ + ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \ + -e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \ + -e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@ CLEANFILES+= install.sub Index: src/distrib/sun3/miniroot/Makefile diff -u src/distrib/sun3/miniroot/Makefile:1.47 src/distrib/sun3/miniroot/Makefile:1.47.2.1 --- src/distrib/sun3/miniroot/Makefile:1.47 Sun Jul 28 10:29:49 2019 +++ src/distrib/sun3/miniroot/Makefile Fri Jun 25 19:08:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.47 2019/07/28 10:29:49 martin Exp $ +# $NetBSD: Makefile,v 1.47.2.1 2021/06/25 19:08:46 martin Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -53,7 +53,9 @@ HACK_CURSES=yes ${CRUNCHBIN}: libhack.o install.sub: ${DISTRIBDIR}/miniroot/install.sub - ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" < $? > $@ + ${TOOL_SED} -e "/^VERSION=/s/=.*/=${DISTRIBREV}/" \ + -e "/^RELEASE=/s/=.*/=${DISTRIBVER}/" \ + -e "/^MACHINE=/s/=.*/=${MACHINE}/" < $? > $@ CLEANFILES+= install.sub
CVS commit: src/lib/libcurses
Module Name:src Committed By: martin Date: Thu Jun 24 15:41:25 UTC 2021 Modified Files: src/lib/libcurses: slk.c Log Message: Fix printf format for size_t To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/slk.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/libcurses/slk.c diff -u src/lib/libcurses/slk.c:1.10 src/lib/libcurses/slk.c:1.11 --- src/lib/libcurses/slk.c:1.10 Thu Jun 24 05:53:05 2021 +++ src/lib/libcurses/slk.c Thu Jun 24 15:41:25 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: slk.c,v 1.10 2021/06/24 05:53:05 blymn Exp $ */ +/* $NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #ifndef lint -__RCSID("$NetBSD: slk.c,v 1.10 2021/06/24 05:53:05 blymn Exp $"); +__RCSID("$NetBSD: slk.c,v 1.11 2021/06/24 15:41:25 martin Exp $"); #endif/* not lint */ #include @@ -568,7 +568,7 @@ __slk_wset(SCREEN *screen, int labnum, c } #ifdef DEBUG - __CTRACE(__CTRACE_INPUT, "__slk_wset: wcsrtombs %ld\n", len); + __CTRACE(__CTRACE_INPUT, "__slk_wset: wcsrtombs %zu\n", len); #endif len++; /* We need to store the NULL character. */ if ((str = malloc(len)) == NULL)
CVS commit: src/doc
Module Name:src Committed By: martin Date: Tue Jun 22 13:02:52 UTC 2021 Modified Files: src/doc: HACKS Log Message: Document sh3* lint hack for gcc 9 To generate a diff of this commit: cvs rdiff -u -r1.218 -r1.219 src/doc/HACKS Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/HACKS diff -u src/doc/HACKS:1.218 src/doc/HACKS:1.219 --- src/doc/HACKS:1.218 Mon May 31 22:33:19 2021 +++ src/doc/HACKS Tue Jun 22 13:02:52 2021 @@ -1,4 +1,4 @@ -# $NetBSD: HACKS,v 1.218 2021/05/31 22:33:19 rin Exp $ +# $NetBSD: HACKS,v 1.219 2021/06/22 13:02:52 martin Exp $ # # This file is intended to document workarounds for currently unsolved # (mostly) compiler bugs. @@ -998,3 +998,16 @@ descr For alpha gcc-9 and gcc-10 miscomp allocation from the stack and freeing with regular free which causes a crash. kcah + +port sh3 + + hack gcc9-sh3-lint + cdate Tue Jun 22 14:59:52 CEST 2021 + mdate Tue Jun 22 14:59:52 CEST 2021 + who martin + file usr.bin/xlint/lint1/Makefile : 1.70 + descr + The in-tree gcc 9 crashes with an internal invalid + opcode exception when using any kind of optimization + on the lex.c file. Force -O0 for this file. +kcah
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: martin Date: Tue Jun 22 12:58:28 UTC 2021 Modified Files: src/usr.bin/xlint/lint1: Makefile Log Message: Hack to avoid gcc 9 internal compiler error for sh3. To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/usr.bin/xlint/lint1/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/xlint/lint1/Makefile diff -u src/usr.bin/xlint/lint1/Makefile:1.70 src/usr.bin/xlint/lint1/Makefile:1.71 --- src/usr.bin/xlint/lint1/Makefile:1.70 Sun Apr 18 22:51:24 2021 +++ src/usr.bin/xlint/lint1/Makefile Tue Jun 22 12:58:28 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.70 2021/04/18 22:51:24 rillig Exp $ +# $NetBSD: Makefile,v 1.71 2021/06/22 12:58:28 martin Exp $ .include @@ -27,6 +27,11 @@ CPPFLAGS+= ${DEBUG:D-DDEBUG} COPTS.err.c+= ${${ACTIVE_CC} == "clang":? -Wno-format-nonliteral :} +.if ${HAVE_GCC} == 9 && \ + (${MACHINE_ARCH} == "sh3el" || ${MACHINE_ARCH} == "sh3eb") +COPTS.lex.c+= -O0 +.endif + BINDIR= /usr/libexec CLEANFILES+= ${MAN}
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Tue Jun 22 05:12:27 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Ammend ticket #1301 To generate a diff of this commit: cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.9 src/doc/CHANGES-9.3:1.1.2.10 --- src/doc/CHANGES-9.3:1.1.2.9 Mon Jun 21 17:42:15 2021 +++ src/doc/CHANGES-9.3 Tue Jun 22 05:12:27 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.9 2021/06/21 17:42:15 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.10 2021/06/22 05:12:27 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -210,9 +210,9 @@ sys/external/bsd/drm2/dist/drm/i915/i915 i915drmkms: Fix LOCKDEBUG panic and potential deadlock. [riastradh, ticket #1300] -sys/dev/usb/xhci.c1.139-1.141,1.143 -sys/dev/usb/xhcireg.h1.19 -sys/dev/usb/xhcivar.h1.18,1.19 +sys/dev/usb/xhci.c1.139-1.141,1.143 (patch) +sys/dev/usb/xhcireg.h1.19 (patch) +sys/dev/usb/xhcivar.h1.18,1.19 (patch) xhci(4): support suspend/resume. [riastradh, ticket #1301]
CVS commit: [netbsd-9] src/sys/dev/usb
Module Name:src Committed By: martin Date: Tue Jun 22 05:10:50 UTC 2021 Modified Files: src/sys/dev/usb [netbsd-9]: xhci.c xhcireg.h xhcivar.h Log Message: Fix pullup #1302 by adapting the changes to this branch (there was a misunderstanding in the ticket handling) To generate a diff of this commit: cvs rdiff -u -r1.107.2.8 -r1.107.2.9 src/sys/dev/usb/xhci.c cvs rdiff -u -r1.13.2.1 -r1.13.2.2 src/sys/dev/usb/xhcireg.h cvs rdiff -u -r1.11.4.1 -r1.11.4.2 src/sys/dev/usb/xhcivar.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/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.107.2.8 src/sys/dev/usb/xhci.c:1.107.2.9 --- src/sys/dev/usb/xhci.c:1.107.2.8 Mon Jun 21 17:11:46 2021 +++ src/sys/dev/usb/xhci.c Tue Jun 22 05:10:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $ */ +/* $NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -724,7 +724,7 @@ xhci_suspend(device_t self, const pmf_qu if (xs->xs_idx == 0) continue; - for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) { + for (dci = 0; dci < 32; dci++) { /* Skip if the endpoint is not Running. */ /* XXX What about Busy? */ if (xhci_get_epstate(sc, xs, dci) != @@ -951,7 +951,7 @@ xhci_resume(device_t self, const pmf_qua * * XXX Hope just zeroing it is good enough! */ - xhci_host_dequeue(sc->sc_cr); + xhci_host_dequeue(&sc->sc_cr); /* * `7. Write the CRCR with the address and RCS value of the @@ -959,8 +959,8 @@ xhci_resume(device_t self, const pmf_qua * cause the Command Ring to restart at the address * specified by the CRCR.' */ - xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(sc->sc_cr, 0) | - sc->sc_cr->xr_cs); + xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(&sc->sc_cr, 0) | + sc->sc_cr.xr_cs); /* * `8. Enable the controller by setting Run/Stop (R/S) = @@ -1049,7 +1049,7 @@ xhci_resume(device_t self, const pmf_qua if (xs->xs_idx == 0) continue; - for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) { + for (dci = 0; dci < 32; dci++) { /* Skip if the endpoint is not Running. */ if (xhci_get_epstate(sc, xs, dci) != XHCI_EPSTATE_RUNNING) Index: src/sys/dev/usb/xhcireg.h diff -u src/sys/dev/usb/xhcireg.h:1.13.2.1 src/sys/dev/usb/xhcireg.h:1.13.2.2 --- src/sys/dev/usb/xhcireg.h:1.13.2.1 Mon Jun 21 17:11:46 2021 +++ src/sys/dev/usb/xhcireg.h Tue Jun 22 05:10:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xhcireg.h,v 1.13.2.1 2021/06/21 17:11:46 martin Exp $ */ +/* $NetBSD: xhcireg.h,v 1.13.2.2 2021/06/22 05:10:50 martin Exp $ */ /*- * Copyright (c) 2010 Hans Petter Selasky. All rights reserved. @@ -162,8 +162,31 @@ #define XHCI_PS_PED 0x0002 /* RW - port enabled / disabled */ #define XHCI_PS_OCA 0x0008 /* RO - over current active */ #define XHCI_PS_PR 0x0010 /* RW - port reset */ +#define XHCI_PS_PLS_MASK __BITS(8, 5) #define XHCI_PS_PLS_GET(x) (((x) >> 5) & 0xF) /* RW - port link state */ #define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ + +#define XHCI_PS_PLS_SETU0 0 +#define XHCI_PS_PLS_SETU2 2 +#define XHCI_PS_PLS_SETU3 3 +#define XHCI_PS_PLS_SETDISC 5 +#define XHCI_PS_PLS_SETCOMP 10 +#define XHCI_PS_PLS_SETRESUME 15 + +#define XHCI_PS_PLS_U0 0 +#define XHCI_PS_PLS_U1 1 +#define XHCI_PS_PLS_U2 2 +#define XHCI_PS_PLS_U3 3 +#define XHCI_PS_PLS_DISABLED 4 +#define XHCI_PS_PLS_RXDETECT 5 +#define XHCI_PS_PLS_INACTIVE 6 +#define XHCI_PS_PLS_POLLING 7 +#define XHCI_PS_PLS_RECOVERY 8 +#define XHCI_PS_PLS_HOTRESET 9 +#define XHCI_PS_PLS_COMPLIANCE 10 +#define XHCI_PS_PLS_TEST 11 +#define XHCI_PS_PLS_RESUME 15 + #define XHCI_PS_PP 0x0200 /* RW - port power */ #define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ #define XHCI_PS_SPEED_FS 1 Index: src/sys/dev/usb/xhcivar.h diff -u src/sys/dev/usb/xhcivar.h:1.11.4.1 src/sys/dev/usb/xhcivar.h:1.11.4.2 --- src/sys/dev/usb/xhcivar.h:1.11.4.1 Mon Jun 21 17:11:46 2021 +++ src/sys/dev/usb/xhcivar.h Tue Jun 22 05:10:50 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xhcivar.h,v 1.11.4.1 2021/06/21 17:11:46 martin Exp $ */ +/* $NetBSD: xhcivar.h,v 1.11.4.2 2021/06/22 05:10:50 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch
CVS commit: [netbsd-8] src/doc
Module Name:src Committed By: martin Date: Mon Jun 21 17:46:13 UTC 2021 Modified Files: src/doc [netbsd-8]: CHANGES-8.3 Log Message: Tickets #1685 and #1684 To generate a diff of this commit: cvs rdiff -u -r1.1.2.91 -r1.1.2.92 src/doc/CHANGES-8.3 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.3 diff -u src/doc/CHANGES-8.3:1.1.2.91 src/doc/CHANGES-8.3:1.1.2.92 --- src/doc/CHANGES-8.3:1.1.2.91 Tue Jun 8 13:01:10 2021 +++ src/doc/CHANGES-8.3 Mon Jun 21 17:46:13 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-8.3,v 1.1.2.91 2021/06/08 13:01:10 martin Exp $ +# $NetBSD: CHANGES-8.3,v 1.1.2.92 2021/06/21 17:46:13 martin Exp $ A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3 release: @@ -1954,3 +1954,21 @@ sbin/dump/tape.c1.56 dump(8): prevent crashes for large file systems. [hannken, ticket #1683] +sys/kern/vfs_lookup.c1.226 +sys/kern/vfs_vnops.c1.215 +sys/sys/namei.src1.59 (patch) +sys/rump/include/rump/rump_namei.h (regen) +sys/sys/namei.h (regen) + + Add a new namei flag NONEXCLHACK for open with O_CREAT and not O_EXCL. + In the case where that target is the root, or a mount + point, such that there's no parent dir, "real" CREATE operations fail, + but O_CREAT without O_EXCL needs to succeed. + Fixes newer Samba usage of /proc/self/fd/NNN with O_CREAT. + [dholland, ticket #1685] + +compat/arm/oabi/bsd.oabi.mk (apply patch) + + Fix PR 50192. + [mrg, ticket #1684] +
CVS commit: [netbsd-8] src/compat/arm/oabi
Module Name:src Committed By: martin Date: Mon Jun 21 17:43:18 UTC 2021 Modified Files: src/compat/arm/oabi [netbsd-8]: bsd.oabi.mk Log Message: Apply patch, requested by mrg in ticket #1684 (no corresponding change in HEAD, oabi has been removed): compat/arm/oabi/bsd.oabi.mk (apply patch) Fix PR 50192. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.8.1 src/compat/arm/oabi/bsd.oabi.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/compat/arm/oabi/bsd.oabi.mk diff -u src/compat/arm/oabi/bsd.oabi.mk:1.4 src/compat/arm/oabi/bsd.oabi.mk:1.4.8.1 --- src/compat/arm/oabi/bsd.oabi.mk:1.4 Wed Jun 24 22:20:24 2015 +++ src/compat/arm/oabi/bsd.oabi.mk Mon Jun 21 17:43:18 2021 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.oabi.mk,v 1.4 2015/06/24 22:20:24 matt Exp $ +# $NetBSD: bsd.oabi.mk,v 1.4.8.1 2021/06/21 17:43:18 martin Exp $ .if !defined(MLIBDIR) MLIBDIR= oabi @@ -15,10 +15,12 @@ ARM_APCS_FLAGS= ${${ACTIVE_CC} == "clang ARM_MACHINE_ARCH= armeb ARM_LD= -m armelfb_nbsd LDFLAGS+= -Wl,-m,armelfb_nbsd +ARM_APCS_FLAGS= -mcpu=arm10 .else ARM_MACHINE_ARCH= arm ARM_LD= -m armelf_nbsd LDFLAGS+= -Wl,-m,armelf_nbsd +ARM_APCS_FLAGS= -mcpu=arm10 .endif LIBC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Mon Jun 21 17:42:15 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1296 - #1309 To generate a diff of this commit: cvs rdiff -u -r1.1.2.8 -r1.1.2.9 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.8 src/doc/CHANGES-9.3:1.1.2.9 --- src/doc/CHANGES-9.3:1.1.2.8 Mon Jun 14 12:00:44 2021 +++ src/doc/CHANGES-9.3 Mon Jun 21 17:42:15 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.8 2021/06/14 12:00:44 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.9 2021/06/21 17:42:15 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -131,3 +131,135 @@ usr.bin/ftp/version.h1.93 Set version to 20210603. [lukem, ticket #1295] +sys/kern/vfs_lookup.c1.226 +sys/kern/vfs_vnops.c1.215 +sys/sys/namei.src1.59 (patch) +sys/rump/include/rump/rump_namei.h (regen) +sys/sys/namei.h (regen) + + Add a new namei flag NONEXCLHACK for open with O_CREAT and not O_EXCL. + In the case where that target is the root, or a mount + point, such that there's no parent dir, "real" CREATE operations fail, + but O_CREAT without O_EXCL needs to succeed. + Fixes newer Samba usage of /proc/self/fd/NNN with O_CREAT. + [dholland, ticket #1296] + +external/bsd/libarchive/dist/cat/test/test_0.c up to 1.2 +external/bsd/libarchive/dist/cpio/test/test_basic.c up to 1.2 +external/bsd/libarchive/dist/cpio/test/test_format_newc.c up to 1.3 +external/bsd/libarchive/dist/libarchive/archive_read.c up to 1.2 +external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c up to 1.2 +external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c up to 1.2 +external/bsd/libarchive/dist/libarchive/archive_read_support_format_xar.c up to 1.2 +external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c up to 1.6 +external/bsd/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_compat_zip.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_fuzz.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_extract.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_gtar_sparse.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_comment_stored.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_jar.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_mac_metadata.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_malformed.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_msdos.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_nested.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_padded.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_sfx.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_zip64.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_pax_truncated.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_read_truncated_filter.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_sparse_basic.c up to 1.3 +external/bsd/libarchive/dist/libarchive/test/test_write_disk.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_write_disk_secure.c up to 1.4 +external/bsd/libarchive/dist/libarchive/test/test_write_format_cpio_empty.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_write_format_shar_empty.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_write_format_tar.c up to 1.2 +external/bsd/libarchive/dist/libarchive/test/test_write_format_tar_sparse.c up to 1.2 +external/bsd/libarchive/dist/tar/write.c up to 1.3 +external/bsd/libarchive/dist/tar/test/test_basic.c up to 1.2 +external/bsd/libarchive/dist/tar/test/test_copy.c up to 1.3 +external/bsd/libarchive/dist/tar/test/test_option_C_upper.c up to 1.2 +external/bsd/libarchive/dist/tar/test/test_option_s.c up to 1.2 +external/bsd/libarchive/dist/test_utils/test_common.h up to 1.2 +external/bsd/libarchive/dist/t
CVS commit: [netbsd-9] src/compat/arm/oabi
Module Name:src Committed By: martin Date: Mon Jun 21 17:40:43 UTC 2021 Modified Files: src/compat/arm/oabi [netbsd-9]: bsd.oabi.mk Log Message: Apply patch, requested by mrg in ticket #1309 (no corresponding change in HEAD, oabi has been removed): compat/arm/oabi/bsd.oabi.mk (apply patch) Fix PR 50192. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.4.18.1 src/compat/arm/oabi/bsd.oabi.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/compat/arm/oabi/bsd.oabi.mk diff -u src/compat/arm/oabi/bsd.oabi.mk:1.4 src/compat/arm/oabi/bsd.oabi.mk:1.4.18.1 --- src/compat/arm/oabi/bsd.oabi.mk:1.4 Wed Jun 24 22:20:24 2015 +++ src/compat/arm/oabi/bsd.oabi.mk Mon Jun 21 17:40:43 2021 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.oabi.mk,v 1.4 2015/06/24 22:20:24 matt Exp $ +# $NetBSD: bsd.oabi.mk,v 1.4.18.1 2021/06/21 17:40:43 martin Exp $ .if !defined(MLIBDIR) MLIBDIR= oabi @@ -15,10 +15,12 @@ ARM_APCS_FLAGS= ${${ACTIVE_CC} == "clang ARM_MACHINE_ARCH= armeb ARM_LD= -m armelfb_nbsd LDFLAGS+= -Wl,-m,armelfb_nbsd +ARM_APCS_FLAGS= -mcpu=arm10 .else ARM_MACHINE_ARCH= arm ARM_LD= -m armelf_nbsd LDFLAGS+= -Wl,-m,armelf_nbsd +ARM_APCS_FLAGS= -mcpu=arm10 .endif LIBC_MACHINE_ARCH= ${ARM_MACHINE_ARCH}
CVS commit: [netbsd-9] src/sys/arch/amd64/conf
Module Name:src Committed By: martin Date: Mon Jun 21 17:34:42 UTC 2021 Modified Files: src/sys/arch/amd64/conf [netbsd-9]: GENERIC Log Message: Pull up following revision(s) (requested by riastradh in ticket #1308): sys/arch/amd64/conf/GENERIC: revision 1.581 Enable tpm @ acpi (now that it can match TPM 1.2 devices, which are not, as the comment implies, experimental). To generate a diff of this commit: cvs rdiff -u -r1.531.2.10 -r1.531.2.11 src/sys/arch/amd64/conf/GENERIC 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/GENERIC diff -u src/sys/arch/amd64/conf/GENERIC:1.531.2.10 src/sys/arch/amd64/conf/GENERIC:1.531.2.11 --- src/sys/arch/amd64/conf/GENERIC:1.531.2.10 Tue Jul 7 10:29:05 2020 +++ src/sys/arch/amd64/conf/GENERIC Mon Jun 21 17:34:42 2021 @@ -1,4 +1,4 @@ -# $NetBSD: GENERIC,v 1.531.2.10 2020/07/07 10:29:05 martin Exp $ +# $NetBSD: GENERIC,v 1.531.2.11 2021/06/21 17:34:42 martin Exp $ # # GENERIC machine description file # @@ -22,7 +22,7 @@ include "arch/amd64/conf/std.amd64" options INCLUDE_CONFIG_FILE # embed config file in kernel binary -#ident "GENERIC-$Revision: 1.531.2.10 $" +#ident "GENERIC-$Revision: 1.531.2.11 $" maxusers 64 # estimated number of users @@ -329,7 +329,7 @@ sony* at acpi? # Sony Notebook Control spic* at acpi? # Sony Programmable I/O Controller wsmouse* at spic? # mouse thinkpad* at acpi? # IBM/Lenovo Thinkpad hotkeys -#tpm* at acpi? # ACPI TPM (Experimental) +tpm* at acpi? # ACPI TPM (Experimental) ug* at acpi? # Abit uGuru Hardware monitor valz* at acpi? # Toshiba Dynabook hotkeys wb* at acpi? # Winbond W83L518D SD/MMC reader
CVS commit: [netbsd-9] src/sys/arch
Module Name:src Committed By: martin Date: Mon Jun 21 17:32:52 UTC 2021 Modified Files: src/sys/arch/amd64/amd64 [netbsd-9]: db_disasm.c src/sys/arch/i386/i386 [netbsd-9]: db_disasm.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1307): sys/arch/amd64/amd64/db_disasm.c: revision 1.28 sys/arch/i386/i386/db_disasm.c: revision 1.49 ddb/amd64: Don't go out of the way to detect invalid addresses. db_disasm had logic to detect invalid addresses before trying to disassemble them. But when disassembling a null instruction address, the logic to detect invalid addresses itself tried to dereference an invalid address. db_get_value can already handle this situation gracefully, so there is no need for this faulty fault-avoidance logic. Fixes double-fault in ddb on calling null function pointers. With any luck, this should make diagnosing such bugs easier in the future! ddb/i386: Don't go out of the way to detect invalid addresses. db_read_bytes already does this better (but didn't at the time this check was originally added back in 1998). Not sure if this code had the same mistake as the amd64 code causing it to trip over its own shoelaces, but there should be no need for it here. To generate a diff of this commit: cvs rdiff -u -r1.27 -r1.27.4.1 src/sys/arch/amd64/amd64/db_disasm.c cvs rdiff -u -r1.48 -r1.48.4.1 src/sys/arch/i386/i386/db_disasm.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/amd64/amd64/db_disasm.c diff -u src/sys/arch/amd64/amd64/db_disasm.c:1.27 src/sys/arch/amd64/amd64/db_disasm.c:1.27.4.1 --- src/sys/arch/amd64/amd64/db_disasm.c:1.27 Sat Mar 9 08:42:25 2019 +++ src/sys/arch/amd64/amd64/db_disasm.c Mon Jun 21 17:32:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.27 2019/03/09 08:42:25 maxv Exp $ */ +/* $NetBSD: db_disasm.c,v 1.27.4.1 2021/06/21 17:32:52 martin Exp $ */ /* * Mach Operating System @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.27 2019/03/09 08:42:25 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.27.4.1 2021/06/21 17:32:52 martin Exp $"); #ifndef _KERNEL #include @@ -1191,33 +1191,8 @@ db_disasm(db_addr_t loc, bool altfmt) uint64_t imm64; int len; struct i_addr address; -#ifdef _KERNEL - pt_entry_t *pte, *pde; -#endif u_int rex = 0; -#ifdef _KERNEL - /* - * Don't try to disassemble the location if the mapping is invalid. - * If we do, we'll fault, and end up debugging the debugger! - * in the case of largepages, "pte" is really the pde and "pde" is - * really the entry for the pdp itself. - */ - if ((vaddr_t)loc >= VM_MIN_KERNEL_ADDRESS) - pte = kvtopte((vaddr_t)loc); - else - pte = vtopte((vaddr_t)loc); - if ((vaddr_t)pte >= VM_MIN_KERNEL_ADDRESS) - pde = kvtopte((vaddr_t)pte); - else - pde = vtopte((vaddr_t)pte); - - if ((*pde & PTE_P) == 0 || (*pte & PTE_P) == 0) { - db_printf("invalid address\n"); - return (loc); - } -#endif - get_value_inc(inst, loc, 1, false); short_addr = false; size = LONG; Index: src/sys/arch/i386/i386/db_disasm.c diff -u src/sys/arch/i386/i386/db_disasm.c:1.48 src/sys/arch/i386/i386/db_disasm.c:1.48.4.1 --- src/sys/arch/i386/i386/db_disasm.c:1.48 Sat Mar 9 08:42:25 2019 +++ src/sys/arch/i386/i386/db_disasm.c Mon Jun 21 17:32:52 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: db_disasm.c,v 1.48 2019/03/09 08:42:25 maxv Exp $ */ +/* $NetBSD: db_disasm.c,v 1.48.4.1 2021/06/21 17:32:52 martin Exp $ */ /* * Mach Operating System @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.48 2019/03/09 08:42:25 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_disasm.c,v 1.48.4.1 2021/06/21 17:32:52 martin Exp $"); #include #include @@ -1132,26 +1132,6 @@ db_disasm(db_addr_t loc, bool altfmt) int len; struct i_addr address; -#ifdef _KERNEL - pt_entry_t *pte, *pde; - - /* - * Don't try to disassemble the location if the mapping is invalid. - * If we do, we'll fault, and end up debugging the debugger! - * in the case of largepages, "pte" is really the pde and "pde" is - * really the entry for the pdp itself. - */ - if ((vaddr_t)loc >= VM_MIN_KERNEL_ADDRESS) - pte = kvtopte((vaddr_t)loc); - else - pte = vtopte((vaddr_t)loc); - pde = vtopte((vaddr_t)pte); - if ((*pde & PTE_P) == 0 || (*pte & PTE_P) == 0) { - db_printf("invalid address\n"); - return (loc); - } -#endif - get_value_inc(inst, loc, 1, false); short_addr = false; size = LONG;
CVS commit: [netbsd-9] src/sys/dev/usb
Module Name:src Committed By: martin Date: Mon Jun 21 17:27:57 UTC 2021 Modified Files: src/sys/dev/usb [netbsd-9]: umass.c umass_scsipi.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1306): sys/dev/usb/umass.c: revision 1.185 sys/dev/usb/umass_scsipi.c: revision 1.68 umass(4): Use an empty function callback, not null pointer. This stupid bug, with an `XXX Broken!' comment right above, has been preventing NetBSD from suspend/resume with a USB drive plugged in for longer than I want to even think about admitting. *sigh* umass(4): Assert that we got a cb up front. Avoids jump to zero waaay down the line where we've forgotten why we wanted to jump into oblivion. To generate a diff of this commit: cvs rdiff -u -r1.175.2.1 -r1.175.2.2 src/sys/dev/usb/umass.c cvs rdiff -u -r1.62 -r1.62.2.1 src/sys/dev/usb/umass_scsipi.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/usb/umass.c diff -u src/sys/dev/usb/umass.c:1.175.2.1 src/sys/dev/usb/umass.c:1.175.2.2 --- src/sys/dev/usb/umass.c:1.175.2.1 Sun Mar 1 12:38:59 2020 +++ src/sys/dev/usb/umass.c Mon Jun 21 17:27:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: umass.c,v 1.175.2.1 2020/03/01 12:38:59 martin Exp $ */ +/* $NetBSD: umass.c,v 1.175.2.2 2021/06/21 17:27:57 martin Exp $ */ /* * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -124,7 +124,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.175.2.1 2020/03/01 12:38:59 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umass.c,v 1.175.2.2 2021/06/21 17:27:57 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -1105,6 +1105,7 @@ umass_bbb_transfer(struct umass_softc *s UMASSHIST_FUNC(); UMASSHIST_CALLED(); static int dCBWtag = 42; /* unique for CBW of transfer */ + KASSERT(cb); DPRINTFM(UDMASS_BBB, "sc %#jx cmd=0x%02jx", (uintptr_t)sc, *(u_char *)cmd, 0, 0); @@ -1629,6 +1630,7 @@ umass_cbi_transfer(struct umass_softc *s DPRINTFM(UDMASS_CBI, "sc %#jx: cmd=0x%02jx, len=%jd", (uintptr_t)sc, *(u_char *)cmd, datalen, 0); + KASSERT(cb); KASSERTMSG(sc->sc_wire & (UMASS_WPROTO_CBI|UMASS_WPROTO_CBI_I), "sc->sc_wire == 0x%02x wrong for umass_cbi_transfer\n", sc->sc_wire); Index: src/sys/dev/usb/umass_scsipi.c diff -u src/sys/dev/usb/umass_scsipi.c:1.62 src/sys/dev/usb/umass_scsipi.c:1.62.2.1 --- src/sys/dev/usb/umass_scsipi.c:1.62 Thu May 30 21:44:49 2019 +++ src/sys/dev/usb/umass_scsipi.c Mon Jun 21 17:27:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: umass_scsipi.c,v 1.62 2019/05/30 21:44:49 mlelstv Exp $ */ +/* $NetBSD: umass_scsipi.c,v 1.62.2.1 2021/06/21 17:27:57 martin Exp $ */ /* * Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.62 2019/05/30 21:44:49 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.62.2.1 2021/06/21 17:27:57 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -101,6 +101,8 @@ Static int umass_scsipi_ioctl(struct scs Static int umass_scsipi_getgeom(struct scsipi_periph *, struct disk_parms *, u_long); +Static void umass_null_cb(struct umass_softc *, void *, + int, int); Static void umass_scsipi_cb(struct umass_softc *, void *, int, int); Static void umass_scsipi_sense_cb(struct umass_softc *, void *, @@ -319,7 +321,7 @@ umass_scsipi_request(struct scsipi_chann cmdlen, xs->data, xs->datalen, dir, xs->timeout, USBD_SYNCHRONOUS, - 0, xs); + umass_null_cb, xs); DPRINTFM(UDMASS_SCSI, "done err=%jd", scbus->sc_sync_status, 0, 0, 0); switch (scbus->sc_sync_status) { @@ -419,6 +421,12 @@ umass_scsipi_getgeom(struct scsipi_perip } Static void +umass_null_cb(struct umass_softc *sc, void *priv, int residue, int status) +{ + UMASSHIST_FUNC(); UMASSHIST_CALLED(); +} + +Static void umass_scsipi_cb(struct umass_softc *sc, void *priv, int residue, int status) { UMASSHIST_FUNC(); UMASSHIST_CALLED();
CVS commit: [netbsd-9] src/sys/dev
Module Name:src Committed By: martin Date: Mon Jun 21 17:25:48 UTC 2021 Modified Files: src/sys/dev/ic [netbsd-9]: nvme.c nvmevar.h src/sys/dev/pci [netbsd-9]: nvme_pci.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1305): sys/dev/ic/nvmevar.h: revision 1.22 sys/dev/ic/nvme.c: revision 1.56 sys/dev/ic/nvme.c: revision 1.57 sys/dev/pci/nvme_pci.c: revision 1.30 nvme(4): Add suspend/resume, derived from OpenBSD. nvme(4): Move disestablishment of admin q interrupt to nvme_detach. Nothing re-established this after suspend/resume, so attempting suspend/resume/suspend would crash, and presumably we would miss interrupts after resume. This keeps the establish/disestablish more symmetric in attach/detach. To generate a diff of this commit: cvs rdiff -u -r1.44.2.5 -r1.44.2.6 src/sys/dev/ic/nvme.c cvs rdiff -u -r1.20 -r1.20.2.1 src/sys/dev/ic/nvmevar.h cvs rdiff -u -r1.26 -r1.26.4.1 src/sys/dev/pci/nvme_pci.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/ic/nvme.c diff -u src/sys/dev/ic/nvme.c:1.44.2.5 src/sys/dev/ic/nvme.c:1.44.2.6 --- src/sys/dev/ic/nvme.c:1.44.2.5 Mon Dec 7 20:04:07 2020 +++ src/sys/dev/ic/nvme.c Mon Jun 21 17:25:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: nvme.c,v 1.44.2.5 2020/12/07 20:04:07 martin Exp $ */ +/* $NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $ */ /* $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.5 2020/12/07 20:04:07 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.44.2.6 2021/06/21 17:25:48 martin Exp $"); #include #include @@ -81,6 +81,7 @@ static void nvme_empty_done(struct nvme_ static struct nvme_queue * nvme_q_alloc(struct nvme_softc *, uint16_t, u_int, u_int); static int nvme_q_create(struct nvme_softc *, struct nvme_queue *); +static void nvme_q_reset(struct nvme_softc *, struct nvme_queue *); static int nvme_q_delete(struct nvme_softc *, struct nvme_queue *); static void nvme_q_submit(struct nvme_softc *, struct nvme_queue *, struct nvme_ccb *, void (*)(struct nvme_queue *, @@ -338,7 +339,6 @@ nvme_attach(struct nvme_softc *sc) { uint64_t cap; uint32_t reg; - u_int dstrd; u_int mps = PAGE_SHIFT; u_int ncq, nsq; uint16_t adminq_entries = nvme_adminq_size; @@ -359,7 +359,7 @@ nvme_attach(struct nvme_softc *sc) NVME_VS_MNR(reg), NVME_VS_TER(reg)); cap = nvme_read8(sc, NVME_CAP); - dstrd = NVME_CAP_DSTRD(cap); + sc->sc_dstrd = NVME_CAP_DSTRD(cap); if (NVME_CAP_MPSMIN(cap) > PAGE_SHIFT) { aprint_error_dev(sc->sc_dev, "NVMe minimum page size %u " "is greater than CPU page size %u\n", @@ -382,7 +382,8 @@ nvme_attach(struct nvme_softc *sc) return 1; } - sc->sc_admin_q = nvme_q_alloc(sc, NVME_ADMIN_Q, adminq_entries, dstrd); + sc->sc_admin_q = nvme_q_alloc(sc, NVME_ADMIN_Q, adminq_entries, + sc->sc_dstrd); if (sc->sc_admin_q == NULL) { aprint_error_dev(sc->sc_dev, "unable to allocate admin queue\n"); @@ -427,7 +428,8 @@ nvme_attach(struct nvme_softc *sc) sc->sc_q = kmem_zalloc(sizeof(*sc->sc_q) * sc->sc_nq, KM_SLEEP); for (i = 0; i < sc->sc_nq; i++) { - sc->sc_q[i] = nvme_q_alloc(sc, i + 1, ioq_entries, dstrd); + sc->sc_q[i] = nvme_q_alloc(sc, i + 1, ioq_entries, + sc->sc_dstrd); if (sc->sc_q[i] == NULL) { aprint_error_dev(sc->sc_dev, "unable to allocate io queue\n"); @@ -550,6 +552,7 @@ nvme_detach(struct nvme_softc *sc, int f return error; /* from now on we are committed to detach, following will never fail */ + sc->sc_intr_disestablish(sc, NVME_ADMIN_Q); for (i = 0; i < sc->sc_nq; i++) nvme_q_free(sc, sc->sc_q[i]); kmem_free(sc->sc_q, sizeof(*sc->sc_q) * sc->sc_nq); @@ -558,6 +561,68 @@ nvme_detach(struct nvme_softc *sc, int f return 0; } +int +nvme_suspend(struct nvme_softc *sc) +{ + + return nvme_shutdown(sc); +} + +int +nvme_resume(struct nvme_softc *sc) +{ + int ioq_entries = nvme_ioq_size; + uint64_t cap; + int i, error; + + error = nvme_disable(sc); + if (error) { + device_printf(sc->sc_dev, "unable to disable controller\n"); + return error; + } + + nvme_q_reset(sc, sc->sc_admin_q); + + error = nvme_enable(sc, ffs(sc->sc_mps) - 1); + if (error) { + device_printf(sc->sc_dev, "unable to enable controller\n"); + return error; + } + + for (i = 0; i < sc->sc_nq; i++) { + cap = nvme_read8(sc, NVME_CAP); + if (ioq_entries > NVME_CAP_MQES(cap)) + ioq_entries = NVME_CAP_MQES(cap); + sc->sc_q[i] = nvme_q_alloc(sc, i + 1, ioq_entries, + sc->sc_dstrd); + if (sc->sc_q[i] == NULL) { + error = ENOMEM; + device_printf(sc->sc_dev, "unable to allocate io q %d" + "\n", i); + goto disable; + } + if (nvme_q_create(sc, sc->sc_q[i]) != 0) { + error = EIO; + device_printf(sc->sc_dev, "unable to create io q %d" + "\n", i)
CVS commit: [netbsd-9] src/sys/dev
Module Name:src Committed By: martin Date: Mon Jun 21 17:23:13 UTC 2021 Modified Files: src/sys/dev [netbsd-9]: ld.c ldvar.h Log Message: Pull up following revision(s) (requested by riastradh in ticket #1304): sys/dev/ldvar.h: revision 1.35 sys/dev/ld.c: revision 1.112 ld(4): Block requests while suspended until resumed. Otherwise nothing stops us from continuing to feed I/O to the disk controller when it expects that the queues are quiesced as it pokes registers to change its power states. Fixes resume during disk activity on my T480 with nvme. To generate a diff of this commit: cvs rdiff -u -r1.106.4.2 -r1.106.4.3 src/sys/dev/ld.c cvs rdiff -u -r1.33 -r1.33.4.1 src/sys/dev/ldvar.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/dev/ld.c diff -u src/sys/dev/ld.c:1.106.4.2 src/sys/dev/ld.c:1.106.4.3 --- src/sys/dev/ld.c:1.106.4.2 Sat Mar 21 15:52:09 2020 +++ src/sys/dev/ld.c Mon Jun 21 17:23:13 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ld.c,v 1.106.4.2 2020/03/21 15:52:09 martin Exp $ */ +/* $NetBSD: ld.c,v 1.106.4.3 2021/06/21 17:23:13 martin Exp $ */ /*- * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.106.4.2 2020/03/21 15:52:09 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.106.4.3 2021/06/21 17:23:13 martin Exp $"); #include #include @@ -63,6 +63,7 @@ __KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.106 static void ldminphys(struct buf *bp); static bool ld_suspend(device_t, const pmf_qual_t *); +static bool ld_resume(device_t, const pmf_qual_t *); static bool ld_shutdown(device_t, int); static int ld_diskstart(device_t, struct buf *bp); static void ld_iosize(device_t, int *); @@ -160,7 +161,8 @@ ldattach(struct ld_softc *sc, const char bufq_alloc(&dksc->sc_bufq, default_strategy, BUFQ_SORT_RAWBLOCK); /* Register with PMF */ - if (!pmf_device_register1(dksc->sc_dev, ld_suspend, NULL, ld_shutdown)) + if (!pmf_device_register1(dksc->sc_dev, ld_suspend, ld_resume, + ld_shutdown)) aprint_error_dev(dksc->sc_dev, "couldn't establish power handler\n"); @@ -266,7 +268,55 @@ ldenddetach(struct ld_softc *sc) static bool ld_suspend(device_t dev, const pmf_qual_t *qual) { - return ld_shutdown(dev, 0); + struct ld_softc *sc = device_private(dev); + int queuecnt; + bool ok = false; + + /* Block new requests and wait for outstanding requests to drain. */ + mutex_enter(&sc->sc_mutex); + KASSERT((sc->sc_flags & LDF_SUSPEND) == 0); + sc->sc_flags |= LDF_SUSPEND; + while ((queuecnt = sc->sc_queuecnt) > 0) { + if (cv_timedwait(&sc->sc_drain, &sc->sc_mutex, 30 * hz)) + break; + } + mutex_exit(&sc->sc_mutex); + + /* Block suspend if we couldn't drain everything in 30sec. */ + if (queuecnt > 0) { + device_printf(dev, "timeout draining buffers\n"); + goto out; + } + + /* Flush cache before we lose power. If we can't, block suspend. */ + if (ld_flush(dev, /*poll*/false) != 0) { + device_printf(dev, "failed to flush cache\n"); + goto out; + } + + /* Success! */ + ok = true; + +out: if (!ok) + (void)ld_resume(dev, qual); + return ok; +} + +static bool +ld_resume(device_t dev, const pmf_qual_t *qual) +{ + struct ld_softc *sc = device_private(dev); + + /* Allow new requests to come in. */ + mutex_enter(&sc->sc_mutex); + KASSERT(sc->sc_flags & LDF_SUSPEND); + sc->sc_flags &= ~LDF_SUSPEND; + mutex_exit(&sc->sc_mutex); + + /* Restart any pending queued requests. */ + dk_start(&sc->sc_dksc, NULL); + + return true; } /* ARGSUSED */ @@ -428,17 +478,24 @@ ld_diskstart(device_t dev, struct buf *b struct ld_softc *sc = device_private(dev); int error; - if (sc->sc_queuecnt >= sc->sc_maxqueuecnt) + if (sc->sc_queuecnt >= sc->sc_maxqueuecnt || + sc->sc_flags & LDF_SUSPEND) { + if (sc->sc_flags & LDF_SUSPEND) + aprint_debug_dev(dev, "i/o blocked while suspended\n"); return EAGAIN; + } if ((sc->sc_flags & LDF_MPSAFE) == 0) KERNEL_LOCK(1, curlwp); mutex_enter(&sc->sc_mutex); - if (sc->sc_queuecnt >= sc->sc_maxqueuecnt) + if (sc->sc_queuecnt >= sc->sc_maxqueuecnt || + sc->sc_flags & LDF_SUSPEND) { + if (sc->sc_flags & LDF_SUSPEND) + aprint_debug_dev(dev, "i/o blocked while suspended\n"); error = EAGAIN; - else { + } else { error = (*sc->sc_start)(sc, bp); if (error == 0) sc->sc_queuecnt++; Index: src/sys/dev/ldvar.h diff -u src/sys/dev/ldvar.h:1.33 src/sys/dev/ldvar.h:1.33.4.1 --- src/sys/dev/ldvar.h:1.33 Tue Mar 19 07:01:14 2019 +++ src/sys/dev/ldvar.h Mon Jun 21 17:23:13 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ldvar.h,v 1.33 2019/03/19 07:01:14 mlelstv Exp $ */ +/* $NetBSD: ldvar.h,v 1.33.4.1 2021/06/21 17:23:13 martin Exp $ */ /*- * Copyright (c) 2000 The NetBSD Foundation, Inc. @@ -70,6 +70,7 @@ struct ld_softc { #define LDF_DRAIN 0x020 /* maxqueuecnt has changed; drain */ #define LDF_NO_RND 0x040 /* do not attach rnd source
CVS commit: [netbsd-9] src/sys/arch/x86/pci
Module Name:src Committed By: martin Date: Mon Jun 21 17:19:55 UTC 2021 Modified Files: src/sys/arch/x86/pci [netbsd-9]: dwiic_pci.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1303): sys/arch/x86/pci/dwiic_pci.c: revision 1.5 (patch) dwiic(4): Attribute output correctly and relegate to debug-level. Tidy up a little while here. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.2.4.1 src/sys/arch/x86/pci/dwiic_pci.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/pci/dwiic_pci.c diff -u src/sys/arch/x86/pci/dwiic_pci.c:1.2 src/sys/arch/x86/pci/dwiic_pci.c:1.2.4.1 --- src/sys/arch/x86/pci/dwiic_pci.c:1.2 Wed Sep 26 19:06:33 2018 +++ src/sys/arch/x86/pci/dwiic_pci.c Mon Jun 21 17:19:55 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: dwiic_pci.c,v 1.2 2018/09/26 19:06:33 jakllsch Exp $ */ +/* $NetBSD: dwiic_pci.c,v 1.2.4.1 2021/06/21 17:19:55 martin Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.2 2018/09/26 19:06:33 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dwiic_pci.c,v 1.2.4.1 2021/06/21 17:19:55 martin Exp $"); #include #include @@ -68,9 +68,8 @@ struct pci_dwiic_softc { static uint32_t lpss_read(struct pci_dwiic_softc *sc, int offset) { - u_int32_t b = bus_space_read_4(sc->sc_dwiic.sc_iot, sc->sc_dwiic.sc_ioh, - offset); - return b; + return bus_space_read_4(sc->sc_dwiic.sc_iot, sc->sc_dwiic.sc_ioh, + offset); } static void @@ -169,7 +168,7 @@ pci_dwiic_attach(device_t parent, device pa->pa_bus, pa->pa_device, pa->pa_function); if (sc->sc_acpinode) { - sc->sc_dwiic.sc_iba.iba_child_devices = + sc->sc_dwiic.sc_iba.iba_child_devices = acpi_enter_i2c_devs(sc->sc_acpinode); } else { aprint_verbose_dev(self, "no matching ACPI node\n"); @@ -188,13 +187,18 @@ out: static bool dwiic_pci_power(struct dwiic_softc *dwsc, bool power) { - struct pci_dwiic_softc *sc = (void *)dwsc; - pcireg_t pmreg; - - printf("status 0x%x\n", pci_conf_read(sc->sc_pc, sc->sc_ptag, PCI_COMMAND_STATUS_REG)); - printf("reset 0x%x\n", lpss_read(sc, LPSS_RESET)); - printf("rlo 0x%x\n", lpss_read(sc, LPSS_REMAP_LO)); - printf("rho 0x%x\n", lpss_read(sc, LPSS_REMAP_HI)); + struct pci_dwiic_softc *sc = container_of(dwsc, struct pci_dwiic_softc, + sc_dwiic); + pcireg_t pmreg, csr; + uint32_t reset, rlo, rhi; + + csr = pci_conf_read(sc->sc_pc, sc->sc_ptag, PCI_COMMAND_STATUS_REG); + reset = lpss_read(sc, LPSS_RESET); + rlo = lpss_read(sc, LPSS_REMAP_LO); + rhi = lpss_read(sc, LPSS_REMAP_HI); + aprint_debug_dev(dwsc->sc_dev, + "status 0x%x reset 0x%x rlo 0x%x rhi 0x%x\n", + csr, reset, rlo, rhi); if (!power) lpss_write(sc, LPSS_CLKGATE, LPSS_CLKGATE_CTRL_OFF); @@ -205,7 +209,7 @@ dwiic_pci_power(struct dwiic_softc *dwsc pci_conf_write(sc->sc_pc, sc->sc_ptag, pmreg + PCI_PMCSR, power ? PCI_PMCSR_STATE_D0 : PCI_PMCSR_STATE_D3); DELAY(1); /* 10 milliseconds */ - DPRINTF((" -> 0x%x\n", + DPRINTF((" -> 0x%x\n", pci_conf_read(sc->sc_pc, sc->sc_ptag, pmreg + PCI_PMCSR))); } if (power) {
CVS commit: [netbsd-9] src/sys/dev/usb
Module Name:src Committed By: martin Date: Mon Jun 21 17:15:38 UTC 2021 Modified Files: src/sys/dev/usb [netbsd-9]: ualea.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1302): sys/dev/usb/ualea.c: revision 1.13 ualea(4): Null suspend/resume handler. To generate a diff of this commit: cvs rdiff -u -r1.9.10.2 -r1.9.10.3 src/sys/dev/usb/ualea.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/usb/ualea.c diff -u src/sys/dev/usb/ualea.c:1.9.10.2 src/sys/dev/usb/ualea.c:1.9.10.3 --- src/sys/dev/usb/ualea.c:1.9.10.2 Wed Jul 15 13:52:05 2020 +++ src/sys/dev/usb/ualea.c Mon Jun 21 17:15:38 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ualea.c,v 1.9.10.2 2020/07/15 13:52:05 martin Exp $ */ +/* $NetBSD: ualea.c,v 1.9.10.3 2021/06/21 17:15:38 martin Exp $ */ /*- * Copyright (c) 2017 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9.10.2 2020/07/15 13:52:05 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ualea.c,v 1.9.10.3 2021/06/21 17:15:38 martin Exp $"); #include #include @@ -144,6 +144,10 @@ ualea_attach(device_t parent, device_t s return; } + if (!pmf_device_register(self, NULL, NULL)) + aprint_error_dev(sc->sc_dev, "failed to register power handler" + "\n"); + /* Success! We are ready to run. */ mutex_enter(&sc->sc_lock); sc->sc_attached = true;
CVS commit: [netbsd-9] src/sys/dev/usb
Module Name:src Committed By: martin Date: Mon Jun 21 17:11:46 UTC 2021 Modified Files: src/sys/dev/usb [netbsd-9]: xhci.c xhcireg.h xhcivar.h Log Message: Pull up following revision(s) (requested by riastradh in ticket #1301): sys/dev/usb/xhci.c: revision 1.140 sys/dev/usb/xhci.c: revision 1.141 sys/dev/usb/xhci.c: revision 1.143 sys/dev/usb/xhcivar.h: revision 1.18 sys/dev/usb/xhcivar.h: revision 1.19 sys/dev/usb/xhcireg.h: revision 1.19 sys/dev/usb/xhci.c: revision 1.139 xhci(4): Draft suspend/resume. Work almost entirely done and tested by maya@ based on xhci 1.2 spec; tidied up and tweaked by me. Not sure about issuing Stop Endpoint commands or ensuring the Command Ring is in the Stopped or Idle state, but this seems to work as is, so it's already an improvement over what we had before which was no xhci suspend/resume at all. In particular, it's not clear to us: - if we don't have any pending USB activity whether we need to issue the Stop Endpoints or quiesce the command ring; but - if we do have any pending USB activity whether issuing Stop Endpoint is enough or whether we also need to do anything to synchronize with other software logic to quiesce it too. xhci(4): Block commands and issue Stop Endpoint on suspend. xhci: Fix logic in waiting for command queue access. _Either_ an existing command in progress, _or_ an existing suspend in progress that is not done by us, should block us; the logic I wrote previously erroneously blocked only if both conditions happened at the same time. Should fix issue reported by Andrius V in the PR kern/56050 followup discussion. xhci(4): Wait USB_RESUME_WAIT ms, not 20 ms. Better to use the named constant, and although the spec says 20 ms is enough, apparently for some devices it's not. To generate a diff of this commit: cvs rdiff -u -r1.107.2.7 -r1.107.2.8 src/sys/dev/usb/xhci.c cvs rdiff -u -r1.13 -r1.13.2.1 src/sys/dev/usb/xhcireg.h cvs rdiff -u -r1.11 -r1.11.4.1 src/sys/dev/usb/xhcivar.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/dev/usb/xhci.c diff -u src/sys/dev/usb/xhci.c:1.107.2.7 src/sys/dev/usb/xhci.c:1.107.2.8 --- src/sys/dev/usb/xhci.c:1.107.2.7 Wed Dec 23 12:34:38 2020 +++ src/sys/dev/usb/xhci.c Mon Jun 21 17:11:46 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: xhci.c,v 1.107.2.7 2020/12/23 12:34:38 martin Exp $ */ +/* $NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $ */ /* * Copyright (c) 2013 Jonathan A. Kollasch @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.7 2020/12/23 12:34:38 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -154,6 +154,8 @@ static int xhci_roothub_ctrl(struct usbd static usbd_status xhci_configure_endpoint(struct usbd_pipe *); //static usbd_status xhci_unconfigure_endpoint(struct usbd_pipe *); static usbd_status xhci_reset_endpoint(struct usbd_pipe *); +static usbd_status xhci_stop_endpoint_cmd(struct xhci_softc *, +struct xhci_slot *, u_int, uint32_t); static usbd_status xhci_stop_endpoint(struct usbd_pipe *); static void xhci_host_dequeue(struct xhci_ring * const); @@ -369,7 +371,6 @@ xhci_rt_write_4(const struct xhci_softc bus_space_write_4(sc->sc_iot, sc->sc_rbh, offset, value); } -#if 0 /* unused */ static inline uint64_t xhci_rt_read_8(const struct xhci_softc * const sc, bus_size_t offset) { @@ -389,7 +390,6 @@ xhci_rt_read_8(const struct xhci_softc * return value; } -#endif /* unused */ static inline void xhci_rt_write_8(const struct xhci_softc * const sc, bus_size_t offset, @@ -678,15 +678,408 @@ xhci_activate(device_t self, enum devact } bool -xhci_suspend(device_t dv, const pmf_qual_t *qual) +xhci_suspend(device_t self, const pmf_qual_t *qual) { - return false; + struct xhci_softc * const sc = device_private(self); + size_t i, j, bn, dci; + int port; + uint32_t v; + usbd_status err; + bool ok = false; + + XHCIHIST_FUNC(); XHCIHIST_CALLED(); + + mutex_enter(&sc->sc_lock); + + /* + * Block issuance of new commands, and wait for all pending + * commands to complete. + */ + KASSERT(sc->sc_suspender == NULL); + sc->sc_suspender = curlwp; + while (sc->sc_command_addr != 0) + cv_wait(&sc->sc_cmdbusy_cv, &sc->sc_lock); + + /* + * xHCI Requirements Specification 1.2, May 2019, Sec. 4.23.2: + * xHCI Power Management, p. 342 + * https://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf#page=342 + */ + + /* + * `1. Stop all USB activity by issuing Stop Endpoint Commands + * for Busy endpoints in the Running state. If the Force + * Save Context Capability (FSC = ``0'') is not supported, + * then Stop Endpoint Commands shall be issued for all idle + * endpoints in t
CVS commit: [netbsd-9] src/sys/external/bsd/drm2/dist/drm/i915
Module Name:src Committed By: martin Date: Mon Jun 21 16:41:02 UTC 2021 Modified Files: src/sys/external/bsd/drm2/dist/drm/i915 [netbsd-9]: i915_drv.h Log Message: Pull up following revision(s) (requested by riastradh in ticket #1300): sys/external/bsd/drm2/dist/drm/i915/i915_drv.h: revision 1.33 (patch) i915drmkms: Fix LOCKDEBUG panic and potential deadlock. This path is taken with a spin lock held, and possibly even in interrupt context, where taking vmobjlock is not kosher, but we are guaranteed to have the queue populated and unchanging. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.29.2.1 -r1.29.2.2 \ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.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/external/bsd/drm2/dist/drm/i915/i915_drv.h diff -u src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.29.2.1 src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.29.2.2 --- src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h:1.29.2.1 Thu Dec 12 21:00:32 2019 +++ src/sys/external/bsd/drm2/dist/drm/i915/i915_drv.h Mon Jun 21 16:41:02 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: i915_drv.h,v 1.29.2.1 2019/12/12 21:00:32 martin Exp $ */ +/* $NetBSD: i915_drv.h,v 1.29.2.2 2021/06/21 16:41:02 martin Exp $ */ /* i915_drv.h -- Private header for the I915 driver -*- linux-c -*- */ @@ -3021,9 +3021,10 @@ i915_gem_object_get_page(struct drm_i915 * lock to prevent them from disappearing. */ KASSERT(obj->pages != NULL); - mutex_enter(obj->base.filp->vmobjlock); - page = uvm_pagelookup(obj->base.filp, ptoa(n)); - mutex_exit(obj->base.filp->vmobjlock); + TAILQ_FOREACH(page, &obj->pageq, pageq.queue) { + if (n-- == 0) +break; + } } KASSERT(page != NULL); return container_of(page, struct page, p_vmp);
CVS commit: [netbsd-9] src/sys/kern
Module Name:src Committed By: martin Date: Mon Jun 21 16:14:14 UTC 2021 Modified Files: src/sys/kern [netbsd-9]: kern_ksyms.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1299): sys/kern/kern_ksyms.c: revision 1.90 sys/kern/kern_ksyms.c: revision 1.91 sys/kern/kern_ksyms.c: revision 1.92 sys/kern/kern_ksyms.c: revision 1.93 sys/kern/kern_ksyms.c: revision 1.94 sys/kern/kern_ksyms.c: revision 1.95 sys/kern/kern_ksyms.c: revision 1.96 sys/kern/kern_ksyms.c: revision 1.97 ksyms(4): Fix ksymsread synchronization. Fixes crash on concurrent update and read of /dev/ksyms. XXX Unclear why we have to skip sd_gone entries here -- it seems like they should be preserved until ksymsclose. ksyms(4): Modify ksyms_symtabs only at IPL_HIGH. This limits the opportunities for ddb to witness an inconsistent state of the symbol table list. ksyms(4): Don't skip symbol tables that are soon to be freed. They will not actually be freed until /dev/ksyms is closed, so continued access to them remains kosher. Revert "ksyms(4): Don't skip symbol tables that are soon to be freed." Apparently the equality kassert this restored doesn't work; to be analyzed. Fix regression introduced in rev 1.90 in which the last element of ksyms_symtabs is skipped by mistake. ksyms(4): Fix race in ksymsread iteration. TAILQ_NEXT(ksyms_last_snapshot) might change while we are iterating, but ksyms_last_snapshot itself cannot, so invert the loop structure. Discussed with rin@. ksyms(4): Don't skip symbol tables that are soon to be freed, take 2. They will not actually be freed until /dev/ksyms is closed, so continued access to them remains kosher. The previous change was busted because of an off-by-one error in a previous previous change's iteration over the symtabs; that error has since been corrected. ksyms(4): Allow multiple concurrent opens of /dev/ksyms. First one takes a snapshot; others all agree with the snapshot. Previously this code path was just broken (could fail horribly if modules were unloaded after one of the opens is closed), so I just blocked it off in an earlier commit, but that broke crash(8). So let's continue allowing multiple opens seeing the same snapshot, but without the horrible bugs. To generate a diff of this commit: cvs rdiff -u -r1.87.8.1 -r1.87.8.2 src/sys/kern/kern_ksyms.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/kern_ksyms.c diff -u src/sys/kern/kern_ksyms.c:1.87.8.1 src/sys/kern/kern_ksyms.c:1.87.8.2 --- src/sys/kern/kern_ksyms.c:1.87.8.1 Tue Jan 7 11:54:57 2020 +++ src/sys/kern/kern_ksyms.c Mon Jun 21 16:14:14 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_ksyms.c,v 1.87.8.1 2020/01/07 11:54:57 martin Exp $ */ +/* $NetBSD: kern_ksyms.c,v 1.87.8.2 2021/06/21 16:14:14 martin Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.87.8.1 2020/01/07 11:54:57 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c,v 1.87.8.2 2021/06/21 16:14:14 martin Exp $"); #if defined(_KERNEL) && defined(_KERNEL_OPT) #include "opt_copy_symtab.h" @@ -92,6 +92,8 @@ __KERNEL_RCSID(0, "$NetBSD: kern_ksyms.c #include #include #include +#include +#include #ifdef DDB #include @@ -110,7 +112,8 @@ static uint32_t *ksyms_nmap = NULL; #endif static int ksyms_maxlen; -static bool ksyms_isopen; +static uint64_t ksyms_opencnt; +static struct ksyms_symtab *ksyms_last_snapshot; static bool ksyms_initted; static bool ksyms_loaded; static kmutex_t ksyms_lock __cacheline_aligned; @@ -140,7 +143,7 @@ struct ksyms_hdr ksyms_hdr; int ksyms_symsz; int ksyms_strsz; int ksyms_ctfsz; /* this is not currently used by savecore(8) */ -TAILQ_HEAD(, ksyms_symtab) ksyms_symtabs = +TAILQ_HEAD(ksyms_symtab_queue, ksyms_symtab) ksyms_symtabs = TAILQ_HEAD_INITIALIZER(ksyms_symtabs); static int @@ -296,6 +299,7 @@ addsymtab(const char *name, void *symsta int i, j, n, nglob; char *str; int nsyms = symsize / sizeof(Elf_Sym); + int s; /* Sanity check for pre-allocated map table used during startup. */ if ((nmap == ksyms_nmap) && (nsyms >= KSYMS_MAX_ID)) { @@ -419,7 +423,7 @@ addsymtab(const char *name, void *symsta for (new = 0; new < n; new++) { uint32_t orig = nsym[new].st_size - 1; uint32_t size = nmap[orig]; - + nmap[orig] = new + 1; /* restore the size */ @@ -428,9 +432,18 @@ addsymtab(const char *name, void *symsta } #endif - /* ksymsread() is unlocked, so membar. */ - membar_producer(); + KASSERT(strcmp(name, "netbsd") == 0 || mutex_owned(&ksyms_lock)); + KASSERT(cold || mutex_owned(&ksyms_lock)); + + /* + * Ensure ddb never witnesses an inconsistent state of the + * queue, unless memory is so corrupt that we crash in + * TAILQ_INSERT_TAIL. + */ + s = splhigh(); TA
CVS commit: [netbsd-9] src/lib/libc/gen
Module Name:src Committed By: martin Date: Mon Jun 21 16:04:57 UTC 2021 Modified Files: src/lib/libc/gen [netbsd-9]: setjmp.3 Log Message: Pull up following revision(s) (requested by riastradh in ticket #1298): lib/libc/gen/setjmp.3: revision 1.18 Clarify what happens when you longjmp(..., 0). Derived from C99 7.13.2.1 `The longjmp function'. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.17.64.1 src/lib/libc/gen/setjmp.3 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/gen/setjmp.3 diff -u src/lib/libc/gen/setjmp.3:1.17 src/lib/libc/gen/setjmp.3:1.17.64.1 --- src/lib/libc/gen/setjmp.3:1.17 Sat May 31 16:15:07 2008 +++ src/lib/libc/gen/setjmp.3 Mon Jun 21 16:04:57 2021 @@ -1,4 +1,4 @@ -.\" $NetBSD: setjmp.3,v 1.17 2008/05/31 16:15:07 enami Exp $ +.\" $NetBSD: setjmp.3,v 1.17.64.1 2021/06/21 16:04:57 martin Exp $ .\" .\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -85,6 +85,15 @@ invocation of the call had just returned the value specified by .Fa val , instead of 0. +The +.Fn longjmp +functions cannot cause +.Fn setjmp +to return 0; if +.Fa val +is 0, +.Fn setjmp +returns 1 instead. .Pp Pairs of calls may be intermixed, i.e., both .Fn sigsetjmp
CVS commit: [netbsd-9] src/external/bsd/libarchive/dist
Module Name:src Committed By: martin Date: Mon Jun 21 15:41:39 UTC 2021 Modified Files: src/external/bsd/libarchive/dist/cat/test [netbsd-9]: test_0.c src/external/bsd/libarchive/dist/cpio/test [netbsd-9]: test_basic.c test_format_newc.c src/external/bsd/libarchive/dist/libarchive [netbsd-9]: archive_read.c archive_read_disk_posix.c archive_read_open_filename.c archive_read_support_format_xar.c archive_write_disk_posix.c src/external/bsd/libarchive/dist/libarchive/test [netbsd-9]: test_acl_platform_nfs4.c test_acl_platform_posix1e.c test_compat_zip.c test_fuzz.c test_read_extract.c test_read_format_gtar_sparse.c test_read_format_zip.c test_read_format_zip_7075_utf8_paths.c test_read_format_zip_comment_stored.c test_read_format_zip_extra_padding.c test_read_format_zip_high_compression.c test_read_format_zip_jar.c test_read_format_zip_mac_metadata.c test_read_format_zip_malformed.c test_read_format_zip_msdos.c test_read_format_zip_nested.c test_read_format_zip_nofiletype.c test_read_format_zip_padded.c test_read_format_zip_sfx.c test_read_format_zip_with_invalid_traditional_eocd.c test_read_format_zip_zip64.c test_read_pax_truncated.c test_read_truncated_filter.c test_sparse_basic.c test_write_disk.c test_write_disk_secure.c test_write_format_cpio_empty.c test_write_format_shar_empty.c test_write_format_tar.c test_write_format_tar_sparse.c src/external/bsd/libarchive/dist/tar [netbsd-9]: write.c src/external/bsd/libarchive/dist/tar/test [netbsd-9]: test_basic.c test_copy.c test_option_C_upper.c test_option_s.c src/external/bsd/libarchive/dist/test_utils [netbsd-9]: test_common.h test_main.c Log Message: Apply patch, requested by christos in ticket #1297: external/bsd/libarchive/dist/cat/test/test_0.c up to 1.2 external/bsd/libarchive/dist/cpio/test/test_basic.c up to 1.2 external/bsd/libarchive/dist/cpio/test/test_format_newc.c up to 1.3 external/bsd/libarchive/dist/libarchive/archive_read.c up to 1.2 external/bsd/libarchive/dist/libarchive/archive_read_disk_posix.c up to 1.2 external/bsd/libarchive/dist/libarchive/archive_read_open_filename.c up to 1.2 external/bsd/libarchive/dist/libarchive/archive_read_support_format_xar.c up to 1.2 external/bsd/libarchive/dist/libarchive/archive_write_disk_posix.c up to 1.6 external/bsd/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_compat_zip.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_fuzz.cup to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_extract.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_gtar_sparse.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_comment_stored.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_jar.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_mac_metadata.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_malformed.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_msdos.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_nested.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_padded.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_sfx.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_format_zip_zip64.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_pax_truncated.c up to 1.2 external/bsd/libarchive/dist/libarchive/test/test_read_truncated_filter.c up to 1.
CVS commit: [netbsd-8] src/sys
Module Name:src Committed By: martin Date: Mon Jun 21 14:56:46 UTC 2021 Modified Files: src/sys/rump/include/rump [netbsd-8]: rump_namei.h src/sys/sys [netbsd-8]: namei.h Log Message: Regen for ticket #1685 To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.31.6.1 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.97 -r1.97.6.1 src/sys/sys/namei.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/rump/include/rump/rump_namei.h diff -u src/sys/rump/include/rump/rump_namei.h:1.31 src/sys/rump/include/rump/rump_namei.h:1.31.6.1 --- src/sys/rump/include/rump/rump_namei.h:1.31 Tue Mar 21 10:20:38 2017 +++ src/sys/rump/include/rump/rump_namei.h Mon Jun 21 14:56:46 2021 @@ -1,11 +1,11 @@ -/* $NetBSD: rump_namei.h,v 1.31 2017/03/21 10:20:38 riastradh Exp $ */ +/* $NetBSD: rump_namei.h,v 1.31.6.1 2021/06/21 14:56:46 martin Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.41 2017/03/21 10:20:12 riastradh Exp + * from: NetBSD: namei.src,v 1.41.6.1 2021/06/21 14:55:15 martin Exp */ #ifndef _RUMP_RUMP_NAMEI_H_ @@ -24,7 +24,8 @@ #define RUMP_NAMEI_NOFOLLOW 0x #define RUMP_NAMEI_EMULROOTSET 0x0080 #define RUMP_NAMEI_NOCHROOT 0x0100 -#define RUMP_NAMEI_MODMASK 0x01fc +#define RUMP_NAMEI_NONEXCLHACK 0x0200 +#define RUMP_NAMEI_MODMASK 0x03fc #define RUMP_NAMEI_NOCROSSMOUNT 0x100 #define RUMP_NAMEI_RDONLY 0x200 #define RUMP_NAMEI_ISDOTDOT 0x0002000 Index: src/sys/sys/namei.h diff -u src/sys/sys/namei.h:1.97 src/sys/sys/namei.h:1.97.6.1 --- src/sys/sys/namei.h:1.97 Tue Mar 21 10:20:38 2017 +++ src/sys/sys/namei.h Mon Jun 21 14:56:46 2021 @@ -1,11 +1,11 @@ -/* $NetBSD: namei.h,v 1.97 2017/03/21 10:20:38 riastradh Exp $ */ +/* $NetBSD: namei.h,v 1.97.6.1 2021/06/21 14:56:46 martin Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.41 2017/03/21 10:20:12 riastradh Exp + * from: NetBSD: namei.src,v 1.41.6.1 2021/06/21 14:55:15 martin Exp */ /* @@ -160,7 +160,8 @@ struct nameidata { #define EMULROOTSET 0x0080 /* emulation root already in ni_erootdir */ #define NOCHROOT 0x0100 /* no chroot on abs path lookups */ -#define MODMASK 0x01fc /* mask of operational modifiers */ +#define NONEXCLHACK 0x0200 /* open wwith O_CREAT but not O_EXCL */ +#define MODMASK 0x03fc /* mask of operational modifiers */ /* * Namei parameter descriptors. */ @@ -351,7 +352,8 @@ struct nchstats _NAMEI_CACHE_STATS(uint6 #define NAMEI_NOFOLLOW 0x #define NAMEI_EMULROOTSET 0x0080 #define NAMEI_NOCHROOT 0x0100 -#define NAMEI_MODMASK 0x01fc +#define NAMEI_NONEXCLHACK 0x0200 +#define NAMEI_MODMASK 0x03fc #define NAMEI_NOCROSSMOUNT 0x100 #define NAMEI_RDONLY 0x200 #define NAMEI_ISDOTDOT 0x0002000
CVS commit: [netbsd-8] src/sys
Module Name:src Committed By: martin Date: Mon Jun 21 14:55:15 UTC 2021 Modified Files: src/sys/kern [netbsd-8]: vfs_lookup.c vfs_vnops.c src/sys/sys [netbsd-8]: namei.src Log Message: Pull up following revision(s) (requested by dholland in ticket #1685): sys/sys/namei.src: revision 1.59(via patch) sys/kern/vfs_vnops.c: revision 1.215 sys/kern/vfs_lookup.c: revision 1.226 Add a new namei flag NONEXCLHACK for open with O_CREAT and not O_EXCL. This case needs to be distinguished from the other CREATE operations because it is supposed to successfully return (and open) the target if it exists. In the case where that target is the root, or a mount point, such that there's no parent dir, "real" CREATE operations fail, but O_CREAT without O_EXCL needs to succeed. So (a) add the flag, (b) test for it in namei in the situation described above, (c) set it in open under the appropriate circumstances, and (d) because this can result in namei returning ni_dvp of NULL, cope with that case. Should get into -9 and maybe even -8, because it was prompted by issues with 3rd-party code. The use of a flag (vs. adding an additional nameiop, which would be more appropriate) was deliberate to make the patch small and noninvasive. To generate a diff of this commit: cvs rdiff -u -r1.207.2.1 -r1.207.2.2 src/sys/kern/vfs_lookup.c cvs rdiff -u -r1.195.6.1 -r1.195.6.2 src/sys/kern/vfs_vnops.c cvs rdiff -u -r1.41 -r1.41.6.1 src/sys/sys/namei.src 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/vfs_lookup.c diff -u src/sys/kern/vfs_lookup.c:1.207.2.1 src/sys/kern/vfs_lookup.c:1.207.2.2 --- src/sys/kern/vfs_lookup.c:1.207.2.1 Mon Jul 10 13:02:47 2017 +++ src/sys/kern/vfs_lookup.c Mon Jun 21 14:55:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_lookup.c,v 1.207.2.1 2017/07/10 13:02:47 martin Exp $ */ +/* $NetBSD: vfs_lookup.c,v 1.207.2.2 2021/06/21 14:55:15 martin Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.207.2.1 2017/07/10 13:02:47 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.207.2.2 2021/06/21 14:55:15 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_magiclinks.h" @@ -1402,10 +1402,33 @@ namei_oneroot(struct namei_state *state, * a CREATE, DELETE, or RENAME), and we don't have one * (because this is the root directory, or we crossed * a mount point), then we must fail. + * + * 20210604 dholland when NONEXCLHACK is set (open + * with O_CREAT but not O_EXCL) skip this logic. Since + * we have a foundobj, open will not be creating, so + * it doesn't actually need or use the searchdir, so + * it's ok to return it even if it's on a different + * volume, and it's also ok to return NULL; by setting + * NONEXCLHACK the open code promises to cope with + * those cases correctly. (That is, it should do what + * it would do anyway, that is, just release the + * searchdir, except not crash if it's null.) This is + * needed because otherwise opening mountpoints with + * O_CREAT but not O_EXCL fails... which is a silly + * thing to do but ought to work. (This whole issue + * came to light because 3rd party code wanted to open + * certain procfs nodes with O_CREAT for some 3rd + * party reason, and it failed.) + * + * Note that NONEXCLHACK is properly a different + * nameiop (it is partway between LOOKUP and CREATE) + * but it was stuffed in as a flag instead to make the + * resulting patch less invasive for pullup. Blah. */ if (cnp->cn_nameiop != LOOKUP && (searchdir == NULL || - searchdir->v_mount != foundobj->v_mount)) { + searchdir->v_mount != foundobj->v_mount) && + (cnp->cn_flags & NONEXCLHACK) == 0) { if (searchdir) { vput(searchdir); } Index: src/sys/kern/vfs_vnops.c diff -u src/sys/kern/vfs_vnops.c:1.195.6.1 src/sys/kern/vfs_vnops.c:1.195.6.2 --- src/sys/kern/vfs_vnops.c:1.195.6.1 Thu Apr 12 01:45:57 2018 +++ src/sys/kern/vfs_vnops.c Mon Jun 21 14:55:15 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnops.c,v 1.195.6.1 2018/04/12 01:45:57 msaitoh Exp $ */ +/* $NetBSD: vfs_vnops.c,v 1.195.6.2 2021/06/21 14:55:15 martin Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.195.6.1 2018/04/12 01:45:57 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.195.6.2 2021/06/21 14:55:15 martin Exp $"); #include "veriexec.h" @@ -160,6 +160,8 @@ vn_open(struct nameidata *ndp, int fmode if ((fmode & O_EXCL) == 0 && ((fmode & O_NOFOLLOW) == 0)) ndp->ni_cnd.cn_flags |= FOLLOW; + if ((fmode & O_EXCL) == 0) + ndp->ni_cnd.cn_flags |= NONEXCLHACK; } else { ndp->ni_cnd.cn_nameiop = LOOKUP; ndp->ni_cnd.cn_flags |= LOCKLEAF; @@ -182,7 +184,12 @@ vn_open(struct nameid
CVS commit: [netbsd-9] src/sys
Module Name:src Committed By: martin Date: Mon Jun 21 14:52:58 UTC 2021 Modified Files: src/sys/rump/include/rump [netbsd-9]: rump_namei.h src/sys/sys [netbsd-9]: namei.h Log Message: Regen for ticket #1296 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.32.2.1 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.98 -r1.98.2.1 src/sys/sys/namei.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/rump/include/rump/rump_namei.h diff -u src/sys/rump/include/rump/rump_namei.h:1.32 src/sys/rump/include/rump/rump_namei.h:1.32.2.1 --- src/sys/rump/include/rump/rump_namei.h:1.32 Mon Jun 3 06:05:39 2019 +++ src/sys/rump/include/rump/rump_namei.h Mon Jun 21 14:52:58 2021 @@ -1,11 +1,11 @@ -/* $NetBSD: rump_namei.h,v 1.32 2019/06/03 06:05:39 msaitoh Exp $ */ +/* $NetBSD: rump_namei.h,v 1.32.2.1 2021/06/21 14:52:58 martin Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.42 2019/06/03 06:04:21 msaitoh Exp + * from: NetBSD: namei.src,v 1.42.2.1 2021/06/21 14:50:57 martin Exp */ #ifndef _RUMP_RUMP_NAMEI_H_ @@ -24,7 +24,8 @@ #define RUMP_NAMEI_NOFOLLOW 0x #define RUMP_NAMEI_EMULROOTSET 0x0080 #define RUMP_NAMEI_NOCHROOT 0x0100 -#define RUMP_NAMEI_MODMASK 0x01fc +#define RUMP_NAMEI_NONEXCLHACK 0x0200 +#define RUMP_NAMEI_MODMASK 0x03fc #define RUMP_NAMEI_NOCROSSMOUNT 0x100 #define RUMP_NAMEI_RDONLY 0x200 #define RUMP_NAMEI_ISDOTDOT 0x0002000 Index: src/sys/sys/namei.h diff -u src/sys/sys/namei.h:1.98 src/sys/sys/namei.h:1.98.2.1 --- src/sys/sys/namei.h:1.98 Mon Jun 3 06:05:39 2019 +++ src/sys/sys/namei.h Mon Jun 21 14:52:58 2021 @@ -1,11 +1,11 @@ -/* $NetBSD: namei.h,v 1.98 2019/06/03 06:05:39 msaitoh Exp $ */ +/* $NetBSD: namei.h,v 1.98.2.1 2021/06/21 14:52:58 martin Exp $ */ /* * WARNING: GENERATED FILE. DO NOT EDIT * (edit namei.src and run make namei in src/sys/sys) * by: NetBSD: gennameih.awk,v 1.5 2009/12/23 14:17:19 pooka Exp - * from: NetBSD: namei.src,v 1.42 2019/06/03 06:04:21 msaitoh Exp + * from: NetBSD: namei.src,v 1.42.2.1 2021/06/21 14:50:57 martin Exp */ /* @@ -160,7 +160,8 @@ struct nameidata { #define EMULROOTSET 0x0080 /* emulation root already in ni_erootdir */ #define NOCHROOT 0x0100 /* no chroot on abs path lookups */ -#define MODMASK 0x01fc /* mask of operational modifiers */ +#define NONEXCLHACK 0x0200 /* open wwith O_CREAT but not O_EXCL */ +#define MODMASK 0x03fc /* mask of operational modifiers */ /* * Namei parameter descriptors. */ @@ -351,7 +352,8 @@ struct nchstats _NAMEI_CACHE_STATS(uint6 #define NAMEI_NOFOLLOW 0x #define NAMEI_EMULROOTSET 0x0080 #define NAMEI_NOCHROOT 0x0100 -#define NAMEI_MODMASK 0x01fc +#define NAMEI_NONEXCLHACK 0x0200 +#define NAMEI_MODMASK 0x03fc #define NAMEI_NOCROSSMOUNT 0x100 #define NAMEI_RDONLY 0x200 #define NAMEI_ISDOTDOT 0x0002000
CVS commit: [netbsd-9] src/sys
Module Name:src Committed By: martin Date: Mon Jun 21 14:50:57 UTC 2021 Modified Files: src/sys/kern [netbsd-9]: vfs_lookup.c vfs_vnops.c src/sys/sys [netbsd-9]: namei.src Log Message: Pull up following revision(s) (requested by dholland in ticket #1296): sys/sys/namei.src: revision 1.59(via patch) sys/kern/vfs_vnops.c: revision 1.215 sys/kern/vfs_lookup.c: revision 1.226 Add a new namei flag NONEXCLHACK for open with O_CREAT and not O_EXCL. This case needs to be distinguished from the other CREATE operations because it is supposed to successfully return (and open) the target if it exists. In the case where that target is the root, or a mount point, such that there's no parent dir, "real" CREATE operations fail, but O_CREAT without O_EXCL needs to succeed. So (a) add the flag, (b) test for it in namei in the situation described above, (c) set it in open under the appropriate circumstances, and (d) because this can result in namei returning ni_dvp of NULL, cope with that case. Should get into -9 and maybe even -8, because it was prompted by issues with 3rd-party code. The use of a flag (vs. adding an additional nameiop, which would be more appropriate) was deliberate to make the patch small and noninvasive. To generate a diff of this commit: cvs rdiff -u -r1.212 -r1.212.2.1 src/sys/kern/vfs_lookup.c cvs rdiff -u -r1.200 -r1.200.4.1 src/sys/kern/vfs_vnops.c cvs rdiff -u -r1.42 -r1.42.2.1 src/sys/sys/namei.src 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/vfs_lookup.c diff -u src/sys/kern/vfs_lookup.c:1.212 src/sys/kern/vfs_lookup.c:1.212.2.1 --- src/sys/kern/vfs_lookup.c:1.212 Thu Jul 18 09:39:40 2019 +++ src/sys/kern/vfs_lookup.c Mon Jun 21 14:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_lookup.c,v 1.212 2019/07/18 09:39:40 hannken Exp $ */ +/* $NetBSD: vfs_lookup.c,v 1.212.2.1 2021/06/21 14:50:57 martin Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212 2019/07/18 09:39:40 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.212.2.1 2021/06/21 14:50:57 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_magiclinks.h" @@ -1434,10 +1434,33 @@ namei_oneroot(struct namei_state *state, * a CREATE, DELETE, or RENAME), and we don't have one * (because this is the root directory, or we crossed * a mount point), then we must fail. + * + * 20210604 dholland when NONEXCLHACK is set (open + * with O_CREAT but not O_EXCL) skip this logic. Since + * we have a foundobj, open will not be creating, so + * it doesn't actually need or use the searchdir, so + * it's ok to return it even if it's on a different + * volume, and it's also ok to return NULL; by setting + * NONEXCLHACK the open code promises to cope with + * those cases correctly. (That is, it should do what + * it would do anyway, that is, just release the + * searchdir, except not crash if it's null.) This is + * needed because otherwise opening mountpoints with + * O_CREAT but not O_EXCL fails... which is a silly + * thing to do but ought to work. (This whole issue + * came to light because 3rd party code wanted to open + * certain procfs nodes with O_CREAT for some 3rd + * party reason, and it failed.) + * + * Note that NONEXCLHACK is properly a different + * nameiop (it is partway between LOOKUP and CREATE) + * but it was stuffed in as a flag instead to make the + * resulting patch less invasive for pullup. Blah. */ if (cnp->cn_nameiop != LOOKUP && (searchdir == NULL || - searchdir->v_mount != foundobj->v_mount)) { + searchdir->v_mount != foundobj->v_mount) && + (cnp->cn_flags & NONEXCLHACK) == 0) { if (searchdir) { vput(searchdir); } Index: src/sys/kern/vfs_vnops.c diff -u src/sys/kern/vfs_vnops.c:1.200 src/sys/kern/vfs_vnops.c:1.200.4.1 --- src/sys/kern/vfs_vnops.c:1.200 Thu Mar 7 11:09:48 2019 +++ src/sys/kern/vfs_vnops.c Mon Jun 21 14:50:57 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnops.c,v 1.200 2019/03/07 11:09:48 hannken Exp $ */ +/* $NetBSD: vfs_vnops.c,v 1.200.4.1 2021/06/21 14:50:57 martin Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.200 2019/03/07 11:09:48 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_vnops.c,v 1.200.4.1 2021/06/21 14:50:57 martin Exp $"); #include "veriexec.h" @@ -161,6 +161,8 @@ vn_open(struct nameidata *ndp, int fmode if ((fmode & O_EXCL) == 0 && ((fmode & O_NOFOLLOW) == 0)) ndp->ni_cnd.cn_flags |= FOLLOW; + if ((fmode & O_EXCL) == 0) + ndp->ni_cnd.cn_flags |= NONEXCLHACK; } else { ndp->ni_cnd.cn_nameiop = LOOKUP; ndp->ni_cnd.cn_flags |= LOCKLEAF; @@ -183,7 +185,12 @@ vn_open(struct nameidata *ndp, int fmode error = veriexec
CVS commit: [netbsd-9] src/doc
Module Name:src Committed By: martin Date: Mon Jun 14 12:00:45 UTC 2021 Modified Files: src/doc [netbsd-9]: CHANGES-9.3 Log Message: Tickets #1290 - #1295 To generate a diff of this commit: cvs rdiff -u -r1.1.2.7 -r1.1.2.8 src/doc/CHANGES-9.3 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-9.3 diff -u src/doc/CHANGES-9.3:1.1.2.7 src/doc/CHANGES-9.3:1.1.2.8 --- src/doc/CHANGES-9.3:1.1.2.7 Wed Jun 9 19:47:29 2021 +++ src/doc/CHANGES-9.3 Mon Jun 14 12:00:44 2021 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-9.3,v 1.1.2.7 2021/06/09 19:47:29 martin Exp $ +# $NetBSD: CHANGES-9.3,v 1.1.2.8 2021/06/14 12:00:44 martin Exp $ A complete list of changes from the NetBSD 9.2 release to the NetBSD 9.3 release: @@ -92,3 +92,42 @@ external/bsd/libpcap/bin/Makefile 1.3 Fix pcap-config output. [dholland, ticket #1284] +usr.bin/ftp/ftp.c1.170 +usr.bin/ftp/version.h1.90 + + ftp(1): improve signal handler restoration. + [lukem, ticket #1290] + +usr.bin/ftp/ftp.c1.169 +usr.bin/ftp/util.c1.161 + + ftp(1): exit if lostpeer() is invoked by a signal. + [lukem, ticket #1291] + +usr.bin/ftp/fetch.c1.232 + + ftp(1): improve signal handler restoration. + [lukem, ticket #1292] + +usr.bin/ftp/ftp.c1.172 + + ftp(1): PR 56129: attempt to prevent timeouts of the control + connection. + [lukem, ticket #1293] + +usr.bin/ftp/cmds.c1.141 +usr.bin/ftp/ftp.11.143 + + ftp(1): fix description of "debug". + [lukem, ticket #1294] + +usr.bin/ftp/Makefile1.39 +usr.bin/ftp/ssl.c1.10 +usr.bin/ftp/ssl.h1.5 +usr.bin/ftp/version.h1.93 + + ftp(1): PR 56219: in crunched builds (e.g. some install media) + use fetch_* functions for I/O. + Set version to 20210603. + [lukem, ticket #1295] +
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:57:39 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: Makefile ssl.c ssl.h version.h Log Message: Pull up following revision(s) (requested by lukem in ticket #1295): usr.bin/ftp/ssl.c: revision 1.10 usr.bin/ftp/ssl.h: revision 1.5 usr.bin/ftp/version.h: revision 1.93 usr.bin/ftp/Makefile: revision 1.39 use fetch_*() for I/O with SMALLPROG / !WITH_SSL builds Adapt the SMALLPROG / -UWITH_SSL build to also use the fetch_*() methods from ssl.c, instead of using stdio, as stdio isn't robust when using interruptable signals. Disable ssl-specific support in the fetch_*() methods if WITH_SSL isn't defined, so SMALLPROG still doesn't have ssl support (as expected). The resulting SMALLPROG binary is slightly larger than before (e.g., 157KiB vs 153KiB on amd64). Set version to 20210603 for this fix and the SO_KEEPALIVE fix for PR 56129. PR install/56219 To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.37.12.1 src/usr.bin/ftp/Makefile cvs rdiff -u -r1.8.2.1 -r1.8.2.2 src/usr.bin/ftp/ssl.c cvs rdiff -u -r1.4 -r1.4.2.1 src/usr.bin/ftp/ssl.h cvs rdiff -u -r1.87.18.2 -r1.87.18.3 src/usr.bin/ftp/version.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ftp/Makefile diff -u src/usr.bin/ftp/Makefile:1.37 src/usr.bin/ftp/Makefile:1.37.12.1 --- src/usr.bin/ftp/Makefile:1.37 Sun May 21 15:28:43 2017 +++ src/usr.bin/ftp/Makefile Mon Jun 14 11:57:39 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.37 2017/05/21 15:28:43 riastradh Exp $ +# $NetBSD: Makefile,v 1.37.12.1 2021/06/14 11:57:39 martin Exp $ # from: @(#)Makefile 8.2 (Berkeley) 4/3/94 .include @@ -8,6 +8,7 @@ USE_FORT?= yes # network client PROG= ftp SRCS= cmds.c cmdtab.c complete.c domacro.c fetch.c ftp.c main.c \ progressbar.c ruserpass.c util.c +SRCS+= ssl.c # Uncomment the following to provide defaults for gate-ftp operation # @@ -19,7 +20,6 @@ CPPFLAGS+=-DNO_EDITCOMPLETE -DNO_ABOUT - LDADD+= -ledit -lterminfo DPADD+= ${LIBEDIT} ${LIBTERMINFO} CPPFLAGS+= -DWITH_SSL -SRCS+=ssl.c LDADD+= -lssl -lcrypto DPADD+= ${LIBSSL} ${LIBCRYPTO} .endif Index: src/usr.bin/ftp/ssl.c diff -u src/usr.bin/ftp/ssl.c:1.8.2.1 src/usr.bin/ftp/ssl.c:1.8.2.2 --- src/usr.bin/ftp/ssl.c:1.8.2.1 Fri Jan 29 20:58:19 2021 +++ src/usr.bin/ftp/ssl.c Mon Jun 14 11:57:39 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ssl.c,v 1.8.2.1 2021/01/29 20:58:19 martin Exp $ */ +/* $NetBSD: ssl.c,v 1.8.2.2 2021/06/14 11:57:39 martin Exp $ */ /*- * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav @@ -34,13 +34,17 @@ #include #ifndef lint -__RCSID("$NetBSD: ssl.c,v 1.8.2.1 2021/01/29 20:58:19 martin Exp $"); +__RCSID("$NetBSD: ssl.c,v 1.8.2.2 2021/06/14 11:57:39 martin Exp $"); #endif +#include +#include +#include +#include +#include +#include #include #include -#include -#include #include #include @@ -48,11 +52,14 @@ __RCSID("$NetBSD: ssl.c,v 1.8.2.1 2021/0 #include #include + +#ifdef WITH_SSL #include #include #include #include #include +#endif #include "ssl.h" @@ -75,7 +82,9 @@ struct fetch_connect { int issock; int iserr; int iseof; +#ifdef WITH_SSL SSL *ssl; /* SSL handle */ +#endif }; /* @@ -121,9 +130,11 @@ fetch_writev(struct fetch_connect *conn, } } errno = 0; +#ifdef WITH_SSL if (conn->ssl != NULL) len = SSL_write(conn->ssl, iov->iov_base, iov->iov_len); else +#endif len = writev(fd, iov, iovcnt); if (len == 0) { /* we consider a short write a failure */ @@ -275,7 +286,9 @@ fetch_close(struct fetch_connect *conn) return 0; fetch_flush(conn); +#ifdef WITH_SSL SSL_free(conn->ssl); +#endif close(conn->sd); free(conn->cache.buf); free(conn->buf); @@ -287,6 +300,7 @@ fetch_close(struct fetch_connect *conn) #define FETCH_READ_WAIT -2 #define FETCH_READ_ERROR -1 +#ifdef WITH_SSL static ssize_t fetch_ssl_read(SSL *ssl, void *buf, size_t len) { @@ -305,6 +319,7 @@ fetch_ssl_read(SSL *ssl, void *buf, size return FETCH_READ_ERROR; } } +#endif /* WITH_SSL */ static ssize_t fetch_nonssl_read(int sd, void *buf, size_t len) @@ -433,9 +448,11 @@ fetch_read(void *ptr, size_t size, size_ * In the non-SSL case, it may improve performance (very * slightly) when reading small amounts of data. */ +#ifdef WITH_SSL if (conn->ssl != NULL) rlen = fetch_ssl_read(conn->ssl, buf, len); else +#endif rlen = fetch_nonssl_read(conn->sd, buf, len); switch (rlen) { case 0: @@ -564,6 +581,7 @@ fetch_getline(struct fetch_connect *conn return len; } +#ifdef WITH_SSL void * fetch_start_ssl(int sock, const char *servername) { @@ -624,10 +642,13 @@ fetch_start_ssl(int sock, const char *se return ssl; } +#endif /* WITH_SSL */ void fetch_set_ssl(struct fetch_connect *conn, void *ssl) { +#ifdef WITH_SSL conn->ssl =
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:52:52 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: cmds.c ftp.1 Log Message: Pull up following revision(s) (requested by lukem in ticket #1294): usr.bin/ftp/cmds.c: revision 1.141 usr.bin/ftp/ftp.1: revision 1.143 ftp(1): fix description of "debug" "debug" command and documentation got accidentally renamed to "ftp_debug" 13 years ago, and was only partially fixed. To generate a diff of this commit: cvs rdiff -u -r1.140 -r1.140.2.1 src/usr.bin/ftp/cmds.c cvs rdiff -u -r1.136 -r1.136.8.1 src/usr.bin/ftp/ftp.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ftp/cmds.c diff -u src/usr.bin/ftp/cmds.c:1.140 src/usr.bin/ftp/cmds.c:1.140.2.1 --- src/usr.bin/ftp/cmds.c:1.140 Wed Feb 6 07:56:42 2019 +++ src/usr.bin/ftp/cmds.c Mon Jun 14 11:52:52 2021 @@ -1,7 +1,7 @@ -/* $NetBSD: cmds.c,v 1.140 2019/02/06 07:56:42 martin Exp $ */ +/* $NetBSD: cmds.c,v 1.140.2.1 2021/06/14 11:52:52 martin Exp $ */ /*- - * Copyright (c) 1996-2009 The NetBSD Foundation, Inc. + * Copyright (c) 1996-2021 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -96,7 +96,7 @@ #if 0 static char sccsid[] = "@(#)cmds.c 8.6 (Berkeley) 10/9/94"; #else -__RCSID("$NetBSD: cmds.c,v 1.140 2019/02/06 07:56:42 martin Exp $"); +__RCSID("$NetBSD: cmds.c,v 1.140.2.1 2021/06/14 11:52:52 martin Exp $"); #endif #endif /* not lint */ @@ -1131,7 +1131,7 @@ setdebug(int argc, char *argv[]) options |= SO_DEBUG; else options &= ~SO_DEBUG; - fprintf(ttyout, "Debugging %s (ftp_debug=%d).\n", onoff(ftp_debug), ftp_debug); + fprintf(ttyout, "Debugging %s (debug=%d).\n", onoff(ftp_debug), ftp_debug); code = ftp_debug > 0; } Index: src/usr.bin/ftp/ftp.1 diff -u src/usr.bin/ftp/ftp.1:1.136 src/usr.bin/ftp/ftp.1:1.136.8.1 --- src/usr.bin/ftp/ftp.1:1.136 Mon Jul 3 21:34:57 2017 +++ src/usr.bin/ftp/ftp.1 Mon Jun 14 11:52:52 2021 @@ -1,6 +1,6 @@ -.\" $NetBSD: ftp.1,v 1.136 2017/07/03 21:34:57 wiz Exp $ +.\" $NetBSD: ftp.1,v 1.136.8.1 2021/06/14 11:52:52 martin Exp $ .\" -.\" Copyright (c) 1996-2015 The NetBSD Foundation, Inc. +.\" Copyright (c) 1996-2021 The NetBSD Foundation, Inc. .\" All rights reserved. .\" .\" This code is derived from software contributed to The NetBSD Foundation @@ -57,7 +57,7 @@ .\" .\" @(#)ftp.1 8.3 (Berkeley) 10/9/94 .\" -.Dd April 24, 2015 +.Dd January 6, 2021 .Dt FTP 1 .Os .Sh NAME @@ -442,6 +442,16 @@ when an ascii type transfer is made, the distinguished from a record delimiter only when .Ic \&cr is off. +.It Ic debug Op Ar debug-value +Toggle debugging mode. +If an optional +.Ar debug-value +is specified it is used to set the debugging level. +When debugging is on, +.Nm +prints each command sent to the remote machine, preceded +by the string +.Ql \-\-> . .It Ic delete Ar remote-file Delete the file .Ar remote-file @@ -519,16 +529,6 @@ format is .It Ic ftp Ar host Op Ar port A synonym for .Ic open . -.It Ic ftp_debug Op Ar ftp_debug-value -Toggle debugging mode. -If an optional -.Ar ftp_debug-value -is specified it is used to set the debugging level. -When debugging is on, -.Nm -prints each command sent to the remote machine, preceded -by the string -.Ql \-\-> . .It Ic gate Op Ar host Op Ar port Toggle gate-ftp mode, which used to connect through the TIS FWTK and Gauntlet ftp proxies.
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:45:49 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: ftp.c Log Message: Pull up following revision(s) (requested by lukem in ticket #1293): usr.bin/ftp/ftp.c: revision 1.172 set SO_KEEPALIVE on control connection Attempt to prevent timeouts of the control connection by setting SO_KEEPALIVE. This matches the equivalent behaviour in ftpd. Note: This is a much simpler change than adding a background polling event to invoke "STAT" (or "NOOP") on the control connection during a transfer. (It's unclear from RFC 959 whether "NOOP" is even permitted during a transfer). PR bin/56129 To generate a diff of this commit: cvs rdiff -u -r1.168.2.3 -r1.168.2.4 src/usr.bin/ftp/ftp.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.bin/ftp/ftp.c diff -u src/usr.bin/ftp/ftp.c:1.168.2.3 src/usr.bin/ftp/ftp.c:1.168.2.4 --- src/usr.bin/ftp/ftp.c:1.168.2.3 Mon Jun 14 11:28:28 2021 +++ src/usr.bin/ftp/ftp.c Mon Jun 14 11:45:48 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $ */ +/* $NetBSD: ftp.c,v 1.168.2.4 2021/06/14 11:45:48 martin Exp $ */ /*- * Copyright (c) 1996-2021 The NetBSD Foundation, Inc. @@ -92,7 +92,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.168.2.4 2021/06/14 11:45:48 martin Exp $"); #endif #endif /* not lint */ @@ -280,6 +280,11 @@ hookup(const char *host, const char *por goto bad; } + if (setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, + (void *)&on, sizeof(on)) == -1) { + DWARN("setsockopt %s (ignored)", "SO_KEEPALIVE"); + } + if (setsockopt(s, SOL_SOCKET, SO_OOBINLINE, (void *)&on, sizeof(on)) == -1) { DWARN("setsockopt %s (ignored)", "SO_OOBINLINE");
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:34:20 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: fetch.c Log Message: Pull up following revision(s) (requested by lukem in ticket #1292): usr.bin/ftp/fetch.c: revision 1.232 fetch_url: improve signal handler restoration Use SIG_ERR not NULL as the indicator that a signal handler hasn't been changed, so that SIG_DFL (equivalent to NULL) will be restored. Fix restoration of SIGQUIT; use the old handler not SIGPIPE's. To generate a diff of this commit: cvs rdiff -u -r1.231 -r1.231.2.1 src/usr.bin/ftp/fetch.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.bin/ftp/fetch.c diff -u src/usr.bin/ftp/fetch.c:1.231 src/usr.bin/ftp/fetch.c:1.231.2.1 --- src/usr.bin/ftp/fetch.c:1.231 Thu Apr 4 00:36:09 2019 +++ src/usr.bin/ftp/fetch.c Mon Jun 14 11:34:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.231 2019/04/04 00:36:09 christos Exp $ */ +/* $NetBSD: fetch.c,v 1.231.2.1 2021/06/14 11:34:20 martin Exp $ */ /*- * Copyright (c) 1997-2015 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fetch.c,v 1.231 2019/04/04 00:36:09 christos Exp $"); +__RCSID("$NetBSD: fetch.c,v 1.231.2.1 2021/06/14 11:34:20 martin Exp $"); #endif /* not lint */ /* @@ -1295,7 +1295,7 @@ fetch_url(const char *url, const char *p DPRINTF("%s: `%s' proxyenv `%s'\n", __func__, url, STRorNULL(penv)); - oldquit = oldalrm = oldint = oldpipe = NULL; + oldquit = oldalrm = oldint = oldpipe = SIG_ERR; closefunc = NULL; fin = NULL; fout = NULL; @@ -1572,9 +1572,9 @@ fetch_url(const char *url, const char *p bytes = 0; hashbytes = mark; - if (oldalrm) { + if (oldalrm != SIG_ERR) { (void)xsignal(SIGALRM, oldalrm); - oldalrm = NULL; + oldalrm = SIG_ERR; } progressmeter(-1); @@ -1736,14 +1736,14 @@ chunkerror: warnx("Improper response from `%s:%s'", ui.host, ui.port); cleanup_fetch_url: - if (oldint) + if (oldint != SIG_ERR) (void)xsignal(SIGINT, oldint); - if (oldpipe) + if (oldpipe != SIG_ERR) (void)xsignal(SIGPIPE, oldpipe); - if (oldalrm) + if (oldalrm != SIG_ERR) (void)xsignal(SIGALRM, oldalrm); - if (oldquit) - (void)xsignal(SIGQUIT, oldpipe); + if (oldquit != SIG_ERR) + (void)xsignal(SIGQUIT, oldquit); if (fin != NULL) fetch_close(fin); else if (s != -1)
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:28:28 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: ftp.c util.c Log Message: Pull up following revision(s) (requested by lukem in ticket #1291): usr.bin/ftp/ftp.c: revision 1.169 usr.bin/ftp/util.c: revision 1.161 ftp: exit if lostpeer invoked by a signal lostpeer() calls too many async-unsafe functions (both directly and indirectly) to close and cleanup the remote connections, so just exit after the cleanup if invoked by a signal. Reported in private mail by Qi Hou. May also resolve a crash reported by Thomas Klausner. To generate a diff of this commit: cvs rdiff -u -r1.168.2.2 -r1.168.2.3 src/usr.bin/ftp/ftp.c cvs rdiff -u -r1.160 -r1.160.2.1 src/usr.bin/ftp/util.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.bin/ftp/ftp.c diff -u src/usr.bin/ftp/ftp.c:1.168.2.2 src/usr.bin/ftp/ftp.c:1.168.2.3 --- src/usr.bin/ftp/ftp.c:1.168.2.2 Mon Jun 14 11:22:16 2021 +++ src/usr.bin/ftp/ftp.c Mon Jun 14 11:28:28 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.168.2.2 2021/06/14 11:22:16 martin Exp $ */ +/* $NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $ */ /*- * Copyright (c) 1996-2021 The NetBSD Foundation, Inc. @@ -92,7 +92,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.168.2.2 2021/06/14 11:22:16 martin Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.168.2.3 2021/06/14 11:28:28 martin Exp $"); #endif #endif /* not lint */ @@ -2074,7 +2074,7 @@ gunique(const char *local) * needs to get back to a known state. */ static void -abort_squared(int dummy) +abort_squared(int signo) { char msgbuf[100]; size_t len; @@ -2084,7 +2084,7 @@ abort_squared(int dummy) len = strlcpy(msgbuf, "\nremote abort aborted; closing connection.\n", sizeof(msgbuf)); write(fileno(ttyout), msgbuf, len); - lostpeer(0); + lostpeer(signo); siglongjmp(xferabort, 1); } Index: src/usr.bin/ftp/util.c diff -u src/usr.bin/ftp/util.c:1.160 src/usr.bin/ftp/util.c:1.160.2.1 --- src/usr.bin/ftp/util.c:1.160 Sat Jun 22 23:40:53 2019 +++ src/usr.bin/ftp/util.c Mon Jun 14 11:28:28 2021 @@ -1,7 +1,7 @@ -/* $NetBSD: util.c,v 1.160 2019/06/22 23:40:53 christos Exp $ */ +/* $NetBSD: util.c,v 1.160.2.1 2021/06/14 11:28:28 martin Exp $ */ /*- - * Copyright (c) 1997-2009 The NetBSD Foundation, Inc. + * Copyright (c) 1997-2020 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -64,7 +64,7 @@ #include #ifndef lint -__RCSID("$NetBSD: util.c,v 1.160 2019/06/22 23:40:53 christos Exp $"); +__RCSID("$NetBSD: util.c,v 1.160.2.1 2021/06/14 11:28:28 martin Exp $"); #endif /* not lint */ /* @@ -324,9 +324,10 @@ intr(int signo) /* * Signal handler for lost connections; cleanup various elements of * the connection state, and call cleanuppeer() to finish it off. + * This function is not signal safe, so exit if called by a signal. */ void -lostpeer(int dummy) +lostpeer(int signo) { int oerrno = errno; @@ -356,6 +357,9 @@ lostpeer(int dummy) proxflag = 0; pswitch(0); cleanuppeer(); + if (signo) { + errx(1, "lostpeer due to signal %d", signo); + } errno = oerrno; }
CVS commit: [netbsd-9] src/usr.bin/ftp
Module Name:src Committed By: martin Date: Mon Jun 14 11:22:16 UTC 2021 Modified Files: src/usr.bin/ftp [netbsd-9]: ftp.c version.h Log Message: Pull up following revision(s) (requested by lukem in ticket #1290): usr.bin/ftp/version.h: revision 1.90 usr.bin/ftp/ftp.c: revision 1.170 ftp.c: improve signal handler restoration Only invoke the old signal handler if it's a real signal handler and not SIG_IGN, SIG_DFL, SIG_HOLD, or SIG_ERR, using new static function issighandler(). Avoids an intermittent race condition with a null pointer dereference via (*SIG_DFL)(). Bug class reported by Joyu Liao from Juniper Networks. Use SIG_ERR instead of NULL as the indicator that a signal handler hasn't been changed, so that SIG_DFL (equivalent to NULL) will be restored. To generate a diff of this commit: cvs rdiff -u -r1.168.2.1 -r1.168.2.2 src/usr.bin/ftp/ftp.c cvs rdiff -u -r1.87.18.1 -r1.87.18.2 src/usr.bin/ftp/version.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/ftp/ftp.c diff -u src/usr.bin/ftp/ftp.c:1.168.2.1 src/usr.bin/ftp/ftp.c:1.168.2.2 --- src/usr.bin/ftp/ftp.c:1.168.2.1 Fri Jan 29 20:58:19 2021 +++ src/usr.bin/ftp/ftp.c Mon Jun 14 11:22:16 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.168.2.1 2021/01/29 20:58:19 martin Exp $ */ +/* $NetBSD: ftp.c,v 1.168.2.2 2021/06/14 11:22:16 martin Exp $ */ /*- * Copyright (c) 1996-2021 The NetBSD Foundation, Inc. @@ -92,7 +92,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.168.2.1 2021/01/29 20:58:19 martin Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.168.2.2 2021/06/14 11:22:16 martin Exp $"); #endif #endif /* not lint */ @@ -320,6 +320,17 @@ cmdtimeout(int notused) errno = oerrno; } +static int +issighandler(sigfunc func) +{ + return (func != SIG_IGN && + func != SIG_DFL && +#ifdef SIG_HOLD + func != SIG_HOLD && +#endif + func != SIG_ERR); +} + /*VARARGS*/ int command(const char *fmt, ...) @@ -359,8 +370,9 @@ command(const char *fmt, ...) (void)fflush(cout); cpend = 1; r = getreply(!strcmp(fmt, "QUIT")); - if (abrtflag && oldsigint != SIG_IGN) + if (abrtflag && issighandler(oldsigint)) { (*oldsigint)(SIGINT); + } (void)xsignal(SIGINT, oldsigint); return (r); } @@ -510,11 +522,14 @@ getreply(int expecteof) (void)xsignal(SIGALRM, oldsigalrm); if (code == 421 || originalcode == 421) lostpeer(0); - if (abrtflag && oldsigint != cmdabort && oldsigint != SIG_IGN) + if (abrtflag && oldsigint != cmdabort && + issighandler(oldsigint)) { (*oldsigint)(SIGINT); + } if (timeoutflag && oldsigalrm != cmdtimeout && - oldsigalrm != SIG_IGN) + issighandler(oldsigalrm)) { (*oldsigalrm)(SIGINT); + } return (n - '0'); } } @@ -680,7 +695,7 @@ sendrequest(const char *cmd, const char FILE *volatile dout; int (*volatile closefunc)(FILE *); sigfunc volatile oldintr; - sigfunc volatile oldintp; + sigfunc volatile oldpipe; off_t volatile hashbytes; int hash_interval; const char *lmode; @@ -707,8 +722,8 @@ sendrequest(const char *cmd, const char if (curtype != type) changetype(type, 0); closefunc = NULL; - oldintr = NULL; - oldintp = NULL; + oldintr = SIG_ERR; + oldpipe = SIG_ERR; lmode = "w"; if (sigsetjmp(xferabort, 1)) { while (cpend) @@ -722,7 +737,7 @@ sendrequest(const char *cmd, const char fin = stdin; progress = 0; } else if (*local == '|') { - oldintp = xsignal(SIGPIPE, SIG_IGN); + oldpipe = xsignal(SIGPIPE, SIG_IGN); fin = popen(local + 1, "r"); if (fin == NULL) { warn("Can't execute `%s'", local + 1); @@ -796,7 +811,9 @@ sendrequest(const char *cmd, const char } progressmeter(-1); - oldintp = xsignal(SIGPIPE, SIG_IGN); + if (oldpipe == SIG_ERR) { + oldpipe = xsignal(SIGPIPE, SIG_IGN); + } hash_interval = (hash && (!progress || filesize < 0)) ? mark : 0; switch (curtype) { @@ -865,7 +882,7 @@ sendrequest(const char *cmd, const char abort: (void)xsignal(SIGINT, oldintr); - oldintr = NULL; + oldintr = SIG_ERR; if (!cpend) { code = -1; goto cleanupsend; @@ -884,10 +901,10 @@ sendrequest(const char *cmd, const char ptransfer(0); cleanupsend: - if (oldintr) + if (oldintr != SIG_ERR) (void)xsignal(SIGINT, oldintr); - if (oldintp) - (void)xsignal(SIGPIPE, oldintp); + if (oldpipe != SIG_ERR) + (void)xsignal(SIGPIPE, oldpipe); if (data >= 0) { (void)close(data); data = -1; @@ -909,7 +926,7 @@ recvrequest(const char *cmd, const char FILE *volatile din; int (*volatile closefunc)(FILE *); sigfunc volatile oldintr; - sigfunc volatile oldintp; + sigfunc volatile oldpipe; int c, d; int volatile is_retr; int volatile tcrflag; @@ -945,8 +962,8 @@ recvrequest(const char *cmd, const char return; } closefunc = NULL; - oldintr = NULL; - oldintp = NULL; + oldintr = SIG_ERR; + oldpipe = SIG_ERR; tcrflag = !cr
CVS commit: src/sys/sys
Module Name:src Committed By: martin Date: Sun Jun 13 15:11:20 UTC 2021 Modified Files: src/sys/sys: param.h Log Message: Fix the last bump - now for real: welcome to 9.99.85 To generate a diff of this commit: cvs rdiff -u -r1.695 -r1.696 src/sys/sys/param.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/sys/param.h diff -u src/sys/sys/param.h:1.695 src/sys/sys/param.h:1.696 --- src/sys/sys/param.h:1.695 Sun Jun 13 03:07:57 2021 +++ src/sys/sys/param.h Sun Jun 13 15:11:20 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.695 2021/06/13 03:07:57 christos Exp $ */ +/* $NetBSD: param.h,v 1.696 2021/06/13 15:11:20 martin Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 999008500 /* NetBSD 9.99.84 */ +#define __NetBSD_Version__ 999008500 /* NetBSD 9.99.85 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src/sys/kern
Module Name:src Committed By: martin Date: Fri Jun 11 12:54:23 UTC 2021 Modified Files: src/sys/kern: kern_exec.c Log Message: Fix the order of handling of posix_spawn attributes and file actions. The standard is explicit about it and it matters if e.g. RESETIDS is used as an attribute and file actions depend on the group rights for opening a file. To generate a diff of this commit: cvs rdiff -u -r1.505 -r1.506 src/sys/kern/kern_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/kern/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.505 src/sys/kern/kern_exec.c:1.506 --- src/sys/kern/kern_exec.c:1.505 Sun May 2 10:23:55 2021 +++ src/sys/kern/kern_exec.c Fri Jun 11 12:54:22 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.505 2021/05/02 10:23:55 martin Exp $ */ +/* $NetBSD: kern_exec.c,v 1.506 2021/06/11 12:54:22 martin Exp $ */ /*- * Copyright (c) 2008, 2019, 2020 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.505 2021/05/02 10:23:55 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_exec.c,v 1.506 2021/06/11 12:54:22 martin Exp $"); #include "opt_exec.h" #include "opt_execfmt.h" @@ -2260,13 +2260,13 @@ spawn_return(void *arg) rw_enter(&p->p_reflock, RW_WRITER); have_reflock = true; - /* handle posix_spawn_file_actions */ - error = handle_posix_spawn_file_actions(spawn_data->sed_actions); + /* handle posix_spawnattr */ + error = handle_posix_spawn_attrs(attrs, spawn_data->sed_parent); if (error) goto report_error; - /* handle posix_spawnattr */ - error = handle_posix_spawn_attrs(attrs, spawn_data->sed_parent); + /* handle posix_spawn_file_actions */ + error = handle_posix_spawn_file_actions(spawn_data->sed_actions); if (error) goto report_error;