CVS commit: src/sys/arch/sh3/include
Module Name:src Committed By: skrll Date: Tue Jan 7 07:41:20 UTC 2020 Modified Files: src/sys/arch/sh3/include: userret.h Log Message: Fix indentation. NFCI To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.18 src/sys/arch/sh3/include/userret.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sh3/include/userret.h diff -u src/sys/arch/sh3/include/userret.h:1.17 src/sys/arch/sh3/include/userret.h:1.18 --- src/sys/arch/sh3/include/userret.h:1.17 Sun Dec 1 12:19:28 2019 +++ src/sys/arch/sh3/include/userret.h Tue Jan 7 07:41:20 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: userret.h,v 1.17 2019/12/01 12:19:28 ad Exp $ */ +/* $NetBSD: userret.h,v 1.18 2020/01/07 07:41:20 skrll Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -75,7 +75,7 @@ userret(struct lwp *l) if (CPU_IS_SH3) { tf->tf_ubc = UBC_CYCLE_INSN | UBC_CYCLE_READ | SH3_UBC_CYCLE_CPU; - } + } #endif #ifdef SH4 if (CPU_IS_SH4) {
CVS commit: src/external/mit/xorg
Module Name:src Committed By: mrg Date: Tue Jan 7 07:27:51 UTC 2020 Modified Files: src/external/mit/xorg/bin/xtrap: Makefile.xtrap src/external/mit/xorg/lib/libXaw: Makefile src/external/mit/xorg/lib/libXaw6: Makefile Log Message: remove no longer necessary -Wno-error usage. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/mit/xorg/bin/xtrap/Makefile.xtrap cvs rdiff -u -r1.13 -r1.14 src/external/mit/xorg/lib/libXaw/Makefile cvs rdiff -u -r1.9 -r1.10 src/external/mit/xorg/lib/libXaw6/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/mit/xorg/bin/xtrap/Makefile.xtrap diff -u src/external/mit/xorg/bin/xtrap/Makefile.xtrap:1.2 src/external/mit/xorg/bin/xtrap/Makefile.xtrap:1.3 --- src/external/mit/xorg/bin/xtrap/Makefile.xtrap:1.2 Fri Jul 1 01:25:52 2011 +++ src/external/mit/xorg/bin/xtrap/Makefile.xtrap Tue Jan 7 07:27:50 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.xtrap,v 1.2 2011/07/01 01:25:52 mrg Exp $ +# $NetBSD: Makefile.xtrap,v 1.3 2020/01/07 07:27:50 mrg Exp $ NOMAN= 1 @@ -15,8 +15,3 @@ DPADD+= ${LIBXTRAP} ${LIBXT} ${LIBSM} ${ .include .include - -# XXX -.if defined(HAVE_GCC) -COPTS+= -Wno-error -.endif Index: src/external/mit/xorg/lib/libXaw/Makefile diff -u src/external/mit/xorg/lib/libXaw/Makefile:1.13 src/external/mit/xorg/lib/libXaw/Makefile:1.14 --- src/external/mit/xorg/lib/libXaw/Makefile:1.13 Tue Mar 19 06:19:44 2019 +++ src/external/mit/xorg/lib/libXaw/Makefile Tue Jan 7 07:27:50 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.13 2019/03/19 06:19:44 mrg Exp $ +# $NetBSD: Makefile,v 1.14 2020/01/07 07:27:50 mrg Exp $ .include @@ -75,9 +75,4 @@ X11EXTRAMANTRANSFORMS+= \ .include .include -# XXX -.if defined(HAVE_GCC) -COPTS.XawIm.c+= -Wno-error -.endif - CWARNFLAGS.clang+= -Wno-format Index: src/external/mit/xorg/lib/libXaw6/Makefile diff -u src/external/mit/xorg/lib/libXaw6/Makefile:1.9 src/external/mit/xorg/lib/libXaw6/Makefile:1.10 --- src/external/mit/xorg/lib/libXaw6/Makefile:1.9 Sun Jul 19 07:55:07 2015 +++ src/external/mit/xorg/lib/libXaw6/Makefile Tue Jan 7 07:27:50 2020 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.9 2015/07/19 07:55:07 mrg Exp $ +# $NetBSD: Makefile,v 1.10 2020/01/07 07:27:50 mrg Exp $ NOCHECKVER= yes # we want to install an older version ... MKLINKLIB= no @@ -37,8 +37,3 @@ PKGDIST= ${LIBOLD} .include .include - -# XXX -.if defined(HAVE_GCC) -COPTS.XawIm.c+= -Wno-error -.endif
CVS commit: src/sys/compat/netbsd32
Module Name:src Committed By: mrg Date: Tue Jan 7 07:26:21 UTC 2020 Modified Files: src/sys/compat/netbsd32: netbsd32_vm.c Log Message: don't check the value of retval in netbsd32_mmap() if sys_mmap() was not successful. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/compat/netbsd32/netbsd32_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/sys/compat/netbsd32/netbsd32_vm.c diff -u src/sys/compat/netbsd32/netbsd32_vm.c:1.1 src/sys/compat/netbsd32/netbsd32_vm.c:1.2 --- src/sys/compat/netbsd32/netbsd32_vm.c:1.1 Mon Dec 24 21:27:06 2018 +++ src/sys/compat/netbsd32/netbsd32_vm.c Tue Jan 7 07:26:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_vm.c,v 1.1 2018/12/24 21:27:06 mrg Exp $ */ +/* $NetBSD: netbsd32_vm.c,v 1.2 2020/01/07 07:26:21 mrg Exp $ */ /* * Copyright (c) 1998, 2001, 2008, 2018 Matthew R. Green @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: netbsd32_vm.c,v 1.1 2018/12/24 21:27:06 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netbsd32_vm.c,v 1.2 2020/01/07 07:26:21 mrg Exp $"); #include #include @@ -86,9 +86,13 @@ netbsd32_mmap(struct lwp *l, const struc #endif error = sys_mmap(l, &ua, retval); - if ((u_long)*retval > (u_long)UINT_MAX) { - printf("netbsd32_mmap: retval out of range: 0x%lx\n", - (u_long)*retval); + if (error == 0 && (u_long)*retval > (u_long)UINT_MAX) { + const char *name = curlwp->l_name; + + if (name == NULL) + name = curproc->p_comm; + printf("netbsd32_mmap(%s:%u:%u): retval out of range: 0x%lx\n", + name, curproc->p_pid, curlwp->l_lid, (u_long)*retval); /* Should try to recover and return an error here. */ } return error;
CVS commit: src/sys/dev/usb
Module Name:src Committed By: maxv Date: Tue Jan 7 06:42:26 UTC 2020 Modified Files: src/sys/dev/usb: if_aue.c if_axe.c if_axen.c if_cdce.c if_cue.c if_kue.c if_mos.c if_mue.c if_smsc.c if_udav.c if_upl.c if_ure.c if_url.c if_urndis.c u3g.c uark.c ubsa.c uchcom.c uftdi.c uhub.c uipad.c uipaq.c ukyopon.c umcs.c umct.c umodem.c uplcom.c usbnet.h uvisor.c Log Message: Localify, constify. To generate a diff of this commit: cvs rdiff -u -r1.161 -r1.162 src/sys/dev/usb/if_aue.c cvs rdiff -u -r1.120 -r1.121 src/sys/dev/usb/if_axe.c cvs rdiff -u -r1.67 -r1.68 src/sys/dev/usb/if_axen.c \ src/sys/dev/usb/if_cdce.c cvs rdiff -u -r1.87 -r1.88 src/sys/dev/usb/if_cue.c cvs rdiff -u -r1.100 -r1.101 src/sys/dev/usb/if_kue.c cvs rdiff -u -r1.2 -r1.3 src/sys/dev/usb/if_mos.c cvs rdiff -u -r1.55 -r1.56 src/sys/dev/usb/if_mue.c cvs rdiff -u -r1.61 -r1.62 src/sys/dev/usb/if_smsc.c cvs rdiff -u -r1.72 -r1.73 src/sys/dev/usb/if_udav.c src/sys/dev/usb/umodem.c cvs rdiff -u -r1.68 -r1.69 src/sys/dev/usb/if_upl.c cvs rdiff -u -r1.33 -r1.34 src/sys/dev/usb/if_ure.c src/sys/dev/usb/uchcom.c cvs rdiff -u -r1.71 -r1.72 src/sys/dev/usb/if_url.c src/sys/dev/usb/uftdi.c cvs rdiff -u -r1.34 -r1.35 src/sys/dev/usb/if_urndis.c cvs rdiff -u -r1.37 -r1.38 src/sys/dev/usb/u3g.c cvs rdiff -u -r1.15 -r1.16 src/sys/dev/usb/uark.c src/sys/dev/usb/usbnet.h cvs rdiff -u -r1.38 -r1.39 src/sys/dev/usb/ubsa.c cvs rdiff -u -r1.143 -r1.144 src/sys/dev/usb/uhub.c cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/uipad.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/usb/uipaq.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/usb/ukyopon.c cvs rdiff -u -r1.14 -r1.15 src/sys/dev/usb/umcs.c cvs rdiff -u -r1.39 -r1.40 src/sys/dev/usb/umct.c cvs rdiff -u -r1.85 -r1.86 src/sys/dev/usb/uplcom.c cvs rdiff -u -r1.53 -r1.54 src/sys/dev/usb/uvisor.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/if_aue.c diff -u src/sys/dev/usb/if_aue.c:1.161 src/sys/dev/usb/if_aue.c:1.162 --- src/sys/dev/usb/if_aue.c:1.161 Fri Aug 23 04:34:51 2019 +++ src/sys/dev/usb/if_aue.c Tue Jan 7 06:42:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $ */ +/* $NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $ */ /* * Copyright (c) 1997, 1998, 1999, 2000 @@ -76,7 +76,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.161 2019/08/23 04:34:51 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_aue.c,v 1.162 2020/01/07 06:42:26 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -231,8 +231,8 @@ static const struct aue_type aue_devs[] }; #define aue_lookup(v, p) ((const struct aue_type *)usb_lookup(aue_devs, v, p)) -int aue_match(device_t, cfdata_t, void *); -void aue_attach(device_t, device_t, void *); +static int aue_match(device_t, cfdata_t, void *); +static void aue_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(aue, sizeof(struct aue_softc), aue_match, aue_attach, usbnet_detach, usbnet_activate); @@ -250,7 +250,7 @@ static void aue_rx_loop(struct usbnet *, static int aue_init(struct ifnet *); static void aue_intr(struct usbnet *, usbd_status); -static struct usbnet_ops aue_ops = { +static const struct usbnet_ops aue_ops = { .uno_stop = aue_stop_cb, .uno_ioctl = aue_ioctl_cb, .uno_read_reg = aue_mii_read_reg, @@ -742,7 +742,7 @@ aue_reset(struct aue_softc *sc) /* * Probe for a Pegasus chip. */ -int +static int aue_match(device_t parent, cfdata_t match, void *aux) { struct usb_attach_arg *uaa = aux; @@ -775,7 +775,7 @@ aue_match(device_t parent, cfdata_t matc * Attach the interface. Allocate softc structures, do ifmedia * setup and ethernet/BPF attach. */ -void +static void aue_attach(device_t parent, device_t self, void *aux) { USBNET_MII_DECL_DEFAULT(unm); Index: src/sys/dev/usb/if_axe.c diff -u src/sys/dev/usb/if_axe.c:1.120 src/sys/dev/usb/if_axe.c:1.121 --- src/sys/dev/usb/if_axe.c:1.120 Mon Aug 26 17:26:33 2019 +++ src/sys/dev/usb/if_axe.c Tue Jan 7 06:42:26 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_axe.c,v 1.120 2019/08/26 17:26:33 rin Exp $ */ +/* $NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $ */ /* $OpenBSD: if_axe.c,v 1.137 2016/04/13 11:03:37 mpi Exp $ */ /* @@ -87,7 +87,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.120 2019/08/26 17:26:33 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_axe.c,v 1.121 2020/01/07 06:42:26 maxv Exp $"); #ifdef _KERNEL_OPT #include "opt_usb.h" @@ -250,8 +250,8 @@ static const struct ax88772b_mfb ax88772 { 0x8700, 0x8A3D, 32768 } }; -int axe_match(device_t, cfdata_t, void *); -void axe_attach(device_t, device_t, void *); +static int axe_match(device_t, cfdata_t, void *); +static void axe_attach(device_t, device_t, void *); CFATTACH_DECL_NEW(axe, sizeof(struct axe_softc), axe_match, axe_attach, usbnet_detach, usbnet_activate); @@ -271,7 +271,7 @@ sta
CVS commit: src/sys/netsmb
Module Name:src Committed By: maxv Date: Tue Jan 7 06:14:43 UTC 2020 Modified Files: src/sys/netsmb: smb_smb.c Log Message: Set 'ntencpass' to NULL as part of 'again', to prevent use-after-free. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/netsmb/smb_smb.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/netsmb/smb_smb.c diff -u src/sys/netsmb/smb_smb.c:1.34 src/sys/netsmb/smb_smb.c:1.35 --- src/sys/netsmb/smb_smb.c:1.34 Mon Sep 3 16:29:36 2018 +++ src/sys/netsmb/smb_smb.c Tue Jan 7 06:14:42 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: smb_smb.c,v 1.34 2018/09/03 16:29:36 riastradh Exp $ */ +/* $NetBSD: smb_smb.c,v 1.35 2020/01/07 06:14:42 maxv Exp $ */ /* * Copyright (c) 2000-2001 Boris Popov @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: smb_smb.c,v 1.34 2018/09/03 16:29:36 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smb_smb.c,v 1.35 2020/01/07 06:14:42 maxv Exp $"); #include #include @@ -262,7 +262,7 @@ smb_smb_ssnsetup(struct smb_vc *vcp, str struct smb_rq *rqp; struct mbchain *mbp; const smb_unichar *unipp; - smb_uniptr ntencpass = NULL; + smb_uniptr ntencpass; char *up, *pbuf, *encpass; const char *pp; int error, plen, uniplen, ulen, upper; @@ -272,7 +272,7 @@ smb_smb_ssnsetup(struct smb_vc *vcp, str upper = 0; again: - + ntencpass = NULL; vcp->vc_smbuid = SMB_UID_UNKNOWN; error = smb_rq_alloc(VCTOCP(vcp), SMB_COM_SESSION_SETUP_ANDX, scred, &rqp);
CVS commit: src/sys/dev/ic
Module Name:src Committed By: maxv Date: Tue Jan 7 06:12:09 UTC 2020 Modified Files: src/sys/dev/ic: mfi.c Log Message: Set 'ld_sync' to NULL as part of 'again', to prevent use-after-free. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 src/sys/dev/ic/mfi.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/mfi.c diff -u src/sys/dev/ic/mfi.c:1.62 src/sys/dev/ic/mfi.c:1.63 --- src/sys/dev/ic/mfi.c:1.62 Sun Nov 10 21:16:35 2019 +++ src/sys/dev/ic/mfi.c Tue Jan 7 06:12:09 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: mfi.c,v 1.62 2019/11/10 21:16:35 chs Exp $ */ +/* $NetBSD: mfi.c,v 1.63 2020/01/07 06:12:09 maxv Exp $ */ /* $OpenBSD: mfi.c,v 1.66 2006/11/28 23:59:45 dlg Exp $ */ /* @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.62 2019/11/10 21:16:35 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mfi.c,v 1.63 2020/01/07 06:12:09 maxv Exp $"); #include "bio.h" @@ -3378,12 +3378,13 @@ mfi_tbolt_sync_map_info(struct work *w, int i; struct mfi_ccb *ccb = NULL; uint8_t mbox[MFI_MBOX_SIZE]; - struct mfi_ld *ld_sync = NULL; + struct mfi_ld *ld_sync; size_t ld_size; int s; DNPRINTF(MFI_D_SYNC, "%s: mfi_tbolt_sync_map_info\n", DEVNAME(sc)); again: + ld_sync = NULL; s = splbio(); if (sc->sc_ldsync_ccb != NULL) { splx(s);
CVS commit: src/sys/dev/raidframe
Module Name:src Committed By: maxv Date: Tue Jan 7 06:10:19 UTC 2020 Modified Files: src/sys/dev/raidframe: rf_compat32.c Log Message: Fix big bugs. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/dev/raidframe/rf_compat32.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/raidframe/rf_compat32.c diff -u src/sys/dev/raidframe/rf_compat32.c:1.7 src/sys/dev/raidframe/rf_compat32.c:1.8 --- src/sys/dev/raidframe/rf_compat32.c:1.7 Thu Dec 12 02:15:43 2019 +++ src/sys/dev/raidframe/rf_compat32.c Tue Jan 7 06:10:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: rf_compat32.c,v 1.7 2019/12/12 02:15:43 pgoyette Exp $ */ +/* $NetBSD: rf_compat32.c,v 1.8 2020/01/07 06:10:18 maxv Exp $ */ /* * Copyright (c) 2017 Matthew R. Green @@ -101,7 +101,7 @@ rf_config_netbsd32(struct raid_softc *rs k_cfg = RF_Malloc(sizeof(*k_cfg)); if (k_cfg == NULL) { RF_Free(k_cfg32, sizeof(RF_Config_t32)); - RF_Free(k_cfg, sizeof(RF_Config_t)); + return ENOMEM; } k_cfg->numCol = k_cfg32->numCol; k_cfg->numSpare = k_cfg32->numSpare;
CVS commit: src/doc
Module Name:src Committed By: christos Date: Mon Jan 6 21:04:58 UTC 2020 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: new tmux To generate a diff of this commit: cvs rdiff -u -r1.1684 -r1.1685 src/doc/3RDPARTY cvs rdiff -u -r1.2631 -r1.2632 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1684 src/doc/3RDPARTY:1.1685 --- src/doc/3RDPARTY:1.1684 Fri Jan 3 07:41:26 2020 +++ src/doc/3RDPARTY Mon Jan 6 16:04:58 2020 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1684 2020/01/03 12:41:26 roy Exp $ +# $NetBSD: 3RDPARTY,v 1.1685 2020/01/06 21:04:58 christos Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -1346,12 +1346,12 @@ perhaps this implementation should be ke purposes. Package: tmux -Version: 2.9a +Version: 3.0a Current Vers: 3.0a Maintainer: Nicholas Marriott Archive site: https://github.com/tmux/tmux Home page: http://tmux.github.io -Date: 2020-01-01 +Date: 2020-01-06 Mailing List: tmux-us...@googlegroups.com Responsible: christos License: BSD Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2631 src/doc/CHANGES:1.2632 --- src/doc/CHANGES:1.2631 Fri Jan 3 07:41:26 2020 +++ src/doc/CHANGES Mon Jan 6 16:04:58 2020 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2631 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2632 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -93,4 +93,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0: not needed anymore [christos 20191229] aq(4): Add Aquantia 10G network adapter driver [ryo 20200101] dhcpcd(8): Import dhcpcd-8.1.5 [roy 20200103] - + tmux(1): Imported 3.0a. [christos 20200106]
CVS import: src/external/bsd/tmux/dist
Module Name:src Committed By: christos Date: Mon Jan 6 20:40:39 UTC 2020 Update of /cvsroot/src/external/bsd/tmux/dist In directory ivanova.netbsd.org:/tmp/cvs-serv23465 Log Message: CHANGES FROM 3.0 to 3.0a * Do not require REG_STARTEND. * Respawn panes or windows correctly if default-command is set. * Add missing option for after-kill-pane hook. * Fix for crash with a format variable that doesn't exist. * Do not truncate list-keys output on some platforms. * Do not crash when restoring a layout with only one pane. CHANGES FROM 2.9 to 3.0 * Workaround invalid layout strings generated by older tmux versions and add some additional sanity checks * xterm 348 now disables margins when resized, so send DECLRMM again after resize. * Add support for the SD (scroll down) escape sequence. * Expand arguments to C and s format modifiers to match the m modifier. * Add support for underscore colours (Setulc capability must be added with terminal-overrides as described in tmux(1)). * Add a "fill" style attribute for the fill colour of the drawing area (where appropriate). * New -H flag to send-keys to send literal keys. * Format variables for pane mouse modes (mouse_utf8_flag and mouse_sgr_flag) and for origin mode (origin_flag). * Add -F to refresh-client for flags for control mode clients, only one flag (no-output) supported at the moment. * Add a few vi(1) keys for menus. * Add pane options, set with set-option -p and displayed with show-options -p. Pane options inherit from window options (so every pane option is also a window option). The pane style is now configured by setting window-style and window-active-style in the pane options; select-pane -P and -g now change the option but are no longer documented. * Do not document set-window-option and show-window-options. set-option -w and show-options -w should be used instead. * Add a -A flag to show-options to show parent options as well (they are marked with a *). * Resize panes lazily - do not resize unless they are in an attached, active window. * Add regular expression support for the format search, match and substitute modifiers and make them able to ignore case. find-window now accepts -r to use regular expressions. * Do not use $TMUX to find the session because for windows in multiple sessions it is wrong as often as it is right, and for windows in one session it is pointless. Instead use TMUX_PANE if it is present. * Do not always resize the window back to its original size after applying a layout, keep it at the layout size until it must be resized (for example when attached and window-size is not manual). * Add new-session -X and attach-session -x to send SIGHUP to parent when detaching (like detach-client -P). * Support for octal escapes in strings (such as \007) and improve list-keys output so it parses correctly if copied into a configuration file. * INCOMPATIBLE: Add a new {} syntax to the configuration file. This is a string similar to single quotes but also includes newlines and allows commands that take other commands as string arguments to be expressed more clearly and without additional escaping. A literal { and } or a string containing { or } must now be escaped or quoted, for example '{' and '}' instead of { or }, or 'X#{foo}' instead of X#{foo}. * New <, >, <= and >= comparison operators for formats. * Improve escaping of special characters in list-keys output. * INCOMPATIBLE: tmux's configuration parsing has changed to use yacc(1). There is one incompatible change: a \ on its own must be escaped or quoted as either \\ or '\' (the latter works on older tmux versions). Entirely the same parser is now used for parsing the configuration file and for string commands. This means that constructs previously only available in .tmux.conf, such as %if, can now be used in string commands (for example, those given to if-shell - not commands invoked from the shell, they are still parsed by the shell itself). * Add support for the overline attribute (SGR 53). The Smol capability is needed in terminal-overrides. * Add the ability to create simple menus. Introduces new command display-menu. Default menus are bound to MouseDown3 on the status line; MouseDown3 or M-MouseDown3 on panes; MouseDown3 in tree, client and buffer modes; and C-b C-m and C-b M-m. * Allow panes to be empty (no command). They can be created either by piping to split-window -I, or by passing an empty command ('') to split-window. Output can be sent to an existing empty window with display-message -I. * Add keys to jump between matching brackets (emacs C-M-f and C-M-b, vi %). * Add a -e flag to new-window, split-window, respawn-window, respawn-pane to pass environment variables into the newly created process. * Hooks are now stored in the options tree as array options, allowing them to have multiple separate commands. set-hook and show-hooks remain but
CVS commit: src/external/bsd/jemalloc/dist/src
Module Name:src Committed By: christos Date: Mon Jan 6 20:35:11 UTC 2020 Modified Files: src/external/bsd/jemalloc/dist/src: pages.c Log Message: set that NetBSD overcommits (from maya) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/bsd/jemalloc/dist/src/pages.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/jemalloc/dist/src/pages.c diff -u src/external/bsd/jemalloc/dist/src/pages.c:1.5 src/external/bsd/jemalloc/dist/src/pages.c:1.6 --- src/external/bsd/jemalloc/dist/src/pages.c:1.5 Fri Apr 26 19:57:59 2019 +++ src/external/bsd/jemalloc/dist/src/pages.c Mon Jan 6 15:35:11 2020 @@ -592,6 +592,8 @@ pages_boot(void) { mmap_flags |= MAP_NORESERVE; } # endif +#elif defined(__NetBSD__) + os_overcommits = true; #else os_overcommits = false; #endif
CVS commit: src/sys/net
Module Name:src Committed By: christos Date: Mon Jan 6 20:31:35 UTC 2020 Modified Files: src/sys/net: if_tap.c Log Message: Add missing packet filter hooks, byte accounting. To generate a diff of this commit: cvs rdiff -u -r1.114 -r1.115 src/sys/net/if_tap.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/net/if_tap.c diff -u src/sys/net/if_tap.c:1.114 src/sys/net/if_tap.c:1.115 --- src/sys/net/if_tap.c:1.114 Wed Oct 16 02:53:34 2019 +++ src/sys/net/if_tap.c Mon Jan 6 15:31:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $ */ +/* $NetBSD: if_tap.c,v 1.115 2020/01/06 20:31:35 christos Exp $ */ /* * Copyright (c) 2003, 2004, 2008, 2009 The NetBSD Foundation. @@ -33,7 +33,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.114 2019/10/16 06:53:34 knakahara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_tap.c,v 1.115 2020/01/06 20:31:35 christos Exp $"); #if defined(_KERNEL_OPT) @@ -525,6 +525,7 @@ tap_start(struct ifnet *ifp) goto done; ifp->if_opackets++; + ifp->if_obytes += m0->m_len; bpf_mtap(ifp, m0, BPF_D_OUT); m_freem(m0); @@ -893,6 +894,7 @@ tap_dev_close(struct tap_softc *sc) break; ifp->if_opackets++; + ifp->if_obytes += m->m_len; bpf_mtap(ifp, m, BPF_D_OUT); m_freem(m); } @@ -979,7 +981,12 @@ tap_dev_read(int unit, struct uio *uio, } ifp->if_opackets++; + ifp->if_obytes += m->m_len; // XXX: only first in chain bpf_mtap(ifp, m, BPF_D_OUT); + if ((error = pfil_run_hooks(ifp->if_pfil, &m, ifp, PFIL_OUT)) != 0) + goto out; + if (m == NULL) + goto out; /* * One read is one packet. @@ -1050,6 +1057,7 @@ tap_dev_write(int unit, struct uio *uio, device_lookup_private(&tap_cd, unit); struct ifnet *ifp; struct mbuf *m, **mp; + size_t len = 0; int error = 0; if (sc == NULL) @@ -1076,6 +1084,7 @@ tap_dev_write(int unit, struct uio *uio, } } (*mp)->m_len = uimin(MHLEN, uio->uio_resid); + len += (*mp)->m_len; error = uiomove(mtod(*mp, void *), (*mp)->m_len, uio); mp = &(*mp)->m_next; } @@ -1087,6 +1096,14 @@ tap_dev_write(int unit, struct uio *uio, m_set_rcvif(m, ifp); + ifp->if_ipackets++; + ifp->if_ibytes += len; + bpf_mtap(ifp, m, BPF_D_IN); + if ((error = pfil_run_hooks(ifp->if_pfil, &m, ifp, PFIL_IN)) != 0) + return error; + if (m == NULL) + return 0; + if_percpuq_enqueue(ifp->if_percpuq, m); return 0;
CVS commit: src/doc
Module Name:src Committed By: msaitoh Date: Mon Jan 6 15:21:29 UTC 2020 Modified Files: src/doc: TODO.smpnet Log Message: Protecting ec_multi* of ethercom with ec_lock have been finished now. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/doc/TODO.smpnet Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/TODO.smpnet diff -u src/doc/TODO.smpnet:1.30 src/doc/TODO.smpnet:1.31 --- src/doc/TODO.smpnet:1.30 Mon Jan 6 05:38:59 2020 +++ src/doc/TODO.smpnet Mon Jan 6 15:21:29 2020 @@ -1,4 +1,4 @@ -$NetBSD: TODO.smpnet,v 1.30 2020/01/06 05:38:59 msaitoh Exp $ +$NetBSD: TODO.smpnet,v 1.31 2020/01/06 15:21:29 msaitoh Exp $ MP-safe components == @@ -175,15 +175,6 @@ Scalability - opencrypto(9)'s crypto_newsession()/crypto_freesession() aren't scalable as they are serialized by one mutex -ec_multi* of ethercom -- - -ec_multiaddrs and ec_multicnt of struct ethercom and items listed in -ec_multiaddrs must be protected by ec_lock. The core of ethernet subsystem is -already MP-safe, however, device drivers that use the data should also be fixed. -A typical change should be to protect manipulations of the data via ETHER_* -macros such as ETHER_FIRST_MULTI by ETHER_LOCK and ETHER_UNLOCK. - ALTQ
CVS commit: src/sys/dev/usb
Module Name:src Committed By: msaitoh Date: Mon Jan 6 15:19:00 UTC 2020 Modified Files: src/sys/dev/usb: if_mos.c Log Message: Fix a bug that IFF_ALLMULTI is almost always set. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/usb/if_mos.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/if_mos.c diff -u src/sys/dev/usb/if_mos.c:1.1 src/sys/dev/usb/if_mos.c:1.2 --- src/sys/dev/usb/if_mos.c:1.1 Fri Sep 20 10:34:54 2019 +++ src/sys/dev/usb/if_mos.c Mon Jan 6 15:19:00 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: if_mos.c,v 1.1 2019/09/20 10:34:54 mrg Exp $ */ +/* $NetBSD: if_mos.c,v 1.2 2020/01/06 15:19:00 msaitoh Exp $ */ /* $OpenBSD: if_mos.c,v 1.40 2019/07/07 06:40:10 kevlo Exp $ */ /* @@ -72,7 +72,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.1 2019/09/20 10:34:54 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_mos.c,v 1.2 2020/01/06 15:19:00 msaitoh Exp $"); #include @@ -472,17 +472,15 @@ mos_setiff_locked(struct usbnet *un) rxmode = mos_reg_read_1(un, MOS_CTL); rxmode &= ~(MOS_CTL_ALLMULTI | MOS_CTL_RX_PROMISC); - if (ifp->if_flags & IFF_PROMISC || ec->ec_multicnt > 0) { + ETHER_LOCK(ec); + if (ifp->if_flags & IFF_PROMISC) { allmulti: - ETHER_LOCK(ec); ec->ec_flags |= ETHER_F_ALLMULTI; - ETHER_UNLOCK(ec); rxmode |= MOS_CTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) rxmode |= MOS_CTL_RX_PROMISC; } else { /* now program new ones */ - ETHER_LOCK(ec); ec->ec_flags &= ~ETHER_F_ALLMULTI; ETHER_FIRST_MULTI(step, ec, enm); @@ -490,7 +488,6 @@ allmulti: if (memcmp(enm->enm_addrlo, enm->enm_addrhi, ETHER_ADDR_LEN)) { memset(hashtbl, 0, sizeof(hashtbl)); -ETHER_UNLOCK(ec); goto allmulti; } h = ether_crc32_be(enm->enm_addrlo, @@ -499,8 +496,8 @@ allmulti: ETHER_NEXT_MULTI(step, enm); } - ETHER_UNLOCK(ec); } + ETHER_UNLOCK(ec); /* * The datasheet claims broadcast frames were always accepted
CVS commit: src/common/lib/libutil
Module Name:src Committed By: skrll Date: Mon Jan 6 13:21:18 UTC 2020 Modified Files: src/common/lib/libutil: proc_compare.c Log Message: Trailing whitespace To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/common/lib/libutil/proc_compare.c 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/libutil/proc_compare.c diff -u src/common/lib/libutil/proc_compare.c:1.2 src/common/lib/libutil/proc_compare.c:1.3 --- src/common/lib/libutil/proc_compare.c:1.2 Mon Jan 6 11:16:35 2020 +++ src/common/lib/libutil/proc_compare.c Mon Jan 6 13:21:18 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $ */ +/* $NetBSD: proc_compare.c,v 1.3 2020/01/06 13:21:18 skrll Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -37,7 +37,7 @@ # include # if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $"); +__RCSID("$NetBSD: proc_compare.c,v 1.3 2020/01/06 13:21:18 skrll Exp $"); # endif # include @@ -52,7 +52,7 @@ __RCSID("$NetBSD: proc_compare.c,v 1.2 2 # define P_RTIME_USEC p_rtime_usec # else # include -__KERNEL_RCSID(0, "$NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: proc_compare.c,v 1.3 2020/01/06 13:21:18 skrll Exp $"); # include # include # include @@ -140,7 +140,7 @@ out: return 0; if (p2->P_RTIME_USEC < p1->P_RTIME_USEC) return 1; - + return p2->p_pid > p1->p_pid; /* Nonsense */ } #endif /* STANDALONE */
CVS commit: src/usr.bin/vmstat
Module Name:src Committed By: ad Date: Mon Jan 6 11:24:30 UTC 2020 Modified Files: src/usr.bin/vmstat: vmstat.c Log Message: - Report namecache reverse hits with vmstat -s. - ncvhashtbl is no more. To generate a diff of this commit: cvs rdiff -u -r1.232 -r1.233 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c diff -u src/usr.bin/vmstat/vmstat.c:1.232 src/usr.bin/vmstat/vmstat.c:1.233 --- src/usr.bin/vmstat/vmstat.c:1.232 Sat Jan 4 03:09:55 2020 +++ src/usr.bin/vmstat/vmstat.c Mon Jan 6 11:24:30 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vmstat.c,v 1.232 2020/01/04 03:09:55 mrg Exp $ */ +/* $NetBSD: vmstat.c,v 1.233 2020/01/06 11:24:30 ad Exp $ */ /*- * Copyright (c) 1998, 2000, 2001, 2007, 2019 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19 #if 0 static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 3/1/95"; #else -__RCSID("$NetBSD: vmstat.c,v 1.232 2020/01/04 03:09:55 mrg Exp $"); +__RCSID("$NetBSD: vmstat.c,v 1.233 2020/01/06 11:24:30 ad Exp $"); #endif #endif /* not lint */ @@ -230,15 +230,11 @@ struct nlist hashnl[] = { .n_name = "_nchash" }, #define X_NCHASHTBL 11 { .n_name = "_nchashtbl" }, -#define X_NCVHASH 12 - { .n_name = "_ncvhash" }, -#define X_NCVHASHTBL 13 - { .n_name = "_ncvhashtbl" }, -#define X_NCVCACHEHASH 14 +#define X_NCVCACHEHASH 12 { .n_name = "_vcache_hashmask" }, -#define X_NCVCACHETBL 15 +#define X_NCVCACHETBL 13 { .n_name = "_vcache_hashtab" }, -#define X_HASHNL_SIZE 16 /* must be last */ +#define X_HASHNL_SIZE 14 /* must be last */ { .n_name = NULL }, }; @@ -1117,6 +1113,7 @@ dosum(void) (void)printf("%9" PRIu64 " too long\n", nch_stats.ncs_long); (void)printf("%9" PRIu64 " pass2 hits\n", nch_stats.ncs_pass2); (void)printf("%9" PRIu64 " 2passes\n", nch_stats.ncs_2passes); + (void)printf("%9" PRIu64 " reverse hits\n", nch_stats.ncs_revhits); (void)printf( "%9s cache hits (%d%% pos + %d%% neg) system %d%% per-process\n", "", PCT(nch_stats.ncs_goodhits, nchtotal), @@ -1895,10 +1892,6 @@ struct kernel_hash { X_NCHASH, X_NCHASHTBL, HASH_LIST, offsetof(struct namecache, nc_hash), }, { - "name cache directory hash", - X_NCVHASH, X_NCVHASHTBL, - HASH_LIST, offsetof(struct namecache, nc_vhash), - }, { "user info (uid -> used processes) hash", X_UIHASH, X_UIHASHTBL, HASH_LIST, offsetof(struct uidinfo, ui_hash),
CVS commit: src/sys
Module Name:src Committed By: ad Date: Mon Jan 6 11:23:31 UTC 2020 Modified Files: src/sys/rump/include/rump: rump_namei.h src/sys/sys: namei.h Log Message: Regen. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/rump/include/rump/rump_namei.h cvs rdiff -u -r1.102 -r1.103 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.36 src/sys/rump/include/rump/rump_namei.h:1.37 --- src/sys/rump/include/rump/rump_namei.h:1.36 Sun Dec 1 18:32:07 2019 +++ src/sys/rump/include/rump/rump_namei.h Mon Jan 6 11:23:31 2020 @@ -1,11 +1,11 @@ -/* $NetBSD: rump_namei.h,v 1.36 2019/12/01 18:32:07 ad Exp $ */ +/* $NetBSD: rump_namei.h,v 1.37 2020/01/06 11:23:31 ad 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.46 2019/12/01 18:31:19 ad Exp + * from: NetBSD: namei.src,v 1.47 2020/01/06 11:22:33 ad Exp */ #ifndef _RUMP_RUMP_NAMEI_H_ Index: src/sys/sys/namei.h diff -u src/sys/sys/namei.h:1.102 src/sys/sys/namei.h:1.103 --- src/sys/sys/namei.h:1.102 Sun Dec 1 18:32:07 2019 +++ src/sys/sys/namei.h Mon Jan 6 11:23:31 2020 @@ -1,11 +1,11 @@ -/* $NetBSD: namei.h,v 1.102 2019/12/01 18:32:07 ad Exp $ */ +/* $NetBSD: namei.h,v 1.103 2020/01/06 11:23:31 ad 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.46 2019/12/01 18:31:19 ad Exp + * from: NetBSD: namei.src,v 1.47 2020/01/06 11:22:33 ad Exp */ /* @@ -218,7 +218,6 @@ struct nameidata { */ struct namecache { LIST_ENTRY(namecache) nc_hash; /* L/C hash chain */ - LIST_ENTRY(namecache) nc_vhash; /* L directory hash chain */ TAILQ_ENTRY(namecache) nc_lru; /* L pseudo-lru chain */ LIST_ENTRY(namecache) nc_dvlist;/* L dvp's list of cache entries */ LIST_ENTRY(namecache) nc_vlist; /* L vp's list of cache entries */
CVS commit: src/sys
Module Name:src Committed By: ad Date: Mon Jan 6 11:22:33 UTC 2020 Modified Files: src/sys/kern: vfs_cache.c src/sys/sys: namei.src Log Message: Kill ncvhashtbl. It uses 64MB on my computer to map: vp -> vp (lol!). To generate a diff of this commit: cvs rdiff -u -r1.125 -r1.126 src/sys/kern/vfs_cache.c cvs rdiff -u -r1.46 -r1.47 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_cache.c diff -u src/sys/kern/vfs_cache.c:1.125 src/sys/kern/vfs_cache.c:1.126 --- src/sys/kern/vfs_cache.c:1.125 Sun Dec 1 18:31:19 2019 +++ src/sys/kern/vfs_cache.c Mon Jan 6 11:22:33 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_cache.c,v 1.125 2019/12/01 18:31:19 ad Exp $ */ +/* $NetBSD: vfs_cache.c,v 1.126 2020/01/06 11:22:33 ad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.125 2019/12/01 18:31:19 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_cache.c,v 1.126 2020/01/06 11:22:33 ad Exp $"); #define __NAMECACHE_PRIVATE #ifdef _KERNEL_OPT @@ -84,7 +84,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_cache.c, #include #include -#define NAMECACHE_ENTER_REVERSE /* * Name caching works as follows: * @@ -159,7 +158,6 @@ __KERNEL_RCSID(0, "$NetBSD: vfs_cache.c, * All use serialized by namecache_lock: * * nclruhead / struct namecache::nc_lru - * ncvhashtbl / struct namecache::nc_vhash * struct vnode_impl::vi_dnclist / struct namecache::nc_dvlist * struct vnode_impl::vi_nclist / struct namecache::nc_vlist * nchstats @@ -267,11 +265,6 @@ static u_long nchash __read_mostly; #define NCHASH2(hash, dvp) \ (((hash) ^ ((uintptr_t)(dvp) >> 3)) & nchash) -static LIST_HEAD(ncvhashhead, namecache) *ncvhashtbl __read_mostly; -static u_long ncvhash __read_mostly; - -#define NCVHASH(vp) (((uintptr_t)(vp) >> 3) & ncvhash) - /* Number of cache entries allocated. */ static long numcache __cacheline_aligned; @@ -408,10 +401,6 @@ cache_disassociate(struct namecache *ncp TAILQ_REMOVE(&nclruhead, ncp, nc_lru); ncp->nc_lru.tqe_prev = NULL; } - if (ncp->nc_vhash.le_prev != NULL) { - LIST_REMOVE(ncp, nc_vhash); - ncp->nc_vhash.le_prev = NULL; - } if (ncp->nc_vlist.le_prev != NULL) { LIST_REMOVE(ncp, nc_vlist); ncp->nc_vlist.le_prev = NULL; @@ -771,16 +760,15 @@ cache_revlookup(struct vnode *vp, struct { struct namecache *ncp; struct vnode *dvp; - struct ncvhashhead *nvcpp; struct nchcpu *cpup; char *bp; int error, nlen; + KASSERT(vp != NULL); + if (!doingcache) goto out; - nvcpp = &ncvhashtbl[NCVHASH(vp)]; - /* * We increment counters in the local CPU's per-cpu stats. * We don't take the per-cpu lock, however, since this function @@ -789,22 +777,22 @@ cache_revlookup(struct vnode *vp, struct */ cpup = curcpu()->ci_data.cpu_nch; mutex_enter(namecache_lock); - LIST_FOREACH(ncp, nvcpp, nc_vhash) { + LIST_FOREACH(ncp, &VNODE_TO_VIMPL(vp)->vi_nclist, nc_vlist) { mutex_enter(&ncp->nc_lock); if (ncp->nc_vp == vp && (dvp = ncp->nc_dvp) != NULL && dvp != vp) { /* avoid pesky . entries.. */ - -#ifdef DIAGNOSTIC if (ncp->nc_nlen == 1 && - ncp->nc_name[0] == '.') -panic("cache_revlookup: found entry for ."); - + ncp->nc_name[0] == '.') { + mutex_exit(&ncp->nc_lock); + continue; + } if (ncp->nc_nlen == 2 && ncp->nc_name[0] == '.' && - ncp->nc_name[1] == '.') -panic("cache_revlookup: found entry for .."); -#endif + ncp->nc_name[1] == '.') { + mutex_exit(&ncp->nc_lock); + continue; + } COUNT(cpup, ncs_revhits); nlen = ncp->nc_nlen; @@ -860,7 +848,6 @@ cache_enter(struct vnode *dvp, struct vn struct namecache *ncp; struct namecache *oncp; struct nchashhead *ncpp; - struct ncvhashhead *nvcpp; nchash_t hash; /* First, check whether we can/should add a cache entry. */ @@ -940,25 +927,6 @@ cache_enter(struct vnode *dvp, struct vn ncp->nc_hash.le_prev = &ncpp->lh_first; membar_producer(); ncpp->lh_first = ncp; - - ncp->nc_vhash.le_prev = NULL; - ncp->nc_vhash.le_next = NULL; - - /* - * Create reverse-cache entries (used in getcwd) for directories. - * (and in linux procfs exe node) - */ - if (vp != NULL && - vp != dvp && -#ifndef NAMECACHE_ENTER_REVERSE - vp->v_type == VDIR && -#endif - (ncp->nc_nlen > 2 || - (ncp->nc_nlen > 1 && ncp->nc_name[1] != '.') || - (/* ncp->nc_nlen > 0 && */ ncp->nc_name[0] != '.'))) { - nvcpp = &ncvhashtbl[NCVHASH(vp)]; - LIST_INSERT_HEAD(nvcpp, ncp, nc_vhash); - } mutex_exit(&ncp->nc_lock); mutex_exit(namecache_lock); } @@ -978,14 +946,7 @@ nchinit(void) KASSERT(namecache_cache != NULL); namecache_lock = mutex_obj_alloc(MUTEX_DEFAULT, IPL_NONE); - nchashtbl = hashinit(desiredvnodes, HASH_LIST, true, &nchash); - ncvhashtbl = -#ifdef NAMECACHE_ENTER_REVERSE -
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Jan 6 11:18:51 UTC 2020 Modified Files: src/sys/kern: tty.c Log Message: ttygetinfo(): avoid crash with zombies. From skrll@, tweaked by me. To generate a diff of this commit: cvs rdiff -u -r1.283 -r1.284 src/sys/kern/tty.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/tty.c diff -u src/sys/kern/tty.c:1.283 src/sys/kern/tty.c:1.284 --- src/sys/kern/tty.c:1.283 Thu Jan 2 16:52:55 2020 +++ src/sys/kern/tty.c Mon Jan 6 11:18:51 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: tty.c,v 1.283 2020/01/02 16:52:55 skrll Exp $ */ +/* $NetBSD: tty.c,v 1.284 2020/01/06 11:18:51 ad Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -63,7 +63,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.283 2020/01/02 16:52:55 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.284 2020/01/06 11:18:51 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -2533,11 +2533,13 @@ ttygetinfo(struct tty *tp, int fromsig, const char *msg; char lmsg[100]; long rss; + bool again = false; KASSERT(mutex_owned(proc_lock)); *buf = '\0'; + retry: if (tp->t_session == NULL) msg = "not a controlling terminal\n"; else if (tp->t_pgrp == NULL) @@ -2568,11 +2570,26 @@ ttygetinfo(struct tty *tp, int fromsig, if (p->p_lock != oldpick->p_lock) mutex_exit(oldpick->p_lock); } - if (fromsig && - (SIGACTION_PS(pick->p_sigacts, SIGINFO).sa_flags & - SA_NOKERNINFO)) - return; - msg = NULL; + + if (pick != NULL) { + mutex_enter(pick->p_lock); + if (P_ZOMBIE(pick)) { +mutex_exit(pick->p_lock); +pick = NULL; +if (!again) { + again = true; + goto retry; +} +msg = "found only zombie processes\n"; + } + if (fromsig && + (SIGACTION_PS(pick->p_sigacts, SIGINFO).sa_flags & + SA_NOKERNINFO)) { +mutex_exit(pick->p_lock); +return; + } + msg = NULL; + } } /* Print load average. */ @@ -2589,7 +2606,7 @@ ttygetinfo(struct tty *tp, int fromsig, pick->p_pid); strlcat(buf, lmsg, bufsz); - mutex_enter(pick->p_lock); + KASSERT(mutex_owned(pick->p_lock)); LIST_FOREACH(l, &pick->p_lwps, l_sibling) { const char *lp; lwp_lock(l); @@ -2679,11 +2696,8 @@ proc_compare_wrapper(struct proc *p1, st KASSERT(mutex_owned(p1->p_lock)); KASSERT(mutex_owned(p2->p_lock)); - if ((l1 = LIST_FIRST(&p1->p_lwps)) == NULL) - return 1; - - if ((l2 = LIST_FIRST(&p2->p_lwps)) == NULL) - return 0; + l1 = LIST_FIRST(&p1->p_lwps); + l2 = LIST_FIRST(&p2->p_lwps); return proc_compare(p1, l1, p2, l2); }
CVS commit: src/common/lib/libutil
Module Name:src Committed By: ad Date: Mon Jan 6 11:16:35 UTC 2020 Modified Files: src/common/lib/libutil: proc_compare.c Log Message: proc_compare(): weed out zombies before doing anything else. From skrll@. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/common/lib/libutil/proc_compare.c 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/libutil/proc_compare.c diff -u src/common/lib/libutil/proc_compare.c:1.1 src/common/lib/libutil/proc_compare.c:1.2 --- src/common/lib/libutil/proc_compare.c:1.1 Fri Oct 21 02:09:00 2011 +++ src/common/lib/libutil/proc_compare.c Mon Jan 6 11:16:35 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: proc_compare.c,v 1.1 2011/10/21 02:09:00 christos Exp $ */ +/* $NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -37,7 +37,7 @@ # include # if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: proc_compare.c,v 1.1 2011/10/21 02:09:00 christos Exp $"); +__RCSID("$NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $"); # endif # include @@ -52,7 +52,7 @@ __RCSID("$NetBSD: proc_compare.c,v 1.1 2 # define P_RTIME_USEC p_rtime_usec # else # include -__KERNEL_RCSID(0, "$NetBSD: proc_compare.c,v 1.1 2011/10/21 02:09:00 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: proc_compare.c,v 1.2 2020/01/06 11:16:35 ad Exp $"); # include # include # include @@ -89,6 +89,17 @@ int proc_compare(const PROC *p1, const LWP *l1, const PROC *p2, const LWP *l2) { /* + * weed out zombies + */ + switch (TESTAB(P_ZOMBIE(p1), P_ZOMBIE(p2))) { + case ONLYA: + return 1; + case ONLYB: + return 0; + case BOTH: + goto out; + } + /* * see if at least one of them is runnable */ switch (TESTAB(ISRUN(p1), ISRUN(p2))) { @@ -105,17 +116,6 @@ proc_compare(const PROC *p1, const LWP * goto out; } /* - * weed out zombies - */ - switch (TESTAB(P_ZOMBIE(p1), P_ZOMBIE(p2))) { - case ONLYA: - return 1; - case ONLYB: - return 0; - case BOTH: - goto out; - } - /* * pick the one with the smallest sleep time */ if (l1->l_slptime < l2->l_slptime)
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Jan 6 11:12:56 UTC 2020 Modified Files: src/sys/kern: kern_mutex.c Log Message: mutex_vector_enter(): avoid some unneeded reads of mtx_owner. To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/sys/kern/kern_mutex.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_mutex.c diff -u src/sys/kern/kern_mutex.c:1.86 src/sys/kern/kern_mutex.c:1.87 --- src/sys/kern/kern_mutex.c:1.86 Wed Dec 11 20:46:06 2019 +++ src/sys/kern/kern_mutex.c Mon Jan 6 11:12:55 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_mutex.c,v 1.86 2019/12/11 20:46:06 ad Exp $ */ +/* $NetBSD: kern_mutex.c,v 1.87 2020/01/06 11:12:55 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2019 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ #define __MUTEX_PRIVATE #include -__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.86 2019/12/11 20:46:06 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_mutex.c,v 1.87 2020/01/06 11:12:55 ad Exp $"); #include #include @@ -186,8 +186,8 @@ do { \ #define MUTEX_OWNER(owner) \ (owner & MUTEX_THREAD) -#define MUTEX_HAS_WAITERS(mtx) \ - (((int)(mtx)->mtx_owner & MUTEX_BIT_WAITERS) != 0) +#define MUTEX_HAS_WAITERS(owner) \ + ((owner & MUTEX_BIT_WAITERS) != 0) #define MUTEX_INITIALIZE_ADAPTIVE(mtx, dodebug)\ do { \ @@ -209,10 +209,10 @@ do { \ (mtx)->mtx_owner = MUTEX_THREAD;\ } while (/* CONSTCOND */ 0) -#define MUTEX_SPIN_P(mtx) \ -(((mtx)->mtx_owner & MUTEX_BIT_SPIN) != 0) -#define MUTEX_ADAPTIVE_P(mtx) \ -(((mtx)->mtx_owner & MUTEX_BIT_SPIN) == 0) +#define MUTEX_SPIN_P(owner) \ +(((owner) & MUTEX_BIT_SPIN) != 0) +#define MUTEX_ADAPTIVE_P(owner) \ +(((owner) & MUTEX_BIT_SPIN) == 0) #define MUTEX_DEBUG_P(mtx) (((mtx)->mtx_owner & MUTEX_BIT_NODEBUG) == 0) #if defined(LOCKDEBUG) @@ -310,10 +310,11 @@ static void mutex_dump(const volatile void *cookie, lockop_printer_t pr) { const volatile kmutex_t *mtx = cookie; + uintptr_t owner = mtx->mtx_owner; pr("owner field : %#018lx wait/spin: %16d/%d\n", - (long)MUTEX_OWNER(mtx->mtx_owner), MUTEX_HAS_WAITERS(mtx), - MUTEX_SPIN_P(mtx)); + (long)MUTEX_OWNER(owner), MUTEX_HAS_WAITERS(owner), + MUTEX_SPIN_P(owner)); } /* @@ -327,7 +328,7 @@ static void __noinline mutex_abort(const char *func, size_t line, const kmutex_t *mtx, const char *msg) { - LOCKDEBUG_ABORT(func, line, mtx, (MUTEX_SPIN_P(mtx) ? + LOCKDEBUG_ABORT(func, line, mtx, (MUTEX_SPIN_P(mtx->mtx_owner) ? &mutex_spin_lockops : &mutex_adaptive_lockops), msg); } @@ -380,10 +381,11 @@ mutex_init(kmutex_t *mtx, kmutex_type_t void mutex_destroy(kmutex_t *mtx) { + uintptr_t owner = mtx->mtx_owner; - if (MUTEX_ADAPTIVE_P(mtx)) { - MUTEX_ASSERT(mtx, !MUTEX_OWNED(mtx->mtx_owner) && - !MUTEX_HAS_WAITERS(mtx)); + if (MUTEX_ADAPTIVE_P(owner)) { + MUTEX_ASSERT(mtx, !MUTEX_OWNED(owner) && + !MUTEX_HAS_WAITERS(owner)); } else { MUTEX_ASSERT(mtx, !MUTEX_SPINBIT_LOCKED_P(mtx)); } @@ -454,7 +456,8 @@ mutex_vector_enter(kmutex_t *mtx) /* * Handle spin mutexes. */ - if (MUTEX_SPIN_P(mtx)) { + owner = mtx->mtx_owner; + if (MUTEX_SPIN_P(owner)) { #if defined(LOCKDEBUG) && defined(MULTIPROCESSOR) u_int spins = 0; #endif @@ -501,7 +504,7 @@ mutex_vector_enter(kmutex_t *mtx) curthread = (uintptr_t)curlwp; - MUTEX_DASSERT(mtx, MUTEX_ADAPTIVE_P(mtx)); + MUTEX_DASSERT(mtx, MUTEX_ADAPTIVE_P(owner)); MUTEX_ASSERT(mtx, curthread != 0); MUTEX_ASSERT(mtx, !cpu_intr_p()); MUTEX_WANTLOCK(mtx); @@ -519,7 +522,7 @@ mutex_vector_enter(kmutex_t *mtx) * then we stop spinning, and sleep instead. */ KPREEMPT_DISABLE(curlwp); - for (owner = mtx->mtx_owner;;) { + for (;;) { if (!MUTEX_OWNED(owner)) { /* * Mutex owner clear could mean two things: @@ -667,12 +670,18 @@ mutex_vector_enter(kmutex_t *mtx) * If the waiters bit is not set it's unsafe to go asleep, * as we might never be awoken. */ - if ((membar_consumer(), mutex_oncpu(owner)) || - (membar_consumer(), !MUTEX_HAS_WAITERS(mtx))) { + membar_consumer(); + if (mutex_oncpu(owner)) { turnstile_exit(mtx); owner = mtx->mtx_owner; continue; } + membar_consumer(); + owner = mtx->mtx_owner; + if (!MUTEX_HAS_WAITERS(owner)) { + turnstile_exit(mtx); + continue; + } #endif /* MULTIPROCESSOR */ LOCKSTAT_START_TIMER(lsflag, slptime); @@ -707,7 +716,7 @@ mutex_vector_exit(kmutex_t *mtx) turnstile_t *ts; uintptr_t curthread; - if (MUTEX_SPIN_P(mtx)) { + if (MUTEX_SPIN_P(mtx->mtx_owner)) { #ifdef FULL if (__predict_false(!MUTEX_SPINBIT_LOCKED_P(mtx))) { MUTEX_ABORT(mtx, "exiting unheld spin mutex"); @@ -748,7 +757,7 @@ mutex_vector_exit(kmutex_t *mtx) */ { int s = splhigh(); - if (!MUTEX_HAS_WAITERS(mtx)) { + if (!MUTEX_HAS_WAITERS(mtx->mtx_owner)) { MUTEX_RELEASE(mtx)
CVS commit: src/sys/sys
Module Name:src Committed By: martin Date: Mon Jan 6 10:21:21 UTC 2020 Modified Files: src/sys/sys: sched.h Log Message: Move the include into a kernel-only section. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/sys/sched.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/sched.h diff -u src/sys/sys/sched.h:1.84 src/sys/sys/sched.h:1.85 --- src/sys/sys/sched.h:1.84 Mon Jan 6 01:37:57 2020 +++ src/sys/sys/sched.h Mon Jan 6 10:21:21 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: sched.h,v 1.84 2020/01/06 01:37:57 oster Exp $ */ +/* $NetBSD: sched.h,v 1.85 2020/01/06 10:21:21 martin Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2007, 2008, 2019 @@ -71,7 +71,6 @@ #define _SYS_SCHED_H_ #include -#include #include #if defined(_KERNEL_OPT) @@ -145,6 +144,7 @@ __END_DECLS #include #include +#include /* * Per-CPU scheduler state. Field markings and the corresponding locks:
CVS commit: src/sys/arch/aarch64/aarch64
Module Name:src Committed By: skrll Date: Mon Jan 6 08:36:09 UTC 2020 Modified Files: src/sys/arch/aarch64/aarch64: trap.c Log Message: fix new cpu_intr_p To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/sys/arch/aarch64/aarch64/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/aarch64/aarch64/trap.c diff -u src/sys/arch/aarch64/aarch64/trap.c:1.23 src/sys/arch/aarch64/aarch64/trap.c:1.24 --- src/sys/arch/aarch64/aarch64/trap.c:1.23 Sun Jan 5 20:17:43 2020 +++ src/sys/arch/aarch64/aarch64/trap.c Mon Jan 6 08:36:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.23 2020/01/05 20:17:43 ad Exp $ */ +/* $NetBSD: trap.c,v 1.24 2020/01/06 08:36:08 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include -__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.23 2020/01/05 20:17:43 ad Exp $"); +__KERNEL_RCSID(1, "$NetBSD: trap.c,v 1.24 2020/01/06 08:36:08 skrll Exp $"); #include "opt_arm_intr_impl.h" #include "opt_compat_netbsd32.h" @@ -641,7 +641,7 @@ cpu_intr_p(void) do { ncsw = l->l_ncsw; __insn_barrier(); - idepth = l->l_cpu->ci_idepth; + idepth = l->l_cpu->ci_intr_depth; __insn_barrier(); } while (__predict_false(ncsw != l->l_ncsw));
CVS commit: src/sys/arch
Module Name:src Committed By: skrll Date: Mon Jan 6 08:29:08 UTC 2020 Modified Files: src/sys/arch/aarch64/include: pmap.h src/sys/arch/arm/fdt: arm_platform.c Log Message: Fix DEVMAP build losage by reducing diffs between arm and aarch64 *sigh* To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/arch/aarch64/include/pmap.h cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/fdt/arm_platform.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/aarch64/include/pmap.h diff -u src/sys/arch/aarch64/include/pmap.h:1.29 src/sys/arch/aarch64/include/pmap.h:1.30 --- src/sys/arch/aarch64/include/pmap.h:1.29 Mon Dec 30 16:05:15 2019 +++ src/sys/arch/aarch64/include/pmap.h Mon Jan 6 08:29:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.29 2019/12/30 16:05:15 skrll Exp $ */ +/* $NetBSD: pmap.h,v 1.30 2020/01/06 08:29:08 skrll Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -201,14 +201,14 @@ paddr_t pmap_alloc_pdp(struct pmap *, st #define L3_TRUNC_BLOCK(x) ((x) & L3_FRAME) #define L3_ROUND_BLOCK(x) L3_TRUNC_BLOCK((x) + L3_SIZE - 1) -#define DEVMAP_TRUNC_ADDR(x) L3_TRUNC_BLOCK((x)) -#define DEVMAP_ROUND_SIZE(x) L3_ROUND_BLOCK((x)) +#define DEVMAP_ALIGN(x) L3_TRUNC_BLOCK((x)) +#define DEVMAP_SIZE(x) L3_ROUND_BLOCK((x)) #define DEVMAP_ENTRY(va, pa, sz) \ { \ - .pd_va = DEVMAP_TRUNC_ADDR(va), \ - .pd_pa = DEVMAP_TRUNC_ADDR(pa), \ - .pd_size = DEVMAP_ROUND_SIZE(sz), \ + .pd_va = DEVMAP_ALIGN(va), \ + .pd_pa = DEVMAP_ALIGN(pa), \ + .pd_size = DEVMAP_SIZE(sz), \ .pd_prot = VM_PROT_READ|VM_PROT_WRITE, \ .pd_flags = PMAP_DEV \ } Index: src/sys/arch/arm/fdt/arm_platform.c diff -u src/sys/arch/arm/fdt/arm_platform.c:1.1 src/sys/arch/arm/fdt/arm_platform.c:1.2 --- src/sys/arch/arm/fdt/arm_platform.c:1.1 Sun Jan 5 17:26:31 2020 +++ src/sys/arch/arm/fdt/arm_platform.c Mon Jan 6 08:29:08 2020 @@ -1,4 +1,4 @@ -/* $NetBSD: arm_platform.c,v 1.1 2020/01/05 17:26:31 jmcneill Exp $ */ +/* $NetBSD: arm_platform.c,v 1.2 2020/01/06 08:29:08 skrll Exp $ */ /*- * Copyright (c) 2020 Jared McNeill @@ -36,7 +36,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: arm_platform.c,v 1.1 2020/01/05 17:26:31 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arm_platform.c,v 1.2 2020/01/06 08:29:08 skrll Exp $"); #include #include @@ -50,6 +50,7 @@ __KERNEL_RCSID(0, "$NetBSD: arm_platform #include #include + #include #include @@ -85,7 +86,7 @@ arm_platform_devmap(void) DEVMAP_ENTRY_END }; static struct pmap_devmap devmap_uart[] = { - DEVMAP_ENTRY(KERNEL_IO_VBASE, 0, L3_SIZE), + DEVMAP_ENTRY(KERNEL_IO_VBASE, 0, PAGE_SIZE), DEVMAP_ENTRY_END }; bus_addr_t uart_base; @@ -97,7 +98,7 @@ arm_platform_devmap(void) if (fdtbus_get_reg(phandle, 0, &uart_base, NULL) != 0) return devmap_empty; - devmap_uart[0].pd_pa = DEVMAP_TRUNC_ADDR(uart_base); + devmap_uart[0].pd_pa = DEVMAP_ALIGN(uart_base); return devmap_uart; }