From owner-svn-src-user@freebsd.org Mon Aug 1 06:56:34 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E73B0BAB405 for ; Mon, 1 Aug 2016 06:56:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C4B171F28; Mon, 1 Aug 2016 06:56:34 +0000 (UTC) (envelope-from ngie@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u716uYpR067007; Mon, 1 Aug 2016 06:56:34 GMT (envelope-from ngie@FreeBSD.org) Received: (from ngie@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u716uXT4066998; Mon, 1 Aug 2016 06:56:33 GMT (envelope-from ngie@FreeBSD.org) Message-Id: <201608010656.u716uXT4066998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ngie set sender to ngie@FreeBSD.org using -f From: Garrett Cooper Date: Mon, 1 Aug 2016 06:56:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303608 - user/ngie/stable-10-libnv/sys/conf X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 06:56:35 -0000 Author: ngie Date: Mon Aug 1 06:56:32 2016 New Revision: 303608 URL: https://svnweb.freebsd.org/changeset/base/303608 Log: MFC r288071: - arm64 change was omitted due to lack of architecture support - ia64 change was added as the architecture was removed from ^/head Sponsored by: EMC / Isilon Storage Division r288071 (by emaste): Move kbd.c to main sys/conf/files list It is (optionally) used on all architectures. Modified: user/ngie/stable-10-libnv/sys/conf/files user/ngie/stable-10-libnv/sys/conf/files.amd64 user/ngie/stable-10-libnv/sys/conf/files.arm user/ngie/stable-10-libnv/sys/conf/files.i386 user/ngie/stable-10-libnv/sys/conf/files.ia64 user/ngie/stable-10-libnv/sys/conf/files.mips user/ngie/stable-10-libnv/sys/conf/files.pc98 user/ngie/stable-10-libnv/sys/conf/files.powerpc user/ngie/stable-10-libnv/sys/conf/files.sparc64 Directory Properties: user/ngie/stable-10-libnv/ (props changed) Modified: user/ngie/stable-10-libnv/sys/conf/files ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files Mon Aug 1 06:56:32 2016 (r303608) @@ -1785,6 +1785,7 @@ dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy dev/joy/joy_isa.c optional joy isa dev/joy/joy_pccard.c optional joy pccard +dev/kbd/kbd.c optional atkbd | pckbd | sc | ukbd | vt dev/kbdmux/kbdmux.c optional kbdmux dev/ksyms/ksyms.c optional ksyms dev/le/am7990.c optional le Modified: user/ngie/stable-10-libnv/sys/conf/files.amd64 ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.amd64 Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.amd64 Mon Aug 1 06:56:32 2016 (r303608) @@ -281,7 +281,6 @@ dev/hyperv/vmbus/vmbus.c optional hyp dev/hyperv/vmbus/vmbus_et.c optional hyperv dev/hyperv/vmbus/amd64/hyperv_machdep.c optional hyperv dev/hyperv/vmbus/amd64/vmbus_vector.S optional hyperv -dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev dev/nfe/if_nfe.c optional nfe pci Modified: user/ngie/stable-10-libnv/sys/conf/files.arm ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.arm Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.arm Mon Aug 1 06:56:32 2016 (r303608) @@ -66,7 +66,6 @@ crypto/blowfish/bf_enc.c optional crypto crypto/des/des_enc.c optional crypto | ipsec | netsmb dev/fb/fb.c optional sc dev/hwpmc/hwpmc_arm.c optional hwpmc -dev/kbd/kbd.c optional sc | vt dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc Modified: user/ngie/stable-10-libnv/sys/conf/files.i386 ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.i386 Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.i386 Mon Aug 1 06:56:32 2016 (r303608) @@ -273,7 +273,6 @@ dev/ipmi/ipmi_smbios.c optional ipmi dev/ipmi/ipmi_ssif.c optional ipmi smbus dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux -dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_isa.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: user/ngie/stable-10-libnv/sys/conf/files.ia64 ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.ia64 Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.ia64 Mon Aug 1 06:56:32 2016 (r303608) @@ -52,7 +52,6 @@ dev/fb/fb.c optional fb | vga dev/fb/vga.c optional vga dev/hwpmc/hwpmc_ia64.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional atkbd | sc | ukbd dev/syscons/scterm-teken.c optional sc dev/syscons/scvgarndr.c optional sc vga dev/syscons/scvtb.c optional sc Modified: user/ngie/stable-10-libnv/sys/conf/files.mips ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.mips Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.mips Mon Aug 1 06:56:32 2016 (r303608) @@ -68,7 +68,6 @@ dev/cfe/cfe_env.c optional cfe_env # syscons support dev/fb/fb.c optional sc -dev/kbd/kbd.c optional sc dev/syscons/scgfbrndr.c optional sc dev/syscons/scterm-teken.c optional sc dev/syscons/scvtb.c optional sc Modified: user/ngie/stable-10-libnv/sys/conf/files.pc98 ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.pc98 Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.pc98 Mon Aug 1 06:56:32 2016 (r303608) @@ -125,7 +125,6 @@ dev/hwpmc/hwpmc_ppro.c optional hwpmc dev/hwpmc/hwpmc_tsc.c optional hwpmc dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io -dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.c optional le isa dev/lindev/full.c optional lindev dev/lindev/lindev.c optional lindev Modified: user/ngie/stable-10-libnv/sys/conf/files.powerpc ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.powerpc Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.powerpc Mon Aug 1 06:56:32 2016 (r303608) @@ -39,7 +39,6 @@ dev/iicbus/adt746x.c optional ad dev/iicbus/ds1631.c optional ds1631 powermac dev/iicbus/ds1775.c optional ds1775 powermac dev/iicbus/max6690.c optional max6690 powermac -dev/kbd/kbd.c optional sc | vt dev/nand/nfc_fsl.c optional nand mpc85xx # ofw can be either aim or fdt: fdt case handled in files. aim only powerpc specific. dev/ofw/openfirm.c optional aim Modified: user/ngie/stable-10-libnv/sys/conf/files.sparc64 ============================================================================== --- user/ngie/stable-10-libnv/sys/conf/files.sparc64 Mon Aug 1 06:35:35 2016 (r303607) +++ user/ngie/stable-10-libnv/sys/conf/files.sparc64 Mon Aug 1 06:56:32 2016 (r303608) @@ -40,7 +40,6 @@ dev/fb/fb.c optional sc dev/fb/gallant12x22.c optional sc dev/fb/machfb.c optional machfb sc dev/hwpmc/hwpmc_sparc64.c optional hwpmc -dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_lebuffer.c optional le sbus dev/le/if_le_ledma.c optional le sbus dev/le/lebuffer_sbus.c optional le sbus From owner-svn-src-user@freebsd.org Mon Aug 1 21:28:38 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B70FABAB1A2 for ; Mon, 1 Aug 2016 21:28:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 737DD192C; Mon, 1 Aug 2016 21:28:38 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u71LSbT6096177; Mon, 1 Aug 2016 21:28:37 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u71LSZUU096148; Mon, 1 Aug 2016 21:28:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608012128.u71LSZUU096148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 1 Aug 2016 21:28:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303642 - in user/alc/PQ_LAUNDRY: . bin/sh cddl/contrib/opensolaris/lib/libdtrace/arm cddl/contrib/opensolaris/lib/libdtrace/i386 cddl/contrib/opensolaris/lib/libzpool/common contrib/bl... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 21:28:38 -0000 Author: alc Date: Mon Aug 1 21:28:34 2016 New Revision: 303642 URL: https://svnweb.freebsd.org/changeset/base/303642 Log: MFH r303641 Added: user/alc/PQ_LAUNDRY/share/man/man4/ng_checksum.4 - copied unchanged from r303641, head/share/man/man4/ng_checksum.4 user/alc/PQ_LAUNDRY/sys/arm/arm/gic.h - copied unchanged from r303641, head/sys/arm/arm/gic.h user/alc/PQ_LAUNDRY/sys/arm/arm/gic_fdt.c - copied unchanged from r303641, head/sys/arm/arm/gic_fdt.c user/alc/PQ_LAUNDRY/sys/modules/netgraph/checksum/ - copied from r303641, head/sys/modules/netgraph/checksum/ user/alc/PQ_LAUNDRY/sys/netgraph/ng_checksum.c - copied unchanged from r303641, head/sys/netgraph/ng_checksum.c user/alc/PQ_LAUNDRY/sys/netgraph/ng_checksum.h - copied unchanged from r303641, head/sys/netgraph/ng_checksum.h Modified: user/alc/PQ_LAUNDRY/Makefile.inc1 user/alc/PQ_LAUNDRY/bin/sh/expand.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libzpool/common/util.c user/alc/PQ_LAUNDRY/contrib/blacklist/lib/bl.c user/alc/PQ_LAUNDRY/contrib/libexecinfo/backtrace.c user/alc/PQ_LAUNDRY/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp user/alc/PQ_LAUNDRY/contrib/ofed/usr.lib/libibverbs/config.h user/alc/PQ_LAUNDRY/include/grp.h user/alc/PQ_LAUNDRY/include/stdio.h user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.3 user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.c user/alc/PQ_LAUNDRY/lib/libc/gen/glob.3 user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c user/alc/PQ_LAUNDRY/lib/libc/stdio/dprintf.c user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.3 user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.c user/alc/PQ_LAUNDRY/lib/libc/stdio/printf.3 user/alc/PQ_LAUNDRY/lib/libc/tests/stdio/getdelim_test.c user/alc/PQ_LAUNDRY/lib/libproc/Makefile user/alc/PQ_LAUNDRY/lib/libproc/_libproc.h user/alc/PQ_LAUNDRY/lib/libproc/libproc.h user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c user/alc/PQ_LAUNDRY/lib/libproc/proc_rtld.c user/alc/PQ_LAUNDRY/lib/libproc/proc_util.c user/alc/PQ_LAUNDRY/lib/librtld_db/Makefile user/alc/PQ_LAUNDRY/lib/librtld_db/rtld_db.c user/alc/PQ_LAUNDRY/lib/librtld_db/rtld_db.h user/alc/PQ_LAUNDRY/sbin/fsdb/fsdb.c user/alc/PQ_LAUNDRY/sbin/ipfw/tables.c user/alc/PQ_LAUNDRY/sbin/resolvconf/Makefile user/alc/PQ_LAUNDRY/share/man/man4/gpioled.4 user/alc/PQ_LAUNDRY/share/man/man9/bitset.9 user/alc/PQ_LAUNDRY/share/man/man9/cpuset.9 user/alc/PQ_LAUNDRY/share/mk/src.libnames.mk user/alc/PQ_LAUNDRY/sys/amd64/amd64/support.S user/alc/PQ_LAUNDRY/sys/arm/arm/gic.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/machdep.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/mp_machdep.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/nexus.c user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c user/alc/PQ_LAUNDRY/sys/arm64/include/armreg.h user/alc/PQ_LAUNDRY/sys/arm64/include/machdep.h user/alc/PQ_LAUNDRY/sys/boot/common/bcache.c user/alc/PQ_LAUNDRY/sys/boot/common/interp_parse.c user/alc/PQ_LAUNDRY/sys/boot/zfs/libzfs.h user/alc/PQ_LAUNDRY/sys/boot/zfs/zfs.c user/alc/PQ_LAUNDRY/sys/boot/zfs/zfsimpl.c user/alc/PQ_LAUNDRY/sys/cddl/boot/zfs/zfsimpl.h user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/dtrace/fasttrap.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_mirror.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c user/alc/PQ_LAUNDRY/sys/conf/files.arm user/alc/PQ_LAUNDRY/sys/conf/files.arm64 user/alc/PQ_LAUNDRY/sys/contrib/libnv/nvlist.c user/alc/PQ_LAUNDRY/sys/dev/ath/if_athioctl.h user/alc/PQ_LAUNDRY/sys/dev/cfe/cfe_api.c user/alc/PQ_LAUNDRY/sys/dev/cfe/cfe_api.h user/alc/PQ_LAUNDRY/sys/dev/cfe/cfe_api_int.h user/alc/PQ_LAUNDRY/sys/dev/cfe/cfe_error.h user/alc/PQ_LAUNDRY/sys/dev/cfe/cfe_ioctl.h user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c user/alc/PQ_LAUNDRY/sys/dev/e1000/if_em.c user/alc/PQ_LAUNDRY/sys/dev/gpio/gpioled.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/include/vmbus.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_net_vsc.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/vmbus/vmbus_brvar.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/vmbus/vmbus_chan.c user/alc/PQ_LAUNDRY/sys/dev/iwm/if_iwm.c user/alc/PQ_LAUNDRY/sys/dev/ntb/if_ntb/if_ntb.c user/alc/PQ_LAUNDRY/sys/dev/ntb/ntb.c user/alc/PQ_LAUNDRY/sys/dev/ntb/ntb_hw/ntb_hw.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c user/alc/PQ_LAUNDRY/sys/geom/geom_disk.c user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c user/alc/PQ_LAUNDRY/sys/kern/kern_tc.c user/alc/PQ_LAUNDRY/sys/mips/atheros/ar71xx_gpio.c user/alc/PQ_LAUNDRY/sys/mips/broadcom/uart_cpu_chipc.c user/alc/PQ_LAUNDRY/sys/mips/conf/SENTRY5.hints user/alc/PQ_LAUNDRY/sys/mips/conf/TL-WDR4300.hints user/alc/PQ_LAUNDRY/sys/netgraph/ng_patch.c user/alc/PQ_LAUNDRY/sys/netgraph/ng_patch.h user/alc/PQ_LAUNDRY/sys/netinet/tcp_subr.c user/alc/PQ_LAUNDRY/sys/netinet6/icmp6.c user/alc/PQ_LAUNDRY/sys/netinet6/ip6_output.c user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/core/cma.c user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c user/alc/PQ_LAUNDRY/tools/regression/zfs/zpool/add/option-f_size_mismatch.t user/alc/PQ_LAUNDRY/tools/regression/zfs/zpool/add/option-f_type_mismatch.t user/alc/PQ_LAUNDRY/tools/regression/zfs/zpool/create/files.t user/alc/PQ_LAUNDRY/usr.bin/at/at.c user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.common user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.holiday (contents, props changed) user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.military user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.orthodox user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.KOI8-R/calendar.pagan user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.common user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.military user/alc/PQ_LAUNDRY/usr.bin/calendar/calendars/ru_RU.UTF-8/calendar.pagan user/alc/PQ_LAUNDRY/usr.bin/calendar/io.c user/alc/PQ_LAUNDRY/usr.bin/checknr/checknr.c user/alc/PQ_LAUNDRY/usr.bin/comm/comm.c user/alc/PQ_LAUNDRY/usr.bin/cpuset/cpuset.1 user/alc/PQ_LAUNDRY/usr.bin/grep/grep.c user/alc/PQ_LAUNDRY/usr.bin/gzip/gzip.c user/alc/PQ_LAUNDRY/usr.bin/indent/args.c user/alc/PQ_LAUNDRY/usr.bin/indent/indent.c user/alc/PQ_LAUNDRY/usr.bin/indent/indent.h user/alc/PQ_LAUNDRY/usr.bin/indent/indent_codes.h user/alc/PQ_LAUNDRY/usr.bin/indent/indent_globs.h user/alc/PQ_LAUNDRY/usr.bin/indent/io.c user/alc/PQ_LAUNDRY/usr.bin/indent/lexi.c user/alc/PQ_LAUNDRY/usr.bin/indent/parse.c user/alc/PQ_LAUNDRY/usr.bin/indent/pr_comment.c user/alc/PQ_LAUNDRY/usr.bin/locale/locale.c user/alc/PQ_LAUNDRY/usr.bin/mandoc/Makefile user/alc/PQ_LAUNDRY/usr.bin/netstat/pfkey.c user/alc/PQ_LAUNDRY/usr.bin/nl/nl.c user/alc/PQ_LAUNDRY/usr.bin/procstat/procstat_files.c user/alc/PQ_LAUNDRY/usr.bin/sdiff/sdiff.c user/alc/PQ_LAUNDRY/usr.bin/sed/compile.c user/alc/PQ_LAUNDRY/usr.bin/sed/main.c user/alc/PQ_LAUNDRY/usr.bin/soelim/soelim.c user/alc/PQ_LAUNDRY/usr.bin/uniq/uniq.c user/alc/PQ_LAUNDRY/usr.sbin/autofs/common.c user/alc/PQ_LAUNDRY/usr.sbin/bsdinstall/scripts/hardening user/alc/PQ_LAUNDRY/usr.sbin/pkg/pkg.c user/alc/PQ_LAUNDRY/usr.sbin/pw/pw.h user/alc/PQ_LAUNDRY/usr.sbin/pw/pw_vpw.c user/alc/PQ_LAUNDRY/usr.sbin/pw/pwupd.h user/alc/PQ_LAUNDRY/usr.sbin/services_mkdb/services_mkdb.c user/alc/PQ_LAUNDRY/usr.sbin/uathload/uathload.c Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/cddl/ (props changed) user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/ (props changed) user/alc/PQ_LAUNDRY/contrib/libexecinfo/ (props changed) user/alc/PQ_LAUNDRY/contrib/llvm/ (props changed) user/alc/PQ_LAUNDRY/contrib/llvm/projects/libunwind/ (props changed) user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/alc/PQ_LAUNDRY/Makefile.inc1 ============================================================================== --- user/alc/PQ_LAUNDRY/Makefile.inc1 Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/Makefile.inc1 Mon Aug 1 21:28:34 2016 (r303642) @@ -2095,7 +2095,10 @@ cddl/lib/libctf__L: lib/libz__L # cddl/lib/libdtrace requires lib/libproc and lib/librtld_db; it's only built # on select architectures though (see cddl/lib/Makefile) .if ${MACHINE_CPUARCH} != "sparc64" -_prebuild_libs+= lib/libproc lib/librtld_db +_prebuild_libs+= lib/libprocstat lib/libproc lib/librtld_db +lib/libprocstat__L: lib/libelf__L lib/libkvm__L lib/libutil__L +lib/libproc__L: lib/libprocstat__L +lib/librtld_db__L: lib/libprocstat__L .endif .if ${MK_CRYPT} != "no" Modified: user/alc/PQ_LAUNDRY/bin/sh/expand.c ============================================================================== --- user/alc/PQ_LAUNDRY/bin/sh/expand.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/bin/sh/expand.c Mon Aug 1 21:28:34 2016 (r303642) @@ -473,7 +473,8 @@ expbackq(union node *cmd, int quoted, in if (--in.nleft < 0) { if (in.fd < 0) break; - while ((i = read(in.fd, buf, sizeof buf)) < 0 && errno == EINTR); + while ((i = read(in.fd, buf, sizeof buf)) < 0 && errno == EINTR) + ; TRACE(("expbackq: read returns %d\n", i)); if (i <= 0) break; Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/arm/dt_isadep.c Mon Aug 1 21:28:34 2016 (r303642) @@ -38,9 +38,7 @@ #include #include -#if !defined(sun) -#define PR_MODEL_ILP32 1 -#define PR_MODEL_LP64 2 +#ifdef __FreeBSD__ #include #endif Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libdtrace/i386/dt_isadep.c Mon Aug 1 21:28:34 2016 (r303642) @@ -39,9 +39,8 @@ #include -#ifndef illumos -#define PR_MODEL_ILP32 1 -#define PR_MODEL_LP64 2 +#ifdef __FreeBSD__ +#include #include #endif @@ -93,11 +92,7 @@ dt_pid_has_jump_table(struct ps_prochand char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif /* @@ -149,11 +144,7 @@ dt_pid_create_return_probe(struct ps_pro char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif /* @@ -310,11 +301,7 @@ dt_pid_create_offset_probe(struct ps_pro char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif if ((text = malloc(symp->st_size)) == NULL) { @@ -393,11 +380,7 @@ dt_pid_create_glob_offset_probes(struct char dmodel = Pstatus(P)->pr_dmodel; #else pid_t pid = proc_getpid(P); -#if __i386__ - char dmodel = PR_MODEL_ILP32; -#elif __amd64__ - char dmodel = PR_MODEL_LP64; -#endif + char dmodel = proc_getmodel(P); #endif ftp->ftps_type = DTFTP_OFFSETS; Modified: user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libzpool/common/util.c ============================================================================== --- user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libzpool/common/util.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/cddl/contrib/opensolaris/lib/libzpool/common/util.c Mon Aug 1 21:28:34 2016 (r303642) @@ -108,7 +108,7 @@ show_vdev_stats(const char *desc, const (void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n", indent, "", prefix, - indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12), + (int)(indent + strlen(prefix) - 25 - (vs->vs_space ? 0 : 12)), desc, vs->vs_space ? 6 : 0, vs->vs_space ? used : "", vs->vs_space ? 6 : 0, vs->vs_space ? avail : "", Modified: user/alc/PQ_LAUNDRY/contrib/blacklist/lib/bl.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/blacklist/lib/bl.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/contrib/blacklist/lib/bl.c Mon Aug 1 21:28:34 2016 (r303642) @@ -152,8 +152,8 @@ bl_init(bl_t b, bool srv) b->b_fd = socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_NOSIGPIPE, 0); if (b->b_fd == -1) { - bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%m)", - __func__); + bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%s)", + __func__, strerror(errno)); BL_UNLOCK(b); return -1; } @@ -200,8 +200,8 @@ bl_init(bl_t b, bool srv) */ if (b->b_connected != 1) { bl_log(b->b_fun, LOG_DEBUG, - "%s: connect failed for `%s' (%m)", - __func__, sun->sun_path); + "%s: connect failed for `%s' (%s)", + __func__, sun->sun_path, strerror(errno)); b->b_connected = 1; } BL_UNLOCK(b); @@ -220,8 +220,8 @@ bl_init(bl_t b, bool srv) errno = serrno; if (rv == -1) { bl_log(b->b_fun, LOG_ERR, - "%s: bind failed for `%s' (%m)", - __func__, sun->sun_path); + "%s: bind failed for `%s' (%s)", + __func__, sun->sun_path, strerror(errno)); goto out; } } @@ -260,7 +260,8 @@ bl_init(bl_t b, bool srv) if (setsockopt(b->b_fd, CRED_LEVEL, CRED_NAME, &one, (socklen_t)sizeof(one)) == -1) { bl_log(b->b_fun, LOG_ERR, "%s: setsockopt %s " - "failed (%m)", __func__, __STRING(CRED_NAME)); + "failed (%s)", __func__, __STRING(CRED_NAME), + strerror(errno)); goto out; } #endif @@ -296,7 +297,8 @@ bl_create(bool srv, const char *path, vo return b; out: free(b); - bl_log(fun, LOG_ERR, "%s: malloc failed (%m)", __func__); + bl_log(fun, LOG_ERR, "%s: malloc failed (%s)", __func__, + strerror(errno)); return NULL; } @@ -451,7 +453,8 @@ bl_recv(bl_t b) rlen = recvmsg(b->b_fd, &msg, 0); if (rlen == -1) { - bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%m)", __func__); + bl_log(b->b_fun, LOG_ERR, "%s: recvmsg failed (%s)", __func__, + strerror(errno)); return NULL; } Modified: user/alc/PQ_LAUNDRY/contrib/libexecinfo/backtrace.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libexecinfo/backtrace.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/contrib/libexecinfo/backtrace.c Mon Aug 1 21:28:34 2016 (r303642) @@ -33,7 +33,6 @@ __RCSID("$NetBSD: backtrace.c,v 1.3 2013 #include #include -#define _WITH_DPRINTF #include #include #include Modified: user/alc/PQ_LAUNDRY/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/contrib/llvm/projects/libunwind/src/Unwind-EHABI.cpp Mon Aug 1 21:28:34 2016 (r303642) @@ -572,7 +572,7 @@ static _Unwind_Reason_Code unwind_phase2 unw_get_reg(cursor, UNW_REG_SP, &sp); if (unw_get_proc_info(cursor, &frameInfo) != UNW_ESUCCESS) { _LIBUNWIND_TRACE_UNWINDING("unwind_phase2(ex_ojb=%p): unw_get_proc_info " - "failed => _URC_FATAL_PHASE1_ERROR\n", + "failed => _URC_FATAL_PHASE2_ERROR\n", static_cast(exception_object)); return _URC_FATAL_PHASE2_ERROR; } Modified: user/alc/PQ_LAUNDRY/contrib/ofed/usr.lib/libibverbs/config.h ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/ofed/usr.lib/libibverbs/config.h Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/contrib/ofed/usr.lib/libibverbs/config.h Mon Aug 1 21:28:34 2016 (r303642) @@ -1,2 +1 @@ -#define _WITH_GETLINE #include Modified: user/alc/PQ_LAUNDRY/include/grp.h ============================================================================== --- user/alc/PQ_LAUNDRY/include/grp.h Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/include/grp.h Mon Aug 1 21:28:34 2016 (r303642) @@ -75,8 +75,7 @@ int pwcache_groupdb(int (*)(int), void struct group * (*)(gid_t)); #endif #if __XSI_VISIBLE -/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ -int setgrent(void); +void setgrent(void); #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE int getgrgid_r(gid_t, struct group *, char *, size_t, Modified: user/alc/PQ_LAUNDRY/include/stdio.h ============================================================================== --- user/alc/PQ_LAUNDRY/include/stdio.h Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/include/stdio.h Mon Aug 1 21:28:34 2016 (r303642) @@ -357,44 +357,8 @@ ssize_t getdelim(char ** __restrict, si FILE *open_memstream(char **, size_t *); int renameat(int, const char *, int, const char *); int vdprintf(int, const char * __restrict, __va_list); - -/* - * Every programmer and his dog wrote functions called getline() and dprintf() - * before POSIX.1-2008 came along and decided to usurp the names, so we - * don't prototype them by default unless one of the following is true: - * a) the app has requested them specifically by defining _WITH_GETLINE or - * _WITH_DPRINTF, respectively - * b) the app has requested a POSIX.1-2008 environment via _POSIX_C_SOURCE - * c) the app defines a GNUism such as _BSD_SOURCE or _GNU_SOURCE - */ -#ifndef _WITH_GETLINE -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -#define _WITH_GETLINE -#elif defined(_POSIX_C_SOURCE) -#if _POSIX_C_SOURCE >= 200809 -#define _WITH_GETLINE -#endif -#endif -#endif - -#ifdef _WITH_GETLINE ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); -#endif - -#ifndef _WITH_DPRINTF -#if defined(_BSD_SOURCE) || defined(_GNU_SOURCE) -#define _WITH_DPRINTF -#elif defined(_POSIX_C_SOURCE) -#if _POSIX_C_SOURCE >= 200809 -#define _WITH_DPRINTF -#endif -#endif -#endif - -#ifdef _WITH_DPRINTF -int (dprintf)(int, const char * __restrict, ...); -#endif - +int dprintf(int, const char * __restrict, ...); #endif /* __POSIX_VISIBLE >= 200809 */ /* Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.3 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.3 Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.3 Mon Aug 1 21:28:34 2016 (r303642) @@ -28,7 +28,7 @@ .\" From: @(#)getgrent.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 16, 2003 +.Dd July 31, 2016 .Dt GETGRENT 3 .Os .Sh NAME @@ -60,7 +60,7 @@ .Fn getgrgid_r "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" .Ft int .Fn setgroupent "int stayopen" -.Ft int +.Ft void .Fn setgrent void .Ft void .Fn endgrent void @@ -188,14 +188,13 @@ is set to .Dv NULL and the return value is 0, no matching entry exists.) .Pp -The functions +The function .Fn setgroupent -and -.Fn setgrent -return the value 1 if successful, otherwise the value +returns the value 1 if successful, otherwise the value 0 is returned. The functions -.Fn endgrent +.Fn endgrent , +.Fn setgrent and .Fn setgrfile have no return value. Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/getgrent.c Mon Aug 1 21:28:34 2016 (r303642) @@ -533,12 +533,10 @@ out: return (rv); } -/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ -int +void setgrent(void) { (void)_nsdispatch(NULL, setgrent_dtab, NSDB_GROUP, "setgrent", defaultsrc, 0); - return (1); } Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/glob.3 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/glob.3 Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/glob.3 Mon Aug 1 21:28:34 2016 (r303642) @@ -363,7 +363,7 @@ file .It Dv GLOB_NOSPACE An attempt to allocate memory failed, or if .Fa errno -was 0 +was E2BIG, .Dv GLOB_LIMIT was specified in the flags and .Fa pglob\->gl_matchc Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c Mon Aug 1 21:28:34 2016 (r303642) @@ -270,7 +270,7 @@ globexp0(const Char *pattern, glob_t *pg if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) { if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } return (glob0(pattern, pglob, limit, origpat)); @@ -297,7 +297,7 @@ globexp1(const Char *pattern, glob_t *pg if ((ptr = g_strchr(pattern, LBRACE)) != NULL) { if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } return (globexp2(ptr, pattern, pglob, limit)); @@ -538,7 +538,7 @@ glob0(const Char *pattern, glob_t *pglob qpatnext = globtilde(pattern, patbuf, MAXPATHLEN, pglob); if (qpatnext == NULL) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } oldpathc = pglob->gl_pathc; @@ -672,7 +672,7 @@ glob2(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } if ((pglob->gl_flags & GLOB_MARK) && @@ -682,7 +682,7 @@ glob2(Char *pathbuf, Char *pathend, Char g_stat(pathbuf, &sb, pglob) == 0 && S_ISDIR(sb.st_mode)))) { if (pathend + 1 > pathend_last) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } *pathend++ = SEP; @@ -699,7 +699,7 @@ glob2(Char *pathbuf, Char *pathend, Char if (ismeta(*p)) anymeta = 1; if (q + 1 > pathend_last) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } *q++ = *p++; @@ -710,7 +710,7 @@ glob2(Char *pathbuf, Char *pathend, Char pattern = p; while (UNPROT(*pattern) == SEP) { if (pathend + 1 > pathend_last) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } *pathend++ = *pattern++; @@ -729,30 +729,36 @@ glob3(Char *pathbuf, Char *pathend, Char { struct dirent *dp; DIR *dirp; - int err, too_long, saverrno; + int err, too_long, saverrno, saverrno2; char buf[MAXPATHLEN + MB_LEN_MAX - 1]; struct dirent *(*readdirfunc)(DIR *); if (pathend > pathend_last) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } *pathend = EOS; if (pglob->gl_errfunc != NULL && g_Ctoc(pathbuf, buf, sizeof(buf))) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } + saverrno = errno; errno = 0; if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { if (errno == ENOENT || errno == ENOTDIR) return (0); if ((pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, errno)) || - (pglob->gl_flags & GLOB_ERR)) + (pglob->gl_flags & GLOB_ERR)) { + if (errno == 0) + errno = saverrno; return (GLOB_ABORTED); + } + if (errno == 0) + errno = saverrno; return (0); } @@ -775,14 +781,16 @@ glob3(Char *pathbuf, Char *pathend, Char if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { - errno = 0; + errno = E2BIG; err = GLOB_NOSPACE; break; } /* Initial DOT must be matched literally. */ - if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) + if (dp->d_name[0] == '.' && UNPROT(*pattern) != DOT) { + errno = 0; continue; + } memset(&mbs, 0, sizeof(mbs)); dc = pathend; sc = dp->d_name; @@ -801,10 +809,20 @@ glob3(Char *pathbuf, Char *pathend, Char } sc += clen; } + if (too_long && ((pglob->gl_errfunc != NULL && + pglob->gl_errfunc(buf, ENAMETOOLONG)) || + (pglob->gl_flags & GLOB_ERR))) { + errno = ENAMETOOLONG; + err = GLOB_ABORTED; + break; + } if (too_long || !match(pathend, pattern, restpattern)) { *pathend = EOS; + errno = 0; continue; } + if (errno == 0) + errno = saverrno; err = glob2(pathbuf, --dc, pathend_last, restpattern, pglob, limit); if (err) @@ -812,12 +830,12 @@ glob3(Char *pathbuf, Char *pathend, Char errno = 0; } - saverrno = errno; + saverrno2 = errno; if (pglob->gl_flags & GLOB_ALTDIRFUNC) (*pglob->gl_closedir)(dirp); else closedir(dirp); - errno = saverrno; + errno = saverrno2; if (err) return (err); @@ -826,6 +844,8 @@ glob3(Char *pathbuf, Char *pathend, Char pglob->gl_errfunc(buf, errno)) || (pglob->gl_flags & GLOB_ERR))) return (GLOB_ABORTED); + if (errno == 0) + errno = saverrno; return (0); } @@ -855,7 +875,7 @@ globextend(const Char *path, glob_t *pgl if ((pglob->gl_flags & GLOB_LIMIT) && pglob->gl_matchc > limit->l_path_lim) { - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } @@ -882,7 +902,7 @@ globextend(const Char *path, glob_t *pgl if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } } @@ -892,7 +912,7 @@ globextend(const Char *path, glob_t *pgl if ((pglob->gl_flags & GLOB_LIMIT) && limit->l_string_cnt >= GLOB_LIMIT_STRING) { free(copy); - errno = 0; + errno = E2BIG; return (GLOB_NOSPACE); } pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; Modified: user/alc/PQ_LAUNDRY/lib/libc/stdio/dprintf.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/stdio/dprintf.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/stdio/dprintf.c Mon Aug 1 21:28:34 2016 (r303642) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_DPRINTF #include "namespace.h" #include #include Modified: user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.3 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.3 Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.3 Mon Aug 1 21:28:34 2016 (r303642) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 30, 2012 +.Dd July 30, 2016 .Dt GETLINE 3 .Os .Sh NAME @@ -34,7 +34,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd "#define _WITH_GETLINE" .In stdio.h .Ft ssize_t .Fn getdelim "char ** restrict linep" "size_t * restrict linecapp" "int delimiter" " FILE * restrict stream" @@ -97,34 +96,6 @@ while ((linelen = getline(&line, &lineca fwrite(line, linelen, 1, stdout); free(line); .Ed -.Sh COMPATIBILITY -Many application writers used the name -.Va getline -before the -.Fn getline -function was introduced in -.St -p1003.1 , -so a prototype is not provided by default in order to avoid -compatibility problems. -Applications that wish to use the -.Fn getline -function described herein should either request a strict -.St -p1003.1-2008 -environment by defining the macro -.Dv _POSIX_C_SOURCE -to the value 200809 or greater, or by defining the macro -.Dv _WITH_GETLINE , -prior to the inclusion of -.In stdio.h . -For compatibility with GNU libc, defining either -.Dv _BSD_SOURCE -or -.Dv _GNU_SOURCE -prior to the inclusion of -.In stdio.h -will also make -.Fn getline -available. .Sh ERRORS These functions may fail if: .Bl -tag -width Er Modified: user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/stdio/getline.c Mon Aug 1 21:28:34 2016 (r303642) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_GETLINE #include ssize_t Modified: user/alc/PQ_LAUNDRY/lib/libc/stdio/printf.3 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/stdio/printf.3 Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/stdio/printf.3 Mon Aug 1 21:28:34 2016 (r303642) @@ -32,7 +32,7 @@ .\" @(#)printf.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd December 2, 2009 +.Dd July 30, 2016 .Dt PRINTF 3 .Os .Sh NAME @@ -42,7 +42,6 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.Fd "#define _WITH_DPRINTF" .In stdio.h .Ft int .Fn printf "const char * restrict format" ... @@ -715,34 +714,6 @@ char *newfmt(const char *fmt, ...) } .Ed .Sh COMPATIBILITY -Many application writers used the name -.Va dprintf -before the -.Fn dprintf -function was introduced in -.St -p1003.1 , -so a prototype is not provided by default in order to avoid -compatibility problems. -Applications that wish to use the -.Fn dprintf -function described herein should either request a strict -.St -p1003.1-2008 -environment by defining the macro -.Dv _POSIX_C_SOURCE -to the value 200809 or greater, or by defining the macro -.Dv _WITH_DPRINTF , -prior to the inclusion of -.In stdio.h . -For compatibility with GNU libc, defining either -.Dv _BSD_SOURCE -or -.Dv _GNU_SOURCE -prior to the inclusion of -.In stdio.h -will also make -.Fn dprintf -available. -.Pp The conversion formats .Cm \&%D , \&%O , and Modified: user/alc/PQ_LAUNDRY/lib/libc/tests/stdio/getdelim_test.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/tests/stdio/getdelim_test.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libc/tests/stdio/getdelim_test.c Mon Aug 1 21:28:34 2016 (r303642) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); -#define _WITH_GETLINE #include #include #include Modified: user/alc/PQ_LAUNDRY/lib/libproc/Makefile ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/Makefile Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/Makefile Mon Aug 1 21:28:34 2016 (r303642) @@ -24,7 +24,7 @@ LIBADD+= cxxrt LIBADD+= supcplusplus .endif -LIBADD+= elf rtld_db util +LIBADD+= elf procstat rtld_db util .if ${MK_CDDL} != "no" LIBADD+= ctf Modified: user/alc/PQ_LAUNDRY/lib/libproc/_libproc.h ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/_libproc.h Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/_libproc.h Mon Aug 1 21:28:34 2016 (r303642) @@ -26,28 +26,29 @@ * $FreeBSD$ */ -#include -#include #include -#include #include + #include #include "libproc.h" +struct procstat; + struct proc_handle { pid_t pid; /* Process ID. */ - int kq; /* Kernel event queue ID. */ int flags; /* Process flags. */ int status; /* Process status (PS_*). */ int wstat; /* Process wait status. */ + int model; /* Process data model. */ rd_agent_t *rdap; /* librtld_db agent */ - rd_loadobj_t *rdobjs; - size_t rdobjsz; - size_t nobjs; - struct lwpstatus lwps; - rd_loadobj_t *rdexec; /* rdobj index of program executable. */ - char execname[MAXPATHLEN]; /* Path to program executable. */ + rd_loadobj_t *rdobjs; /* Array of loaded objects. */ + size_t rdobjsz; /* Array size. */ + size_t nobjs; /* Num. objects currently loaded. */ + rd_loadobj_t *rdexec; /* rdobj for program executable. */ + struct lwpstatus lwps; /* Process status. */ + struct procstat *procstat; /* libprocstat handle. */ + char execpath[MAXPATHLEN]; /* Path to program executable. */ }; #ifdef DEBUG Modified: user/alc/PQ_LAUNDRY/lib/libproc/libproc.h ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/libproc.h Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/libproc.h Mon Aug 1 21:28:34 2016 (r303642) @@ -113,6 +113,9 @@ typedef struct lwpstatus { #define FLTBPT -1 } lwpstatus_t; +#define PR_MODEL_ILP32 1 +#define PR_MODEL_LP64 2 + /* Function prototype definitions. */ __BEGIN_DECLS @@ -136,6 +139,7 @@ int proc_name2sym(struct proc_handle *, struct ctf_file *proc_name2ctf(struct proc_handle *, const char *); int proc_setflags(struct proc_handle *, int); int proc_state(struct proc_handle *); +int proc_getmodel(struct proc_handle *); pid_t proc_getpid(struct proc_handle *); int proc_wstatus(struct proc_handle *); int proc_getwstat(struct proc_handle *); Modified: user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c Mon Aug 1 21:28:34 2016 (r303642) @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -38,57 +39,103 @@ #include #include +#include +#include + #include "_libproc.h" -static int proc_init(pid_t, int, int, struct proc_handle *); +static int getelfclass(int); +static int proc_init(pid_t, int, int, struct proc_handle **); + +static int +getelfclass(int fd) +{ + GElf_Ehdr ehdr; + Elf *e; + int class; + + class = ELFCLASSNONE; + + if ((e = elf_begin(fd, ELF_C_READ, NULL)) == NULL) + goto out; + if (gelf_getehdr(e, &ehdr) == NULL) + goto out; + class = ehdr.e_ident[EI_CLASS]; +out: + (void)elf_end(e); + return (class); +} static int -proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) +proc_init(pid_t pid, int flags, int status, struct proc_handle **pphdl) { - int mib[4], error; - size_t len; + struct kinfo_proc *kp; + struct proc_handle *phdl; + int error, class, count, fd; + + *pphdl = NULL; + if ((phdl = malloc(sizeof(*phdl))) == NULL) + return (ENOMEM); memset(phdl, 0, sizeof(*phdl)); phdl->pid = pid; phdl->flags = flags; phdl->status = status; + phdl->procstat = procstat_open_sysctl(); + if (phdl->procstat == NULL) + return (ENOMEM); - mib[0] = CTL_KERN; - mib[1] = KERN_PROC; - mib[2] = KERN_PROC_PATHNAME; - mib[3] = pid; - len = sizeof(phdl->execname); - if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) { - error = errno; - DPRINTF("ERROR: cannot get pathname for child process %d", pid); + /* Obtain a path to the executable. */ + if ((kp = procstat_getprocs(phdl->procstat, KERN_PROC_PID, pid, + &count)) == NULL) + return (ENOMEM); + error = procstat_getpathname(phdl->procstat, kp, phdl->execpath, + sizeof(phdl->execpath)); + procstat_freeprocs(phdl->procstat, kp); + if (error != 0) return (error); + + /* Use it to determine the data model for the process. */ + if ((fd = open(phdl->execpath, O_RDONLY)) < 0) { + error = errno; + goto out; } - if (len == 0) - phdl->execname[0] = '\0'; + class = getelfclass(fd); + switch (class) { + case ELFCLASS64: + phdl->model = PR_MODEL_LP64; + break; + case ELFCLASS32: + phdl->model = PR_MODEL_ILP32; + break; + case ELFCLASSNONE: + default: + error = EINVAL; + break; + } + (void)close(fd); - return (0); +out: + *pphdl = phdl; + return (error); } int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) { struct proc_handle *phdl; - int error = 0; - int status; + int error, status; if (pid == 0 || pid == getpid()) return (EINVAL); + if (elf_version(EV_CURRENT) == EV_NONE) + return (ENOENT); /* * Allocate memory for the process handle, a structure containing * all things related to the process. */ - if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) - return (ENOMEM); - - elf_version(EV_CURRENT); - - error = proc_init(pid, flags, PS_RUN, phdl); + error = proc_init(pid, flags, PS_RUN, &phdl); if (error != 0) goto out; @@ -106,16 +153,17 @@ proc_attach(pid_t pid, int flags, struct } /* Check for an unexpected status. */ - if (WIFSTOPPED(status) == 0) + if (!WIFSTOPPED(status)) DPRINTFX("ERROR: child process %d status 0x%x", pid, status); else phdl->status = PS_STOP; out: - if (error) + if (error && phdl != NULL) { proc_free(phdl); - else - *pphdl = phdl; + phdl = NULL; + } + *pphdl = phdl; return (error); } @@ -128,14 +176,8 @@ proc_create(const char *file, char * con int status; pid_t pid; - /* - * Allocate memory for the process handle, a structure containing - * all things related to the process. - */ - if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) - return (ENOMEM); - - elf_version(EV_CURRENT); + if (elf_version(EV_CURRENT) == EV_NONE) + return (ENOENT); /* Fork a new process. */ if ((pid = vfork()) == -1) @@ -153,9 +195,10 @@ proc_create(const char *file, char * con /* Couldn't execute the file. */ _exit(2); + /* NOTREACHED */ } else { /* The parent owns the process handle. */ - error = proc_init(pid, 0, PS_IDLE, phdl); + error = proc_init(pid, 0, PS_IDLE, &phdl); if (error != 0) goto bad; @@ -167,7 +210,7 @@ proc_create(const char *file, char * con } /* Check for an unexpected status. */ - if (WIFSTOPPED(status) == 0) { + if (!WIFSTOPPED(status)) { error = errno; DPRINTFX("ERROR: child process %d status 0x%x", pid, status); goto bad; @@ -175,15 +218,19 @@ proc_create(const char *file, char * con phdl->status = PS_STOP; } bad: - if (error) + if (error && phdl != NULL) { proc_free(phdl); - else - *pphdl = phdl; + phdl = NULL; + } + *pphdl = phdl; return (error); } void proc_free(struct proc_handle *phdl) { + + if (phdl->procstat != NULL) + procstat_close(phdl->procstat); free(phdl); } Modified: user/alc/PQ_LAUNDRY/lib/libproc/proc_rtld.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/proc_rtld.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/proc_rtld.c Mon Aug 1 21:28:34 2016 (r303642) @@ -49,7 +49,7 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->rdobjs == NULL) return (-1); } - if (strcmp(lop->rdl_path, phdl->execname) == 0 && + if (strcmp(lop->rdl_path, phdl->execpath) == 0 && (lop->rdl_prot & RD_RDL_X) != 0) phdl->rdexec = &phdl->rdobjs[phdl->nobjs]; memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop)); Modified: user/alc/PQ_LAUNDRY/lib/libproc/proc_util.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/proc_util.c Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/libproc/proc_util.c Mon Aug 1 21:28:34 2016 (r303642) @@ -140,6 +140,16 @@ proc_getpid(struct proc_handle *phdl) } int +proc_getmodel(struct proc_handle *phdl) +{ + + if (phdl == NULL) + return (-1); + + return (phdl->model); +} + +int proc_wstatus(struct proc_handle *phdl) { int status; Modified: user/alc/PQ_LAUNDRY/lib/librtld_db/Makefile ============================================================================== --- user/alc/PQ_LAUNDRY/lib/librtld_db/Makefile Mon Aug 1 21:21:26 2016 (r303641) +++ user/alc/PQ_LAUNDRY/lib/librtld_db/Makefile Mon Aug 1 21:28:34 2016 (r303642) @@ -14,4 +14,6 @@ CFLAGS+= -I${.CURDIR} # Avoid circular dependency, we only need the libproc.h header here. CFLAGS+= -I${.CURDIR:H}/libproc +LIBADD+= elf procstat + .include *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Mon Aug 1 21:49:36 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC20BAB6F7 for ; Mon, 1 Aug 2016 21:49:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 88F1B1508; Mon, 1 Aug 2016 21:49:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u71LnZ4S003825; Mon, 1 Aug 2016 21:49:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u71LnZNu003824; Mon, 1 Aug 2016 21:49:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608012149.u71LnZNu003824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 1 Aug 2016 21:49:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303644 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 21:49:36 -0000 Author: alc Date: Mon Aug 1 21:49:35 2016 New Revision: 303644 URL: https://svnweb.freebsd.org/changeset/base/303644 Log: Style. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Mon Aug 1 21:48:37 2016 (r303643) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Mon Aug 1 21:49:35 2016 (r303644) @@ -1090,8 +1090,7 @@ vm_pageout_laundry_worker(void *arg) struct vm_domain *domain; uint64_t ninact, nlaundry; u_int wakeups, gen; - int cycle, domidx, launder; - int shortfall, prev_shortfall, target; + int cycle, domidx, launder, prev_shortfall, shortfall, target; domidx = (uintptr_t)arg; domain = &vm_dom[domidx]; From owner-svn-src-user@freebsd.org Mon Aug 1 22:53:30 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DEC1BACA45 for ; Mon, 1 Aug 2016 22:53:30 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE0591254; Mon, 1 Aug 2016 22:53:29 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u71MrTfW029886; Mon, 1 Aug 2016 22:53:29 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u71MrT3q029885; Mon, 1 Aug 2016 22:53:29 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608012253.u71MrT3q029885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Mon, 1 Aug 2016 22:53:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303649 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2016 22:53:30 -0000 Author: alc Date: Mon Aug 1 22:53:28 2016 New Revision: 303649 URL: https://svnweb.freebsd.org/changeset/base/303649 Log: Update a couple comments. In particular, explain why we dequeue the page early in vm_pageout_scan(). Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Mon Aug 1 22:41:50 2016 (r303648) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Mon Aug 1 22:53:28 2016 (r303649) @@ -948,9 +948,8 @@ vm_pageout_launder(struct vm_domain *vmd } /* - * We unlock the laundry queue, invalidating the - * 'next' pointer. Use our marker to remember our - * place. + * Unlock the laundry queue, invalidating the 'next' pointer. + * Use a marker to remember our place in the laundry queue. */ TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_laundry_marker, plinks.q); @@ -1333,9 +1332,12 @@ unlock_page: KASSERT(m->hold_count == 0, ("Held page %p", m)); /* - * We unlock the inactive page queue, invalidating the - * 'next' pointer. Use our marker to remember our - * place. + * Dequeue the inactive page and unlock the inactive page + * queue, invalidating the 'next' pointer. Dequeueing the + * page here avoids a later reacquisition (and release) of + * the inactive page queue lock when vm_page_activate(), + * vm_page_free(), or vm_page_launder() is called. Use a + * marker to remember our place in the inactive queue. */ TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_marker, plinks.q); vm_page_dequeue_locked(m); From owner-svn-src-user@freebsd.org Tue Aug 2 02:29:50 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2140FBAB38B for ; Tue, 2 Aug 2016 02:29:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC4691B7C; Tue, 2 Aug 2016 02:29:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u722TnN1008258; Tue, 2 Aug 2016 02:29:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u722Tnas008257; Tue, 2 Aug 2016 02:29:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608020229.u722Tnas008257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 2 Aug 2016 02:29:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303653 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 02:29:50 -0000 Author: markj Date: Tue Aug 2 02:29:48 2016 New Revision: 303653 URL: https://svnweb.freebsd.org/changeset/base/303653 Log: Add a parameter to vm_pageout_launder() to indicate shortfall. Otherwise vm_pageout_launder() is repeating a computation of its caller. Suggested by: alc Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 00:15:08 2016 (r303652) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 02:29:48 2016 (r303653) @@ -249,7 +249,8 @@ SYSCTL_INT(_vm, OID_AUTO, max_wired, CTLFLAG_RW, &vm_page_max_wired, 0, "System-wide limit to wired page count"); static boolean_t vm_pageout_fallback_object_lock(vm_page_t, vm_page_t *); -static int vm_pageout_launder(struct vm_domain *vmd, int launder); +static int vm_pageout_launder(struct vm_domain *vmd, int launder, + bool shortfall); static void vm_pageout_laundry_worker(void *arg); #if !defined(NO_SWAPPING) static void vm_pageout_map_deactivate_pages(vm_map_t, long); @@ -892,14 +893,14 @@ unlock_mp: * Returns the number of pages successfully laundered. */ static int -vm_pageout_launder(struct vm_domain *vmd, int launder) +vm_pageout_launder(struct vm_domain *vmd, int launder, bool shortfall) { vm_page_t m, next; struct vm_pagequeue *pq; vm_object_t object; int act_delta, error, maxscan, numpagedout, starting_target; int vnodes_skipped; - boolean_t pageout_ok, queue_locked, shortfall; + boolean_t pageout_ok, queue_locked; starting_target = launder; vnodes_skipped = 0; @@ -916,7 +917,6 @@ vm_pageout_launder(struct vm_domain *vmd */ pq = &vmd->vmd_pagequeues[PQ_LAUNDRY]; maxscan = pq->pq_cnt; - shortfall = vm_laundry_target() > 0; vm_pagequeue_lock(pq); queue_locked = TRUE; @@ -1191,8 +1191,8 @@ vm_pageout_laundry_worker(void *arg) dolaundry: if (launder > 0) - target -= min(vm_pageout_launder(domain, launder), - target); + target -= min(vm_pageout_launder(domain, launder, + shortfall > 0), target); tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL); From owner-svn-src-user@freebsd.org Tue Aug 2 02:32:02 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFA1BBAB4BB for ; Tue, 2 Aug 2016 02:32:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7C9421D96; Tue, 2 Aug 2016 02:32:02 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u722W1aE009665; Tue, 2 Aug 2016 02:32:01 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u722W09E009649; Tue, 2 Aug 2016 02:32:00 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201608020232.u722W09E009649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 2 Aug 2016 02:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303654 - in user/alc/PQ_LAUNDRY/sys: ddb dev/cxgbe dev/cxgbe/iw_cxgbe dev/pci kern net ofed/drivers/infiniband/ulp/ipoib opencrypto sys X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 02:32:02 -0000 Author: markj Date: Tue Aug 2 02:32:00 2016 New Revision: 303654 URL: https://svnweb.freebsd.org/changeset/base/303654 Log: MFH r303653 Modified: user/alc/PQ_LAUNDRY/sys/ddb/db_ps.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/adapter.h user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/cq.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/qp.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_netmap.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_sge.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c user/alc/PQ_LAUNDRY/sys/kern/subr_lock.c user/alc/PQ_LAUNDRY/sys/net/route.h user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c user/alc/PQ_LAUNDRY/sys/opencrypto/xform_aes_icm.c user/alc/PQ_LAUNDRY/sys/sys/lock.h Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) Modified: user/alc/PQ_LAUNDRY/sys/ddb/db_ps.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/ddb/db_ps.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/ddb/db_ps.c Tue Aug 2 02:32:00 2016 (r303654) @@ -440,9 +440,16 @@ DB_SHOW_COMMAND(proc, db_show_proc) p->p_leader); if (p->p_sysent != NULL) db_printf(" ABI: %s\n", p->p_sysent->sv_name); - if (p->p_args != NULL) - db_printf(" arguments: %.*s\n", (int)p->p_args->ar_length, - p->p_args->ar_args); + if (p->p_args != NULL) { + db_printf(" arguments: "); + for (i = 0; i < (int)p->p_args->ar_length; i++) { + if (p->p_args->ar_args[i] == '\0') + db_printf(" "); + else + db_printf("%c", p->p_args->ar_args[i]); + } + db_printf("\n"); + } db_printf(" threads: %d\n", p->p_numthreads); FOREACH_THREAD_IN_PROC(p, td) { dumpthread(p, td, 1); Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/adapter.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/adapter.h Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/adapter.h Tue Aug 2 02:32:00 2016 (r303654) @@ -781,6 +781,8 @@ struct adapter { struct sge_rxq *rxq; struct sge_nm_rxq *nm_rxq; } __aligned(CACHE_LINE_SIZE) *irq; + int sge_gts_reg; + int sge_kdoorbell_reg; bus_dma_tag_t dmat; /* Parent DMA tag */ Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/cq.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/cq.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/cq.c Tue Aug 2 02:32:00 2016 (r303654) @@ -172,7 +172,7 @@ create_cq(struct c4iw_rdev *rdev, struct cq->gen = 1; cq->gts = (void *)((unsigned long)rman_get_virtual(sc->regs_res) + - MYPF_REG(SGE_PF_GTS)); + sc->sge_gts_reg); cq->rdev = rdev; if (user) { Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/qp.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/qp.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/iw_cxgbe/qp.c Tue Aug 2 02:32:00 2016 (r303654) @@ -182,9 +182,9 @@ static int create_qp(struct c4iw_rdev *r pci_unmap_addr_set(&wq->rq, mapping, wq->rq.dma_addr); wq->db = (void *)((unsigned long)rman_get_virtual(sc->regs_res) + - MYPF_REG(SGE_PF_KDOORBELL)); + sc->sge_kdoorbell_reg); wq->gts = (void *)((unsigned long)rman_get_virtual(rdev->adap->regs_res) - + MYPF_REG(SGE_PF_GTS)); + + sc->sge_gts_reg); if (user) { wq->sq.udb = (u64)((char*)rman_get_virtual(rdev->adap->udbs_res) + (wq->sq.qid << rdev->qpshift)); Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c Tue Aug 2 02:32:00 2016 (r303654) @@ -697,6 +697,8 @@ t4_attach(device_t dev) sc->params.pci.mps = 128 << ((v & PCIEM_CTL_MAX_PAYLOAD) >> 5); } + sc->sge_gts_reg = MYPF_REG(A_SGE_PF_GTS); + sc->sge_kdoorbell_reg = MYPF_REG(A_SGE_PF_KDOORBELL); sc->traceq = -1; mtx_init(&sc->ifp_lock, sc->ifp_lockname, 0, MTX_DEF); snprintf(sc->ifp_lockname, sizeof(sc->ifp_lockname), "%s tracer", Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_netmap.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_netmap.c Tue Aug 2 02:32:00 2016 (r303654) @@ -204,7 +204,7 @@ alloc_nm_rxq_hwq(struct vi_info *vi, str } } - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), + t4_write_reg(sc, sc->sge_gts_reg, V_INGRESSQID(nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); @@ -364,7 +364,7 @@ cxgbe_netmap_on(struct adapter *sc, stru MPASS((j & 7) == 0); j /= 8; /* driver pidx to hardware pidx */ wmb(); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(j)); atomic_cmpset_int(&irq->nm_state, NM_OFF, NM_ON); @@ -537,7 +537,7 @@ ring_nm_txq_db(struct adapter *sc, struc break; case DOORBELL_KDB: - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, V_QID(nm_txq->cntxt_id) | V_PIDX(n)); break; } @@ -818,7 +818,7 @@ cxgbe_netmap_rxsync(struct netmap_kring } if (++dbinc == 8 && n >= 32) { wmb(); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(dbinc)); dbinc = 0; } @@ -827,7 +827,7 @@ cxgbe_netmap_rxsync(struct netmap_kring if (dbinc > 0) { wmb(); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(dbinc)); } } @@ -981,14 +981,14 @@ t4_nm_intr(void *arg) fl_credits /= 8; IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, nm_rxq->fl_sidx); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(fl_credits)); fl_credits = fl_cidx & 7; } else if (!black_hole) { netmap_rx_irq(ifp, nm_rxq->nid, &work); MPASS(work != 0); } - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(n) | V_INGRESSQID(nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); n = 0; @@ -999,12 +999,12 @@ t4_nm_intr(void *arg) if (black_hole) { fl_credits /= 8; IDXINCR(nm_rxq->fl_pidx, fl_credits * 8, nm_rxq->fl_sidx); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, nm_rxq->fl_db_val | V_PIDX(fl_credits)); } else netmap_rx_irq(ifp, nm_rxq->nid, &work); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(n) | + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(n) | V_INGRESSQID((u32)nm_rxq->iq_cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(holdoff_tmr_idx))); } Modified: user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_sge.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_sge.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_sge.c Tue Aug 2 02:32:00 2016 (r303654) @@ -1474,7 +1474,7 @@ service_iq(struct sge_iq *iq, int budget d = &iq->desc[0]; } if (__predict_false(++ndescs == limit)) { - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID(iq->cntxt_id) | V_SEINTARM(V_QINTR_TIMER_IDX(X_TIMERREG_UPDATE_CIDX))); @@ -1529,7 +1529,7 @@ process_iql: } #endif - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_CIDXINC(ndescs) | + t4_write_reg(sc, sc->sge_gts_reg, V_CIDXINC(ndescs) | V_INGRESSQID((u32)iq->cntxt_id) | V_SEINTARM(iq->intr_params)); if (iq->flags & IQ_HAS_FL) { @@ -2793,7 +2793,7 @@ alloc_iq_fl(struct vi_info *vi, struct s /* Enable IQ interrupts */ atomic_store_rel_int(&iq->state, IQS_IDLE); - t4_write_reg(sc, MYPF_REG(A_SGE_PF_GTS), V_SEINTARM(iq->intr_params) | + t4_write_reg(sc, sc->sge_gts_reg, V_SEINTARM(iq->intr_params) | V_INGRESSQID(iq->cntxt_id)); return (0); @@ -3676,7 +3676,7 @@ ring_fl_db(struct adapter *sc, struct sg if (fl->udb) *fl->udb = htole32(v); else - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), v); + t4_write_reg(sc, sc->sge_kdoorbell_reg, v); IDXINCR(fl->dbidx, n, fl->sidx); } @@ -4409,7 +4409,7 @@ ring_eq_db(struct adapter *sc, struct sg break; case DOORBELL_KDB: - t4_write_reg(sc, MYPF_REG(A_SGE_PF_KDOORBELL), + t4_write_reg(sc, sc->sge_kdoorbell_reg, V_QID(eq->cntxt_id) | V_PIDX(n)); break; } Modified: user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/dev/pci/pci_pci.c Tue Aug 2 02:32:00 2016 (r303654) @@ -932,6 +932,13 @@ pcib_probe_hotplug(struct pcib_softc *sc sc->pcie_link_cap = pcie_read_config(dev, PCIER_LINK_CAP, 4); sc->pcie_slot_cap = pcie_read_config(dev, PCIER_SLOT_CAP, 4); + /* + * XXX: Handling of slots with a power controller needs to be + * reexamined. Ignore hotplug on such slots for now. + */ + if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_PCP) + return; + if (sc->pcie_slot_cap & PCIEM_SLOT_CAP_HPC) sc->flags |= PCIB_HOTPLUG; } Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c Tue Aug 2 02:32:00 2016 (r303654) @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -138,6 +139,37 @@ struct lock_class lock_class_mtx_spin = #endif }; +#ifdef ADAPTIVE_MUTEXES +static SYSCTL_NODE(_debug, OID_AUTO, mtx, CTLFLAG_RD, NULL, "mtx debugging"); + +static struct lock_delay_config mtx_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_initial, CTLFLAG_RW, &mtx_delay.initial, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_step, CTLFLAG_RW, &mtx_delay.step, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_min, CTLFLAG_RW, &mtx_delay.min, + 0, ""); +SYSCTL_INT(_debug_mtx, OID_AUTO, delay_max, CTLFLAG_RW, &mtx_delay.max, + 0, ""); + +static void +mtx_delay_sysinit(void *dummy) +{ + + mtx_delay.initial = mp_ncpus * 25; + mtx_delay.step = (mp_ncpus * 25) / 2; + mtx_delay.min = mp_ncpus * 5; + mtx_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(mtx_delay_sysinit); +#endif + /* * System-wide mutexes */ @@ -408,8 +440,10 @@ __mtx_lock_sleep(volatile uintptr_t *c, int contested = 0; uint64_t waittime = 0; #endif +#if defined(ADAPTIVE_MUTEXES) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS - u_int spin_cnt = 0; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; @@ -418,6 +452,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_MUTEXES) || defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, &mtx_delay); +#endif m = mtxlock2mtx(c); if (mtx_owned(m)) { @@ -451,7 +488,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, if (m->mtx_lock == MTX_UNOWNED && _mtx_obtain_lock(m, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef ADAPTIVE_MUTEXES /* @@ -471,12 +508,8 @@ __mtx_lock_sleep(volatile uintptr_t *c, "spinning", "lockname:\"%s\"", m->lock_object.lo_name); while (mtx_owner(m) == owner && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname((struct thread *)tid), "running"); @@ -570,7 +603,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, /* * Only record the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD1(adaptive__spin, m, all_time - sleep_time); #endif } Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c Tue Aug 2 02:32:00 2016 (r303654) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -65,15 +66,6 @@ PMC_SOFT_DECLARE( , , lock, failed); */ #define rwlock2rw(c) (__containerof(c, struct rwlock, rw_lock)) -#ifdef ADAPTIVE_RWLOCKS -static int rowner_retries = 10; -static int rowner_loops = 10000; -static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, - "rwlock debugging"); -SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); -SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); -#endif - #ifdef DDB #include @@ -100,6 +92,42 @@ struct lock_class lock_class_rw = { #endif }; +#ifdef ADAPTIVE_RWLOCKS +static int rowner_retries = 10; +static int rowner_loops = 10000; +static SYSCTL_NODE(_debug, OID_AUTO, rwlock, CTLFLAG_RD, NULL, + "rwlock debugging"); +SYSCTL_INT(_debug_rwlock, OID_AUTO, retry, CTLFLAG_RW, &rowner_retries, 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, loops, CTLFLAG_RW, &rowner_loops, 0, ""); + +static struct lock_delay_config rw_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_initial, CTLFLAG_RW, &rw_delay.initial, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_step, CTLFLAG_RW, &rw_delay.step, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_min, CTLFLAG_RW, &rw_delay.min, + 0, ""); +SYSCTL_INT(_debug_rwlock, OID_AUTO, delay_max, CTLFLAG_RW, &rw_delay.max, + 0, ""); + +static void +rw_delay_sysinit(void *dummy) +{ + + rw_delay.initial = mp_ncpus * 25; + rw_delay.step = (mp_ncpus * 25) / 2; + rw_delay.min = mp_ncpus * 5; + rw_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(rw_delay_sysinit); +#endif + /* * Return a pointer to the owning thread if the lock is write-locked or * NULL if the lock is unlocked or read-locked. @@ -355,9 +383,11 @@ __rw_rlock(volatile uintptr_t *c, const int contested = 0; #endif uintptr_t v; +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - u_int spin_cnt = 0; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; @@ -366,6 +396,9 @@ __rw_rlock(volatile uintptr_t *c, const if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, &rw_delay); +#endif rw = rwlock2rw(c); KASSERT(kdb_active != 0 || !TD_IS_IDLETHREAD(curthread), @@ -412,7 +445,7 @@ __rw_rlock(volatile uintptr_t *c, const continue; } #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -437,12 +470,8 @@ __rw_rlock(volatile uintptr_t *c, const sched_tdname(curthread), "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == - owner && TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + owner && TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -459,7 +488,7 @@ __rw_rlock(volatile uintptr_t *c, const cpu_spinwait(); } #ifdef KDTRACE_HOOKS - spin_cnt += rowner_loops - i; + lda.spin_cnt += rowner_loops - i; #endif KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); @@ -552,7 +581,7 @@ __rw_rlock(volatile uintptr_t *c, const (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_READER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); @@ -740,9 +769,11 @@ __rw_wlock_hard(volatile uintptr_t *c, u uint64_t waittime = 0; int contested = 0; #endif +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - u_int spin_cnt = 0; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; @@ -751,6 +782,9 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (SCHEDULER_STOPPED()) return; +#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, &rw_delay); +#endif rw = rwlock2rw(c); if (rw_wlocked(rw)) { @@ -775,7 +809,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (rw->rw_lock == RW_UNLOCKED && _rw_write_lock(rw, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -798,12 +832,8 @@ __rw_wlock_hard(volatile uintptr_t *c, u "spinning", "lockname:\"%s\"", rw->lock_object.lo_name); while ((struct thread*)RW_OWNER(rw->rw_lock) == owner && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -828,7 +858,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); #ifdef KDTRACE_HOOKS - spin_cnt += rowner_loops - i; + lda.spin_cnt += rowner_loops - i; #endif if (i != rowner_loops) continue; @@ -918,7 +948,7 @@ __rw_wlock_hard(volatile uintptr_t *c, u (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); /* Record only the loops spinning and not sleeping. */ - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(rw__spin, rw, all_time - sleep_time, LOCKSTAT_WRITER, (state & RW_LOCK_READ) == 0, (state & RW_LOCK_READ) == 0 ? 0 : RW_READERS(state)); Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c Tue Aug 2 02:32:00 2016 (r303654) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #if defined(SMP) && !defined(NO_ADAPTIVE_SX) @@ -145,6 +146,33 @@ static u_int asx_loops = 10000; static SYSCTL_NODE(_debug, OID_AUTO, sx, CTLFLAG_RD, NULL, "sxlock debugging"); SYSCTL_UINT(_debug_sx, OID_AUTO, retries, CTLFLAG_RW, &asx_retries, 0, ""); SYSCTL_UINT(_debug_sx, OID_AUTO, loops, CTLFLAG_RW, &asx_loops, 0, ""); + +static struct lock_delay_config sx_delay = { + .initial = 1000, + .step = 500, + .min = 100, + .max = 5000, +}; + +SYSCTL_INT(_debug_sx, OID_AUTO, delay_initial, CTLFLAG_RW, &sx_delay.initial, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_step, CTLFLAG_RW, &sx_delay.step, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_min, CTLFLAG_RW, &sx_delay.min, + 0, ""); +SYSCTL_INT(_debug_sx, OID_AUTO, delay_max, CTLFLAG_RW, &sx_delay.max, + 0, ""); + +static void +sx_delay_sysinit(void *dummy) +{ + + sx_delay.initial = mp_ncpus * 25; + sx_delay.step = (mp_ncpus * 25) / 2; + sx_delay.min = mp_ncpus * 5; + sx_delay.max = mp_ncpus * 25 * 10; +} +LOCK_DELAY_SYSINIT(sx_delay_sysinit); #endif void @@ -513,9 +541,11 @@ _sx_xlock_hard(struct sx *sx, uintptr_t int contested = 0; #endif int error = 0; +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - u_int spin_cnt = 0; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; @@ -524,6 +554,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t if (SCHEDULER_STOPPED()) return (0); +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, &sx_delay); +#endif + /* If we already hold an exclusive lock, then recurse. */ if (sx_xlocked(sx)) { KASSERT((sx->lock_object.lo_flags & LO_RECURSABLE) != 0, @@ -549,7 +583,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t atomic_cmpset_acq_ptr(&sx->sx_lock, SX_LOCK_UNLOCKED, tid)) break; #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif #ifdef HWPMC_HOOKS PMC_SOFT_CALL( , , lock, failed); @@ -578,12 +612,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -605,7 +635,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t break; cpu_spinwait(); #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif } KTR_STATE0(KTR_SCHED, "thread", @@ -725,7 +755,7 @@ _sx_xlock_hard(struct sx *sx, uintptr_t LOCKSTAT_RECORD4(sx__block, sx, sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_WRITER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); @@ -818,9 +848,11 @@ _sx_slock_hard(struct sx *sx, int opts, #endif uintptr_t x; int error = 0; +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + struct lock_delay_arg lda; +#endif #ifdef KDTRACE_HOOKS uintptr_t state; - u_int spin_cnt = 0; u_int sleep_cnt = 0; int64_t sleep_time = 0; int64_t all_time = 0; @@ -829,6 +861,9 @@ _sx_slock_hard(struct sx *sx, int opts, if (SCHEDULER_STOPPED()) return (0); +#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, &sx_delay); +#endif #ifdef KDTRACE_HOOKS state = sx->sx_lock; all_time -= lockstat_nsecs(&sx->lock_object); @@ -840,7 +875,7 @@ _sx_slock_hard(struct sx *sx, int opts, */ for (;;) { #ifdef KDTRACE_HOOKS - spin_cnt++; + lda.spin_cnt++; #endif x = sx->sx_lock; @@ -888,12 +923,8 @@ _sx_slock_hard(struct sx *sx, int opts, "lockname:\"%s\"", sx->lock_object.lo_name); GIANT_SAVE(); while (SX_OWNER(sx->sx_lock) == x && - TD_IS_RUNNING(owner)) { - cpu_spinwait(); -#ifdef KDTRACE_HOOKS - spin_cnt++; -#endif - } + TD_IS_RUNNING(owner)) + lock_delay(&lda); KTR_STATE0(KTR_SCHED, "thread", sched_tdname(curthread), "running"); continue; @@ -989,7 +1020,7 @@ _sx_slock_hard(struct sx *sx, int opts, LOCKSTAT_RECORD4(sx__block, sx, sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); - if (spin_cnt > sleep_cnt) + if (lda.spin_cnt > sleep_cnt) LOCKSTAT_RECORD4(sx__spin, sx, all_time - sleep_time, LOCKSTAT_READER, (state & SX_LOCK_SHARED) == 0, (state & SX_LOCK_SHARED) == 0 ? 0 : SX_SHARERS(state)); Modified: user/alc/PQ_LAUNDRY/sys/kern/subr_lock.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/subr_lock.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/kern/subr_lock.c Tue Aug 2 02:32:00 2016 (r303654) @@ -103,6 +103,34 @@ lock_destroy(struct lock_object *lock) lock->lo_flags &= ~LO_INITIALIZED; } +void +lock_delay(struct lock_delay_arg *la) +{ + u_int i, delay, backoff, min, max; + struct lock_delay_config *lc = la->config; + + delay = la->delay; + + if (delay == 0) + delay = lc->initial; + else { + delay += lc->step; + max = lc->max; + if (delay > max) + delay = max; + } + + backoff = cpu_ticks() % delay; + min = lc->min; + if (backoff < min) + backoff = min; + for (i = 0; i < backoff; i++) + cpu_spinwait(); + + la->delay = delay; + la->spin_cnt += backoff; +} + #ifdef DDB DB_SHOW_COMMAND(lock, db_show_lock) { Modified: user/alc/PQ_LAUNDRY/sys/net/route.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/net/route.h Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/net/route.h Tue Aug 2 02:32:00 2016 (r303654) @@ -360,7 +360,7 @@ struct rt_addrinfo { || (ifp)->if_link_state == LINK_STATE_UP) #define RT_LOCK_INIT(_rt) \ - mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK) + mtx_init(&(_rt)->rt_mtx, "rtentry", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW) #define RT_LOCK(_rt) mtx_lock(&(_rt)->rt_mtx) #define RT_UNLOCK(_rt) mtx_unlock(&(_rt)->rt_mtx) #define RT_LOCK_DESTROY(_rt) mtx_destroy(&(_rt)->rt_mtx) Modified: user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Aug 2 02:32:00 2016 (r303654) @@ -660,7 +660,13 @@ ipoib_unicast_send(struct mbuf *mb, stru new_path = 1; } if (path) { - _IF_ENQUEUE(&path->queue, mb); + if (_IF_QLEN(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) + _IF_ENQUEUE(&path->queue, mb); + else { + if_inc_counter(priv->dev, IFCOUNTER_OERRORS, 1); + m_freem(mb); + } + if (!path->query && path_rec_start(priv, path)) { spin_unlock_irqrestore(&priv->lock, flags); if (new_path) Modified: user/alc/PQ_LAUNDRY/sys/opencrypto/xform_aes_icm.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/opencrypto/xform_aes_icm.c Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/opencrypto/xform_aes_icm.c Tue Aug 2 02:32:00 2016 (r303654) @@ -65,7 +65,7 @@ struct enc_xform enc_xform_aes_icm = { aes_icm_crypt, aes_icm_crypt, aes_icm_setkey, - rijndael128_zerokey, + aes_icm_zerokey, aes_icm_reinit, }; Modified: user/alc/PQ_LAUNDRY/sys/sys/lock.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/sys/lock.h Tue Aug 2 02:29:48 2016 (r303653) +++ user/alc/PQ_LAUNDRY/sys/sys/lock.h Tue Aug 2 02:32:00 2016 (r303654) @@ -201,9 +201,33 @@ extern struct lock_class lock_class_lock extern struct lock_class *lock_classes[]; +struct lock_delay_config { + u_int initial; + u_int step; + u_int min; + u_int max; +}; + +struct lock_delay_arg { + struct lock_delay_config *config; + u_int delay; + u_int spin_cnt; +}; + +static inline void +lock_delay_arg_init(struct lock_delay_arg *la, struct lock_delay_config *lc) { + la->config = lc; + la->delay = 0; + la->spin_cnt = 0; +} + +#define LOCK_DELAY_SYSINIT(func) \ + SYSINIT(func##_ld, SI_SUB_LOCK, SI_ORDER_ANY, func, NULL) + void lock_init(struct lock_object *, struct lock_class *, const char *, const char *, int); void lock_destroy(struct lock_object *); +void lock_delay(struct lock_delay_arg *); void spinlock_enter(void); void spinlock_exit(void); void witness_init(struct lock_object *, const char *); From owner-svn-src-user@freebsd.org Tue Aug 2 15:49:35 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB30CBAD112 for ; Tue, 2 Aug 2016 15:49:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9EF9116D3; Tue, 2 Aug 2016 15:49:35 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u72FnYqH003211; Tue, 2 Aug 2016 15:49:34 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u72FnYhG003210; Tue, 2 Aug 2016 15:49:34 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608021549.u72FnYhG003210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 2 Aug 2016 15:49:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303666 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 15:49:36 -0000 Author: alc Date: Tue Aug 2 15:49:34 2016 New Revision: 303666 URL: https://svnweb.freebsd.org/changeset/base/303666 Log: Use "bool" in new code. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 15:44:49 2016 (r303665) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 15:49:34 2016 (r303666) @@ -900,7 +900,7 @@ vm_pageout_launder(struct vm_domain *vmd vm_object_t object; int act_delta, error, maxscan, numpagedout, starting_target; int vnodes_skipped; - boolean_t pageout_ok, queue_locked; + bool pageout_ok, queue_locked; starting_target = launder; vnodes_skipped = 0; @@ -919,7 +919,7 @@ vm_pageout_launder(struct vm_domain *vmd maxscan = pq->pq_cnt; vm_pagequeue_lock(pq); - queue_locked = TRUE; + queue_locked = true; for (m = TAILQ_FIRST(&pq->pq_pl); m != NULL && maxscan-- > 0 && launder > 0; m = next) { @@ -954,7 +954,7 @@ vm_pageout_launder(struct vm_domain *vmd TAILQ_INSERT_AFTER(&pq->pq_pl, m, &vmd->vmd_laundry_marker, plinks.q); vm_pagequeue_unlock(pq); - queue_locked = FALSE; + queue_locked = false; /* * Invalid pages can be easily freed. They cannot be @@ -1033,15 +1033,15 @@ free_page: } else if ((object->flags & OBJ_DEAD) == 0) { if (object->type != OBJT_SWAP && object->type != OBJT_DEFAULT) - pageout_ok = TRUE; + pageout_ok = true; else if (disable_swap_pageouts) - pageout_ok = FALSE; + pageout_ok = false; else - pageout_ok = TRUE; + pageout_ok = true; if (!pageout_ok) { requeue_page: vm_pagequeue_lock(pq); - queue_locked = TRUE; + queue_locked = true; vm_page_requeue_locked(m); goto drop_page; } @@ -1061,7 +1061,7 @@ drop_page: relock_queue: if (!queue_locked) { vm_pagequeue_lock(pq); - queue_locked = TRUE; + queue_locked = true; } next = TAILQ_NEXT(&vmd->vmd_laundry_marker, plinks.q); TAILQ_REMOVE(&pq->pq_pl, &vmd->vmd_laundry_marker, plinks.q); From owner-svn-src-user@freebsd.org Tue Aug 2 15:52:17 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84745BAD33D for ; Tue, 2 Aug 2016 15:52:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E2241A04; Tue, 2 Aug 2016 15:52:17 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u72FqGji006612; Tue, 2 Aug 2016 15:52:16 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u72FqEjN006587; Tue, 2 Aug 2016 15:52:14 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608021552.u72FqEjN006587@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 2 Aug 2016 15:52:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303667 - in user/alc/PQ_LAUNDRY: sbin/pfctl sys/arm64/arm64 sys/boot/fdt/dts/riscv sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace/riscv sys/conf sys/kern sys/netinet s... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 15:52:17 -0000 Author: alc Date: Tue Aug 2 15:52:14 2016 New Revision: 303667 URL: https://svnweb.freebsd.org/changeset/base/303667 Log: MFH r303666 Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/riscv/spike.dts user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_asm.S user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_subr.c user/alc/PQ_LAUNDRY/sys/conf/ldscript.riscv user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.h user/alc/PQ_LAUNDRY/sys/netinet6/ip6_output.c user/alc/PQ_LAUNDRY/sys/riscv/conf/GENERIC user/alc/PQ_LAUNDRY/sys/riscv/htif/htif.c user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_block.c user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_console.c user/alc/PQ_LAUNDRY/sys/riscv/include/cpu.h user/alc/PQ_LAUNDRY/sys/riscv/include/cpufunc.h user/alc/PQ_LAUNDRY/sys/riscv/include/db_machdep.h user/alc/PQ_LAUNDRY/sys/riscv/include/intr.h user/alc/PQ_LAUNDRY/sys/riscv/include/pte.h user/alc/PQ_LAUNDRY/sys/riscv/include/riscvreg.h user/alc/PQ_LAUNDRY/sys/riscv/include/vmparam.h user/alc/PQ_LAUNDRY/sys/riscv/riscv/exception.S user/alc/PQ_LAUNDRY/sys/riscv/riscv/genassym.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/identcpu.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/intr_machdep.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/locore.S user/alc/PQ_LAUNDRY/sys/riscv/riscv/machdep.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/pmap.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/swtch.S user/alc/PQ_LAUNDRY/sys/riscv/riscv/timer.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/trap.c user/alc/PQ_LAUNDRY/sys/riscv/riscv/vm_machdep.c user/alc/PQ_LAUNDRY/usr.bin/sed/Makefile user/alc/PQ_LAUNDRY/usr.bin/sed/compile.c user/alc/PQ_LAUNDRY/usr.bin/sed/defs.h user/alc/PQ_LAUNDRY/usr.bin/sed/extern.h user/alc/PQ_LAUNDRY/usr.bin/sed/main.c user/alc/PQ_LAUNDRY/usr.bin/sed/misc.c user/alc/PQ_LAUNDRY/usr.bin/sed/process.c Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y Tue Aug 2 15:52:14 2016 (r303667) @@ -3593,8 +3593,8 @@ tos : STRING { else if ($1[0] == '0' && $1[1] == 'x') $$ = strtoul($1, NULL, 16); else - $$ = 0; /* flag bad argument */ - if (!$$ || $$ > 255) { + $$ = 256; /* flag bad argument */ + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); free($1); YYERROR; @@ -3603,7 +3603,7 @@ tos : STRING { } | NUMBER { $$ = $1; - if (!$$ || $$ > 255) { + if ($$ < 0 || $$ > 255) { yyerror("illegal tos value %s", $1); YYERROR; } Modified: user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c Tue Aug 2 15:52:14 2016 (r303667) @@ -782,7 +782,7 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offs virtual_avail = roundup2(freemempos, L1_SIZE); virtual_end = VM_MAX_KERNEL_ADDRESS - L2_SIZE; kernel_vm_end = virtual_avail; - + pa = pmap_early_vtophys(l1pt, freemempos); /* Finish initialising physmap */ @@ -908,7 +908,7 @@ pmap_invalidate_all(pmap_t pmap) * Extract the physical page address associated * with the given map/virtual_address pair. */ -vm_paddr_t +vm_paddr_t pmap_extract(pmap_t pmap, vm_offset_t va) { pt_entry_t *pte, tpte; @@ -1243,7 +1243,7 @@ pmap_add_delayed_free_list(vm_page_t m, m->flags &= ~PG_ZERO; SLIST_INSERT_HEAD(free, m, plinks.s.ss); } - + /* * Decrements a page table page's wire count, which is used to record the * number of valid page table entries within the page. If the wire count @@ -1321,7 +1321,7 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t */ atomic_subtract_rel_int(&vm_cnt.v_wire_count, 1); - /* + /* * Put page on a list so that it is released after * *ALL* TLB shootdown is done */ @@ -1591,7 +1591,7 @@ kvm_size(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &ksize, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, +SYSCTL_PROC(_vm, OID_AUTO, kvm_size, CTLTYPE_LONG|CTLFLAG_RD, 0, 0, kvm_size, "LU", "Size of KVM"); static int @@ -1601,7 +1601,7 @@ kvm_free(SYSCTL_HANDLER_ARGS) return sysctl_handle_long(oidp, &kfree, 0, req); } -SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, +SYSCTL_PROC(_vm, OID_AUTO, kvm_free, CTLTYPE_LONG|CTLFLAG_RD, 0, 0, kvm_free, "LU", "Amount of KVM free"); #endif /* 0 */ @@ -1645,7 +1645,7 @@ pmap_growkernel(vm_offset_t addr) kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= kernel_map->max_offset) { kernel_vm_end = kernel_map->max_offset; - break; + break; } continue; } @@ -1665,7 +1665,7 @@ pmap_growkernel(vm_offset_t addr) kernel_vm_end = (kernel_vm_end + L2_SIZE) & ~L2_OFFSET; if (kernel_vm_end - 1 >= kernel_map->max_offset) { kernel_vm_end = kernel_map->max_offset; - break; + break; } } } @@ -1926,7 +1926,7 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm * pmap_remove_l3: do the things to unmap a page in a process */ static int -pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, +pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_t va, pd_entry_t l2e, struct spglist *free, struct rwlock **lockp) { pt_entry_t old_l3; @@ -2057,7 +2057,7 @@ pmap_remove(pmap_t pmap, vm_offset_t sva rw_wunlock(lock); if (anyvalid) pmap_invalidate_all(pmap); - rw_runlock(&pvh_global_lock); + rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } @@ -2724,7 +2724,7 @@ pmap_zero_page(vm_page_t m) } /* - * pmap_zero_page_area zeros the specified hardware page by mapping + * pmap_zero_page_area zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. * * off and size may not cover an area beyond a single hardware page. @@ -2741,7 +2741,7 @@ pmap_zero_page_area(vm_page_t m, int off } /* - * pmap_zero_page_idle zeros the specified hardware page by mapping + * pmap_zero_page_idle zeros the specified hardware page by mapping * the page into KVM and using bzero to clear its contents. This * is intended to be called from the vm_pagezero process only and * outside of Giant. @@ -2902,7 +2902,7 @@ restart: * Destroy all managed, non-wired mappings in the given user-space * pmap. This pmap cannot be active on any processor besides the * caller. - * + * * This function cannot be applied to the kernel pmap. Moreover, it * is not intended for general use. It is only to be used during * process termination. Consequently, it can be implemented in ways Modified: user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/riscv/spike.dts ============================================================================== --- user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/riscv/spike.dts Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/riscv/spike.dts Tue Aug 2 15:52:14 2016 (r303667) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -37,8 +37,8 @@ /dts-v1/; / { - model = "UC Berkeley Spike Simulator RV64I"; - compatible = "riscv,rv64i"; + model = "UC Berkeley Spike Simulator RV64"; + compatible = "riscv,rv64"; #address-cells = <1>; #size-cells = <1>; #interrupt-cells = <1>; @@ -49,14 +49,14 @@ cpu@0 { device_type = "cpu"; - compatible = "riscv,rv64i"; - reg = <0x40002000>; + compatible = "riscv,rv64"; + reg = <0x40001000>; }; cpu@1 { device_type = "cpu"; - compatible = "riscv,rv64i"; - reg = <0x4000a000>; + compatible = "riscv,rv64"; + reg = <0x40002000>; }; }; @@ -66,12 +66,12 @@ memory { device_type = "memory"; - reg = <0x0 0x40000000>; /* 1GB at 0x0 */ + reg = <0x80000000 0x40000000>; /* 1GB at 0x80000000 */ }; soc { - #address-cells = <2>; - #size-cells = <2>; + #address-cells = <1>; + #size-cells = <1>; #interrupt-cells = <1>; compatible = "simple-bus"; @@ -84,14 +84,15 @@ timer0: timer@0 { compatible = "riscv,timer"; - interrupts = < 1 >; + reg = < 0x40000000 0x100 >; + interrupts = < 5 >; interrupt-parent = < &pic0 >; clock-frequency = < 1000000 >; }; htif0: htif@0 { compatible = "riscv,htif"; - interrupts = < 0 >; + interrupts = < 1 >; interrupt-parent = < &pic0 >; console0: console@0 { Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Tue Aug 2 15:52:14 2016 (r303667) @@ -2498,8 +2498,8 @@ extern void dtrace_helpers_destroy(proc_ #elif defined(__riscv__) -#define SD_RA_SP_MASK 0x1fff07f -#define SD_RA_SP 0x0113023 +#define SD_RA_SP_MASK 0x01fff07f +#define SD_RA_SP 0x00113023 #define DTRACE_INVOP_SD 1 #define DTRACE_INVOP_RET 2 Modified: user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_asm.S ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_asm.S Tue Aug 2 15:52:14 2016 (r303667) @@ -57,8 +57,8 @@ END(dtrace_membar_consumer) dtrace_icookie_t dtrace_interrupt_disable(void) */ ENTRY(dtrace_interrupt_disable) - csrrci a0, sstatus, SSTATUS_IE - andi a0, a0, SSTATUS_IE + csrrci a0, sstatus, (SSTATUS_SIE) + andi a0, a0, (SSTATUS_SIE) RET END(dtrace_interrupt_disable) Modified: user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_subr.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/cddl/dev/dtrace/riscv/dtrace_subr.c Tue Aug 2 15:52:14 2016 (r303667) @@ -203,9 +203,9 @@ dtrace_trap(struct trapframe *frame, u_i * All the rest will be handled in the usual way. */ switch (type) { - case EXCP_LOAD_ACCESS_FAULT: - case EXCP_STORE_ACCESS_FAULT: - case EXCP_INSTR_ACCESS_FAULT: + case EXCP_FAULT_LOAD: + case EXCP_FAULT_STORE: + case EXCP_FAULT_FETCH: /* Flag a bad address. */ cpu_core[curcpu].cpuc_dtrace_flags |= CPU_DTRACE_BADADDR; cpu_core[curcpu].cpuc_dtrace_illval = 0; Modified: user/alc/PQ_LAUNDRY/sys/conf/ldscript.riscv ============================================================================== --- user/alc/PQ_LAUNDRY/sys/conf/ldscript.riscv Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/conf/ldscript.riscv Tue Aug 2 15:52:14 2016 (r303667) @@ -6,7 +6,7 @@ SEARCH_DIR(/usr/lib); SECTIONS { /* Read-only sections, merged into text segment: */ - . = kernbase + 0x100; + . = kernbase + 0x80000000 /* KERNENTRY */; .text : AT(ADDR(.text) - kernbase) { *(.text) Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_mutex.c Tue Aug 2 15:52:14 2016 (r303667) @@ -452,8 +452,10 @@ __mtx_lock_sleep(volatile uintptr_t *c, if (SCHEDULER_STOPPED()) return; -#if defined(ADAPTIVE_MUTEXES) || defined(KDTRACE_HOOKS) +#if defined(ADAPTIVE_MUTEXES) lock_delay_arg_init(&lda, &mtx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); #endif m = mtxlock2mtx(c); Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_rwlock.c Tue Aug 2 15:52:14 2016 (r303667) @@ -396,8 +396,10 @@ __rw_rlock(volatile uintptr_t *c, const if (SCHEDULER_STOPPED()) return; -#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) +#if defined(ADAPTIVE_RWLOCKS) lock_delay_arg_init(&lda, &rw_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); #endif rw = rwlock2rw(c); @@ -782,8 +784,10 @@ __rw_wlock_hard(volatile uintptr_t *c, u if (SCHEDULER_STOPPED()) return; -#if defined(ADAPTIVE_RWLOCKS) || defined(KDTRACE_HOOKS) +#if defined(ADAPTIVE_RWLOCKS) lock_delay_arg_init(&lda, &rw_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); #endif rw = rwlock2rw(c); Modified: user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c Tue Aug 2 15:52:14 2016 (r303667) @@ -554,8 +554,10 @@ _sx_xlock_hard(struct sx *sx, uintptr_t if (SCHEDULER_STOPPED()) return (0); -#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) +#if defined(ADAPTIVE_SX) lock_delay_arg_init(&lda, &sx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); #endif /* If we already hold an exclusive lock, then recurse. */ @@ -861,8 +863,10 @@ _sx_slock_hard(struct sx *sx, int opts, if (SCHEDULER_STOPPED()) return (0); -#if defined(ADAPTIVE_SX) || defined(KDTRACE_HOOKS) +#if defined(ADAPTIVE_SX) lock_delay_arg_init(&lda, &sx_delay); +#elif defined(KDTRACE_HOOKS) + lock_delay_arg_init(&lda, NULL); #endif #ifdef KDTRACE_HOOKS state = sx->sx_lock; Modified: user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c Tue Aug 2 15:52:14 2016 (r303667) @@ -68,19 +68,24 @@ static MALLOC_DEFINE(M_LRO, "LRO", "LRO #endif static void tcp_lro_rx_done(struct lro_ctrl *lc); +static int tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, + uint32_t csum, int use_hash); static __inline void -tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_entry *le) +tcp_lro_active_insert(struct lro_ctrl *lc, struct lro_head *bucket, + struct lro_entry *le) { LIST_INSERT_HEAD(&lc->lro_active, le, next); + LIST_INSERT_HEAD(bucket, le, hash_next); } static __inline void tcp_lro_active_remove(struct lro_entry *le) { - LIST_REMOVE(le, next); + LIST_REMOVE(le, next); /* active list */ + LIST_REMOVE(le, hash_next); /* hash bucket */ } int @@ -95,7 +100,7 @@ tcp_lro_init_args(struct lro_ctrl *lc, s { struct lro_entry *le; size_t size; - unsigned i; + unsigned i, elements; lc->lro_bad_csum = 0; lc->lro_queued = 0; @@ -110,6 +115,18 @@ tcp_lro_init_args(struct lro_ctrl *lc, s LIST_INIT(&lc->lro_free); LIST_INIT(&lc->lro_active); + /* create hash table to accelerate entry lookup */ + if (lro_entries > lro_mbufs) + elements = lro_entries; + else + elements = lro_mbufs; + lc->lro_hash = phashinit_flags(elements, M_LRO, &lc->lro_hashsz, + HASH_NOWAIT); + if (lc->lro_hash == NULL) { + memset(lc, 0, sizeof(*lc)); + return (ENOMEM); + } + /* compute size to allocate */ size = (lro_mbufs * sizeof(struct lro_mbuf_sort)) + (lro_entries * sizeof(*le)); @@ -147,6 +164,13 @@ tcp_lro_free(struct lro_ctrl *lc) m_freem(le->m_head); } + /* free hash table */ + if (lc->lro_hash != NULL) { + free(lc->lro_hash, M_LRO); + lc->lro_hash = NULL; + } + lc->lro_hashsz = 0; + /* free mbuf array, if any */ for (x = 0; x != lc->lro_mbuf_count; x++) m_freem(lc->lro_mbuf_data[x].mb); @@ -487,7 +511,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc) } /* add packet to LRO engine */ - if (tcp_lro_rx(lc, mb, 0) != 0) { + if (tcp_lro_rx2(lc, mb, 0, 0) != 0) { /* input packet to network layer */ (*lc->ifp->if_input)(lc->ifp, mb); lc->lro_queued++; @@ -561,8 +585,8 @@ tcp_lro_rx_ipv4(struct lro_ctrl *lc, str } #endif -int -tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) +static int +tcp_lro_rx2(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, int use_hash) { struct lro_entry *le; struct ether_header *eh; @@ -578,6 +602,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m tcp_seq seq; int error, ip_len, l; uint16_t eh_type, tcp_data_len; + struct lro_head *bucket; /* We expect a contiguous header [eh, ip, tcp]. */ @@ -670,8 +695,41 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m seq = ntohl(th->th_seq); + if (!use_hash) { + bucket = &lc->lro_hash[0]; + } else if (M_HASHTYPE_ISHASH(m)) { + bucket = &lc->lro_hash[m->m_pkthdr.flowid % lc->lro_hashsz]; + } else { + uint32_t hash; + + switch (eh_type) { +#ifdef INET + case ETHERTYPE_IP: + hash = ip4->ip_src.s_addr + ip4->ip_dst.s_addr; + break; +#endif +#ifdef INET6 + case ETHERTYPE_IPV6: + hash = ip6->ip6_src.s6_addr32[0] + + ip6->ip6_dst.s6_addr32[0]; + hash += ip6->ip6_src.s6_addr32[1] + + ip6->ip6_dst.s6_addr32[1]; + hash += ip6->ip6_src.s6_addr32[2] + + ip6->ip6_dst.s6_addr32[2]; + hash += ip6->ip6_src.s6_addr32[3] + + ip6->ip6_dst.s6_addr32[3]; + break; +#endif + default: + hash = 0; + break; + } + hash += th->th_sport + th->th_dport; + bucket = &lc->lro_hash[hash % lc->lro_hashsz]; + } + /* Try to find a matching previous segment. */ - LIST_FOREACH(le, &lc->lro_active, next) { + LIST_FOREACH(le, bucket, hash_next) { if (le->eh_type != eh_type) continue; if (le->source_port != th->th_sport || @@ -779,7 +837,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m /* Start a new segment chain. */ le = LIST_FIRST(&lc->lro_free); LIST_REMOVE(le, next); - tcp_lro_active_insert(lc, le); + tcp_lro_active_insert(lc, bucket, le); getmicrotime(&le->mtime); /* Start filling in details. */ @@ -837,6 +895,13 @@ tcp_lro_rx(struct lro_ctrl *lc, struct m return (0); } +int +tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) +{ + + return tcp_lro_rx2(lc, m, csum, 1); +} + void tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) { Modified: user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.h Tue Aug 2 15:52:14 2016 (r303667) @@ -40,6 +40,7 @@ struct lro_entry { LIST_ENTRY(lro_entry) next; + LIST_ENTRY(lro_entry) hash_next; struct mbuf *m_head; struct mbuf *m_tail; union { @@ -95,6 +96,8 @@ struct lro_ctrl { unsigned short lro_ackcnt_lim; /* max # of aggregated ACKs */ unsigned lro_length_lim; /* max len of aggregated data */ + u_long lro_hashsz; + struct lro_head *lro_hash; struct lro_head lro_active; struct lro_head lro_free; }; Modified: user/alc/PQ_LAUNDRY/sys/netinet6/ip6_output.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/netinet6/ip6_output.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/netinet6/ip6_output.c Tue Aug 2 15:52:14 2016 (r303667) @@ -1058,7 +1058,8 @@ done: * Release the route if using our private route, or if * (with flowtable) we don't have our own reference. */ - if (ro == &ip6route || ro->ro_flags & RT_NORTREF) + if (ro == &ip6route || + (ro != NULL && ro->ro_flags & RT_NORTREF)) RO_RTFREE(ro); return (error); Modified: user/alc/PQ_LAUNDRY/sys/riscv/conf/GENERIC ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/conf/GENERIC Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/conf/GENERIC Tue Aug 2 15:52:14 2016 (r303667) @@ -26,6 +26,7 @@ makeoptions DEBUG=-g # Build kernel wit # FIXME: linker error. "--relax and -r may not be used together" makeoptions WITHOUT_MODULES="usb otusfw mwlfw ispfw mwlfw ralfw rtwnfw urtwnfw" +# makeoptions NO_MODULES options SCHED_ULE # ULE scheduler options PREEMPTION # Enable kernel thread preemption @@ -40,7 +41,6 @@ options UFS_ACL # Support for access options UFS_DIRHASH # Improve performance on big directories options UFS_GJOURNAL # Enable gjournal-based UFS journaling options QUOTA # Enable disk quotas for UFS -options MD_ROOT # MD is a potential root device options NFSCL # Network Filesystem Client options NFSD # Network Filesystem Server options NFSLOCKD # Network Lock Manager @@ -93,6 +93,7 @@ options INVARIANT_SUPPORT # Extra sanit # options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones # options EARLY_PRINTF +# options VERBOSE_SYSINIT # Pseudo devices. device loop # Network loopback Modified: user/alc/PQ_LAUNDRY/sys/riscv/htif/htif.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/htif/htif.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/htif/htif.c Tue Aug 2 15:52:14 2016 (r303667) @@ -177,11 +177,6 @@ htif_enumerate(struct htif_softc *sc) htif_command(cmd); - /* Do poll as interrupts are disabled yet */ - while (sc->identify_done == 0) { - htif_handle_entry(sc); - } - len = strnlen(id, sizeof(id)); if (len <= 0) break; Modified: user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_block.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_block.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_block.c Tue Aug 2 15:52:14 2016 (r303667) @@ -202,6 +202,7 @@ htif_blk_task(void *arg) uint64_t req_paddr; struct bio *bp; uint64_t paddr; + uint64_t resp; uint64_t cmd; int i; @@ -239,7 +240,8 @@ htif_blk_task(void *arg) cmd |= req_paddr; sc->cmd_done = 0; - htif_command(cmd); + resp = htif_command(cmd); + htif_blk_intr(sc, resp); /* Wait for interrupt */ i = 0; Modified: user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_console.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_console.c Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/htif/htif_console.c Tue Aug 2 15:52:14 2016 (r303667) @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD$"); #include -extern uint64_t console_intr; - static tsw_outwakeup_t riscvtty_outwakeup; static struct ttydevsw riscv_ttydevsw = { @@ -102,7 +100,7 @@ struct queue_entry *entry_last; struct queue_entry *entry_served; static void -htif_putc(int c) +riscv_putc(int c) { uint64_t cmd; @@ -110,57 +108,7 @@ htif_putc(int c) cmd |= (CONSOLE_DEFAULT_ID << HTIF_DEV_ID_SHIFT); cmd |= c; -#ifdef SPIN_IN_MACHINE_MODE - machine_command(ECALL_HTIF_LOWPUTC, cmd); -#else - htif_command(cmd); -#endif - -} - -static uint8_t -htif_getc(void) -{ - uint64_t cmd; - uint8_t res; - - cmd = (HTIF_CMD_READ << HTIF_CMD_SHIFT); - cmd |= (CONSOLE_DEFAULT_ID << HTIF_DEV_ID_SHIFT); - - res = htif_command(cmd); - - return (res); -} - -static void -riscv_putc(int c) -{ - uint64_t counter; - uint64_t *cc; - uint64_t val; - - val = 0; - counter = 0; - - cc = (uint64_t*)&console_intr; - *cc = 0; - - htif_putc(c); - -#ifndef SPIN_IN_MACHINE_MODE - /* Wait for an interrupt */ - __asm __volatile( - "li %0, 1\n" /* counter = 1 */ - "slli %0, %0, 12\n" /* counter <<= 12 */ - "1:" - "addi %0, %0, -1\n" /* counter -= 1 */ - "beqz %0, 2f\n" /* counter == 0 ? finish */ - "ld %1, 0(%2)\n" /* val = *cc */ - "beqz %1, 1b\n" /* val == 0 ? repeat */ - "2:" - : "=&r"(counter), "=&r"(val) : "r"(cc) - ); -#endif + machine_command(ECALL_HTIF_CMD, cmd); } #ifdef EARLY_PRINTF @@ -272,14 +220,19 @@ riscv_cngetc(struct consdev *cp) uint64_t entry; uint64_t devid; #endif + uint64_t cmd; uint8_t data; int ch; - htif_getc(); + cmd = (HTIF_CMD_READ << HTIF_CMD_SHIFT); + cmd |= (CONSOLE_DEFAULT_ID << HTIF_DEV_ID_SHIFT); + + machine_command(ECALL_HTIF_CMD_REQ, cmd); #if defined(KDB) if (kdb_active) { - entry = machine_command(ECALL_HTIF_GET_ENTRY, 0); + + entry = machine_command(ECALL_HTIF_CMD_RESP, 0); while (entry) { devid = HTIF_DEV_ID(entry); devcmd = HTIF_DEV_CMD(entry); @@ -294,7 +247,7 @@ riscv_cngetc(struct consdev *cp) devid); } - entry = machine_command(ECALL_HTIF_GET_ENTRY, 0); + entry = machine_command(ECALL_HTIF_CMD_RESP, 0); } } #endif Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/cpu.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/cpu.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/cpu.h Tue Aug 2 15:52:14 2016 (r303667) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -67,11 +67,10 @@ #define CPU_PART_SHIFT 62 #define CPU_PART_MASK (0x3ul << CPU_PART_SHIFT) -#define CPU_PART(mcpuid) ((mcpuid & CPU_PART_MASK) >> CPU_PART_SHIFT) -#define CPU_PART_RV32I 0x0 -#define CPU_PART_RV32E 0x1 -#define CPU_PART_RV64I 0x2 -#define CPU_PART_RV128I 0x3 +#define CPU_PART(misa) ((misa & CPU_PART_MASK) >> CPU_PART_SHIFT) +#define CPU_PART_RV32 0x1 +#define CPU_PART_RV64 0x2 +#define CPU_PART_RV128 0x3 extern char btext[]; extern char etext[]; Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/cpufunc.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/cpufunc.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/cpufunc.h Tue Aug 2 15:52:14 2016 (r303667) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -54,11 +54,11 @@ intr_disable(void) uint64_t ret; __asm __volatile( - "csrrci %0, sstatus, 1" - : "=&r" (ret) + "csrrci %0, sstatus, %1" + : "=&r" (ret) : "i" (SSTATUS_SIE) ); - return (ret & SSTATUS_IE); + return (ret & (SSTATUS_SIE)); } static __inline void @@ -76,7 +76,8 @@ intr_enable(void) { __asm __volatile( - "csrsi sstatus, 1" + "csrsi sstatus, %0" + :: "i" (SSTATUS_SIE) ); } Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/db_machdep.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/db_machdep.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/db_machdep.h Tue Aug 2 15:52:14 2016 (r303667) @@ -41,7 +41,7 @@ #include #include -#define T_BREAKPOINT (EXCP_INSTR_BREAKPOINT) +#define T_BREAKPOINT (EXCP_BREAKPOINT) #define T_WATCHPOINT (0) typedef vm_offset_t db_addr_t; Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/intr.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/intr.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/intr.h Tue Aug 2 15:52:14 2016 (r303667) @@ -57,11 +57,23 @@ void riscv_unmask_ipi(void); #endif enum { - IRQ_SOFTWARE, - IRQ_TIMER, - IRQ_HTIF, + IRQ_SOFTWARE_USER, + IRQ_SOFTWARE_SUPERVISOR, + IRQ_SOFTWARE_HYPERVISOR, + IRQ_SOFTWARE_MACHINE, + IRQ_TIMER_USER, + IRQ_TIMER_SUPERVISOR, + IRQ_TIMER_HYPERVISOR, + IRQ_TIMER_MACHINE, + IRQ_EXTERNAL_USER, + IRQ_EXTERNAL_SUPERVISOR, + IRQ_EXTERNAL_HYPERVISOR, + IRQ_EXTERNAL_MACHINE, +#if 0 + /* lowRISC TODO */ IRQ_COP, /* lowRISC only */ IRQ_UART, /* lowRISC only */ +#endif NIRQS }; Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/pte.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/pte.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/pte.h Tue Aug 2 15:52:14 2016 (r303667) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2014 Andrew Turner - * Copyright (c) 2015 Ruslan Bukin + * Copyright (c) 2015-2016 Ruslan Bukin * All rights reserved. * * Portions of this software were developed by SRI International and the @@ -66,29 +66,18 @@ typedef uint64_t pn_t; /* page number #define Ln_ADDR_MASK (Ln_ENTRIES - 1) /* Bits 9:7 are reserved for software */ -#define PTE_SW_MANAGED (1 << 8) -#define PTE_SW_WIRED (1 << 7) -#define PTE_DIRTY (1 << 6) /* Virtual page is written */ -#define PTE_REF (1 << 5) /* Virtual page is referenced */ -#define PTE_VALID (1 << 0) /* Virtual page is valid */ -#define PTE_TYPE_S 1 -#define PTE_TYPE_M (0xf << PTE_TYPE_S) -#define PTE_TYPE_PTR 0 -#define PTE_TYPE_PTR_G 1 -#define PTE_TYPE_SROURX 2 /* Supervisor read-only, user read-execute page. */ -#define PTE_TYPE_SRWURWX 3 /* Supervisor read-write, user read-write-execute page. */ -#define PTE_TYPE_SURO 4 /* Supervisor and user read-only page. */ -#define PTE_TYPE_SURW 5 /* Supervisor and user read-write page. */ -#define PTE_TYPE_SURX 6 /* Supervisor and user read-execute page. */ -#define PTE_TYPE_SURWX 7 /* Supervisor and User Read Write Execute */ -#define PTE_TYPE_SRO 8 /* Supervisor read-only page. */ -#define PTE_TYPE_SRW 9 /* Supervisor read-write page. */ -#define PTE_TYPE_SRX 10 /* Supervisor read-execute page. */ -#define PTE_TYPE_SRWX 11 /* Supervisor read-write-execute page. */ -#define PTE_TYPE_SRO_G 12 /* Supervisor read-only page--global mapping. */ -#define PTE_TYPE_SRW_G 13 /* Supervisor read-write page--global mapping. */ -#define PTE_TYPE_SRX_G 14 /* Supervisor read-execute page--global mapping. */ -#define PTE_TYPE_SRWX_G 15 /* Supervisor Read Write Execute Global */ +#define PTE_SW_MANAGED (1 << 9) +#define PTE_SW_WIRED (1 << 8) +#define PTE_D (1 << 7) /* Dirty */ +#define PTE_A (1 << 6) /* Accessed */ +#define PTE_G (1 << 5) /* Global */ +#define PTE_U (1 << 4) /* User */ +#define PTE_X (1 << 3) /* Execute */ +#define PTE_W (1 << 2) /* Write */ +#define PTE_R (1 << 1) /* Read */ +#define PTE_V (1 << 0) /* Valid */ +#define PTE_RWX (PTE_R | PTE_W | PTE_X) +#define PTE_RX (PTE_R | PTE_X) #define PTE_PPN0_S 10 #define PTE_PPN1_S 19 Modified: user/alc/PQ_LAUNDRY/sys/riscv/include/riscvreg.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/riscv/include/riscvreg.h Tue Aug 2 15:49:34 2016 (r303666) +++ user/alc/PQ_LAUNDRY/sys/riscv/include/riscvreg.h Tue Aug 2 15:52:14 2016 (r303667) @@ -39,88 +39,127 @@ /* Machine mode requests */ #define ECALL_MTIMECMP 0x01 -#define ECALL_CLEAR_PENDING 0x02 -#define ECALL_HTIF_CMD 0x03 -#define ECALL_HTIF_GET_ENTRY 0x04 -#define ECALL_MCPUID_GET 0x05 -#define ECALL_MIMPID_GET 0x06 -#define ECALL_SEND_IPI 0x07 -#define ECALL_CLEAR_IPI 0x08 -#define ECALL_HTIF_LOWPUTC 0x09 -#define ECALL_MIE_SET 0x0a -#define ECALL_IO_IRQ_MASK 0x0b +#define ECALL_HTIF_GET_ENTRY 0x02 +#define ECALL_MCPUID_GET 0x03 +#define ECALL_MIMPID_GET 0x04 +#define ECALL_SEND_IPI 0x05 +#define ECALL_CLEAR_IPI 0x06 +#define ECALL_MIE_SET 0x07 +#define ECALL_IO_IRQ_MASK 0x08 +#define ECALL_HTIF_CMD 0x09 +#define ECALL_HTIF_CMD_REQ 0x0a +#define ECALL_HTIF_CMD_RESP 0x0b #define EXCP_SHIFT 0 #define EXCP_MASK (0xf << EXCP_SHIFT) -#define EXCP_INSTR_ADDR_MISALIGNED 0 -#define EXCP_INSTR_ACCESS_FAULT 1 -#define EXCP_INSTR_ILLEGAL 2 -#define EXCP_INSTR_BREAKPOINT 3 -#define EXCP_LOAD_ADDR_MISALIGNED 4 -#define EXCP_LOAD_ACCESS_FAULT 5 -#define EXCP_STORE_ADDR_MISALIGNED 6 -#define EXCP_STORE_ACCESS_FAULT 7 -#define EXCP_UMODE_ENV_CALL 8 -#define EXCP_SMODE_ENV_CALL 9 -#define EXCP_HMODE_ENV_CALL 10 -#define EXCP_MMODE_ENV_CALL 11 -#define EXCP_INTR (1 << 31) +#define EXCP_MISALIGNED_FETCH 0 +#define EXCP_FAULT_FETCH 1 +#define EXCP_ILLEGAL_INSTRUCTION 2 +#define EXCP_BREAKPOINT 3 +#define EXCP_MISALIGNED_LOAD 4 +#define EXCP_FAULT_LOAD 5 +#define EXCP_MISALIGNED_STORE 6 +#define EXCP_FAULT_STORE 7 +#define EXCP_USER_ECALL 8 +#define EXCP_SUPERVISOR_ECALL 9 +#define EXCP_HYPERVISOR_ECALL 10 +#define EXCP_MACHINE_ECALL 11 +#define EXCP_INTR (1ul << 63) #define EXCP_INTR_SOFTWARE 0 #define EXCP_INTR_TIMER 1 #define EXCP_INTR_HTIF 2 -#define SSTATUS_IE (1 << 0) -#define SSTATUS_PIE (1 << 3) -#define SSTATUS_PS (1 << 4) - -#define MSTATUS_MPRV (1 << 16) -#define MSTATUS_PRV_SHIFT 1 -#define MSTATUS_PRV1_SHIFT 4 -#define MSTATUS_PRV2_SHIFT 7 -#define MSTATUS_PRV_MASK (0x3 << MSTATUS_PRV_SHIFT) -#define MSTATUS_PRV_U 0 /* user */ -#define MSTATUS_PRV_S 1 /* supervisor */ -#define MSTATUS_PRV_H 2 /* hypervisor */ -#define MSTATUS_PRV_M 3 /* machine */ - -#define MSTATUS_VM_SHIFT 17 -#define MSTATUS_VM_MASK 0x1f -#define MSTATUS_VM_MBARE 0 -#define MSTATUS_VM_MBB 1 -#define MSTATUS_VM_MBBID 2 -#define MSTATUS_VM_SV32 8 -#define MSTATUS_VM_SV39 9 -#define MSTATUS_VM_SV48 10 +#define SSTATUS_UIE (1 << 0) +#define SSTATUS_SIE (1 << 1) +#define SSTATUS_UPIE (1 << 4) +#define SSTATUS_SPIE (1 << 5) +#define SSTATUS_SPIE_SHIFT 5 +#define SSTATUS_SPP (1 << 8) +#define SSTATUS_SPP_SHIFT 8 +#define SSTATUS_FS_MASK 0x3 +#define SSTATUS_FS_SHIFT 13 +#define SSTATUS_XS_MASK 0x3 +#define SSTATUS_XS_SHIFT 15 +#define SSTATUS_PUM (1 << 18) +#define SSTATUS32_SD (1 << 63) +#define SSTATUS64_SD (1 << 31) + +#define MSTATUS_UIE (1 << 0) +#define MSTATUS_SIE (1 << 1) +#define MSTATUS_HIE (1 << 2) +#define MSTATUS_MIE (1 << 3) +#define MSTATUS_UPIE (1 << 4) +#define MSTATUS_SPIE (1 << 5) +#define MSTATUS_SPIE_SHIFT 5 +#define MSTATUS_HPIE (1 << 6) +#define MSTATUS_MPIE (1 << 7) +#define MSTATUS_MPIE_SHIFT 7 +#define MSTATUS_SPP (1 << 8) +#define MSTATUS_SPP_SHIFT 8 +#define MSTATUS_HPP_MASK 0x3 +#define MSTATUS_HPP_SHIFT 9 +#define MSTATUS_MPP_MASK 0x3 +#define MSTATUS_MPP_SHIFT 11 +#define MSTATUS_FS_MASK 0x3 +#define MSTATUS_FS_SHIFT 13 +#define MSTATUS_XS_MASK 0x3 +#define MSTATUS_XS_SHIFT 15 +#define MSTATUS_MPRV (1 << 17) +#define MSTATUS_PUM (1 << 18) +#define MSTATUS_VM_MASK 0x1f +#define MSTATUS_VM_SHIFT 24 +#define MSTATUS_VM_MBARE 0 +#define MSTATUS_VM_MBB 1 +#define MSTATUS_VM_MBBID 2 +#define MSTATUS_VM_SV32 8 +#define MSTATUS_VM_SV39 9 +#define MSTATUS_VM_SV48 10 +#define MSTATUS_VM_SV57 11 +#define MSTATUS_VM_SV64 12 +#define MSTATUS32_SD (1 << 63) +#define MSTATUS64_SD (1 << 31) + +#define MSTATUS_PRV_U 0 /* user */ +#define MSTATUS_PRV_S 1 /* supervisor */ +#define MSTATUS_PRV_H 2 /* hypervisor */ +#define MSTATUS_PRV_M 3 /* machine */ +#define MIE_USIE (1 << 0) #define MIE_SSIE (1 << 1) #define MIE_HSIE (1 << 2) #define MIE_MSIE (1 << 3) +#define MIE_UTIE (1 << 4) #define MIE_STIE (1 << 5) #define MIE_HTIE (1 << 6) #define MIE_MTIE (1 << 7) +#define MIP_USIP (1 << 0) #define MIP_SSIP (1 << 1) #define MIP_HSIP (1 << 2) #define MIP_MSIP (1 << 3) +#define MIP_UTIP (1 << 4) #define MIP_STIP (1 << 5) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Tue Aug 2 17:23:46 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB7E2BAA6CE for ; Tue, 2 Aug 2016 17:23:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AEDDB1B0E; Tue, 2 Aug 2016 17:23:46 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u72HNj3f039976; Tue, 2 Aug 2016 17:23:45 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u72HNjf5039975; Tue, 2 Aug 2016 17:23:45 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608021723.u72HNjf5039975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 2 Aug 2016 17:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303668 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2016 17:23:47 -0000 Author: alc Date: Tue Aug 2 17:23:45 2016 New Revision: 303668 URL: https://svnweb.freebsd.org/changeset/base/303668 Log: Style tweaks. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 15:52:14 2016 (r303667) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Tue Aug 2 17:23:45 2016 (r303668) @@ -895,9 +895,9 @@ unlock_mp: static int vm_pageout_launder(struct vm_domain *vmd, int launder, bool shortfall) { - vm_page_t m, next; struct vm_pagequeue *pq; vm_object_t object; + vm_page_t m, next; int act_delta, error, maxscan, numpagedout, starting_target; int vnodes_skipped; bool pageout_ok, queue_locked; @@ -1114,6 +1114,7 @@ vm_pageout_laundry_worker(void *arg) */ if (vm_laundering_needed()) { shortfall = vm_laundry_target() + vm_pageout_deficit; + /* * If we're in shortfall and we haven't yet started a * laundering cycle to get us out of it, begin a run. @@ -1158,6 +1159,7 @@ vm_pageout_laundry_worker(void *arg) if (target == 0 && ninact > 0 && wakeups != gen && nlaundry * bkgrd_launder_ratio >= ninact) { gen = wakeups; + /* * The pagedaemon has woken up at least once since the * last background laundering run and we're above the From owner-svn-src-user@freebsd.org Wed Aug 3 03:49:43 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8477DBAB162 for ; Wed, 3 Aug 2016 03:49:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 554B91968; Wed, 3 Aug 2016 03:49:43 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u733ngce070563; Wed, 3 Aug 2016 03:49:42 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u733ng4C070562; Wed, 3 Aug 2016 03:49:42 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608030349.u733ng4C070562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 3 Aug 2016 03:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303697 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 03:49:43 -0000 Author: alc Date: Wed Aug 3 03:49:42 2016 New Revision: 303697 URL: https://svnweb.freebsd.org/changeset/base/303697 Log: Only decrement "cycle" if we laundered pages. Reviewed by: markj Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 3 01:46:55 2016 (r303696) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 3 03:49:42 2016 (r303697) @@ -1192,13 +1192,14 @@ vm_pageout_laundry_worker(void *arg) launder = target / cycle; dolaundry: - if (launder > 0) + if (launder > 0) { target -= min(vm_pageout_launder(domain, launder, shortfall > 0), target); + cycle--; + } tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL); - cycle--; } } From owner-svn-src-user@freebsd.org Wed Aug 3 17:20:36 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67D6FBAD231 for ; Wed, 3 Aug 2016 17:20:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B3EA13A1; Wed, 3 Aug 2016 17:20:36 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u73HKZZZ082507; Wed, 3 Aug 2016 17:20:35 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u73HKZQ1082506; Wed, 3 Aug 2016 17:20:35 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608031720.u73HKZQ1082506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Wed, 3 Aug 2016 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303724 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Aug 2016 17:20:36 -0000 Author: alc Date: Wed Aug 3 17:20:35 2016 New Revision: 303724 URL: https://svnweb.freebsd.org/changeset/base/303724 Log: Revert the previous change (r303697). Unfortunately, I'm able to provoke cases where "target > 0" but "laundry == 0", resulting in "cycle" getting stuck. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 3 17:17:01 2016 (r303723) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Wed Aug 3 17:20:35 2016 (r303724) @@ -1192,14 +1192,13 @@ vm_pageout_laundry_worker(void *arg) launder = target / cycle; dolaundry: - if (launder > 0) { + if (launder > 0) target -= min(vm_pageout_launder(domain, launder, shortfall > 0), target); - cycle--; - } tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL); + cycle--; } } From owner-svn-src-user@freebsd.org Thu Aug 4 16:36:04 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F5D4BAF4BC for ; Thu, 4 Aug 2016 16:36:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2C5CF186F; Thu, 4 Aug 2016 16:36:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u74Ga3iw009328; Thu, 4 Aug 2016 16:36:03 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u74Ga0Sm009297; Thu, 4 Aug 2016 16:36:00 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608041636.u74Ga0Sm009297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Thu, 4 Aug 2016 16:36:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303748 - in user/alc/PQ_LAUNDRY: bin/uuidgen contrib/elftoolchain/readelf contrib/libpcap crypto/openssh etc/rc.d include lib/libc/gen lib/libc/sys lib/libproc sbin/geom/class/eli sbin... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Aug 2016 16:36:04 -0000 Author: alc Date: Thu Aug 4 16:36:00 2016 New Revision: 303748 URL: https://svnweb.freebsd.org/changeset/base/303748 Log: MFH r303747 Note: A conflict in one of vm_pageout_cluster()'s comments had to be resolved because of functional differences between HEAD and this branch. Added: user/alc/PQ_LAUNDRY/sys/mips/conf/std.AR933X - copied unchanged from r303747, head/sys/mips/conf/std.AR933X user/alc/PQ_LAUNDRY/sys/mips/conf/std.AR934X - copied unchanged from r303747, head/sys/mips/conf/std.AR934X user/alc/PQ_LAUNDRY/sys/x86/x86/mp_watchdog.c - copied unchanged from r303747, head/sys/x86/x86/mp_watchdog.c Deleted: user/alc/PQ_LAUNDRY/sys/amd64/amd64/mp_watchdog.c user/alc/PQ_LAUNDRY/sys/i386/i386/mp_watchdog.c user/alc/PQ_LAUNDRY/sys/mips/conf/AR933X_BASE user/alc/PQ_LAUNDRY/sys/mips/conf/AR934X_BASE Modified: user/alc/PQ_LAUNDRY/bin/uuidgen/uuidgen.c user/alc/PQ_LAUNDRY/contrib/elftoolchain/readelf/readelf.c user/alc/PQ_LAUNDRY/contrib/libpcap/pcap-bpf.c user/alc/PQ_LAUNDRY/crypto/openssh/FREEBSD-upgrade user/alc/PQ_LAUNDRY/crypto/openssh/config.h user/alc/PQ_LAUNDRY/crypto/openssh/configure.ac user/alc/PQ_LAUNDRY/crypto/openssh/myproposal.h user/alc/PQ_LAUNDRY/crypto/openssh/servconf.c user/alc/PQ_LAUNDRY/crypto/openssh/ssh_config.5 user/alc/PQ_LAUNDRY/crypto/openssh/sshd_config.5 user/alc/PQ_LAUNDRY/etc/rc.d/sshd user/alc/PQ_LAUNDRY/include/stdio.h user/alc/PQ_LAUNDRY/lib/libc/gen/Makefile.inc user/alc/PQ_LAUNDRY/lib/libc/gen/clock_getcpuclockid.3 user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c user/alc/PQ_LAUNDRY/lib/libc/sys/mprotect.2 user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c user/alc/PQ_LAUNDRY/sbin/geom/class/eli/geli.8 user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_radix.c user/alc/PQ_LAUNDRY/share/man/man3/pthread_getcpuclockid.3 user/alc/PQ_LAUNDRY/share/man/man9/Makefile user/alc/PQ_LAUNDRY/share/man/man9/pci.9 user/alc/PQ_LAUNDRY/share/misc/bsd-family-tree user/alc/PQ_LAUNDRY/sys/amd64/vmm/vmm.c user/alc/PQ_LAUNDRY/sys/arm/allwinner/axp209.c user/alc/PQ_LAUNDRY/sys/arm/include/elf.h user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/boot1.c user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/ufs_module.c user/alc/PQ_LAUNDRY/sys/boot/efi/boot1/zfs_module.c user/alc/PQ_LAUNDRY/sys/boot/fdt/dts/arm/zynq-7000.dtsi user/alc/PQ_LAUNDRY/sys/boot/i386/libi386/biosdisk.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_proto.h user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_syscall.h user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_syscalls.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_sysent.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_systrace_args.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/syscalls.master user/alc/PQ_LAUNDRY/sys/conf/files.amd64 user/alc/PQ_LAUNDRY/sys/conf/files.i386 user/alc/PQ_LAUNDRY/sys/conf/files.pc98 user/alc/PQ_LAUNDRY/sys/conf/files.powerpc user/alc/PQ_LAUNDRY/sys/conf/options.powerpc user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_if.m user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_iov.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/tom/t4_ddp.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/tom/t4_tom.h user/alc/PQ_LAUNDRY/sys/dev/hwpmc/hwpmc_core.c user/alc/PQ_LAUNDRY/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_if.m user/alc/PQ_LAUNDRY/sys/dev/pci/pci_iov.c user/alc/PQ_LAUNDRY/sys/dev/pci/pci_iov.h user/alc/PQ_LAUNDRY/sys/dev/pci/pci_private.h user/alc/PQ_LAUNDRY/sys/fs/nfsclient/nfs_clbio.c user/alc/PQ_LAUNDRY/sys/fs/nfsclient/nfs_clsubs.c user/alc/PQ_LAUNDRY/sys/fs/nfsclient/nfs_clvnops.c user/alc/PQ_LAUNDRY/sys/fs/nfsclient/nfsnode.h user/alc/PQ_LAUNDRY/sys/fs/pseudofs/pseudofs.c user/alc/PQ_LAUNDRY/sys/fs/pseudofs/pseudofs.h user/alc/PQ_LAUNDRY/sys/fs/pseudofs/pseudofs_fileno.c user/alc/PQ_LAUNDRY/sys/fs/pseudofs/pseudofs_vncache.c user/alc/PQ_LAUNDRY/sys/kern/init_sysent.c user/alc/PQ_LAUNDRY/sys/kern/kern_fork.c user/alc/PQ_LAUNDRY/sys/kern/kern_sx.c user/alc/PQ_LAUNDRY/sys/kern/syscalls.c user/alc/PQ_LAUNDRY/sys/kern/syscalls.master user/alc/PQ_LAUNDRY/sys/kern/systrace_args.c user/alc/PQ_LAUNDRY/sys/kern/vfs_subr.c user/alc/PQ_LAUNDRY/sys/kern/vnode_if.src user/alc/PQ_LAUNDRY/sys/mips/conf/ALFA_HORNET_UB user/alc/PQ_LAUNDRY/sys/mips/conf/AP121 user/alc/PQ_LAUNDRY/sys/mips/conf/CARAMBOLA2 user/alc/PQ_LAUNDRY/sys/mips/conf/DB120 user/alc/PQ_LAUNDRY/sys/mips/conf/DIR-825C1 user/alc/PQ_LAUNDRY/sys/mips/conf/ONIONOMEGA user/alc/PQ_LAUNDRY/sys/mips/conf/TL-WDR4300 user/alc/PQ_LAUNDRY/sys/mips/conf/TL-WR740Nv4 user/alc/PQ_LAUNDRY/sys/mips/conf/TP-MR3020 user/alc/PQ_LAUNDRY/sys/powerpc/conf/MPC85XX user/alc/PQ_LAUNDRY/sys/powerpc/conf/dpaa/DPAA user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/mpc85xx.c user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/mpc85xx.h user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/pci_mpc85xx.c user/alc/PQ_LAUNDRY/sys/powerpc/mpc85xx/platform_mpc85xx.c user/alc/PQ_LAUNDRY/sys/sys/elf_common.h user/alc/PQ_LAUNDRY/sys/sys/mman.h user/alc/PQ_LAUNDRY/sys/sys/pmc.h user/alc/PQ_LAUNDRY/sys/sys/syscall.h user/alc/PQ_LAUNDRY/sys/sys/syscall.mk user/alc/PQ_LAUNDRY/sys/sys/sysproto.h user/alc/PQ_LAUNDRY/sys/sys/vnode.h user/alc/PQ_LAUNDRY/sys/vm/swap_pager.c user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c user/alc/PQ_LAUNDRY/usr.bin/grep/regex/tre-fastmatch.c user/alc/PQ_LAUNDRY/usr.bin/indent/args.c user/alc/PQ_LAUNDRY/usr.bin/indent/indent.1 user/alc/PQ_LAUNDRY/usr.bin/indent/indent.c user/alc/PQ_LAUNDRY/usr.bin/indent/indent.h user/alc/PQ_LAUNDRY/usr.bin/indent/indent_globs.h user/alc/PQ_LAUNDRY/usr.bin/indent/lexi.c user/alc/PQ_LAUNDRY/usr.bin/truss/setup.c user/alc/PQ_LAUNDRY/usr.sbin/kgzip/kgzip.8 Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/contrib/elftoolchain/ (props changed) user/alc/PQ_LAUNDRY/contrib/libpcap/ (props changed) user/alc/PQ_LAUNDRY/crypto/openssh/ (props changed) Modified: user/alc/PQ_LAUNDRY/bin/uuidgen/uuidgen.c ============================================================================== --- user/alc/PQ_LAUNDRY/bin/uuidgen/uuidgen.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/bin/uuidgen/uuidgen.c Thu Aug 4 16:36:00 2016 (r303748) @@ -47,7 +47,7 @@ main(int argc, char *argv[]) FILE *fp; uuid_t *store, *uuid; char *p; - int ch, count, i, iterate; + int ch, count, i, iterate, status; count = -1; /* no count yet */ fp = stdout; /* default output file */ @@ -101,7 +101,9 @@ main(int argc, char *argv[]) uuid = store; while (count--) { - uuid_to_string(uuid++, &p, NULL); + uuid_to_string(uuid++, &p, &status); + if (status != uuid_s_ok) + err(1, "cannot stringify a UUID"); fprintf(fp, "%s\n", p); free(p); } Modified: user/alc/PQ_LAUNDRY/contrib/elftoolchain/readelf/readelf.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/elftoolchain/readelf/readelf.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/contrib/elftoolchain/readelf/readelf.c Thu Aug 4 16:36:00 2016 (r303748) @@ -343,7 +343,7 @@ static const char *note_type_openbsd(uns static const char *note_type_unknown(unsigned int nt); static const char *note_type_xen(unsigned int nt); static const char *option_kind(uint8_t kind); -static const char *phdr_type(unsigned int ptype); +static const char *phdr_type(unsigned int mach, unsigned int ptype); static const char *ppc_abi_fp(uint64_t fp); static const char *ppc_abi_vector(uint64_t vec); static void readelf_usage(int status); @@ -622,10 +622,24 @@ elf_ver(unsigned int ver) } static const char * -phdr_type(unsigned int ptype) +phdr_type(unsigned int mach, unsigned int ptype) { static char s_ptype[32]; + if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) { + switch (mach) { + case EM_ARM: + switch (ptype) { + case PT_ARM_ARCHEXT: return "ARM_ARCHEXT"; + case PT_ARM_EXIDX: return "ARM_EXIDX"; + } + break; + } + snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x", + ptype - PT_LOPROC); + return (s_ptype); + } + switch (ptype) { case PT_NULL: return "NULL"; case PT_LOAD: return "LOAD"; @@ -639,10 +653,7 @@ phdr_type(unsigned int ptype) case PT_GNU_STACK: return "GNU_STACK"; case PT_GNU_RELRO: return "GNU_RELRO"; default: - if (ptype >= PT_LOPROC && ptype <= PT_HIPROC) - snprintf(s_ptype, sizeof(s_ptype), "LOPROC+%#x", - ptype - PT_LOPROC); - else if (ptype >= PT_LOOS && ptype <= PT_HIOS) + if (ptype >= PT_LOOS && ptype <= PT_HIOS) snprintf(s_ptype, sizeof(s_ptype), "LOOS+%#x", ptype - PT_LOOS); else @@ -659,6 +670,15 @@ section_type(unsigned int mach, unsigned if (stype >= SHT_LOPROC && stype <= SHT_HIPROC) { switch (mach) { + case EM_ARM: + switch (stype) { + case SHT_ARM_EXIDX: return "ARM_EXIDX"; + case SHT_ARM_PREEMPTMAP: return "ARM_PREEMPTMAP"; + case SHT_ARM_ATTRIBUTES: return "ARM_ATTRIBUTES"; + case SHT_ARM_DEBUGOVERLAY: return "ARM_DEBUGOVERLAY"; + case SHT_ARM_OVERLAYSECTION: return "ARM_OVERLAYSECTION"; + } + break; case EM_X86_64: switch (stype) { case SHT_X86_64_UNWIND: return "X86_64_UNWIND"; @@ -2273,9 +2293,10 @@ dump_phdr(struct readelf *re) #define PH_HDR "Type", "Offset", "VirtAddr", "PhysAddr", "FileSiz", \ "MemSiz", "Flg", "Align" -#define PH_CT phdr_type(phdr.p_type), (uintmax_t)phdr.p_offset, \ - (uintmax_t)phdr.p_vaddr, (uintmax_t)phdr.p_paddr, \ - (uintmax_t)phdr.p_filesz, (uintmax_t)phdr.p_memsz, \ +#define PH_CT phdr_type(re->ehdr.e_machine, phdr.p_type), \ + (uintmax_t)phdr.p_offset, (uintmax_t)phdr.p_vaddr, \ + (uintmax_t)phdr.p_paddr, (uintmax_t)phdr.p_filesz, \ + (uintmax_t)phdr.p_memsz, \ phdr.p_flags & PF_R ? 'R' : ' ', \ phdr.p_flags & PF_W ? 'W' : ' ', \ phdr.p_flags & PF_X ? 'E' : ' ', \ Modified: user/alc/PQ_LAUNDRY/contrib/libpcap/pcap-bpf.c ============================================================================== --- user/alc/PQ_LAUNDRY/contrib/libpcap/pcap-bpf.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/contrib/libpcap/pcap-bpf.c Thu Aug 4 16:36:00 2016 (r303748) @@ -431,6 +431,22 @@ pcap_create_interface(const char *device p->activate_op = pcap_activate_bpf; p->can_set_rfmon_op = pcap_can_set_rfmon_bpf; +#ifdef BIOCSTSTAMP + /* + * We claim that we support microsecond and nanosecond time + * stamps. + */ + p->tstamp_precision_count = 2; + p->tstamp_precision_list = malloc(2 * sizeof(u_int)); + if (p->tstamp_precision_list == NULL) { + snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s", + pcap_strerror(errno)); + free(p); + return (NULL); + } + p->tstamp_precision_list[0] = PCAP_TSTAMP_PRECISION_MICRO; + p->tstamp_precision_list[1] = PCAP_TSTAMP_PRECISION_NANO; +#endif /* BIOCSTSTAMP */ return (p); } @@ -946,7 +962,11 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h /* * Loop through each packet. */ +#ifdef BIOCSTSTAMP +#define bhp ((struct bpf_xhdr *)bp) +#else #define bhp ((struct bpf_hdr *)bp) +#endif ep = bp + cc; #ifdef PCAP_FDDIPAD pad = p->fddipad; @@ -1008,7 +1028,25 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h if (pb->filtering_in_kernel || bpf_filter(p->fcode.bf_insns, datap, bhp->bh_datalen, caplen)) { struct pcap_pkthdr pkthdr; +#ifdef BIOCSTSTAMP + struct bintime bt; + + bt.sec = bhp->bh_tstamp.bt_sec; + bt.frac = bhp->bh_tstamp.bt_frac; + if (p->opt.tstamp_precision == PCAP_TSTAMP_PRECISION_NANO) { + struct timespec ts; + + bintime2timespec(&bt, &ts); + pkthdr.ts.tv_sec = ts.tv_sec; + pkthdr.ts.tv_usec = ts.tv_nsec; + } else { + struct timeval tv; + bintime2timeval(&bt, &tv); + pkthdr.ts.tv_sec = tv.tv_sec; + pkthdr.ts.tv_usec = tv.tv_usec; + } +#else pkthdr.ts.tv_sec = bhp->bh_tstamp.tv_sec; #ifdef _AIX /* @@ -1019,6 +1057,7 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_h #else pkthdr.ts.tv_usec = bhp->bh_tstamp.tv_usec; #endif +#endif /* BIOCSTSTAMP */ #ifdef PCAP_FDDIPAD if (caplen > pad) pkthdr.caplen = caplen - pad; @@ -2192,6 +2231,16 @@ pcap_activate_bpf(pcap_t *p) } } +#ifdef BIOCSTSTAMP + v = BPF_T_BINTIME; + if (ioctl(p->fd, BIOCSTSTAMP, &v) < 0) { + snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "BIOCSTSTAMP: %s", + pcap_strerror(errno)); + status = PCAP_ERROR; + goto bad; + } +#endif /* BIOCSTSTAMP */ + if (ioctl(fd, BIOCGBLEN, (caddr_t)&v) < 0) { snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "BIOCGBLEN: %s", pcap_strerror(errno)); Modified: user/alc/PQ_LAUNDRY/crypto/openssh/FREEBSD-upgrade ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/FREEBSD-upgrade Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/FREEBSD-upgrade Thu Aug 4 16:36:00 2016 (r303748) @@ -142,30 +142,25 @@ Support for TCP wrappers was removed in upstream 6.7p1. We've added it back by porting the 6.6p1 code forward. -6) DSA keys - - DSA keys were disabled by default in upstream 6.9p1. We've added - them back. - -7) Agent client reference counting +6) Agent client reference counting We've added code to ssh-agent.c to implement client reference counting; the agent will automatically exit when the last client disconnects. -8) Class-based login restrictions +7) Class-based login restrictions We've added code to auth2.c to enforce the host.allow, host.deny, times.allow and times.deny login class capabilities. -9) HPN +8) HPN We no longer have the HPN patches (adaptive buffer size for increased throughput on high-BxD links), but we recognize and ignore HPN-related configuration options to avoid breaking existing configurations. -A) AES-CBC +9) AES-CBC The AES-CBC ciphers were removed from the server-side proposal list in 6.7p1 due to theoretical weaknesses and the availability of Modified: user/alc/PQ_LAUNDRY/crypto/openssh/config.h ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/config.h Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/config.h Thu Aug 4 16:36:00 2016 (r303748) @@ -1701,7 +1701,7 @@ /* #undef WITH_SELINUX */ /* include SSH protocol version 1 support */ -#define WITH_SSH1 1 +/* #undef WITH_SSH1 */ /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ Modified: user/alc/PQ_LAUNDRY/crypto/openssh/configure.ac ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/configure.ac Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/configure.ac Thu Aug 4 16:36:00 2016 (r303748) @@ -123,7 +123,7 @@ AC_CHECK_DECL([PR_SET_NO_NEW_PRIVS], [ha ]) openssl=yes -ssh1=yes +ssh1=no AC_ARG_WITH([openssl], [ --without-openssl Disable use of OpenSSL; use only limited internal crypto **EXPERIMENTAL** ], [ if test "x$withval" = "xno" ; then Modified: user/alc/PQ_LAUNDRY/crypto/openssh/myproposal.h ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/myproposal.h Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/myproposal.h Thu Aug 4 16:36:00 2016 (r303748) @@ -100,13 +100,11 @@ HOSTKEY_ECDSA_CERT_METHODS \ "ssh-ed25519-cert-v01@openssh.com," \ "ssh-rsa-cert-v01@openssh.com," \ - "ssh-dss-cert-v01@openssh.com," \ HOSTKEY_ECDSA_METHODS \ "ssh-ed25519," \ "rsa-sha2-512," \ "rsa-sha2-256," \ - "ssh-rsa," \ - "ssh-dss" + "ssh-rsa" /* the actual algorithms */ Modified: user/alc/PQ_LAUNDRY/crypto/openssh/servconf.c ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/servconf.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/servconf.c Thu Aug 4 16:36:00 2016 (r303748) @@ -206,8 +206,6 @@ fill_default_server_options(ServerOption /* Standard Options */ if (options->protocol == SSH_PROTO_UNKNOWN) options->protocol = SSH_PROTO_2; - if (options->protocol & SSH_PROTO_1) - error("WARNING: SSH protocol version 1 enabled"); if (options->num_host_key_files == 0) { /* fill default hostkeys for protocols */ if (options->protocol & SSH_PROTO_1) Modified: user/alc/PQ_LAUNDRY/crypto/openssh/ssh_config.5 ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/ssh_config.5 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/ssh_config.5 Thu Aug 4 16:36:00 2016 (r303748) @@ -871,10 +871,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp The @@ -896,10 +894,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp If hostkeys are known for the destination host then this default is modified @@ -1336,10 +1332,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp The Modified: user/alc/PQ_LAUNDRY/crypto/openssh/sshd_config.5 ============================================================================== --- user/alc/PQ_LAUNDRY/crypto/openssh/sshd_config.5 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/crypto/openssh/sshd_config.5 Thu Aug 4 16:36:00 2016 (r303748) @@ -659,10 +659,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp The @@ -753,10 +751,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp The list of available key types may also be obtained using the @@ -1372,10 +1368,8 @@ ecdsa-sha2-nistp384-cert-v01@openssh.com ecdsa-sha2-nistp521-cert-v01@openssh.com, ssh-ed25519-cert-v01@openssh.com, ssh-rsa-cert-v01@openssh.com, -ssh-dss-cert-v01@openssh.com, -ecdsa-sha2-nistp256,ecdsa-sha2-nistp384, -ecdsa-sha2-nistp521,ssh-ed25519, -ssh-rsa,ssh-dss +ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, +ssh-ed25519,ssh-rsa .Ed .Pp The Modified: user/alc/PQ_LAUNDRY/etc/rc.d/sshd ============================================================================== --- user/alc/PQ_LAUNDRY/etc/rc.d/sshd Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/etc/rc.d/sshd Thu Aug 4 16:36:00 2016 (r303748) @@ -23,7 +23,7 @@ extra_commands="configtest keygen reload : ${sshd_rsa1_enable:="no"} : ${sshd_rsa_enable:="yes"} -: ${sshd_dsa_enable:="yes"} +: ${sshd_dsa_enable:="no"} : ${sshd_ecdsa_enable:="yes"} : ${sshd_ed25519_enable:="yes"} Modified: user/alc/PQ_LAUNDRY/include/stdio.h ============================================================================== --- user/alc/PQ_LAUNDRY/include/stdio.h Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/include/stdio.h Thu Aug 4 16:36:00 2016 (r303748) @@ -357,6 +357,7 @@ ssize_t getdelim(char ** __restrict, si FILE *open_memstream(char **, size_t *); int renameat(int, const char *, int, const char *); int vdprintf(int, const char * __restrict, __va_list); +/* _WITH_GETLINE to allow pre 11 sources to build on 11+ systems */ ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict); int dprintf(int, const char * __restrict, ...); #endif /* __POSIX_VISIBLE >= 200809 */ Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/Makefile.inc ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/Makefile.inc Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/Makefile.inc Thu Aug 4 16:36:00 2016 (r303748) @@ -390,6 +390,7 @@ MLINKS+=getgrent.3 endgrent.3 \ getgrent.3 getgrgid_r.3 MLINKS+=gethostname.3 sethostname.3 MLINKS+=getnetgrent.3 endnetgrent.3 \ + getnetgrent.3 getnetgrent_r.3 \ getnetgrent.3 innetgr.3 \ getnetgrent.3 setnetgrent.3 MLINKS+=getprogname.3 setprogname.3 Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/clock_getcpuclockid.3 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/clock_getcpuclockid.3 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/clock_getcpuclockid.3 Thu Aug 4 16:36:00 2016 (r303748) @@ -70,7 +70,9 @@ Upon successful completion, returns zero; otherwise, an error number is returned to indicate the error. .Sh ERRORS -The clock_getcpuclockid() function will fail if: +The +.Fn clock_getcpuclockid +function will fail if: .Bl -tag -width Er .It Bq Er EPERM The requesting process does not have permission to access the CPU-time @@ -84,7 +86,7 @@ No process can be found corresponding to .Sh STANDARDS The .Fn clock_getcpuclockid -function conform to +function conforms to .St -p1003.1-2001 . .Sh HISTORY The Modified: user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/lib/libc/gen/glob.c Thu Aug 4 16:36:00 2016 (r303748) @@ -177,6 +177,8 @@ static int globexp2(const Char *, const static int globfinal(glob_t *, struct glob_limit *, size_t, const char *); static int match(Char *, Char *, Char *); +static int err_nomatch(glob_t *, struct glob_limit *, const char *); +static int err_aborted(glob_t *, int, char *); #ifdef DEBUG static void qprintf(const char *, Char *); #endif @@ -217,8 +219,7 @@ glob(const char * __restrict pattern, in while (bufnext <= bufend) { clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (globfinal(pglob, &limit, - pglob->gl_pathc, pattern)); + return (err_nomatch(pglob, &limit, pattern)); else if (clen == 0) { too_long = 0; break; @@ -240,8 +241,7 @@ glob(const char * __restrict pattern, in prot = 0; clen = mbrtowc(&wc, patnext, MB_LEN_MAX, &mbs); if (clen == (size_t)-1 || clen == (size_t)-2) - return (globfinal(pglob, &limit, - pglob->gl_pathc, pattern)); + return (err_nomatch(pglob, &limit, pattern)); else if (clen == 0) { too_long = 0; break; @@ -251,7 +251,7 @@ glob(const char * __restrict pattern, in } } if (too_long) - return (globfinal(pglob, &limit, pglob->gl_pathc, pattern)); + return (err_nomatch(pglob, &limit, pattern)); *bufnext = EOS; if (flags & GLOB_BRACE) @@ -608,20 +608,9 @@ glob0(const Char *pattern, glob_t *pglob static int globfinal(glob_t *pglob, struct glob_limit *limit, size_t oldpathc, const char *origpat) { - /* - * If there was no match we are going to append the origpat - * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified - * and the origpat did not contain any magic characters - * GLOB_NOMAGIC is there just for compatibility with csh. - */ - if (pglob->gl_pathc == oldpathc) { - if ((pglob->gl_flags & GLOB_NOCHECK) || - ((pglob->gl_flags & GLOB_NOMAGIC) && - !(pglob->gl_flags & GLOB_MAGCHAR))) - return (globextend(NULL, pglob, limit, origpat)); - else - return (GLOB_NOMATCH); - } + if (pglob->gl_pathc == oldpathc) + return (err_nomatch(pglob, limit, origpat)); + if (!(pglob->gl_flags & GLOB_NOSORT)) qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, pglob->gl_pathc - oldpathc, sizeof(char *), compare); @@ -750,16 +739,10 @@ glob3(Char *pathbuf, Char *pathend, Char if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { if (errno == ENOENT || errno == ENOTDIR) return (0); - if ((pglob->gl_errfunc != NULL && - pglob->gl_errfunc(buf, errno)) || - (pglob->gl_flags & GLOB_ERR)) { - if (errno == 0) - errno = saverrno; - return (GLOB_ABORTED); - } + err = err_aborted(pglob, errno, buf); if (errno == 0) errno = saverrno; - return (0); + return (err); } err = 0; @@ -809,11 +792,9 @@ glob3(Char *pathbuf, Char *pathend, Char } sc += clen; } - if (too_long && ((pglob->gl_errfunc != NULL && - pglob->gl_errfunc(buf, ENAMETOOLONG)) || - (pglob->gl_flags & GLOB_ERR))) { + if (too_long && (err = err_aborted(pglob, ENAMETOOLONG, + buf))) { errno = ENAMETOOLONG; - err = GLOB_ABORTED; break; } if (too_long || !match(pathend, pattern, restpattern)) { @@ -840,9 +821,9 @@ glob3(Char *pathbuf, Char *pathend, Char if (err) return (err); - if (dp == NULL && errno != 0 && ((pglob->gl_errfunc != NULL && - pglob->gl_errfunc(buf, errno)) || (pglob->gl_flags & GLOB_ERR))) - return (GLOB_ABORTED); + if (dp == NULL && errno != 0 && + (err = err_aborted(pglob, errno, buf))) + return (err); if (errno == 0) errno = saverrno; @@ -1079,6 +1060,29 @@ g_Ctoc(const Char *str, char *buf, size_ return (1); } +static int +err_nomatch(glob_t *pglob, struct glob_limit *limit, const char *origpat) { + /* + * If there was no match we are going to append the origpat + * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified + * and the origpat did not contain any magic characters + * GLOB_NOMAGIC is there just for compatibility with csh. + */ + if ((pglob->gl_flags & GLOB_NOCHECK) || + ((pglob->gl_flags & GLOB_NOMAGIC) && + !(pglob->gl_flags & GLOB_MAGCHAR))) + return (globextend(NULL, pglob, limit, origpat)); + return (GLOB_NOMATCH); +} + +static int +err_aborted(glob_t *pglob, int err, char *buf) { + if ((pglob->gl_errfunc != NULL && pglob->gl_errfunc(buf, err)) || + (pglob->gl_flags & GLOB_ERR)) + return (GLOB_ABORTED); + return (0); +} + #ifdef DEBUG static void qprintf(const char *str, Char *s) Modified: user/alc/PQ_LAUNDRY/lib/libc/sys/mprotect.2 ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libc/sys/mprotect.2 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/lib/libc/sys/mprotect.2 Thu Aug 4 16:36:00 2016 (r303748) @@ -28,7 +28,7 @@ .\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd August 3, 2016 .Dt MPROTECT 2 .Os .Sh NAME @@ -39,7 +39,7 @@ .Sh SYNOPSIS .In sys/mman.h .Ft int -.Fn mprotect "const void *addr" "size_t len" "int prot" +.Fn mprotect "void *addr" "size_t len" "int prot" .Sh DESCRIPTION The .Fn mprotect Modified: user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c ============================================================================== --- user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/lib/libproc/proc_create.c Thu Aug 4 16:36:00 2016 (r303748) @@ -73,9 +73,9 @@ proc_init(pid_t pid, int flags, int stat struct proc_handle *phdl; int error, class, count, fd; - *pphdl = NULL; + error = ENOMEM; if ((phdl = malloc(sizeof(*phdl))) == NULL) - return (ENOMEM); + goto out; memset(phdl, 0, sizeof(*phdl)); phdl->pid = pid; @@ -83,17 +83,17 @@ proc_init(pid_t pid, int flags, int stat phdl->status = status; phdl->procstat = procstat_open_sysctl(); if (phdl->procstat == NULL) - return (ENOMEM); + goto out; /* Obtain a path to the executable. */ if ((kp = procstat_getprocs(phdl->procstat, KERN_PROC_PID, pid, &count)) == NULL) - return (ENOMEM); + goto out; error = procstat_getpathname(phdl->procstat, kp, phdl->execpath, sizeof(phdl->execpath)); procstat_freeprocs(phdl->procstat, kp); if (error != 0) - return (error); + goto out; /* Use it to determine the data model for the process. */ if ((fd = open(phdl->execpath, O_RDONLY)) < 0) { Modified: user/alc/PQ_LAUNDRY/sbin/geom/class/eli/geli.8 ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/geom/class/eli/geli.8 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sbin/geom/class/eli/geli.8 Thu Aug 4 16:36:00 2016 (r303748) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 10, 2015 +.Dd August 3, 2016 .Dt GELI 8 .Os .Sh NAME @@ -266,7 +266,7 @@ If the option is not given, there will b The recommended algorithm is .Nm HMAC/SHA256 . .It Fl b -Ask for the passphrase on boot, before the root partition is mounted. +Try to decrypt this partition during boot, before the root partition is mounted. This makes it possible to use an encrypted root partition. One will still need bootable unencrypted storage with a .Pa /boot/ Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c Thu Aug 4 16:36:00 2016 (r303748) @@ -82,7 +82,7 @@ int pfctl_load_limit(struct pfctl *, un int pfctl_load_timeout(struct pfctl *, unsigned int, unsigned int); int pfctl_load_debug(struct pfctl *, unsigned int); int pfctl_load_logif(struct pfctl *, char *); -int pfctl_load_hostid(struct pfctl *, unsigned int); +int pfctl_load_hostid(struct pfctl *, u_int32_t); int pfctl_get_pool(int, struct pf_pool *, u_int32_t, u_int32_t, int, char *); void pfctl_print_rule_counters(struct pf_rule *, int); @@ -100,7 +100,7 @@ int pfctl_ruleset_trans(struct pfctl *, int pfctl_load_ruleset(struct pfctl *, char *, struct pf_ruleset *, int, int); int pfctl_load_rule(struct pfctl *, char *, struct pf_rule *, int); -const char *pfctl_lookup_option(char *, const char **); +const char *pfctl_lookup_option(char *, const char * const *); struct pf_anchor_global pf_anchors; struct pf_anchor pf_main_anchor; @@ -111,7 +111,7 @@ const char *showopt; const char *debugopt; char *anchoropt; const char *optiopt = NULL; -char *pf_device = "/dev/pf"; +const char *pf_device = "/dev/pf"; char *ifaceopt; char *tableopt; const char *tblcmdopt; @@ -203,27 +203,27 @@ static const struct { { NULL, NULL } }; -static const char *clearopt_list[] = { +static const char * const clearopt_list[] = { "nat", "queue", "rules", "Sources", "states", "info", "Tables", "osfp", "all", NULL }; -static const char *showopt_list[] = { +static const char * const showopt_list[] = { "nat", "queue", "rules", "Anchors", "Sources", "states", "info", "Interfaces", "labels", "timeouts", "memory", "Tables", "osfp", "all", NULL }; -static const char *tblcmdopt_list[] = { +static const char * const tblcmdopt_list[] = { "kill", "flush", "add", "delete", "load", "replace", "show", "test", "zero", "expire", NULL }; -static const char *debugopt_list[] = { +static const char * const debugopt_list[] = { "none", "urgent", "misc", "loud", NULL }; -static const char *optiopt_list[] = { +static const char * const optiopt_list[] = { "none", "basic", "profile", NULL }; @@ -1975,7 +1975,7 @@ pfctl_show_anchors(int dev, int opts, ch } const char * -pfctl_lookup_option(char *cmd, const char **list) +pfctl_lookup_option(char *cmd, const char * const *list) { if (cmd != NULL && *cmd) for (; *list; list++) Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c Thu Aug 4 16:36:00 2016 (r303748) @@ -76,7 +76,7 @@ struct node_host *host_v4(const char *, struct node_host *host_v6(const char *, int); struct node_host *host_dns(const char *, int, int); -const char *tcpflags = "FSRPAUEW"; +const char * const tcpflags = "FSRPAUEW"; static const struct icmptypeent icmp_type[] = { { "echoreq", ICMP_ECHO }, @@ -473,10 +473,10 @@ print_pool(struct pf_pool *pool, u_int16 printf(" static-port"); } -const char *pf_reasons[PFRES_MAX+1] = PFRES_NAMES; -const char *pf_lcounters[LCNT_MAX+1] = LCNT_NAMES; -const char *pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; -const char *pf_scounters[FCNT_MAX+1] = FCNT_NAMES; +const char * const pf_reasons[PFRES_MAX+1] = PFRES_NAMES; +const char * const pf_lcounters[LCNT_MAX+1] = LCNT_NAMES; +const char * const pf_fcounters[FCNT_MAX+1] = FCNT_NAMES; +const char * const pf_scounters[FCNT_MAX+1] = FCNT_NAMES; void print_status(struct pf_status *s, int opts) Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_radix.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_radix.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_radix.c Thu Aug 4 16:36:00 2016 (r303748) @@ -401,7 +401,7 @@ pfi_get_ifaces(const char *filter, struc /* buffer management code */ -size_t buf_esize[PFRB_MAX] = { 0, +const size_t buf_esize[PFRB_MAX] = { 0, sizeof(struct pfr_table), sizeof(struct pfr_tstats), sizeof(struct pfr_addr), sizeof(struct pfr_astats), sizeof(struct pfi_kif), sizeof(struct pfioc_trans_e) Modified: user/alc/PQ_LAUNDRY/share/man/man3/pthread_getcpuclockid.3 ============================================================================== --- user/alc/PQ_LAUNDRY/share/man/man3/pthread_getcpuclockid.3 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/share/man/man3/pthread_getcpuclockid.3 Thu Aug 4 16:36:00 2016 (r303748) @@ -51,8 +51,8 @@ The .Fn pthread_getcpuclockid returns the clock ID of the CPU-time clock of the thread specified by -.Fa thread_id . -If the thread described by +.Fa thread_id , +if the thread described by .Fa thread_id exists. .Sh RETURN VALUES @@ -61,7 +61,9 @@ Upon successful completion, returns zero; otherwise, an error number is returned to indicate the error. .Sh ERRORS -The pthread_getcpuclockid() function will fail if: +The +.Fn pthread_getcpuclockid +function will fail if: .Bl -tag -width Er .It Bq Er ESRCH The value specified by Modified: user/alc/PQ_LAUNDRY/share/man/man9/Makefile ============================================================================== --- user/alc/PQ_LAUNDRY/share/man/man9/Makefile Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/share/man/man9/Makefile Thu Aug 4 16:36:00 2016 (r303748) @@ -1303,6 +1303,7 @@ MLINKS+=pci.9 pci_alloc_msi.9 \ pci.9 pci_get_vpd_ident.9 \ pci.9 pci_get_vpd_readonly.9 \ pci.9 pci_iov_attach.9 \ + pci.9 pci_iov_attach_name.9 \ pci.9 pci_iov_detach.9 \ pci.9 pci_msi_count.9 \ pci.9 pci_msix_count.9 \ Modified: user/alc/PQ_LAUNDRY/share/man/man9/pci.9 ============================================================================== --- user/alc/PQ_LAUNDRY/share/man/man9/pci.9 Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/share/man/man9/pci.9 Thu Aug 4 16:36:00 2016 (r303748) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 24, 2016 +.Dd August 3, 2016 .Dt PCI 9 .Os .Sh NAME @@ -50,6 +50,7 @@ .Nm pci_get_vpd_ident , .Nm pci_get_vpd_readonly , .Nm pci_iov_attach , +.Nm pci_iov_attach_name , .Nm pci_iov_detach , .Nm pci_msi_count , .Nm pci_msix_count , @@ -152,6 +153,14 @@ .Ft int .Fn pci_iov_attach "device_t dev" "nvlist_t *pf_schema" "nvlist_t *vf_schema" .Ft int +.Fo pci_iov_attach_name +.Fa "device_t dev" +.Fa "nvlist_t *pf_schema" +.Fa "nvlist_t *vf_schema" +.Fa "const char *fmt" +.Fa "..." +.Fc +.Ft int .Fn pci_iov_detach "device_t dev" .Sh DESCRIPTION The @@ -595,6 +604,20 @@ and is responsible for freeing them. The driver must never free the schemas itself. .Pp The +.Fn pci_iov_attach_name +function is a variant of +.Fn pci_iov_attach +that allows the name of the associated character device in +.Pa /dev/iov +to be specified by +.Fa fmt . +The +.Fn pci_iov_attach +function uses the name of +.Fa dev +as the device name. +.Pp +The .Fn pci_iov_detach function is used to advise the SR-IOV infrastructure that the driver for the given device is attempting to detach and that all SR-IOV resources for the Modified: user/alc/PQ_LAUNDRY/share/misc/bsd-family-tree ============================================================================== --- user/alc/PQ_LAUNDRY/share/misc/bsd-family-tree Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/share/misc/bsd-family-tree Thu Aug 4 16:36:00 2016 (r303748) @@ -338,7 +338,7 @@ FreeBSD 5.2 | | | | | | | DragonFly 4.4.1 | FreeBSD | | OpenBSD 5.9 | | 10.3 | | | | - | | | | | + | | | | DragonFly 4.6.0 *--FreeBSD | | | | | 11.0 | | | | | | | | | @@ -691,6 +691,7 @@ OpenBSD 5.8 2015-10-18 [OBD] DragonFly 4.4.1 2015-12-07 [DFB] OpenBSD 5.9 2016-03-29 [OBD] FreeBSD 10.3 2016-04-04 [FBD] +DragonFly 4.6.0 2016-08-02 [DFB] Bibliography ------------------------ Modified: user/alc/PQ_LAUNDRY/sys/amd64/vmm/vmm.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/amd64/vmm/vmm.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sys/amd64/vmm/vmm.c Thu Aug 4 16:36:00 2016 (r303748) @@ -914,7 +914,7 @@ vm_gpa_hold(struct vm *vm, int vcpuid, v * guaranteed if at least one vcpu is in the VCPU_FROZEN state. */ int state; - KASSERT(vcpuid >= -1 || vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d", + KASSERT(vcpuid >= -1 && vcpuid < VM_MAXCPU, ("%s: invalid vcpuid %d", __func__, vcpuid)); for (i = 0; i < VM_MAXCPU; i++) { if (vcpuid != -1 && vcpuid != i) Modified: user/alc/PQ_LAUNDRY/sys/arm/allwinner/axp209.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/arm/allwinner/axp209.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sys/arm/allwinner/axp209.c Thu Aug 4 16:36:00 2016 (r303748) @@ -707,10 +707,10 @@ extern devclass_t ofwgpiobus_devclass, g extern driver_t ofw_gpiobus_driver, gpioc_driver; EARLY_DRIVER_MODULE(axp209, iicbus, axp209_driver, axp209_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); EARLY_DRIVER_MODULE(ofw_gpiobus, axp209_pmu, ofw_gpiobus_driver, - ofwgpiobus_devclass, 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); -EARLY_DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass, - 0, 0, BUS_PASS_RESOURCE + BUS_PASS_ORDER_MIDDLE); + ofwgpiobus_devclass, 0, 0, BUS_PASS_INTERRUPT + BUS_PASS_ORDER_LATE); +DRIVER_MODULE(gpioc, axp209_pmu, gpioc_driver, gpioc_devclass, + 0, 0); MODULE_VERSION(axp209, 1); MODULE_DEPEND(axp209, iicbus, 1, 1, 1); Modified: user/alc/PQ_LAUNDRY/sys/arm/include/elf.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/arm/include/elf.h Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sys/arm/include/elf.h Thu Aug 4 16:36:00 2016 (r303748) @@ -55,9 +55,6 @@ __ElfType(Auxinfo); #define ELF_MACHINE_OK(x) ((x) == EM_ARM) -/* Unwind info section type */ -#define PT_ARM_EXIDX (PT_LOPROC + 1) - /* * Relocation types. */ Modified: user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c Thu Aug 4 16:20:12 2016 (r303747) +++ user/alc/PQ_LAUNDRY/sys/arm64/arm64/pmap.c Thu Aug 4 16:36:00 2016 (r303748) @@ -218,8 +218,6 @@ vm_offset_t kernel_vm_end = 0; struct msgbuf *msgbufp = NULL; -static struct rwlock_padalign pvh_global_lock; - vm_paddr_t dmap_phys_base; /* The start of the dmap region */ vm_paddr_t dmap_phys_max; /* The limit of the dmap region */ vm_offset_t dmap_max_addr; /* The virtual address limit of the dmap */ @@ -671,11 +669,6 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offs kernel_pmap_store.pm_l0 = (pd_entry_t *)l0pt; PMAP_LOCK_INIT(kernel_pmap); - /* - * Initialize the global pv list lock. - */ - rw_init(&pvh_global_lock, "pmap pv global"); - /* Assume the address we were loaded to is a valid physical address */ min_pa = max_pa = KERNBASE - kern_delta; @@ -1404,9 +1397,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t if (lockp != NULL) { RELEASE_PV_LIST_LOCK(lockp); PMAP_UNLOCK(pmap); - rw_runlock(&pvh_global_lock); VM_WAIT; - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); } @@ -1748,7 +1739,6 @@ free_pv_entry(pmap_t pmap, pv_entry_t pv struct pv_chunk *pc; int idx, field, bit; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_frees, 1)); PV_STAT(atomic_add_int(&pv_entry_spare, 1)); @@ -1805,7 +1795,6 @@ get_pv_entry(pmap_t pmap, struct rwlock struct pv_chunk *pc; vm_page_t m; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); PV_STAT(atomic_add_long(&pv_entry_allocs, 1)); retry: @@ -1873,7 +1862,6 @@ pmap_pvh_remove(struct md_page *pvh, pma { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); TAILQ_FOREACH(pv, &pvh->pv_list, pv_next) { if (pmap == PV_PMAP(pv) && va == pv->pv_va) { TAILQ_REMOVE(&pvh->pv_list, pv, pv_next); @@ -1909,7 +1897,6 @@ pmap_try_insert_pv_entry(pmap_t pmap, vm { pv_entry_t pv; - rw_assert(&pvh_global_lock, RA_LOCKED); PMAP_LOCK_ASSERT(pmap, MA_OWNED); /* Pass NULL instead of the lock pointer to disable reclamation. */ if ((pv = get_pv_entry(pmap, NULL)) != NULL) { @@ -1978,7 +1965,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva anyvalid = 0; SLIST_INIT(&free); - rw_rlock(&pvh_global_lock); PMAP_LOCK(pmap); lock = NULL; @@ -2057,7 +2043,6 @@ pmap_remove(pmap_t pmap, vm_offset_t sva rw_wunlock(lock); if (anyvalid) pmap_invalidate_all(pmap); - rw_runlock(&pvh_global_lock); PMAP_UNLOCK(pmap); pmap_free_zero_pages(&free); } @@ -2080,18 +2065,31 @@ pmap_remove_all(vm_page_t m) { pv_entry_t pv; pmap_t pmap; + struct rwlock *lock; pd_entry_t *pde, tpde; pt_entry_t *pte, tpte; struct spglist free; - int lvl; + int lvl, md_gen; KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("pmap_remove_all: page %p is not managed", m)); SLIST_INIT(&free); - rw_wlock(&pvh_global_lock); + lock = VM_PAGE_TO_PV_LIST_LOCK(m); +retry: + rw_wlock(lock); while ((pv = TAILQ_FIRST(&m->md.pv_list)) != NULL) { pmap = PV_PMAP(pv); - PMAP_LOCK(pmap); + if (!PMAP_TRYLOCK(pmap)) { + md_gen = m->md.pv_gen; + rw_wunlock(lock); + PMAP_LOCK(pmap); + rw_wlock(lock); + if (md_gen != m->md.pv_gen) { + rw_wunlock(lock); + PMAP_UNLOCK(pmap); + goto retry; + } + } pmap_resident_count_dec(pmap, 1); pde = pmap_pde(pmap, pv->pv_va, &lvl); @@ -2126,7 +2124,7 @@ pmap_remove_all(vm_page_t m) PMAP_UNLOCK(pmap); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-user@freebsd.org Fri Aug 5 16:49:33 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF951BB0709 for ; Fri, 5 Aug 2016 16:49:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8FC241BBF; Fri, 5 Aug 2016 16:49:33 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u75GnWSB049620; Fri, 5 Aug 2016 16:49:32 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u75GnWJ7049619; Fri, 5 Aug 2016 16:49:32 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608051649.u75GnWJ7049619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 5 Aug 2016 16:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303774 - user/alc/PQ_LAUNDRY/sys/vm X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 16:49:33 -0000 Author: alc Date: Fri Aug 5 16:49:32 2016 New Revision: 303774 URL: https://svnweb.freebsd.org/changeset/base/303774 Log: A second attempt at avoiding spurious "cycle" decrements. Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Modified: user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 5 16:44:11 2016 (r303773) +++ user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c Fri Aug 5 16:49:32 2016 (r303774) @@ -1078,6 +1078,7 @@ vm_pageout_laundry_worker(void *arg) * The pageout laundry worker is never done, so loop forever. */ for (;;) { + KASSERT(cycle >= 0, ("negative cycle %d", cycle)); KASSERT(target >= 0, ("negative target %d", target)); launder = 0; @@ -1111,7 +1112,7 @@ vm_pageout_laundry_worker(void *arg) if (vm_laundry_target() <= 0 || cycle == 0) { shortfall = prev_shortfall = target = 0; } else { - launder = target / cycle; + launder = target / cycle--; goto dolaundry; } } @@ -1162,7 +1163,7 @@ vm_pageout_laundry_worker(void *arg) target = min(target, bkgrd_launder_max); } if (target > 0 && cycle != 0) - launder = target / cycle; + launder = target / cycle--; dolaundry: if (launder > 0) @@ -1171,7 +1172,6 @@ dolaundry: tsleep(&vm_cnt.v_laundry_count, PVM, "laundr", hz / VM_LAUNDER_INTERVAL); - cycle--; } } From owner-svn-src-user@freebsd.org Fri Aug 5 16:53:27 2016 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E117BB093F for ; Fri, 5 Aug 2016 16:53:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B22810CD; Fri, 5 Aug 2016 16:53:27 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u75GrQOL053047; Fri, 5 Aug 2016 16:53:26 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u75GrOhk053028; Fri, 5 Aug 2016 16:53:24 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201608051653.u75GrOhk053028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Fri, 5 Aug 2016 16:53:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r303775 - in user/alc/PQ_LAUNDRY: sbin/etherswitchcfg sbin/pfctl share/man/man9 sys/amd64/amd64 sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/c... X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Aug 2016 16:53:27 -0000 Author: alc Date: Fri Aug 5 16:53:24 2016 New Revision: 303775 URL: https://svnweb.freebsd.org/changeset/base/303775 Log: MFH r303774 Modified: user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.8 user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.c user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_altq.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_optimize.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_osfp.c user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c user/alc/PQ_LAUNDRY/share/man/man9/Makefile user/alc/PQ_LAUNDRY/share/man/man9/lock.9 user/alc/PQ_LAUNDRY/sys/amd64/amd64/mem.c user/alc/PQ_LAUNDRY/sys/cddl/compat/opensolaris/sys/vnode.h user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_sa.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c user/alc/PQ_LAUNDRY/sys/compat/freebsd32/freebsd32_syscall.h user/alc/PQ_LAUNDRY/sys/dev/cxgbe/t4_main.c user/alc/PQ_LAUNDRY/sys/dev/cxgbe/tom/t4_ddp.c user/alc/PQ_LAUNDRY/sys/dev/etherswitch/arswitch/arswitch.c user/alc/PQ_LAUNDRY/sys/dev/etherswitch/arswitch/arswitch_8327.c user/alc/PQ_LAUNDRY/sys/dev/etherswitch/arswitch/arswitch_8327.h user/alc/PQ_LAUNDRY/sys/dev/etherswitch/arswitch/arswitchvar.h user/alc/PQ_LAUNDRY/sys/dev/etherswitch/etherswitch.h user/alc/PQ_LAUNDRY/sys/dev/hyperv/vmbus/vmbus_brvar.h user/alc/PQ_LAUNDRY/sys/dev/ioat/ioat.c user/alc/PQ_LAUNDRY/sys/dev/usb/input/ukbd.c user/alc/PQ_LAUNDRY/sys/dev/xen/netfront/netfront.c user/alc/PQ_LAUNDRY/sys/kern/init_sysent.c user/alc/PQ_LAUNDRY/sys/kern/makesyscalls.sh user/alc/PQ_LAUNDRY/sys/kern/syscalls.c user/alc/PQ_LAUNDRY/sys/net/iflib.c user/alc/PQ_LAUNDRY/sys/netinet/tcp_lro.c user/alc/PQ_LAUNDRY/sys/sys/buf.h user/alc/PQ_LAUNDRY/sys/sys/bus.h user/alc/PQ_LAUNDRY/sys/sys/lockmgr.h user/alc/PQ_LAUNDRY/sys/sys/syscall.h user/alc/PQ_LAUNDRY/sys/sys/syscall.mk user/alc/PQ_LAUNDRY/sys/sys/sysproto.h user/alc/PQ_LAUNDRY/sys/vm/vm_pageout.c user/alc/PQ_LAUNDRY/sys/x86/iommu/intel_drv.c Directory Properties: user/alc/PQ_LAUNDRY/ (props changed) user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.8 ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.8 Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.8 Fri Aug 5 16:53:24 2016 (r303775) @@ -33,26 +33,26 @@ .Sh SYNOPSIS .Nm .Op Fl "f control file" -.Ar info +.Cm info .Nm .Op Fl "f control file" -.Ar config +.Cm config .Ar command parameter .Nm .Op Fl "f control file" -.Ar phy +.Cm phy .Ar phy.register[=value] .Nm .Op Fl "f control file" -.Ar port%d +.Cm port%d .Ar [flags] command parameter .Nm .Op Fl "f control file" -.Ar reg +.Cm reg .Ar register[=value] .Nm .Op Fl "f control file" -.Ar vlangroup%d +.Cm vlangroup%d .Ar command parameter .Sh DESCRIPTION The @@ -81,8 +81,8 @@ The config command provides access to gl parameters. It support the following commands: .Pp -.Bl -tag -width ".Ar vlan_mode mode" -compact -.It Ar vlan_mode mode +.Bl -tag -width ".Cm vlan_mode mode" -compact +.It Cm vlan_mode Ar mode Sets the switch VLAN mode (depends on the hardware). .El .Ss phy @@ -103,51 +103,60 @@ The port command selects one of the port It supports the following commands: .Pp .Bl -tag -width ".Ar pvid number" -compact -.It Ar pvid number +.It Cm pvid Ar number Sets the default port VID that is used to process incoming frames that are not tagged. -.It Ar media mediaspec +.It Cm media Ar mediaspec Specifies the physical media configuration to be configured for a port. -.It Ar mediaopt mediaoption +.It Cm mediaopt Ar mediaoption Specifies a list of media options for a port. See .Xr ifconfig 8 for details on -.Ar media +.Cm media and -.Ar mediaopt . +.Cm mediaopt . +.It Cm led Ar number style +Sets the display style for a given LED. Available styles are: +.Cm default +(usually flash on activity), +.Cm on , +.Cm off , +and +.Cm blink . +Not all switches will support all styles. .El .Pp And the following flags (please note that not all flags are supported by all switch drivers): .Pp -.Bl -tag -width ".Ar addtag" -compact -.It Ar addtag +.Bl -tag -width ".Fl addtag" -compact +.It Cm addtag Add VLAN tag to each packet sent by the port. -.It Ar -addtag +.It Fl addtag Disable the add VLAN tag option. -.It Ar striptag +.It Cm striptag Strip the VLAN tags from the packets sent by the port. -.It Ar -striptag +.It Fl striptag Disable the strip VLAN tag option. -.It Ar firstlock +.It Cm firstlock This options makes the switch port lock on the first MAC address it sees. After that, usually you need to reset the switch to learn different MAC addresses. -.It Ar -firstlock +.It Fl firstlock Disable the first lock option. Note that sometimes you need to reset the switch to really disable this option. -.It Ar dropuntagged +.It Cm dropuntagged Drop packets without a VLAN tag. -.It Ar -dropuntagged +.It Fl dropuntagged Disable the drop untagged packets option. -.It Ar doubletag +.It Cm doubletag Enable QinQ for the port. -.It Ar -doubletag +.It Fl doubletag Disable QinQ for the port. -.It Ar ingress +.It Cm ingress Enable the ingress filter on the port. -.It Ar -ingress +.It Fl ingress Disable the ingress filter. .El .Ss reg @@ -156,14 +165,14 @@ The reg command provides access to the r The vlangroup command selects one of the VLAN groups for configuration. It supports the following commands: .Pp -.Bl -tag -width ".Ar vlangroup" -compact -.It Ar vlan VID +.Bl -tag -width ".Cm members" -compact +.It Cm vlan Ar VID Sets the VLAN ID (802.1q VID) for this VLAN group. Frames transmitted on tagged member ports of this group will be tagged with this VID. Incoming frames carrying this tag will be forwarded according to the configuration of this VLAN group. -.It Ar members port,... +.It Cm members Ar port,... Configures which ports are to be a member of this VLAN group. The port numbers are given as a comma-separated list. Each port can optionally be followed by Modified: user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/etherswitchcfg/etherswitchcfg.c Fri Aug 5 16:53:24 2016 (r303775) @@ -83,6 +83,8 @@ struct cmds { }; static struct cmds cmds[]; +/* Must match the ETHERSWITCH_PORT_LED_* enum order */ +static const char *ledstyles[] = { "default", "on", "off", "blink", NULL }; /* * Print a value a la the %b format of the kernel's printf. @@ -270,6 +272,38 @@ set_port_mediaopt(struct cfg *cfg, char } static void +set_port_led(struct cfg *cfg, char *argv[]) +{ + etherswitch_port_t p; + int led; + int i; + + bzero(&p, sizeof(p)); + p.es_port = cfg->unit; + if (ioctl(cfg->fd, IOETHERSWITCHGETPORT, &p) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHGETPORT)"); + + led = strtol(argv[1], NULL, 0); + if (led < 1 || led > p.es_nleds) + errx(EX_USAGE, "invalid led number %s; must be between 1 and %d", + argv[1], p.es_nleds); + + led--; + + for (i=0; ledstyles[i] != NULL; i++) { + if (strcmp(argv[2], ledstyles[i]) == 0) { + p.es_led[led] = i; + break; + } + } + if (ledstyles[i] == NULL) + errx(EX_USAGE, "invalid led style \"%s\"", argv[2]); + + if (ioctl(cfg->fd, IOETHERSWITCHSETPORT, &p) != 0) + err(EX_OSERR, "ioctl(IOETHERSWITCHSETPORT)"); +} + +static void set_vlangroup_vid(struct cfg *cfg, char *argv[]) { int v; @@ -334,10 +368,10 @@ set_register(struct cfg *cfg, char *arg) if (c==arg) return (1); if (*c == '=') { - v = strtol(c+1, NULL, 0); + v = strtoul(c+1, NULL, 0); write_register(cfg, a, v); } - printf("\treg 0x%04x=0x%04x\n", a, read_register(cfg, a)); + printf("\treg 0x%04x=0x%08x\n", a, read_register(cfg, a)); return (0); } @@ -357,7 +391,7 @@ set_phyregister(struct cfg *cfg, char *a if (d == c) return (1); if (*c == '=') { - val = strtol(c+1, NULL, 0); + val = strtoul(c+1, NULL, 0); write_phyregister(cfg, phy, reg, val); } printf("\treg %d.0x%02x=0x%04x\n", phy, reg, read_phyregister(cfg, phy, reg)); @@ -442,6 +476,13 @@ print_port(struct cfg *cfg, int port) printf("\tpvid: %d\n", p.es_pvid); printb("\tflags", p.es_flags, ETHERSWITCH_PORT_FLAGS_BITS); printf("\n"); + if (p.es_nleds) { + printf("\tled: "); + for (i = 0; i < p.es_nleds; i++) { + printf("%d:%s%s", i+1, ledstyles[p.es_led[i]], (i==p.es_nleds-1)?"":" "); + } + printf("\n"); + } printf("\tmedia: "); print_media_word(p.es_ifmr.ifm_current, 1); if (p.es_ifmr.ifm_active != p.es_ifmr.ifm_current) { @@ -540,7 +581,7 @@ usage(struct cfg *cfg __unused, char *ar "phy.register[=value]\n"); fprintf(stderr, "\tetherswitchcfg [-f control file] portX " "[flags] command parameter\n"); - fprintf(stderr, "\t\tport commands: pvid, media, mediaopt\n"); + fprintf(stderr, "\t\tport commands: pvid, media, mediaopt, led\n"); fprintf(stderr, "\tetherswitchcfg [-f control file] reg " "register[=value]\n"); fprintf(stderr, "\tetherswitchcfg [-f control file] vlangroupX " @@ -651,7 +692,7 @@ main(int argc, char *argv[]) for(i=0; cmds[i].name != NULL; i++) { if (cfg.mode == cmds[i].mode && strcmp(argv[0], cmds[i].name) == 0) { if (argc < (cmds[i].args + 1)) { - printf("%s needs an argument\n", cmds[i].name); + printf("%s needs %d argument%s\n", cmds[i].name, cmds[i].args, (cmds[i].args==1)?"":","); break; } (cmds[i].f)(&cfg, argv); @@ -691,6 +732,7 @@ static struct cmds cmds[] = { { MODE_PORT, "pvid", 1, set_port_vid }, { MODE_PORT, "media", 1, set_port_media }, { MODE_PORT, "mediaopt", 1, set_port_mediaopt }, + { MODE_PORT, "led", 2, set_port_led }, { MODE_PORT, "addtag", 0, set_port_flag }, { MODE_PORT, "-addtag", 0, set_port_flag }, { MODE_PORT, "ingress", 0, set_port_flag }, Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/parse.y Fri Aug 5 16:53:24 2016 (r303775) @@ -80,7 +80,7 @@ static int blockpolicy = PFRULE_DROP; static int require_order = 1; static int default_statelock; -TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files); +static TAILQ_HEAD(files, file) files = TAILQ_HEAD_INITIALIZER(files); static struct file { TAILQ_ENTRY(file) entry; FILE *stream; @@ -100,7 +100,7 @@ int lgetc(int); int lungetc(int); int findeol(void); -TAILQ_HEAD(symhead, sym) symhead = TAILQ_HEAD_INITIALIZER(symhead); +static TAILQ_HEAD(symhead, sym) symhead = TAILQ_HEAD_INITIALIZER(symhead); struct sym { TAILQ_ENTRY(sym) entry; int used; @@ -196,7 +196,7 @@ struct peer { struct node_port *port; }; -struct node_queue { +static struct node_queue { char queue[PF_QNAME_SIZE]; char parent[PF_QNAME_SIZE]; char ifname[IFNAMSIZ]; @@ -210,7 +210,7 @@ struct node_qassign { char *pqname; }; -struct filter_opts { +static struct filter_opts { int marker; #define FOM_FLAGS 0x01 #define FOM_ICMP 0x02 @@ -250,12 +250,12 @@ struct filter_opts { } divert; } filter_opts; -struct antispoof_opts { +static struct antispoof_opts { char *label; u_int rtableid; } antispoof_opts; -struct scrub_opts { +static struct scrub_opts { int marker; #define SOM_MINTTL 0x01 #define SOM_MAXMSS 0x02 @@ -273,7 +273,7 @@ struct scrub_opts { u_int rtableid; } scrub_opts; -struct queue_opts { +static struct queue_opts { int marker; #define QOM_BWSPEC 0x01 #define QOM_SCHEDULER 0x02 @@ -287,13 +287,13 @@ struct queue_opts { int qlimit; } queue_opts; -struct table_opts { +static struct table_opts { int flags; int init_addr; struct node_tinithead init_nodes; } table_opts; -struct pool_opts { +static struct pool_opts { int marker; #define POM_TYPE 0x01 #define POM_STICKYADDRESS 0x02 @@ -304,10 +304,10 @@ struct pool_opts { } pool_opts; -struct codel_opts codel_opts; -struct node_hfsc_opts hfsc_opts; -struct node_fairq_opts fairq_opts; -struct node_state_opt *keep_state_defaults = NULL; +static struct codel_opts codel_opts; +static struct node_hfsc_opts hfsc_opts; +static struct node_fairq_opts fairq_opts; +static struct node_state_opt *keep_state_defaults = NULL; int disallow_table(struct node_host *, const char *); int disallow_urpf_failed(struct node_host *, const char *); @@ -352,7 +352,7 @@ void remove_invalid_hosts(struct node_h int invalid_redirect(struct node_host *, sa_family_t); u_int16_t parseicmpspec(char *, sa_family_t); -TAILQ_HEAD(loadanchorshead, loadanchors) +static TAILQ_HEAD(loadanchorshead, loadanchors) loadanchorshead = TAILQ_HEAD_INITIALIZER(loadanchorshead); struct loadanchors { @@ -4460,6 +4460,16 @@ timeout_spec : STRING NUMBER } free($1); } + | INTERVAL NUMBER { + if (check_rulestate(PFCTL_STATE_OPTION)) + YYERROR; + if ($2 < 0 || $2 > UINT_MAX) { + yyerror("only positive values permitted"); + YYERROR; + } + if (pfctl_set_timeout(pf, "interval", $2, 0) != 0) + YYERROR; + } ; timeout_list : timeout_list comma timeout_spec optnl @@ -5572,10 +5582,10 @@ lookup(char *s) #define MAXPUSHBACK 128 -char *parsebuf; -int parseindex; -char pushback_buffer[MAXPUSHBACK]; -int pushback_index = 0; +static char *parsebuf; +static int parseindex; +static char pushback_buffer[MAXPUSHBACK]; +static int pushback_index = 0; int lgetc(int quotec) Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl.c Fri Aug 5 16:53:24 2016 (r303775) @@ -102,29 +102,29 @@ int pfctl_load_ruleset(struct pfctl *, int pfctl_load_rule(struct pfctl *, char *, struct pf_rule *, int); const char *pfctl_lookup_option(char *, const char * const *); -struct pf_anchor_global pf_anchors; -struct pf_anchor pf_main_anchor; +static struct pf_anchor_global pf_anchors; +static struct pf_anchor pf_main_anchor; -const char *clearopt; -char *rulesopt; -const char *showopt; -const char *debugopt; -char *anchoropt; -const char *optiopt = NULL; -const char *pf_device = "/dev/pf"; -char *ifaceopt; -char *tableopt; -const char *tblcmdopt; -int src_node_killers; -char *src_node_kill[2]; -int state_killers; -char *state_kill[2]; -int loadopt; -int altqsupport; - -int dev = -1; -int first_title = 1; -int labels = 0; +static const char *clearopt; +static char *rulesopt; +static const char *showopt; +static const char *debugopt; +static char *anchoropt; +static const char *optiopt = NULL; +static const char *pf_device = "/dev/pf"; +static char *ifaceopt; +static char *tableopt; +static const char *tblcmdopt; +static int src_node_killers; +static char *src_node_kill[2]; +static int state_killers; +static char *state_kill[2]; +int loadopt; +int altqsupport; + +int dev = -1; +static int first_title = 1; +static int labels = 0; #define INDENT(d, o) do { \ if (o) { \ Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_altq.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_altq.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_altq.c Fri Aug 5 16:53:24 2016 (r303775) @@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$"); #define is_sc_null(sc) (((sc) == NULL) || ((sc)->m1 == 0 && (sc)->m2 == 0)) -TAILQ_HEAD(altqs, pf_altq) altqs = TAILQ_HEAD_INITIALIZER(altqs); -LIST_HEAD(gen_sc, segment) rtsc, lssc; +static TAILQ_HEAD(altqs, pf_altq) altqs = TAILQ_HEAD_INITIALIZER(altqs); +static LIST_HEAD(gen_sc, segment) rtsc, lssc; struct pf_altq *qname_to_pfaltq(const char *, const char *); u_int32_t qname_to_qid(const char *); Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_optimize.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_optimize.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_optimize.c Fri Aug 5 16:53:24 2016 (r303775) @@ -90,7 +90,7 @@ enum { COMBINED, /* the field may itself be combined with other rules */ DC, /* we just don't care about the field */ NEVER}; /* we should never see this field set?!? */ -struct pf_rule_field { +static struct pf_rule_field { const char *prf_name; int prf_type; size_t prf_offset; @@ -242,8 +242,9 @@ int superblock_inclusive(struct superblo void superblock_free(struct pfctl *, struct superblock *); -int (*skip_comparitors[PF_SKIP_COUNT])(struct pf_rule *, struct pf_rule *); -const char *skip_comparitors_names[PF_SKIP_COUNT]; +static int (*skip_comparitors[PF_SKIP_COUNT])(struct pf_rule *, + struct pf_rule *); +static const char *skip_comparitors_names[PF_SKIP_COUNT]; #define PF_SKIP_COMPARITORS { \ { "ifp", PF_SKIP_IFP, skip_cmp_ifp }, \ { "dir", PF_SKIP_DIR, skip_cmp_dir }, \ @@ -255,8 +256,8 @@ const char *skip_comparitors_names[PF_SK { "dport", PF_SKIP_DST_PORT, skip_cmp_dst_port } \ } -struct pfr_buffer table_buffer; -int table_identifier; +static struct pfr_buffer table_buffer; +static int table_identifier; int Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_osfp.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_osfp.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_osfp.c Fri Aug 5 16:53:24 2016 (r303775) @@ -16,6 +16,9 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -64,9 +67,9 @@ struct name_entry { struct name_list nm_sublist; int nm_sublist_num; }; -struct name_list classes = LIST_HEAD_INITIALIZER(&classes); -int class_count; -int fingerprint_count; +static struct name_list classes = LIST_HEAD_INITIALIZER(&classes); +static int class_count; +static int fingerprint_count; void add_fingerprint(int, int, struct pf_osfp_ioctl *); struct name_entry *fingerprint_name_entry(struct name_list *, char *); Modified: user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c ============================================================================== --- user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sbin/pfctl/pfctl_parser.c Fri Aug 5 16:53:24 2016 (r303775) @@ -1147,7 +1147,7 @@ check_netmask(struct node_host *h, sa_fa /* interface lookup routines */ -struct node_host *iftab; +static struct node_host *iftab; void ifa_load(void) Modified: user/alc/PQ_LAUNDRY/share/man/man9/Makefile ============================================================================== --- user/alc/PQ_LAUNDRY/share/man/man9/Makefile Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/share/man/man9/Makefile Fri Aug 5 16:53:24 2016 (r303775) @@ -1015,7 +1015,6 @@ MLINKS+=lock.9 lockdestroy.9 \ lock.9 lockmgr_printinfo.9 \ lock.9 lockmgr_recursed.9 \ lock.9 lockmgr_rw.9 \ - lock.9 lockmgr_waiters.9 \ lock.9 lockstatus.9 MLINKS+=LOCK_PROFILING.9 MUTEX_PROFILING.9 MLINKS+=make_dev.9 destroy_dev.9 \ Modified: user/alc/PQ_LAUNDRY/share/man/man9/lock.9 ============================================================================== --- user/alc/PQ_LAUNDRY/share/man/man9/lock.9 Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/share/man/man9/lock.9 Fri Aug 5 16:53:24 2016 (r303775) @@ -39,7 +39,6 @@ .Nm lockmgr_printinfo , .Nm lockmgr_recursed , .Nm lockmgr_rw , -.Nm lockmgr_waiters , .Nm lockstatus , .Nm lockmgr_assert .Nd "lockmgr family of functions" @@ -66,8 +65,6 @@ .Ft int .Fn lockmgr_rw "struct lock *lkp" "u_int flags" "struct rwlock *ilk" .Ft int -.Fn lockmgr_waiters "const struct lock *lkp" -.Ft int .Fn lockstatus "const struct lock *lkp" .Pp .Cd "options INVARIANTS" @@ -279,10 +276,6 @@ function returns true if the lock is rec otherwise. .Pp The -.Fn lockmgr_waiters -function returns true if the lock has waiters, 0 otherwise. -.Pp -The .Fn lockstatus function returns the status of the lock in relation to the current thread. .Pp Modified: user/alc/PQ_LAUNDRY/sys/amd64/amd64/mem.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/amd64/amd64/mem.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/amd64/amd64/mem.c Fri Aug 5 16:53:24 2016 (r303775) @@ -168,9 +168,11 @@ int memmmap(struct cdev *dev, vm_ooffset_t offset, vm_paddr_t *paddr, int prot __unused, vm_memattr_t *memattr __unused) { - if (dev2unit(dev) == CDEV_MINOR_MEM) + if (dev2unit(dev) == CDEV_MINOR_MEM) { + if (offset >= (1ULL << cpu_maxphyaddr)) + return (-1); *paddr = offset; - else if (dev2unit(dev) == CDEV_MINOR_KMEM) + } else if (dev2unit(dev) == CDEV_MINOR_KMEM) *paddr = vtophys(offset); /* else panic! */ return (0); Modified: user/alc/PQ_LAUNDRY/sys/cddl/compat/opensolaris/sys/vnode.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/compat/opensolaris/sys/vnode.h Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/compat/opensolaris/sys/vnode.h Fri Aug 5 16:53:24 2016 (r303775) @@ -87,8 +87,6 @@ vn_is_readonly(vnode_t *vp) #define VN_RELE(v) vrele(v) #define VN_URELE(v) vput(v) -#define VOP_REALVP(vp, vpp, ct) (*(vpp) = (vp), 0) - #define vnevent_create(vp, ct) do { } while (0) #define vnevent_link(vp, ct) do { } while (0) #define vnevent_remove(vp, dvp, name, ct) do { } while (0) Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_dir.h Fri Aug 5 16:53:24 2016 (r303775) @@ -48,18 +48,18 @@ extern "C" { #define IS_ROOT_NODE 0x01 /* create a root node */ #define IS_XATTR 0x02 /* create an extended attribute node */ -extern int zfs_dirent_lock(zfs_dirlock_t **, znode_t *, char *, znode_t **, - int, int *, pathname_t *); -extern void zfs_dirent_unlock(zfs_dirlock_t *); -extern int zfs_link_create(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int); -extern int zfs_link_destroy(zfs_dirlock_t *, znode_t *, dmu_tx_t *, int, +extern int zfs_dirent_lookup(znode_t *, const char *, znode_t **, int); +extern int zfs_link_create(znode_t *, const char *, znode_t *, dmu_tx_t *, int); +extern int zfs_link_destroy(znode_t *, const char *, znode_t *, dmu_tx_t *, int, boolean_t *); -extern int zfs_dirlook(znode_t *, char *, vnode_t **, int, int *, - pathname_t *); +#if 0 +extern int zfs_dirlook(vnode_t *, const char *, vnode_t **, int); +#else +extern int zfs_dirlook(znode_t *, const char *name, znode_t **); +#endif extern void zfs_mknode(znode_t *, vattr_t *, dmu_tx_t *, cred_t *, uint_t, znode_t **, zfs_acl_ids_t *); extern void zfs_rmnode(znode_t *); -extern void zfs_dl_name_switch(zfs_dirlock_t *dl, char *new, char **old); extern boolean_t zfs_dirempty(znode_t *); extern void zfs_unlinked_add(znode_t *, dmu_tx_t *); extern void zfs_unlinked_drain(zfsvfs_t *zfsvfs); Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_vfsops.h Fri Aug 5 16:53:24 2016 (r303775) @@ -75,6 +75,7 @@ struct zfsvfs { boolean_t z_use_fuids; /* version allows fuids */ boolean_t z_replay; /* set during ZIL replay */ boolean_t z_use_sa; /* version allow system attributes */ + boolean_t z_use_namecache;/* make use of FreeBSD name cache */ uint64_t z_version; /* ZPL version */ uint64_t z_shares_dir; /* hidden shares dir */ kmutex_t z_lock; Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Fri Aug 5 16:53:24 2016 (r303775) @@ -181,10 +181,12 @@ typedef struct znode { struct zfsvfs *z_zfsvfs; vnode_t *z_vnode; uint64_t z_id; /* object ID for this znode */ +#ifdef illumos kmutex_t z_lock; /* znode modification lock */ krwlock_t z_parent_lock; /* parent lock for directories */ krwlock_t z_name_lock; /* "master" lock for dirent locks */ zfs_dirlock_t *z_dirlocks; /* directory entry lock list */ +#endif kmutex_t z_range_lock; /* protects changes to z_range_avl */ avl_tree_t z_range_avl; /* avl tree of file range locks */ uint8_t z_unlinked; /* file has been unlinked */ Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Fri Aug 5 16:53:24 2016 (r303775) @@ -1055,8 +1055,7 @@ zfs_mode_compute(uint64_t fmode, zfs_acl * create a new acl and leave any cached acl in place. */ static int -zfs_acl_node_read(znode_t *zp, boolean_t have_lock, zfs_acl_t **aclpp, - boolean_t will_modify) +zfs_acl_node_read(znode_t *zp, zfs_acl_t **aclpp, boolean_t will_modify) { zfs_acl_t *aclp; int aclsize; @@ -1065,26 +1064,15 @@ zfs_acl_node_read(znode_t *zp, boolean_t zfs_acl_phys_t znode_acl; int version; int error; - boolean_t drop_lock = B_FALSE; ASSERT(MUTEX_HELD(&zp->z_acl_lock)); + ASSERT_VOP_LOCKED(ZTOV(zp), __func__); if (zp->z_acl_cached && !will_modify) { *aclpp = zp->z_acl_cached; return (0); } - /* - * close race where znode could be upgrade while trying to - * read the znode attributes. - * - * But this could only happen if the file isn't already an SA - * znode - */ - if (!zp->z_is_sa && !have_lock) { - mutex_enter(&zp->z_lock); - drop_lock = B_TRUE; - } version = zfs_znode_acl_version(zp); if ((error = zfs_acl_znode_info(zp, &aclsize, @@ -1130,8 +1118,6 @@ zfs_acl_node_read(znode_t *zp, boolean_t if (!will_modify) zp->z_acl_cached = aclp; done: - if (drop_lock) - mutex_exit(&zp->z_lock); return (error); } @@ -1158,10 +1144,10 @@ zfs_acl_chown_setattr(znode_t *zp) int error; zfs_acl_t *aclp; - ASSERT(MUTEX_HELD(&zp->z_lock)); + ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); ASSERT(MUTEX_HELD(&zp->z_acl_lock)); - if ((error = zfs_acl_node_read(zp, B_TRUE, &aclp, B_FALSE)) == 0) + if ((error = zfs_acl_node_read(zp, &aclp, B_FALSE)) == 0) zp->z_mode = zfs_mode_compute(zp->z_mode, aclp, &zp->z_pflags, zp->z_uid, zp->z_gid); return (error); @@ -1453,18 +1439,17 @@ zfs_acl_chmod_setattr(znode_t *zp, zfs_a int error = 0; mutex_enter(&zp->z_acl_lock); - mutex_enter(&zp->z_lock); + ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); if (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_DISCARD) *aclp = zfs_acl_alloc(zfs_acl_version_zp(zp)); else - error = zfs_acl_node_read(zp, B_TRUE, aclp, B_TRUE); + error = zfs_acl_node_read(zp, aclp, B_TRUE); if (error == 0) { (*aclp)->z_hints = zp->z_pflags & V4_ACL_WIDE_FLAGS; zfs_acl_chmod(ZTOV(zp)->v_type, mode, B_TRUE, (zp->z_zfsvfs->z_acl_mode == ZFS_ACL_GROUPMASK), *aclp); } - mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); return (error); @@ -1617,6 +1602,7 @@ zfs_acl_ids_create(znode_t *dzp, int fla boolean_t trim = B_FALSE; boolean_t inherited = B_FALSE; + ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); bzero(acl_ids, sizeof (zfs_acl_ids_t)); acl_ids->z_mode = MAKEIMODE(vap->va_type, vap->va_mode); @@ -1700,12 +1686,10 @@ zfs_acl_ids_create(znode_t *dzp, int fla if (acl_ids->z_aclp == NULL) { mutex_enter(&dzp->z_acl_lock); - mutex_enter(&dzp->z_lock); if (!(flag & IS_ROOT_NODE) && (dzp->z_pflags & ZFS_INHERIT_ACE) && !(dzp->z_pflags & ZFS_XATTR)) { - VERIFY(0 == zfs_acl_node_read(dzp, B_TRUE, - &paclp, B_FALSE)); + VERIFY(0 == zfs_acl_node_read(dzp, &paclp, B_FALSE)); acl_ids->z_aclp = zfs_acl_inherit(zfsvfs, vap->va_type, paclp, acl_ids->z_mode); inherited = B_TRUE; @@ -1714,7 +1698,6 @@ zfs_acl_ids_create(znode_t *dzp, int fla zfs_acl_alloc(zfs_acl_version_zp(dzp)); acl_ids->z_aclp->z_hints |= ZFS_ACL_TRIVIAL; } - mutex_exit(&dzp->z_lock); mutex_exit(&dzp->z_acl_lock); if (vap->va_type == VDIR) @@ -1783,7 +1766,8 @@ zfs_getacl(znode_t *zp, vsecattr_t *vsec mutex_enter(&zp->z_acl_lock); - error = zfs_acl_node_read(zp, B_FALSE, &aclp, B_FALSE); + ASSERT_VOP_LOCKED(ZTOV(zp), __func__); + error = zfs_acl_node_read(zp, &aclp, B_FALSE); if (error != 0) { mutex_exit(&zp->z_acl_lock); return (error); @@ -1931,6 +1915,7 @@ zfs_setacl(znode_t *zp, vsecattr_t *vsec boolean_t fuid_dirtied; uint64_t acl_obj; + ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); if (mask == 0) return (SET_ERROR(ENOSYS)); @@ -1955,7 +1940,6 @@ zfs_setacl(znode_t *zp, vsecattr_t *vsec } top: mutex_enter(&zp->z_acl_lock); - mutex_enter(&zp->z_lock); tx = dmu_tx_create(zfsvfs->z_os); @@ -1987,7 +1971,6 @@ top: zfs_sa_upgrade_txholds(tx, zp); error = dmu_tx_assign(tx, TXG_NOWAIT); if (error) { - mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); if (error == ERESTART) { @@ -2013,7 +1996,6 @@ top: if (fuidp) zfs_fuid_info_free(fuidp); dmu_tx_commit(tx); - mutex_exit(&zp->z_lock); mutex_exit(&zp->z_acl_lock); return (error); @@ -2117,7 +2099,8 @@ zfs_zaccess_aces_check(znode_t *zp, uint mutex_enter(&zp->z_acl_lock); - error = zfs_acl_node_read(zp, B_FALSE, &aclp, B_FALSE); + ASSERT_VOP_LOCKED(ZTOV(zp), __func__); + error = zfs_acl_node_read(zp, &aclp, B_FALSE); if (error != 0) { mutex_exit(&zp->z_acl_lock); return (error); Modified: user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Aug 5 16:49:32 2016 (r303774) +++ user/alc/PQ_LAUNDRY/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Fri Aug 5 16:53:24 2016 (r303775) @@ -58,96 +58,64 @@ #include /* - * zfs_match_find() is used by zfs_dirent_lock() to peform zap lookups + * zfs_match_find() is used by zfs_dirent_lookup() to peform zap lookups * of names after deciding which is the appropriate lookup interface. */ static int -zfs_match_find(zfsvfs_t *zfsvfs, znode_t *dzp, char *name, boolean_t exact, - boolean_t update, int *deflags, pathname_t *rpnp, uint64_t *zoid) +zfs_match_find(zfsvfs_t *zfsvfs, znode_t *dzp, const char *name, + boolean_t exact, uint64_t *zoid) { int error; if (zfsvfs->z_norm) { - matchtype_t mt = MT_FIRST; - boolean_t conflict = B_FALSE; - size_t bufsz = 0; - char *buf = NULL; - - if (rpnp) { - buf = rpnp->pn_buf; - bufsz = rpnp->pn_bufsize; - } - if (exact) - mt = MT_EXACT; + matchtype_t mt = exact? MT_EXACT : MT_FIRST; + /* * In the non-mixed case we only expect there would ever * be one match, but we need to use the normalizing lookup. */ error = zap_lookup_norm(zfsvfs->z_os, dzp->z_id, name, 8, 1, - zoid, mt, buf, bufsz, &conflict); - if (!error && deflags) - *deflags = conflict ? ED_CASE_CONFLICT : 0; + zoid, mt, NULL, 0, NULL); } else { error = zap_lookup(zfsvfs->z_os, dzp->z_id, name, 8, 1, zoid); } *zoid = ZFS_DIRENT_OBJ(*zoid); - if (error == ENOENT && update) - dnlc_update(ZTOV(dzp), name, DNLC_NO_VNODE); - return (error); } /* - * Lock a directory entry. A dirlock on protects that name - * in dzp's directory zap object. As long as you hold a dirlock, you can - * assume two things: (1) dzp cannot be reaped, and (2) no other thread - * can change the zap entry for (i.e. link or unlink) this name. + * Look up a directory entry under a locked vnode. + * dvp being locked gives us a guarantee that there are no concurrent + * modification of the directory and, thus, if a node can be found in + * the directory, then it must not be unlinked. * * Input arguments: * dzp - znode for directory * name - name of entry to lock * flag - ZNEW: if the entry already exists, fail with EEXIST. * ZEXISTS: if the entry does not exist, fail with ENOENT. - * ZSHARED: allow concurrent access with other ZSHARED callers. * ZXATTR: we want dzp's xattr directory - * ZCILOOK: On a mixed sensitivity file system, - * this lookup should be case-insensitive. - * ZCIEXACT: On a purely case-insensitive file system, - * this lookup should be case-sensitive. - * ZRENAMING: we are locking for renaming, force narrow locks - * ZHAVELOCK: Don't grab the z_name_lock for this call. The - * current thread already holds it. * * Output arguments: * zpp - pointer to the znode for the entry (NULL if there isn't one) - * dlpp - pointer to the dirlock for this entry (NULL on error) - * direntflags - (case-insensitive lookup only) - * flags if multiple case-sensitive matches exist in directory - * realpnp - (case-insensitive lookup only) - * actual name matched within the directory * * Return value: 0 on success or errno on failure. * * NOTE: Always checks for, and rejects, '.' and '..'. - * NOTE: For case-insensitive file systems we take wide locks (see below), - * but return znode pointers to a single match. */ int -zfs_dirent_lock(zfs_dirlock_t **dlpp, znode_t *dzp, char *name, znode_t **zpp, - int flag, int *direntflags, pathname_t *realpnp) +zfs_dirent_lookup(znode_t *dzp, const char *name, znode_t **zpp, int flag) { zfsvfs_t *zfsvfs = dzp->z_zfsvfs; - zfs_dirlock_t *dl; - boolean_t update; boolean_t exact; uint64_t zoid; vnode_t *vp = NULL; int error = 0; - int cmpflags; + + ASSERT_VOP_LOCKED(ZTOV(dzp), __func__); *zpp = NULL; - *dlpp = NULL; /* * Verify that we are not trying to lock '.', '..', or '.zfs' @@ -161,280 +129,108 @@ zfs_dirent_lock(zfs_dirlock_t **dlpp, zn * Case sensitivity and normalization preferences are set when * the file system is created. These are stored in the * zfsvfs->z_case and zfsvfs->z_norm fields. These choices - * affect what vnodes can be cached in the DNLC, how we - * perform zap lookups, and the "width" of our dirlocks. + * affect how we perform zap lookups. * - * A normal dirlock locks a single name. Note that with - * normalization a name can be composed multiple ways, but - * when normalized, these names all compare equal. A wide - * dirlock locks multiple names. We need these when the file - * system is supporting mixed-mode access. It is sometimes - * necessary to lock all case permutations of file name at - * once so that simultaneous case-insensitive/case-sensitive - * behaves as rationally as possible. - */ - - /* * Decide if exact matches should be requested when performing * a zap lookup on file systems supporting case-insensitive * access. - */ - exact = - ((zfsvfs->z_case == ZFS_CASE_INSENSITIVE) && (flag & ZCIEXACT)) || - ((zfsvfs->z_case == ZFS_CASE_MIXED) && !(flag & ZCILOOK)); - - /* - * Only look in or update the DNLC if we are looking for the - * name on a file system that does not require normalization - * or case folding. We can also look there if we happen to be - * on a non-normalizing, mixed sensitivity file system IF we - * are looking for the exact name. * - * Maybe can add TO-UPPERed version of name to dnlc in ci-only - * case for performance improvement? + * NB: we do not need to worry about this flag for ZFS_CASE_SENSITIVE + * because in that case MT_EXACT and MT_FIRST should produce exactly + * the same result. */ - update = !zfsvfs->z_norm || - ((zfsvfs->z_case == ZFS_CASE_MIXED) && - !(zfsvfs->z_norm & ~U8_TEXTPREP_TOUPPER) && !(flag & ZCILOOK)); + exact = zfsvfs->z_case == ZFS_CASE_MIXED; - /* - * ZRENAMING indicates we are in a situation where we should - * take narrow locks regardless of the file system's - * preferences for normalizing and case folding. This will - * prevent us deadlocking trying to grab the same wide lock - * twice if the two names happen to be case-insensitive - * matches. - */ - if (flag & ZRENAMING) - cmpflags = 0; - else - cmpflags = zfsvfs->z_norm; - - /* - * Wait until there are no locks on this name. - * - * Don't grab the the lock if it is already held. However, cannot - * have both ZSHARED and ZHAVELOCK together. - */ - ASSERT(!(flag & ZSHARED) || !(flag & ZHAVELOCK)); - if (!(flag & ZHAVELOCK)) - rw_enter(&dzp->z_name_lock, RW_READER); - - mutex_enter(&dzp->z_lock); - for (;;) { - if (dzp->z_unlinked && !(flag & ZXATTR)) { - mutex_exit(&dzp->z_lock); - if (!(flag & ZHAVELOCK)) - rw_exit(&dzp->z_name_lock); - return (SET_ERROR(ENOENT)); - } *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***