CVS commit: src/distrib/utils/embedded/conf
Module Name:src Committed By: skrll Date: Mon Dec 16 08:01:20 UTC 2019 Modified Files: src/distrib/utils/embedded/conf: arm64.conf Log Message: Fix whitespace in a comment To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/distrib/utils/embedded/conf/arm64.conf Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/utils/embedded/conf/arm64.conf diff -u src/distrib/utils/embedded/conf/arm64.conf:1.6 src/distrib/utils/embedded/conf/arm64.conf:1.7 --- src/distrib/utils/embedded/conf/arm64.conf:1.6 Sun Mar 3 11:44:18 2019 +++ src/distrib/utils/embedded/conf/arm64.conf Mon Dec 16 08:01:20 2019 @@ -1,4 +1,4 @@ -# $NetBSD: arm64.conf,v 1.6 2019/03/03 11:44:18 jmcneill Exp $ +# $NetBSD: arm64.conf,v 1.7 2019/12/16 08:01:20 skrll Exp $ # ARM64 customization script used by mkimage # board=arm64 @@ -101,7 +101,7 @@ populate() { kernels="" k="$kernel_GENERIC64" - # .imgkernel + # .img kernel f="${kernel}/netbsd-${k}.img.gz" test -f "${f}" && kernels="${kernels} ${f}"
CVS commit: src/sys/miscfs/genfs
Module Name:src Committed By: ad Date: Mon Dec 16 08:50:43 UTC 2019 Modified Files: src/sys/miscfs/genfs: genfs_io.c Log Message: Correction to previous for DEBUG case. To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/sys/miscfs/genfs/genfs_io.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/genfs/genfs_io.c diff -u src/sys/miscfs/genfs/genfs_io.c:1.79 src/sys/miscfs/genfs/genfs_io.c:1.80 --- src/sys/miscfs/genfs/genfs_io.c:1.79 Sun Dec 15 21:43:42 2019 +++ src/sys/miscfs/genfs/genfs_io.c Mon Dec 16 08:50:42 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: genfs_io.c,v 1.79 2019/12/15 21:43:42 ad Exp $ */ +/* $NetBSD: genfs_io.c,v 1.80 2019/12/16 08:50:42 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.79 2019/12/15 21:43:42 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.80 2019/12/16 08:50:42 ad Exp $"); #include #include @@ -1239,6 +1239,7 @@ retry: if (pg == NULL) { break; } + uvm_page_array_advance(&a); if ((pg->flags & (PG_FAKE | PG_MARKER)) != 0) { continue; }
CVS commit: src
Module Name:src Committed By: skrll Date: Mon Dec 16 11:00:31 UTC 2019 Modified Files: src/distrib/evbarm/instkernel/instkernel: Makefile src/distrib/utils/embedded/conf: arm64.conf armv7.conf rpi.conf rpi_inst.conf src/external/broadcom/rpi-firmware/dist: bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf src/sys/arch/evbarm/conf: mk.generic mk.generic64 mk.rpi Added Files: src/external/broadcom/rpi-firmware/dist: fixup4.dat fixup4cd.dat start4.elf start4cd.elf Removed Files: src/sys/arch/evbarm/compile: rpi-mkknlimg.sh Log Message: Update to new RaspberryPi firware commit 0c01dbefba45a08c47f8538d5a071a0fba6b7e83 Author: popcornmix Date: Wed Dec 11 15:30:08 2019 + and include firmware for RPI4 Firmware has bee updated to support mainline linux kernels as described in https://github.com/raspberrypi/linux/issues/3237 To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/distrib/evbarm/instkernel/instkernel/Makefile cvs rdiff -u -r1.7 -r1.8 src/distrib/utils/embedded/conf/arm64.conf cvs rdiff -u -r1.39 -r1.40 src/distrib/utils/embedded/conf/armv7.conf cvs rdiff -u -r1.34 -r1.35 src/distrib/utils/embedded/conf/rpi.conf cvs rdiff -u -r1.11 -r1.12 src/distrib/utils/embedded/conf/rpi_inst.conf cvs rdiff -u -r1.11 -r1.12 \ src/external/broadcom/rpi-firmware/dist/bootcode.bin \ src/external/broadcom/rpi-firmware/dist/fixup.dat \ src/external/broadcom/rpi-firmware/dist/fixup_cd.dat \ src/external/broadcom/rpi-firmware/dist/start.elf \ src/external/broadcom/rpi-firmware/dist/start_cd.elf cvs rdiff -u -r0 -r1.1 src/external/broadcom/rpi-firmware/dist/fixup4.dat \ src/external/broadcom/rpi-firmware/dist/fixup4cd.dat \ src/external/broadcom/rpi-firmware/dist/start4.elf \ src/external/broadcom/rpi-firmware/dist/start4cd.elf cvs rdiff -u -r1.2 -r0 src/sys/arch/evbarm/compile/rpi-mkknlimg.sh cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/mk.generic cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/conf/mk.generic64 cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/mk.rpi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/distrib/evbarm/instkernel/instkernel/Makefile diff -u src/distrib/evbarm/instkernel/instkernel/Makefile:1.32 src/distrib/evbarm/instkernel/instkernel/Makefile:1.33 --- src/distrib/evbarm/instkernel/instkernel/Makefile:1.32 Mon Aug 12 08:04:28 2019 +++ src/distrib/evbarm/instkernel/instkernel/Makefile Mon Dec 16 11:00:30 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2019/08/12 08:04:28 martin Exp $ +# $NetBSD: Makefile,v 1.33 2019/12/16 11:00:30 skrll Exp $ .include .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib" @@ -14,8 +14,7 @@ MDSETTARGETS= .for i in ${BUILD_KERNELS:M*_INSTALL} .if ${i} == "RPI_INSTALL" MDSETTARGETS+= ${i} ${SSHRAMDISK} netbsd-${i} -MDSET_SUFFIXES.netbsd-${i}= bin create-bin img create-img -MDSET_.RPI_INSTALL.netbsd-RPI_INSTALL.img.deps= netbsd-RPI_INSTALL.bin +MDSET_SUFFIXES.netbsd-${i}= img create-img .else MDSETTARGETS+= ${i} ${RAMDISK} - .endif @@ -23,12 +22,9 @@ MDSETTARGETS+= ${i} ${RAMDISK} - MDSET_RELEASEDIR= installation/instkernel -MDSET_SUFFIXES.-= srec create-srec bin create-bin +MDSET_SUFFIXES.-= srec create-srec img create-img create-srec= ${OBJCOPY} -O srec ${.TARGET:R} ${.TARGET} -create-bin= ${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET} -create-img= \ - ${HOST_SH} ${NETBSDSRCDIR}/sys/arch/evbarm/compile/rpi-mkknlimg.sh \ - ${.TARGET:R}.bin ${.TARGET} +create-img= ${OBJCOPY} -O binary ${.TARGET:R} ${.TARGET} .include "${DISTRIBDIR}/common/Makefile.mdset" Index: src/distrib/utils/embedded/conf/arm64.conf diff -u src/distrib/utils/embedded/conf/arm64.conf:1.7 src/distrib/utils/embedded/conf/arm64.conf:1.8 --- src/distrib/utils/embedded/conf/arm64.conf:1.7 Mon Dec 16 08:01:20 2019 +++ src/distrib/utils/embedded/conf/arm64.conf Mon Dec 16 11:00:30 2019 @@ -1,4 +1,4 @@ -# $NetBSD: arm64.conf,v 1.7 2019/12/16 08:01:20 skrll Exp $ +# $NetBSD: arm64.conf,v 1.8 2019/12/16 11:00:30 skrll Exp $ # ARM64 customization script used by mkimage # board=arm64 @@ -67,13 +67,16 @@ populate_rockchip() { populate_rpi() { firmwaredir="${src}/external/broadcom/rpi-firmware/dist" - firmwarefiles="LICENCE.broadcom bootcode.bin fixup.dat fixup_cd.dat start.elf start_cd.elf" + firmwarefiles="LICENCE.broadcom bootcode.bin fixup4cd.dat fixup4.dat fixup_cd.dat fixup.dat start4cd.elf start4.elf start_cd.elf start.elf" cat > "${mnt}/boot/cmdline.txt" << EOF root=ld0a console=${console} EOF cat > "${mnt}/boot/config.txt" << EOF +# +upstream_kernel=1 +# arm_64bit=1 kernel=netbsd.img kernel_address=0x20 Index: src/distrib/utils/embedded/conf/armv7.conf diff -u src/distrib/utils/embedded/conf/armv7.conf:1.39 src/distrib/utils/embedded/conf/armv7.conf:1.40 --- src/distrib/utils/embedded/c
CVS commit: src/sys/arch/arm/sunxi
Module Name:src Committed By: jmcneill Date: Mon Dec 16 12:40:17 UTC 2019 Modified Files: src/sys/arch/arm/sunxi: sunxi_drm.c Log Message: Make sure memory stolen from simplefb is page aligned. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/sunxi/sunxi_drm.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/arm/sunxi/sunxi_drm.c diff -u src/sys/arch/arm/sunxi/sunxi_drm.c:1.10 src/sys/arch/arm/sunxi/sunxi_drm.c:1.11 --- src/sys/arch/arm/sunxi/sunxi_drm.c:1.10 Sun Dec 15 01:00:58 2019 +++ src/sys/arch/arm/sunxi/sunxi_drm.c Mon Dec 16 12:40:17 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sunxi_drm.c,v 1.10 2019/12/15 01:00:58 mrg Exp $ */ +/* $NetBSD: sunxi_drm.c,v 1.11 2019/12/16 12:40:17 jmcneill Exp $ */ /*- * Copyright (c) 2019 Jared D. McNeill @@ -27,7 +27,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.10 2019/12/15 01:00:58 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c,v 1.11 2019/12/16 12:40:17 jmcneill Exp $"); #include #include @@ -53,6 +53,14 @@ __KERNEL_RCSID(0, "$NetBSD: sunxi_drm.c, #define SUNXI_DRM_MAX_WIDTH 3840 #define SUNXI_DRM_MAX_HEIGHT 2160 +/* + * The DRM headers break trunc_page/round_page macros with a redefinition + * of PAGE_MASK. Use our own macros instead. + */ +#define SUNXI_PAGE_MASK (PAGE_SIZE - 1) +#define SUNXI_TRUNC_PAGE(x) ((x) & ~SUNXI_PAGE_MASK) +#define SUNXI_ROUND_PAGE(x) (((x) + SUNXI_PAGE_MASK) & ~SUNXI_PAGE_MASK) + static TAILQ_HEAD(, sunxi_drm_endpoint) sunxi_drm_endpoints = TAILQ_HEAD_INITIALIZER(sunxi_drm_endpoints); @@ -299,7 +307,8 @@ static int sunxi_drm_simplefb_lookup(bus_addr_t *paddr, bus_size_t *psize) { static const char * compat[] = { "simple-framebuffer", NULL }; - int chosen, child; + int chosen, child, error; + bus_addr_t addr_end; chosen = OF_finddevice("/chosen"); if (chosen == -1) @@ -310,7 +319,15 @@ sunxi_drm_simplefb_lookup(bus_addr_t *pa continue; if (!of_match_compatible(child, compat)) continue; - return fdtbus_get_reg(child, 0, paddr, psize); + error = fdtbus_get_reg(child, 0, paddr, psize); + if (error != 0) + return error; + + /* Reclaim entire pages used by the simplefb */ + addr_end = *paddr + *psize; + *paddr = SUNXI_TRUNC_PAGE(*paddr); + *psize = SUNXI_ROUND_PAGE(addr_end - *paddr); + return 0; } return ENOENT;
CVS commit: src/usr.sbin/sysinst
Module Name:src Committed By: martin Date: Mon Dec 16 13:48:44 UTC 2019 Modified Files: src/usr.sbin/sysinst: Makefile.inc Log Message: Fix the pattern creating the relative path for distribution sets on branches: we missed the potential numbers in suffixes, like _RC1. To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/usr.sbin/sysinst/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/usr.sbin/sysinst/Makefile.inc diff -u src/usr.sbin/sysinst/Makefile.inc:1.30 src/usr.sbin/sysinst/Makefile.inc:1.31 --- src/usr.sbin/sysinst/Makefile.inc:1.30 Thu Nov 14 13:58:22 2019 +++ src/usr.sbin/sysinst/Makefile.inc Mon Dec 16 13:48:44 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.30 2019/11/14 13:58:22 martin Exp $ +# $NetBSD: Makefile.inc,v 1.31 2019/12/16 13:48:44 martin Exp $ # # Makefile for sysinst @@ -96,10 +96,10 @@ CPPFLAGS+= -DSYSINST_HTTP_HOST=\"nycdn.N CPPFLAGS+= -DREL_PATH=\"HEAD\" CPPFLAGS+= -DPKG_SUBDIR="\"${DISTRIBVER:C/\.99\.[0-9]*[_A-Z]*$//}.0\"" .elif (${DISTRIBVER:M*.[0-9].[0-9]*}) -CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*$//:S/./-/}\" +CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*[0-9]*$//:S/./-/}\" CPPFLAGS+= -DPKG_SUBDIR="\"${DISTRIBVER:C/_.*$//}\"" .elif (${DISTRIBVER:M*.[0-9]*}) -CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*$//}\" +CPPFLAGS+= -DREL_PATH=\"netbsd-${DISTRIBVER:C/\.[0-9][_A-Z]*[0-9]*$//}\" CPPFLAGS+= -DPKG_SUBDIR="\"${DISTRIBVER:C/_.*$//}\"" .endif .endif
CVS commit: src/sys
Module Name:src Committed By: tkusumi Date: Mon Dec 16 14:26:23 UTC 2019 Modified Files: src/sys/dev/dm: dm.h dm_target.c dm_target_error.c dm_target_zero.c src/sys/modules/dm: Makefile Log Message: dm: Enable dm-error and dm-zero target Add these two targets to dm.kmod. These are generally available in Linux and DragonFlyBSD, so enable them in NetBSD as well. To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/sys/dev/dm/dm.h cvs rdiff -u -r1.32 -r1.33 src/sys/dev/dm/dm_target.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/dm/dm_target_error.c cvs rdiff -u -r1.26 -r1.27 src/sys/dev/dm/dm_target_zero.c cvs rdiff -u -r1.7 -r1.8 src/sys/modules/dm/Makefile 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/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.46 src/sys/dev/dm/dm.h:1.47 --- src/sys/dev/dm/dm.h:1.46 Sun Dec 15 16:14:27 2019 +++ src/sys/dev/dm/dm.h Mon Dec 16 14:26:23 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: dm.h,v 1.46 2019/12/15 16:14:27 tkusumi Exp $ */ +/*$NetBSD: dm.h,v 1.47 2019/12/16 14:26:23 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -266,6 +266,22 @@ int dm_target_stripe_destroy(dm_table_en int dm_target_stripe_upcall(dm_table_entry_t *, struct buf *); int dm_target_stripe_secsize(dm_table_entry_t *, unsigned int *); +/* dm_target_error.c */ +int dm_target_error_init(dm_table_entry_t*, int, char **); +char *dm_target_error_table(void *); +int dm_target_error_strategy(dm_table_entry_t *, struct buf *); +int dm_target_error_deps(dm_table_entry_t *, prop_array_t); +int dm_target_error_destroy(dm_table_entry_t *); +int dm_target_error_upcall(dm_table_entry_t *, struct buf *); + +/* dm_target_zero.c */ +int dm_target_zero_init(dm_table_entry_t *, int, char **); +char *dm_target_zero_table(void *); +int dm_target_zero_strategy(dm_table_entry_t *, struct buf *); +int dm_target_zero_destroy(dm_table_entry_t *); +int dm_target_zero_deps(dm_table_entry_t *, prop_array_t); +int dm_target_zero_upcall(dm_table_entry_t *, struct buf *); + /* dm_table.c */ #define DM_TABLE_ACTIVE 0 #define DM_TABLE_INACTIVE 1 Index: src/sys/dev/dm/dm_target.c diff -u src/sys/dev/dm/dm_target.c:1.32 src/sys/dev/dm/dm_target.c:1.33 --- src/sys/dev/dm/dm_target.c:1.32 Sun Dec 15 14:39:42 2019 +++ src/sys/dev/dm/dm_target.c Mon Dec 16 14:26:23 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: dm_target.c,v 1.32 2019/12/15 14:39:42 tkusumi Exp $ */ +/*$NetBSD: dm_target.c,v 1.33 2019/12/16 14:26:23 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include -__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.32 2019/12/15 14:39:42 tkusumi Exp $"); +__KERNEL_RCSID(0, "$NetBSD: dm_target.c,v 1.33 2019/12/16 14:26:23 tkusumi Exp $"); #include #include @@ -312,14 +312,11 @@ dm_target_prop_list(void) int dm_target_init(void) { - dm_target_t *dmt, *dmt3; - int r; + dm_target_t *dmt; mutex_init(&dm_target_mutex, MUTEX_DEFAULT, IPL_NONE); dmt = dm_target_alloc("linear"); - dmt3 = dm_target_alloc("striped"); - dmt->version[0] = 1; dmt->version[1] = 0; dmt->version[2] = 2; @@ -331,22 +328,49 @@ dm_target_init(void) dmt->destroy = &dm_target_linear_destroy; dmt->upcall = &dm_target_linear_upcall; dmt->secsize = &dm_target_linear_secsize; + if (dm_target_insert(dmt)) + printf("Failed to insert linear\n"); - r = dm_target_insert(dmt); + dmt = dm_target_alloc("striped"); + dmt->version[0] = 1; + dmt->version[1] = 0; + dmt->version[2] = 3; + dmt->init = &dm_target_stripe_init; + dmt->table = &dm_target_stripe_table; + dmt->strategy = &dm_target_stripe_strategy; + dmt->sync = &dm_target_stripe_sync; + dmt->deps = &dm_target_stripe_deps; + dmt->destroy = &dm_target_stripe_destroy; + dmt->upcall = &dm_target_stripe_upcall; + dmt->secsize = &dm_target_stripe_secsize; + if (dm_target_insert(dmt)) + printf("Failed to insert striped\n"); - dmt3->version[0] = 1; - dmt3->version[1] = 0; - dmt3->version[2] = 3; - dmt3->init = &dm_target_stripe_init; - dmt3->table = &dm_target_stripe_table; - dmt3->strategy = &dm_target_stripe_strategy; - dmt3->sync = &dm_target_stripe_sync; - dmt3->deps = &dm_target_stripe_deps; - dmt3->destroy = &dm_target_stripe_destroy; - dmt3->upcall = &dm_target_stripe_upcall; - dmt3->secsize = &dm_target_stripe_secsize; + dmt = dm_target_alloc("error"); + dmt->version[0] = 1; + dmt->version[1] = 0; + dmt->version[2] = 0; + dmt->init = &dm_target_error_init; + dmt->table = &dm_target_error_table; + dmt->strategy = &dm_target_error_strategy; + dmt->deps = &dm_target_error_deps; + dmt->destroy = &dm_target_error_destroy; + dmt->upcall = &dm_target_error_upcall; + if (dm_target_insert(dmt)) + printf("Failed to insert error\n"); - r = dm_target_insert(dmt3); + dmt = dm_target_alloc("zero"); + dmt->version[0] = 1; + dmt->versi
CVS commit: src/sys/arch/evbarm/conf
Module Name:src Committed By: skrll Date: Mon Dec 16 14:32:14 UTC 2019 Modified Files: src/sys/arch/evbarm/conf: mk.rpi Log Message: Be consistent with RPI 32-bit and 64-kernels and use .img for the file to give to the firmware to boot To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/arch/evbarm/conf/mk.rpi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/evbarm/conf/mk.rpi diff -u src/sys/arch/evbarm/conf/mk.rpi:1.7 src/sys/arch/evbarm/conf/mk.rpi:1.8 --- src/sys/arch/evbarm/conf/mk.rpi:1.7 Mon Dec 16 11:00:30 2019 +++ src/sys/arch/evbarm/conf/mk.rpi Mon Dec 16 14:32:14 2019 @@ -1,4 +1,4 @@ -# $NetBSD: mk.rpi,v 1.7 2019/12/16 11:00:30 skrll Exp $ +# $NetBSD: mk.rpi,v 1.8 2019/12/16 14:32:14 skrll Exp $ SYSTEM_FIRST_OBJ= armv6_start.o SYSTEM_FIRST_SFILE= ${ARM}/arm/armv6_start.S @@ -9,7 +9,7 @@ KERNEL_BASE_PHYS=0x8000 KERNEL_BASE_VIRT=0x80008000 SYSTEM_LD_TAIL_EXTRA+=; \ - echo ${OBJCOPY} -S -O binary $@ $@.bin; \ - ${OBJCOPY} -S -O binary $@ $@.bin; + echo ${OBJCOPY} -S -O binary $@ $@.img; \ + ${OBJCOPY} -S -O binary $@ $@.img; -EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.bin@} +EXTRA_KERNELS+= ${KERNELS:@.KERNEL.@${.KERNEL.}.img@}
CVS commit: src/sys/dev/dm
Module Name:src Committed By: tkusumi Date: Mon Dec 16 15:59:05 UTC 2019 Modified Files: src/sys/dev/dm: dm.h Log Message: dm: Cleanup dm.h (remove unneeded comments, etc) To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/dev/dm/dm.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/dm/dm.h diff -u src/sys/dev/dm/dm.h:1.47 src/sys/dev/dm/dm.h:1.48 --- src/sys/dev/dm/dm.h:1.47 Mon Dec 16 14:26:23 2019 +++ src/sys/dev/dm/dm.h Mon Dec 16 15:59:04 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: dm.h,v 1.47 2019/12/16 14:26:23 tkusumi Exp $ */ +/*$NetBSD: dm.h,v 1.48 2019/12/16 15:59:04 tkusumi Exp $ */ /* * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -29,14 +29,12 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#ifndef _DM_DEV_H_ -#define _DM_DEV_H_ - +#ifndef _DM_H_ +#define _DM_H_ #ifdef _KERNEL #include - #include #include #include @@ -45,7 +43,6 @@ #include #include #include - #include #include #include @@ -72,7 +69,6 @@ extern uint32_t dm_dev_counter; * A device mapper table is a list of physical ranges plus the mapping target * applied to them. */ - typedef struct dm_table_entry { struct dm_dev *dm_dev; /* backlink */ uint64_t start; @@ -90,10 +86,10 @@ typedef struct dm_table dm_table_t; typedef struct dm_table_head { /* Current active table is selected with this. */ int cur_active_table; - struct dm_table tables[2]; + dm_table_t tables[2]; kmutex_t table_mtx; - kcondvar_t table_cv; /*IO waiting cv */ + kcondvar_t table_cv; /* I/O waiting cv */ uint32_t io_cnt; } dm_table_head_t; @@ -105,7 +101,6 @@ typedef struct dm_table_head { * I need this because devices can be opened only once, but I can * have more than one device on one partition. */ - typedef struct dm_pdev { char name[MAX_DEV_NAME]; @@ -150,13 +145,7 @@ typedef struct dm_dev { TAILQ_ENTRY(dm_dev) next_devlist; /* Major device list. */ } dm_dev_t; -/* for zero, error : dm_target->target_config == NULL */ - -/* - * Target config is initiated with target_init function. - */ - -/* for linear : */ +/* For linear target. */ typedef struct target_linear_config { dm_pdev_t *pdev; uint64_t offset; @@ -182,7 +171,7 @@ typedef struct dm_target { /* Destroy target_config area */ int (*destroy)(dm_table_entry_t *); - int (*deps) (dm_table_entry_t *, prop_array_t); + int (*deps)(dm_table_entry_t *, prop_array_t); /* * Info/table routine are called to get params string, which is target * specific. When dm_table_status_ioctl is called with flag @@ -205,8 +194,6 @@ typedef struct dm_target { TAILQ_ENTRY(dm_target) dm_target_next; } dm_target_t; -/* Interface structures */ - /* device-mapper */ void dmgetproperties(struct disk *, dm_table_head_t *); @@ -240,8 +227,6 @@ dm_target_t* dm_target_lookup(const char int dm_target_rem(const char *); void dm_target_unbusy(dm_target_t *); void dm_target_busy(dm_target_t *); - -/* XXX temporally add */ int dm_target_init(void); #define DM_MAX_PARAMS_SIZE 1024 @@ -319,4 +304,4 @@ dm_pdev_t* dm_pdev_insert(const char *); #endif /*_KERNEL*/ -#endif /*_DM_DEV_H_*/ +#endif /*_DM_H_*/
CVS commit: src/sys/miscfs/genfs
Module Name:src Committed By: ad Date: Mon Dec 16 18:17:32 UTC 2019 Modified Files: src/sys/miscfs/genfs: genfs_io.c Log Message: genfs_do_putpages(): add a missing call to uvm_page_array_advance(). Spotted by the automated test runs and: Reported-by: syzbot+adc1f0ce21bcece53...@syzkaller.appspotmail.com To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/sys/miscfs/genfs/genfs_io.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/genfs/genfs_io.c diff -u src/sys/miscfs/genfs/genfs_io.c:1.80 src/sys/miscfs/genfs/genfs_io.c:1.81 --- src/sys/miscfs/genfs/genfs_io.c:1.80 Mon Dec 16 08:50:42 2019 +++ src/sys/miscfs/genfs/genfs_io.c Mon Dec 16 18:17:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: genfs_io.c,v 1.80 2019/12/16 08:50:42 ad Exp $ */ +/* $NetBSD: genfs_io.c,v 1.81 2019/12/16 18:17:32 ad Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.80 2019/12/16 08:50:42 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: genfs_io.c,v 1.81 2019/12/16 18:17:32 ad Exp $"); #include #include @@ -978,6 +978,7 @@ retry: if (pg->flags & (PG_RELEASED|PG_PAGEOUT)) { wasclean = false; nextoff = pg->offset + PAGE_SIZE; + uvm_page_array_advance(&a); continue; }
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Mon Dec 16 18:30:18 UTC 2019 Modified Files: src/sys/uvm: uvm_page.c Log Message: Merge from yamt-pagecache: uvm_pagerealloc(): Don't bother with insert to new. Nobody uses it and it can return an error now due to radixtree. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.204 src/sys/uvm/uvm_page.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/uvm/uvm_page.c diff -u src/sys/uvm/uvm_page.c:1.203 src/sys/uvm/uvm_page.c:1.204 --- src/sys/uvm/uvm_page.c:1.203 Sun Dec 15 21:11:35 2019 +++ src/sys/uvm/uvm_page.c Mon Dec 16 18:30:18 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_page.c,v 1.203 2019/12/15 21:11:35 ad Exp $ */ +/* $NetBSD: uvm_page.c,v 1.204 2019/12/16 18:30:18 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -66,7 +66,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.203 2019/12/15 21:11:35 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.204 2019/12/16 18:30:18 ad Exp $"); #include "opt_ddb.h" #include "opt_uvm.h" @@ -1123,9 +1123,10 @@ uvm_pagerealloc(struct vm_page *pg, stru */ if (newobj) { - pg->uobject = newobj; - pg->offset = newoff; - uvm_pageinsert(newobj, pg); + /* + * XXX we have no in-tree users of this functionality + */ + panic("uvm_pagerealloc: no impl"); } }
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Dec 16 18:50:45 UTC 2019 Modified Files: src/sys/kern: subr_pcq.c Log Message: pcq_create(): fix broken assertion. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/kern/subr_pcq.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/subr_pcq.c diff -u src/sys/kern/subr_pcq.c:1.10 src/sys/kern/subr_pcq.c:1.11 --- src/sys/kern/subr_pcq.c:1.10 Thu Feb 8 09:05:20 2018 +++ src/sys/kern/subr_pcq.c Mon Dec 16 18:50:44 2019 @@ -1,7 +1,7 @@ -/* $NetBSD: subr_pcq.c,v 1.10 2018/02/08 09:05:20 dholland Exp $ */ +/* $NetBSD: subr_pcq.c,v 1.11 2019/12/16 18:50:44 ad Exp $ */ /*- - * Copyright (c) 2009 The NetBSD Foundation, Inc. + * Copyright (c) 2009, 2019 The NetBSD Foundation, Inc. * All rights reserved. * * This code is derived from software contributed to The NetBSD Foundation @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.10 2018/02/08 09:05:20 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pcq.c,v 1.11 2019/12/16 18:50:44 ad Exp $"); #include #include @@ -201,13 +201,12 @@ pcq_create(size_t nitems, km_flag_t kmfl { pcq_t *pcq; - KASSERT(nitems > 0 || nitems <= PCQ_MAXLEN); + KASSERT(nitems > 0 && nitems <= PCQ_MAXLEN); pcq = kmem_zalloc(offsetof(pcq_t, pcq_items[nitems]), kmflags); - if (pcq == NULL) { - return NULL; + if (pcq != NULL) { + pcq->pcq_nitems = nitems; } - pcq->pcq_nitems = nitems; return pcq; }
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: ad Date: Mon Dec 16 19:17:25 UTC 2019 Modified Files: src/sys/arch/x86/x86: x86_tlb.c Log Message: Align the TLB packet precisely on the stack, and do 7 INVLPG since it's what fits in a single line. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/arch/x86/x86/x86_tlb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/x86_tlb.c diff -u src/sys/arch/x86/x86/x86_tlb.c:1.12 src/sys/arch/x86/x86/x86_tlb.c:1.13 --- src/sys/arch/x86/x86/x86_tlb.c:1.12 Mon Dec 2 20:59:56 2019 +++ src/sys/arch/x86/x86/x86_tlb.c Mon Dec 16 19:17:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_tlb.c,v 1.12 2019/12/02 20:59:56 pgoyette Exp $ */ +/* $NetBSD: x86_tlb.c,v 1.13 2019/12/16 19:17:25 ad Exp $ */ /*- * Copyright (c) 2008-2019 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.12 2019/12/02 20:59:56 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v 1.13 2019/12/16 19:17:25 ad Exp $"); #include #include @@ -66,10 +66,10 @@ __KERNEL_RCSID(0, "$NetBSD: x86_tlb.c,v * until the request is completed. This keeps the cache line in the shared * state, and bus traffic to a minimum. * - * On i386 the packet is 28 bytes in size. On amd64 it's 52 bytes. + * On i386 the packet is 32 bytes in size. On amd64 it's 60 bytes. */ typedef struct { - uintptr_t tp_va[6]; + uintptr_t tp_va[7]; uint8_t tp_count; uint8_t tp_userpmap; uint8_t tp_global; @@ -77,23 +77,14 @@ typedef struct { } pmap_tlb_packet_t; /* - * Padded packet stored on the initiator's stack. - */ -typedef struct { - uint8_t ts_pad1[COHERENCY_UNIT]; - pmap_tlb_packet_t ts_tp; - uint8_t ts_pad2[COHERENCY_UNIT]; -} pmap_tlb_stackbuf_t; - -/* * No more than N separate invlpg. * - * Statistically, a value of six is big enough to cover the requested number + * Statistically, a value of 7 is big enough to cover the requested number * of pages in ~ 95% of the TLB shootdowns we are getting. We therefore rarely * reach the limit, and increasing it can actually reduce the performance due * to the high cost of invlpg. */ -#define TP_MAXVA 6 /* for individual mappings */ +#define TP_MAXVA 7 /* for individual mappings */ #define TP_ALLVA 255 /* special: shoot all mappings */ /* @@ -355,8 +346,8 @@ pmap_tlb_processpacket(volatile pmap_tlb void pmap_tlb_shootnow(void) { - volatile pmap_tlb_packet_t *tp; - volatile pmap_tlb_stackbuf_t ts; + volatile pmap_tlb_packet_t *tp, *ts; + volatile uint8_t stackbuf[128]; struct cpu_info *ci; kcpuset_t *target; u_int local, rcpucount; @@ -405,11 +396,13 @@ pmap_tlb_shootnow(void) * against an interrupt on the current CPU trying the same. */ KASSERT(rcpucount < ncpu); - ts.ts_tp = *tp; - KASSERT(!ts.ts_tp.tp_done); + KASSERT(sizeof(*ts) <= (sizeof(stackbuf) / 2)); + ts = (void *)roundup2((uintptr_t)stackbuf, (sizeof(stackbuf) / 2)); + *ts = *tp; + KASSERT(!ts->tp_done); while (atomic_cas_ptr(&pmap_tlb_packet, NULL, - __UNVOLATILE(&ts.ts_tp)) != NULL) { - KASSERT(pmap_tlb_packet != &ts.ts_tp); + __UNVOLATILE(ts)) != NULL) { + KASSERT(pmap_tlb_packet != ts); /* * Don't bother with exponentional backoff, as the pointer * is in a dedicated cache line and only updated twice per @@ -439,7 +432,7 @@ pmap_tlb_shootnow(void) */ pmap_tlb_pendcount = rcpucount; pmap_tlb_evcnt.ev_count++; - pmap_tlb_processpacket(&ts.ts_tp, target); + pmap_tlb_processpacket(ts, target); /* * Clear out the local CPU's buffer for the next user. Once done, @@ -461,7 +454,7 @@ pmap_tlb_shootnow(void) * perform local shootdown if needed, using our copy of the packet. */ if (local) { - pmap_tlb_invalidate(&ts.ts_tp); + pmap_tlb_invalidate(ts); } /* @@ -470,7 +463,7 @@ pmap_tlb_shootnow(void) * CPU out will update it and only we are reading it). No memory * barrier required due to prior stores - yay x86. */ - while (!ts.ts_tp.tp_done) { + while (!ts->tp_done) { x86_pause(); } }
CVS commit: src/sys/uvm
Module Name:src Committed By: ad Date: Mon Dec 16 19:18:26 UTC 2019 Modified Files: src/sys/uvm: uvm_pdpolicy_clock.c Log Message: Use the high bits of pqflags for PQ_TIME, not low. To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/sys/uvm/uvm_pdpolicy_clock.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/uvm/uvm_pdpolicy_clock.c diff -u src/sys/uvm/uvm_pdpolicy_clock.c:1.18 src/sys/uvm/uvm_pdpolicy_clock.c:1.19 --- src/sys/uvm/uvm_pdpolicy_clock.c:1.18 Fri Dec 13 20:10:22 2019 +++ src/sys/uvm/uvm_pdpolicy_clock.c Mon Dec 16 19:18:26 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_pdpolicy_clock.c,v 1.18 2019/12/13 20:10:22 ad Exp $ */ +/* $NetBSD: uvm_pdpolicy_clock.c,v 1.19 2019/12/16 19:18:26 ad Exp $ */ /* NetBSD: uvm_pdaemon.c,v 1.72 2006/01/05 10:47:33 yamt Exp $ */ /* @@ -69,7 +69,7 @@ #else /* defined(PDSIM) */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.18 2019/12/13 20:10:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy_clock.c,v 1.19 2019/12/16 19:18:26 ad Exp $"); #include #include @@ -83,9 +83,9 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_pdpolicy #endif /* defined(PDSIM) */ -#define PQ_TIME 0x3fff /* time of last activation */ -#define PQ_INACTIVE 0x4000 /* page is in inactive list */ -#define PQ_ACTIVE 0x8000 /* page is in active list */ +#define PQ_TIME 0xfffc /* time of last activation */ +#define PQ_INACTIVE 0x0001 /* page is in inactive list */ +#define PQ_ACTIVE 0x0002 /* page is in active list */ #if !defined(CLOCK_INACTIVEPCT) #define CLOCK_INACTIVEPCT 33 @@ -407,7 +407,7 @@ uvmpdpol_pageactivate(struct vm_page *pg /* Safety: PQ_ACTIVE clear also tells us if it is not enqueued. */ if ((pg->pqflags & PQ_ACTIVE) == 0 || - ((hardclock_ticks & PQ_TIME) - (pg->pqflags & PQ_TIME)) > hz) { + ((hardclock_ticks & PQ_TIME) - (pg->pqflags & PQ_TIME)) >= hz) { mutex_enter(&s->lock); uvmpdpol_pageactivate_locked(pg); mutex_exit(&s->lock);
CVS commit: src/sys/arch/x86/x86
Module Name:src Committed By: ad Date: Mon Dec 16 19:20:45 UTC 2019 Modified Files: src/sys/arch/x86/x86: pmap.c Log Message: pmap_unmap_ptes(): ci_want_pmapload isn't dependant on TLB state. To generate a diff of this commit: cvs rdiff -u -r1.345 -r1.346 src/sys/arch/x86/x86/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/x86/x86/pmap.c diff -u src/sys/arch/x86/x86/pmap.c:1.345 src/sys/arch/x86/x86/pmap.c:1.346 --- src/sys/arch/x86/x86/pmap.c:1.345 Sun Dec 15 20:33:22 2019 +++ src/sys/arch/x86/x86/pmap.c Mon Dec 16 19:20:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.345 2019/12/15 20:33:22 ad Exp $ */ +/* $NetBSD: pmap.c,v 1.346 2019/12/16 19:20:45 ad Exp $ */ /* * Copyright (c) 2008, 2010, 2016, 2017, 2019 The NetBSD Foundation, Inc. @@ -130,7 +130,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.345 2019/12/15 20:33:22 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.346 2019/12/16 19:20:45 ad Exp $"); #include "opt_user_ldt.h" #include "opt_lockdebug.h" @@ -707,13 +707,16 @@ pmap_unmap_ptes(struct pmap *pmap, struc * Mark whatever's on the CPU now as lazy and unlock. * If the pmap was already installed, we are done. */ - if (ci->ci_pmap != mypmap && ci->ci_tlbstate == TLBSTATE_VALID) { - ci->ci_tlbstate = TLBSTATE_LAZY; + if (ci->ci_pmap != mypmap) { ci->ci_want_pmapload = (mypmap != pmap_kernel()); - } else { - /* - * This can happen when undoing after pmap_get_ptp blocked. - */ + if (ci->ci_tlbstate == TLBSTATE_VALID) { + ci->ci_tlbstate = TLBSTATE_LAZY; + } else { + /* + * This can happen when undoing after pmap_get_ptp + * blocked. + */ + } } /* Now safe to free PTPs, with the pmap still locked. */
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Dec 16 19:22:15 UTC 2019 Modified Files: src/sys/kern: kern_turnstile.c Log Message: Just make the turnstile locks statics and avoid the indirect reference since COHERENCY_UNIT does the right thing in !MP. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/kern/kern_turnstile.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_turnstile.c diff -u src/sys/kern/kern_turnstile.c:1.34 src/sys/kern/kern_turnstile.c:1.35 --- src/sys/kern/kern_turnstile.c:1.34 Sun Nov 24 13:14:23 2019 +++ src/sys/kern/kern_turnstile.c Mon Dec 16 19:22:15 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_turnstile.c,v 1.34 2019/11/24 13:14:23 ad Exp $ */ +/* $NetBSD: kern_turnstile.c,v 1.35 2019/12/16 19:22:15 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2009, 2019 The NetBSD Foundation, Inc. @@ -60,7 +60,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.34 2019/11/24 13:14:23 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_turnstile.c,v 1.35 2019/12/16 19:22:15 ad Exp $"); #include #include @@ -78,12 +78,15 @@ __KERNEL_RCSID(0, "$NetBSD: kern_turnsti #define TS_HASH_MASK (TS_HASH_SIZE - 1) #define TS_HASH(obj) (((uintptr_t)(obj) >> 6) & TS_HASH_MASK) -/* Keep the chains and mutex pointers apart to prevent false sharing. */ static tschain_t turnstile_chains[TS_HASH_SIZE] __cacheline_aligned; -static kmutex_t *turnstile_locks[TS_HASH_SIZE] __read_mostly; pool_cache_t turnstile_cache __read_mostly; extern turnstile_t turnstile0; +static union { + kmutex_t lock; + uint8_t pad[COHERENCY_UNIT]; +} turnstile_locks[TS_HASH_SIZE] __cacheline_aligned; + static int turnstile_ctor(void *, void *, int); /* @@ -98,7 +101,7 @@ turnstile_init(void) for (i = 0; i < TS_HASH_SIZE; i++) { LIST_INIT(&turnstile_chains[i]); - turnstile_locks[i] = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SCHED); + mutex_init(&turnstile_locks[i].lock, MUTEX_DEFAULT, IPL_SCHED); } turnstile_cache = pool_cache_init(sizeof(turnstile_t), coherency_unit, @@ -173,7 +176,7 @@ turnstile_lookup(wchan_t obj) hash = TS_HASH(obj); tc = &turnstile_chains[hash]; - mutex_spin_enter(turnstile_locks[hash]); + mutex_spin_enter(&turnstile_locks[hash].lock); LIST_FOREACH(ts, tc, ts_chain) if (ts->ts_obj == obj) @@ -195,7 +198,7 @@ void turnstile_exit(wchan_t obj) { - mutex_spin_exit(turnstile_locks[TS_HASH(obj)]); + mutex_spin_exit(&turnstile_locks[TS_HASH(obj)].lock); } /* @@ -381,7 +384,7 @@ turnstile_block(turnstile_t *ts, int q, hash = TS_HASH(obj); tc = &turnstile_chains[hash]; - lock = turnstile_locks[hash]; + lock = &turnstile_locks[hash].lock; KASSERT(q == TS_READER_Q || q == TS_WRITER_Q); KASSERT(mutex_owned(lock)); @@ -455,7 +458,7 @@ turnstile_wakeup(turnstile_t *ts, int q, lwp_t *l; hash = TS_HASH(ts->ts_obj); - lock = turnstile_locks[hash]; + lock = &turnstile_locks[hash].lock; sq = &ts->ts_sleepq[q]; KASSERT(q == TS_READER_Q || q == TS_WRITER_Q); @@ -539,7 +542,7 @@ turnstile_print(volatile void *obj, void hash = TS_HASH(obj); tc = &turnstile_chains[hash]; - lock = turnstile_locks[hash]; + lock = &turnstile_locks[hash].lock; LIST_FOREACH(ts, tc, ts_chain) if (ts->ts_obj == obj)
CVS commit: src/sys
Module Name:src Committed By: ad Date: Mon Dec 16 19:43:36 UTC 2019 Modified Files: src/sys/kern: kern_sleepq.c src/sys/sys: sleepq.h Log Message: As with turnstiles, don't bother allocating sleepq locks with mutex_obj_alloc(), and avoid the indirect reference. To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.55 src/sys/kern/kern_sleepq.c cvs rdiff -u -r1.26 -r1.27 src/sys/sys/sleepq.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/kern/kern_sleepq.c diff -u src/sys/kern/kern_sleepq.c:1.54 src/sys/kern/kern_sleepq.c:1.55 --- src/sys/kern/kern_sleepq.c:1.54 Fri Dec 6 21:36:10 2019 +++ src/sys/kern/kern_sleepq.c Mon Dec 16 19:43:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_sleepq.c,v 1.54 2019/12/06 21:36:10 ad Exp $ */ +/* $NetBSD: kern_sleepq.c,v 1.55 2019/12/16 19:43:36 ad Exp $ */ /*- * Copyright (c) 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.54 2019/12/06 21:36:10 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_sleepq.c,v 1.55 2019/12/16 19:43:36 ad Exp $"); #include #include @@ -66,7 +66,7 @@ static int sleepq_sigtoerror(lwp_t *, in /* General purpose sleep table, used by mtsleep() and condition variables. */ sleeptab_t sleeptab __cacheline_aligned; -kmutex_t *sleepq_locks[SLEEPTAB_HASH_SIZE] __read_mostly; +sleepqlock_t sleepq_locks[SLEEPTAB_HASH_SIZE] __cacheline_aligned; /* * sleeptab_init: @@ -79,7 +79,7 @@ sleeptab_init(sleeptab_t *st) int i; for (i = 0; i < SLEEPTAB_HASH_SIZE; i++) { - sleepq_locks[i] = mutex_obj_alloc(MUTEX_DEFAULT, IPL_SCHED); + mutex_init(&sleepq_locks[i].lock, MUTEX_DEFAULT, IPL_SCHED); sleepq_init(&st->st_queue[i]); } } Index: src/sys/sys/sleepq.h diff -u src/sys/sys/sleepq.h:1.26 src/sys/sys/sleepq.h:1.27 --- src/sys/sys/sleepq.h:1.26 Thu Nov 21 18:56:55 2019 +++ src/sys/sys/sleepq.h Mon Dec 16 19:43:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: sleepq.h,v 1.26 2019/11/21 18:56:55 ad Exp $ */ +/* $NetBSD: sleepq.h,v 1.27 2019/12/16 19:43:36 ad Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008, 2009, 2019 The NetBSD Foundation, Inc. @@ -38,6 +38,7 @@ #include #include #include +#include /* * Generic sleep queues. @@ -72,6 +73,11 @@ void sleeptab_init(sleeptab_t *); extern sleeptab_t sleeptab; #ifdef _KERNEL +typedef union { + kmutex_t lock; + uint8_t pad[COHERENCY_UNIT]; +} sleepqlock_t; + /* * Return non-zero if it is unsafe to sleep. * @@ -92,13 +98,13 @@ sleepq_dontsleep(lwp_t *l) static __inline sleepq_t * sleeptab_lookup(sleeptab_t *st, wchan_t wchan, kmutex_t **mp) { - extern kmutex_t *sleepq_locks[SLEEPTAB_HASH_SIZE]; + extern sleepqlock_t sleepq_locks[SLEEPTAB_HASH_SIZE]; sleepq_t *sq; u_int hash; hash = SLEEPTAB_HASH(wchan); sq = &st->st_queue[hash]; - *mp = sleepq_locks[hash]; + *mp = &sleepq_locks[hash].lock; mutex_spin_enter(*mp); return sq; } @@ -106,10 +112,10 @@ sleeptab_lookup(sleeptab_t *st, wchan_t static __inline kmutex_t * sleepq_hashlock(wchan_t wchan) { - extern kmutex_t *sleepq_locks[SLEEPTAB_HASH_SIZE]; + extern sleepqlock_t sleepq_locks[SLEEPTAB_HASH_SIZE]; kmutex_t *mp; - mp = sleepq_locks[SLEEPTAB_HASH(wchan)]; + mp = &sleepq_locks[SLEEPTAB_HASH(wchan)].lock; mutex_spin_enter(mp); return mp; }
CVS commit: src/lib/libpthread
Module Name:src Committed By: uwe Date: Mon Dec 16 20:45:40 UTC 2019 Modified Files: src/lib/libpthread: pthread_int.h Log Message: G/c unused rwlock owner macros copy-pasted from the kernel. They were brought along with the rwlock flags but never used and never even adapted to the new home (the struct member name is different here). I looked at adapting and using them, but they don't really help readability that much and there are cases where we need to deal with "fused" owner values anyway and so can't use them. To generate a diff of this commit: cvs rdiff -u -r1.95 -r1.96 src/lib/libpthread/pthread_int.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libpthread/pthread_int.h diff -u src/lib/libpthread/pthread_int.h:1.95 src/lib/libpthread/pthread_int.h:1.96 --- src/lib/libpthread/pthread_int.h:1.95 Tue Mar 5 01:35:52 2019 +++ src/lib/libpthread/pthread_int.h Mon Dec 16 20:45:40 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_int.h,v 1.95 2019/03/05 01:35:52 christos Exp $ */ +/* $NetBSD: pthread_int.h,v 1.96 2019/12/16 20:45:40 uwe Exp $ */ /*- * Copyright (c) 2001, 2002, 2003, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -324,8 +324,5 @@ int pthread__add_specific(pthread_t, pth #define RW_READ_COUNT_SHIFT 4 #define RW_READ_INCR (1 << RW_READ_COUNT_SHIFT) #define RW_THREAD ((uintptr_t)-RW_READ_INCR) -#define RW_OWNER(rw) ((rw)->rw_owner & RW_THREAD) -#define RW_COUNT(rw) ((rw)->rw_owner & RW_THREAD) -#define RW_FLAGS(rw) ((rw)->rw_owner & ~RW_THREAD) #endif /* _LIB_PTHREAD_INT_H */
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Mon Dec 16 20:59:40 UTC 2019 Modified Files: src/sys/kern: kern_synch.c Log Message: kpreempt_disabled(): softint LWPs aren't preemptable. To generate a diff of this commit: cvs rdiff -u -r1.331 -r1.332 src/sys/kern/kern_synch.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_synch.c diff -u src/sys/kern/kern_synch.c:1.331 src/sys/kern/kern_synch.c:1.332 --- src/sys/kern/kern_synch.c:1.331 Sat Dec 7 21:14:36 2019 +++ src/sys/kern/kern_synch.c Mon Dec 16 20:59:39 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_synch.c,v 1.331 2019/12/07 21:14:36 ad Exp $ */ +/* $NetBSD: kern_synch.c,v 1.332 2019/12/16 20:59:39 ad Exp $ */ /*- * Copyright (c) 1999, 2000, 2004, 2006, 2007, 2008, 2009, 2019 @@ -69,7 +69,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.331 2019/12/07 21:14:36 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_synch.c,v 1.332 2019/12/16 20:59:39 ad Exp $"); #include "opt_kstack.h" #include "opt_dtrace.h" @@ -422,7 +422,8 @@ kpreempt_disabled(void) const lwp_t *l = curlwp; return l->l_nopreempt != 0 || l->l_stat == LSZOMB || - (l->l_flag & LW_IDLE) != 0 || cpu_kpreempt_disabled(); + (l->l_flag & LW_IDLE) != 0 || (l->l_pflag & LP_INTR) != 0 || + cpu_kpreempt_disabled(); } /*
CVS commit: src/lib/libpthread
Module Name:src Committed By: uwe Date: Mon Dec 16 22:22:11 UTC 2019 Modified Files: src/lib/libpthread: pthread_rwlock.c Log Message: pthread__rwlock_spin - clarify the test. It's more pedantically correct to check RW_WRITE_LOCKED before obtaining the thread id of the owner. And since there must be an owner annotate the guard NULL check as unlinkely. No functional change intended. Ok ad@. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/lib/libpthread/pthread_rwlock.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/libpthread/pthread_rwlock.c diff -u src/lib/libpthread/pthread_rwlock.c:1.35 src/lib/libpthread/pthread_rwlock.c:1.36 --- src/lib/libpthread/pthread_rwlock.c:1.35 Sun Dec 15 23:13:33 2019 +++ src/lib/libpthread/pthread_rwlock.c Mon Dec 16 22:22:11 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pthread_rwlock.c,v 1.35 2019/12/15 23:13:33 uwe Exp $ */ +/* $NetBSD: pthread_rwlock.c,v 1.36 2019/12/16 22:22:11 uwe Exp $ */ /*- * Copyright (c) 2002, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__RCSID("$NetBSD: pthread_rwlock.c,v 1.35 2019/12/15 23:13:33 uwe Exp $"); +__RCSID("$NetBSD: pthread_rwlock.c,v 1.36 2019/12/16 22:22:11 uwe Exp $"); #include #include @@ -134,12 +134,15 @@ pthread__rwlock_spin(uintptr_t owner) pthread_t thread; unsigned int i; - thread = (pthread_t)(owner & RW_THREAD); - if (thread == NULL || (owner & ~RW_THREAD) != RW_WRITE_LOCKED) + if ((owner & ~RW_THREAD) != RW_WRITE_LOCKED) return 0; - if (thread->pt_lwpctl->lc_curcpu == LWPCTL_CPU_NONE || + + thread = (pthread_t)(owner & RW_THREAD); + if (__predict_false(thread == NULL) || + thread->pt_lwpctl->lc_curcpu == LWPCTL_CPU_NONE || thread->pt_blocking) return 0; + for (i = 128; i != 0; i--) pthread__rwlock_pause(); return 1;
CVS commit: src/sys
Module Name:src Committed By: ad Date: Mon Dec 16 22:47:55 UTC 2019 Modified Files: src/sys/kern: kern_cpu.c kern_fork.c kern_softint.c vfs_vnode.c vfs_vnops.c src/sys/miscfs/procfs: procfs_linux.c src/sys/rump/librump/rumpkern: MAINBUS.ioconf Makefile.rumpkern emul.c intr.c scheduler.c src/sys/sys: cpu_data.h src/sys/uvm: uvm_extern.h uvm_fault.c uvm_fault_i.h uvm_glue.c uvm_meter.c uvm_page.c uvm_pdpolicy_clock.c uvm_pglist.c uvm_stat.c Log Message: - Extend the per-CPU counters matt@ did to include all of the hot counters in UVM, excluding uvmexp.free, which needs special treatment and will be done with a separate commit. Cuts system time for a build by 20-25% on a 48 CPU machine w/DIAGNOSTIC. - Avoid 64-bit integer divide on every fault (for rnd_add_uint32). To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/sys/kern/kern_cpu.c cvs rdiff -u -r1.216 -r1.217 src/sys/kern/kern_fork.c cvs rdiff -u -r1.55 -r1.56 src/sys/kern/kern_softint.c cvs rdiff -u -r1.104 -r1.105 src/sys/kern/vfs_vnode.c cvs rdiff -u -r1.203 -r1.204 src/sys/kern/vfs_vnops.c cvs rdiff -u -r1.76 -r1.77 src/sys/miscfs/procfs/procfs_linux.c cvs rdiff -u -r1.1 -r1.2 src/sys/rump/librump/rumpkern/MAINBUS.ioconf cvs rdiff -u -r1.179 -r1.180 src/sys/rump/librump/rumpkern/Makefile.rumpkern cvs rdiff -u -r1.192 -r1.193 src/sys/rump/librump/rumpkern/emul.c cvs rdiff -u -r1.54 -r1.55 src/sys/rump/librump/rumpkern/intr.c cvs rdiff -u -r1.47 -r1.48 src/sys/rump/librump/rumpkern/scheduler.c cvs rdiff -u -r1.43 -r1.44 src/sys/sys/cpu_data.h cvs rdiff -u -r1.213 -r1.214 src/sys/uvm/uvm_extern.h cvs rdiff -u -r1.212 -r1.213 src/sys/uvm/uvm_fault.c cvs rdiff -u -r1.31 -r1.32 src/sys/uvm/uvm_fault_i.h cvs rdiff -u -r1.170 -r1.171 src/sys/uvm/uvm_glue.c cvs rdiff -u -r1.69 -r1.70 src/sys/uvm/uvm_meter.c cvs rdiff -u -r1.204 -r1.205 src/sys/uvm/uvm_page.c cvs rdiff -u -r1.19 -r1.20 src/sys/uvm/uvm_pdpolicy_clock.c cvs rdiff -u -r1.73 -r1.74 src/sys/uvm/uvm_pglist.c cvs rdiff -u -r1.40 -r1.41 src/sys/uvm/uvm_stat.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_cpu.c diff -u src/sys/kern/kern_cpu.c:1.81 src/sys/kern/kern_cpu.c:1.82 --- src/sys/kern/kern_cpu.c:1.81 Wed Dec 4 09:34:13 2019 +++ src/sys/kern/kern_cpu.c Mon Dec 16 22:47:54 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.81 2019/12/04 09:34:13 wiz Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.82 2019/12/16 22:47:54 ad Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc. @@ -56,9 +56,11 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.81 2019/12/04 09:34:13 wiz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.82 2019/12/16 22:47:54 ad Exp $"); +#ifdef _KERNEL_OPT #include "opt_cpu_ucode.h" +#endif #include #include @@ -120,6 +122,7 @@ int ncpu __read_mostly; int ncpuonline __read_mostly; bool mp_online __read_mostly; static bool cpu_topology_present __read_mostly; +int64_t cpu_counts[CPU_COUNT_MAX]; /* An array of CPUs. There are ncpu entries. */ struct cpu_info **cpu_infos __read_mostly; @@ -305,6 +308,7 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void return error; } +#ifndef _RUMPKERNEL struct cpu_info * cpu_lookup(u_int idx) { @@ -327,6 +331,7 @@ cpu_lookup(u_int idx) return ci; } +#endif static void cpu_xc_offline(struct cpu_info *ci, void *unused) @@ -830,3 +835,86 @@ err0: return error; } #endif + +/* + * Adjust one count, for a counter that's NOT updated from interrupt + * context. Hardly worth making an inline due to preemption stuff. + */ +void +cpu_count(enum cpu_count idx, int64_t delta) +{ + lwp_t *l = curlwp; + KPREEMPT_DISABLE(l); + l->l_cpu->ci_counts[idx] += delta; + KPREEMPT_ENABLE(l); +} + +/* + * Fetch fresh sum total for all counts. Expensive - don't call often. + */ +void +cpu_count_sync_all(void) +{ + CPU_INFO_ITERATOR cii; + struct cpu_info *ci; + int64_t sum[CPU_COUNT_MAX], *ptr; + enum cpu_count i; + int s; + + KASSERT(sizeof(ci->ci_counts) == sizeof(cpu_counts)); + + if (__predict_true(mp_online)) { + memset(sum, 0, sizeof(sum)); + /* + * We want this to be reasonably quick, so any value we get + * isn't totally out of whack, so don't let the current LWP + * get preempted. + */ + s = splvm(); + curcpu()->ci_counts[CPU_COUNT_SYNC_ALL]++; + for (CPU_INFO_FOREACH(cii, ci)) { + ptr = ci->ci_counts; + for (i = 0; i < CPU_COUNT_MAX; i += 8) { +sum[i+0] += ptr[i+0]; +sum[i+1] += ptr[i+1]; +sum[i+2] += ptr[i+2]; +sum[i+3] += ptr[i+3]; +sum[i+4] += ptr[i+4]; +sum[i+5] += ptr[i+5]; +sum[i+6] += ptr[i+6]; +sum[i+7] += ptr[i+7]; + } + KASSERT(i == CPU_COUNT_MAX); + } + memcpy(cpu_counts, sum, sizeof(cpu_counts)); + splx(s); + } else { + memcpy(cpu_counts, curcpu()->ci_counts, sizeof(cpu_counts)); + } +} +
CVS commit: src/sys/sys
Module Name:src Committed By: ad Date: Mon Dec 16 22:48:25 UTC 2019 Modified Files: src/sys/sys: param.h Log Message: NetBSD 9.99.26 - UVM counter changes To generate a diff of this commit: cvs rdiff -u -r1.626 -r1.627 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.626 src/sys/sys/param.h:1.627 --- src/sys/sys/param.h:1.626 Sun Dec 15 21:12:40 2019 +++ src/sys/sys/param.h Mon Dec 16 22:48:25 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: param.h,v 1.626 2019/12/15 21:12:40 ad Exp $ */ +/* $NetBSD: param.h,v 1.627 2019/12/16 22:48:25 ad Exp $ */ /*- * Copyright (c) 1982, 1986, 1989, 1993 @@ -67,7 +67,7 @@ * 2.99.9 (299000900) */ -#define __NetBSD_Version__ 999002500 /* NetBSD 9.99.25 */ +#define __NetBSD_Version__ 999002600 /* NetBSD 9.99.26 */ #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \ (m) * 100) + (p) * 100) <= __NetBSD_Version__)
CVS commit: src/usr.bin/mail
Module Name:src Committed By: christos Date: Mon Dec 16 22:55:45 UTC 2019 Modified Files: src/usr.bin/mail: complete.c Log Message: revert previous, don't specialcase NUL string. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/mail/complete.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/mail/complete.c diff -u src/usr.bin/mail/complete.c:1.22 src/usr.bin/mail/complete.c:1.23 --- src/usr.bin/mail/complete.c:1.22 Sat Dec 14 23:17:38 2019 +++ src/usr.bin/mail/complete.c Mon Dec 16 17:55:45 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: complete.c,v 1.22 2019/12/15 04:17:38 christos Exp $ */ +/* $NetBSD: complete.c,v 1.23 2019/12/16 22:55:45 christos Exp $ */ /*- * Copyright (c) 1997-2000,2005,2006 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: complete.c,v 1.22 2019/12/15 04:17:38 christos Exp $"); +__RCSID("$NetBSD: complete.c,v 1.23 2019/12/16 22:55:45 christos Exp $"); #endif /* not lint */ /* @@ -339,8 +339,7 @@ complete_filename(EditLine *el, char *wo size_t len; if ((fname = strrchr(word, '/')) == NULL) { - if (word[0] == '+' && (mf = value(ENAME_FOLDER)) != NULL && *mf) - { + if (word[0] == '+' && (mf = value(ENAME_FOLDER)) != NULL) { if (mf[0] == '/') { (void)estrlcpy(dir, mf, sizeof(dir)); } else {
CVS commit: src/crypto/external/bsd/heimdal/bin/krb5-config
Module Name:src Committed By: christos Date: Tue Dec 17 00:16:26 UTC 2019 Modified Files: src/crypto/external/bsd/heimdal/bin/krb5-config: Makefile Log Message: PR/54773: David Shao: krb5-config.in needs to be evaluated by the shell now in order to work. Perhaps it is better to keep a local modified copy that does not need this treatment... To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 \ src/crypto/external/bsd/heimdal/bin/krb5-config/Makefile 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/heimdal/bin/krb5-config/Makefile diff -u src/crypto/external/bsd/heimdal/bin/krb5-config/Makefile:1.3 src/crypto/external/bsd/heimdal/bin/krb5-config/Makefile:1.4 --- src/crypto/external/bsd/heimdal/bin/krb5-config/Makefile:1.3 Thu Apr 24 09:50:53 2014 +++ src/crypto/external/bsd/heimdal/bin/krb5-config/Makefile Mon Dec 16 19:16:26 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2014/04/24 13:50:53 pettai Exp $ +# $NetBSD: Makefile,v 1.4 2019/12/17 00:16:26 christos Exp $ .include .include <${.CURDIR}/../../Makefile.inc> @@ -11,8 +11,9 @@ MAN= krb5-config.1 CLEANFILES+= krb5-config krb5-config: krb5-config.in - ${TOOL_SED} -e "s!@PACKAGE\@!heimdal!g" \ - -e "s!@VERSION\@!1.5.3!g" \ + ${TOOL_SED} \ + -e "s!@PACKAGE\@!heimdal!g" \ + -e "s!@VERSION\@!${VERSION}!g" \ -e "s!@prefix\@!/!g" \ -e "s!@exec_prefix\@!/!g" \ -e "s!@libdir\@!/usr/lib!g" \ @@ -26,7 +27,7 @@ krb5-config: krb5-config.in -e "s!@LIB_pkinit\@!-lhx509!g" \ -e "s!@PTHREAD_LIBADD\@!!g" \ -e "s!@LIBS\@!!g" \ - ${HEIMDIST}/tools/krb5-config.in > $@ + ${HEIMDIST}/tools/krb5-config.in | sh > $@ chmod +x $@ .include
CVS commit: src/crypto/external/bsd/heimdal
Module Name:src Committed By: christos Date: Tue Dec 17 00:17:00 UTC 2019 Modified Files: src/crypto/external/bsd/heimdal: Makefile.inc Log Message: Find and set a version to a make(1) variable. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/crypto/external/bsd/heimdal/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/crypto/external/bsd/heimdal/Makefile.inc diff -u src/crypto/external/bsd/heimdal/Makefile.inc:1.4 src/crypto/external/bsd/heimdal/Makefile.inc:1.5 --- src/crypto/external/bsd/heimdal/Makefile.inc:1.4 Sat Feb 3 22:19:51 2018 +++ src/crypto/external/bsd/heimdal/Makefile.inc Mon Dec 16 19:17:00 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.4 2018/02/04 03:19:51 christos Exp $ +# $NetBSD: Makefile.inc,v 1.5 2019/12/17 00:17:00 christos Exp $ HEIMBASE?= ${NETBSDSRCDIR}/crypto/external/bsd/heimdal HEIMDIST= ${HEIMBASE}/dist @@ -16,6 +16,8 @@ LIBIPC_PIC= ${LIBIPCDIR}/libipc.a LIBIPC_PIC= ${LIBIPCDIR}/libipc_pic.a .endif +VERSION!= ${TOOL_SED} -ne 's/.*PACKAGE_VERSION[ ]*"\([0-9.]*\)"/\1/p' ${.PARSEDIR}/include/config.h + .if ${USETOOLS} != "yes" COMPILEETOBJ!= cd ${HEIMBASE}/lib/libcom_err/compile_et && ${PRINTOBJDIR} TOOL_COMPILE_ET= ${COMPILEETOBJ}/compile_et
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Tue Dec 17 00:33:47 UTC 2019 Modified Files: src/sys/kern: kern_cpu.c Log Message: Hopefully unbreak the build - now that this is included in rump. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/sys/kern/kern_cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.82 src/sys/kern/kern_cpu.c:1.83 --- src/sys/kern/kern_cpu.c:1.82 Mon Dec 16 22:47:54 2019 +++ src/sys/kern/kern_cpu.c Tue Dec 17 00:33:47 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.82 2019/12/16 22:47:54 ad Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.83 2019/12/17 00:33:47 ad Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.82 2019/12/16 22:47:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.83 2019/12/17 00:33:47 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_cpu_ucode.h" @@ -97,8 +97,10 @@ CTASSERT(offsetof(struct cpu_info, ci_da CTASSERT(offsetof(struct cpu_info, ci_data) != 0); #endif +#ifndef _RUMPKERNEL /* XXX temporary */ static void cpu_xc_online(struct cpu_info *, void *); static void cpu_xc_offline(struct cpu_info *, void *); +#endif /* ifndef _RUMPKERNEL XXX */ dev_type_ioctl(cpuctl_ioctl); @@ -151,6 +153,7 @@ mi_cpu_init(void) kcpuset_set(kcpuset_running, 0); } +#ifndef _RUMPKERNEL /* XXX temporary */ int mi_cpu_attach(struct cpu_info *ci) { @@ -308,7 +311,6 @@ cpuctl_ioctl(dev_t dev, u_long cmd, void return error; } -#ifndef _RUMPKERNEL struct cpu_info * cpu_lookup(u_int idx) { @@ -331,7 +333,6 @@ cpu_lookup(u_int idx) return ci; } -#endif static void cpu_xc_offline(struct cpu_info *ci, void *unused) @@ -474,6 +475,7 @@ cpu_setstate(struct cpu_info *ci, bool o spc->spc_lastmod = time_second; return 0; } +#endif /* ifndef _RUMPKERNEL XXX */ int cpu_setmodel(const char *fmt, ...)
CVS commit: src/sys
Module Name:src Committed By: ad Date: Tue Dec 17 00:51:28 UTC 2019 Modified Files: src/sys/kern: kern_cpu.c src/sys/rump/librump/rumpkern: MAINBUS.ioconf Log Message: Rump is living up to its name To generate a diff of this commit: cvs rdiff -u -r1.83 -r1.84 src/sys/kern/kern_cpu.c cvs rdiff -u -r1.2 -r1.3 src/sys/rump/librump/rumpkern/MAINBUS.ioconf 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_cpu.c diff -u src/sys/kern/kern_cpu.c:1.83 src/sys/kern/kern_cpu.c:1.84 --- src/sys/kern/kern_cpu.c:1.83 Tue Dec 17 00:33:47 2019 +++ src/sys/kern/kern_cpu.c Tue Dec 17 00:51:28 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.83 2019/12/17 00:33:47 ad Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.84 2019/12/17 00:51:28 ad Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.83 2019/12/17 00:33:47 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.84 2019/12/17 00:51:28 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_cpu_ucode.h" @@ -100,7 +100,6 @@ CTASSERT(offsetof(struct cpu_info, ci_da #ifndef _RUMPKERNEL /* XXX temporary */ static void cpu_xc_online(struct cpu_info *, void *); static void cpu_xc_offline(struct cpu_info *, void *); -#endif /* ifndef _RUMPKERNEL XXX */ dev_type_ioctl(cpuctl_ioctl); @@ -118,6 +117,7 @@ const struct cdevsw cpuctl_cdevsw = { .d_discard = nodiscard, .d_flag = D_OTHER | D_MPSAFE }; +#endif /* ifndef _RUMPKERNEL XXX */ kmutex_t cpu_lock __cacheline_aligned; int ncpu __read_mostly; Index: src/sys/rump/librump/rumpkern/MAINBUS.ioconf diff -u src/sys/rump/librump/rumpkern/MAINBUS.ioconf:1.2 src/sys/rump/librump/rumpkern/MAINBUS.ioconf:1.3 --- src/sys/rump/librump/rumpkern/MAINBUS.ioconf:1.2 Mon Dec 16 22:47:55 2019 +++ src/sys/rump/librump/rumpkern/MAINBUS.ioconf Tue Dec 17 00:51:28 2019 @@ -4,6 +4,3 @@ include "conf/files" include "rump/dev/files.rump" mainbus0 at root - -pseudo-device cpuctl -
CVS commit: src/sys/kern
Module Name:src Committed By: ad Date: Tue Dec 17 00:59:14 UTC 2019 Modified Files: src/sys/kern: kern_cpu.c Log Message: More rump-ing. I will split this into two files during the week. To generate a diff of this commit: cvs rdiff -u -r1.84 -r1.85 src/sys/kern/kern_cpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/kern_cpu.c diff -u src/sys/kern/kern_cpu.c:1.84 src/sys/kern/kern_cpu.c:1.85 --- src/sys/kern/kern_cpu.c:1.84 Tue Dec 17 00:51:28 2019 +++ src/sys/kern/kern_cpu.c Tue Dec 17 00:59:14 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_cpu.c,v 1.84 2019/12/17 00:51:28 ad Exp $ */ +/* $NetBSD: kern_cpu.c,v 1.85 2019/12/17 00:59:14 ad Exp $ */ /*- * Copyright (c) 2007, 2008, 2009, 2010, 2012, 2019 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.84 2019/12/17 00:51:28 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_cpu.c,v 1.85 2019/12/17 00:59:14 ad Exp $"); #ifdef _KERNEL_OPT #include "opt_cpu_ucode.h" @@ -495,7 +495,7 @@ cpu_getmodel(void) return cpu_model; } -#ifdef __HAVE_INTR_CONTROL +#if defined(__HAVE_INTR_CONTROL) && !defined(_RUMPKERNEL) /* XXX */ static void cpu_xc_intr(struct cpu_info *ci, void *unused) {
CVS commit: src/sys/arch/i386/stand
Module Name:src Committed By: manu Date: Tue Dec 17 01:37:53 UTC 2019 Modified Files: src/sys/arch/i386/stand/efiboot: efidisk.c src/sys/arch/i386/stand/lib: biosdisk.c Log Message: Do not use NAME=label syntax when label are empty When booting sysinst from UEFI, it defaults to a GPT installation where partition have no labels. Bootstrap used the NAME=label partition anyway, with the result that both EFI and FFS root partition had the same name "NAME=" and could not be distinguished. The first matching partition for the name was used, and bootstrap looked for the kernel in the EFI partition. We fix that by not using NAME=label names for partition when label is empty. In that case we revert to old syntax such as hd0b To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/efidisk.c cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/biosdisk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/i386/stand/efiboot/efidisk.c diff -u src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 src/sys/arch/i386/stand/efiboot/efidisk.c:1.9 --- src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 Sun Aug 18 02:18:24 2019 +++ src/sys/arch/i386/stand/efiboot/efidisk.c Tue Dec 17 01:37:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: efidisk.c,v 1.8 2019/08/18 02:18:24 manu Exp $ */ +/* $NetBSD: efidisk.c,v 1.9 2019/12/17 01:37:52 manu Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka @@ -253,7 +253,7 @@ efi_disk_show(void) printf(" "); first = false; } - if (part[i].part_name != NULL) + if (part[i].part_name && part[i].part_name[0]) printf(" NAME=%s(", part[i].part_name); else printf(" hd%d%c(", edi->dev & 0x7f, i + 'a'); @@ -308,7 +308,7 @@ efi_disk_show(void) printf(" "); first = 0; } - if (part[j].part_name != NULL) + if (part[j].part_name && part[j].part_name[0]) printf(" NAME=%s(", part[j].part_name); else printf(" raid%d%c(", Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.53 src/sys/arch/i386/stand/lib/biosdisk.c:1.54 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.53 Tue Dec 10 02:02:47 2019 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 17 01:37:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.53 2019/12/10 02:02:47 manu Exp $ */ +/* $NetBSD: biosdisk.c,v 1.54 2019/12/17 01:37:53 manu Exp $ */ /* * Copyright (c) 1996, 1998 @@ -908,7 +908,8 @@ biosdisk_probe(void) first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -987,7 +988,8 @@ next_disk: first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -1095,7 +1097,9 @@ biosdisk_findpartition(int biosdev, dadd *partition = boot_part; #ifndef NO_GPT - if (part_name && d->part[boot_part].part_name) { + if (part_name && + d->part[boot_part].part_name && + d->part[boot_part].part_name[0]) { strlcpy(namebuf, d->part[boot_part].part_name, BIOSDISK_PART_NAME_LEN); *part_name = namebuf;
CVS import: src/external/bsd/file/dist
Module Name:src Committed By: christos Date: Tue Dec 17 02:23:56 UTC 2019 Update of /cvsroot/src/external/bsd/file/dist In directory ivanova.netbsd.org:/tmp/cvs-serv27671 Log Message: Import 5.38: - Always accept -S (no sandbox) even if we don't support sandboxing - More syscalls elided for sandboxiing - For ELF dynamic means having an interpreter not just PT_DYNAMIC - Check for large ELF session header offset - When saving and restoring a locale, keep the locale name in our own storage. - Add a flag to disable CSV file detection. - Don't pass NULL/0 to memset to appease sanitizers. - Avoid spurious prints when looks for extensions or apple strings in fsmagic. - Add builtin decompressors for xz and and bzip. - Add a limit for the number of CDF elements. - More checks for overflow in CDF. Status: Vendor Tag: CHRISTOS Release Tags: FILE5_38 C src/external/bsd/file/dist/depcomp U src/external/bsd/file/dist/Makefile.am C src/external/bsd/file/dist/configure U src/external/bsd/file/dist/acinclude.m4 C src/external/bsd/file/dist/configure.ac C src/external/bsd/file/dist/aclocal.m4 C src/external/bsd/file/dist/Makefile.in C src/external/bsd/file/dist/config.h.in U src/external/bsd/file/dist/AUTHORS U src/external/bsd/file/dist/COPYING C src/external/bsd/file/dist/ChangeLog U src/external/bsd/file/dist/INSTALL U src/external/bsd/file/dist/NEWS U src/external/bsd/file/dist/README U src/external/bsd/file/dist/TODO C src/external/bsd/file/dist/compile C src/external/bsd/file/dist/config.guess C src/external/bsd/file/dist/config.sub U src/external/bsd/file/dist/install-sh U src/external/bsd/file/dist/ltmain.sh C src/external/bsd/file/dist/missing U src/external/bsd/file/dist/MAINT U src/external/bsd/file/dist/m4/lt~obsolete.m4 U src/external/bsd/file/dist/m4/libtool.m4 U src/external/bsd/file/dist/m4/ltoptions.m4 U src/external/bsd/file/dist/m4/ltsugar.m4 U src/external/bsd/file/dist/m4/ltversion.m4 U src/external/bsd/file/dist/src/fmtcheck.c U src/external/bsd/file/dist/src/Makefile.am C src/external/bsd/file/dist/src/Makefile.in U src/external/bsd/file/dist/src/asctime_r.c U src/external/bsd/file/dist/src/asprintf.c U src/external/bsd/file/dist/src/ctime_r.c U src/external/bsd/file/dist/src/dprintf.c U src/external/bsd/file/dist/src/getline.c U src/external/bsd/file/dist/src/getopt_long.c U src/external/bsd/file/dist/src/mygetopt.h U src/external/bsd/file/dist/src/gmtime_r.c U src/external/bsd/file/dist/src/localtime_r.c U src/external/bsd/file/dist/src/pread.c U src/external/bsd/file/dist/src/strcasestr.c U src/external/bsd/file/dist/src/strlcat.c U src/external/bsd/file/dist/src/strlcpy.c U src/external/bsd/file/dist/src/vasprintf.c U src/external/bsd/file/dist/src/buffer.c U src/external/bsd/file/dist/src/magic.c C src/external/bsd/file/dist/src/apprentice.c U src/external/bsd/file/dist/src/softmagic.c U src/external/bsd/file/dist/src/ascmagic.c C src/external/bsd/file/dist/src/encoding.c C src/external/bsd/file/dist/src/compress.c N src/external/bsd/file/dist/src/is_csv.c U src/external/bsd/file/dist/src/is_json.c U src/external/bsd/file/dist/src/is_tar.c C src/external/bsd/file/dist/src/readelf.c U src/external/bsd/file/dist/src/print.c C src/external/bsd/file/dist/src/fsmagic.c C src/external/bsd/file/dist/src/funcs.c C src/external/bsd/file/dist/src/file.h U src/external/bsd/file/dist/src/readelf.h U src/external/bsd/file/dist/src/tar.h U src/external/bsd/file/dist/src/apptype.c U src/external/bsd/file/dist/src/der.c U src/external/bsd/file/dist/src/der.h U src/external/bsd/file/dist/src/file_opts.h U src/external/bsd/file/dist/src/elfclass.h C src/external/bsd/file/dist/src/cdf.c U src/external/bsd/file/dist/src/cdf_time.c C src/external/bsd/file/dist/src/readcdf.c U src/external/bsd/file/dist/src/cdf.h C src/external/bsd/file/dist/src/file.c U src/external/bsd/file/dist/src/seccomp.c U src/external/bsd/file/dist/src/magic.h.in C src/external/bsd/file/dist/magic/Makefile.am C src/external/bsd/file/dist/magic/Makefile.in U src/external/bsd/file/dist/magic/Header U src/external/bsd/file/dist/magic/Localstuff U src/external/bsd/file/dist/magic/magdir/adventure U src/external/bsd/file/dist/magic/magdir/acorn U src/external/bsd/file/dist/magic/magdir/adi U src/external/bsd/file/dist/magic/magdir/application U src/external/bsd/file/dist/magic/magdir/algol68 U src/external/bsd/file/dist/magic/magdir/allegro U src/external/bsd/file/dist/magic/magdir/alliant U src/external/bsd/file/dist/magic/magdir/amanda U src/external/bsd/file/dist/magic/magdir/amigaos U src/external/bsd/file/dist/magic/magdir/android U src/external/bsd/file/dist/magic/magdir/animation U src/external/bsd/file/dist/magic/magdir/aout U src/external/bsd/file/dist/magic/magdir/apache U src/external/bsd/file/dist/magic/magdir/apl C src/external/bsd/file/dist/magic/magdir/apple U src/external/bsd/file/dis
CVS commit: src/doc
Module Name:src Committed By: christos Date: Tue Dec 17 02:32:26 UTC 2019 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: new file(1) To generate a diff of this commit: cvs rdiff -u -r1.1677 -r1.1678 src/doc/3RDPARTY cvs rdiff -u -r1.2623 -r1.2624 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.1677 src/doc/3RDPARTY:1.1678 --- src/doc/3RDPARTY:1.1677 Sun Dec 15 17:57:26 2019 +++ src/doc/3RDPARTY Mon Dec 16 21:32:26 2019 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1677 2019/12/15 22:57:26 christos Exp $ +# $NetBSD: 3RDPARTY,v 1.1678 2019/12/17 02:32:26 christos Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -396,12 +396,12 @@ Notes: Please use "expat" as the vendor tag for CVS imports. Package: file -Version: 5.37 -Current Vers: 5.37 +Version: 5.38 +Current Vers: 5.38 Maintainer: Christos Zoulas Archive Site: ftp://ftp.astron.com/pub/file/ Home Page: http://www.darwinsys.com/file/ -Date: 2019-05-22 +Date: 2019-12-16 Mailing List: f...@astron.com Responsible: christos, pooka License: BSD (2-clause) Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.2623 src/doc/CHANGES:1.2624 --- src/doc/CHANGES:1.2623 Sun Dec 15 17:57:26 2019 +++ src/doc/CHANGES Mon Dec 16 21:32:26 2019 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2623 $> +# LIST OF CHANGES FROM LAST RELEASE: <$Revision: 1.2624 $> # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -82,3 +82,4 @@ Changes from NetBSD 9.0 to NetBSD 10.0: unbound(8): Import 1.9.6. [christos 20191215] openpam(3): update to 20190224 (tabebuia) [christos 20191215] kerberos(8): Update to Heimdal-7.7.0 [christos 20191215] + file(1): Upgraded to 5.38. [christos 20191216]
CVS commit: src/sys
Module Name:src Committed By: christos Date: Tue Dec 17 04:54:37 UTC 2019 Modified Files: src/sys/dev/ic: ath.c src/sys/dev/usb: if_umb.c src/sys/net: if.c Log Message: Protect network ioctls from non-authorized users. (Ilja Van Sprundel) To generate a diff of this commit: cvs rdiff -u -r1.128 -r1.129 src/sys/dev/ic/ath.c cvs rdiff -u -r1.9 -r1.10 src/sys/dev/usb/if_umb.c cvs rdiff -u -r1.465 -r1.466 src/sys/net/if.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/ath.c diff -u src/sys/dev/ic/ath.c:1.128 src/sys/dev/ic/ath.c:1.129 --- src/sys/dev/ic/ath.c:1.128 Sun Nov 10 16:16:35 2019 +++ src/sys/dev/ic/ath.c Mon Dec 16 23:54:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ath.c,v 1.128 2019/11/10 21:16:35 chs Exp $ */ +/* $NetBSD: ath.c,v 1.129 2019/12/17 04:54:36 christos Exp $ */ /*- * Copyright (c) 2002-2005 Sam Leffler, Errno Consulting @@ -41,7 +41,7 @@ __FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.104 2005/09/16 10:09:23 ru Exp $"); #endif #ifdef __NetBSD__ -__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.128 2019/11/10 21:16:35 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.129 2019/12/17 04:54:36 christos Exp $"); #endif /* @@ -69,6 +69,7 @@ __KERNEL_RCSID(0, "$NetBSD: ath.c,v 1.12 #include #include #include +#include #include #include @@ -5422,6 +5423,12 @@ ath_ioctl(struct ifnet *ifp, u_long cmd, return copyout(&sc->sc_stats, ifr->ifr_data, sizeof (sc->sc_stats)); case SIOCGATHDIAG: + error = kauth_authorize_network(curlwp->l_cred, + KAUTH_NETWORK_INTERFACE, + KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd), + NULL); + if (error) + break; error = ath_ioctl_diag(sc, (struct ath_diag *) ifr); break; default: Index: src/sys/dev/usb/if_umb.c diff -u src/sys/dev/usb/if_umb.c:1.9 src/sys/dev/usb/if_umb.c:1.10 --- src/sys/dev/usb/if_umb.c:1.9 Wed Jun 26 18:58:58 2019 +++ src/sys/dev/usb/if_umb.c Mon Dec 16 23:54:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if_umb.c,v 1.9 2019/06/26 22:58:58 khorben Exp $ */ +/* $NetBSD: if_umb.c,v 1.10 2019/12/17 04:54:36 christos Exp $ */ /* $OpenBSD: if_umb.c,v 1.20 2018/09/10 17:00:45 gerhard Exp $ */ /* @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.9 2019/06/26 22:58:58 khorben Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_umb.c,v 1.10 2019/12/17 04:54:36 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -779,6 +779,12 @@ umb_ioctl(struct ifnet *ifp, u_long cmd, usb_add_task(sc->sc_udev, &sc->sc_umb_task, USB_TASKQ_DRIVER); break; case SIOCGUMBINFO: + error = kauth_authorize_network(curlwp->l_cred, + KAUTH_NETWORK_INTERFACE, + KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd), + NULL); + if (error) + break; error = copyout(&sc->sc_info, ifr->ifr_data, sizeof(sc->sc_info)); break; Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.465 src/sys/net/if.c:1.466 --- src/sys/net/if.c:1.465 Thu Nov 14 11:23:53 2019 +++ src/sys/net/if.c Mon Dec 16 23:54:36 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.465 2019/11/14 16:23:53 maxv Exp $ */ +/* $NetBSD: if.c,v 1.466 2019/12/17 04:54:36 christos Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.465 2019/11/14 16:23:53 maxv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.466 2019/12/17 04:54:36 christos Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -2971,6 +2971,8 @@ ifioctl_common(struct ifnet *ifp, u_long struct ifcapreq *ifcr; struct ifdatareq *ifdr; unsigned short flags; + char *descr; + int error; switch (cmd) { case SIOCSIFCAP: @@ -3125,55 +3127,53 @@ ifioctl_common(struct ifnet *ifp, u_long #endif return ENETRESET; case SIOCSIFDESCR: - { - char *descrbuf; + error = kauth_authorize_network(curlwp->l_cred, + KAUTH_NETWORK_INTERFACE, + KAUTH_REQ_NETWORK_INTERFACE_SETPRIV, ifp, KAUTH_ARG(cmd), + NULL); + if (error) + return error; - ifr = data; + ifr = data; - if (ifr->ifr_buflen > IFDESCRSIZE) -return ENAMETOOLONG; + if (ifr->ifr_buflen > IFDESCRSIZE) + return ENAMETOOLONG; - if (ifr->ifr_buf == NULL || ifr->ifr_buflen == 0) { -/* unset description */ -descrbuf = NULL; - } else { -int error; - - descrbuf = kmem_zalloc(IFDESCRSIZE, KM_SLEEP); -/* copy (IFDESCRSIZE - 1) bytes to ensure terminating nul */ -error = copyin(ifr->ifr_buf, descrbuf, IFDESCRSIZE - 1); -if (error) { - kmem_free(descrbuf, IFDESCRSIZE); - return error; -} + if (ifr->ifr_buf == NULL || ifr->ifr_buflen == 0) { + /* unset description */ + descr = NULL; + } else { + descr = kmem_zalloc(IFDESCRSIZE, KM_SLEEP); + /* + * copy (IFDESCRSIZE - 1) bytes to ensure + * terminating nul + */ + error = copyin(ifr->ifr_buf, descr, IFDES
CVS commit: src/sys/dev/pci/ixgbe
Module Name:src Committed By: msaitoh Date: Tue Dec 17 05:49:01 UTC 2019 Modified Files: src/sys/dev/pci/ixgbe: ixgbe.c ixgbe_osdep.c ixgbe_osdep.h ixv.c Log Message: Use bus_space_barrier() instead of x86 specific *fence instruction. Written by riastradh@. To generate a diff of this commit: cvs rdiff -u -r1.216 -r1.217 src/sys/dev/pci/ixgbe/ixgbe.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/ixgbe/ixgbe_osdep.c cvs rdiff -u -r1.24 -r1.25 src/sys/dev/pci/ixgbe/ixgbe_osdep.h cvs rdiff -u -r1.142 -r1.143 src/sys/dev/pci/ixgbe/ixv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/ixgbe/ixgbe.c diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.216 src/sys/dev/pci/ixgbe/ixgbe.c:1.217 --- src/sys/dev/pci/ixgbe/ixgbe.c:1.216 Mon Nov 18 03:17:51 2019 +++ src/sys/dev/pci/ixgbe/ixgbe.c Tue Dec 17 05:49:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe.c,v 1.216 2019/11/18 03:17:51 msaitoh Exp $ */ +/* $NetBSD: ixgbe.c,v 1.217 2019/12/17 05:49:01 msaitoh Exp $ */ /** @@ -4016,7 +4016,7 @@ ixgbe_init_locked(struct adapter *adapte else msec_delay(1); } - wmb(); + IXGBE_WRITE_BARRIER(hw); /* * In netmap mode, we must preserve the buffers made Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.c diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.5 src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.6 --- src/sys/dev/pci/ixgbe/ixgbe_osdep.c:1.5 Mon Dec 16 02:50:54 2019 +++ src/sys/dev/pci/ixgbe/ixgbe_osdep.c Tue Dec 17 05:49:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_osdep.c,v 1.5 2019/12/16 02:50:54 msaitoh Exp $ */ +/* $NetBSD: ixgbe_osdep.c,v 1.6 2019/12/17 05:49:01 msaitoh Exp $ */ /** @@ -116,3 +116,12 @@ ixgbe_write_reg_array(struct ixgbe_hw *h ((struct adapter *)hw->back)->osdep.mem_bus_space_handle, reg + (offset << 2), val); } + +inline void +ixgbe_write_barrier(struct ixgbe_hw *hw) +{ + bus_space_barrier(((struct adapter *)hw->back)->osdep.mem_bus_space_tag, + ((struct adapter *)hw->back)->osdep.mem_bus_space_handle, + 0, ((struct adapter *)hw->back)->osdep.mem_size, + BUS_SPACE_BARRIER_WRITE); +} Index: src/sys/dev/pci/ixgbe/ixgbe_osdep.h diff -u src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.24 src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.25 --- src/sys/dev/pci/ixgbe/ixgbe_osdep.h:1.24 Mon Dec 16 02:50:54 2019 +++ src/sys/dev/pci/ixgbe/ixgbe_osdep.h Tue Dec 17 05:49:01 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: ixgbe_osdep.h,v 1.24 2019/12/16 02:50:54 msaitoh Exp $ */ +/* $NetBSD: ixgbe_osdep.h,v 1.25 2019/12/17 05:49:01 msaitoh Exp $ */ /** SPDX-License-Identifier: BSD-3-Clause @@ -157,18 +157,6 @@ typedef uint64_t u64; /* This device driver's max interrupt numbers. */ #define IXG_MAX_NINTR 64 -#if __FreeBSD_version < 80 -#if defined(__i386__) || defined(__amd64__) -#define mb() __asm volatile("mfence" ::: "memory") -#define wmb() __asm volatile("sfence" ::: "memory") -#define rmb() __asm volatile("lfence" ::: "memory") -#else -#define mb() -#define rmb() -#define wmb() -#endif -#endif - #if defined(__i386__) || defined(__amd64__) static __inline void prefetch(void *x) @@ -241,4 +229,8 @@ extern void ixgbe_write_reg_array(struct #define IXGBE_WRITE_REG_ARRAY(a, reg, offset, val) \ ixgbe_write_reg_array(a, reg, offset, val) +extern void ixgbe_write_barrier(struct ixgbe_hw *); +#define IXGBE_WRITE_BARRIER(a) \ +ixgbe_write_barrier(a) + #endif /* _IXGBE_OSDEP_H_ */ Index: src/sys/dev/pci/ixgbe/ixv.c diff -u src/sys/dev/pci/ixgbe/ixv.c:1.142 src/sys/dev/pci/ixgbe/ixv.c:1.143 --- src/sys/dev/pci/ixgbe/ixv.c:1.142 Mon Dec 16 02:50:54 2019 +++ src/sys/dev/pci/ixgbe/ixv.c Tue Dec 17 05:49:01 2019 @@ -1,4 +1,4 @@ -/*$NetBSD: ixv.c,v 1.142 2019/12/16 02:50:54 msaitoh Exp $*/ +/*$NetBSD: ixv.c,v 1.143 2019/12/17 05:49:01 msaitoh Exp $*/ /** @@ -1844,7 +1844,7 @@ ixv_initialize_receive_units(struct adap else break; } - wmb(); + IXGBE_WRITE_BARRIER(hw); /* Setup the Base and Length of the Rx Descriptor Ring */ IXGBE_WRITE_REG(hw, IXGBE_VFRDBAL(j), (rdba & 0xULL)); @@ -1876,7 +1876,7 @@ ixv_initialize_receive_units(struct adap break; msec_delay(1); } - wmb(); + IXGBE_WRITE_BARRIER(hw); /* Set the Tail Pointer */ #ifdef DEV_NETMAP
CVS commit: src/sys
Module Name:src Committed By: mlelstv Date: Tue Dec 17 07:57:25 UTC 2019 Modified Files: src/sys/dev/dm: files.dm src/sys/rump/dev/lib/libdm: Makefile Log Message: Add error and zero targets to build. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/sys/dev/dm/files.dm cvs rdiff -u -r1.7 -r1.8 src/sys/rump/dev/lib/libdm/Makefile 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/dm/files.dm diff -u src/sys/dev/dm/files.dm:1.6 src/sys/dev/dm/files.dm:1.7 --- src/sys/dev/dm/files.dm:1.6 Sun Jan 3 22:22:23 2010 +++ src/sys/dev/dm/files.dm Tue Dec 17 07:57:25 2019 @@ -7,3 +7,5 @@ filedev/dm/dm_table.c filedev/dm/dm_target.c dm filedev/dm/dm_target_linear.c dm file dev/dm/dm_target_stripe.c dm +file dev/dm/dm_target_zero.c dm +file dev/dm/dm_target_error.c dm Index: src/sys/rump/dev/lib/libdm/Makefile diff -u src/sys/rump/dev/lib/libdm/Makefile:1.7 src/sys/rump/dev/lib/libdm/Makefile:1.8 --- src/sys/rump/dev/lib/libdm/Makefile:1.7 Tue Jan 26 23:12:15 2016 +++ src/sys/rump/dev/lib/libdm/Makefile Tue Dec 17 07:57:25 2019 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.7 2016/01/26 23:12:15 pooka Exp $ +# $NetBSD: Makefile,v 1.8 2019/12/17 07:57:25 mlelstv Exp $ # .PATH: ${.CURDIR}/../../../../dev/dm @@ -8,7 +8,8 @@ COMMENT=Device-mapper driver (for LVM) IOCONF= DM.ioconf SRCS= device-mapper.c dm_dev.c dm_ioctl.c dm_pdev.c dm_table.c dm_target.c \ -dm_target_linear.c dm_target_stripe.c +dm_target_linear.c dm_target_stripe.c dm_target_error.c \ + dm_target_zero.c SRCS+= dm_component.c