From owner-svn-src-head@freebsd.org Sun Dec 17 18:21:41 2017 Return-Path: Delivered-To: svn-src-head@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 D41B1E91029; Sun, 17 Dec 2017 18:21:41 +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 9D9C579166; Sun, 17 Dec 2017 18:21:41 +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 vBHILe2W030670; Sun, 17 Dec 2017 18:21:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBHILelT030669; Sun, 17 Dec 2017 18:21:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201712171821.vBHILelT030669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 17 Dec 2017 18:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326919 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 326919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Dec 2017 18:21:41 -0000 Author: markj Date: Sun Dec 17 18:21:40 2017 New Revision: 326919 URL: https://svnweb.freebsd.org/changeset/base/326919 Log: Unregister the ARC lowmem event handler earlier in arc_fini(). Otherwise a poorly timed lowmem event may attempt to acquire a destroyed lock. Unregister the handler before destroying the ARC reclaim thread. Reported by: gjb MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13480 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Dec 17 06:00:49 2017 (r326918) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Sun Dec 17 18:21:40 2017 (r326919) @@ -6619,6 +6619,11 @@ arc_init(void) void arc_fini(void) { +#ifdef _KERNEL + if (arc_event_lowmem != NULL) + EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem); +#endif + mutex_enter(&arc_reclaim_lock); arc_reclaim_thread_exit = B_TRUE; /* @@ -6664,11 +6669,6 @@ arc_fini(void) buf_fini(); ASSERT0(arc_loaned_bytes); - -#ifdef _KERNEL - if (arc_event_lowmem != NULL) - EVENTHANDLER_DEREGISTER(vm_lowmem, arc_event_lowmem); -#endif } /* From owner-svn-src-head@freebsd.org Mon Dec 18 00:15:55 2017 Return-Path: Delivered-To: svn-src-head@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 40DFAE9A843; Mon, 18 Dec 2017 00:15:55 +0000 (UTC) (envelope-from ian@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 0B2263D43; Mon, 18 Dec 2017 00:15:54 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI0Fsii076520; Mon, 18 Dec 2017 00:15:54 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI0Fs9t076519; Mon, 18 Dec 2017 00:15:54 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712180015.vBI0Fs9t076519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Dec 2017 00:15:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326924 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 326924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 00:15:55 -0000 Author: ian Date: Mon Dec 18 00:15:53 2017 New Revision: 326924 URL: https://svnweb.freebsd.org/changeset/base/326924 Log: Fix debugging output, fallout from something like s/read/readctl/g while renaming variables in a previous change. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Sun Dec 17 22:12:57 2017 (r326923) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Dec 18 00:15:53 2017 (r326924) @@ -610,7 +610,7 @@ bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, u */ if (sc->sc_replen == 0) { DEVICE_DEBUGF(sc, 1, "%-6s 0x%02x len %d: ", - (curisread) ? "readctl" : "write", curslave, + (curisread) ? "read" : "write", curslave, sc->sc_totlen); curlen = sc->sc_totlen; if (curisread) { @@ -622,7 +622,7 @@ bcm_bsc_transfer(device_t dev, struct iic_msg *msgs, u } } else { DEVICE_DEBUGF(sc, 1, "%-6s 0x%02x len %d: ", - (curisread) ? "readctl" : "write", curslave, + (curisread) ? "read" : "write", curslave, sc->sc_replen); /* From owner-svn-src-head@freebsd.org Mon Dec 18 02:34:38 2017 Return-Path: Delivered-To: svn-src-head@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 A3CBEE9E15F; Mon, 18 Dec 2017 02:34:38 +0000 (UTC) (envelope-from ian@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 6E1A766AE7; Mon, 18 Dec 2017 02:34:38 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI2Ybsk034656; Mon, 18 Dec 2017 02:34:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI2YbnB034655; Mon, 18 Dec 2017 02:34:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712180234.vBI2YbnB034655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 18 Dec 2017 02:34:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326925 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 326925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 02:34:38 -0000 Author: ian Date: Mon Dec 18 02:34:37 2017 New Revision: 326925 URL: https://svnweb.freebsd.org/changeset/base/326925 Log: Do not attempt to refill the TX fifo if there is no data left to transfer. A comment in bcm_bsc_fill_tx_fifo() even lists sc_totlen > 0 as a precondition for calling the routine. I apparently forgot to make the code do what my comment said. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Dec 18 00:15:53 2017 (r326924) +++ head/sys/arm/broadcom/bcm2835/bcm2835_bsc.c Mon Dec 18 02:34:37 2017 (r326925) @@ -508,7 +508,7 @@ bcm_bsc_intr(void *arg) * transfer is complete; TXD will be asserted along with ERR or * DONE if there is room in the fifo. */ - if (status & BCM_BSC_STATUS_TXD) + if ((status & BCM_BSC_STATUS_TXD) && sc->sc_totlen > 0) bcm_bsc_fill_tx_fifo(sc); } From owner-svn-src-head@freebsd.org Mon Dec 18 04:33:28 2017 Return-Path: Delivered-To: svn-src-head@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 E2947EA0CC6 for ; Mon, 18 Dec 2017 04:33:28 +0000 (UTC) (envelope-from 0100016067e1fa2d-5f2e80c5-5584-4d6f-821d-185c98cff9af-000000@amazonses.com) Received: from a8-176.smtp-out.amazonses.com (a8-176.smtp-out.amazonses.com [54.240.8.176]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A922F6ACB0 for ; Mon, 18 Dec 2017 04:33:28 +0000 (UTC) (envelope-from 0100016067e1fa2d-5f2e80c5-5584-4d6f-821d-185c98cff9af-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1513571351; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=+ky7GL9dEPmHF8PlCZwS2EH2JMtdsadhiwojK854jW0=; b=mDBNyHrLrMsgSgeu9gYItvSntQEUlJsvQ5pYa5pMarClZBn4K76F58l4sj9nc/JU LP6lrXjbvKpD90tbrNp1Pw4zgELcdFS0tAThqAnsU8xVwco5JKORtALuMNP8IamLY1k oww73Ryf0sJ1CqIqGXGFMbb5wJIcXEfGU8Yt4eQk= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1513571351; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=+ky7GL9dEPmHF8PlCZwS2EH2JMtdsadhiwojK854jW0=; b=AYlKxURRV4sMouwzB0sg19H+fouvWrOkPEmo/+gTB9Fox6XqGa7AS3OTfW/JpyA1 cz5sTimZhpagWsVnNe/fty7Izpvn6OQ7fRwrijOImF6oRK+lDWTQq7d/pvUkPjqv87L mb6O02mioN8ZWF4iKgpT/fSBJ4tUq0iI334uDapM= Subject: Re: svn commit: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4 To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711151114.vAFBEeUb015030@repo.freebsd.org> From: Colin Percival Message-ID: <0100016067e1fa2d-5f2e80c5-5584-4d6f-821d-185c98cff9af-000000@email.amazonses.com> Date: Mon, 18 Dec 2017 04:29:11 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <201711151114.vAFBEeUb015030@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.12.18-54.240.8.176 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 04:33:29 -0000 On 11/15/17 03:14, Hans Petter Selasky wrote: > Author: hselasky > Date: Wed Nov 15 11:14:39 2017 > New Revision: 325841 > URL: https://svnweb.freebsd.org/changeset/base/325841 > > Log: > Update the mlx4 core and mlx4en(4) modules towards Linux v4.9. sys/dev/mlx4/mlx4_core/mlx4_main.c, around line 1170: > +static ssize_t set_port_type(struct device *dev, > + struct device_attribute *attr, > + const char *buf, size_t count) > +{ > + struct mlx4_port_info *info = container_of(attr, struct mlx4_port_info, > + port_attr); > + struct mlx4_dev *mdev = info->dev; > + enum mlx4_port_type port_type; > + static DEFINE_MUTEX(set_port_type_mutex); I'm not sure this is what you meant to do. In particular, DEFINE_MUTEX uses SX_SYSINIT_FLAGS, which creates a SYSINIT and a SYSUNINIT to initialize and destroy the mutex -- meaning that it's being accessed from outside of the function scope. This seems to work because function-scope static variables are compiled as if they have file scope, but I'm not at all convinced that it's legal C. Also, it breaks some work I have in progress for instrumenting SYSINITs. Would you mind moving the DEFINE_MUTEX line to occur immediately prior to the set_port_type function, rather than being placed inside it? -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon Dec 18 04:51:36 2017 Return-Path: Delivered-To: svn-src-head@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 E431CEA1260; Mon, 18 Dec 2017 04:51:36 +0000 (UTC) (envelope-from imp@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 B35856B211; Mon, 18 Dec 2017 04:51:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI4pZhK093461; Mon, 18 Dec 2017 04:51:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI4pYFB093448; Mon, 18 Dec 2017 04:51:34 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712180451.vBI4pYFB093448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Dec 2017 04:51:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326926 - in head/stand: . arm/uboot efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . arm/uboot efi/loader i386/loader mips/beri/loader mips/uboot powerpc/kboot powerpc/ofw powerpc/ps3 powerpc/uboot sparc64/loader userboot/userboot X-SVN-Commit-Revision: 326926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 04:51:37 -0000 Author: imp Date: Mon Dec 18 04:51:34 2017 New Revision: 326926 URL: https://svnweb.freebsd.org/changeset/base/326926 Log: Move loader help file definitions to being 100% inside of loader.mk. HELP_FILES is a loader only thing, so move it to loader.mk. Only generate the help file if HELP_FILES is defined. Adjust Makefiles to new convention. Fix a few cases where ${.CURDIR}/ was missing resulting in missing bits from the help files. Sponsored by: Netflix Modified: head/stand/arm/uboot/Makefile head/stand/defs.mk head/stand/efi/loader/Makefile head/stand/i386/loader/Makefile head/stand/loader.mk head/stand/mips/beri/loader/Makefile head/stand/mips/uboot/Makefile head/stand/powerpc/kboot/Makefile head/stand/powerpc/ofw/Makefile head/stand/powerpc/ps3/Makefile head/stand/powerpc/uboot/Makefile head/stand/sparc64/loader/Makefile head/stand/userboot/userboot/Makefile Modified: head/stand/arm/uboot/Makefile ============================================================================== --- head/stand/arm/uboot/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/arm/uboot/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -28,7 +28,7 @@ SRCS= start.S conf.c self_reloc.c vers.c CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif -HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/defs.mk Mon Dec 18 04:51:34 2017 (r326926) @@ -170,8 +170,4 @@ ${_ILINKS}: ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} -# For loader implementations, we generate a loader.help file. This can be suppressed by -# setting HELP_FILES to nothing. -HELP_FILES= ${LDRSRC}/help.common - .endif # __BOOT_DEFS_MK__ Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/efi/loader/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -83,7 +83,6 @@ CFLAGS+= -DEFI_STAGING_SIZE=${EFI_STAGING_SIZE} .endif # Always add MI sources -HELP_FILES= .include "${BOOTSRC}/loader.mk" FILES+= loader.efi Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/i386/loader/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -41,9 +41,7 @@ LIBFIREWIRE= ${BOOTOBJ}/i386/libfirewire/libfirewire.a .endif .if exists(${.CURDIR}/help.i386) -HELP_FILES+= help.i386 -.else -HELP_FILES= +HELP_FILES= ${.CURDIR}/help.i386 .endif # Always add MI sources Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/loader.mk Mon Dec 18 04:51:34 2017 (r326926) @@ -139,6 +139,8 @@ vers.c: ${LDRSRC}/newvers.sh ${VERSION_FILE} ${NEWVERSWHAT} .if !empty(HELP_FILES) +HELP_FILES+= ${LDRSRC}/help.common + CLEANFILES+= loader.help FILES+= loader.help Modified: head/stand/mips/beri/loader/Makefile ============================================================================== --- head/stand/mips/beri/loader/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/mips/beri/loader/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -67,7 +67,7 @@ SRCS+= altera_jtag_uart.c \ # Since we don't have a backward compatibility issue, default to this on BERI. CFLAGS+= -DBOOT_PROMPT_123 -HELP_FILES+= ${.CURDIR}/help.mips +HELP_FILES= ${.CURDIR}/help.mips # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/stand/mips/uboot/Makefile ============================================================================== --- head/stand/mips/uboot/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/mips/uboot/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -24,7 +24,7 @@ UBLDR_LOADADDR?= 0xffffffff80800000 # Architecture-specific loader code SRCS= start.S conf.c vers.c -HELP_FILES+= help.uboot ${BOOTSRC}/fdt/help.fdt +HELP_FILES= ${.CURDIR}/help.uboot ${BOOTSRC}/fdt/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/stand/powerpc/kboot/Makefile ============================================================================== --- head/stand/powerpc/kboot/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/powerpc/kboot/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -28,7 +28,6 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern @@ -44,7 +43,5 @@ CFLAGS+= -Wa,-mppc64bridge DPADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} LDADD= ${LIBFICL} ${LIBOFW} ${LIBFDT} ${LIBSA} - -HELP_FILES+= ${FDTSRC}/help.fdt .include Modified: head/stand/powerpc/ofw/Makefile ============================================================================== --- head/stand/powerpc/ofw/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/powerpc/ofw/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -27,7 +27,7 @@ SRCS+= ucmpdi2.c SRCS+= ofwfdt.c .endif -HELP_FILES+= ${FDTSRC}/help.fdt +HELP_FILES= ${FDTSRC}/help.fdt # Always add MI sources .include "${BOOTSRC}/loader.mk" Modified: head/stand/powerpc/ps3/Makefile ============================================================================== --- head/stand/powerpc/ps3/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/powerpc/ps3/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -26,7 +26,6 @@ SRCS+= ucmpdi2.c CFLAGS+= -mcpu=powerpc64 # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern Modified: head/stand/powerpc/uboot/Makefile ============================================================================== --- head/stand/powerpc/uboot/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/powerpc/uboot/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -21,7 +21,6 @@ SRCS= start.S conf.c vers.c SRCS+= ucmpdi2.c # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" .PATH: ${SYSDIR}/libkern Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/sparc64/loader/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -30,9 +30,7 @@ CFLAGS+= -DLOADER_DEBUG .endif .if exists(${.CURDIR}/help.sparc64) -HELP_FILES+= help.sparc64 -.else -HELP_FILES= +HELP_FILES= ${.CURDIR}/help.sparc64 .endif # Always add MI sources Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Mon Dec 18 02:34:37 2017 (r326925) +++ head/stand/userboot/userboot/Makefile Mon Dec 18 04:51:34 2017 (r326926) @@ -49,7 +49,6 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif # Always add MI sources -HELP_FILES= # Disable .include "${BOOTSRC}/loader.mk" CFLAGS+= -I. DPADD+= ${LIBFICL} ${LIBZFSBOOT} ${LIBSA} From owner-svn-src-head@freebsd.org Mon Dec 18 04:51:48 2017 Return-Path: Delivered-To: svn-src-head@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 29CE3EA1293; Mon, 18 Dec 2017 04:51:48 +0000 (UTC) (envelope-from imp@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 C06AB6B2E4; Mon, 18 Dec 2017 04:51:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI4pkAh093518; Mon, 18 Dec 2017 04:51:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI4pjxE093516; Mon, 18 Dec 2017 04:51:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712180451.vBI4pjxE093516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Dec 2017 04:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326927 - head/stand X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand X-SVN-Commit-Revision: 326927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 04:51:48 -0000 Author: imp Date: Mon Dec 18 04:51:45 2017 New Revision: 326927 URL: https://svnweb.freebsd.org/changeset/base/326927 Log: libficl is only ever used in a loader (never a boot) program. Move it to loader.mk. Sponsored by: Netflix Modified: head/stand/defs.mk head/stand/loader.mk Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Dec 18 04:51:34 2017 (r326926) +++ head/stand/defs.mk Mon Dec 18 04:51:45 2017 (r326927) @@ -24,15 +24,6 @@ BOOTOBJ= ${OBJTOP}/stand # BINDIR is where we install BINDIR?= /boot -# NB: The makefiles depend on these being empty when we don't build forth. -.if ${MK_FORTH} != "no" -LIBFICL= ${BOOTOBJ}/ficl/libficl.a -.if ${MACHINE} == "i386" -LIBFICL32= ${LIBFICL} -.else -LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a -.endif -.endif LIBSA= ${BOOTOBJ}/libsa/libsa.a .if ${MACHINE} == "i386" LIBSA32= ${LIBSA} Modified: head/stand/loader.mk ============================================================================== --- head/stand/loader.mk Mon Dec 18 04:51:34 2017 (r326926) +++ head/stand/loader.mk Mon Dec 18 04:51:45 2017 (r326927) @@ -129,6 +129,16 @@ LIBZFSBOOT= ${BOOTOBJ}/zfs/libzfsboot.a .endif .endif +# NB: The makefiles depend on these being empty when we don't build forth. +.if ${MK_FORTH} != "no" +LIBFICL= ${BOOTOBJ}/ficl/libficl.a +.if ${MACHINE} == "i386" +LIBFICL32= ${LIBFICL} +.else +LIBFICL32= ${BOOTOBJ}/ficl32/libficl.a +.endif +.endif + CLEANFILES+= vers.c VERSION_FILE?= ${.CURDIR}/version .if ${MK_REPRODUCIBLE_BUILD} != no From owner-svn-src-head@freebsd.org Mon Dec 18 08:18:07 2017 Return-Path: Delivered-To: svn-src-head@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 EC1C6E800BB; Mon, 18 Dec 2017 08:18:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [88.99.82.50]) (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 B305E70300; Mon, 18 Dec 2017 08:18:07 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0B38026006C; Mon, 18 Dec 2017 09:17:57 +0100 (CET) Subject: Re: svn commit: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4 To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711151114.vAFBEeUb015030@repo.freebsd.org> <0100016067e203d1-fa769584-f8a1-44f2-ac39-1572e8fff087-000000@email.amazonses.com> From: Hans Petter Selasky Message-ID: <6d9cacd6-0f98-54e0-86be-6f202f509b17@selasky.org> Date: Mon, 18 Dec 2017 09:15:11 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <0100016067e203d1-fa769584-f8a1-44f2-ac39-1572e8fff087-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 08:18:08 -0000 On 12/18/17 05:29, Colin Percival wrote: > Also, it breaks some work I have in progress for instrumenting SYSINITs. > Would you mind moving the DEFINE_MUTEX line to occur immediately prior to > the set_port_type function, rather than being placed inside it? I'll have a look at this later today. Your point is valid! --HPS From owner-svn-src-head@freebsd.org Mon Dec 18 09:32:57 2017 Return-Path: Delivered-To: svn-src-head@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 888EDE81A42; Mon, 18 Dec 2017 09:32:57 +0000 (UTC) (envelope-from bde@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 5FEBA72365; Mon, 18 Dec 2017 09:32:57 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI9Wuei012052; Mon, 18 Dec 2017 09:32:56 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI9Wua5012050; Mon, 18 Dec 2017 09:32:56 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201712180932.vBI9Wua5012050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 18 Dec 2017 09:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326929 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 326929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 09:32:57 -0000 Author: bde Date: Mon Dec 18 09:32:56 2017 New Revision: 326929 URL: https://svnweb.freebsd.org/changeset/base/326929 Log: Fix the undersupported option KERNLOAD, part 1: fix crashes in locore when KERNLOAD is not a multiple of NBPDR (not the default) and PSE is enabled (the default if the CPU supports it). Addresses in PDEs must be a multiple of NBPDR in the PSE case, but were not so in the crashing case. KERNLOAD defaults to NBPDR. NBPDR is 4 MB for !PAE and 2 MB for PAE. The default can be changed by editing i386/include/vmparam.h or using makeoptions. It can be changed to less than NBPDR to save real and virtual memory at a small cost in time, or to more than NBPDR to waste real and virtual memory. It must be larger than 1 MB and a multiple of PAGE_SIZE. When it is less than NBPDR, it is necessarily not a multiple of NBPDR. This case has much larger bugs which will be fixed in part 2. The fix is to only use PSE for physical addresses above . When the rounding is non-null, this leaves part of the kernel not using large pages. Rounding down would avoid this pessimization, but would break setting of PAT bits on i/o pages if it goes below 1MB. Since rounding down always goes below 1MB when KERNLOAD < NBPDR and the KERNLOAD > NBPDR case is not useful, never round down. Fix related style bugs (e.g., wrong literal values for NBPDR in comments). Reviewed by: kib Modified: head/sys/i386/i386/locore.s head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Dec 18 05:29:38 2017 (r326928) +++ head/sys/i386/i386/locore.s Mon Dec 18 09:32:56 2017 (r326929) @@ -668,7 +668,7 @@ over_symalloc: no_kernend: addl $PDRMASK,%esi /* Play conservative for now, and */ - andl $~PDRMASK,%esi /* ... wrap to next 4M. */ + andl $~PDRMASK,%esi /* ... round up to PDR boundary */ movl %esi,R(KERNend) /* save end of kernel */ movl %esi,R(physfree) /* next free page is at end of kernel */ @@ -784,7 +784,8 @@ no_kernend: /* * Create an identity mapping for low physical memory, including the kernel. - * The part of this mapping that covers the first 1 MB of physical memory + * The part of this mapping given by the first PDE (for the first 4 MB or 2 + * MB of physical memory) * becomes a permanent part of the kernel's address space. The rest of this * mapping is destroyed in pmap_bootstrap(). Ordinarily, the same page table * pages are shared by the identity mapping and the kernel's native mapping. @@ -815,10 +816,9 @@ no_kernend: #endif /* - * For the non-PSE case, install PDEs for PTs covering the KVA. - * For the PSE case, do the same, but clobber the ones corresponding - * to the kernel (from btext to KERNend) with 4M (2M for PAE) ('PS') - * PDEs immediately after. + * Install PDEs for PTs covering enough kva to bootstrap. Then for the PSE + * case, replace the PDEs whose coverage is strictly within the kernel + * (between KERNLOAD (rounded up) and KERNend) by large-page PDEs. */ movl R(KPTphys), %eax movl $KPTDI, %ebx @@ -828,10 +828,10 @@ no_kernend: je done_pde movl R(KERNend), %ecx - movl $KERNLOAD, %eax + movl $(KERNLOAD + PDRMASK) & ~PDRMASK, %eax subl %eax, %ecx shrl $PDRSHIFT, %ecx - movl $(KPTDI+(KERNLOAD/(1 << PDRSHIFT))), %ebx + movl $KPTDI + ((KERNLOAD + PDRMASK) >> PDRSHIFT), %ebx shll $PDESHIFT, %ebx addl R(IdlePTD), %ebx orl $(PG_V|PG_RW|PG_PS), %eax Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Dec 18 05:29:38 2017 (r326928) +++ head/sys/i386/i386/pmap.c Mon Dec 18 09:32:56 2017 (r326929) @@ -662,7 +662,7 @@ pmap_set_pg(void) endva = KERNBASE + KERNend; if (pseflag) { - va = KERNBASE + KERNLOAD; + va = KERNBASE + roundup2(KERNLOAD, NBPDR); while (va < endva) { pdir_pde(PTD, va) |= pgeflag; invltlb(); /* Flush non-PG_G entries. */ From owner-svn-src-head@freebsd.org Mon Dec 18 09:35:05 2017 Return-Path: Delivered-To: svn-src-head@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 CAD03E81AFC; Mon, 18 Dec 2017 09:35:05 +0000 (UTC) (envelope-from bapt@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 A23EF724DB; Mon, 18 Dec 2017 09:35:05 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBI9Z4Eo012189; Mon, 18 Dec 2017 09:35:04 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBI9Z4qc012188; Mon, 18 Dec 2017 09:35:04 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201712180935.vBI9Z4qc012188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Mon, 18 Dec 2017 09:35:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326930 - head/usr.sbin/newsyslog X-SVN-Group: head X-SVN-Commit-Author: bapt X-SVN-Commit-Paths: head/usr.sbin/newsyslog X-SVN-Commit-Revision: 326930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 09:35:05 -0000 Author: bapt Date: Mon Dec 18 09:35:04 2017 New Revision: 326930 URL: https://svnweb.freebsd.org/changeset/base/326930 Log: newsyslog: Fix issues after r326616 When building the command to execute for compression, newsyslog was modifying the generic arguments array instead of its own copy. Meaning on the second file to compress with the same arguments, the command line was not the one expected. Fix it by creating one copy of the arguments per execution and modifying that copy. While here, print the command line executed in verbose mode. Reported by: many Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Mon Dec 18 09:32:56 2017 (r326929) +++ head/usr.sbin/newsyslog/newsyslog.c Mon Dec 18 09:35:04 2017 (r326930) @@ -162,6 +162,7 @@ static char *gz_args[] ={ NULL, f_arg, NULL, NULL }; #define xz_args gz_args static char *zstd_args[] = { NULL, q_arg, rm_arg, NULL, NULL }; +#define ARGS_NUM 4 static const struct compress_types compress_type[COMPRESS_TYPES] = { { "", "", "", NULL}, /* none */ { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args}, /* gzip */ @@ -2017,6 +2018,9 @@ do_zipwork(struct zipwork_entry *zwork) assert(zwork != NULL); pgm_path = NULL; strlcpy(zresult, zwork->zw_fname, sizeof(zresult)); + args = calloc(ARGS_NUM, sizeof(*args)); + if (args == NULL) + err(1, "calloc()"); if (zwork->zw_conf != NULL && zwork->zw_conf->compress > COMPRESS_NONE) for (c = 1; c < COMPRESS_TYPES; c++) { @@ -2024,7 +2028,12 @@ do_zipwork(struct zipwork_entry *zwork) pgm_path = compress_type[c].path; (void) strlcat(zresult, compress_type[c].suffix, sizeof(zresult)); - args = compress_type[c].args; + /* the first argument is always NULL, skip it */ + for (c = 1; c < ARGS_NUM; c++) { + if (compress_type[c].args[c] == NULL) + break; + args[c] = compress_type[c].args[c]; + } break; } } @@ -2065,6 +2074,9 @@ do_zipwork(struct zipwork_entry *zwork) return; } + if (verbose) { + printf("Executing: %s\n", command); + } fcount = 1; pidzip = fork(); while (pidzip < 0) { @@ -2094,14 +2106,20 @@ do_zipwork(struct zipwork_entry *zwork) } if (!WIFEXITED(zstatus)) { warnx("`%s' did not terminate normally", command); + free(args[0]); + free(args); return; } if (WEXITSTATUS(zstatus)) { warnx("`%s' terminated with a non-zero status (%d)", command, WEXITSTATUS(zstatus)); + free(args[0]); + free(args); return; } + free(args[0]); + free(args); /* Compression was successful, set file attributes on the result. */ change_attrs(zresult, zwork->zw_conf); } From owner-svn-src-head@freebsd.org Mon Dec 18 09:36:36 2017 Return-Path: Delivered-To: svn-src-head@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 D7D0AE81CA2; Mon, 18 Dec 2017 09:36:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0EE772791; Mon, 18 Dec 2017 09:36:36 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by freefall.freebsd.org (Postfix, from userid 1235) id 0DC786585; Mon, 18 Dec 2017 09:36:36 +0000 (UTC) Date: Mon, 18 Dec 2017 10:36:35 +0100 From: Baptiste Daroussin To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326617 - head/usr.sbin/newsyslog Message-ID: <20171218093635.ilumboo655ualwzs@ivaldir.net> References: <201712060944.vB69iZQe027554@repo.freebsd.org> <201712160140.vBG1eF98037302@slippy.cwsent.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jbk4wldury4uphkl" Content-Disposition: inline In-Reply-To: <201712160140.vBG1eF98037302@slippy.cwsent.com> User-Agent: NeoMutt/20171208 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 09:36:36 -0000 --jbk4wldury4uphkl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 15, 2017 at 05:40:15PM -0800, Cy Schubert wrote: > In message <201712060944.vB69iZQe027554@repo.freebsd.org>, Baptiste=20 > Daroussin w > rites: > > Author: bapt > > Date: Wed Dec 6 09:44:35 2017 > > New Revision: 326617 > > URL: https://svnweb.freebsd.org/changeset/base/326617 > > > > Log: > > Allow newsyslog to execute compression commands which > > have a semantic different than the traditional gzip(1) > > =20 > > This is done to allow to use zstd(1) as a compression tool without > > having to patch it to change its default behavior. > > > > Modified: > > head/usr.sbin/newsyslog/newsyslog.c > > > > Modified: head/usr.sbin/newsyslog/newsyslog.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > > =3D > > --- head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 06:49:53 2017 > > (r326616) > > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 09:44:35 2017 > > (r326617) > > @@ -151,14 +151,23 @@ struct compress_types { > > const char *flag; /* Flag in configuration file */ > > const char *suffix; /* Compression suffix */ > > const char *path; /* Path to compression program */ > > + char **args; /* Comrpession arguments */ > > }; > > =20 > > +static char f_arg[] =3D "-f"; > > +static char q_arg[] =3D "-q"; > > +static char rm_arg[] =3D "--rm"; > > +static char *gz_args[] =3D{ NULL, f_arg, NULL, NULL }; > > +#define bzip2_args gz_args > > +#define xz_args gz_args > > +static char *zstd_args[] =3D { NULL, q_arg, rm_arg, NULL, NULL }; > > + > > static const struct compress_types compress_type[COMPRESS_TYPES] =3D { > > - { "", "", "" }, /* no compression */ > > - { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ > > - { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ > > - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ }, /* xz compression */ > > - { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD } /* zst compression */ > > + { "", "", "", NULL}, /* none */ > > + { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args}, /* gzip */ > > + { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2, bzip2_args}, /* bzip2 */ > > + { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ, xz_args }, /* xz */ > > + { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD, zstd_args } /* zst */ > > }; > > =20 > > struct conf_entry { > > @@ -2001,6 +2010,8 @@ do_zipwork(struct zipwork_entry *zwork) > > int errsav, fcount, zstatus; > > pid_t pidzip, wpid; > > char zresult[MAXPATHLEN]; > > + char command[BUFSIZ]; > > + char **args; > > int c; > > =20 > > assert(zwork !=3D NULL); > > @@ -2013,6 +2024,7 @@ do_zipwork(struct zipwork_entry *zwork) > > pgm_path =3D compress_type[c].path; > > (void) strlcat(zresult, > > compress_type[c].suffix, sizeof(zresult)); > > + args =3D compress_type[c].args; > > break; > > } > > } > > @@ -2026,6 +2038,13 @@ do_zipwork(struct zipwork_entry *zwork) > > else > > pgm_name++; > > =20 > > + args[0] =3D strdup(pgm_name); > > + if (args[0] =3D=3D NULL) > > + err(1, "strdup()"); > > + for (c =3D 0; args[c] !=3D NULL; c++) > > + ; > > + args[c] =3D zwork->zw_fname; > > + > > if (zwork->zw_swork !=3D NULL && zwork->zw_swork->sw_runcmd =3D=3D 0 = && > > zwork->zw_swork->sw_pidok <=3D 0) { > > warnx( > > @@ -2035,6 +2054,11 @@ do_zipwork(struct zipwork_entry *zwork) > > return; > > } > > =20 > > + strlcpy(command, pgm_path, sizeof(command)); > > + for (c =3D 1; args[c] !=3D NULL; c++) { > > + strlcat(command, " ", sizeof(command)); > > + strlcat(command, args[c], sizeof(command)); > > + } > > if (noaction) { > > printf("\t%s %s\n", pgm_name, zwork->zw_fname); > > change_attrs(zresult, zwork->zw_conf); > > @@ -2058,8 +2082,8 @@ do_zipwork(struct zipwork_entry *zwork) > > } > > if (!pidzip) { > > /* The child process executes the compression command */ > > - execl(pgm_path, pgm_path, "-f", zwork->zw_fname, (char *)0); > > - err(1, "execl(`%s -f %s')", pgm_path, zwork->zw_fname); > > + execv(pgm_path, (char *const*) args); > > + err(1, "execv(`%s')", command); > > } > > =20 > > wpid =3D waitpid(pidzip, &zstatus, 0); > > @@ -2069,13 +2093,12 @@ do_zipwork(struct zipwork_entry *zwork) > > return; > > } > > if (!WIFEXITED(zstatus)) { > > - warnx("`%s -f %s' did not terminate normally", pgm_name, > > - zwork->zw_fname); > > + warnx("`%s' did not terminate normally", command); > > return; > > } > > if (WEXITSTATUS(zstatus)) { > > - warnx("`%s -f %s' terminated with a non-zero status (%d)", > > - pgm_name, zwork->zw_fname, WEXITSTATUS(zstatus)); > > + warnx("`%s' terminated with a non-zero status (%d)", command, > > + WEXITSTATUS(zstatus)); > > return; > > } > > =20 > > >=20 > Ever since this revision I'm seeing the following errors: >=20 > bzip2: Can't open input file ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ: No suc= h=20 > file or directory. > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > /var/log/debug.log.0' terminated with a non-zero status (1) > bzip2: Bad flag `--rm' > bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010. >=20 > usage: bzip2 [flags and input files in any order] >=20 > -h --help print this message > -d --decompress force decompression > -z --compress force compression > -k --keep keep (don't delete) input files > -f --force overwrite existing output files > -t --test test compressed file integrity > -c --stdout output to standard out > -q --quiet suppress noncritical error messages > -v --verbose be verbose (a 2nd -v gives more) > -L --license display software version & license > -V --version display software version & license > -s --small use less memory (at most 2500k) > -1 .. -9 set block size to 100k .. 900k > --fast alias for -1 > --best alias for -9 >=20 > If invoked as `bzip2', default action is to compress. > as `bunzip2', default action is to decompress. > as `bzcat', default action is to decompress to stdout. >=20 > If no file names are given, bzip2 compresses or decompresses > from standard input to standard output. You can combine > short flags, so `-v -4' means the same as -v4 or -4v, &c. >=20 > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ= ZZZ > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ /var/log/messages.0 -q --rm'=20 > terminated with a non-zero status (1) Should be fixed in r326930. Sorry about that, Best regards, Bapt --jbk4wldury4uphkl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlo3jCMACgkQY4mL3PG3 Plq93xAA5Pg2GDQS0hdwtexvUZdFuw8ppgh9Xtx3dybNgTsZ2hEYrxbOjsOvCmk2 DsdqS+Vwex9N+6FSzuLZ9E0mf+MD4vv11P10yEC9WX5t9WJRFFZT17pUC5Fi8c/M R0TGi+tnpIcKgxy7lZzdFQgoH0Tl2JZ695KblwuxygWffmXyvlaC7H8iG2E+KK9n U6LmM6pLisIjLostYgZFjDQlIQ0fV0AfG2YZhtKox476GabnwJJaVMj9C+xFneJm v09v6RHQb/A6Xe2/u0kCQ+3A68nlQCuLNEhydWOd6x+Vu6+EyTqFzrxtlaCdDpiT 1fomK33nDGzp7xVrDhbqU9dB8+vDV4RgRFPsPGfZnljFut3WSmlO8PbVdxEJPNwM d52H4XdsL3cLeWvDymxp03tZ9fw7e3vQE3syhlRfdCrGJF7fRw49bcY1dHr2kR14 5cIPzKWjLNwe1iUqVnMBpJNbuYeT8VoqtRmoDee8QLrh9bkjefgzgw/dA6wykQAg PBJvvff4kUrUiDJEYz06wGLugaPXJxurBG0jBJoB+oqFBvbuXldj3BcBIr5j15/I MY1j97wASK5ZSBVi9R+sDYo9f6z2G9uNFZRLOL/ZeufIYxSx991FuVDqBUodf2XT fc0t0iEFceW78g5PPZ/YZVLRBH4ibdC7CbNj3J4w1165Zae2emo= =+HWq -----END PGP SIGNATURE----- --jbk4wldury4uphkl-- From owner-svn-src-head@freebsd.org Mon Dec 18 11:57:06 2017 Return-Path: Delivered-To: svn-src-head@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 D8465E84B3C; Mon, 18 Dec 2017 11:57:06 +0000 (UTC) (envelope-from bde@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 AD0F77706B; Mon, 18 Dec 2017 11:57:06 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBIBv5bI072331; Mon, 18 Dec 2017 11:57:05 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIBv5xH072330; Mon, 18 Dec 2017 11:57:05 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201712181157.vBIBv5xH072330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 18 Dec 2017 11:57:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326931 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 326931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 11:57:06 -0000 Author: bde Date: Mon Dec 18 11:57:05 2017 New Revision: 326931 URL: https://svnweb.freebsd.org/changeset/base/326931 Log: Fix the undersupported option KERNLOAD, part 2: fix crashes in locore when KERNLOAD is smaller than NBPDR (not the default) and PG_G is enabled (the default if the CPU supports it). This case has relatively minor problems with coherency of the permanent double mapping, but the fix in r167869 to improve coherency creates page tables with 3 different errors so never worked. The permanent double mapping is fundamentally broken and will be removed soon. It fundamentally breaks trapping for null pointers and requires complications to avoid cache coherency bugs. It is currently used for only a single instruction in ACPI resume, Many fixes VM86 and/or ACPI and/or the double map were attempted near r1200000. r167869 attempted to fix cache coherency bugs in an unusual case, but the bugs were unreachable because older errors in page tables caused a crash first. This commit just makes r167869 work as intended. Part 1 of these fixes fixed the other errors, but also stopped mapping the PDE for KERNBASE as a large page, so double mapping of this PDE only causes the same problems as when KERNLOAD is the default. Except for the problem of trapping null pointers, r167869 could be used to fix these problems, but it is inactive in usual cases. The only known other problem is that incoherent permissions for page 0 cause spurious traps in VM86 BIOS calls. Reviewed by: kib Modified: head/sys/i386/i386/locore.s Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Dec 18 09:35:04 2017 (r326930) +++ head/sys/i386/i386/locore.s Mon Dec 18 11:57:05 2017 (r326931) @@ -790,8 +790,9 @@ no_kernend: * mapping is destroyed in pmap_bootstrap(). Ordinarily, the same page table * pages are shared by the identity mapping and the kernel's native mapping. * However, the permanent identity mapping cannot contain PG_G mappings. - * Thus, if the kernel is loaded within the permanent identity mapping, that - * page table page must be duplicated and not shared. + * Thus, if the (physical) kernel overlaps the permanent identity mapping + * (and PG_G is enabled), the + * page table for the first PDE must be duplicated and not shared. * * N.B. Due to errata concerning large pages and physical address zero, * a PG_PS mapping is not used. @@ -804,10 +805,15 @@ no_kernend: testl $PG_G, R(pgeflag) jz 1f ALLOCPAGES(1) + movl %esi, %eax + movl $1, %ecx + fillkptphys($PG_RW) /* map the new page table in std map */ movl %esi, %edi movl R(IdlePTD), %eax - movl (%eax), %esi + movl (%eax), %esi /* top bits are 0 for PAE */ + andl $~PAGE_MASK, %esi movl %edi, (%eax) + orl $PG_V | PG_RW, (%eax) /* finish writing new PTD[0] */ movl $PAGE_SIZE, %ecx cld rep From owner-svn-src-head@freebsd.org Mon Dec 18 13:53:23 2017 Return-Path: Delivered-To: svn-src-head@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 A9A3AE8BCAC; Mon, 18 Dec 2017 13:53:23 +0000 (UTC) (envelope-from bde@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 6CC427B5B0; Mon, 18 Dec 2017 13:53:23 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBIDrMKR023036; Mon, 18 Dec 2017 13:53:22 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIDrM1W023033; Mon, 18 Dec 2017 13:53:22 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201712181353.vBIDrM1W023033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 18 Dec 2017 13:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326932 - in head/sys: i386/i386 x86/acpica x86/x86 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: i386/i386 x86/acpica x86/x86 X-SVN-Commit-Revision: 326932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 13:53:23 -0000 Author: bde Date: Mon Dec 18 13:53:22 2017 New Revision: 326932 URL: https://svnweb.freebsd.org/changeset/base/326932 Log: Remove the permanent double mapping of low physical memory and replace it by a transient double mapping for the one instruction in ACPI wakeup where it is needed (and for many surrounding instructions in ACPI resume). Invalidate the TLB as soon as convenient after undoing the transient mapping. ACPI resume already has the strict ordering needed for this. This fixes the non-trapping of null pointers and other garbage pointers below NBPDR (except transiently). NBPDR is quite large (4MB, or 2MB for PAE). This fixes spurious traps at the first instruction in VM86 bioscalls. The traps are for transiently missing read permission in the first VM86 page (physical page 0) which was just written to at KERNBASE in the kernel. The mechanism is unknown (it is not simply PG_G). locore uses a similar but larger transient double mapping and needs it for 2 instructions instead of 1. Unmap the first PDE in it after the 2 instructions to detect most garbage pointers while bootstrapping. pmap_bootstrap() finishes the unmapping. Remove the avoidance of the double mapping for a recently fixed special case. ACPI resume could use this avoidance (made non-special) to avoid any problems with the transient double mapping, but no such problems are known. Update comments in locore. Many were for old versions of FreeBSD which tried to map low memory r/o except for special cases, or might have allowed access to low memory via physical offsets. Now all kernel maps are r/w, and removal of of the double map disallows use of physical offsets again. Modified: head/sys/i386/i386/locore.s head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/mp_x86.c Modified: head/sys/i386/i386/locore.s ============================================================================== --- head/sys/i386/i386/locore.s Mon Dec 18 11:57:05 2017 (r326931) +++ head/sys/i386/i386/locore.s Mon Dec 18 13:53:22 2017 (r326932) @@ -241,22 +241,30 @@ NON_GPROF_ENTRY(btext) #if defined(PAE) || defined(PAE_TABLES) movl R(IdlePDPT), %eax movl %eax, %cr3 - movl %cr4, %eax - orl $CR4_PAE, %eax - movl %eax, %cr4 + movl %cr4, %edx + orl $CR4_PAE, %edx + movl %edx, %cr4 #else movl R(IdlePTD), %eax movl %eax,%cr3 /* load ptd addr into mmu */ #endif - movl %cr0,%eax /* get control word */ - orl $CR0_PE|CR0_PG,%eax /* enable paging */ - movl %eax,%cr0 /* and let's page NOW! */ + movl %cr0,%edx /* get control word */ + orl $CR0_PE|CR0_PG,%edx /* enable paging */ + movl %edx,%cr0 /* and let's page NOW! */ pushl $begin /* jump to high virtualized address */ ret -/* now running relocated at KERNBASE where the system is linked to run */ begin: + /* + * Now running relocated at KERNBASE where the system is linked to run. + * + * Remove the lowest part of the double mapping of low memory to get + * some null pointer checks. + */ + movl $0,PTD + movl %eax,%cr3 /* invalidate TLB */ + /* set up bootstrap stack */ movl proc0kstack,%eax /* location of in-kernel stack */ @@ -725,14 +733,15 @@ no_kernend: /* * Initialize page table pages mapping physical address zero through the - * end of the kernel. All of the page table entries allow read and write - * access. Write access to the first physical page is required by bios32 - * calls, and write access to the first 1 MB of physical memory is required - * by ACPI for implementing suspend and resume. We do this even - * if we've enabled PSE above, we'll just switch the corresponding kernel - * PDEs before we turn on paging. + * (physical) end of the kernel. Many of these pages must be reserved, + * and we reserve them all and map them linearly for convenience. We do + * this even if we've enabled PSE above; we'll just switch the corresponding + * kernel PDEs before we turn on paging. * * XXX: We waste some pages here in the PSE case! + * + * This and all other page table entries allow read and write access for + * various reasons. Kernel mappings never have any access restrictions. */ xorl %eax, %eax movl R(KERNend),%ecx @@ -784,42 +793,21 @@ no_kernend: /* * Create an identity mapping for low physical memory, including the kernel. - * The part of this mapping given by the first PDE (for the first 4 MB or 2 - * MB of physical memory) - * becomes a permanent part of the kernel's address space. The rest of this - * mapping is destroyed in pmap_bootstrap(). Ordinarily, the same page table - * pages are shared by the identity mapping and the kernel's native mapping. - * However, the permanent identity mapping cannot contain PG_G mappings. - * Thus, if the (physical) kernel overlaps the permanent identity mapping - * (and PG_G is enabled), the - * page table for the first PDE must be duplicated and not shared. + * This is only used to map the 2 instructions for jumping to 'begin' in + * locore (we map everything to avoid having to determine where these + * instructions are). ACPI resume will transiently restore the first PDE in + * this mapping (and depend on this PDE's page table created here not being + * destroyed). See pmap_bootstrap() for more details. * - * N.B. Due to errata concerning large pages and physical address zero, - * a PG_PS mapping is not used. + * Note: There are errata concerning large pages and physical address zero, + * so a PG_PS mapping should not be used for PDE 0. Our double mapping + * avoids this automatically by not using PG_PS for PDE #KPDI so that PAT + * bits can be set at the page level for i/o pages below 1 MB. */ movl R(KPTphys), %eax xorl %ebx, %ebx movl $NKPT, %ecx fillkpt(R(IdlePTD), $PG_RW) -#if KERNLOAD < (1 << PDRSHIFT) - testl $PG_G, R(pgeflag) - jz 1f - ALLOCPAGES(1) - movl %esi, %eax - movl $1, %ecx - fillkptphys($PG_RW) /* map the new page table in std map */ - movl %esi, %edi - movl R(IdlePTD), %eax - movl (%eax), %esi /* top bits are 0 for PAE */ - andl $~PAGE_MASK, %esi - movl %edi, (%eax) - orl $PG_V | PG_RW, (%eax) /* finish writing new PTD[0] */ - movl $PAGE_SIZE, %ecx - cld - rep - movsb -1: -#endif /* * Install PDEs for PTs covering enough kva to bootstrap. Then for the PSE Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Mon Dec 18 11:57:05 2017 (r326931) +++ head/sys/x86/acpica/acpi_wakeup.c Mon Dec 18 13:53:22 2017 (r326932) @@ -179,6 +179,17 @@ acpi_wakeup_cpus(struct acpi_softc *sc) } } +#ifdef __i386__ + /* + * Remove the identity mapping of low memory for all CPUs and sync + * the TLB for the BSP. The APs are now spinning in + * cpususpend_handler() and we will release them soon. Then each + * will invalidate its TLB. + */ + kernel_pmap->pm_pdir[0] = 0; + invltlb_glob(); +#endif + /* restore the warmstart vector */ *(uint32_t *)WARMBOOT_OFF = mpbioswarmvec; @@ -234,6 +245,19 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) WAKECODE_FIXUP(wakeup_pcb, struct pcb *, pcb); WAKECODE_FIXUP(wakeup_gdt, uint16_t, pcb->pcb_gdt.rd_limit); WAKECODE_FIXUP(wakeup_gdt + 2, uint64_t, pcb->pcb_gdt.rd_base); + +#ifdef __i386__ + /* + * Map some low memory with virt == phys for ACPI wakecode + * to use to jump to high memory after enabling paging. This + * is the same as for similar jump in locore, except the + * jump is a single instruction, and we know its address + * more precisely so only need a single PTD, and we have to + * be careful to use the kernel map (PTD[0] is for curthread + * which may be a user thread in deprecated APIs). + */ + kernel_pmap->pm_pdir[0] = PTD[KPTDI]; +#endif /* Call ACPICA to enter the desired sleep state */ if (state == ACPI_STATE_S4 && sc->acpi_s4bios) Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Mon Dec 18 11:57:05 2017 (r326931) +++ head/sys/x86/x86/mp_x86.c Mon Dec 18 13:53:22 2017 (r326932) @@ -1398,6 +1398,11 @@ cpususpend_handler(void) while (!CPU_ISSET(cpu, &started_cpus)) ia32_pause(); +#ifdef __i386__ + /* Finish removing the identity mapping of low memory for this AP. */ + invltlb_glob(); +#endif + if (cpu_ops.cpu_resume) cpu_ops.cpu_resume(); #ifdef __amd64__ From owner-svn-src-head@freebsd.org Mon Dec 18 14:29:50 2017 Return-Path: Delivered-To: svn-src-head@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 45122E8EC4F; Mon, 18 Dec 2017 14:29:50 +0000 (UTC) (envelope-from bde@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 0FAA67CD8D; Mon, 18 Dec 2017 14:29:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBIETmHG035653; Mon, 18 Dec 2017 14:29:48 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIETm3R035652; Mon, 18 Dec 2017 14:29:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201712181429.vBIETm3R035652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 18 Dec 2017 14:29:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326933 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 326933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 14:29:50 -0000 Author: bde Date: Mon Dec 18 14:29:48 2017 New Revision: 326933 URL: https://svnweb.freebsd.org/changeset/base/326933 Log: Also forgotten in the previous that removed the permanent double mapping of low physical memory: Update the comment about leaving the permanent mapping in place. This also improves the wording of the comment. PTD 0 is still left alone because it is fairly important that it was unmapped earlier, and the comment now describes the unmapping of the other low PTDs that the code actually does. Reviewed by: kib Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Dec 18 13:53:22 2017 (r326932) +++ head/sys/i386/i386/pmap.c Mon Dec 18 14:29:48 2017 (r326933) @@ -493,9 +493,13 @@ pmap_bootstrap(vm_paddr_t firstaddr) virtual_avail = va; /* - * Leave in place an identity mapping (virt == phys) for the low 1 MB - * physical memory region that is used by the ACPI wakeup code. This - * mapping must not have PG_G set. + * Finish removing the identity mapping (virt == phys) of low memory. + * It was only used for 2 instructions in locore. locore then + * unmapped the first PTD to get some null pointer checks. ACPI + * wakeup will map the first PTD transiently to use it for 1 + * instruction. The double mapping for low memory is not usable in + * normal operation since it breaks trapping of null pointers and + * causes inconsistencies in page tables when combined with PG_G. */ for (i = 1; i < NKPT; i++) PTD[i] = 0; From owner-svn-src-head@freebsd.org Mon Dec 18 14:30:09 2017 Return-Path: Delivered-To: svn-src-head@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 11A25E8ED1F; Mon, 18 Dec 2017 14:30:09 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id C66B47CEDE; Mon, 18 Dec 2017 14:30:08 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id F02461A2704; Tue, 19 Dec 2017 01:03:18 +1100 (AEDT) Date: Tue, 19 Dec 2017 01:03:17 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Bruce Evans cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326932 - in head/sys: i386/i386 x86/acpica x86/x86 In-Reply-To: <201712181353.vBIDrM1W023033@repo.freebsd.org> Message-ID: <20171219005921.H2160@besplex.bde.org> References: <201712181353.vBIDrM1W023033@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=6I5d2MoRAAAA:8 a=8mRGWCooAZZwRf8n84EA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 14:30:09 -0000 On Mon, 18 Dec 2017, Bruce Evans wrote: > Author: bde > Date: Mon Dec 18 13:53:22 2017 > New Revision: 326932 > URL: https://svnweb.freebsd.org/changeset/base/326932 > > Log: > Remove the permanent double mapping of low physical memory and replace > it by a transient double mapping for the one instruction in ACPI wakeup > where it is needed (and for many surrounding instructions in ACPI resume). > Invalidate the TLB as soon as convenient after undoing the transient > mapping. ACPI resume already has the strict ordering needed for this. Forgot: Reviewed by: kib This central part of my recent fixes involving the permanent double mapping needed review more than the previous parts. Bruce From owner-svn-src-head@freebsd.org Mon Dec 18 14:59:19 2017 Return-Path: Delivered-To: svn-src-head@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 E61EFE912E7; Mon, 18 Dec 2017 14:59:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x236.google.com (mail-pl0-x236.google.com [IPv6:2607:f8b0:400e:c01::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB8097E38A; Mon, 18 Dec 2017 14:59:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x236.google.com with SMTP id s10so4954131plj.5; Mon, 18 Dec 2017 06:59:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=SLU3rlJry0DCRHqIckYLYi/W7ICmfZgKLhM6T7nfpb8=; b=QJWO1Nw6u+9//cuX7sNqXAtW1KRLvQutfsKlBf47dHn3UTymPQuL9IlA6KjfNITWHP SQpmILnpj/RXx3wdpGtugvbUzdI6ARfPTkfVPb5N12afcvG/zdbQRSYzgXsNGbkYdtGG XmaPUbyLY0Zx38K/oeP//XOaGuINrIFdyN37e9fvcyrU68Y1GuPeGIxNO+9KRc9eCmni Ne+sOXk6JxE/Yvo8aZllmMhXx3GWQooei4/1uDd6dbUqybUirznUNnD5DVW14TFesOHZ c7g8C5TwdoNTqdeFN3RQb3sE0r7Y92gqccdiYFgfRBxbzXYOEpjjfaWFvZc3uZAvZ3e1 +lAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=SLU3rlJry0DCRHqIckYLYi/W7ICmfZgKLhM6T7nfpb8=; b=ieFDxP8XcWxb5/UqWr3pSNcsx4RQ9xvj9hU6gscmEDhb2nRR0AuniT89Qpn2LV8gGf LlXJ+ckV4zP4KhJNnn3umAHVtRXFJd4/iamA4rybQKPY4Wckyte3b1EGCSxcn9aqTgyu gwLfnOzIrIBCv5iSn4F2GwrJYTgvnfYL082fNZ/tixhUBIQck211/O8usa36ilWrqdgY L39Mk1mhtlaLD2KxTgwOB1jJR04DD0a9Xiseoj7c4xRBKo21Jc5r/5JEkUl1pvbkjX+w jRHn51Gi53Cv3iLzVbzGZpIauLAovPqV0apvoBT9+tFzvYgWvThZmUq3yXrjR+fEAz4D Toew== X-Gm-Message-State: AKGB3mIoQhVPqAotNYGCzOZwVRCURjHM9qpw//s19Xz05oVqL8NrOSdt uWn1dmotaSHFkoO+lCNwwF+gjg== X-Google-Smtp-Source: ACJfBov5o3Vum7aFskMg+5ghA98n8SM2B+4LFP7/vQ6xFuFZRGtxN8Oi//XnJ0xiH3cPANmZPeazFQ== X-Received: by 10.159.197.65 with SMTP id d1mr25102plo.58.1513609158489; Mon, 18 Dec 2017 06:59:18 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id b78sm27959816pfc.21.2017.12.18.06.59.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 06:59:17 -0800 (PST) Sender: Mark Johnston Date: Mon, 18 Dec 2017 09:59:14 -0500 From: Mark Johnston To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, pho@FreeBSD.org Subject: Re: svn commit: r326643 - head/sys/cam Message-ID: <20171218145914.GD4235@raichu> References: <201712062305.vB6N57XP065402@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712062305.vB6N57XP065402@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 14:59:20 -0000 On Wed, Dec 06, 2017 at 11:05:07PM +0000, Warner Losh wrote: > Author: imp > Date: Wed Dec 6 23:05:07 2017 > New Revision: 326643 > URL: https://svnweb.freebsd.org/changeset/base/326643 > > Log: > Make cam_periph_runccb be safe to call when we can only do polling. > > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D13388 > > Modified: > head/sys/cam/cam_periph.c > head/sys/cam/cam_xpt.c > head/sys/cam/cam_xpt.h > > Modified: head/sys/cam/cam_periph.c > ============================================================================== > --- head/sys/cam/cam_periph.c Wed Dec 6 23:03:34 2017 (r326642) > +++ head/sys/cam/cam_periph.c Wed Dec 6 23:05:07 2017 (r326643) > @@ -1160,7 +1160,11 @@ cam_periph_runccb(union ccb *ccb, > struct bintime *starttime; > struct bintime ltime; > int error; > - > + bool sched_stopped; > + struct mtx *periph_mtx; > + struct cam_periph *periph; > + uint32_t timeout = 1; > + > starttime = NULL; > xpt_path_assert(ccb->ccb_h.path, MA_OWNED); > KASSERT((ccb->ccb_h.flags & CAM_UNLOCKED) == 0, > @@ -1180,21 +1184,47 @@ cam_periph_runccb(union ccb *ccb, > devstat_start_transaction(ds, starttime); > } > > + sched_stopped = SCHEDULER_STOPPED(); It looks like this regresses DDB's "dump" command: while SCHEDULER_STOPPED() will be true after a panic, it is not true after breaking into DDB from the console. pho@ reported the following issue: db:0:allt> call doadump Dumping 2234 out of 65426 MB:panic: sleepq_add: td 0xfffff80003a48000 to sleep on wchan 0xfffffe0000b36ce8 with sleeping prohibited cpuid = 18 time = 1513582125 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0000b36940 vpanic() at vpanic+0x19c/frame 0xfffffe0000b369c0 kassert_panic() at kassert_panic+0x126/frame 0xfffffe0000b36a30 sleepq_add() at sleepq_add+0x34d/frame 0xfffffe0000b36a80 _sleep() at _sleep+0x26c/frame 0xfffffe0000b36b20 cam_periph_runccb() at cam_periph_runccb+0x17d/frame 0xfffffe0000b36c80 dadump() at dadump+0x12a/frame 0xfffffe0000b36ef0 dump_append() at dump_append+0xa5/frame 0xfffffe0000b36f10 blk_write() at blk_write+0x28b/frame 0xfffffe0000b36f50 minidumpsys() at minidumpsys+0x959/frame 0xfffffe0000b37010 ... Wouldn't it be more correct to predicate on "dumping" rather than SCHEDULER_STOPPED()? From owner-svn-src-head@freebsd.org Mon Dec 18 15:03:10 2017 Return-Path: Delivered-To: svn-src-head@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 49597E91834 for ; Mon, 18 Dec 2017 15:03:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22b.google.com (mail-io0-x22b.google.com [IPv6:2607:f8b0:4001:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 086617E91A for ; Mon, 18 Dec 2017 15:03:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22b.google.com with SMTP id x129so10098471iod.13 for ; Mon, 18 Dec 2017 07:03:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=9FlPa3LjDxUxFBG7HN9/aEWW6Sg8RIm9ZQc6VflXRTA=; b=mOHCUNyZfy1jvFlMChfcu8e29sbARbG5sNTJpAmyMGIeodexqb4F+WG6S8y2ftA7bw xNcNrrnIOYJiROWVCsFrq8jjhoSP60+IT1vcjuT/a4ILOZXNsWlPO6DB2oujN9w268zS uo0GpFtgK9ZuOwuLEcdv6gli61nD4xZ06dOB1cah8MsOlId9e7fncV5Gmpeza/zSDGKJ 35vWJL1pZapE3CXvlpvA9pr+148qWtwZuxYEPA3iRmeeWF9FK7JsEt1PbGYeKqrkN4uq d1R6ecX6enj9cZ7urU015TLdR+Chgx/pxCQtNRuBY9WbkTIrC4M8buQsHfVKH0UtKmQL wEzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=9FlPa3LjDxUxFBG7HN9/aEWW6Sg8RIm9ZQc6VflXRTA=; b=tM6u0xGmp8Q1qHIUkZakhvK1JB8JZaeD19JTwmqGg+wPGs9K9ZhacV51+5ANo9+aoj cKD3AAWZDEad3SEJsXmESI+BhoG0UriuF9JjAVEbKsVWb+pmvxx5FfyJuXrv3zvj/Tim ICogL18eJ6DWfskFASK5HZ0VJkUKvG7+2h7aGHbfgfczoO0XDeTPU0Gz9hXNpbQDrR+8 fBelv81zVhb8Hi5h0jArKx3hWgZTrt0rPg+UzIH10+veIracVQy8mU9ptIoUQNvqs79V v8XFPjRqL+zUHU7kdAHMInW9Qhr/UzanVHa9mfjEtWJhPz66LiP46QsQeweojVl5eYLW URrw== X-Gm-Message-State: AKGB3mLQ/p5C6rJiM01mYPIiWVFk5jpW2ODrm30x9yhKwbgTuPjZKXUS rj1EZHfnsf3eiBypZkf6dFsr9WppiOfjSfeBvlYNkw== X-Google-Smtp-Source: ACJfBosFX16G73I1DDuI16qKqWHoHEU8ZNm06XCfg3SU5eeJ6J4oiC5wF64J82ypvXaTYgxFpnbA1GEHTkmrUozy3gA= X-Received: by 10.107.30.81 with SMTP id e78mr45564ioe.130.1513609389010; Mon, 18 Dec 2017 07:03:09 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 18 Dec 2017 07:03:08 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20171218145914.GD4235@raichu> References: <201712062305.vB6N57XP065402@repo.freebsd.org> <20171218145914.GD4235@raichu> From: Warner Losh Date: Mon, 18 Dec 2017 08:03:08 -0700 X-Google-Sender-Auth: OPVAhSegMcEcjpMsND3u7--yKng Message-ID: Subject: Re: svn commit: r326643 - head/sys/cam To: Mark Johnston Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Peter Holm Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 15:03:10 -0000 On Mon, Dec 18, 2017 at 7:59 AM, Mark Johnston wrote: > On Wed, Dec 06, 2017 at 11:05:07PM +0000, Warner Losh wrote: > > Author: imp > > Date: Wed Dec 6 23:05:07 2017 > > New Revision: 326643 > > URL: https://svnweb.freebsd.org/changeset/base/326643 > > > > Log: > > Make cam_periph_runccb be safe to call when we can only do polling. > > > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D13388 > > > > Modified: > > head/sys/cam/cam_periph.c > > head/sys/cam/cam_xpt.c > > head/sys/cam/cam_xpt.h > > > > Modified: head/sys/cam/cam_periph.c > > ============================================================ > ================== > > --- head/sys/cam/cam_periph.c Wed Dec 6 23:03:34 2017 (r326642) > > +++ head/sys/cam/cam_periph.c Wed Dec 6 23:05:07 2017 (r326643) > > @@ -1160,7 +1160,11 @@ cam_periph_runccb(union ccb *ccb, > > struct bintime *starttime; > > struct bintime ltime; > > int error; > > - > > + bool sched_stopped; > > + struct mtx *periph_mtx; > > + struct cam_periph *periph; > > + uint32_t timeout = 1; > > + > > starttime = NULL; > > xpt_path_assert(ccb->ccb_h.path, MA_OWNED); > > KASSERT((ccb->ccb_h.flags & CAM_UNLOCKED) == 0, > > @@ -1180,21 +1184,47 @@ cam_periph_runccb(union ccb *ccb, > > devstat_start_transaction(ds, starttime); > > } > > > > + sched_stopped = SCHEDULER_STOPPED(); > > It looks like this regresses DDB's "dump" command: while > SCHEDULER_STOPPED() will be true after a panic, it is not true after > breaking into DDB from the console. pho@ reported the following > issue: > > db:0:allt> call doadump > Dumping 2234 out of 65426 MB:panic: sleepq_add: td 0xfffff80003a48000 to > sleep on wchan 0xfffffe0000b36ce8 with sleeping prohibited > cpuid = 18 > time = 1513582125 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe0000b36940 > vpanic() at vpanic+0x19c/frame 0xfffffe0000b369c0 > kassert_panic() at kassert_panic+0x126/frame 0xfffffe0000b36a30 > sleepq_add() at sleepq_add+0x34d/frame 0xfffffe0000b36a80 > _sleep() at _sleep+0x26c/frame 0xfffffe0000b36b20 > cam_periph_runccb() at cam_periph_runccb+0x17d/frame 0xfffffe0000b36c80 > dadump() at dadump+0x12a/frame 0xfffffe0000b36ef0 > dump_append() at dump_append+0xa5/frame 0xfffffe0000b36f10 > blk_write() at blk_write+0x28b/frame 0xfffffe0000b36f50 > minidumpsys() at minidumpsys+0x959/frame 0xfffffe0000b37010 > ... > > Wouldn't it be more correct to predicate on "dumping" rather than > SCHEDULER_STOPPED()? > I debated between a number of different alternatives, but didn't have a use case for when SCHEDUELR_STOPPED() would be wrong. Now I do. I think that you are right. I'll make that change. Sorry for the hassle this may have caused. I'll submit a review and add you as a reviewer today. Warner From owner-svn-src-head@freebsd.org Mon Dec 18 15:28:36 2017 Return-Path: Delivered-To: svn-src-head@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 BE1A4E935B6 for ; Mon, 18 Dec 2017 15:28:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x233.google.com (mail-io0-x233.google.com [IPv6:2607:f8b0:4001:c06::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F1B37F8FF for ; Mon, 18 Dec 2017 15:28:36 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x233.google.com with SMTP id v186so10184033iod.7 for ; Mon, 18 Dec 2017 07:28:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=IK8agE4EyaEMd4e4F0/ClbfELGNJs7cnrIhCD/Jm1P8=; b=0ECvX1WgnwyjAmddkG2MkXnHP3ITSXyDUdDynX4+AtpV2p6YxOSOwaUnOqH3o3rqI4 FoXpEEyFt0p/rFtMxCKN5wymXGd1SacUc+E/xJRrDdWupbQHva7TUzFVpxVfDGaGvtjb 7MVtxfDmTGyjgmLTx2NJhkixIYLe9A1OrH3km98149V6tWVeP3+h1XkWTYzJFBMMvEjj wMSjOqhInHXV/FUr/QAAlAXhAlhghl/2XUMjo1skoHMbCbCSPT5XrXc49LeAKKX8Qz54 dSPHESilBBPdPQaumCLzoa7LOnLuAoRiEA0zqKyqMT9Evti/jbt1lkwH+URhF1fc/oLs YmgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=IK8agE4EyaEMd4e4F0/ClbfELGNJs7cnrIhCD/Jm1P8=; b=aSiS0S8ox4Ed1kLD+OYSU/B8sKLMbvn+L+4yQYXU/LnRhAzD2ndThMhPjzG5mzYO1w SZizZ8f5xiRz8mXXTcF1015sTmi8JJVX+8Uj2L/PlwdAzF0VsT4gauuDH2EacOkA/z60 H+5IdMvwWNWX3xfKdySYNHOV7sKOwx4QcO4Ygmzklh/chrUlJ1VUiJeoDOv+TXkPwkTd b+ogXMTNL+WYxOXw6YsizjH/NRcoPJ5aH3haviLSbqfLDrhBO5/CsFbQK1xEZ7J90AX8 dRQkpme+JXUQWwq+h29M7A+6wLQASTRSXm8yZMRvLxX4UD6kaGCnNDiVUHbTbfjg4XF0 iaog== X-Gm-Message-State: AKGB3mL4SyaiL3r4BW6t7srzc824QGs6m6MCODk6JKxivWghuuDTnWuE klfOMXkHbGzk5WU8/bc3ygmT8WR6I9A6xVYLLRdfnA== X-Google-Smtp-Source: ACJfBosfX+8zM7KWHhxoMpDQRJJKSsl55ygCIvHNzKDHeASuq3bPvfHV2vY2sOYDk72B2uESr/cnHpqXfS2eKlHUEnY= X-Received: by 10.107.48.197 with SMTP id w188mr94849iow.301.1513610915404; Mon, 18 Dec 2017 07:28:35 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Mon, 18 Dec 2017 07:28:34 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201712062305.vB6N57XP065402@repo.freebsd.org> <20171218145914.GD4235@raichu> From: Warner Losh Date: Mon, 18 Dec 2017 08:28:34 -0700 X-Google-Sender-Auth: DwznuAmEJgFz71wT4J5Lr9KMJJk Message-ID: Subject: Re: svn commit: r326643 - head/sys/cam To: Mark Johnston Cc: Warner Losh , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Peter Holm Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 15:28:36 -0000 Sorry for the top post, but https://reviews.freebsd.org/D13531 should have a fix. Warner On Mon, Dec 18, 2017 at 8:03 AM, Warner Losh wrote: > > > On Mon, Dec 18, 2017 at 7:59 AM, Mark Johnston wrote: > >> On Wed, Dec 06, 2017 at 11:05:07PM +0000, Warner Losh wrote: >> > Author: imp >> > Date: Wed Dec 6 23:05:07 2017 >> > New Revision: 326643 >> > URL: https://svnweb.freebsd.org/changeset/base/326643 >> > >> > Log: >> > Make cam_periph_runccb be safe to call when we can only do polling. >> > >> > Sponsored by: Netflix >> > Differential Revision: https://reviews.freebsd.org/D13388 >> > >> > Modified: >> > head/sys/cam/cam_periph.c >> > head/sys/cam/cam_xpt.c >> > head/sys/cam/cam_xpt.h >> > >> > Modified: head/sys/cam/cam_periph.c >> > ============================================================ >> ================== >> > --- head/sys/cam/cam_periph.c Wed Dec 6 23:03:34 2017 (r326642) >> > +++ head/sys/cam/cam_periph.c Wed Dec 6 23:05:07 2017 (r326643) >> > @@ -1160,7 +1160,11 @@ cam_periph_runccb(union ccb *ccb, >> > struct bintime *starttime; >> > struct bintime ltime; >> > int error; >> > - >> > + bool sched_stopped; >> > + struct mtx *periph_mtx; >> > + struct cam_periph *periph; >> > + uint32_t timeout = 1; >> > + >> > starttime = NULL; >> > xpt_path_assert(ccb->ccb_h.path, MA_OWNED); >> > KASSERT((ccb->ccb_h.flags & CAM_UNLOCKED) == 0, >> > @@ -1180,21 +1184,47 @@ cam_periph_runccb(union ccb *ccb, >> > devstat_start_transaction(ds, starttime); >> > } >> > >> > + sched_stopped = SCHEDULER_STOPPED(); >> >> It looks like this regresses DDB's "dump" command: while >> SCHEDULER_STOPPED() will be true after a panic, it is not true after >> breaking into DDB from the console. pho@ reported the following >> issue: >> >> db:0:allt> call doadump >> Dumping 2234 out of 65426 MB:panic: sleepq_add: td 0xfffff80003a48000 to >> sleep on wchan 0xfffffe0000b36ce8 with sleeping prohibited >> cpuid = 18 >> time = 1513582125 >> KDB: stack backtrace: >> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame >> 0xfffffe0000b36940 >> vpanic() at vpanic+0x19c/frame 0xfffffe0000b369c0 >> kassert_panic() at kassert_panic+0x126/frame 0xfffffe0000b36a30 >> sleepq_add() at sleepq_add+0x34d/frame 0xfffffe0000b36a80 >> _sleep() at _sleep+0x26c/frame 0xfffffe0000b36b20 >> cam_periph_runccb() at cam_periph_runccb+0x17d/frame 0xfffffe0000b36c80 >> dadump() at dadump+0x12a/frame 0xfffffe0000b36ef0 >> dump_append() at dump_append+0xa5/frame 0xfffffe0000b36f10 >> blk_write() at blk_write+0x28b/frame 0xfffffe0000b36f50 >> minidumpsys() at minidumpsys+0x959/frame 0xfffffe0000b37010 >> ... >> >> Wouldn't it be more correct to predicate on "dumping" rather than >> SCHEDULER_STOPPED()? >> > > I debated between a number of different alternatives, but didn't have a > use case for when SCHEDUELR_STOPPED() would be wrong. Now I do. I think > that you are right. I'll make that change. Sorry for the hassle this may > have caused. I'll submit a review and add you as a reviewer today. > > Warner > From owner-svn-src-head@freebsd.org Mon Dec 18 17:18:47 2017 Return-Path: Delivered-To: svn-src-head@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 6F06AE9CE84; Mon, 18 Dec 2017 17:18:47 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id AF63E652CD; Mon, 18 Dec 2017 17:18:46 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id Qz3lenB4lZ8gBQz3meQwRM; Mon, 18 Dec 2017 10:18:39 -0700 X-Authority-Analysis: v=2.2 cv=M/g9E24s c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=mi56gJdQAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wbI1F7SKnoTB2mRG3ewA:9 a=CjuIK1q_8ugA:10 a=m6W23KLcDyq3lIHOBnQi:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 1989D101; Mon, 18 Dec 2017 09:18:37 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBIHITrl059357; Mon, 18 Dec 2017 09:18:29 -0800 (PST) (envelope-from cy@slippy.cwsent.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBIHISiS058980; Mon, 18 Dec 2017 09:18:28 -0800 (PST) (envelope-from cy@slippy.cwsent.com) Resent-Message-Id: <201712181718.vBIHISiS058980@slippy.cwsent.com> Message-Id: <201712181718.vBIHISiS058980@slippy.cwsent.com> X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326617 - head/usr.sbin/newsyslog In-Reply-To: Message from Baptiste Daroussin of "Mon, 18 Dec 2017 10:36:35 +0100." <20171218093635.ilumboo655ualwzs@ivaldir.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 18 Dec 2017 09:10:05 -0800 Resent-To: Baptiste Daroussin Resent-Cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Resent-From: "Cy Schubert (cy)" Resent-Date: Mon, 18 Dec 2017 09:18:28 -0800 X-CMAE-Envelope: MS4wfNMriKcxqrjS3kLsFIufihlHS38E3IzxgB5aI4KVLxMDeZrqqLddXNXByG6lqIjXZoK5NfR1p9xQWp4ZQWLYSE2yqpyRoFxQg370vIL4xrWPacWezIzZ cIkPAwxDyJ/8nR7+swLpSvP6a4EhxdCvv3B4PYewUfyn9+WtZMLmD7RPpxaGvbgOxJ701UD/BC59VKB7dsENjHGfCCzBRe5cvj7CLzuC3c8JQG/w/p2asN95 kIT5/CbPheGHab9aFOePk5z3ap1QTOpOroXyPbUZeZBTD3QT9ovmWyDUuKma7LMy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 17:18:47 -0000 In message <20171218093635.ilumboo655ualwzs@ivaldir.net>, Baptiste Daroussin wr ites: > On Fri, Dec 15, 2017 at 05:40:15PM -0800, Cy Schubert wrote: > > In message <201712060944.vB69iZQe027554@repo.freebsd.org>, Baptiste=20 > > Daroussin w > > rites: > > > Author: bapt > > > Date: Wed Dec 6 09:44:35 2017 > > > New Revision: 326617 > > > URL: https://svnweb.freebsd.org/changeset/base/326617 > > > > > > Log: > > > Allow newsyslog to execute compression commands which > > > have a semantic different than the traditional gzip(1) > > > =20 > > > This is done to allow to use zstd(1) as a compression tool without > > > having to patch it to change its default behavior. > > > > > > Modified: > > > head/usr.sbin/newsyslog/newsyslog.c > > > > > > Modified: head/usr.sbin/newsyslog/newsyslog.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D > > > =3D > > > --- head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 06:49:53 2017 > > > (r326616) > > > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 09:44:35 2017 > > > (r326617) > > > @@ -151,14 +151,23 @@ struct compress_types { > > > const char *flag; /* Flag in configuration file */ > > > const char *suffix; /* Compression suffix */ > > > const char *path; /* Path to compression program */ > > > + char **args; /* Comrpession arguments */ > > > }; > > > =20 > > > +static char f_arg[] =3D "-f"; > > > +static char q_arg[] =3D "-q"; > > > +static char rm_arg[] =3D "--rm"; > > > +static char *gz_args[] =3D{ NULL, f_arg, NULL, NULL }; > > > +#define bzip2_args gz_args > > > +#define xz_args gz_args > > > +static char *zstd_args[] =3D { NULL, q_arg, rm_arg, NULL, NULL }; > > > + > > > static const struct compress_types compress_type[COMPRESS_TYPES] =3D { > > > - { "", "", "" }, /* no compression */ > > > - { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ > > > - { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ > > > - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ }, /* xz compression */ > > > - { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD } /* zst compression */ > > > + { "", "", "", NULL}, /* none */ > > > + { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args}, /* gzip */ > > > + { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2, bzip2_args}, /* bzip2 */ > > > + { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ, xz_args }, /* xz */ > > > + { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD, zstd_args } /* zst */ > > > }; > > > =20 > > > struct conf_entry { > > > @@ -2001,6 +2010,8 @@ do_zipwork(struct zipwork_entry *zwork) > > > int errsav, fcount, zstatus; > > > pid_t pidzip, wpid; > > > char zresult[MAXPATHLEN]; > > > + char command[BUFSIZ]; > > > + char **args; > > > int c; > > > =20 > > > assert(zwork !=3D NULL); > > > @@ -2013,6 +2024,7 @@ do_zipwork(struct zipwork_entry *zwork) > > > pgm_path =3D compress_type[c].path; > > > (void) strlcat(zresult, > > > compress_type[c].suffix, sizeof(zresult)); > > > + args =3D compress_type[c].args; > > > break; > > > } > > > } > > > @@ -2026,6 +2038,13 @@ do_zipwork(struct zipwork_entry *zwork) > > > else > > > pgm_name++; > > > =20 > > > + args[0] =3D strdup(pgm_name); > > > + if (args[0] =3D=3D NULL) > > > + err(1, "strdup()"); > > > + for (c =3D 0; args[c] !=3D NULL; c++) > > > + ; > > > + args[c] =3D zwork->zw_fname; > > > + > > > if (zwork->zw_swork !=3D NULL && zwork->zw_swork->sw_runcmd =3D=3D 0 = > && > > > zwork->zw_swork->sw_pidok <=3D 0) { > > > warnx( > > > @@ -2035,6 +2054,11 @@ do_zipwork(struct zipwork_entry *zwork) > > > return; > > > } > > > =20 > > > + strlcpy(command, pgm_path, sizeof(command)); > > > + for (c =3D 1; args[c] !=3D NULL; c++) { > > > + strlcat(command, " ", sizeof(command)); > > > + strlcat(command, args[c], sizeof(command)); > > > + } > > > if (noaction) { > > > printf("\t%s %s\n", pgm_name, zwork->zw_fname); > > > change_attrs(zresult, zwork->zw_conf); > > > @@ -2058,8 +2082,8 @@ do_zipwork(struct zipwork_entry *zwork) > > > } > > > if (!pidzip) { > > > /* The child process executes the compression command */ > > > - execl(pgm_path, pgm_path, "-f", zwork->zw_fname, (char *)0); > > > - err(1, "execl(`%s -f %s')", pgm_path, zwork->zw_fname); > > > + execv(pgm_path, (char *const*) args); > > > + err(1, "execv(`%s')", command); > > > } > > > =20 > > > wpid =3D waitpid(pidzip, &zstatus, 0); > > > @@ -2069,13 +2093,12 @@ do_zipwork(struct zipwork_entry *zwork) > > > return; > > > } > > > if (!WIFEXITED(zstatus)) { > > > - warnx("`%s -f %s' did not terminate normally", pgm_name, > > > - zwork->zw_fname); > > > + warnx("`%s' did not terminate normally", command); > > > return; > > > } > > > if (WEXITSTATUS(zstatus)) { > > > - warnx("`%s -f %s' terminated with a non-zero status (%d)", > > > - pgm_name, zwork->zw_fname, WEXITSTATUS(zstatus)); > > > + warnx("`%s' terminated with a non-zero status (%d)", command, > > > + WEXITSTATUS(zstatus)); > > > return; > > > } > > > =20 > > > > >=20 > > Ever since this revision I'm seeing the following errors: > >=20 > > bzip2: Can't open input file ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ: No suc= > h=20 > > file or directory. > > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > > /var/log/debug.log.0' terminated with a non-zero status (1) > > bzip2: Bad flag `--rm' > > bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010. > >=20 > > usage: bzip2 [flags and input files in any order] > >=20 > > -h --help print this message > > -d --decompress force decompression > > -z --compress force compression > > -k --keep keep (don't delete) input files > > -f --force overwrite existing output files > > -t --test test compressed file integrity > > -c --stdout output to standard out > > -q --quiet suppress noncritical error messages > > -v --verbose be verbose (a 2nd -v gives more) > > -L --license display software version & license > > -V --version display software version & license > > -s --small use less memory (at most 2500k) > > -1 .. -9 set block size to 100k .. 900k > > --fast alias for -1 > > --best alias for -9 > >=20 > > If invoked as `bzip2', default action is to compress. > > as `bunzip2', default action is to decompress. > > as `bzcat', default action is to decompress to stdout. > >=20 > > If no file names are given, bzip2 compresses or decompresses > > from standard input to standard output. You can combine > > short flags, so `-v -4' means the same as -v4 or -4v, &c. > >=20 > > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ= > ZZZ > > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ /var/log/messages.0 -q --rm'=20 > > terminated with a non-zero status (1) > > Should be fixed in r326930. > > Sorry about that, > Best regards, > Bapt No problem. Thanks for fixing it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Dec 18 17:24:52 2017 Return-Path: Delivered-To: svn-src-head@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 4AA28E9D6D9; Mon, 18 Dec 2017 17:24:52 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 88AFE6586D; Mon, 18 Dec 2017 17:24:51 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id Qz9eeHFT5S7BpQz9fehaPp; Mon, 18 Dec 2017 10:24:44 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=mi56gJdQAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=wbI1F7SKnoTB2mRG3ewA:9 a=CjuIK1q_8ugA:10 a=m6W23KLcDyq3lIHOBnQi:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 3F98F10F; Mon, 18 Dec 2017 09:24:42 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBIHOeL0015790; Mon, 18 Dec 2017 09:24:41 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBIHA6BZ030527; Mon, 18 Dec 2017 09:10:37 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712181710.vBIHA6BZ030527@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Baptiste Daroussin cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326617 - head/usr.sbin/newsyslog In-Reply-To: Message from Baptiste Daroussin of "Mon, 18 Dec 2017 10:36:35 +0100." <20171218093635.ilumboo655ualwzs@ivaldir.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 18 Dec 2017 09:10:05 -0800 X-CMAE-Envelope: MS4wfFPIHq6le0SVGOnwsnbmZ5l2EsWhCZc2uOk79UuAzUIXeMswCTPXCtGs+8dbHrqxEaMncF0FvJ0eCmqTtFzNfxNwx9R0jLUi38OKfZp5gqxp0sd24T8D TeutTGRejxj7soobloNurH8lKzoSmVnu8odk0z/xh7a2GRodiC0RrIF3ydw5nja7f5Aq9tTuw1YDeTjNtZE0AjLaJ+jhTuY0e+htIIRb3WrITfh7oywMvJFO fdDAOyFszITl9/gH0Wye1wHIkShAv7j9nG+Aiz6jbQC2SHPieD5bHyCnImkgLqUP X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 17:24:52 -0000 In message <20171218093635.ilumboo655ualwzs@ivaldir.net>, Baptiste Daroussin wr ites: > On Fri, Dec 15, 2017 at 05:40:15PM -0800, Cy Schubert wrote: > > In message <201712060944.vB69iZQe027554@repo.freebsd.org>, Baptiste=20 > > Daroussin w > > rites: > > > Author: bapt > > > Date: Wed Dec 6 09:44:35 2017 > > > New Revision: 326617 > > > URL: https://svnweb.freebsd.org/changeset/base/326617 > > > > > > Log: > > > Allow newsyslog to execute compression commands which > > > have a semantic different than the traditional gzip(1) > > > =20 > > > This is done to allow to use zstd(1) as a compression tool without > > > having to patch it to change its default behavior. > > > > > > Modified: > > > head/usr.sbin/newsyslog/newsyslog.c > > > > > > Modified: head/usr.sbin/newsyslog/newsyslog.c > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= > =3D=3D=3D=3D > > > =3D > > > --- head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 06:49:53 2017 > > > (r326616) > > > +++ head/usr.sbin/newsyslog/newsyslog.c Wed Dec 6 09:44:35 2017 > > > (r326617) > > > @@ -151,14 +151,23 @@ struct compress_types { > > > const char *flag; /* Flag in configuration file */ > > > const char *suffix; /* Compression suffix */ > > > const char *path; /* Path to compression program */ > > > + char **args; /* Comrpession arguments */ > > > }; > > > =20 > > > +static char f_arg[] =3D "-f"; > > > +static char q_arg[] =3D "-q"; > > > +static char rm_arg[] =3D "--rm"; > > > +static char *gz_args[] =3D{ NULL, f_arg, NULL, NULL }; > > > +#define bzip2_args gz_args > > > +#define xz_args gz_args > > > +static char *zstd_args[] =3D { NULL, q_arg, rm_arg, NULL, NULL }; > > > + > > > static const struct compress_types compress_type[COMPRESS_TYPES] =3D { > > > - { "", "", "" }, /* no compression */ > > > - { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP }, /* gzip compression */ > > > - { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2 }, /* bzip2 compression */ > > > - { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ }, /* xz compression */ > > > - { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD } /* zst compression */ > > > + { "", "", "", NULL}, /* none */ > > > + { "Z", COMPRESS_SUFFIX_GZ, _PATH_GZIP, gz_args}, /* gzip */ > > > + { "J", COMPRESS_SUFFIX_BZ2, _PATH_BZIP2, bzip2_args}, /* bzip2 */ > > > + { "X", COMPRESS_SUFFIX_XZ, _PATH_XZ, xz_args }, /* xz */ > > > + { "Y", COMPRESS_SUFFIX_ZST, _PATH_ZSTD, zstd_args } /* zst */ > > > }; > > > =20 > > > struct conf_entry { > > > @@ -2001,6 +2010,8 @@ do_zipwork(struct zipwork_entry *zwork) > > > int errsav, fcount, zstatus; > > > pid_t pidzip, wpid; > > > char zresult[MAXPATHLEN]; > > > + char command[BUFSIZ]; > > > + char **args; > > > int c; > > > =20 > > > assert(zwork !=3D NULL); > > > @@ -2013,6 +2024,7 @@ do_zipwork(struct zipwork_entry *zwork) > > > pgm_path =3D compress_type[c].path; > > > (void) strlcat(zresult, > > > compress_type[c].suffix, sizeof(zresult)); > > > + args =3D compress_type[c].args; > > > break; > > > } > > > } > > > @@ -2026,6 +2038,13 @@ do_zipwork(struct zipwork_entry *zwork) > > > else > > > pgm_name++; > > > =20 > > > + args[0] =3D strdup(pgm_name); > > > + if (args[0] =3D=3D NULL) > > > + err(1, "strdup()"); > > > + for (c =3D 0; args[c] !=3D NULL; c++) > > > + ; > > > + args[c] =3D zwork->zw_fname; > > > + > > > if (zwork->zw_swork !=3D NULL && zwork->zw_swork->sw_runcmd =3D=3D 0 = > && > > > zwork->zw_swork->sw_pidok <=3D 0) { > > > warnx( > > > @@ -2035,6 +2054,11 @@ do_zipwork(struct zipwork_entry *zwork) > > > return; > > > } > > > =20 > > > + strlcpy(command, pgm_path, sizeof(command)); > > > + for (c =3D 1; args[c] !=3D NULL; c++) { > > > + strlcat(command, " ", sizeof(command)); > > > + strlcat(command, args[c], sizeof(command)); > > > + } > > > if (noaction) { > > > printf("\t%s %s\n", pgm_name, zwork->zw_fname); > > > change_attrs(zresult, zwork->zw_conf); > > > @@ -2058,8 +2082,8 @@ do_zipwork(struct zipwork_entry *zwork) > > > } > > > if (!pidzip) { > > > /* The child process executes the compression command */ > > > - execl(pgm_path, pgm_path, "-f", zwork->zw_fname, (char *)0); > > > - err(1, "execl(`%s -f %s')", pgm_path, zwork->zw_fname); > > > + execv(pgm_path, (char *const*) args); > > > + err(1, "execv(`%s')", command); > > > } > > > =20 > > > wpid =3D waitpid(pidzip, &zstatus, 0); > > > @@ -2069,13 +2093,12 @@ do_zipwork(struct zipwork_entry *zwork) > > > return; > > > } > > > if (!WIFEXITED(zstatus)) { > > > - warnx("`%s -f %s' did not terminate normally", pgm_name, > > > - zwork->zw_fname); > > > + warnx("`%s' did not terminate normally", command); > > > return; > > > } > > > if (WEXITSTATUS(zstatus)) { > > > - warnx("`%s -f %s' terminated with a non-zero status (%d)", > > > - pgm_name, zwork->zw_fname, WEXITSTATUS(zstatus)); > > > + warnx("`%s' terminated with a non-zero status (%d)", command, > > > + WEXITSTATUS(zstatus)); > > > return; > > > } > > > =20 > > > > >=20 > > Ever since this revision I'm seeing the following errors: > >=20 > > bzip2: Can't open input file ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ: No suc= > h=20 > > file or directory. > > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > > /var/log/debug.log.0' terminated with a non-zero status (1) > > bzip2: Bad flag `--rm' > > bzip2, a block-sorting file compressor. Version 1.0.6, 6-Sept-2010. > >=20 > > usage: bzip2 [flags and input files in any order] > >=20 > > -h --help print this message > > -d --decompress force decompression > > -z --compress force compression > > -k --keep keep (don't delete) input files > > -f --force overwrite existing output files > > -t --test test compressed file integrity > > -c --stdout output to standard out > > -q --quiet suppress noncritical error messages > > -v --verbose be verbose (a 2nd -v gives more) > > -L --license display software version & license > > -V --version display software version & license > > -s --small use less memory (at most 2500k) > > -1 .. -9 set block size to 100k .. 900k > > --fast alias for -1 > > --best alias for -9 > >=20 > > If invoked as `bzip2', default action is to compress. > > as `bunzip2', default action is to decompress. > > as `bzcat', default action is to decompress to stdout. > >=20 > > If no file names are given, bzip2 compresses or decompresses > > from standard input to standard output. You can combine > > short flags, so `-v -4' means the same as -v4 or -4v, &c. > >=20 > > newsyslog: `/usr/bin/bzip2 -f ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ= > ZZZ > > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=20 > > ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ /var/log/messages.0 -q --rm'=20 > > terminated with a non-zero status (1) > > Should be fixed in r326930. > > Sorry about that, > Best regards, > Bapt No problem. Thanks for fixing it. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Mon Dec 18 17:26:26 2017 Return-Path: Delivered-To: svn-src-head@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 56D9CE9D90C; Mon, 18 Dec 2017 17:26:26 +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 236C565AB8; Mon, 18 Dec 2017 17:26:26 +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 vBIHQPH6013175; Mon, 18 Dec 2017 17:26:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIHQPor013173; Mon, 18 Dec 2017 17:26:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201712181726.vBIHQPor013173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 18 Dec 2017 17:26:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326935 - in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/cddl/dev/dtrace: amd64 i386 X-SVN-Commit-Revision: 326935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 17:26:26 -0000 Author: markj Date: Mon Dec 18 17:26:24 2017 New Revision: 326935 URL: https://svnweb.freebsd.org/changeset/base/326935 Log: Avoid CPU migration in dtrace_gethrtime() on x86. dtrace_gethrtime() may be called outside of probe context, and in particular, from the DTRACEIOC_BUFSNAP handler. Disable interrupts rather than using sched_pin() to help ensure that we don't call any external functions when in probe context. PR: 218452 MFC after: 1 week Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 18 17:17:07 2017 (r326934) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Mon Dec 18 17:26:24 2017 (r326935) @@ -353,11 +353,11 @@ SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_AN * Returns nanoseconds since boot. */ uint64_t -dtrace_gethrtime() +dtrace_gethrtime(void) { uint64_t tsc; - uint32_t lo; - uint32_t hi; + uint32_t lo, hi; + register_t rflags; /* * We split TSC value into lower and higher 32-bit halves and separately @@ -365,7 +365,10 @@ dtrace_gethrtime() * (see nsec_scale calculations) taking into account 32-bit shift of * the higher half and finally add. */ + rflags = intr_disable(); tsc = rdtsc() - tsc_skew[curcpu]; + intr_restore(rflags); + lo = tsc; hi = tsc >> 32; return (((lo * nsec_scale) >> SCALE_SHIFT) + Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 18 17:17:07 2017 (r326934) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Mon Dec 18 17:26:24 2017 (r326935) @@ -355,11 +355,11 @@ SYSINIT(dtrace_gethrtime_init, SI_SUB_SMP, SI_ORDER_AN * Returns nanoseconds since boot. */ uint64_t -dtrace_gethrtime() +dtrace_gethrtime(void) { uint64_t tsc; - uint32_t lo; - uint32_t hi; + uint32_t lo, hi; + register_t eflags; /* * We split TSC value into lower and higher 32-bit halves and separately @@ -367,7 +367,10 @@ dtrace_gethrtime() * (see nsec_scale calculations) taking into account 32-bit shift of * the higher half and finally add. */ + eflags = intr_disable(); tsc = rdtsc() - tsc_skew[curcpu]; + intr_restore(eflags); + lo = tsc; hi = tsc >> 32; return (((lo * nsec_scale) >> SCALE_SHIFT) + From owner-svn-src-head@freebsd.org Mon Dec 18 18:38:02 2017 Return-Path: Delivered-To: svn-src-head@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 11ACCEA2DDD; Mon, 18 Dec 2017 18:38:02 +0000 (UTC) (envelope-from imp@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 C564268EE5; Mon, 18 Dec 2017 18:38:01 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBIIc0h4043197; Mon, 18 Dec 2017 18:38:00 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIIc0Rq043194; Mon, 18 Dec 2017 18:38:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712181838.vBIIc0Rq043194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Dec 2017 18:38:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326937 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 326937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 18:38:02 -0000 Author: imp Date: Mon Dec 18 18:38:00 2017 New Revision: 326937 URL: https://svnweb.freebsd.org/changeset/base/326937 Log: When we're disabling the nvme device, some drives have a controller bug that requires 'hands off' for a period of time (2.3s) before we check the RDY bit. Sicne this is a very odd quirk for a very limited selection of drives, do this as a quirk. This prevented a successful reset of the card when the card wedged. Also, make sure that we comply with the advice from section 3.1.5 of the 1.3 spec says that transitioning CC.EN from 0 to 1 when CSTS.RDY is 1 or transitioning CC.EN from 1 to 0 when CSTS.RDY is 0 "has undefined results". Short circuit when EN == RDY == desired state. Finally, fail the reset if the disable fails. This will lead to a failed device, which is what we want. (note: nda device needs work for coping with a failed device). Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13389 Modified: head/sys/dev/nvme/nvme.c head/sys/dev/nvme/nvme_ctrlr.c head/sys/dev/nvme/nvme_private.h Modified: head/sys/dev/nvme/nvme.c ============================================================================== --- head/sys/dev/nvme/nvme.c Mon Dec 18 17:58:09 2017 (r326936) +++ head/sys/dev/nvme/nvme.c Mon Dec 18 18:38:00 2017 (r326937) @@ -90,6 +90,7 @@ static struct _pcsid int match_subdevice; uint16_t subdevice; const char *desc; + uint32_t quirks; } pci_ids[] = { { 0x01118086, 0, 0, "NVMe Controller" }, { IDT32_PCI_ID, 0, 0, "IDT NVMe Controller (32 channel)" }, @@ -100,6 +101,11 @@ static struct _pcsid { 0x09538086, 1, 0x3705, "DC P3500 SSD [2.5\" SFF]" }, { 0x09538086, 1, 0x3709, "DC P3600 SSD [Add-in Card]" }, { 0x09538086, 1, 0x370a, "DC P3600 SSD [2.5\" SFF]" }, + { 0x00031c58, 0, 0, "HGST SN100", QUIRK_DELAY_B4_CHK_RDY }, + { 0x00231c58, 0, 0, "WDC SN200", QUIRK_DELAY_B4_CHK_RDY }, + { 0x05401c5f, 0, 0, "Memblaze Pblaze4", QUIRK_DELAY_B4_CHK_RDY }, + { 0xa821144d, 0, 0, "Samsung PM1725", QUIRK_DELAY_B4_CHK_RDY }, + { 0xa822144d, 0, 0, "Samsung PM1725a", QUIRK_DELAY_B4_CHK_RDY }, { 0x00000000, 0, 0, NULL } }; @@ -240,6 +246,19 @@ nvme_attach(device_t dev) { struct nvme_controller *ctrlr = DEVICE2SOFTC(dev); int status; + struct _pcsid *ep; + uint32_t devid; + uint16_t subdevice; + + devid = pci_get_devid(dev); + subdevice = pci_get_subdevice(dev); + ep = pci_ids; + while (ep->devid) { + if (nvme_match(devid, subdevice, ep)) + break; + ++ep; + } + ctrlr->quirks = ep->quirks; status = nvme_ctrlr_construct(ctrlr, dev); Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Dec 18 17:58:09 2017 (r326936) +++ head/sys/dev/nvme/nvme_ctrlr.c Mon Dec 18 18:38:00 2017 (r326937) @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include "nvme_private.h" +#define B4_CHK_RDY_DELAY_MS 2300 /* work arond controller bug */ + static void nvme_ctrlr_construct_and_submit_aer(struct nvme_controller *ctrlr, struct nvme_async_event_request *aer); static void nvme_ctrlr_setup_interrupts(struct nvme_controller *ctrlr); @@ -241,49 +243,65 @@ static int nvme_ctrlr_wait_for_ready(struct nvme_controller *ctrlr, int desired_val) { int ms_waited; - union cc_register cc; union csts_register csts; - cc.raw = nvme_mmio_read_4(ctrlr, cc); csts.raw = nvme_mmio_read_4(ctrlr, csts); - if (cc.bits.en != desired_val) { - nvme_printf(ctrlr, "%s called with desired_val = %d " - "but cc.en = %d\n", __func__, desired_val, cc.bits.en); - return (ENXIO); - } - ms_waited = 0; - while (csts.bits.rdy != desired_val) { - DELAY(1000); if (ms_waited++ > ctrlr->ready_timeout_in_ms) { nvme_printf(ctrlr, "controller ready did not become %d " "within %d ms\n", desired_val, ctrlr->ready_timeout_in_ms); return (ENXIO); } + DELAY(1000); csts.raw = nvme_mmio_read_4(ctrlr, csts); } return (0); } -static void +static int nvme_ctrlr_disable(struct nvme_controller *ctrlr) { union cc_register cc; union csts_register csts; + int err; cc.raw = nvme_mmio_read_4(ctrlr, cc); csts.raw = nvme_mmio_read_4(ctrlr, csts); - if (cc.bits.en == 1 && csts.bits.rdy == 0) - nvme_ctrlr_wait_for_ready(ctrlr, 1); + /* + * Per 3.1.5 in NVME 1.3 spec, transitioning CC.EN from 0 to 1 + * when CSTS.RDY is 1 or transitioning CC.EN from 1 to 0 when + * CSTS.RDY is 0 "has undefined results" So make sure that CSTS.RDY + * isn't the desired value. Short circuit if we're already disabled. + */ + if (cc.bits.en == 1) { + if (csts.bits.rdy == 0) { + /* EN == 1, wait for RDY == 1 or fail */ + err = nvme_ctrlr_wait_for_ready(ctrlr, 1); + if (err != 0) + return (err); + } + } else { + /* EN == 0 already wait for RDY == 0 */ + if (csts.bits.rdy == 0) + return (0); + else + return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); + } cc.bits.en = 0; nvme_mmio_write_4(ctrlr, cc, cc.raw); - DELAY(5000); - nvme_ctrlr_wait_for_ready(ctrlr, 0); + /* + * Some drives have issues with accessing the mmio after we + * disable, so delay for a bit after we write the bit to + * cope with these issues. + */ + if (ctrlr->quirks) + pause("nvmeR", B4_CHK_RDY_DELAY_MS * hz / 1000); + return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); } static int @@ -292,15 +310,24 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) union cc_register cc; union csts_register csts; union aqa_register aqa; + int err; cc.raw = nvme_mmio_read_4(ctrlr, cc); csts.raw = nvme_mmio_read_4(ctrlr, csts); + /* + * See note in nvme_ctrlr_disable. Short circuit if we're already enabled. + */ if (cc.bits.en == 1) { if (csts.bits.rdy == 1) return (0); else return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); + } else { + /* EN == 0 already wait for RDY == 0 or fail */ + err = nvme_ctrlr_wait_for_ready(ctrlr, 0); + if (err != 0) + return (err); } nvme_mmio_write_8(ctrlr, asq, ctrlr->adminq.cmd_bus_addr); @@ -326,7 +353,6 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) cc.bits.mps = (PAGE_SIZE >> 13); nvme_mmio_write_4(ctrlr, cc, cc.raw); - DELAY(5000); return (nvme_ctrlr_wait_for_ready(ctrlr, 1)); } @@ -334,7 +360,7 @@ nvme_ctrlr_enable(struct nvme_controller *ctrlr) int nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) { - int i; + int i, err; nvme_admin_qpair_disable(&ctrlr->adminq); /* @@ -349,7 +375,9 @@ nvme_ctrlr_hw_reset(struct nvme_controller *ctrlr) DELAY(100*1000); - nvme_ctrlr_disable(ctrlr); + err = nvme_ctrlr_disable(ctrlr); + if (err != 0) + return err; return (nvme_ctrlr_enable(ctrlr)); } Modified: head/sys/dev/nvme/nvme_private.h ============================================================================== --- head/sys/dev/nvme/nvme_private.h Mon Dec 18 17:58:09 2017 (r326936) +++ head/sys/dev/nvme/nvme_private.h Mon Dec 18 18:38:00 2017 (r326937) @@ -246,6 +246,8 @@ struct nvme_controller { struct mtx lock; uint32_t ready_timeout_in_ms; + uint32_t quirks; +#define QUIRK_DELAY_B4_CHK_RDY 1 /* Can't touch MMIO on disable */ bus_space_tag_t bus_tag; bus_space_handle_t bus_handle; From owner-svn-src-head@freebsd.org Mon Dec 18 20:11:23 2017 Return-Path: Delivered-To: svn-src-head@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 10E49E8330D; Mon, 18 Dec 2017 20:11:23 +0000 (UTC) (envelope-from imp@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 CFE496C942; Mon, 18 Dec 2017 20:11:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBIKBLND085183; Mon, 18 Dec 2017 20:11:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBIKBLQm085182; Mon, 18 Dec 2017 20:11:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712182011.vBIKBLQm085182@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Dec 2017 20:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326940 - head/sys/dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/nvme X-SVN-Commit-Revision: 326940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 20:11:23 -0000 Author: imp Date: Mon Dec 18 20:11:21 2017 New Revision: 326940 URL: https://svnweb.freebsd.org/changeset/base/326940 Log: Although we only have one quirk at the moment, guard against the day we have more than one by checking the actual quirk bit before delaying the reset. Noticed by: rpokala@ Modified: head/sys/dev/nvme/nvme_ctrlr.c Modified: head/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- head/sys/dev/nvme/nvme_ctrlr.c Mon Dec 18 20:11:15 2017 (r326939) +++ head/sys/dev/nvme/nvme_ctrlr.c Mon Dec 18 20:11:21 2017 (r326940) @@ -299,7 +299,7 @@ nvme_ctrlr_disable(struct nvme_controller *ctrlr) * disable, so delay for a bit after we write the bit to * cope with these issues. */ - if (ctrlr->quirks) + if (ctrlr->quirks & QUIRK_DELAY_B4_CHK_RDY) pause("nvmeR", B4_CHK_RDY_DELAY_MS * hz / 1000); return (nvme_ctrlr_wait_for_ready(ctrlr, 0)); } From owner-svn-src-head@freebsd.org Mon Dec 18 22:50:47 2017 Return-Path: Delivered-To: svn-src-head@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 7EEBEE8F6D2 for ; Mon, 18 Dec 2017 22:50:47 +0000 (UTC) (envelope-from 010001606bd2655b-88495d69-fea4-4969-97f0-62fccf339ca3-000000@amazonses.com) Received: from a8-52.smtp-out.amazonses.com (a8-52.smtp-out.amazonses.com [54.240.8.52]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37E0574F9B for ; Mon, 18 Dec 2017 22:50:46 +0000 (UTC) (envelope-from 010001606bd2655b-88495d69-fea4-4969-97f0-62fccf339ca3-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1513637439; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=uIYmuYS9PXNCHBxlQ9B0VQ1AyDtG9U9/EaX3nuWiU/0=; b=rcaeG7VqdUBWZYuvKjxjgTmn/1nndPupqSRssXWWm87ZOvcXKPFPBsiblg9j2kEx K5kygfima+GHje8qqnye2eXBdbjWApIKLIvV9dKLh7VUPUmMjrXdNUiqhC/j9Y/neuV Ft41Z2zcrwgxGxaHTWPj7yrZocM1L2kDio1eb7LM= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1513637439; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=uIYmuYS9PXNCHBxlQ9B0VQ1AyDtG9U9/EaX3nuWiU/0=; b=lLGLilizNIrcK236fTctJRBM+l5BOSkpH6firsqP/8Iv+P5syJTPr/srVT2t7WiR jQPCme0dyOU/MVMP9HepOeLwe3nf8naZUM7rO/9BLL2vOgfwAQSLGbCn7/FKBr3lBts MhAR+OOCYDcjQaYV+wnpCxSqZ/w7DjMrvDZJQKK0= Subject: Re: svn commit: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4 To: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711151114.vAFBEeUb015030@repo.freebsd.org> <0100016067e203d1-fa769584-f8a1-44f2-ac39-1572e8fff087-000000@email.amazonses.com> <6d9cacd6-0f98-54e0-86be-6f202f509b17@selasky.org> From: Colin Percival Message-ID: <010001606bd2655b-88495d69-fea4-4969-97f0-62fccf339ca3-000000@email.amazonses.com> Date: Mon, 18 Dec 2017 22:50:38 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <6d9cacd6-0f98-54e0-86be-6f202f509b17@selasky.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2017.12.18-54.240.8.52 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 22:50:47 -0000 On 12/18/17 00:15, Hans Petter Selasky wrote: > On 12/18/17 05:29, Colin Percival wrote: >> Also, it breaks some work I have in progress for instrumenting SYSINITs. >> Would you mind moving the DEFINE_MUTEX line to occur immediately prior to >> the set_port_type function, rather than being placed inside it? > > I'll have a look at this later today. Your point is valid! On further examination, it looks like DEFINE_MUTEX is something used in Linux kernel code, and the way it works there does allow it to be used inside a function. Is it possible to change the linuxkpi code to make it safe? (It looks like our mutex initialization is considerably more complicated than what Linux does, so maybe not...?) I have a feeling that we probably don't want to end up in a position of "every time we import code from Linux, we need to grep for DEFINE_MUTEX and hoist all of them out of functions". -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-head@freebsd.org Mon Dec 18 23:35:16 2017 Return-Path: Delivered-To: svn-src-head@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 04D2CE9226E; Mon, 18 Dec 2017 23:35:16 +0000 (UTC) (envelope-from jhb@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 C639D76B5A; Mon, 18 Dec 2017 23:35:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBINZEYK071436; Mon, 18 Dec 2017 23:35:14 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBINZEo9071435; Mon, 18 Dec 2017 23:35:14 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712182335.vBINZEo9071435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 18 Dec 2017 23:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326953 - head/tests/sys/kern X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tests/sys/kern X-SVN-Commit-Revision: 326953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Dec 2017 23:35:16 -0000 Author: jhb Date: Mon Dec 18 23:35:14 2017 New Revision: 326953 URL: https://svnweb.freebsd.org/changeset/base/326953 Log: Catch up to r325719 which makes the kern.proc.pid sysctl "work" for zombies. Some of the ptrace tests need to wait for a child process to become a zombie before preceding. The parent process polls the child process via the kern.proc.pid sysctl to wait for it to become a zombie. Previously the code polled until the sysctl failed with ESRCH. Now it will poll until either the sysctl fails with ESRCH (for compatiblity with older kernels) or returns a kinfo_proc structure with the ki_stat field set to SZOMB. Reported by: Jenkins Tested by: markj Discussed with: mjg MFC after: 1 week Modified: head/tests/sys/kern/ptrace_test.c Modified: head/tests/sys/kern/ptrace_test.c ============================================================================== --- head/tests/sys/kern/ptrace_test.c Mon Dec 18 22:55:19 2017 (r326952) +++ head/tests/sys/kern/ptrace_test.c Mon Dec 18 23:35:14 2017 (r326953) @@ -104,6 +104,10 @@ wait_for_zombie(pid_t pid) /* * Wait for a process to exit. This is kind of gross, but * there is not a better way. + * + * Prior to r325719, the kern.proc.pid. sysctl failed + * with ESRCH. After that change, a valid struct kinfo_proc + * is returned for zombies with ki_stat set to SZOMB. */ for (;;) { struct kinfo_proc kp; @@ -116,10 +120,11 @@ wait_for_zombie(pid_t pid) mib[3] = pid; len = sizeof(kp); if (sysctl(mib, nitems(mib), &kp, &len, NULL, 0) == -1) { - /* The KERN_PROC_PID sysctl fails for zombies. */ ATF_REQUIRE(errno == ESRCH); break; } + if (kp.ki_stat == SZOMB) + break; usleep(5000); } } From owner-svn-src-head@freebsd.org Tue Dec 19 00:18:18 2017 Return-Path: Delivered-To: svn-src-head@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 C1A2AE95346; Tue, 19 Dec 2017 00:18:18 +0000 (UTC) (envelope-from imp@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 99E6878A15; Tue, 19 Dec 2017 00:18:18 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ0IHhI089557; Tue, 19 Dec 2017 00:18:17 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ0IHn4089556; Tue, 19 Dec 2017 00:18:17 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190018.vBJ0IHn4089556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 00:18:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326954 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 326954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 00:18:18 -0000 Author: imp Date: Tue Dec 19 00:18:17 2017 New Revision: 326954 URL: https://svnweb.freebsd.org/changeset/base/326954 Log: Support more images (but still no geli) Print a qemu line to a shell script to ease testing each image Start to support multiple architectures (still very green) Create /etc/rc that echos success and halts the system for better automation (also include halt) Create /etc/fstab on a per-boot type to test loader's passing root to kernel. This lets me run a test, connect to it with telnet and get either a timeout, or a report of success. Sponsored by: Netflix Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Dec 18 23:35:14 2017 (r326953) +++ head/tools/boot/rootgen.sh Tue Dec 19 00:18:17 2017 (r326954) @@ -33,28 +33,41 @@ mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 - rm -f ${img} ${img}.p2 + cat > ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < ${src}/etc/fstab < $sh +# https://wiki.freebsd.org/arm64/QEMU also has +# -device virtio-net-device,netdev=net0 +# -netdev user,id=net0 +} + +# Amd64 qemu +qemu_amd64_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +qemu_amd64_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# arm +# nothing listed? + +# i386 +qemu_i386_legacy() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh +} + +# Not yet supported +qemu_i386_uefi() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# Needs UEFI to be supported +qemu_i386_both() +{ + img=$1 + sh=$2 + + echo "qemu-system-i386 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-i386 -bios ~/bios/OVMF-X32.fd --drive file=${img},format=raw ${qser}" > $sh +} + +# mips +# qemu-system-mips -kernel /path/to/rootfs/boot/kernel/kernel -nographic -hda /path/to/disk.img -m 2048 + +# Powerpc -- doesn't work but maybe it would enough for testing -- needs details +# powerpc64 +# qemu-system-ppc64 -drive file=/path/to/disk.img,format=raw + +# sparc64 +# 10.3 works, 12-current (which one?) hangs +# qemu-system-sparc64 -drive file=/path/to/disk.img,format=raw + + # Misc variables SRCTOP=$(make -v SRCTOP) cd ${SRCTOP}/stand @@ -188,27 +299,115 @@ echo -h -D -S115200 > ${DESTDIR}/boot.config cp /boot/device.hints ${DESTDIR}/boot/device.hints # Assume we're already built make install DESTDIR=${DESTDIR} MK_MAN=no MK_INSTALL_AS_USER=yes -# Copy init, /bin/sh and minimal libraries -mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin ${DESTDIR}/lib ${DESTDIR}/libexec -for f in /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do +# Copy init, /bin/sh, minimal libraries and testing /etc/rc +mkdir -p ${DESTDIR}/sbin ${DESTDIR}/bin \ + ${DESTDIR}/lib ${DESTDIR}/libexec \ + ${DESTDIR}/etc ${DESTDIR}/dev +for f in /sbin/halt /sbin/init /bin/sh $(ldd /bin/sh | awk 'NF == 4 { print $3; }') /libexec/ld-elf.so.1; do cp $f ${DESTDIR}/$f done -mkdir ${DESTDIR}/dev +cat > ${DESTDIR}/etc/rc < Delivered-To: svn-src-head@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 33B9CEA31A5; Tue, 19 Dec 2017 02:49:13 +0000 (UTC) (envelope-from cem@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 031DE7F614; Tue, 19 Dec 2017 02:49:12 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ2nCvm052967; Tue, 19 Dec 2017 02:49:12 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ2nCeO052965; Tue, 19 Dec 2017 02:49:12 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201712190249.vBJ2nCeO052965@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 19 Dec 2017 02:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326956 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 326956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 02:49:13 -0000 Author: cem Date: Tue Dec 19 02:49:11 2017 New Revision: 326956 URL: https://svnweb.freebsd.org/changeset/base/326956 Log: Implement ACPI CPU support when Processor object is not present By the ACPI standard (ACPI 5 chapter 8.4 Declaring Processors) Processors can be implemented in 2 distinct ways: * Through a Processor object type (which provides P_BLK) * Through a Device object type Prior to this change, the FreeBSD driver only supported the former. AMD Epyc / Poweredge systems we are testing both implement the latter only. Add the missing support. Because P_BLK is not defined in the device object case, C-states entering must be completely controlled via _CST methods rather than P_LVL2/3. John Baldwin points out that ACPI 6.0 formally deprecates the Processor keyword, so eventually processors will only be enumerated as Device objects. Submitted by: attilio Reviewed by: jhb, markj, Anton Rang Relnotes: maybe Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13457 Modified: head/sys/dev/acpica/acpi_cpu.c Modified: head/sys/dev/acpica/acpi_cpu.c ============================================================================== --- head/sys/dev/acpica/acpi_cpu.c Tue Dec 19 01:02:58 2017 (r326955) +++ head/sys/dev/acpica/acpi_cpu.c Tue Dec 19 02:49:11 2017 (r326956) @@ -140,6 +140,8 @@ struct acpi_cpu_device { #define CST_FFH_MWAIT_HW_COORD 0x0001 #define CST_FFH_MWAIT_BM_AVOID 0x0002 +#define CPUDEV_DEVICE_ID "ACPI0007" + /* Allow users to ignore processor orders in MADT. */ static int cpu_unordered; SYSCTL_INT(_debug_acpi, OID_AUTO, cpu_unordered, CTLFLAG_RDTUN, @@ -236,44 +238,61 @@ MODULE_DEPEND(cpu, acpi, 1, 1, 1); static int acpi_cpu_probe(device_t dev) { + static char *cpudev_ids[] = { CPUDEV_DEVICE_ID, NULL }; int acpi_id, cpu_id; ACPI_BUFFER buf; ACPI_HANDLE handle; ACPI_OBJECT *obj; ACPI_STATUS status; + ACPI_OBJECT_TYPE type; - if (acpi_disabled("cpu") || acpi_get_type(dev) != ACPI_TYPE_PROCESSOR || - acpi_cpu_disabled) + if (acpi_disabled("cpu") || acpi_cpu_disabled) return (ENXIO); + type = acpi_get_type(dev); + if (type != ACPI_TYPE_PROCESSOR && type != ACPI_TYPE_DEVICE) + return (ENXIO); + if (type == ACPI_TYPE_DEVICE && + ACPI_ID_PROBE(device_get_parent(dev), dev, cpudev_ids) == NULL) + return (ENXIO); handle = acpi_get_handle(dev); if (cpu_softc == NULL) cpu_softc = malloc(sizeof(struct acpi_cpu_softc *) * (mp_maxid + 1), M_TEMP /* XXX */, M_WAITOK | M_ZERO); - /* Get our Processor object. */ - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObject(handle, NULL, NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "probe failed to get Processor obj - %s\n", - AcpiFormatException(status)); - return (ENXIO); - } - obj = (ACPI_OBJECT *)buf.Pointer; - if (obj->Type != ACPI_TYPE_PROCESSOR) { - device_printf(dev, "Processor object has bad type %d\n", obj->Type); + if (type == ACPI_TYPE_PROCESSOR) { + /* Get our Processor object. */ + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObject(handle, NULL, NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "probe failed to get Processor obj - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + obj = (ACPI_OBJECT *)buf.Pointer; + if (obj->Type != ACPI_TYPE_PROCESSOR) { + device_printf(dev, "Processor object has bad type %d\n", + obj->Type); + AcpiOsFree(obj); + return (ENXIO); + } + + /* + * Find the processor associated with our unit. We could use the + * ProcId as a key, however, some boxes do not have the same values + * in their Processor object as the ProcId values in the MADT. + */ + acpi_id = obj->Processor.ProcId; AcpiOsFree(obj); - return (ENXIO); + } else { + status = acpi_GetInteger(handle, "_UID", &acpi_id); + if (ACPI_FAILURE(status)) { + device_printf(dev, "Device object has bad value - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } } - - /* - * Find the processor associated with our unit. We could use the - * ProcId as a key, however, some boxes do not have the same values - * in their Processor object as the ProcId values in the MADT. - */ - acpi_id = obj->Processor.ProcId; - AcpiOsFree(obj); if (acpi_pcpu_get_id(dev, &acpi_id, &cpu_id) != 0) return (ENXIO); @@ -325,19 +344,32 @@ acpi_cpu_attach(device_t dev) cpu_smi_cmd = AcpiGbl_FADT.SmiCommand; cpu_cst_cnt = AcpiGbl_FADT.CstControl; - buf.Pointer = NULL; - buf.Length = ACPI_ALLOCATE_BUFFER; - status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf); - if (ACPI_FAILURE(status)) { - device_printf(dev, "attach failed to get Processor obj - %s\n", - AcpiFormatException(status)); - return (ENXIO); + if (acpi_get_type(dev) == ACPI_TYPE_PROCESSOR) { + buf.Pointer = NULL; + buf.Length = ACPI_ALLOCATE_BUFFER; + status = AcpiEvaluateObject(sc->cpu_handle, NULL, NULL, &buf); + if (ACPI_FAILURE(status)) { + device_printf(dev, "attach failed to get Processor obj - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + obj = (ACPI_OBJECT *)buf.Pointer; + sc->cpu_p_blk = obj->Processor.PblkAddress; + sc->cpu_p_blk_len = obj->Processor.PblkLength; + sc->cpu_acpi_id = obj->Processor.ProcId; + AcpiOsFree(obj); + } else { + KASSERT(acpi_get_type(dev) == ACPI_TYPE_DEVICE, + ("Unexpected ACPI object")); + status = acpi_GetInteger(sc->cpu_handle, "_UID", &sc->cpu_acpi_id); + if (ACPI_FAILURE(status)) { + device_printf(dev, "Device object has bad value - %s\n", + AcpiFormatException(status)); + return (ENXIO); + } + sc->cpu_p_blk = 0; + sc->cpu_p_blk_len = 0; } - obj = (ACPI_OBJECT *)buf.Pointer; - sc->cpu_p_blk = obj->Processor.PblkAddress; - sc->cpu_p_blk_len = obj->Processor.PblkLength; - sc->cpu_acpi_id = obj->Processor.ProcId; - AcpiOsFree(obj); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "acpi_cpu%d: P_BLK at %#x/%d\n", device_get_unit(dev), sc->cpu_p_blk, sc->cpu_p_blk_len)); From owner-svn-src-head@freebsd.org Tue Dec 19 03:15:21 2017 Return-Path: Delivered-To: svn-src-head@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 C7FC3EA54E9; Tue, 19 Dec 2017 03:15:21 +0000 (UTC) (envelope-from emaste@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 9459D1108; Tue, 19 Dec 2017 03:15:21 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ3FKvC065936; Tue, 19 Dec 2017 03:15:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ3FKWo065935; Tue, 19 Dec 2017 03:15:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712190315.vBJ3FKWo065935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Dec 2017 03:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326957 - head/contrib/llvm/tools/lld/ELF X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/contrib/llvm/tools/lld/ELF X-SVN-Commit-Revision: 326957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 03:15:21 -0000 Author: emaste Date: Tue Dec 19 03:15:20 2017 New Revision: 326957 URL: https://svnweb.freebsd.org/changeset/base/326957 Log: lld: Don't write preemptible symbol values to the .got. It is not necessary and matches what bfd and gold do. This was a regression from [LLVM] r315658. Obtained from: LLVM r321023 by Rafael Espíndola Modified: head/contrib/llvm/tools/lld/ELF/Relocations.cpp Modified: head/contrib/llvm/tools/lld/ELF/Relocations.cpp ============================================================================== --- head/contrib/llvm/tools/lld/ELF/Relocations.cpp Tue Dec 19 02:49:11 2017 (r326956) +++ head/contrib/llvm/tools/lld/ELF/Relocations.cpp Tue Dec 19 03:15:20 2017 (r326957) @@ -812,7 +812,7 @@ static void addGotEntry(SymbolBody &Sym, bool Preempti // // This is ugly -- the difference between REL and RELA should be // handled in a better way. It's a TODO. - if (!Config->IsRela) + if (!Config->IsRela && !Preemptible) InX::Got->Relocations.push_back({R_ABS, Target->GotRel, Off, 0, &Sym}); } } From owner-svn-src-head@freebsd.org Tue Dec 19 03:35:41 2017 Return-Path: Delivered-To: svn-src-head@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 024B2E8086C; Tue, 19 Dec 2017 03:35:41 +0000 (UTC) (envelope-from eadler@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 BD0C01DA1; Tue, 19 Dec 2017 03:35:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ3ZdSK074200; Tue, 19 Dec 2017 03:35:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ3ZduV074199; Tue, 19 Dec 2017 03:35:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712190335.vBJ3ZduV074199@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Dec 2017 03:35:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326958 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 326958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 03:35:41 -0000 Author: eadler Date: Tue Dec 19 03:35:39 2017 New Revision: 326958 URL: https://svnweb.freebsd.org/changeset/base/326958 Log: arclint: revert in prep for recommitting Modified: head/.arclint Modified: head/.arclint ============================================================================== --- head/.arclint Tue Dec 19 03:15:20 2017 (r326957) +++ head/.arclint Tue Dec 19 03:35:39 2017 (r326958) @@ -9,8 +9,7 @@ "type": "spelling" }, "chmod": { - "type": "chmod", - "exclude": "(/tests/)" + "type": "chmod" }, "merge-conflict": { "type": "merge-conflict" @@ -24,4 +23,3 @@ } } } - From owner-svn-src-head@freebsd.org Tue Dec 19 03:38:07 2017 Return-Path: Delivered-To: svn-src-head@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 C157EE80AF9; Tue, 19 Dec 2017 03:38:07 +0000 (UTC) (envelope-from eadler@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 8ED631FFF; Tue, 19 Dec 2017 03:38:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ3c6SU074328; Tue, 19 Dec 2017 03:38:06 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ3c6E1074327; Tue, 19 Dec 2017 03:38:06 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712190338.vBJ3c6E1074327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Dec 2017 03:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326959 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 326959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 03:38:07 -0000 Author: eadler Date: Tue Dec 19 03:38:06 2017 New Revision: 326959 URL: https://svnweb.freebsd.org/changeset/base/326959 Log: arc lint: ignore /tests/ in chmod shell scripts in scripts don't need to be chmod +x to work. In fact most are not. Of the tests I found from a simple search: 65 are chmod +x 84 are chmod -x simply disable the check for test shell scripts. Recommit requested by: cem, rgrimes Modified: head/.arclint Modified: head/.arclint ============================================================================== --- head/.arclint Tue Dec 19 03:35:39 2017 (r326958) +++ head/.arclint Tue Dec 19 03:38:06 2017 (r326959) @@ -9,7 +9,8 @@ "type": "spelling" }, "chmod": { - "type": "chmod" + "type": "chmod", + "exclude": "(/tests/)" }, "merge-conflict": { "type": "merge-conflict" From owner-svn-src-head@freebsd.org Tue Dec 19 03:51:38 2017 Return-Path: Delivered-To: svn-src-head@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 A0721E81875; Tue, 19 Dec 2017 03:51:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1A32898; Tue, 19 Dec 2017 03:51:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBJ3pZpp019471; Mon, 18 Dec 2017 19:51:35 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBJ3pZTV019470; Mon, 18 Dec 2017 19:51:35 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712190351.vBJ3pZTV019470@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326958 - head In-Reply-To: <201712190335.vBJ3ZduV074199@repo.freebsd.org> To: Eitan Adler Date: Mon, 18 Dec 2017 19:51:35 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 03:51:38 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: eadler > Date: Tue Dec 19 03:35:39 2017 > New Revision: 326958 > URL: https://svnweb.freebsd.org/changeset/base/326958 > > Log: > arclint: revert in prep for recommitting When you revert you need to sight the Rxxxxx(s) being reverted. > > Modified: > head/.arclint > > Modified: head/.arclint > ============================================================================== > --- head/.arclint Tue Dec 19 03:15:20 2017 (r326957) > +++ head/.arclint Tue Dec 19 03:35:39 2017 (r326958) > @@ -9,8 +9,7 @@ > "type": "spelling" > }, > "chmod": { > - "type": "chmod", > - "exclude": "(/tests/)" > + "type": "chmod" > }, > "merge-conflict": { > "type": "merge-conflict" > @@ -24,4 +23,3 @@ > } > } > } > - > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Dec 19 03:56:02 2017 Return-Path: Delivered-To: svn-src-head@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 E6977E81DD6 for ; Tue, 19 Dec 2017 03:56:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22a.google.com (mail-yb0-x22a.google.com [IPv6:2607:f8b0:4002:c09::22a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9CC722DA5 for ; Tue, 19 Dec 2017 03:56:02 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22a.google.com with SMTP id r4so12688267ybd.12 for ; Mon, 18 Dec 2017 19:56:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=s6CrpRw+04f6KGfuCaurICPLPmGy0ZD3jLy/rue5LpA=; b=m5XukONcPcZMV/AKV1EfRwrB8WdrODc3jZcMuKws43T06zbq5RIxaAUmoiqR5CBqZc sgbFJ0dohWflWeFNtWkpDV1UgOj8HuzH+S5jK5v1pTTfTpn3jOtTZdYM3PBiszm+eQFk +Il4+wBZzQAqLQ11uJZX4Ybx3207GeYPJx3cM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=s6CrpRw+04f6KGfuCaurICPLPmGy0ZD3jLy/rue5LpA=; b=ChPKp0PhdNeD5xStqVPd23ZiY0KQW/9FnqnGxxjZYDjQQZ02Bi+ls9kLcSY4z03Som RtcOmW13n5mUWv5nUo+ConLOAQumVhwt/TDqEzvaIpsEorxssvHaZC4Gu9U+6ANcBXzy Rqjpxpd2wDKWuxaSNPXfsUJ77Afctl621NwJPRAPPtzmdhFlpjcY09jW/Qw7yDUSTFyV b+AhLPiDn9OTjwxh6J2GYKzjdQlhTG6jWokLih4kHa0WOZsT8XC8Xj5pvSzfEpXyEc4C sfDnORRWQH/vm4PCdy9G+EKjDdnfuO89cY1HHOBvi9XneFMx4Zwu/c/j2qdfZA2dkdrc A52Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=s6CrpRw+04f6KGfuCaurICPLPmGy0ZD3jLy/rue5LpA=; b=lTUSFcjhhgF2LkP0eihqWePhwM6RU0diw/tt6p5jRhmaTq2KKQeYTEF0DldHgsOa7B zXJfmb2Bpa0bB9Gn569T4LvwFBR+vW0SobSbC1OrPOTFqSAiFOfbob9zoFfqMiht/kPB yeRRfmB8baVrs4Mk4LjMkrZzLQPp+B/F2ZTWeNB7X06V4L9jWPwXlIHOM17FLQ8/drmW 6Yviy7uDFsCIgpNiPYbEW7/tRIPwZpD6knTWIqY9Dm7XxYyRIkX5XYUIybkpZRQDYP5j 17hkNbUojjXCKXy/667bfEjZfLUPmSCXtS2sVDJkMi+NyaA08bE399A4eYpQLal/Cuvm fQUQ== X-Gm-Message-State: AKGB3mKR7VLBYaOSMNIdGqO9bIEMNi41mwc9kiuiOUy9Pzd2teRr1xi0 hxNFFrDmjTDwRhRDwuOdlXH6Vql/kKVCakw+W+tNEw== X-Google-Smtp-Source: ACJfBovrlzEg2UzRA5GsLYp8Ux9JTmpc1PDWczmzHRVrnjhis2ZpWDjbE7h/XxfcOBofLn6i0vmM+ksISn5SpjrFkHE= X-Received: by 10.129.71.212 with SMTP id u203mr1511923ywa.6.1513655761603; Mon, 18 Dec 2017 19:56:01 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.37.15.66 with HTTP; Mon, 18 Dec 2017 19:55:31 -0800 (PST) In-Reply-To: <201712190351.vBJ3pZTV019470@pdx.rh.CN85.dnsmgr.net> References: <201712190335.vBJ3ZduV074199@repo.freebsd.org> <201712190351.vBJ3pZTV019470@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Mon, 18 Dec 2017 19:55:31 -0800 X-Google-Sender-Auth: uQsNj9oGtOL4lIILS2pn1JfytfM Message-ID: Subject: Re: svn commit: r326958 - head To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 03:56:03 -0000 I give up. Not touching this anymore. If you feel like fixing it do it. On 18 December 2017 at 19:51, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: eadler >> Date: Tue Dec 19 03:35:39 2017 >> New Revision: 326958 >> URL: https://svnweb.freebsd.org/changeset/base/326958 >> >> Log: >> arclint: revert in prep for recommitting > > When you revert you need to sight the Rxxxxx(s) being reverted. > >> >> Modified: >> head/.arclint >> >> Modified: head/.arclint >> ============================================================================== >> --- head/.arclint Tue Dec 19 03:15:20 2017 (r326957) >> +++ head/.arclint Tue Dec 19 03:35:39 2017 (r326958) >> @@ -9,8 +9,7 @@ >> "type": "spelling" >> }, >> "chmod": { >> - "type": "chmod", >> - "exclude": "(/tests/)" >> + "type": "chmod" >> }, >> "merge-conflict": { >> "type": "merge-conflict" >> @@ -24,4 +23,3 @@ >> } >> } >> } >> - >> >> > > -- > Rod Grimes rgrimes@freebsd.org > -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-head@freebsd.org Tue Dec 19 04:05:45 2017 Return-Path: Delivered-To: svn-src-head@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 14A20E82770; Tue, 19 Dec 2017 04:05:45 +0000 (UTC) (envelope-from imp@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 D65693389; Tue, 19 Dec 2017 04:05:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ45hMd086848; Tue, 19 Dec 2017 04:05:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ45hAn086847; Tue, 19 Dec 2017 04:05:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190405.vBJ45hAn086847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 04:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326960 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 326960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:05:45 -0000 Author: imp Date: Tue Dec 19 04:05:43 2017 New Revision: 326960 URL: https://svnweb.freebsd.org/changeset/base/326960 Log: Simplify things a little. The RETURN macro isn't required. It's only used once, inside an #ifdef where it would be defined to be return. Sponsored by: Netflix Modified: head/stand/common/interp.c Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Tue Dec 19 03:38:06 2017 (r326959) +++ head/stand/common/interp.c Tue Dec 19 04:05:43 2017 (r326960) @@ -39,11 +39,7 @@ __FBSDID("$FreeBSD$"); #ifdef BOOT_FORTH #include "ficl.h" -#define RETURN(x) stackPushINT(bf_vm->pStack,!x); return(x) - extern FICL_VM *bf_vm; -#else -#define RETURN(x) return(x) #endif #define MAXARGS 20 /* maximum number of arguments allowed */ @@ -51,12 +47,10 @@ extern FICL_VM *bf_vm; static void prompt(void); #ifndef BOOT_FORTH -static int perform(int argc, char *argv[]); - /* * Perform the command */ -int +static int perform(int argc, char *argv[]) { int result; @@ -82,7 +76,7 @@ perform(int argc, char *argv[]) } else { command_errmsg = "unknown command"; } - RETURN(result); + return(result); } #endif /* ! BOOT_FORTH */ From owner-svn-src-head@freebsd.org Tue Dec 19 04:05:57 2017 Return-Path: Delivered-To: svn-src-head@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 EB5CEE827EA; Tue, 19 Dec 2017 04:05:57 +0000 (UTC) (envelope-from imp@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 C326934C5; Tue, 19 Dec 2017 04:05:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ45u4b086918; Tue, 19 Dec 2017 04:05:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ45tiR086905; Tue, 19 Dec 2017 04:05:55 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190405.vBJ45tiR086905@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 04:05:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326961 - in head/stand: common efi/loader i386/loader mips/beri/loader ofw/common powerpc/kboot powerpc/ps3 sparc64/loader uboot/common userboot/userboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: common efi/loader i386/loader mips/beri/loader ofw/common powerpc/kboot powerpc/ps3 sparc64/loader uboot/common userboot/userboot X-SVN-Commit-Revision: 326961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:05:58 -0000 Author: imp Date: Tue Dec 19 04:05:55 2017 New Revision: 326961 URL: https://svnweb.freebsd.org/changeset/base/326961 Log: Interact is always called with NULL. Simplify code a little by removing this argument, and expanding when rc is NULL. This effectively completes the back out of custom scripts for tftp booted loaders from r269153 that was started in r292344 with the new path tricks that obsoleted it. Submitted by: Netflix Modified: head/stand/common/bootstrap.h head/stand/common/interp.c head/stand/common/interp_forth.c head/stand/efi/loader/main.c head/stand/i386/loader/main.c head/stand/mips/beri/loader/main.c head/stand/ofw/common/main.c head/stand/powerpc/kboot/main.c head/stand/powerpc/ps3/main.c head/stand/sparc64/loader/main.c head/stand/uboot/common/main.c head/stand/userboot/userboot/main.c Modified: head/stand/common/bootstrap.h ============================================================================== --- head/stand/common/bootstrap.h Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/common/bootstrap.h Tue Dec 19 04:05:55 2017 (r326961) @@ -45,7 +45,7 @@ extern char command_errbuf[COMMAND_ERRBUFSZ]; #define CMD_FATAL 4 /* interp.c */ -void interact(const char *rc); +void interact(void); int include(const char *filename); /* interp_backslash.c */ @@ -55,7 +55,7 @@ char *backslash(const char *str); int parse(int *argc, char ***argv, const char *str); /* interp_forth.c */ -void bf_init(const char *rc); +void bf_init(void); int bf_run(char *line); /* boot.c */ Modified: head/stand/common/interp.c ============================================================================== --- head/stand/common/interp.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/common/interp.c Tue Dec 19 04:05:55 2017 (r326961) @@ -84,7 +84,7 @@ perform(int argc, char *argv[]) * Interactive mode */ void -interact(const char *rc) +interact(void) { static char input[256]; /* big enough? */ #ifndef BOOT_FORTH @@ -93,14 +93,11 @@ interact(const char *rc) #endif #ifdef BOOT_FORTH - bf_init((rc) ? "" : NULL); + bf_init(); #endif - if (rc == NULL) { - /* Read our default configuration. */ - include("/boot/loader.rc"); - } else if (*rc != '\0') - include(rc); + /* Read our default configuration. */ + include("/boot/loader.rc"); printf("\n"); Modified: head/stand/common/interp_forth.c ============================================================================== --- head/stand/common/interp_forth.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/common/interp_forth.c Tue Dec 19 04:05:55 2017 (r326961) @@ -250,7 +250,7 @@ bf_command(FICL_VM *vm) * Initialise the Forth interpreter, create all our commands as words. */ void -bf_init(const char *rc) +bf_init(void) { struct bootblk_command **cmdp; char create_buf[41]; /* 31 characters-long builtins */ @@ -280,14 +280,9 @@ bf_init(const char *rc) ficlSetEnv(bf_sys, "loader_version", bootprog_rev); /* try to load and run init file if present */ - if (rc == NULL) - rc = "/boot/boot.4th"; - if (*rc != '\0') { - fd = open(rc, O_RDONLY); - if (fd != -1) { - (void)ficlExecFD(bf_vm, fd); - close(fd); - } + if ((fd = open("/boot/boot.4th", O_RDONLY)) != -1) { + (void)ficlExecFD(bf_vm, fd); + close(fd); } } Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/efi/loader/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -501,7 +501,7 @@ main(int argc, CHAR16 *argv[]) #endif } - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ return (EFI_SUCCESS); /* keep compiler happy */ } Modified: head/stand/i386/loader/main.c ============================================================================== --- head/stand/i386/loader/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/i386/loader/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -232,7 +232,7 @@ main(void) bios_getsmap(); - interact(NULL); + interact(); /* if we ever get here, it is an error */ return (1); Modified: head/stand/mips/beri/loader/main.c ============================================================================== --- head/stand/mips/beri/loader/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/mips/beri/loader/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -149,7 +149,7 @@ main(int argc, char *argv[], char *envv[], struct boot printf("bootpath=\"%s\"\n", bootpath); #endif - interact(NULL); + interact(); return (0); } Modified: head/stand/ofw/common/main.c ============================================================================== --- head/stand/ofw/common/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/ofw/common/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -157,7 +157,7 @@ main(int (*openfirm)(void *)) archsw.arch_readin = ofw_readin; archsw.arch_autoload = ofw_autoload; - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ OF_exit(); Modified: head/stand/powerpc/kboot/main.c ============================================================================== --- head/stand/powerpc/kboot/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/powerpc/kboot/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -122,7 +122,7 @@ main(int argc, const char **argv) setenv("loaddev", bootdev, 1); setenv("LINES", "24", 1); - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ return (0); } Modified: head/stand/powerpc/ps3/main.c ============================================================================== --- head/stand/powerpc/ps3/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/powerpc/ps3/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -140,7 +140,7 @@ main(void) setenv("LINES", "24", 1); setenv("hw.platform", "ps3", 1); - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ return (0); } Modified: head/stand/sparc64/loader/main.c ============================================================================== --- head/stand/sparc64/loader/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/sparc64/loader/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -902,7 +902,7 @@ main(int (*openfirm)(void *)) printf("bootpath=\"%s\"\n", bootpath); /* Give control to the machine independent loader code. */ - interact(NULL); + interact(); return (1); } Modified: head/stand/uboot/common/main.c ============================================================================== --- head/stand/uboot/common/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/uboot/common/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -500,7 +500,7 @@ main(int argc, char **argv) archsw.arch_readin = uboot_readin; archsw.arch_autoload = uboot_autoload; - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ return (0); } Modified: head/stand/userboot/userboot/main.c ============================================================================== --- head/stand/userboot/userboot/main.c Tue Dec 19 04:05:43 2017 (r326960) +++ head/stand/userboot/userboot/main.c Tue Dec 19 04:05:55 2017 (r326961) @@ -142,7 +142,7 @@ loader_main(struct loader_callbacks *cb, void *arg, in if (setjmp(jb)) return; - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ exit(0); } From owner-svn-src-head@freebsd.org Tue Dec 19 04:06:03 2017 Return-Path: Delivered-To: svn-src-head@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 E0DAEE8282D; Tue, 19 Dec 2017 04:06:03 +0000 (UTC) (envelope-from imp@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 B479A3504; Tue, 19 Dec 2017 04:06:03 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ462E5086980; Tue, 19 Dec 2017 04:06:02 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ462Qa086972; Tue, 19 Dec 2017 04:06:02 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190406.vBJ462Qa086972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 04:06:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326962 - in head/stand/i386: . boot2 gptboot libfirewire libi386 loader zfsboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand/i386: . boot2 gptboot libfirewire libi386 loader zfsboot X-SVN-Commit-Revision: 326962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:06:04 -0000 Author: imp Date: Tue Dec 19 04:06:02 2017 New Revision: 326962 URL: https://svnweb.freebsd.org/changeset/base/326962 Log: Hoist btx include stuff to i386/Makefile.inc Sponsored by: Netflix Modified: head/stand/i386/Makefile.inc head/stand/i386/boot2/Makefile head/stand/i386/gptboot/Makefile head/stand/i386/libfirewire/Makefile head/stand/i386/libi386/Makefile head/stand/i386/loader/Makefile head/stand/i386/zfsboot/Makefile Modified: head/stand/i386/Makefile.inc ============================================================================== --- head/stand/i386/Makefile.inc Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/Makefile.inc Tue Dec 19 04:06:02 2017 (r326962) @@ -14,6 +14,8 @@ BTXCRT= ${BTXDIR}/lib/crt0.o BTXSRC= ${BOOTSRC}/i386/btx BTXLIB= ${BTXSRC}/lib +CFLAGS+= -I${BTXLIB} + # compact binary with no padding between text, data, bss LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript # LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/boot2/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -31,7 +31,6 @@ CFLAGS+=-fomit-frame-pointer \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ - -I${BTXLIB} \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ Modified: head/stand/i386/gptboot/Makefile ============================================================================== --- head/stand/i386/gptboot/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/gptboot/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -33,7 +33,6 @@ CFLAGS+=-DBOOTPROG=\"gptboot\" \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ -I${LDRSRC} \ -I${BOOTSRC}/i386/common \ - -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ Modified: head/stand/i386/libfirewire/Makefile ============================================================================== --- head/stand/i386/libfirewire/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/libfirewire/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -12,7 +12,6 @@ SRCS+= dcons.c fwcrom.c CFLAGS+= -D_BOOT CFLAGS+= -I${LDRSRC} -CFLAGS+= -I${BTXLIB} CFLAGS+= -I${BOOTSRC}/i386/libi386 CFLAGS+= -Wformat -Wall Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/libi386/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -47,7 +47,6 @@ CFLAGS+= -Dalloca=__builtin_alloca CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ -I${LDRSRC} -I${BOOTSRC}/i386/common \ - -I${BTXLIB} \ -I${SYSDIR}/contrib/dev/acpica/include # Handle FreeBSD specific %b and %D printf format specifiers Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/loader/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -56,9 +56,6 @@ LDFLAGS+= -static -Ttext 0x0 LIBI386= ${BOOTOBJ}/i386/libi386/libi386.a CFLAGS+= -I${BOOTSRC}/i386 -# BTX components -CFLAGS+= -I${BTXLIB} - # Debug me! #CFLAGS+= -g #LDFLAGS+= -g Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Tue Dec 19 04:05:55 2017 (r326961) +++ head/stand/i386/zfsboot/Makefile Tue Dec 19 04:06:02 2017 (r326962) @@ -31,7 +31,6 @@ CFLAGS+=-DBOOTPROG=\"zfsboot\" \ -I${ZFSSRC} \ -I${SYSDIR}/crypto/skein \ -I${SYSDIR}/cddl/boot/zfs \ - -I${BTXLIB} \ -I${BOOTSRC}/i386/boot2 \ -Wall -Waggregate-return -Wbad-function-cast -Wno-cast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ From owner-svn-src-head@freebsd.org Tue Dec 19 04:06:10 2017 Return-Path: Delivered-To: svn-src-head@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 F29A2E8285C; Tue, 19 Dec 2017 04:06:09 +0000 (UTC) (envelope-from imp@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 600E235D3; Tue, 19 Dec 2017 04:06:08 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ467qu087033; Tue, 19 Dec 2017 04:06:07 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ467Ir087032; Tue, 19 Dec 2017 04:06:07 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190406.vBJ467Ir087032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 04:06:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326963 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 326963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:06:11 -0000 Author: imp Date: Tue Dec 19 04:06:07 2017 New Revision: 326963 URL: https://svnweb.freebsd.org/changeset/base/326963 Log: No need to use relative paths like this here. Sponsored by: Netflix Modified: head/stand/i386/libi386/multiboot.c Modified: head/stand/i386/libi386/multiboot.c ============================================================================== --- head/stand/i386/libi386/multiboot.c Tue Dec 19 04:06:02 2017 (r326962) +++ head/stand/i386/libi386/multiboot.c Tue Dec 19 04:06:07 2017 (r326963) @@ -49,8 +49,8 @@ __FBSDID("$FreeBSD$"); #include "bootstrap.h" #include "multiboot.h" -#include "../i386/libi386/libi386.h" -#include "../i386/btx/lib/btxv86.h" +#include "libi386.h" +#include #define MULTIBOOT_SUPPORTED_FLAGS \ (MULTIBOOT_PAGE_ALIGN|MULTIBOOT_MEMORY_INFO) From owner-svn-src-head@freebsd.org Tue Dec 19 04:13:23 2017 Return-Path: Delivered-To: svn-src-head@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 58656E832B7; Tue, 19 Dec 2017 04:13:23 +0000 (UTC) (envelope-from imp@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 2FDD43D9B; Tue, 19 Dec 2017 04:13:23 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ4DMK7090983; Tue, 19 Dec 2017 04:13:22 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ4DMY9090982; Tue, 19 Dec 2017 04:13:22 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712190413.vBJ4DMY9090982@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Dec 2017 04:13:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326964 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 326964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:13:23 -0000 Author: imp Date: Tue Dec 19 04:13:22 2017 New Revision: 326964 URL: https://svnweb.freebsd.org/changeset/base/326964 Log: When doing a dump, the scheduler is normally not running, so this changed worked to capture dumps for me. However, the test for SCHEDULER_STOPPED() isn't right. We can also call the dump routine from ddb, in which case the scheduler is still running. This leads to an assertion panic that we're sleeping when we shouldn't. Instead, use the proper test for dumping or not. This brings us in line with other places that do special things while we're doing polled I/O like this. Noticed by: pho@ Differential Revision: https://reviews.freebsd.org/D13531 Modified: head/sys/cam/cam_periph.c Modified: head/sys/cam/cam_periph.c ============================================================================== --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 (r326963) +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 (r326964) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, struct bintime *starttime; struct bintime ltime; int error; - bool sched_stopped; + bool must_poll; struct mtx *periph_mtx; struct cam_periph *periph; uint32_t timeout = 1; @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, devstat_start_transaction(ds, starttime); } - sched_stopped = SCHEDULER_STOPPED(); + /* + * We must poll the I/O while we're dumping. The scheduler is normally + * stopped for dumping, except when we call doadump from ddb. While the + * scheduler is running in this case, we still need to poll the I/O to + * avoid sleeping waiting for the ccb to complete. + */ + must_poll = dumping; ccb->ccb_h.cbfcnp = cam_periph_done; periph = xpt_path_periph(ccb->ccb_h.path); periph_mtx = cam_periph_mtx(periph); @@ -1193,7 +1200,7 @@ cam_periph_runccb(union ccb *ccb, * cam_periph_error can reschedule the ccb by calling xpt_action and returning * ERESTART, so we have to effect the polling in the do loop below. */ - if (sched_stopped) { + if (must_poll) { mtx_unlock(periph_mtx); timeout = xpt_poll_setup(ccb); } @@ -1204,11 +1211,11 @@ cam_periph_runccb(union ccb *ccb, } else { xpt_action(ccb); do { - if (!sched_stopped) - cam_periph_ccbwait(ccb); - else { + if (must_poll) { xpt_pollwait(ccb, timeout); timeout = ccb->ccb_h.timeout * 10; + } else { + cam_periph_ccbwait(ccb); } if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) error = 0; @@ -1220,7 +1227,7 @@ cam_periph_runccb(union ccb *ccb, } while (error == ERESTART); } - if (sched_stopped) + if (must_poll) mtx_lock(periph_mtx); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) { From owner-svn-src-head@freebsd.org Tue Dec 19 04:48:59 2017 Return-Path: Delivered-To: svn-src-head@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 4AD5DE85C04; Tue, 19 Dec 2017 04:48:59 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C72976455F; Tue, 19 Dec 2017 04:48:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id u62so1269782ita.2; Mon, 18 Dec 2017 20:48:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9S6QgmYSg8WwiZ2zaJWBUMImQIHjEEcDLyXHgcLUsPc=; b=q3tRWvNm30Vq2ZGCLyofMd05sfbi2aavW+yU5nHzL19gEljPxouG8PaI2EYVUZayEl QzlyGasSBW9FVVQ8TyM/BZ5Fsc/ca0EDKk/w5f/WRFxIvzU2rGlHR1z6yGhcmCeMj6Bq 6ykipmYWzx7/IuWTW/Ps6jk9vXZNFMjrYGuECeGZYm8dhtK/qjWvqE3rUgRpJhcCD658 rY6YdcWcf+XpPzZVIprjQ3yUFjF727PjEJnkBQLrTlt+3I6WgVny6SjnOpw6LRUYWQih +2SmFeaNV+ZNiwPw8esedASyPdXYhkllH5P2cJt2ECyqiMRswTzV+V+afjEUuxD7smLZ ACzg== X-Gm-Message-State: AKGB3mLNxq+vFTpUpSfcwS/YMf2iMYJBOLYK5LQ8lJZL4thVpQKUkHiw XNQAtw910fFZov4PWHnDNM7BA11w X-Google-Smtp-Source: ACJfBovgRjR2jNGD7+422gYCg0lO6qyn463+/Iuh4s8xlSA1T3ENDm+lQ/zUOtkEThv7Z4255zopPQ== X-Received: by 10.36.178.78 with SMTP id h14mr1597961iti.107.1513658503141; Mon, 18 Dec 2017 20:41:43 -0800 (PST) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com. [209.85.214.53]) by smtp.gmail.com with ESMTPSA id j204sm451473itj.37.2017.12.18.20.41.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Dec 2017 20:41:42 -0800 (PST) Received: by mail-it0-f53.google.com with SMTP id x28so1269778ita.0; Mon, 18 Dec 2017 20:41:41 -0800 (PST) X-Received: by 10.36.228.68 with SMTP id o65mr1805453ith.128.1513658501325; Mon, 18 Dec 2017 20:41:41 -0800 (PST) MIME-Version: 1.0 References: <201712190338.vBJ3c6E1074327@repo.freebsd.org> In-Reply-To: <201712190338.vBJ3c6E1074327@repo.freebsd.org> From: Conrad Meyer Date: Tue, 19 Dec 2017 04:41:30 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r326959 - head To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 04:48:59 -0000 Thanks for fixing it. Conrad On Mon, Dec 18, 2017 at 7:38 PM Eitan Adler wrote: > Author: eadler > Date: Tue Dec 19 03:38:06 2017 > New Revision: 326959 > URL: https://svnweb.freebsd.org/changeset/base/326959 > > Log: > arc lint: ignore /tests/ in chmod > > shell scripts in scripts don't need > to be chmod +x to work. In fact most are not. > Of the tests I found from a simple search: > 65 are chmod +x > 84 are chmod -x > > simply disable the check for test shell scripts. > > Recommit requested by: cem, rgrimes > > Modified: > head/.arclint > > Modified: head/.arclint > > ============================================================================== > --- head/.arclint Tue Dec 19 03:35:39 2017 (r326958) > +++ head/.arclint Tue Dec 19 03:38:06 2017 (r326959) > @@ -9,7 +9,8 @@ > "type": "spelling" > }, > "chmod": { > - "type": "chmod" > + "type": "chmod", > + "exclude": "(/tests/)" > }, > "merge-conflict": { > "type": "merge-conflict" > > From owner-svn-src-head@freebsd.org Tue Dec 19 09:59:22 2017 Return-Path: Delivered-To: svn-src-head@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 C8CF1E9BBFD; Tue, 19 Dec 2017 09:59:22 +0000 (UTC) (envelope-from kib@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 A0A1870AD5; Tue, 19 Dec 2017 09:59:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJ9xLPa033120; Tue, 19 Dec 2017 09:59:21 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJ9xKYY033111; Tue, 19 Dec 2017 09:59:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712190959.vBJ9xKYY033111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Dec 2017 09:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326971 - in head/sys: amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/include arm/include arm64/include i386/include mips/include powerpc/include riscv/include sparc64/include sys X-SVN-Commit-Revision: 326971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 09:59:22 -0000 Author: kib Date: Tue Dec 19 09:59:20 2017 New Revision: 326971 URL: https://svnweb.freebsd.org/changeset/base/326971 Log: Add atomic_load(9) and atomic_store(9) operations. They provide relaxed-ordered atomic access semantic. Due to the FreeBSD memory model, the operations are syntaxical wrappers around the volatile accesses. The volatile qualifier is used to ensure that the access not optimized out and in turn depends on the volatile semantic as implemented by supported compilers. The motivation for adding the operation is to help people coming from other systems or knowing the C11/C++ standards where atomics have special type and require use of the special access operations. It is still the case that FreeBSD requires plain load and stores of aligned integer types to be atomic. Suggested by: jhb Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Added: head/sys/sys/atomic_common.h (contents, props changed) Modified: head/sys/amd64/include/atomic.h head/sys/arm/include/atomic.h head/sys/arm64/include/atomic.h head/sys/i386/include/atomic.h head/sys/mips/include/atomic.h head/sys/powerpc/include/atomic.h head/sys/riscv/include/atomic.h head/sys/sparc64/include/atomic.h Modified: head/sys/amd64/include/atomic.h ============================================================================== --- head/sys/amd64/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/amd64/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -57,6 +57,8 @@ #define wmb() __asm __volatile("sfence;" : : : "memory") #define rmb() __asm __volatile("lfence;" : : : "memory") +#include + /* * Various simple operations on memory, each of which is atomic in the * presence of interrupts and multiple processors. Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/arm/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -41,6 +41,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #include #ifndef _KERNEL Modified: head/sys/arm64/include/atomic.h ============================================================================== --- head/sys/arm64/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/arm64/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -29,6 +29,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #define isb() __asm __volatile("isb" : : : "memory") /* Modified: head/sys/i386/include/atomic.h ============================================================================== --- head/sys/i386/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/i386/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -34,6 +34,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + #ifdef _KERNEL #include #include Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/mips/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -36,6 +36,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + /* * Note: All the 64-bit atomic operations are only atomic when running * in 64-bit mode. It is assumed that code compiled for n32 and n64 Modified: head/sys/powerpc/include/atomic.h ============================================================================== --- head/sys/powerpc/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/powerpc/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -38,6 +38,8 @@ #error this file needs sys/cdefs.h as a prerequisite #endif +#include + /* * The __ATOMIC_REL/ACQ() macros provide memory barriers only in conjunction * with the atomic lXarx/stXcx. sequences below. They are not exposed outside Modified: head/sys/riscv/include/atomic.h ============================================================================== --- head/sys/riscv/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/riscv/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -37,6 +37,8 @@ #ifndef _MACHINE_ATOMIC_H_ #define _MACHINE_ATOMIC_H_ +#include + #define fence() __asm __volatile("fence" ::: "memory"); #define mb() fence() #define rmb() fence() Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Tue Dec 19 09:58:41 2017 (r326970) +++ head/sys/sparc64/include/atomic.h Tue Dec 19 09:59:20 2017 (r326971) @@ -39,6 +39,8 @@ #define wmb() mb() #define rmb() mb() +#include + /* Userland needs different ASI's. */ #ifdef _KERNEL #define __ASI_ATOMIC ASI_N Added: head/sys/sys/atomic_common.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/sys/atomic_common.h Tue Dec 19 09:59:20 2017 (r326971) @@ -0,0 +1,73 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2017 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _SYS_ATOMIC_COMMON_H_ +#define _SYS_ATOMIC_COMMON_H_ + +#ifndef _MACHINE_ATOMIC_H_ +#error do not include this header, use machine/atomic.h +#endif + +#define atomic_load_char(p) (*(volatile u_char *)(p)) +#define atomic_load_short(p) (*(volatile u_short *)(p)) +#define atomic_load_int(p) (*(volatile u_int *)(p)) +#define atomic_load_long(p) (*(volatile u_long *)(p)) +#define atomic_load_ptr(p) (*(volatile uintptr_t*)(p)) +#define atomic_load_8(p) (*(volatile uint8_t *)(p)) +#define atomic_load_16(p) (*(volatile uint16_t *)(p)) +#define atomic_load_32(p) (*(volatile uint32_t *)(p)) +#ifdef _LP64 +#define atomic_load_64(p) (*(volatile uint64_t *)(p)) +#endif + +#define atomic_store_char(p, v) \ + (*(volatile u_char *)(p) = (u_char)(v)) +#define atomic_store_short(p, v) \ + (*(volatile u_short *)(p) = (u_short)(v)) +#define atomic_store_int(p, v) \ + (*(volatile u_int *)(p) = (u_int)(v)) +#define atomic_store_long(p, v) \ + (*(volatile u_long *)(p) = (u_long)(v)) +#define atomic_store_ptr(p, v) \ + (*(uintptr_t *)(p) = (uintptr_t)(v)) +#define atomic_store_8(p, v) \ + (*(volatile uint8_t *)(p) = (uint8_t)(v)) +#define atomic_store_16(p, v) \ + (*(volatile uint16_t *)(p) = (uint16_t)(v)) +#define atomic_store_32(p, v) \ + (*(volatile uint32_t *)(p) = (uint32_t)(v)) +#ifdef _LP64 +#define atomic_store_64(p, v) \ + (*(volatile uint64_t *)(p) = (uint64_t)(v)) +#endif + +#endif From owner-svn-src-head@freebsd.org Tue Dec 19 10:05:46 2017 Return-Path: Delivered-To: svn-src-head@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 A0B8DE9C57A; Tue, 19 Dec 2017 10:05:46 +0000 (UTC) (envelope-from kib@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 6CD9571123; Tue, 19 Dec 2017 10:05:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJA5jf7037300; Tue, 19 Dec 2017 10:05:45 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJA5jbQ037299; Tue, 19 Dec 2017 10:05:45 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712191005.vBJA5jbQ037299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Dec 2017 10:05:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326973 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 326973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 10:05:46 -0000 Author: kib Date: Tue Dec 19 10:05:45 2017 New Revision: 326973 URL: https://svnweb.freebsd.org/changeset/base/326973 Log: Use atomic_load(9) to read ppsinfo sequence numbers. In this case volatile qualifiers enusre that a compiler does not optimize the accesses out. Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Tue Dec 19 10:02:09 2017 (r326972) +++ head/sys/kern/kern_tc.c Tue Dec 19 10:05:45 2017 (r326973) @@ -1601,10 +1601,10 @@ pps_fetch(struct pps_fetch_args *fapi, struct pps_stat tv.tv_usec = fapi->timeout.tv_nsec / 1000; timo = tvtohz(&tv); } - aseq = pps->ppsinfo.assert_sequence; - cseq = pps->ppsinfo.clear_sequence; - while (aseq == pps->ppsinfo.assert_sequence && - cseq == pps->ppsinfo.clear_sequence) { + aseq = atomic_load_int(&pps->ppsinfo.assert_sequence); + cseq = atomic_load_int(&pps->ppsinfo.clear_sequence); + while (aseq == atomic_load_int(&pps->ppsinfo.assert_sequence) && + cseq == atomic_load_int(&pps->ppsinfo.clear_sequence)) { if (abi_aware(pps, 1) && pps->driver_mtx != NULL) { if (pps->flags & PPSFLAG_MTX_SPIN) { err = msleep_spin(pps, pps->driver_mtx, From owner-svn-src-head@freebsd.org Tue Dec 19 10:06:57 2017 Return-Path: Delivered-To: svn-src-head@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 2805FE9C6E9; Tue, 19 Dec 2017 10:06:57 +0000 (UTC) (envelope-from kib@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 E95E17128B; Tue, 19 Dec 2017 10:06:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJA6tqu037410; Tue, 19 Dec 2017 10:06:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJA6tEP037409; Tue, 19 Dec 2017 10:06:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712191006.vBJA6tEP037409@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Dec 2017 10:06:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326974 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 326974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 10:06:57 -0000 Author: kib Date: Tue Dec 19 10:06:55 2017 New Revision: 326974 URL: https://svnweb.freebsd.org/changeset/base/326974 Log: Perform all accesses to uma_reclaim_needed using atomic(9) KPI. Reviewed by: alc, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13534 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Tue Dec 19 10:05:45 2017 (r326973) +++ head/sys/vm/uma_core.c Tue Dec 19 10:06:55 2017 (r326974) @@ -3170,14 +3170,14 @@ uma_reclaim_worker(void *arg __unused) for (;;) { sx_xlock(&uma_drain_lock); - while (uma_reclaim_needed == 0) + while (atomic_load_int(&uma_reclaim_needed) == 0) sx_sleep(uma_reclaim, &uma_drain_lock, PVM, "umarcl", hz); sx_xunlock(&uma_drain_lock); EVENTHANDLER_INVOKE(vm_lowmem, VM_LOW_KMEM); sx_xlock(&uma_drain_lock); uma_reclaim_locked(true); - uma_reclaim_needed = 0; + atomic_store_int(&uma_reclaim_needed, 0); sx_xunlock(&uma_drain_lock); /* Don't fire more than once per-second. */ pause("umarclslp", hz); From owner-svn-src-head@freebsd.org Tue Dec 19 10:52:49 2017 Return-Path: Delivered-To: svn-src-head@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 6E47FE9F423; Tue, 19 Dec 2017 10:52:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (turbocat.net [IPv6:2a01:4f8:c17:6c4b::2]) (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 357CD72B41; Tue, 19 Dec 2017 10:52:49 +0000 (UTC) (envelope-from hps@selasky.org) Received: from hps2016.home.selasky.org (unknown [62.141.128.70]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id C12D52606D0; Tue, 19 Dec 2017 11:52:45 +0100 (CET) Subject: Re: svn commit: r325841 - in head/sys: conf dev/mlx4 dev/mlx4/mlx4_core dev/mlx4/mlx4_en dev/mlx4/mlx4_ib modules/mlx4 To: Colin Percival , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201711151114.vAFBEeUb015030@repo.freebsd.org> <0100016067e203d1-fa769584-f8a1-44f2-ac39-1572e8fff087-000000@email.amazonses.com> <6d9cacd6-0f98-54e0-86be-6f202f509b17@selasky.org> <010001606bd2747e-d97faaca-1910-41f5-a699-6d015315de9b-000000@email.amazonses.com> From: Hans Petter Selasky Message-ID: Date: Tue, 19 Dec 2017 11:49:57 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <010001606bd2747e-d97faaca-1910-41f5-a699-6d015315de9b-000000@email.amazonses.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 10:52:49 -0000 On 12/18/17 23:50, Colin Percival wrote: > On 12/18/17 00:15, Hans Petter Selasky wrote: >> On 12/18/17 05:29, Colin Percival wrote: >>> Also, it breaks some work I have in progress for instrumenting SYSINITs. >>> Would you mind moving the DEFINE_MUTEX line to occur immediately prior to >>> the set_port_type function, rather than being placed inside it? >> >> I'll have a look at this later today. Your point is valid! > > On further examination, it looks like DEFINE_MUTEX is something used in Linux > kernel code, and the way it works there does allow it to be used inside a > function. Is it possible to change the linuxkpi code to make it safe? (It > looks like our mutex initialization is considerably more complicated than > what Linux does, so maybe not...?) Hi, Can you explain what you mean by safe? DEFINE_MUTEX() is simply a wrapper for another SYSINIT. It has nothing to do with the function it is placed inside. > > I have a feeling that we probably don't want to end up in a position of > "every time we import code from Linux, we need to grep for DEFINE_MUTEX > and hoist all of them out of functions". > Can we continue this discussion here: https://reviews.freebsd.org/D13530 --HPS From owner-svn-src-head@freebsd.org Tue Dec 19 14:11:42 2017 Return-Path: Delivered-To: svn-src-head@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 957DBE85554; Tue, 19 Dec 2017 14:11:42 +0000 (UTC) (envelope-from kib@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 5FDE479F27; Tue, 19 Dec 2017 14:11:42 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJEBf9p038352; Tue, 19 Dec 2017 14:11:41 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJEBftt038351; Tue, 19 Dec 2017 14:11:41 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712191411.vBJEBftt038351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 19 Dec 2017 14:11:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326977 - head/sys/dev/mlx5/mlx5_en X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/dev/mlx5/mlx5_en X-SVN-Commit-Revision: 326977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 14:11:42 -0000 Author: kib Date: Tue Dec 19 14:11:41 2017 New Revision: 326977 URL: https://svnweb.freebsd.org/changeset/base/326977 Log: mlx5en: Avoid SFENCe on x86 The IA32 memory model guarantees that all writes are seen in the program order. Also, any access to the uncacheable memory flushes the store buffers. As the consequence, SFENCE instruction is (almost) never needed, in particular, it is not needed to ensure the correct order of updates as seen by a PCIe device. Use atomic_thread_fence_rel() instead of wb() to only emit compiler barriers on x86 there. Other architectures get the right barrier instruction as well. Reviewed by: hselasky Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Modified: head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c ============================================================================== --- head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Dec 19 11:44:24 2017 (r326976) +++ head/sys/dev/mlx5/mlx5_en/mlx5_en_rx.c Tue Dec 19 14:11:41 2017 (r326977) @@ -90,7 +90,7 @@ mlx5e_post_rx_wqes(struct mlx5e_rq *rq) } /* ensure wqes are visible to device before updating doorbell record */ - wmb(); + atomic_thread_fence_rel(); mlx5_wq_ll_update_db_record(&rq->wq); } @@ -436,7 +436,7 @@ wq_ll_pop: mlx5_cqwq_update_db_record(&rq->cq.wq); /* ensure cq space is freed before enabling more cqes */ - wmb(); + atomic_thread_fence_rel(); return (i); } From owner-svn-src-head@freebsd.org Tue Dec 19 15:50:47 2017 Return-Path: Delivered-To: svn-src-head@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 E7EFBE8B6E6; Tue, 19 Dec 2017 15:50:47 +0000 (UTC) (envelope-from nwhitehorn@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 B1CCC7E175; Tue, 19 Dec 2017 15:50:47 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJFokQ3080422; Tue, 19 Dec 2017 15:50:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJFokHx080421; Tue, 19 Dec 2017 15:50:46 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712191550.vBJFokHx080421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 19 Dec 2017 15:50:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326978 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 326978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 15:50:48 -0000 Author: nwhitehorn Date: Tue Dec 19 15:50:46 2017 New Revision: 326978 URL: https://svnweb.freebsd.org/changeset/base/326978 Log: Make __startkernel line up with KERNBASE, so that the math to compute the applied relocation offset in link_elf.c works as intended. We may want to revisit how that works in future, for example by having elf_reloc_self() actually store the numbers it is using rather than computing them later, but this fixes symbol lookup after r326203. Reported by: andreast@ Pointy hat to: me Modified: head/sys/conf/ldscript.powerpc64 Modified: head/sys/conf/ldscript.powerpc64 ============================================================================== --- head/sys/conf/ldscript.powerpc64 Tue Dec 19 14:11:41 2017 (r326977) +++ head/sys/conf/ldscript.powerpc64 Tue Dec 19 15:50:46 2017 (r326978) @@ -11,7 +11,7 @@ SECTIONS /* Read-only sections, merged into text segment: */ . = kernbase; - PROVIDE (begin = . - SIZEOF_HEADERS); + PROVIDE (begin = .); .text : { From owner-svn-src-head@freebsd.org Tue Dec 19 16:45:42 2017 Return-Path: Delivered-To: svn-src-head@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 519B2E8F35B; Tue, 19 Dec 2017 16:45:42 +0000 (UTC) (envelope-from nwhitehorn@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 1915180C47; Tue, 19 Dec 2017 16:45:42 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJGjf2p006335; Tue, 19 Dec 2017 16:45:41 GMT (envelope-from nwhitehorn@FreeBSD.org) Received: (from nwhitehorn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJGjfeD006333; Tue, 19 Dec 2017 16:45:41 GMT (envelope-from nwhitehorn@FreeBSD.org) Message-Id: <201712191645.vBJGjfeD006333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: nwhitehorn set sender to nwhitehorn@FreeBSD.org using -f From: Nathan Whitehorn Date: Tue, 19 Dec 2017 16:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326981 - in head/sys/powerpc: booke powerpc X-SVN-Group: head X-SVN-Commit-Author: nwhitehorn X-SVN-Commit-Paths: in head/sys/powerpc: booke powerpc X-SVN-Commit-Revision: 326981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 16:45:42 -0000 Author: nwhitehorn Date: Tue Dec 19 16:45:40 2017 New Revision: 326981 URL: https://svnweb.freebsd.org/changeset/base/326981 Log: The highest-order bit of the bootloader cookie is 1, with the result that the 32-bit cookie can be sign-extended on its way out of the loader and through Open Firmware. If sign-extended, the in-kernel check of its value would fail on 64-bit systems, resulting in a mountroot prompt. Solve this by telling the kernel to ignore the high-order bits. PR: kern/224437 Submitted by: Gustavo Romero Modified: head/sys/powerpc/booke/booke_machdep.c head/sys/powerpc/powerpc/machdep.c Modified: head/sys/powerpc/booke/booke_machdep.c ============================================================================== --- head/sys/powerpc/booke/booke_machdep.c Tue Dec 19 16:20:13 2017 (r326980) +++ head/sys/powerpc/booke/booke_machdep.c Tue Dec 19 16:45:40 2017 (r326981) @@ -201,7 +201,7 @@ extern void *int_performance_counter; mtspr(ivor, (uintptr_t)(&handler) & 0xffffUL); uintptr_t powerpc_init(vm_offset_t fdt, vm_offset_t, vm_offset_t, void *mdp, - vm_offset_t mdp_cookie); + uint32_t mdp_cookie); void booke_cpu_init(void); void Modified: head/sys/powerpc/powerpc/machdep.c ============================================================================== --- head/sys/powerpc/powerpc/machdep.c Tue Dec 19 16:20:13 2017 (r326980) +++ head/sys/powerpc/powerpc/machdep.c Tue Dec 19 16:45:40 2017 (r326981) @@ -155,7 +155,7 @@ SYSCTL_INT(_machdep, CPU_CACHELINE, cacheline_size, CTLFLAG_RD, &cacheline_size, 0, ""); uintptr_t powerpc_init(vm_offset_t, vm_offset_t, vm_offset_t, void *, - vm_offset_t); + uint32_t); long Maxmem = 0; long realmem = 0; @@ -234,7 +234,7 @@ void booke_cpu_init(void); uintptr_t powerpc_init(vm_offset_t fdt, vm_offset_t toc, vm_offset_t ofentry, void *mdp, - vm_offset_t mdp_cookie) + uint32_t mdp_cookie) { struct pcpu *pc; struct cpuref bsp; From owner-svn-src-head@freebsd.org Tue Dec 19 17:07:51 2017 Return-Path: Delivered-To: svn-src-head@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 AD600E90D4C; Tue, 19 Dec 2017 17:07:51 +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 67A1581D2D; Tue, 19 Dec 2017 17:07:51 +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 vBJH7oG0015226; Tue, 19 Dec 2017 17:07:50 GMT (envelope-from alc@FreeBSD.org) Received: (from alc@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJH7onm015225; Tue, 19 Dec 2017 17:07:50 GMT (envelope-from alc@FreeBSD.org) Message-Id: <201712191707.vBJH7onm015225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: alc set sender to alc@FreeBSD.org using -f From: Alan Cox Date: Tue, 19 Dec 2017 17:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326982 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: alc X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 326982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 17:07:51 -0000 Author: alc Date: Tue Dec 19 17:07:50 2017 New Revision: 326982 URL: https://svnweb.freebsd.org/changeset/base/326982 Log: Document the semantics of atomic_thread_fence operations. Add atomic_load_ and atomic_store_, and explain why they exist. Define the synchronizes-with relationship and its effects. Reorder and revise some of the existing text. For example, more precisely describe when ordinary accesses are atomic. Reviewed by: jhb, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D13522 Modified: head/share/man/man9/atomic.9 Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Tue Dec 19 16:45:40 2017 (r326981) +++ head/share/man/man9/atomic.9 Tue Dec 19 17:07:50 2017 (r326982) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 23, 2017 +.Dd December 19, 2017 .Dt ATOMIC 9 .Os .Sh NAME @@ -36,7 +36,8 @@ .Nm atomic_readandclear , .Nm atomic_set , .Nm atomic_subtract , -.Nm atomic_store +.Nm atomic_store , +.Nm atomic_thread_fence .Nd atomic operations .Sh SYNOPSIS .In sys/types.h @@ -60,7 +61,7 @@ .Ft .Fn atomic_fetchadd_ "volatile *p" " v" .Ft -.Fn atomic_load_acq_ "volatile *p" +.Fn atomic_load_[acq_] "volatile *p" .Ft .Fn atomic_readandclear_ "volatile *p" .Ft void @@ -68,19 +69,33 @@ .Ft void .Fn atomic_subtract_[acq_|rel_] "volatile *p" " v" .Ft void -.Fn atomic_store_rel_ "volatile *p" " v" +.Fn atomic_store_[rel_] "volatile *p" " v" .Ft .Fn atomic_swap_ "volatile *p" " v" .Ft int .Fn atomic_testandclear_ "volatile *p" "u_int v" .Ft int .Fn atomic_testandset_ "volatile *p" "u_int v" +.Ft void +.Fn atomic_thread_fence_[acq|acq_rel|rel|seq_cst] "void" .Sh DESCRIPTION -All of these operations are performed atomically across multiple -threads and in the presence of interrupts, meaning that they are -performed in an indivisible manner from the perspective of concurrently +Atomic operations are commonly used to implement reference counts and as +building blocks for synchronization primitives, such as mutexes. +.Pp +All of these operations are performed +.Em atomically +across multiple threads and in the presence of interrupts, meaning that they +are performed in an indivisible manner from the perspective of concurrently running threads and interrupt handlers. .Pp +On all architectures supported by +.Fx , +ordinary loads and stores of integers in cache-coherent memory are +inherently atomic if the integer is naturally aligned and its size does not +exceed the processor's word size. +However, such loads and stores may be elided from the program by +the compiler, whereas atomic operations are always performed. +.Pp When atomic operations are performed on cache-coherent memory, all operations on the same location are totally ordered. .Pp @@ -93,29 +108,16 @@ interrupt handler will observe a .Em torn write , or partial modification of the location. .Pp -On all architectures supported by -.Fx , -ordinary loads and stores of naturally aligned integer types -are atomic, as executed by the processor. -.Pp -Atomic operations can be used to implement reference counts or as -building blocks for synchronization primitives such as mutexes. -.Pp -The semantics of -.Fx Ns 's -atomic operations are almost identical to those of the similarly named -C11 operations. -The one important difference is that the C11 standard does not -require ordinary loads and stores to ever be atomic. -This is is why the -.Fn atomic_load_explicit memory_order_relaxed -operation exists in the C11 standard, but is not provided by -.In machine/atomic.h . +Except as noted below, the semantics of these operations are almost +identical to the semantics of similarly named C11 atomic operations. .Ss Types -Each atomic operation operates on a specific +Most atomic operations act upon a specific .Fa type . -The type to use is indicated in the function name. -The available types that can be used are: +That type is indicated in the function name. +In contrast to C11 atomic operations, +.Fx Ns 's +atomic operations are performed on ordinary integer types. +The available types are: .Pp .Bl -tag -offset indent -width short -compact .It Li int @@ -147,8 +149,7 @@ unsigned 8-bit integer unsigned 16-bit integer .El .Pp -These must not be used in MI code because the instructions to implement them -efficiently might not be available. +These types must not be used in machine-independent code. .Ss Acquire and Release Operations By default, a thread's accesses to different memory locations might not be performed in @@ -167,52 +168,64 @@ Moreover, in some cases, such as the implementation of threads, arbitrary reordering might result in the incorrect execution of the program. To constrain the reordering that both the compiler and processor might perform -on a thread's accesses, the thread should use atomic operations with +on a thread's accesses, a programmer can use atomic operations with .Em acquire and .Em release semantics. .Pp -Most of the atomic operations on memory have three variants. +Atomic operations on memory have up to three variants. The first variant performs the operation without imposing any ordering constraints on memory accesses to other locations. The second variant has acquire semantics, and the third variant has release semantics. -In effect, operations with acquire and release semantics establish one-way -barriers to reordering. .Pp -When an atomic operation has acquire semantics, the effects of the operation -must have completed before any subsequent load or store (by program order) is +When an atomic operation has acquire semantics, the operation must have +completed before any subsequent load or store (by program order) is performed. Conversely, acquire semantics do not require that prior loads or stores have completed before the atomic operation is performed. +An atomic operation can only have acquire semantics if it performs a load +from memory. To denote acquire semantics, the suffix .Dq Li _acq is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. -For example, to subtract two integers ensuring that subsequent loads and -stores happen after the subtraction is performed, use +For example, to subtract two integers ensuring that the subtraction is +completed before any subsequent loads and stores are performed, use .Fn atomic_subtract_acq_int . .Pp -When an atomic operation has release semantics, the effects of all prior -loads or stores (by program order) must have completed before the operation -is performed. -Conversely, release semantics do not require that the effects of the -atomic operation must have completed before any subsequent load or store is -performed. +When an atomic operation has release semantics, all prior loads or stores +(by program order) must have completed before the operation is performed. +Conversely, release semantics do not require that the atomic operation must +have completed before any subsequent load or store is performed. +An atomic operation can only have release semantics if it performs a store +to memory. To denote release semantics, the suffix .Dq Li _rel is inserted into the function name immediately prior to the .Dq Li _ Ns Aq Fa type suffix. For example, to add two long integers ensuring that all prior loads and -stores happen before the addition, use +stores are completed before the addition is performed, use .Fn atomic_add_rel_long . .Pp -The one-way barriers provided by acquire and release operations allow the -implementations of common synchronization primitives to express their -ordering requirements without also imposing unnecessary ordering. +When a release operation by one thread +.Em synchronizes with +an acquire operation by another thread, usually meaning that the acquire +operation reads the value written by the release operation, then the effects +of all prior stores by the releasing thread must become visible to +subsequent loads by the acquiring thread. +Moreover, the effects of all stores (by other threads) that were visible to +the releasing thread must also become visible to the acquiring thread. +These rules only apply to the synchronizing threads. +Other threads might observe these stores in a different order. +.Pp +In effect, atomic operations with acquire and release semantics establish +one-way barriers to reordering that enable the implementations of +synchronization primitives to express their ordering requirements without +also imposing unnecessary ordering. For example, for a critical section guarded by a mutex, an acquire operation when the mutex is locked and a release operation when the mutex is unlocked will prevent any loads or stores from moving outside of the critical @@ -220,6 +233,61 @@ section. However, they will not prevent the compiler or processor from moving loads or stores into the critical section, which does not violate the semantics of a mutex. +.Ss Thread Fence Operations +Alternatively, a programmer can use atomic thread fence operations to +constrain the reordering of accesses. +In contrast to other atomic operations, fences do not, themselves, access +memory. +.Pp +When a fence has acquire semantics, all prior loads (by program order) must +have completed before any subsequent load or store is performed. +Thus, an acquire fence is a two-way barrier for load operations. +To denote acquire semantics, the suffix +.Dq Li _acq +is appended to the function name, for example, +.Fn atomic_thread_fence_acq . +.Pp +When a fence has release semantics, all prior loads or stores (by program +order) must have completed before any subsequent store operation is +performed. +Thus, a release fence is a two-way barrier for store operations. +To denote release semantics, the suffix +.Dq Li _rel +is appended to the function name, for example, +.Fn atomic_thread_fence_rel . +.Pp +Although +.Fn atomic_thread_fence_acq_rel +implements both acquire and release semantics, it is not a full barrier. +For example, a store prior to the fence (in program order) may be completed +after a load subsequent to the fence. +In contrast, +.Fn atomic_thread_fence_seq_cst +implements a full barrier. +Neither loads nor stores may cross this barrier in either direction. +.Pp +In C11, a release fence by one thread synchronizes with an acquire fence by +another thread when an atomic load that is prior to the acquire fence (by +program order) reads the value written by an atomic store that is subsequent +to the release fence. +In constrast, in FreeBSD, because of the atomicity of ordinary, naturally +aligned loads and stores, fences can also be synchronized by ordinary loads +and stores. +This simplifies the implementation and use of some synchronization +primitives in +.Fx . +.Pp +Since neither a compiler nor a processor can foresee which (atomic) load +will read the value written by an (atomic) store, the ordering constraints +imposed by fences must be more restrictive than acquire loads and release +stores. +Essentially, this is why fences are two-way barriers. +.Pp +Although fences impose more restrictive ordering than acquire loads and +release stores, by separating access from ordering, they can sometimes +facilitate more efficient implementations of synchronization primitives. +For example, they can be used to avoid executing a memory barrier until a +memory access shows that some condition is satisfied. .Ss Multiple Processors In multiprocessor systems, the atomicity of the atomic operations on memory depends on support for cache coherence in the underlying architecture. @@ -326,12 +394,6 @@ and do not have any variants with memory barriers at t .Bd -literal -compact return (*p); .Ed -.El -.Pp -The -.Fn atomic_load -functions are only provided with acquire memory barriers. -.Bl -hang .It Fn atomic_readandclear p .Bd -literal -compact tmp = *p; @@ -363,12 +425,6 @@ and do not have any variants with memory barriers at t .Bd -literal -compact *p = v; .Ed -.El -.Pp -The -.Fn atomic_store -functions are only provided with release memory barriers. -.Bl -hang .It Fn atomic_swap p v .Bd -literal -compact tmp = *p; From owner-svn-src-head@freebsd.org Tue Dec 19 17:13:06 2017 Return-Path: Delivered-To: svn-src-head@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 64337E9130A; Tue, 19 Dec 2017 17:13:06 +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 1E597123C; Tue, 19 Dec 2017 17:13:06 +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 vBJHD54E019092; Tue, 19 Dec 2017 17:13:05 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJHD5oC019090; Tue, 19 Dec 2017 17:13:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201712191713.vBJHD5oC019090@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 19 Dec 2017 17:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326983 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 326983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 17:13:06 -0000 Author: markj Date: Tue Dec 19 17:13:04 2017 New Revision: 326983 URL: https://svnweb.freebsd.org/changeset/base/326983 Log: Avoid using bioq_* in gmirror. gmirror does not perform any sorting of I/O requests, so the bioq API doesn't provide any advantages over plain TAILQs. The API also does not provide operations needed by an upcoming change. No functional change intended. The diff shrinks the geom_mirror.ko text and the gmirror softc slightly. Tested by: pho (part of a larger patch) MFC after: 1 week Sponsored by: Dell EMC Isilon Modified: head/sys/geom/mirror/g_mirror.c head/sys/geom/mirror/g_mirror.h Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Tue Dec 19 17:07:50 2017 (r326982) +++ head/sys/geom/mirror/g_mirror.c Tue Dec 19 17:13:04 2017 (r326983) @@ -307,7 +307,7 @@ g_mirror_nrequests(struct g_mirror_softc *sc, struct g u_int nreqs = 0; mtx_lock(&sc->sc_queue_mtx); - TAILQ_FOREACH(bp, &sc->sc_queue.queue, bio_queue) { + TAILQ_FOREACH(bp, &sc->sc_queue, bio_queue) { if (bp->bio_from == cp) nreqs++; } @@ -920,7 +920,7 @@ g_mirror_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_REGULAR; mtx_lock(&sc->sc_queue_mtx); - bioq_insert_tail(&sc->sc_queue, bp); + TAILQ_INSERT_TAIL(&sc->sc_queue, bp, bio_queue); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -965,7 +965,7 @@ g_mirror_regular_request(struct bio *bp) pbp->bio_completed = pbp->bio_length; if (pbp->bio_cmd == BIO_WRITE || pbp->bio_cmd == BIO_DELETE) { - bioq_remove(&sc->sc_inflight, pbp); + TAILQ_REMOVE(&sc->sc_inflight, pbp, bio_queue); /* Release delayed sync requests if possible. */ g_mirror_sync_release(sc); } @@ -1020,7 +1020,7 @@ g_mirror_regular_request(struct bio *bp) else { pbp->bio_error = 0; mtx_lock(&sc->sc_queue_mtx); - bioq_insert_tail(&sc->sc_queue, pbp); + TAILQ_INSERT_TAIL(&sc->sc_queue, pbp, bio_queue); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); @@ -1040,7 +1040,7 @@ g_mirror_regular_request(struct bio *bp) pbp->bio_error = 0; pbp->bio_completed = pbp->bio_length; } - bioq_remove(&sc->sc_inflight, pbp); + TAILQ_REMOVE(&sc->sc_inflight, pbp, bio_queue); /* Release delayed sync requests if possible. */ g_mirror_sync_release(sc); g_io_deliver(pbp, pbp->bio_error); @@ -1060,7 +1060,7 @@ g_mirror_sync_done(struct bio *bp) sc = bp->bio_from->geom->softc; bp->bio_cflags = G_MIRROR_BIO_FLAG_SYNC; mtx_lock(&sc->sc_queue_mtx); - bioq_insert_tail(&sc->sc_queue, bp); + TAILQ_INSERT_TAIL(&sc->sc_queue, bp, bio_queue); mtx_unlock(&sc->sc_queue_mtx); wakeup(sc); } @@ -1117,30 +1117,33 @@ g_mirror_kernel_dump(struct bio *bp) static void g_mirror_flush(struct g_mirror_softc *sc, struct bio *bp) { - struct bio_queue_head queue; + struct bio_queue queue; struct g_mirror_disk *disk; struct g_consumer *cp; struct bio *cbp; - bioq_init(&queue); + TAILQ_INIT(&queue); LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; cbp = g_clone_bio(bp); if (cbp == NULL) { - while ((cbp = bioq_takefirst(&queue)) != NULL) + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, cbp, bio_queue); g_destroy_bio(cbp); + } if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); return; } - bioq_insert_tail(&queue, cbp); + TAILQ_INSERT_TAIL(&queue, cbp, bio_queue); cbp->bio_done = g_mirror_flush_done; cbp->bio_caller1 = disk; cbp->bio_to = disk->d_consumer->provider; } - while ((cbp = bioq_takefirst(&queue)) != NULL) { + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, cbp, bio_queue); G_MIRROR_LOGREQ(3, cbp, "Sending request."); disk = cbp->bio_caller1; cbp->bio_caller1 = NULL; @@ -1194,7 +1197,7 @@ g_mirror_start(struct bio *bp) g_io_deliver(bp, bp->bio_to->error); return; } - bioq_insert_tail(&sc->sc_queue, bp); + TAILQ_INSERT_TAIL(&sc->sc_queue, bp, bio_queue); mtx_unlock(&sc->sc_queue_mtx); G_MIRROR_DEBUG(4, "%s: Waking up %p.", __func__, sc); wakeup(sc); @@ -1246,7 +1249,7 @@ g_mirror_regular_collision(struct g_mirror_softc *sc, return (false); sstart = sbp->bio_offset; send = sbp->bio_offset + sbp->bio_length; - TAILQ_FOREACH(bp, &sc->sc_inflight.queue, bio_queue) { + TAILQ_FOREACH(bp, &sc->sc_inflight, bio_queue) { rstart = bp->bio_offset; rend = bp->bio_offset + bp->bio_length; if (rend > sstart && rstart < send) @@ -1263,7 +1266,7 @@ g_mirror_regular_delay(struct g_mirror_softc *sc, stru { G_MIRROR_LOGREQ(2, bp, "Delaying request."); - bioq_insert_head(&sc->sc_regular_delayed, bp); + TAILQ_INSERT_HEAD(&sc->sc_regular_delayed, bp, bio_queue); } /* @@ -1274,7 +1277,7 @@ g_mirror_sync_delay(struct g_mirror_softc *sc, struct { G_MIRROR_LOGREQ(2, bp, "Delaying synchronization request."); - bioq_insert_tail(&sc->sc_sync_delayed, bp); + TAILQ_INSERT_TAIL(&sc->sc_sync_delayed, bp, bio_queue); } /* @@ -1286,13 +1289,13 @@ g_mirror_regular_release(struct g_mirror_softc *sc) { struct bio *bp, *bp2; - TAILQ_FOREACH_SAFE(bp, &sc->sc_regular_delayed.queue, bio_queue, bp2) { + TAILQ_FOREACH_SAFE(bp, &sc->sc_regular_delayed, bio_queue, bp2) { if (g_mirror_sync_collision(sc, bp)) continue; - bioq_remove(&sc->sc_regular_delayed, bp); + TAILQ_REMOVE(&sc->sc_regular_delayed, bp, bio_queue); G_MIRROR_LOGREQ(2, bp, "Releasing delayed request (%p).", bp); mtx_lock(&sc->sc_queue_mtx); - bioq_insert_head(&sc->sc_queue, bp); + TAILQ_INSERT_HEAD(&sc->sc_queue, bp, bio_queue); mtx_unlock(&sc->sc_queue_mtx); } } @@ -1306,10 +1309,10 @@ g_mirror_sync_release(struct g_mirror_softc *sc) { struct bio *bp, *bp2; - TAILQ_FOREACH_SAFE(bp, &sc->sc_sync_delayed.queue, bio_queue, bp2) { + TAILQ_FOREACH_SAFE(bp, &sc->sc_sync_delayed, bio_queue, bp2) { if (g_mirror_regular_collision(sc, bp)) continue; - bioq_remove(&sc->sc_sync_delayed, bp); + TAILQ_REMOVE(&sc->sc_sync_delayed, bp, bio_queue); G_MIRROR_LOGREQ(2, bp, "Releasing delayed synchronization request."); g_io_request(bp, bp->bio_from); @@ -1615,7 +1618,7 @@ g_mirror_request_load(struct g_mirror_softc *sc, struc static void g_mirror_request_split(struct g_mirror_softc *sc, struct bio *bp) { - struct bio_queue_head queue; + struct bio_queue queue; struct g_mirror_disk *disk; struct g_consumer *cp; struct bio *cbp; @@ -1639,20 +1642,22 @@ g_mirror_request_split(struct g_mirror_softc *sc, stru left = bp->bio_length; offset = bp->bio_offset; data = bp->bio_data; - bioq_init(&queue); + TAILQ_INIT(&queue); LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE) continue; cbp = g_clone_bio(bp); if (cbp == NULL) { - while ((cbp = bioq_takefirst(&queue)) != NULL) + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, cbp, bio_queue); g_destroy_bio(cbp); + } if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); return; } - bioq_insert_tail(&queue, cbp); + TAILQ_INSERT_TAIL(&queue, cbp, bio_queue); cbp->bio_done = g_mirror_done; cbp->bio_caller1 = disk; cbp->bio_to = disk->d_consumer->provider; @@ -1665,7 +1670,8 @@ g_mirror_request_split(struct g_mirror_softc *sc, stru offset += cbp->bio_length; data += cbp->bio_length; } - while ((cbp = bioq_takefirst(&queue)) != NULL) { + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, cbp, bio_queue); G_MIRROR_LOGREQ(3, cbp, "Sending request."); disk = cbp->bio_caller1; cbp->bio_caller1 = NULL; @@ -1704,9 +1710,9 @@ g_mirror_register_request(struct bio *bp) case BIO_WRITE: case BIO_DELETE: { + struct bio_queue queue; struct g_mirror_disk *disk; struct g_mirror_disk_sync *sync; - struct bio_queue_head queue; struct g_consumer *cp; struct bio *cbp; @@ -1736,7 +1742,7 @@ g_mirror_register_request(struct bio *bp) * Allocate all bios before sending any request, so we can * return ENOMEM in nice and clean way. */ - bioq_init(&queue); + TAILQ_INIT(&queue); LIST_FOREACH(disk, &sc->sc_disks, d_next) { sync = &disk->d_sync; switch (disk->d_state) { @@ -1754,14 +1760,16 @@ g_mirror_register_request(struct bio *bp) continue; cbp = g_clone_bio(bp); if (cbp == NULL) { - while ((cbp = bioq_takefirst(&queue)) != NULL) + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { + TAILQ_REMOVE(&queue, cbp, bio_queue); g_destroy_bio(cbp); + } if (bp->bio_error == 0) bp->bio_error = ENOMEM; g_io_deliver(bp, bp->bio_error); return; } - bioq_insert_tail(&queue, cbp); + TAILQ_INSERT_TAIL(&queue, cbp, bio_queue); cbp->bio_done = g_mirror_done; cp = disk->d_consumer; cbp->bio_caller1 = cp; @@ -1770,12 +1778,13 @@ g_mirror_register_request(struct bio *bp) ("Consumer %s not opened (r%dw%de%d).", cp->provider->name, cp->acr, cp->acw, cp->ace)); } - if (bioq_first(&queue) == NULL) { + if (TAILQ_EMPTY(&queue)) { g_io_deliver(bp, EOPNOTSUPP); return; } - while ((cbp = bioq_takefirst(&queue)) != NULL) { + while ((cbp = TAILQ_FIRST(&queue)) != NULL) { G_MIRROR_LOGREQ(3, cbp, "Sending request."); + TAILQ_REMOVE(&queue, cbp, bio_queue); cp = cbp->bio_caller1; cbp->bio_caller1 = NULL; cp->index++; @@ -1786,7 +1795,7 @@ g_mirror_register_request(struct bio *bp) * Put request onto inflight queue, so we can check if new * synchronization requests don't collide with it. */ - bioq_insert_tail(&sc->sc_inflight, bp); + TAILQ_INSERT_TAIL(&sc->sc_inflight, bp, bio_queue); return; } default: @@ -1929,8 +1938,10 @@ g_mirror_worker(void *arg) */ /* Get first request from the queue. */ mtx_lock(&sc->sc_queue_mtx); - bp = bioq_takefirst(&sc->sc_queue); - if (bp == NULL) { + bp = TAILQ_FIRST(&sc->sc_queue); + if (bp != NULL) + TAILQ_REMOVE(&sc->sc_queue, bp, bio_queue); + else { if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { mtx_unlock(&sc->sc_queue_mtx); @@ -1940,7 +1951,7 @@ g_mirror_worker(void *arg) kproc_exit(0); } mtx_lock(&sc->sc_queue_mtx); - if (bioq_first(&sc->sc_queue) != NULL) { + if (!TAILQ_EMPTY(&sc->sc_queue)) { mtx_unlock(&sc->sc_queue_mtx); continue; } @@ -2190,7 +2201,8 @@ g_mirror_destroy_provider(struct g_mirror_softc *sc) g_topology_lock(); g_error_provider(sc->sc_provider, ENXIO); mtx_lock(&sc->sc_queue_mtx); - while ((bp = bioq_takefirst(&sc->sc_queue)) != NULL) { + while ((bp = TAILQ_FIRST(&sc->sc_queue)) != NULL) { + TAILQ_REMOVE(&sc->sc_queue, bp, bio_queue); /* * Abort any pending I/O that wasn't generated by us. * Synchronization requests and requests destined for individual @@ -3009,11 +3021,11 @@ g_mirror_create(struct g_class *mp, const struct g_mir sc->sc_writes = 0; sc->sc_refcnt = 1; sx_init(&sc->sc_lock, "gmirror:lock"); - bioq_init(&sc->sc_queue); + TAILQ_INIT(&sc->sc_queue); mtx_init(&sc->sc_queue_mtx, "gmirror:queue", NULL, MTX_DEF); - bioq_init(&sc->sc_regular_delayed); - bioq_init(&sc->sc_inflight); - bioq_init(&sc->sc_sync_delayed); + TAILQ_INIT(&sc->sc_regular_delayed); + TAILQ_INIT(&sc->sc_inflight); + TAILQ_INIT(&sc->sc_sync_delayed); LIST_INIT(&sc->sc_disks); TAILQ_INIT(&sc->sc_events); mtx_init(&sc->sc_events_mtx, "gmirror:events", NULL, MTX_DEF); Modified: head/sys/geom/mirror/g_mirror.h ============================================================================== --- head/sys/geom/mirror/g_mirror.h Tue Dec 19 17:07:50 2017 (r326982) +++ head/sys/geom/mirror/g_mirror.h Tue Dec 19 17:13:04 2017 (r326983) @@ -193,17 +193,14 @@ struct g_mirror_softc { uint32_t sc_id; /* Mirror unique ID. */ struct sx sc_lock; - struct bio_queue_head sc_queue; + struct bio_queue sc_queue; struct mtx sc_queue_mtx; struct proc *sc_worker; - struct bio_queue_head sc_regular_delayed; /* Delayed I/O requests due - collision with sync - requests. */ - struct bio_queue_head sc_inflight; /* In-flight regular write - requests. */ - struct bio_queue_head sc_sync_delayed; /* Delayed sync requests due - collision with regular - requests. */ + struct bio_queue sc_inflight; /* In-flight regular write requests. */ + struct bio_queue sc_regular_delayed; /* Delayed I/O requests due to + collision with sync requests. */ + struct bio_queue sc_sync_delayed; /* Delayed sync requests due to + collision with regular requests. */ LIST_HEAD(, g_mirror_disk) sc_disks; u_int sc_ndisks; /* Number of disks. */ From owner-svn-src-head@freebsd.org Tue Dec 19 17:59:03 2017 Return-Path: Delivered-To: svn-src-head@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 52C8CE941A0; Tue, 19 Dec 2017 17:59:03 +0000 (UTC) (envelope-from shurd@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 1495D3111; Tue, 19 Dec 2017 17:59:03 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJHx2OT035904; Tue, 19 Dec 2017 17:59:02 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJHx14U035893; Tue, 19 Dec 2017 17:59:01 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712191759.vBJHx14U035893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 17:59:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326984 - in head: share/man/man4 sys/compat/linuxkpi/common/src sys/dev/e1000 sys/net sys/sys X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head: share/man/man4 sys/compat/linuxkpi/common/src sys/dev/e1000 sys/net sys/sys X-SVN-Commit-Revision: 326984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 17:59:03 -0000 Author: shurd Date: Tue Dec 19 17:59:00 2017 New Revision: 326984 URL: https://svnweb.freebsd.org/changeset/base/326984 Log: Update Matthew Macy contact info Email address has changed, uses consistent name (Matthew, not Matt) Reported by: Matthew Macy Differential Revision: https://reviews.freebsd.org/D13537 Modified: head/share/man/man4/em.4 head/sys/compat/linuxkpi/common/src/linux_page.c head/sys/compat/linuxkpi/common/src/linux_rcu.c head/sys/dev/e1000/em_txrx.c head/sys/dev/e1000/if_em.c head/sys/dev/e1000/if_em.h head/sys/dev/e1000/igb_txrx.c head/sys/net/ifdi_if.m head/sys/net/iflib.c head/sys/net/iflib.h head/sys/sys/gtaskqueue.h Modified: head/share/man/man4/em.4 ============================================================================== --- head/share/man/man4/em.4 Tue Dec 19 17:13:04 2017 (r326983) +++ head/share/man/man4/em.4 Tue Dec 19 17:59:00 2017 (r326984) @@ -319,6 +319,6 @@ The driver was originally written by .An Intel Corporation Aq Mt freebsd@intel.com . It was merged with igb driver and converted to the iflib framework by -.An Matthew Macy Aq Mt mmacy@nextbsd.org +.An Matthew Macy Aq Mt mmacy@mattmacy.io and .An Sean Bruno Aq Mt sbruno@FreeBSD.org . Modified: head/sys/compat/linuxkpi/common/src/linux_page.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_page.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/compat/linuxkpi/common/src/linux_page.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2010 Isilon Systems, Inc. - * Copyright (c) 2016 Matt Macy (mmacy@nextbsd.org) + * Copyright (c) 2016 Matthew Macy (mmacy@mattmacy.io) * Copyright (c) 2017 Mellanox Technologies, Ltd. * All rights reserved. * Modified: head/sys/compat/linuxkpi/common/src/linux_rcu.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_rcu.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/compat/linuxkpi/common/src/linux_rcu.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Matt Macy (mmacy@nextbsd.org) + * Copyright (c) 2016 Matthew Macy (mmacy@mattmacy.io) * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/em_txrx.c ============================================================================== --- head/sys/dev/e1000/em_txrx.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/dev/e1000/em_txrx.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016-2017 Matt Macy + * Copyright (c) 2016-2017 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/dev/e1000/if_em.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2016 Matt Macy + * Copyright (c) 2016 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/if_em.h ============================================================================== --- head/sys/dev/e1000/if_em.h Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/dev/e1000/if_em.h Tue Dec 19 17:59:00 2017 (r326984) @@ -1,7 +1,7 @@ /*- * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2016 Matt Macy + * Copyright (c) 2016 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/e1000/igb_txrx.c ============================================================================== --- head/sys/dev/e1000/igb_txrx.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/dev/e1000/igb_txrx.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Matt Macy + * Copyright (c) 2016 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/net/ifdi_if.m ============================================================================== --- head/sys/net/ifdi_if.m Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/net/ifdi_if.m Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ # -# Copyright (c) 2014, Matthew Macy (kmacy@freebsd.org) +# Copyright (c) 2014, Matthew Macy (mmacy@mattmacy.io) # All rights reserved. # # Redistribution and use in source and binary forms, with or without Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/net/iflib.c Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2017, Matthew Macy + * Copyright (c) 2014-2017, Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/net/iflib.h Tue Dec 19 17:59:00 2017 (r326984) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2017, Matthew Macy (mmacy@nextbsd.org) + * Copyright (c) 2014-2017, Matthew Macy (mmacy@mattmacy.io) * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/sys/gtaskqueue.h ============================================================================== --- head/sys/sys/gtaskqueue.h Tue Dec 19 17:13:04 2017 (r326983) +++ head/sys/sys/gtaskqueue.h Tue Dec 19 17:59:00 2017 (r326984) @@ -2,7 +2,7 @@ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2014 Jeffrey Roberson - * Copyright (c) 2016 Matthew Macy + * Copyright (c) 2016 Matthew Macy * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Tue Dec 19 18:12:20 2017 Return-Path: Delivered-To: svn-src-head@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 52A92E95266; Tue, 19 Dec 2017 18:12:20 +0000 (UTC) (envelope-from shurd@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 1C7923F7F; Tue, 19 Dec 2017 18:12:20 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJICJoq044451; Tue, 19 Dec 2017 18:12:19 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJICJeR044450; Tue, 19 Dec 2017 18:12:19 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712191812.vBJICJeR044450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 18:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326985 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 326985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 18:12:20 -0000 Author: shurd Date: Tue Dec 19 18:12:18 2017 New Revision: 326985 URL: https://svnweb.freebsd.org/changeset/base/326985 Log: Add byte swapping in bnxt_cfg_async_cr() request The firmware is always in little endian, use htole*() for all request fields larger than one byte. Submitted by: Bhargava Chenna Marreddy Sponsored by: Broadcom Limited Modified: head/sys/dev/bnxt/bnxt_hwrm.c Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Tue Dec 19 17:59:00 2017 (r326984) +++ head/sys/dev/bnxt/bnxt_hwrm.c Tue Dec 19 18:12:18 2017 (r326985) @@ -945,9 +945,9 @@ bnxt_cfg_async_cr(struct bnxt_softc *softc) bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_CFG); - req.fid = 0xffff; + req.fid = htole16(0xffff); req.enables = htole32(HWRM_FUNC_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); - req.async_event_cr = softc->def_cp_ring.ring.phys_id; + req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id); rc = hwrm_send_message(softc, &req, sizeof(req)); } @@ -957,7 +957,7 @@ bnxt_cfg_async_cr(struct bnxt_softc *softc) bnxt_hwrm_cmd_hdr_init(softc, &req, HWRM_FUNC_VF_CFG); req.enables = htole32(HWRM_FUNC_VF_CFG_INPUT_ENABLES_ASYNC_EVENT_CR); - req.async_event_cr = softc->def_cp_ring.ring.phys_id; + req.async_event_cr = htole16(softc->def_cp_ring.ring.phys_id); rc = hwrm_send_message(softc, &req, sizeof(req)); } From owner-svn-src-head@freebsd.org Tue Dec 19 18:20:40 2017 Return-Path: Delivered-To: svn-src-head@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 34996E9598D; Tue, 19 Dec 2017 18:20:40 +0000 (UTC) (envelope-from jhb@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 D6CDF63742; Tue, 19 Dec 2017 18:20:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJIKcCU045391; Tue, 19 Dec 2017 18:20:38 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJIKcPB045388; Tue, 19 Dec 2017 18:20:38 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191820.vBJIKcPB045388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 18:20:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326986 - in head/sys: fs/fdescfs kern sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: fs/fdescfs kern sys X-SVN-Commit-Revision: 326986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 18:20:40 -0000 Author: jhb Date: Tue Dec 19 18:20:38 2017 New Revision: 326986 URL: https://svnweb.freebsd.org/changeset/base/326986 Log: Add a custom VOP_PATHCONF method for fdescfs. The method handles NAME_MAX and LINK_MAX explicitly. For all other pathconf variables, the method passes the request down to the underlying file descriptor. This requires splitting a kern_fpathconf() syscallsubr routine out of sys_fpathconf(). Also, to avoid lock order reversals with vnode locks, the fdescfs vnode is unlocked around the call to kern_fpathconf(), but with the usecount of the vnode bumped. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/fdescfs/fdesc_vnops.c head/sys/kern/kern_descrip.c head/sys/sys/syscallsubr.h Modified: head/sys/fs/fdescfs/fdesc_vnops.c ============================================================================== --- head/sys/fs/fdescfs/fdesc_vnops.c Tue Dec 19 18:12:18 2017 (r326985) +++ head/sys/fs/fdescfs/fdesc_vnops.c Tue Dec 19 18:20:38 2017 (r326986) @@ -55,6 +55,8 @@ #include #include #include +#include +#include #include #include @@ -70,6 +72,7 @@ struct mtx fdesc_hashmtx; static vop_getattr_t fdesc_getattr; static vop_lookup_t fdesc_lookup; static vop_open_t fdesc_open; +static vop_pathconf_t fdesc_pathconf; static vop_readdir_t fdesc_readdir; static vop_readlink_t fdesc_readlink; static vop_reclaim_t fdesc_reclaim; @@ -82,7 +85,7 @@ static struct vop_vector fdesc_vnodeops = { .vop_getattr = fdesc_getattr, .vop_lookup = fdesc_lookup, .vop_open = fdesc_open, - .vop_pathconf = vop_stdpathconf, + .vop_pathconf = fdesc_pathconf, .vop_readdir = fdesc_readdir, .vop_readlink = fdesc_readlink, .vop_reclaim = fdesc_reclaim, @@ -393,6 +396,33 @@ fdesc_open(struct vop_open_args *ap) */ ap->a_td->td_dupfd = VTOFDESC(vp)->fd_fd; /* XXX */ return (ENODEV); +} + +static int +fdesc_pathconf(struct vop_pathconf_args *ap) +{ + struct vnode *vp = ap->a_vp; + int error; + + switch (ap->a_name) { + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + case _PC_LINK_MAX: + if (VTOFDESC(vp)->fd_type == Froot) + *ap->a_retval = 2; + else + *ap->a_retval = 1; + return (0); + default: + vref(vp); + VOP_UNLOCK(vp, 0); + error = kern_fpathconf(curthread, VTOFDESC(vp)->fd_fd, + ap->a_name); + vn_lock(vp, LK_SHARED | LK_RETRY); + vunref(vp); + return (error); + } } static int Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Tue Dec 19 18:12:18 2017 (r326985) +++ head/sys/kern/kern_descrip.c Tue Dec 19 18:20:38 2017 (r326986) @@ -1418,26 +1418,33 @@ struct fpathconf_args { int sys_fpathconf(struct thread *td, struct fpathconf_args *uap) { + + return (kern_fpathconf(td, uap->fd, uap->name)); +} + +int +kern_fpathconf(struct thread *td, int fd, int name) +{ struct file *fp; struct vnode *vp; cap_rights_t rights; int error; - error = fget(td, uap->fd, cap_rights_init(&rights, CAP_FPATHCONF), &fp); + error = fget(td, fd, cap_rights_init(&rights, CAP_FPATHCONF), &fp); if (error != 0) return (error); - if (uap->name == _PC_ASYNC_IO) { + if (name == _PC_ASYNC_IO) { td->td_retval[0] = _POSIX_ASYNCHRONOUS_IO; goto out; } vp = fp->f_vnode; if (vp != NULL) { vn_lock(vp, LK_SHARED | LK_RETRY); - error = VOP_PATHCONF(vp, uap->name, td->td_retval); + error = VOP_PATHCONF(vp, name, td->td_retval); VOP_UNLOCK(vp, 0); } else if (fp->f_type == DTYPE_PIPE || fp->f_type == DTYPE_SOCKET) { - if (uap->name != _PC_PIPE_BUF) { + if (name != _PC_PIPE_BUF) { error = EINVAL; } else { td->td_retval[0] = PIPE_BUF; Modified: head/sys/sys/syscallsubr.h ============================================================================== --- head/sys/sys/syscallsubr.h Tue Dec 19 18:12:18 2017 (r326985) +++ head/sys/sys/syscallsubr.h Tue Dec 19 18:20:38 2017 (r326986) @@ -111,6 +111,7 @@ int kern_fcntl(struct thread *td, int fd, int cmd, int int kern_fcntl_freebsd(struct thread *td, int fd, int cmd, long arg); int kern_fhstat(struct thread *td, fhandle_t fh, struct stat *buf); int kern_fhstatfs(struct thread *td, fhandle_t fh, struct statfs *buf); +int kern_fpathconf(struct thread *td, int fd, int name); int kern_fstat(struct thread *td, int fd, struct stat *sbp); int kern_fstatfs(struct thread *td, int fd, struct statfs *buf); int kern_fsync(struct thread *td, int fd, bool fullsync); From owner-svn-src-head@freebsd.org Tue Dec 19 19:07:26 2017 Return-Path: Delivered-To: svn-src-head@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 3744DE988B1; Tue, 19 Dec 2017 19:07:26 +0000 (UTC) (envelope-from jhb@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 0E96566284; Tue, 19 Dec 2017 19:07:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJ7P9I067541; Tue, 19 Dec 2017 19:07:25 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJ7Oat067538; Tue, 19 Dec 2017 19:07:24 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191907.vBJJ7Oat067538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326987 - in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 326987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:07:26 -0000 Author: jhb Date: Tue Dec 19 19:07:24 2017 New Revision: 326987 URL: https://svnweb.freebsd.org/changeset/base/326987 Log: Adjust ZFS' link count handling for ino64. - Define a ZFS_LINK_MAX as the ZFS version of LINK_MAX which is set to UINT64_MAX to match the on-disk format. - Enable the currently #if 0'd code to check for link overflows and return EMLINK. - Don't clamp the link count reported in stat() to LINK_MAX as that is still the 16-bit limit, but report the full link counts. Also, avoid possibly overflowing the reported link count to 0 when adjusting the link count to account for ".snapshot". - Update the LINK_MAX reported by pathconf() to report ZFS_LINK_MAX rather than LINK_MAX (but clamped to LONG_MAX for 32-bit systems). Reviewed by: avg (earlier version) Sponsored by: Chelsio Communications Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Dec 19 18:20:38 2017 (r326986) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_znode.h Tue Dec 19 19:07:24 2017 (r326987) @@ -201,6 +201,7 @@ typedef struct znode { boolean_t z_is_sa; /* are we native sa? */ } znode_t; +#define ZFS_LINK_MAX UINT64_MAX /* * Range locking rules Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 18:20:38 2017 (r326986) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 19:07:24 2017 (r326987) @@ -527,10 +527,10 @@ zfs_link_create(znode_t *dzp, const char *name, znode_ ASSERT_VOP_ELOCKED(ZTOV(dzp), __func__); ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); -#if 0 +#ifdef __FreeBSD__ if (zp_is_dir) { error = 0; - if (dzp->z_links >= LINK_MAX) + if (dzp->z_links >= ZFS_LINK_MAX) error = SET_ERROR(EMLINK); return (error); } @@ -540,8 +540,8 @@ zfs_link_create(znode_t *dzp, const char *name, znode_ ASSERT(!(flag & (ZNEW | ZEXISTS))); return (SET_ERROR(ENOENT)); } -#if 0 - if (zp->z_links >= LINK_MAX) { +#ifdef __FreeBSD__ + if (zp->z_links >= ZFS_LINK_MAX - zp_is_dir) { return (SET_ERROR(EMLINK)); } #endif Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 18:20:38 2017 (r326986) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 19:07:24 2017 (r326987) @@ -2643,7 +2643,6 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred int error = 0; uint32_t blksize; u_longlong_t nblocks; - uint64_t links; uint64_t mtime[2], ctime[2], crtime[2], rdev; xvattr_t *xvap = (xvattr_t *)vap; /* vap may be an xvattr_t * */ xoptattr_t *xoap = NULL; @@ -2695,11 +2694,10 @@ zfs_getattr(vnode_t *vp, vattr_t *vap, int flags, cred vn_fsid(vp, vap); #endif vap->va_nodeid = zp->z_id; - if ((vp->v_flag & VROOT) && zfs_show_ctldir(zp)) - links = zp->z_links + 1; - else - links = zp->z_links; - vap->va_nlink = MIN(links, LINK_MAX); /* nlink_t limit! */ + vap->va_nlink = zp->z_links; + if ((vp->v_flag & VROOT) && zfs_show_ctldir(zp) && + zp->z_links < ZFS_LINK_MAX) + vap->va_nlink++; vap->va_size = zp->z_size; #ifdef illumos vap->va_rdev = vp->v_rdev; @@ -4404,7 +4402,7 @@ zfs_pathconf(vnode_t *vp, int cmd, ulong_t *valp, cred switch (cmd) { case _PC_LINK_MAX: - *valp = INT_MAX; + *valp = MIN(LONG_MAX, ZFS_LINK_MAX); return (0); case _PC_FILESIZEBITS: From owner-svn-src-head@freebsd.org Tue Dec 19 19:09:08 2017 Return-Path: Delivered-To: svn-src-head@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 495E8E98A48; Tue, 19 Dec 2017 19:09:08 +0000 (UTC) (envelope-from jhb@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 1422E66413; Tue, 19 Dec 2017 19:09:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJ97ZY067635; Tue, 19 Dec 2017 19:09:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJ97t0067634; Tue, 19 Dec 2017 19:09:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191909.vBJJ97t0067634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:09:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326988 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 326988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:09:08 -0000 Author: jhb Date: Tue Dec 19 19:09:06 2017 New Revision: 326988 URL: https://svnweb.freebsd.org/changeset/base/326988 Log: Add a custom VOP_PATHCONF method for fuse. This method handles _PC_FILESIZEBITS, _PC_SYMLINK_MAX, and _PC_NO_TRUNC. For other values it defers to vop_stdpathconf(). MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:07:24 2017 (r326987) +++ head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:09:06 2017 (r326988) @@ -126,6 +126,7 @@ static vop_lookup_t fuse_vnop_lookup; static vop_mkdir_t fuse_vnop_mkdir; static vop_mknod_t fuse_vnop_mknod; static vop_open_t fuse_vnop_open; +static vop_pathconf_t fuse_vnop_pathconf; static vop_read_t fuse_vnop_read; static vop_readdir_t fuse_vnop_readdir; static vop_readlink_t fuse_vnop_readlink; @@ -158,7 +159,7 @@ struct vop_vector fuse_vnops = { .vop_mkdir = fuse_vnop_mkdir, .vop_mknod = fuse_vnop_mknod, .vop_open = fuse_vnop_open, - .vop_pathconf = vop_stdpathconf, + .vop_pathconf = fuse_vnop_pathconf, .vop_read = fuse_vnop_read, .vop_readdir = fuse_vnop_readdir, .vop_readlink = fuse_vnop_readlink, @@ -1173,6 +1174,25 @@ fuse_vnop_open(struct vop_open_args *ap) error = fuse_filehandle_open(vp, fufh_type, NULL, td, cred); return error; +} + +static int +fuse_vnop_pathconf(struct vop_pathconf_args *ap) +{ + + switch (ap->a_name) { + case _PC_FILESIZEBITS: + *ap->a_retval = 64; + return (0); + case _PC_SYMLINK_MAX: + *ap->a_retval = MAXPATHLEN; + return (0); + case _PC_NO_TRUNC: + *ap->a_retval = 1; + return (0); + default: + return (vop_stdpathconf(ap)); + } } /* From owner-svn-src-head@freebsd.org Tue Dec 19 19:10:01 2017 Return-Path: Delivered-To: svn-src-head@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 7309CE98B99; Tue, 19 Dec 2017 19:10:01 +0000 (UTC) (envelope-from jhb@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 3CE7B66587; Tue, 19 Dec 2017 19:10:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJA0E7067729; Tue, 19 Dec 2017 19:10:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJA06G067728; Tue, 19 Dec 2017 19:10:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191910.vBJJA06G067728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326989 - head/sys/fs/msdosfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/msdosfs X-SVN-Commit-Revision: 326989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:10:01 -0000 Author: jhb Date: Tue Dec 19 19:10:00 2017 New Revision: 326989 URL: https://svnweb.freebsd.org/changeset/base/326989 Log: Support _PC_FILESIZEBITS in msdosfs' VOP_PATHCONF(). MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/msdosfs/msdosfs_vnops.c Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 19 19:09:06 2017 (r326988) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 19 19:10:00 2017 (r326989) @@ -1876,6 +1876,9 @@ msdosfs_pathconf(struct vop_pathconf_args *ap) struct msdosfsmount *pmp = VTODE(ap->a_vp)->de_pmp; switch (ap->a_name) { + case _PC_FILESIZEBITS: + *ap->a_retval = 32; + return (0); case _PC_LINK_MAX: *ap->a_retval = 1; return (0); From owner-svn-src-head@freebsd.org Tue Dec 19 19:14:03 2017 Return-Path: Delivered-To: svn-src-head@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 020BEE990F9; Tue, 19 Dec 2017 19:14:03 +0000 (UTC) (envelope-from jhb@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 C05E966A79; Tue, 19 Dec 2017 19:14:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJE1CI072042; Tue, 19 Dec 2017 19:14:01 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJE1Y1072041; Tue, 19 Dec 2017 19:14:01 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191914.vBJJE1Y1072041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:14:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326990 - head/sys/fs/smbfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/smbfs X-SVN-Commit-Revision: 326990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:14:03 -0000 Author: jhb Date: Tue Dec 19 19:14:01 2017 New Revision: 326990 URL: https://svnweb.freebsd.org/changeset/base/326990 Log: Handle _PC_FILESIZEBITS and _PC_NO_TRUNC for smbfs' VOP_PATHCONF(). MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 19 19:10:00 2017 (r326989) +++ head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 19 19:14:01 2017 (r326990) @@ -901,12 +901,21 @@ smbfs_pathconf (ap) switch (ap->a_name) { case _PC_LINK_MAX: *retval = 0; + case _PC_FILESIZEBITS: + if (vcp->vc_sopt.sv_caps & (SMB_CAP_LARGE_READX | + SMB_CAP_LARGE_WRITEX)) + *retval = 64; + else + *retval = 32; break; case _PC_NAME_MAX: *retval = (vcp->vc_hflags2 & SMB_FLAGS2_KNOWS_LONG_NAMES) ? 255 : 12; break; case _PC_PATH_MAX: *retval = 800; /* XXX: a correct one ? */ + break; + case _PC_NO_TRUNC: + *retval = 1; break; default: error = vop_stdpathconf(ap); From owner-svn-src-head@freebsd.org Tue Dec 19 19:18:50 2017 Return-Path: Delivered-To: svn-src-head@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 572F1E993EE; Tue, 19 Dec 2017 19:18:50 +0000 (UTC) (envelope-from jhb@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 2868466C82; Tue, 19 Dec 2017 19:18:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJInxV072228; Tue, 19 Dec 2017 19:18:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJImA5072223; Tue, 19 Dec 2017 19:18:48 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191918.vBJJImA5072223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:18:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326991 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 326991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:18:50 -0000 Author: jhb Date: Tue Dec 19 19:18:48 2017 New Revision: 326991 URL: https://svnweb.freebsd.org/changeset/base/326991 Log: Update NFS to handle larger link counts post ino64. - Define a NFS_LINK_MAX as UINT32_MAX to match the wire protocol. - Use NFS_LINK_MAX instead of LINK_MAX as the fallback value reported for a PATHCONF RPC by the NFS server. - Use NFS_LINK_MAX instead of LINK_MAX as the default value reported by the NFS client pathconf() if not overridden by the NFS server. - When reading the link count out of an RPC reply, read the full 32 bits instead of the lower 16 bits. Reviewed by: rmacklem (earlier version) Sponsored by: Chelsio Communications Modified: head/sys/fs/nfs/nfs_commonport.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsproto.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfs/nfs_commonport.c ============================================================================== --- head/sys/fs/nfs/nfs_commonport.c Tue Dec 19 19:14:01 2017 (r326990) +++ head/sys/fs/nfs/nfs_commonport.c Tue Dec 19 19:18:48 2017 (r326991) @@ -331,7 +331,7 @@ nfsvno_pathconf(struct vnode *vp, int flag, register_t */ switch (flag) { case _PC_LINK_MAX: - *retf = LINK_MAX; + *retf = NFS_LINK_MAX; break; case _PC_NAME_MAX: *retf = NAME_MAX; Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Dec 19 19:14:01 2017 (r326990) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Dec 19 19:18:48 2017 (r326991) @@ -883,7 +883,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, NFSV3_FSFHOMOGENEOUS | NFSV3_FSFCANSETTIME); } if (pc != NULL) { - pc->pc_linkmax = LINK_MAX; + pc->pc_linkmax = NFS_LINK_MAX; pc->pc_namemax = NAME_MAX; pc->pc_notrunc = 0; pc->pc_chownrestricted = 0; @@ -1320,7 +1320,7 @@ nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); if (compare) { if (!(*retcmpp)) { - if (fxdr_unsigned(int, *tl) != LINK_MAX) + if (fxdr_unsigned(int, *tl) != NFS_LINK_MAX) *retcmpp = NFSERR_NOTSAME; } } else if (pc != NULL) { Modified: head/sys/fs/nfs/nfsproto.h ============================================================================== --- head/sys/fs/nfs/nfsproto.h Tue Dec 19 19:14:01 2017 (r326990) +++ head/sys/fs/nfs/nfsproto.h Tue Dec 19 19:18:48 2017 (r326991) @@ -785,6 +785,8 @@ struct nfs_fattr { #define fa3_mtime fa_un.fa_nfsv3.nfsv3fa_mtime #define fa3_ctime fa_un.fa_nfsv3.nfsv3fa_ctime +#define NFS_LINK_MAX UINT32_MAX + struct nfsv2_sattr { u_int32_t sa_mode; u_int32_t sa_uid; Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Dec 19 19:14:01 2017 (r326990) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Tue Dec 19 19:18:48 2017 (r326991) @@ -433,7 +433,7 @@ nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvat nap->na_mode = fxdr_unsigned(u_short, fp->fa_mode); nap->na_rdev = makedev(fxdr_unsigned(u_char, fp->fa3_rdev.specdata1), fxdr_unsigned(u_char, fp->fa3_rdev.specdata2)); - nap->na_nlink = fxdr_unsigned(u_short, fp->fa_nlink); + nap->na_nlink = fxdr_unsigned(uint32_t, fp->fa_nlink); nap->na_uid = fxdr_unsigned(uid_t, fp->fa_uid); nap->na_gid = fxdr_unsigned(gid_t, fp->fa_gid); nap->na_size = fxdr_hyper(&fp->fa3_size); Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:14:01 2017 (r326990) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:18:48 2017 (r326991) @@ -3450,7 +3450,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) * For NFSv2 (or NFSv3 when not one of the above 4 a_names), * just fake them. */ - pc.pc_linkmax = LINK_MAX; + pc.pc_linkmax = NFS_LINK_MAX; pc.pc_namemax = NFS_MAXNAMLEN; pc.pc_notrunc = 1; pc.pc_chownrestricted = 1; @@ -3460,7 +3460,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) } switch (ap->a_name) { case _PC_LINK_MAX: - *ap->a_retval = pc.pc_linkmax; + *ap->a_retval = MIN(LONG_MAX, pc.pc_linkmax); break; case _PC_NAME_MAX: *ap->a_retval = pc.pc_namemax; From owner-svn-src-head@freebsd.org Tue Dec 19 19:25:22 2017 Return-Path: Delivered-To: svn-src-head@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 0651EE99F89; Tue, 19 Dec 2017 19:25:22 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3CA58672C9; Tue, 19 Dec 2017 19:25:21 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBJJPHYr022309; Tue, 19 Dec 2017 11:25:17 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBJJPHSC022308; Tue, 19 Dec 2017 11:25:17 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712191925.vBJJPHSC022308@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r326958 - head In-Reply-To: To: Eitan Adler Date: Tue, 19 Dec 2017 11:25:17 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:25:22 -0000 > I give up. Not touching this anymore. If you feel like fixing it do it. I was not expecting an additional fix for this as there really isnt a clean way to fix it, just for future reference. > On 18 December 2017 at 19:51, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: eadler > >> Date: Tue Dec 19 03:35:39 2017 > >> New Revision: 326958 > >> URL: https://svnweb.freebsd.org/changeset/base/326958 > >> > >> Log: > >> arclint: revert in prep for recommitting > > > > When you revert you need to sight the Rxxxxx(s) being reverted. > > > >> > >> Modified: > >> head/.arclint > >> > >> Modified: head/.arclint > >> ============================================================================== > >> --- head/.arclint Tue Dec 19 03:15:20 2017 (r326957) > >> +++ head/.arclint Tue Dec 19 03:35:39 2017 (r326958) > >> @@ -9,8 +9,7 @@ > >> "type": "spelling" > >> }, > >> "chmod": { > >> - "type": "chmod", > >> - "exclude": "(/tests/)" > >> + "type": "chmod" > >> }, > >> "merge-conflict": { > >> "type": "merge-conflict" > >> @@ -24,4 +23,3 @@ > >> } > >> } > >> } > >> - > > -- > > Rod Grimes rgrimes@freebsd.org > -- > Eitan Adler -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Tue Dec 19 19:44:08 2017 Return-Path: Delivered-To: svn-src-head@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 1144BE9B359; Tue, 19 Dec 2017 19:44:08 +0000 (UTC) (envelope-from emaste@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 DCC31680C9; Tue, 19 Dec 2017 19:44:07 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJi7wL084520; Tue, 19 Dec 2017 19:44:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJi7pV084519; Tue, 19 Dec 2017 19:44:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201712191944.vBJJi7pV084519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Dec 2017 19:44:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326992 - head/sys/tools X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/tools X-SVN-Commit-Revision: 326992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:44:08 -0000 Author: emaste Date: Tue Dec 19 19:44:06 2017 New Revision: 326992 URL: https://svnweb.freebsd.org/changeset/base/326992 Log: embed_mfs: support embedding mfs into loader The script originally supported embedding an mfs into ELF files or any other type of file, because it searched for magic strings to mark the beginning and end of the embeddable section. It was later modified to read the section offset and length via readelf, which made it work for ELF only. Restore the ability to update arbitrary file types by using the readelf technique for ELF, and the magic string technique for all others (including PE/COFF files like loader.efi). Submitted by: Zakary Nafziger MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12746 Modified: head/sys/tools/embed_mfs.sh Modified: head/sys/tools/embed_mfs.sh ============================================================================== --- head/sys/tools/embed_mfs.sh Tue Dec 19 19:18:48 2017 (r326991) +++ head/sys/tools/embed_mfs.sh Tue Dec 19 19:44:06 2017 (r326992) @@ -27,10 +27,10 @@ # # $FreeBSD$ # -# Embed the MFS image into the kernel body (expects space reserved via -# MD_ROOT_SIZE) +# Embed an MFS image into the kernel body or the loader body (expects space +# reserved via MD_ROOT_SIZE (kernel) or MD_IMAGE_SIZE (loader)) # -# $1: kernel filename +# $1: kernel or loader filename # $2: MFS image filename # @@ -47,16 +47,39 @@ mfs_size=`stat -f '%z' $2 2> /dev/null` # If we can't determine MFS image size - bail. [ -z ${mfs_size} ] && echo "Can't determine MFS image size" && exit 1 -sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` -# If we can't find the mfs section within the given kernel - bail. -[ -z "${sec_info}" ] && echo "Can't locate mfs section within $1" && exit 1 +err_no_mfs="Can't locate mfs section within " -sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2> /dev/null` -sec_start=`echo "${sec_info}" | awk '/sh_offset/ {print $2}' 2> /dev/null` +if [ `file -b $1 | grep -q '^ELF ..-bit .SB executable'` ]; then + sec_info=`elfdump -c $1 2> /dev/null | grep -A 5 -E "sh_name: oldmfs$"` + # If we can't find the mfs section within the given kernel - bail. + [ -z "${sec_info}" ] && echo "${err_no_mfs} $1" && exit 1 + + sec_size=`echo "${sec_info}" | awk '/sh_size/ {print $2}' 2>/dev/null` + sec_start=`echo "${sec_info}" | \ + awk '/sh_offset/ {print $2}' 2>/dev/null` + +else + + #try to find start byte of MFS start flag otherwise - bail. + sec_start=`strings -at d $1 | grep "MFS Filesystem goes here"` || \ + { echo "${err_no_mfs} $1"; exit 1; } + sec_start=`echo ${sec_start} | awk '{print $1}'` + + #try to find start byte of MFS end flag otherwise - bail. + sec_end=`strings -at d $1 | \ + grep "MFS Filesystem had better STOP here"` || \ + { echo "${err_no_mfs} $1"; exit 1; } + sec_end=`echo ${sec_end} | awk '{print $1}'` + + #calculate MFS section size + sec_size=`expr ${sec_end} - ${sec_start}` + +fi + # If the mfs section size is smaller than the mfs image - bail. [ ${sec_size} -lt ${mfs_size} ] && echo "MFS image too large" && exit 1 # Dump the mfs image into the mfs section dd if=$2 ibs=8192 of=$1 obs=${sec_start} oseek=1 conv=notrunc 2> /dev/null && \ - echo "MFS image embedded into kernel" && exit 0 + echo "MFS image embedded into $1" && exit 0 From owner-svn-src-head@freebsd.org Tue Dec 19 19:51:38 2017 Return-Path: Delivered-To: svn-src-head@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 7EFE4E9BB8D; Tue, 19 Dec 2017 19:51:38 +0000 (UTC) (envelope-from jhb@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 568A568751; Tue, 19 Dec 2017 19:51:38 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJpbxY087221; Tue, 19 Dec 2017 19:51:37 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJpab5087211; Tue, 19 Dec 2017 19:51:36 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191951.vBJJpab5087211@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:51:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326993 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/smbfs fs/tmpfs kern ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/devfs fs/ext2fs fs/fuse fs/msdosfs fs/nandfs fs/smbfs fs/tmpfs kern ufs/ufs X-SVN-Commit-Revision: 326993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:51:38 -0000 Author: jhb Date: Tue Dec 19 19:51:36 2017 New Revision: 326993 URL: https://svnweb.freebsd.org/changeset/base/326993 Log: Move NAME_MAX, LINK_MAX, and CHOWN_RESTRICTED out of vop_stdpathconf(). Having all filesystems fall through to default values isn't always correct and these values can vary for different filesystem implementations. Most of these changes just use the existing default values with a few exceptions: - Don't report CHOWN_RESTRICTED for ZFS since it doesn't do the exact permissions check this claims for chown(). - Use NANDFS_NAME_LEN for NAME_MAX for nandfs. - Don't report a LINK_MAX of 0 on smbfs. Now fail with EINVAL to indicate hard links aren't supported. Requested by: bde (though perhaps not this exact implementation) Reviewed by: kib (earlier version) MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/devfs/devfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fuse/fuse_vnops.c head/sys/fs/msdosfs/msdosfs_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/kern/vfs_default.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -5403,11 +5403,20 @@ zfs_freebsd_pathconf(ap) int error; error = zfs_pathconf(ap->a_vp, ap->a_name, &val, curthread->td_ucred, NULL); - if (error == 0) + if (error == 0) { *ap->a_retval = val; - else if (error == EOPNOTSUPP) - error = vop_stdpathconf(ap); - return (error); + return (error); + } + if (error != EOPNOTSUPP) + return (error); + + switch (ap->a_name) { + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + default: + return (vop_stdpathconf(ap)); + } } static int Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -1181,6 +1181,12 @@ devfs_pathconf(struct vop_pathconf_args *ap) { switch (ap->a_name) { + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + return (0); case _PC_MAX_CANON: if (ap->a_vp->v_vflag & VV_ISTTY) { *ap->a_retval = MAX_CANON; @@ -1209,6 +1215,9 @@ devfs_pathconf(struct vop_pathconf_args *ap) #else *ap->a_retval = 0; #endif + return (0); + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; return (0); default: return (vop_stdpathconf(ap)); Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -1633,6 +1633,12 @@ ext2_pathconf(struct vop_pathconf_args *ap) else *ap->a_retval = ext2_max_nlink(VTOI(ap->a_vp)); break; + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + break; + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -1184,6 +1184,12 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) case _PC_FILESIZEBITS: *ap->a_retval = 64; return (0); + case _PC_NAME_MAX: + *ap->a_retval = NAME_MAX; + return (0); + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + return (0); case _PC_SYMLINK_MAX: *ap->a_retval = MAXPATHLEN; return (0); Modified: head/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/msdosfs/msdosfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -1885,6 +1885,9 @@ msdosfs_pathconf(struct vop_pathconf_args *ap) case _PC_NAME_MAX: *ap->a_retval = pmp->pm_flags & MSDOSFSMNT_LONGNAME ? WIN_MAXLEN : 12; return (0); + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + return (0); case _PC_NO_TRUNC: *ap->a_retval = 0; return (0); Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -2238,6 +2238,15 @@ nandfs_pathconf(struct vop_pathconf_args *ap) error = 0; switch (ap->a_name) { + case _PC_LINK_MAX: + *ap->a_retval = LINK_MAX; + break; + case _PC_NAME_MAX: + *ap->a_retval = NANDFS_NAME_LEN; + break; + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/smbfs/smbfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -899,8 +899,6 @@ smbfs_pathconf (ap) int error = 0; switch (ap->a_name) { - case _PC_LINK_MAX: - *retval = 0; case _PC_FILESIZEBITS: if (vcp->vc_sopt.sv_caps & (SMB_CAP_LARGE_READX | SMB_CAP_LARGE_WRITEX)) Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -1348,6 +1348,18 @@ tmpfs_pathconf(struct vop_pathconf_args *v) error = 0; switch (name) { + case _PC_LINK_MAX: + *retval = LINK_MAX; + break; + + case _PC_NAME_MAX: + *retval = NAME_MAX; + break; + + case _PC_CHOWN_RESTRICTED: + *retval = 1; + break; + case _PC_NO_TRUNC: *retval = 1; break; Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/kern/vfs_default.c Tue Dec 19 19:51:36 2017 (r326993) @@ -479,20 +479,11 @@ vop_stdpathconf(ap) case _PC_ASYNC_IO: *ap->a_retval = _POSIX_ASYNCHRONOUS_IO; return (0); - case _PC_NAME_MAX: - *ap->a_retval = NAME_MAX; - return (0); case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; return (0); - case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; - return (0); case _PC_PIPE_BUF: *ap->a_retval = PIPE_BUF; - return (0); - case _PC_CHOWN_RESTRICTED: - *ap->a_retval = 1; return (0); default: return (EINVAL); Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Dec 19 19:44:06 2017 (r326992) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) @@ -2450,6 +2450,9 @@ ufs_pathconf(ap) case _PC_NAME_MAX: *ap->a_retval = UFS_MAXNAMLEN; break; + case _PC_CHOWN_RESTRICTED: + *ap->a_retval = 1; + break; case _PC_NO_TRUNC: *ap->a_retval = 1; break; From owner-svn-src-head@freebsd.org Tue Dec 19 19:53:35 2017 Return-Path: Delivered-To: svn-src-head@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 A524CE9BD27; Tue, 19 Dec 2017 19:53:35 +0000 (UTC) (envelope-from jhb@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 6F94B68992; Tue, 19 Dec 2017 19:53:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJrYhJ088782; Tue, 19 Dec 2017 19:53:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJrYTf088781; Tue, 19 Dec 2017 19:53:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191953.vBJJrYTf088781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326994 - head/sys/fs/devfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/devfs X-SVN-Commit-Revision: 326994 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:53:35 -0000 Author: jhb Date: Tue Dec 19 19:53:34 2017 New Revision: 326994 URL: https://svnweb.freebsd.org/changeset/base/326994 Log: Handle _PC_FILESIZEBITS and _PC_SYMLINK_MAX for devfs' VOP_PATHCONF(). MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 19:51:36 2017 (r326993) +++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 19:53:34 2017 (r326994) @@ -1181,11 +1181,17 @@ devfs_pathconf(struct vop_pathconf_args *ap) { switch (ap->a_name) { + case _PC_FILESIZEBITS: + *ap->a_retval = 64; + return (0); case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; return (0); case _PC_LINK_MAX: *ap->a_retval = LINK_MAX; + return (0); + case _PC_SYMLINK_MAX: + *ap->a_retval = MAXPATHLEN; return (0); case _PC_MAX_CANON: if (ap->a_vp->v_vflag & VV_ISTTY) { From owner-svn-src-head@freebsd.org Tue Dec 19 19:57:56 2017 Return-Path: Delivered-To: svn-src-head@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 94D50E9C146; Tue, 19 Dec 2017 19:57:56 +0000 (UTC) (envelope-from jhb@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 5D21268BD9; Tue, 19 Dec 2017 19:57:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJJvtmv089003; Tue, 19 Dec 2017 19:57:55 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJJvtJD089002; Tue, 19 Dec 2017 19:57:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712191957.vBJJvtJD089002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 19:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326995 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 326995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 19:57:56 -0000 Author: jhb Date: Tue Dec 19 19:57:55 2017 New Revision: 326995 URL: https://svnweb.freebsd.org/changeset/base/326995 Log: Use FUSE_LINK_MAX for LINK_MAX in fuse' VOP_PATHCONF(). Should have included this in r326993. MFC after: 1 month Sponsored by: Chelsio Communications Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:53:34 2017 (r326994) +++ head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 19:57:55 2017 (r326995) @@ -1188,7 +1188,7 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = NAME_MAX; return (0); case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; + *ap->a_retval = FUSE_LINK_MAX; return (0); case _PC_SYMLINK_MAX: *ap->a_retval = MAXPATHLEN; From owner-svn-src-head@freebsd.org Tue Dec 19 20:07:58 2017 Return-Path: Delivered-To: svn-src-head@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 BFEB1E9CB60; Tue, 19 Dec 2017 20:07:58 +0000 (UTC) (envelope-from jhb@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 89C0D692B2; Tue, 19 Dec 2017 20:07:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJK7vZ7093124; Tue, 19 Dec 2017 20:07:57 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJK7vne093123; Tue, 19 Dec 2017 20:07:57 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192007.vBJK7vne093123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 20:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326996 - head/sys/fs/devfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/devfs X-SVN-Commit-Revision: 326996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 20:07:58 -0000 Author: jhb Date: Tue Dec 19 20:07:57 2017 New Revision: 326996 URL: https://svnweb.freebsd.org/changeset/base/326996 Log: Report INT_MAX for LINK_MAX for devfs' VOP_PATHCONF(). devfs uses int's for link counts internally and already reports the the full link count via stat() post ino64. Sponsored by: Chelsio Communications Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 19:57:55 2017 (r326995) +++ head/sys/fs/devfs/devfs_vnops.c Tue Dec 19 20:07:57 2017 (r326996) @@ -1188,7 +1188,7 @@ devfs_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = NAME_MAX; return (0); case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; + *ap->a_retval = INT_MAX; return (0); case _PC_SYMLINK_MAX: *ap->a_retval = MAXPATHLEN; From owner-svn-src-head@freebsd.org Tue Dec 19 20:17:09 2017 Return-Path: Delivered-To: svn-src-head@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 0FD97E9D594; Tue, 19 Dec 2017 20:17:09 +0000 (UTC) (envelope-from jhb@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 CE81F699EF; Tue, 19 Dec 2017 20:17:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJKH79T097462; Tue, 19 Dec 2017 20:17:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJKH7gV097461; Tue, 19 Dec 2017 20:17:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192017.vBJKH7gV097461@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 20:17:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326997 - head/sys/fs/nandfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/nandfs X-SVN-Commit-Revision: 326997 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 20:17:09 -0000 Author: jhb Date: Tue Dec 19 20:17:07 2017 New Revision: 326997 URL: https://svnweb.freebsd.org/changeset/base/326997 Log: Honor NANDFS_LINK_MAX for post-ino64. This uses NANDFS_LINK_MAX instead of LINK_MAX for link overflow checks and the value reported by pathconf() / fpathconf(). Sponsored by: Chelsio Communications Modified: head/sys/fs/nandfs/nandfs_vnops.c Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 20:07:57 2017 (r326996) +++ head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 20:17:07 2017 (r326997) @@ -1354,7 +1354,7 @@ nandfs_link(struct vop_link_args *ap) struct nandfs_inode *inode = &node->nn_inode; int error; - if (inode->i_links_count >= LINK_MAX) + if (inode->i_links_count >= NANDFS_LINK_MAX) return (EMLINK); if (inode->i_flags & (IMMUTABLE | APPEND)) @@ -1576,7 +1576,7 @@ abortit: fdnode = VTON(fdvp); fnode = VTON(fvp); - if (fnode->nn_inode.i_links_count >= LINK_MAX) { + if (fnode->nn_inode.i_links_count >= NANDFS_LINK_MAX) { VOP_UNLOCK(fvp, 0); error = EMLINK; goto abortit; @@ -1839,7 +1839,7 @@ nandfs_mkdir(struct vop_mkdir_args *ap) if (nandfs_fs_full(dir_node->nn_nandfsdev)) return (ENOSPC); - if (dir_inode->i_links_count >= LINK_MAX) + if (dir_inode->i_links_count >= NANDFS_LINK_MAX) return (EMLINK); error = nandfs_node_create(nmp, &node, mode); @@ -2239,7 +2239,7 @@ nandfs_pathconf(struct vop_pathconf_args *ap) error = 0; switch (ap->a_name) { case _PC_LINK_MAX: - *ap->a_retval = LINK_MAX; + *ap->a_retval = NANDFS_LINK_MAX; break; case _PC_NAME_MAX: *ap->a_retval = NANDFS_NAME_LEN; From owner-svn-src-head@freebsd.org Tue Dec 19 20:19:09 2017 Return-Path: Delivered-To: svn-src-head@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 21BDCE9D7A8; Tue, 19 Dec 2017 20:19:09 +0000 (UTC) (envelope-from jhb@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 EC8FF69CA6; Tue, 19 Dec 2017 20:19:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJKJ7CD097736; Tue, 19 Dec 2017 20:19:07 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJKJ7H7097733; Tue, 19 Dec 2017 20:19:07 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192019.vBJKJ7H7097733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 20:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326998 - head/sys/fs/tmpfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/tmpfs X-SVN-Commit-Revision: 326998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 20:19:09 -0000 Author: jhb Date: Tue Dec 19 20:19:07 2017 New Revision: 326998 URL: https://svnweb.freebsd.org/changeset/base/326998 Log: Update tmpfs link count handling for ino64. Add a new TMPFS_LINK_MAX to use in place of LINK_MAX for link overflow checks and pathconf() reporting. Rather than storing a full 64-bit link count, just use a plain int and use INT_MAX as TMPFS_LINK_MAX. Discussed with: bde Reviewed by: kib (part of a larger patch) Sponsored by: Chelsio Communications Modified: head/sys/fs/tmpfs/tmpfs.h head/sys/fs/tmpfs/tmpfs_subr.c head/sys/fs/tmpfs/tmpfs_vnops.c Modified: head/sys/fs/tmpfs/tmpfs.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs.h Tue Dec 19 20:17:07 2017 (r326997) +++ head/sys/fs/tmpfs/tmpfs.h Tue Dec 19 20:19:07 2017 (r326998) @@ -188,8 +188,8 @@ struct tmpfs_node { uid_t tn_uid; /* (v) */ gid_t tn_gid; /* (v) */ mode_t tn_mode; /* (v) */ + int tn_links; /* (v) */ u_long tn_flags; /* (v) */ - nlink_t tn_links; /* (v) */ struct timespec tn_atime; /* (vi) */ struct timespec tn_mtime; /* (vi) */ struct timespec tn_ctime; /* (vi) */ @@ -296,6 +296,8 @@ LIST_HEAD(tmpfs_node_list, tmpfs_node); #define tn_link tn_spec.tn_link #define tn_reg tn_spec.tn_reg #define tn_fifo tn_spec.tn_fifo + +#define TMPFS_LINK_MAX INT_MAX #define TMPFS_NODE_LOCK(node) mtx_lock(&(node)->tn_interlock) #define TMPFS_NODE_UNLOCK(node) mtx_unlock(&(node)->tn_interlock) Modified: head/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_subr.c Tue Dec 19 20:17:07 2017 (r326997) +++ head/sys/fs/tmpfs/tmpfs_subr.c Tue Dec 19 20:19:07 2017 (r326998) @@ -739,8 +739,8 @@ tmpfs_alloc_file(struct vnode *dvp, struct vnode **vpp if (vap->va_type == VDIR) { /* Ensure that we do not overflow the maximum number of links * imposed by the system. */ - MPASS(dnode->tn_links <= LINK_MAX); - if (dnode->tn_links == LINK_MAX) { + MPASS(dnode->tn_links <= TMPFS_LINK_MAX); + if (dnode->tn_links == TMPFS_LINK_MAX) { return (EMLINK); } Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 20:17:07 2017 (r326997) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 20:19:07 2017 (r326998) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -618,8 +619,8 @@ tmpfs_link(struct vop_link_args *v) /* Ensure that we do not overflow the maximum number of links imposed * by the system. */ - MPASS(node->tn_links <= LINK_MAX); - if (node->tn_links == LINK_MAX) { + MPASS(node->tn_links <= TMPFS_LINK_MAX); + if (node->tn_links == TMPFS_LINK_MAX) { error = EMLINK; goto out; } @@ -1349,7 +1350,7 @@ tmpfs_pathconf(struct vop_pathconf_args *v) switch (name) { case _PC_LINK_MAX: - *retval = LINK_MAX; + *retval = TMPFS_LINK_MAX; break; case _PC_NAME_MAX: From owner-svn-src-head@freebsd.org Tue Dec 19 20:32:47 2017 Return-Path: Delivered-To: svn-src-head@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 11DD8E9E6EE; Tue, 19 Dec 2017 20:32:47 +0000 (UTC) (envelope-from shurd@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 D65866A74D; Tue, 19 Dec 2017 20:32:46 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJKWkYw006047; Tue, 19 Dec 2017 20:32:46 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJKWjDT006045; Tue, 19 Dec 2017 20:32:45 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712192032.vBJKWjDT006045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 20:32:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r326999 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 326999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 20:32:47 -0000 Author: shurd Date: Tue Dec 19 20:32:45 2017 New Revision: 326999 URL: https://svnweb.freebsd.org/changeset/base/326999 Log: Don't populate NVRAM sysctls for VFs Only the PF allows NVRAM interaction on bnxt devices. Submitted by: Bhargava Chenna Marreddy Sponsored by: Broadcom Limited Modified: head/sys/dev/bnxt/bnxt_sysctl.c head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt_sysctl.c ============================================================================== --- head/sys/dev/bnxt/bnxt_sysctl.c Tue Dec 19 20:19:07 2017 (r326998) +++ head/sys/dev/bnxt/bnxt_sysctl.c Tue Dec 19 20:32:45 2017 (r326999) @@ -74,14 +74,16 @@ bnxt_init_sysctl_ctx(struct bnxt_softc *softc) return ENOMEM; } - sysctl_ctx_init(&softc->nvm_info->nvm_ctx); - ctx = device_get_sysctl_ctx(softc->dev); - softc->nvm_info->nvm_oid = SYSCTL_ADD_NODE(ctx, - SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, - "nvram", CTLFLAG_RD, 0, "nvram information"); - if (!softc->nvm_info->nvm_oid) { - sysctl_ctx_free(&softc->nvm_info->nvm_ctx); - return ENOMEM; + if (BNXT_PF(softc)) { + sysctl_ctx_init(&softc->nvm_info->nvm_ctx); + ctx = device_get_sysctl_ctx(softc->dev); + softc->nvm_info->nvm_oid = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(softc->dev)), OID_AUTO, + "nvram", CTLFLAG_RD, 0, "nvram information"); + if (!softc->nvm_info->nvm_oid) { + sysctl_ctx_free(&softc->nvm_info->nvm_ctx); + return ENOMEM; + } } sysctl_ctx_init(&softc->hw_lro_ctx); @@ -127,7 +129,7 @@ bnxt_free_sysctl_ctx(struct bnxt_softc *softc) else softc->ver_info->ver_oid = NULL; } - if (softc->nvm_info->nvm_oid != NULL) { + if (BNXT_PF(softc) && softc->nvm_info->nvm_oid != NULL) { orc = sysctl_ctx_free(&softc->nvm_info->nvm_ctx); if (orc) rc = orc; Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 20:19:07 2017 (r326998) +++ head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 20:32:45 2017 (r326999) @@ -715,18 +715,21 @@ bnxt_attach_pre(if_ctx_t ctx) } /* Get NVRAM info */ - softc->nvm_info = malloc(sizeof(struct bnxt_nvram_info), - M_DEVBUF, M_NOWAIT | M_ZERO); - if (softc->nvm_info == NULL) { - rc = ENOMEM; - device_printf(softc->dev, - "Unable to allocate space for NVRAM info\n"); - goto nvm_alloc_fail; + if (BNXT_PF(softc)) { + softc->nvm_info = malloc(sizeof(struct bnxt_nvram_info), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (softc->nvm_info == NULL) { + rc = ENOMEM; + device_printf(softc->dev, + "Unable to allocate space for NVRAM info\n"); + goto nvm_alloc_fail; + } + + rc = bnxt_hwrm_nvm_get_dev_info(softc, &softc->nvm_info->mfg_id, + &softc->nvm_info->device_id, &softc->nvm_info->sector_size, + &softc->nvm_info->size, &softc->nvm_info->reserved_size, + &softc->nvm_info->available_size); } - rc = bnxt_hwrm_nvm_get_dev_info(softc, &softc->nvm_info->mfg_id, - &softc->nvm_info->device_id, &softc->nvm_info->sector_size, - &softc->nvm_info->size, &softc->nvm_info->reserved_size, - &softc->nvm_info->available_size); /* Register the driver with the FW */ rc = bnxt_hwrm_func_drv_rgtr(softc); @@ -859,9 +862,11 @@ bnxt_attach_pre(if_ctx_t ctx) rc = bnxt_init_sysctl_ctx(softc); if (rc) goto init_sysctl_failed; - rc = bnxt_create_nvram_sysctls(softc->nvm_info); - if (rc) - goto failed; + if (BNXT_PF(softc)) { + rc = bnxt_create_nvram_sysctls(softc->nvm_info); + if (rc) + goto failed; + } arc4rand(softc->vnic_info.rss_hash_key, HW_HASH_KEY_SIZE, 0); softc->vnic_info.rss_hash_type = @@ -894,7 +899,8 @@ failed: init_sysctl_failed: bnxt_hwrm_func_drv_unrgtr(softc, false); drv_rgtr_fail: - free(softc->nvm_info, M_DEVBUF); + if (BNXT_PF(softc)) + free(softc->nvm_info, M_DEVBUF); nvm_alloc_fail: ver_fail: free(softc->ver_info, M_DEVBUF); @@ -963,7 +969,8 @@ bnxt_detach(if_ctx_t ctx) for (i = 0; i < softc->nrxqsets; i++) free(softc->rx_rings[i].tpa_start, M_DEVBUF); free(softc->ver_info, M_DEVBUF); - free(softc->nvm_info, M_DEVBUF); + if (BNXT_PF(softc)) + free(softc->nvm_info, M_DEVBUF); bnxt_hwrm_func_drv_unrgtr(softc, false); bnxt_free_hwrm_dma_mem(softc); From owner-svn-src-head@freebsd.org Tue Dec 19 21:07:32 2017 Return-Path: Delivered-To: svn-src-head@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 6C9B9EA03A6; Tue, 19 Dec 2017 21:07:32 +0000 (UTC) (envelope-from shurd@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 4291B6B891; Tue, 19 Dec 2017 21:07:32 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJL7VxN022395; Tue, 19 Dec 2017 21:07:31 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJL7VCU022391; Tue, 19 Dec 2017 21:07:31 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712192107.vBJL7VCU022391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 21:07:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327000 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 327000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 21:07:32 -0000 Author: shurd Date: Tue Dec 19 21:07:30 2017 New Revision: 327000 URL: https://svnweb.freebsd.org/changeset/base/327000 Log: Support short HWRM commands New Stratus bnxt devices require support for short HWRM commands for VFs to function. Enable their use, but only use them if it's both supported and required... prefer the long HWRM commands when possible. Submitted by: Bhargava Chenna Marreddy Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D13269?id=36180 Modified: head/sys/dev/bnxt/bnxt.h head/sys/dev/bnxt/bnxt_hwrm.c head/sys/dev/bnxt/bnxt_hwrm.h head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/bnxt.h ============================================================================== --- head/sys/dev/bnxt/bnxt.h Tue Dec 19 20:32:45 2017 (r326999) +++ head/sys/dev/bnxt/bnxt.h Tue Dec 19 21:07:30 2017 (r327000) @@ -561,6 +561,7 @@ struct bnxt_softc { #define BNXT_FLAG_VF 0x0001 #define BNXT_FLAG_NPAR 0x0002 #define BNXT_FLAG_WOL_CAP 0x0004 +#define BNXT_FLAG_SHORT_CMD 0x0008 uint32_t flags; uint32_t total_msix; @@ -572,6 +573,7 @@ struct bnxt_softc { uint16_t hwrm_cmd_seq; uint32_t hwrm_cmd_timeo; /* milliseconds */ struct iflib_dma_info hwrm_cmd_resp; + struct iflib_dma_info hwrm_short_cmd_req_addr; /* Interrupt info for HWRM */ struct if_irq irq; struct mtx hwrm_lock; Modified: head/sys/dev/bnxt/bnxt_hwrm.c ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.c Tue Dec 19 20:32:45 2017 (r326999) +++ head/sys/dev/bnxt/bnxt_hwrm.c Tue Dec 19 21:07:30 2017 (r327000) @@ -122,12 +122,37 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg uint16_t cp_ring_id; uint8_t *valid; uint16_t err; + uint16_t max_req_len = HWRM_MAX_REQ_LEN; + struct hwrm_short_input short_input = {0}; /* TODO: DMASYNC in here. */ req->seq_id = htole16(softc->hwrm_cmd_seq++); memset(resp, 0, PAGE_SIZE); cp_ring_id = le16toh(req->cmpl_ring); + if (softc->flags & BNXT_FLAG_SHORT_CMD) { + void *short_cmd_req = softc->hwrm_short_cmd_req_addr.idi_vaddr; + + memcpy(short_cmd_req, req, msg_len); + memset((uint8_t *) short_cmd_req + msg_len, 0, softc->hwrm_max_req_len- + msg_len); + + short_input.req_type = req->req_type; + short_input.signature = + htole16(HWRM_SHORT_INPUT_SIGNATURE_SHORT_CMD); + short_input.size = htole16(msg_len); + short_input.req_addr = + htole64(softc->hwrm_short_cmd_req_addr.idi_paddr); + + data = (uint32_t *)&short_input; + msg_len = sizeof(short_input); + + /* Sync memory write before updating doorbell */ + wmb(); + + max_req_len = BNXT_HWRM_SHORT_REQ_LEN; + } + /* Write request msg to hwrm channel */ for (i = 0; i < msg_len; i += 4) { bus_space_write_4(softc->hwrm_bar.tag, @@ -137,7 +162,7 @@ _hwrm_send_message(struct bnxt_softc *softc, void *msg } /* Clear to the end of the request buffer */ - for (i = msg_len; i < HWRM_MAX_REQ_LEN; i += 4) + for (i = msg_len; i < max_req_len; i += 4) bus_space_write_4(softc->hwrm_bar.tag, softc->hwrm_bar.handle, i, 0); @@ -248,6 +273,7 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) int rc; const char nastr[] = ""; const char naver[] = ""; + uint32_t dev_caps_cfg; softc->hwrm_max_req_len = HWRM_MAX_REQ_LEN; softc->hwrm_cmd_timeo = 1000; @@ -322,6 +348,11 @@ bnxt_hwrm_ver_get(struct bnxt_softc *softc) softc->hwrm_max_req_len = le16toh(resp->max_req_win_len); if (resp->def_req_timeout) softc->hwrm_cmd_timeo = le16toh(resp->def_req_timeout); + + dev_caps_cfg = le32toh(resp->dev_caps_cfg); + if ((dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_SUPPORTED) && + (dev_caps_cfg & HWRM_VER_GET_OUTPUT_DEV_CAPS_CFG_SHORT_CMD_REQUIRED)) + softc->flags |= BNXT_FLAG_SHORT_CMD; fail: BNXT_HWRM_UNLOCK(softc); Modified: head/sys/dev/bnxt/bnxt_hwrm.h ============================================================================== --- head/sys/dev/bnxt/bnxt_hwrm.h Tue Dec 19 20:32:45 2017 (r326999) +++ head/sys/dev/bnxt/bnxt_hwrm.h Tue Dec 19 21:07:30 2017 (r327000) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #define BNXT_PAUSE_RX (HWRM_PORT_PHY_QCFG_OUTPUT_PAUSE_RX) #define BNXT_AUTO_PAUSE_AUTONEG_PAUSE \ (HWRM_PORT_PHY_QCFG_OUTPUT_AUTO_PAUSE_AUTONEG_PAUSE) +#define BNXT_HWRM_SHORT_REQ_LEN sizeof(struct hwrm_short_input) /* HWRM Function Prototypes */ int bnxt_alloc_hwrm_dma_mem(struct bnxt_softc *softc); Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 20:32:45 2017 (r326999) +++ head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 21:07:30 2017 (r327000) @@ -643,6 +643,23 @@ cp_alloc_fail: return rc; } +static void bnxt_free_hwrm_short_cmd_req(struct bnxt_softc *softc) +{ + if (softc->hwrm_short_cmd_req_addr.idi_vaddr) + iflib_dma_free(&softc->hwrm_short_cmd_req_addr); + softc->hwrm_short_cmd_req_addr.idi_vaddr = NULL; +} + +static int bnxt_alloc_hwrm_short_cmd_req(struct bnxt_softc *softc) +{ + int rc; + + rc = iflib_dma_alloc(softc->ctx, softc->hwrm_max_req_len, + &softc->hwrm_short_cmd_req_addr, BUS_DMA_NOWAIT); + + return rc; +} + /* Device setup and teardown */ static int bnxt_attach_pre(if_ctx_t ctx) @@ -714,6 +731,12 @@ bnxt_attach_pre(if_ctx_t ctx) goto ver_fail; } + if (softc->flags & BNXT_FLAG_SHORT_CMD) { + rc = bnxt_alloc_hwrm_short_cmd_req(softc); + if (rc) + goto hwrm_short_cmd_alloc_fail; + } + /* Get NVRAM info */ if (BNXT_PF(softc)) { softc->nvm_info = malloc(sizeof(struct bnxt_nvram_info), @@ -902,6 +925,8 @@ drv_rgtr_fail: if (BNXT_PF(softc)) free(softc->nvm_info, M_DEVBUF); nvm_alloc_fail: + bnxt_free_hwrm_short_cmd_req(softc); +hwrm_short_cmd_alloc_fail: ver_fail: free(softc->ver_info, M_DEVBUF); ver_alloc_fail: @@ -974,6 +999,7 @@ bnxt_detach(if_ctx_t ctx) bnxt_hwrm_func_drv_unrgtr(softc, false); bnxt_free_hwrm_dma_mem(softc); + bnxt_free_hwrm_short_cmd_req(softc); BNXT_HWRM_LOCK_DESTROY(softc); pci_disable_busmaster(softc->dev); From owner-svn-src-head@freebsd.org Tue Dec 19 22:06:27 2017 Return-Path: Delivered-To: svn-src-head@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 0AD08EA3B2A; Tue, 19 Dec 2017 22:06:27 +0000 (UTC) (envelope-from shurd@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 CC4D96DDC0; Tue, 19 Dec 2017 22:06:26 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJM6PsB049647; Tue, 19 Dec 2017 22:06:25 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJM6Pqo049646; Tue, 19 Dec 2017 22:06:25 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712192206.vBJM6Pqo049646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 22:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327001 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 327001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:06:27 -0000 Author: shurd Date: Tue Dec 19 22:06:25 2017 New Revision: 327001 URL: https://svnweb.freebsd.org/changeset/base/327001 Log: On Link up & down, update media types It's possible to change the SFP module when link is down, which would change the available media types. This is part of D13358. Submitted by: Bhargava Chenna Marreddy Sponsored by: Broadcom Limited Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 21:07:30 2017 (r327000) +++ head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 22:06:25 2017 (r327001) @@ -2224,6 +2224,10 @@ bnxt_report_link(struct bnxt_softc *softc) link_info->last_flow_ctrl.tx = link_info->flow_ctrl.tx; link_info->last_flow_ctrl.rx = link_info->flow_ctrl.rx; link_info->last_flow_ctrl.autoneg = link_info->flow_ctrl.autoneg; + /* update media types */ + ifmedia_removeall(softc->media); + bnxt_add_media_types(softc); + ifmedia_set(softc->media, IFM_ETHER | IFM_AUTO); } static int From owner-svn-src-head@freebsd.org Tue Dec 19 22:15:48 2017 Return-Path: Delivered-To: svn-src-head@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 3A6A6EA4324; Tue, 19 Dec 2017 22:15:48 +0000 (UTC) (envelope-from shurd@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 078D36E45C; Tue, 19 Dec 2017 22:15:47 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJMFlPt054832; Tue, 19 Dec 2017 22:15:47 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJMFlXh054831; Tue, 19 Dec 2017 22:15:47 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712192215.vBJMFlXh054831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 19 Dec 2017 22:15:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327003 - head/sys/dev/bnxt X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/dev/bnxt X-SVN-Commit-Revision: 327003 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:15:48 -0000 Author: shurd Date: Tue Dec 19 22:15:46 2017 New Revision: 327003 URL: https://svnweb.freebsd.org/changeset/base/327003 Log: Add log messages for unknown and unhandled phy types Previously, it silently only supported auto, instead, log a message indicating why only auto is supported. Submitted by: Bhargava Chenna Marreddy Sponsored by: Broadcom Limited Differential Revision: https://reviews.freebsd.org/D13358 Modified: head/sys/dev/bnxt/if_bnxt.c Modified: head/sys/dev/bnxt/if_bnxt.c ============================================================================== --- head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 22:08:57 2017 (r327002) +++ head/sys/dev/bnxt/if_bnxt.c Tue Dec 19 22:15:46 2017 (r327003) @@ -2085,8 +2085,13 @@ bnxt_add_media_types(struct bnxt_softc *softc) break; case HWRM_PORT_PHY_QCFG_OUTPUT_PHY_TYPE_UNKNOWN: - default: /* Only Autoneg is supported for TYPE_UNKNOWN */ + device_printf(softc->dev, "Unknown phy type\n"); + break; + + default: + /* Only Autoneg is supported for new phy type values */ + device_printf(softc->dev, "phy type %d not supported by driver\n", phy_type); break; } From owner-svn-src-head@freebsd.org Tue Dec 19 22:39:08 2017 Return-Path: Delivered-To: svn-src-head@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 CB6D4EA558A; Tue, 19 Dec 2017 22:39:08 +0000 (UTC) (envelope-from jhb@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 029DA6F0A4; Tue, 19 Dec 2017 22:39:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJMd6F4063283; Tue, 19 Dec 2017 22:39:06 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJMd50Q063272; Tue, 19 Dec 2017 22:39:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192239.vBJMd50Q063272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 22:39:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327004 - in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/ext2fs fs/fifofs fs/nandfs fs/nfsclient fs/tmpfs fs/udf kern ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/ext2fs fs/fifofs fs/nandfs fs/nfsclient fs/tmpfs fs/udf kern ufs/ufs X-SVN-Commit-Revision: 327004 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:39:09 -0000 Author: jhb Date: Tue Dec 19 22:39:05 2017 New Revision: 327004 URL: https://svnweb.freebsd.org/changeset/base/327004 Log: Rework pathconf handling for FIFOs. On the one hand, FIFOs should respect other variables not supported by the fifofs vnode operation (such as _PC_NAME_MAX, _PC_LINK_MAX, etc.). These values are fs-specific and must come from a fs-specific method. On the other hand, filesystems that support FIFOs are required to support _PC_PIPE_BUF on directory vnodes that can contain FIFOs. Given this latter requirement, once the fs-specific VOP_PATHCONF method supports _PC_PIPE_BUF for directories, it is also suitable for FIFOs permitting a single VOP_PATHCONF method to be used for both FIFOs and non-FIFOs. To that end, retire all of the FIFO-specific pathconf methods from filesystems and change FIFO-specific vnode operation switches to use the existing fs-specific VOP_PATHCONF method. For fifofs, set it's VOP_PATHCONF to VOP_PANIC since it should no longer be used. While here, move _PC_PIPE_BUF handling out of vop_stdpathconf() so that only filesystems supporting FIFOs will report a value. In addition, only report a valid _PC_PIPE_BUF for directories and FIFOs. Discussed with: bde Reviewed by: kib (part of a larger patch) MFC after: 1 month Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12572 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c head/sys/fs/ext2fs/ext2_vnops.c head/sys/fs/fifofs/fifo_vnops.c head/sys/fs/nandfs/nandfs_vnops.c head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/tmpfs/tmpfs_fifoops.c head/sys/fs/tmpfs/tmpfs_vnops.c head/sys/fs/tmpfs/tmpfs_vnops.h head/sys/fs/udf/udf_vnops.c head/sys/kern/vfs_default.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -5414,31 +5414,17 @@ zfs_freebsd_pathconf(ap) case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; return (0); + case _PC_PIPE_BUF: + if (ap->a_vp->v_type == VDIR || ap->a_vp->v_type == VFIFO) { + *ap->a_retval = PIPE_BUF; + return (0); + } + return (EINVAL); default: return (vop_stdpathconf(ap)); } } -static int -zfs_freebsd_fifo_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - register_t *a_retval; - } */ *ap; -{ - - switch (ap->a_name) { - case _PC_ACL_EXTENDED: - case _PC_ACL_NFS4: - case _PC_ACL_PATH_MAX: - case _PC_MAC_PRESENT: - return (zfs_freebsd_pathconf(ap)); - default: - return (fifo_specops.vop_pathconf(ap)); - } -} - /* * FreeBSD's extended attributes namespace defines file name prefix for ZFS' * extended attribute name: @@ -6050,7 +6036,7 @@ struct vop_vector zfs_fifoops = { .vop_reclaim = zfs_freebsd_reclaim, .vop_setattr = zfs_freebsd_setattr, .vop_write = VOP_PANIC, - .vop_pathconf = zfs_freebsd_fifo_pathconf, + .vop_pathconf = zfs_freebsd_pathconf, .vop_fid = zfs_freebsd_fid, .vop_getacl = zfs_freebsd_getacl, .vop_setacl = zfs_freebsd_setacl, Modified: head/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- head/sys/fs/ext2fs/ext2_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/ext2fs/ext2_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -180,6 +180,7 @@ struct vop_vector ext2_fifoops = { .vop_getattr = ext2_getattr, .vop_inactive = ext2_inactive, .vop_kqfilter = ext2fifo_kqfilter, + .vop_pathconf = ext2_pathconf, .vop_print = ext2_print, .vop_read = VOP_PANIC, .vop_reclaim = ext2_reclaim, @@ -1635,6 +1636,12 @@ ext2_pathconf(struct vop_pathconf_args *ap) break; case _PC_NAME_MAX: *ap->a_retval = NAME_MAX; + break; + case _PC_PIPE_BUF: + if (ap->a_vp->v_type == VDIR || ap->a_vp->v_type == VFIFO) + *ap->a_retval = PIPE_BUF; + else + error = EINVAL; break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; Modified: head/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- head/sys/fs/fifofs/fifo_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/fifofs/fifo_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -88,7 +88,7 @@ struct vop_vector fifo_specops = { .vop_mkdir = VOP_PANIC, .vop_mknod = VOP_PANIC, .vop_open = fifo_open, - .vop_pathconf = vop_stdpathconf, + .vop_pathconf = VOP_PANIC, .vop_print = fifo_print, .vop_read = VOP_PANIC, .vop_readdir = VOP_PANIC, Modified: head/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/nandfs/nandfs_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -2244,6 +2244,12 @@ nandfs_pathconf(struct vop_pathconf_args *ap) case _PC_NAME_MAX: *ap->a_retval = NANDFS_NAME_LEN; break; + case _PC_PIPE_BUF: + if (ap->a_vp->v_type == VDIR || ap->a_vp->v_type == VFIFO) + *ap->a_retval = PIPE_BUF; + else + error = EINVAL; + break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; break; @@ -2414,6 +2420,7 @@ struct vop_vector nandfs_fifoops = { .vop_close = nandfsfifo_close, .vop_getattr = nandfs_getattr, .vop_inactive = nandfs_inactive, + .vop_pathconf = nandfs_pathconf, .vop_print = nandfs_print, .vop_read = VOP_PANIC, .vop_reclaim = nandfs_reclaim, Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -189,6 +189,7 @@ struct vop_vector newnfs_fifoops = { .vop_fsync = nfs_fsync, .vop_getattr = nfs_getattr, .vop_inactive = ncl_inactive, + .vop_pathconf = nfs_pathconf, .vop_print = nfs_print, .vop_read = nfsfifo_read, .vop_reclaim = ncl_reclaim, @@ -3464,6 +3465,12 @@ nfs_pathconf(struct vop_pathconf_args *ap) break; case _PC_NAME_MAX: *ap->a_retval = pc.pc_namemax; + break; + case _PC_PIPE_BUF: + if (ap->a_vp->v_type == VDIR || ap->a_vp->v_type == VFIFO) + *ap->a_retval = PIPE_BUF; + else + error = EINVAL; break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = pc.pc_chownrestricted; Modified: head/sys/fs/tmpfs/tmpfs_fifoops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_fifoops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/tmpfs/tmpfs_fifoops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -71,5 +71,6 @@ struct vop_vector tmpfs_fifoop_entries = { .vop_access = tmpfs_access, .vop_getattr = tmpfs_getattr, .vop_setattr = tmpfs_setattr, + .vop_pathconf = tmpfs_pathconf, .vop_print = tmpfs_print, }; Modified: head/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/tmpfs/tmpfs_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -1338,9 +1338,10 @@ tmpfs_print(struct vop_print_args *v) return 0; } -static int +int tmpfs_pathconf(struct vop_pathconf_args *v) { + struct vnode *vp = v->a_vp; int name = v->a_name; register_t *retval = v->a_retval; @@ -1355,6 +1356,13 @@ tmpfs_pathconf(struct vop_pathconf_args *v) case _PC_NAME_MAX: *retval = NAME_MAX; + break; + + case _PC_PIPE_BUF: + if (vp->v_type == VDIR || vp->v_type == VFIFO) + *retval = PIPE_BUF; + else + error = EINVAL; break; case _PC_CHOWN_RESTRICTED: Modified: head/sys/fs/tmpfs/tmpfs_vnops.h ============================================================================== --- head/sys/fs/tmpfs/tmpfs_vnops.h Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/tmpfs/tmpfs_vnops.h Tue Dec 19 22:39:05 2017 (r327004) @@ -51,6 +51,7 @@ extern struct vop_vector tmpfs_vnodeop_nonc_entries; vop_access_t tmpfs_access; vop_getattr_t tmpfs_getattr; vop_setattr_t tmpfs_setattr; +vop_pathconf_t tmpfs_pathconf; vop_print_t tmpfs_print; vop_reclaim_t tmpfs_reclaim; Modified: head/sys/fs/udf/udf_vnops.c ============================================================================== --- head/sys/fs/udf/udf_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/fs/udf/udf_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -102,6 +102,7 @@ struct vop_vector udf_fifoops = { .vop_default = &fifo_specops, .vop_access = udf_access, .vop_getattr = udf_getattr, + .vop_pathconf = udf_pathconf, .vop_print = udf_print, .vop_reclaim = udf_reclaim, .vop_setattr = udf_setattr, @@ -400,6 +401,12 @@ udf_pathconf(struct vop_pathconf_args *a) case _PC_NO_TRUNC: *a->a_retval = 1; return (0); + case _PC_PIPE_BUF: + if (a->a_vp->v_type == VDIR || a->a_vp->v_type == VFIFO) { + *a->a_retval = PIPE_BUF; + return (0); + } + return (EINVAL); default: return (vop_stdpathconf(a)); } Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/kern/vfs_default.c Tue Dec 19 22:39:05 2017 (r327004) @@ -482,9 +482,6 @@ vop_stdpathconf(ap) case _PC_PATH_MAX: *ap->a_retval = PATH_MAX; return (0); - case _PC_PIPE_BUF: - *ap->a_retval = PIPE_BUF; - return (0); default: return (EINVAL); } Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Dec 19 22:15:46 2017 (r327003) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Dec 19 22:39:05 2017 (r327004) @@ -124,7 +124,6 @@ static vop_symlink_t ufs_symlink; static vop_whiteout_t ufs_whiteout; static vop_close_t ufsfifo_close; static vop_kqfilter_t ufsfifo_kqfilter; -static vop_pathconf_t ufsfifo_pathconf; SYSCTL_NODE(_vfs, OID_AUTO, ufs, CTLFLAG_RD, 0, "UFS filesystem"); @@ -2406,30 +2405,6 @@ ufsfifo_kqfilter(ap) } /* - * Return POSIX pathconf information applicable to fifos. - */ -static int -ufsfifo_pathconf(ap) - struct vop_pathconf_args /* { - struct vnode *a_vp; - int a_name; - int *a_retval; - } */ *ap; -{ - - switch (ap->a_name) { - case _PC_ACL_EXTENDED: - case _PC_ACL_NFS4: - case _PC_ACL_PATH_MAX: - case _PC_MAC_PRESENT: - return (ufs_pathconf(ap)); - default: - return (fifo_specops.vop_pathconf(ap)); - } - /* NOTREACHED */ -} - -/* * Return POSIX pathconf information applicable to ufs filesystems. */ static int @@ -2450,6 +2425,12 @@ ufs_pathconf(ap) case _PC_NAME_MAX: *ap->a_retval = UFS_MAXNAMLEN; break; + case _PC_PIPE_BUF: + if (ap->a_vp->v_type == VDIR || ap->a_vp->v_type == VFIFO) + *ap->a_retval = PIPE_BUF; + else + error = EINVAL; + break; case _PC_CHOWN_RESTRICTED: *ap->a_retval = 1; break; @@ -2803,7 +2784,7 @@ struct vop_vector ufs_fifoops = { .vop_inactive = ufs_inactive, .vop_kqfilter = ufsfifo_kqfilter, .vop_markatime = ufs_markatime, - .vop_pathconf = ufsfifo_pathconf, + .vop_pathconf = ufs_pathconf, .vop_print = ufs_print, .vop_read = VOP_PANIC, .vop_reclaim = ufs_reclaim, From owner-svn-src-head@freebsd.org Tue Dec 19 22:40:18 2017 Return-Path: Delivered-To: svn-src-head@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 84D3DEA577B; Tue, 19 Dec 2017 22:40:18 +0000 (UTC) (envelope-from pfg@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 5E8C36F354; Tue, 19 Dec 2017 22:40:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJMeHcd063423; Tue, 19 Dec 2017 22:40:17 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJMeGg8063411; Tue, 19 Dec 2017 22:40:16 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712192240.vBJMeGg8063411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Tue, 19 Dec 2017 22:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: sbin/ipfw sys/sys usr.sbin/watch X-SVN-Commit-Revision: 327005 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:40:18 -0000 Author: pfg Date: Tue Dec 19 22:40:16 2017 New Revision: 327005 URL: https://svnweb.freebsd.org/changeset/base/327005 Log: SPDX: These are fundamentally BSD-2-Clause. They just omit the introductory line and numbering. Modified: head/sbin/ipfw/altq.c head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/ipv6.c head/sbin/ipfw/main.c head/sbin/ipfw/nat.c head/sys/sys/msg.h head/sys/sys/snoop.h head/usr.sbin/watch/watch.c Modified: head/sbin/ipfw/altq.c ============================================================================== --- head/sbin/ipfw/altq.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/altq.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/dummynet.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*. + * SPDX-License-Identifier: BSD-2-Clause + * * Codel/FQ_Codel and PIE/FQ_PIE Code: * Copyright (C) 2016 Centre for Advanced Internet Architectures, * Swinburne University of Technology, Melbourne, Australia. Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/ipfw2.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/ipfw2.h Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/ipv6.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/main.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003,2010 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/sbin/ipfw/nat.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: BSD-2-Clause + * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Tue Dec 19 22:39:05 2017 (r327004) +++ head/sys/sys/msg.h Tue Dec 19 22:40:16 2017 (r327005) @@ -6,7 +6,7 @@ * * Author: Daniel Boulet * - * SPDX-License-Identifier: BSD-1-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright 1993 Daniel Boulet and RTMX Inc. * Modified: head/sys/sys/snoop.h ============================================================================== --- head/sys/sys/snoop.h Tue Dec 19 22:39:05 2017 (r327004) +++ head/sys/sys/snoop.h Tue Dec 19 22:40:16 2017 (r327005) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-1-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1995 Ugen J.S.Antsilevich * Modified: head/usr.sbin/watch/watch.c ============================================================================== --- head/usr.sbin/watch/watch.c Tue Dec 19 22:39:05 2017 (r327004) +++ head/usr.sbin/watch/watch.c Tue Dec 19 22:40:16 2017 (r327005) @@ -1,5 +1,5 @@ /*- - * SPDX-License-Identifier: BSD-1-Clause + * SPDX-License-Identifier: BSD-2-Clause * * Copyright (c) 1995 Ugen J.S.Antsilevich * From owner-svn-src-head@freebsd.org Tue Dec 19 22:40:55 2017 Return-Path: Delivered-To: svn-src-head@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 99A7AEA586A; Tue, 19 Dec 2017 22:40:55 +0000 (UTC) (envelope-from jhb@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 65CA16F4E6; Tue, 19 Dec 2017 22:40:55 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJMeskP064255; Tue, 19 Dec 2017 22:40:54 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJMesll064253; Tue, 19 Dec 2017 22:40:54 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192240.vBJMesll064253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 22:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327006 - head/sys/fs/fuse X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/fuse X-SVN-Commit-Revision: 327006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:40:55 -0000 Author: jhb Date: Tue Dec 19 22:40:54 2017 New Revision: 327006 URL: https://svnweb.freebsd.org/changeset/base/327006 Log: Update link count handling in fuse for post-ino64. Set FUSE_LINK_MAX to UINT32_MAX instead of LINK_MAX to match the maximum link count possible in the 'nlink' field of 'struct fuse_attr'. Sponsored by: Chelsio Communications Modified: head/sys/fs/fuse/fuse_param.h head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_param.h ============================================================================== --- head/sys/fs/fuse/fuse_param.h Tue Dec 19 22:40:16 2017 (r327005) +++ head/sys/fs/fuse/fuse_param.h Tue Dec 19 22:40:54 2017 (r327006) @@ -77,6 +77,6 @@ #endif -#define FUSE_LINK_MAX LINK_MAX +#define FUSE_LINK_MAX UINT32_MAX #endif /* _FUSE_PARAM_H_ */ Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 22:40:16 2017 (r327005) +++ head/sys/fs/fuse/fuse_vnops.c Tue Dec 19 22:40:54 2017 (r327006) @@ -1188,7 +1188,7 @@ fuse_vnop_pathconf(struct vop_pathconf_args *ap) *ap->a_retval = NAME_MAX; return (0); case _PC_LINK_MAX: - *ap->a_retval = FUSE_LINK_MAX; + *ap->a_retval = MIN(LONG_MAX, FUSE_LINK_MAX); return (0); case _PC_SYMLINK_MAX: *ap->a_retval = MAXPATHLEN; From owner-svn-src-head@freebsd.org Tue Dec 19 22:43:40 2017 Return-Path: Delivered-To: svn-src-head@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 738FAEA5AE5; Tue, 19 Dec 2017 22:43:40 +0000 (UTC) (envelope-from jhb@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 400ED6F898; Tue, 19 Dec 2017 22:43:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJMhdke067491; Tue, 19 Dec 2017 22:43:39 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJMhd2x067490; Tue, 19 Dec 2017 22:43:39 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192243.vBJMhd2x067490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 22:43:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327007 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 327007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 22:43:40 -0000 Author: jhb Date: Tue Dec 19 22:43:39 2017 New Revision: 327007 URL: https://svnweb.freebsd.org/changeset/base/327007 Log: Replace one more LINK_MAX with NFS_LINK_MAX missed in r326991. Sponsored by: Chelsio Communications Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue Dec 19 22:40:54 2017 (r327006) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue Dec 19 22:43:39 2017 (r327007) @@ -2301,7 +2301,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount break; case NFSATTRBIT_MAXLINK: NFSM_BUILD(tl, u_int32_t *, NFSX_UNSIGNED); - *tl = txdr_unsigned(LINK_MAX); + *tl = txdr_unsigned(NFS_LINK_MAX); retnum += NFSX_UNSIGNED; break; case NFSATTRBIT_MAXNAME: From owner-svn-src-head@freebsd.org Tue Dec 19 23:54:45 2017 Return-Path: Delivered-To: svn-src-head@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 ABEB5E83CFA; Tue, 19 Dec 2017 23:54:45 +0000 (UTC) (envelope-from jhb@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 78AB271D45; Tue, 19 Dec 2017 23:54:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBJNsiQd096493; Tue, 19 Dec 2017 23:54:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBJNsiok096492; Tue, 19 Dec 2017 23:54:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201712192354.vBJNsiok096492@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 19 Dec 2017 23:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327009 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 327009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Dec 2017 23:54:45 -0000 Author: jhb Date: Tue Dec 19 23:54:44 2017 New Revision: 327009 URL: https://svnweb.freebsd.org/changeset/base/327009 Log: Don't return early for non-failure for one of the EMLINK checks. r326987 enabled two #if 0'd-out EMLINK checks in zfs_link_create() for link overflow. However, one of the checks (when the vnode adding a link is a directory such as for mkdir) always returned even if the link did not overflow. Change this to only return early if it needs to report an EMLINK error. Reported by: db, shurd Sponsored by: Chelsio Communications Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 23:00:08 2017 (r327008) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c Tue Dec 19 23:54:44 2017 (r327009) @@ -529,10 +529,8 @@ zfs_link_create(znode_t *dzp, const char *name, znode_ ASSERT_VOP_ELOCKED(ZTOV(zp), __func__); #ifdef __FreeBSD__ if (zp_is_dir) { - error = 0; if (dzp->z_links >= ZFS_LINK_MAX) - error = SET_ERROR(EMLINK); - return (error); + return (SET_ERROR(EMLINK)); } #endif if (!(flag & ZRENAMING)) { From owner-svn-src-head@freebsd.org Wed Dec 20 00:15:37 2017 Return-Path: Delivered-To: svn-src-head@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 C4EBDE85105; Wed, 20 Dec 2017 00:15:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B52307280E; Wed, 20 Dec 2017 00:15:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBK0FRfH023260; Tue, 19 Dec 2017 16:15:27 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBK0FRwX023259; Tue, 19 Dec 2017 16:15:27 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712200015.vBK0FRwX023259@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch In-Reply-To: <201712192240.vBJMeGg8063411@repo.freebsd.org> To: "Pedro F. Giffuni" Date: Tue, 19 Dec 2017 16:15:27 -0800 (PST) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 00:15:38 -0000 > Author: pfg > Date: Tue Dec 19 22:40:16 2017 > New Revision: 327005 > URL: https://svnweb.freebsd.org/changeset/base/327005 > > Log: > SPDX: These are fundamentally BSD-2-Clause. > > They just omit the introductory line and numbering. I again must assert that it would be better to not apply an SPDX than to apply one that is not an exact match for the license. > Modified: > head/sbin/ipfw/altq.c > head/sbin/ipfw/dummynet.c > head/sbin/ipfw/ipfw2.c > head/sbin/ipfw/ipfw2.h > head/sbin/ipfw/ipv6.c > head/sbin/ipfw/main.c > head/sbin/ipfw/nat.c > head/sys/sys/msg.h > head/sys/sys/snoop.h > head/usr.sbin/watch/watch.c ... -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Dec 20 00:27:45 2017 Return-Path: Delivered-To: svn-src-head@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 20484E85B59; Wed, 20 Dec 2017 00:27:45 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23EC72E61; Wed, 20 Dec 2017 00:27:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 91A5510A87D; Tue, 19 Dec 2017 19:27:43 -0500 (EST) From: John Baldwin To: src-committers@freebsd.org Cc: svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327009 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs Date: Tue, 19 Dec 2017 15:59:52 -0800 Message-ID: <1822377.LL8RI7UkXd@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201712192354.vBJNsiok096492@repo.freebsd.org> References: <201712192354.vBJNsiok096492@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 19 Dec 2017 19:27:43 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 00:27:45 -0000 On Tuesday, December 19, 2017 11:54:44 PM John Baldwin wrote: > Author: jhb > Date: Tue Dec 19 23:54:44 2017 > New Revision: 327009 > URL: https://svnweb.freebsd.org/changeset/base/327009 > > Log: > Don't return early for non-failure for one of the EMLINK checks. > > r326987 enabled two #if 0'd-out EMLINK checks in zfs_link_create() for > link overflow. However, one of the checks (when the vnode adding a link > is a directory such as for mkdir) always returned even if the link did not > overflow. Change this to only return early if it needs to report an > EMLINK error. Most of the callers of zfs_link_create() explicitly don't check for errors, so any EMLINK error is silently dropped and not reported anyway if you manage to overflow the link count. The Solaris code appears to just not detect/care about overflow. Perhaps it takes so long to actually create 2^64 links to trigger an overflow that it can be safely ignored in which case we could just drop these (ignored) checks. If the error handling isn't atrocious it might be nice to fix the callers to honor errors though. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Dec 20 00:34:30 2017 Return-Path: Delivered-To: svn-src-head@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 034EEE862BD; Wed, 20 Dec 2017 00:34:30 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFDAF735B3; Wed, 20 Dec 2017 00:34:29 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from helicon.physics.ucla.edu (helicon.physics.ucla.edu [169.232.156.253]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id vBK0YPw4009889 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Tue, 19 Dec 2017 16:34:26 -0800 Subject: Re: svn commit: r326758 - in head/sys/i386: conf include To: John Baldwin , Eugene Grosbein , Konstantin Belousov , Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <20171211091943.GF2272@kib.kiev.ua> <5A2E5D44.9030904@grosbein.net> <4a9c76c9-8063-9420-b198-14487b089840@FreeBSD.org> From: Nathan Whitehorn Message-ID: <9b4b021b-dbf5-b788-2e23-6a49efa95da8@freebsd.org> Date: Tue, 19 Dec 2017 16:34:25 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <4a9c76c9-8063-9420-b198-14487b089840@FreeBSD.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZBX1ky9ANZODUU+Fr5DEkYXnT+PRhdax6eloy8PokTIYoPjwrcFwUVRux8U4fe0cr6qJVqXCN66KkdjeR7G6xkGNP2Da4Xr08= X-Sonic-ID: C;2tMyiB3l5xGiZusnWtmBlw== M;apCViB3l5xGiZusnWtmBlw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 00:34:30 -0000 On 12/12/17 11:32, John Baldwin wrote: > On 12/11/17 5:26 AM, Eugene Grosbein wrote: >> On 11.12.2017 16:19, Konstantin Belousov wrote: >>> On Mon, Dec 11, 2017 at 04:32:37AM +0000, Conrad Meyer wrote: >>>> Author: cem >>>> Date: Mon Dec 11 04:32:37 2017 >>>> New Revision: 326758 >>>> URL: https://svnweb.freebsd.org/changeset/base/326758 >>>> >>>> Log: >>>> i386: Bump KSTACK_PAGES default to match amd64 >>> i386 is not amd64, the change is wrong. >>> >>> i386 has the word size two times smaller than amd64, which makes typical >>> frame smaller by 30-40% over same code on amd64. Also i386 has much >>> smaller available KVA size (tens of MB) and KVA fragmentation is both >>> more severe and more fatal due to this. I expect that your change will >>> make any non-trivial load which creates enough threads to either fail >>> randomly or deadlock. >>> >>> If somebody tries to fit large load onto i386 machine, he must know what to >>> do and how to configure the kernel to adapt to the load (which does not >>> require the recompilation). >> Its very easy to get kernel stack overflow with 11-STABLE/i386 >> without any significant load due to abuse of kernel stack in many kernel subsystems >> as shown in the https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=219476 >> >> Contrary, "enough threads" seems to be very non-trivial number of threads >> and pretty unusual load pattern for i386 as I run several such systems >> with kern.kstack_pages=4 for quite long time and have no problems. >> No random fails, no deadlocks. And with 2 pages only 11-STABLE/i386 is just unusable >> if one utilizes SCTP, IPv6, some WiFi connectivity, IPSEC or even very small ZFS pool. >> >> I still wonder if there is really such load pattern that creates "enough threads" >> for i386 to make 4-pages stack troublesome. > I suspect two things are at play in running out of stack in 10.x and later. > 1) Usage of XSAVE for AVX, etc. state uses more of the kstack (as kib@ alludes > to), and 2) clang. Certainly for MIPS I have found that compiling with clang > instead of gcc for mips64 gives a kernel that panics for stack overflow for any > use of NFS. It might be that this is due to something MIPS-specific, but it > might be worthwhile retesting with kstack_pages=2 and building the kernel > with CROSS_TOOLCHAIN=i386-gcc after installing the appropriate package. For what it's worth, I see the same NFS-related stack overflows on mips64 with in-tree GCC 4.2.1. -Nathan From owner-svn-src-head@freebsd.org Wed Dec 20 01:03:35 2017 Return-Path: Delivered-To: svn-src-head@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 D6349E87A54; Wed, 20 Dec 2017 01:03:35 +0000 (UTC) (envelope-from shurd@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 AF1F974686; Wed, 20 Dec 2017 01:03:35 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBK13YRq025897; Wed, 20 Dec 2017 01:03:34 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBK13YgS025896; Wed, 20 Dec 2017 01:03:34 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712200103.vBK13YgS025896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Wed, 20 Dec 2017 01:03:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327013 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 01:03:35 -0000 Author: shurd Date: Wed Dec 20 01:03:34 2017 New Revision: 327013 URL: https://svnweb.freebsd.org/changeset/base/327013 Log: Support attaching tx queues to cpus This will attempt to use a different thread/core on the same L2 cache when possible, or use the same cpu as the rx thread when not. If SMP isn't enabled, don't go looking for cores to use. This is mostly useful when using shared TX/RX queues. Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D12446 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Dec 20 00:49:08 2017 (r327012) +++ head/sys/net/iflib.c Wed Dec 20 01:03:34 2017 (r327013) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" #include "opt_acpi.h" +#include "opt_sched.h" #include #include @@ -5044,25 +5045,136 @@ iflib_irq_alloc(if_ctx_t ctx, if_irq_t irq, int rid, return (_iflib_irq_alloc(ctx, irq, rid, filter, handler, arg, name)); } +#ifdef SMP static int -find_nth(if_ctx_t ctx, cpuset_t *cpus, int qid) +find_nth(if_ctx_t ctx, int qid) { + cpuset_t cpus; int i, cpuid, eqid, count; - CPU_COPY(&ctx->ifc_cpus, cpus); - count = CPU_COUNT(cpus); + CPU_COPY(&ctx->ifc_cpus, &cpus); + count = CPU_COUNT(&cpus); eqid = qid % count; /* clear up to the qid'th bit */ for (i = 0; i < eqid; i++) { - cpuid = CPU_FFS(cpus); + cpuid = CPU_FFS(&cpus); MPASS(cpuid != 0); - CPU_CLR(cpuid-1, cpus); + CPU_CLR(cpuid-1, &cpus); } - cpuid = CPU_FFS(cpus); + cpuid = CPU_FFS(&cpus); MPASS(cpuid != 0); return (cpuid-1); } +#ifdef SCHED_ULE +extern struct cpu_group *cpu_top; /* CPU topology */ + +static int +find_child_with_core(int cpu, struct cpu_group *grp) +{ + int i; + + if (grp->cg_children == 0) + return -1; + + MPASS(grp->cg_child); + for (i = 0; i < grp->cg_children; i++) { + if (CPU_ISSET(cpu, &grp->cg_child[i].cg_mask)) + return i; + } + + return -1; +} + +/* + * Find the nth thread on the specified core + */ +static int +find_thread(int cpu, int thread_num) +{ + struct cpu_group *grp; + int i; + cpuset_t cs; + + grp = cpu_top; + if (grp == NULL) + return cpu; + i = 0; + while ((i = find_child_with_core(cpu, grp)) != -1) { + /* If the child only has one cpu, don't descend */ + if (grp->cg_child[i].cg_count <= 1) + break; + grp = &grp->cg_child[i]; + } + + /* If they don't share at least an L2 cache, use the same CPU */ + if (grp->cg_level > CG_SHARE_L2 || grp->cg_level == CG_SHARE_NONE) + return cpu; + + /* Now pick one */ + CPU_COPY(&grp->cg_mask, &cs); + for (i = thread_num % grp->cg_count; i > 0; i--) { + MPASS(CPU_FFS(&cs)); + CPU_CLR(CPU_FFS(&cs) - 1, &cs); + } + MPASS(CPU_FFS(&cs)); + return CPU_FFS(&cs) - 1; +} +#else +static int +find_thread(int cpu, int thread_num __unused) +{ + return cpu_id +} +#endif + +static int +get_thread_num(if_ctx_t ctx, iflib_intr_type_t type, int qid) +{ + switch (type) { + case IFLIB_INTR_TX: + /* TX queues get threads on the same core as the corresponding RX queue */ + /* XXX handle multiple RX threads per core and more than two threads per core */ + return qid / CPU_COUNT(&ctx->ifc_cpus) + 1; + case IFLIB_INTR_RX: + case IFLIB_INTR_RXTX: + /* RX queues get the first thread on their core */ + return qid / CPU_COUNT(&ctx->ifc_cpus); + default: + return -1; + } +} +#else +#define get_thread_num(ctx, type, qid) CPU_FIRST() +#define find_thread(cpuid, tid) CPU_FIRST() +#define find_nth(ctx, gid) CPU_FIRST() +#endif + +/* Just to avoid copy/paste */ +static inline int +iflib_irq_set_affinity(if_ctx_t ctx, int irq, iflib_intr_type_t type, int qid, + struct grouptask *gtask, struct taskqgroup *tqg, void *uniq, char *name) +{ + int cpuid; + int err, tid; + + cpuid = find_nth(ctx, qid); + tid = get_thread_num(ctx, type, qid); + MPASS(tid >= 0); + cpuid = find_thread(cpuid, tid); + err = taskqgroup_attach_cpu(tqg, gtask, uniq, cpuid, irq, name); + if (err) { + device_printf(ctx->ifc_dev, "taskqgroup_attach_cpu failed %d\n", err); + return (err); + } +#ifdef notyet + if (cpuid > ctx->ifc_cpuid_highest) + ctx->ifc_cpuid_highest = cpuid; +#endif + MPASS(gtask->gt_taskqueue != NULL); + return 0; +} + int iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, int rid, iflib_intr_type_t type, driver_filter_t *filter, @@ -5071,9 +5183,8 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in struct grouptask *gtask; struct taskqgroup *tqg; iflib_filter_info_t info; - cpuset_t cpus; gtask_fn_t *fn; - int tqrid, err, cpuid; + int tqrid, err; driver_filter_t *intr_fast; void *q; @@ -5136,8 +5247,9 @@ iflib_irq_alloc_generic(if_ctx_t ctx, if_irq_t irq, in return (0); if (tqrid != -1) { - cpuid = find_nth(ctx, &cpus, qid); - taskqgroup_attach_cpu(tqg, gtask, q, cpuid, rman_get_start(irq->ii_res), name); + err = iflib_irq_set_affinity(ctx, rman_get_start(irq->ii_res), type, qid, gtask, tqg, q, name); + if (err) + return (err); } else { taskqgroup_attach(tqg, gtask, q, rman_get_start(irq->ii_res), name); } @@ -5153,6 +5265,7 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq gtask_fn_t *fn; void *q; int irq_num = -1; + int err; switch (type) { case IFLIB_INTR_TX: @@ -5181,7 +5294,14 @@ iflib_softirq_alloc_generic(if_ctx_t ctx, if_irq_t irq panic("unknown net intr type"); } GROUPTASK_INIT(gtask, 0, fn, q); - taskqgroup_attach(tqg, gtask, q, irq_num, name); + if (irq_num != -1) { + err = iflib_irq_set_affinity(ctx, irq_num, type, qid, gtask, tqg, q, name); + if (err) + taskqgroup_attach(tqg, gtask, q, irq_num, name); + } + else { + taskqgroup_attach(tqg, gtask, q, irq_num, name); + } } void From owner-svn-src-head@freebsd.org Wed Dec 20 01:36:51 2017 Return-Path: Delivered-To: svn-src-head@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 5252AE89618 for ; Wed, 20 Dec 2017 01:36:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1.freebsd.org (Postfix) with SMTP id 3166D75820 for ; Wed, 20 Dec 2017 01:36:50 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: (qmail 73891 invoked by uid 99); 20 Dec 2017 01:36:44 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Dec 2017 01:36:44 +0000 Received: from [192.168.0.8] (unknown [186.80.205.98]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id AC6F41A0112; Wed, 20 Dec 2017 01:36:43 +0000 (UTC) From: Pedro Giffuni Message-Id: <5FDA0E4A-C1A9-4283-B80D-2C13FAF75FF9@FreeBSD.org> Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch Date: Tue, 19 Dec 2017 20:36:37 -0500 In-Reply-To: <201712200015.vBK0FRwX023259@pdx.rh.CN85.dnsmgr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org To: rgrimes@freebsd.org References: <201712200015.vBK0FRwX023259@pdx.rh.CN85.dnsmgr.net> X-Mailer: Apple Mail (2.3445.4.7) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 01:36:51 -0000 > On Dec 19, 2017, at 19:15, Rodney W. Grimes = wrote: >=20 >> Author: pfg >> Date: Tue Dec 19 22:40:16 2017 >> New Revision: 327005 >> URL: https://svnweb.freebsd.org/changeset/base/327005 >>=20 >> Log: >> SPDX: These are fundamentally BSD-2-Clause. >>=20 >> They just omit the introductory line and numbering. >=20 > I again must assert that it would be better to not apply an SPDX than = to > apply one that is not an exact match for the license. =20 >=20 >=20 Not being a lawyer, I would normally agree, however: 1) SPDX IDs are only advisory: we always keep the exact license text, = which is what has legal value. 2) The license is detected by license scanners as BSD and it has two = clauses so the description fits. FWIW, according to SPDX lawyers, the numbering is not relevant and it = would appear to me that the phrase: "Redistribution and use in source and binary forms, with or without = modification, are permitted provided that the following conditions are = met:=E2=80=9D doesn=E2=80=99t add any information to the two clauses, = which read: Redistributions of source code must =E2=80=A6 Redistributions in binary form must ... Pedro. >> Modified: >> head/sbin/ipfw/altq.c >> head/sbin/ipfw/dummynet.c >> head/sbin/ipfw/ipfw2.c >> head/sbin/ipfw/ipfw2.h >> head/sbin/ipfw/ipv6.c >> head/sbin/ipfw/main.c >> head/sbin/ipfw/nat.c >> head/sys/sys/msg.h >> head/sys/sys/snoop.h >> head/usr.sbin/watch/watch.c > ... >=20 > --=20 > Rod Grimes = rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Dec 20 02:55:37 2017 Return-Path: Delivered-To: svn-src-head@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 32C2DE8DA08; Wed, 20 Dec 2017 02:55:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D96D47858C; Wed, 20 Dec 2017 02:55:36 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBK2tXEY023725; Tue, 19 Dec 2017 18:55:33 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBK2tWT0023724; Tue, 19 Dec 2017 18:55:32 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712200255.vBK2tWT0023724@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch In-Reply-To: <5FDA0E4A-C1A9-4283-B80D-2C13FAF75FF9@FreeBSD.org> To: Pedro Giffuni Date: Tue, 19 Dec 2017 18:55:32 -0800 (PST) CC: rgrimes@freebsd.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 02:55:37 -0000 > > > > On Dec 19, 2017, at 19:15, Rodney W. Grimes wrote: > > > >> Author: pfg > >> Date: Tue Dec 19 22:40:16 2017 > >> New Revision: 327005 > >> URL: https://svnweb.freebsd.org/changeset/base/327005 > >> > >> Log: > >> SPDX: These are fundamentally BSD-2-Clause. > >> > >> They just omit the introductory line and numbering. > > > > I again must assert that it would be better to not apply an SPDX than to > > apply one that is not an exact match for the license. > > > > > > Not being a lawyer, I would normally agree, however: This isnt about any legal issue. > 1) SPDX IDs are only advisory: we always keep the exact license text, which is what has legal value. And we should do our best to provide the most accurate advisory we can, and we know that this is not a direct copy of the BSD 2 clause, so making advice that it is, IMHO, would be poor advice. > 2) The license is detected by license scanners as BSD and it has two clauses so the description fits. And a human reading it sees it reads like a 2 clause but does not match a 2 clause exactly so how do I trust any of this SPDX stuff as being done with some ration of sanity. > FWIW, according to SPDX lawyers, the numbering is not relevant and it would appear to me that the phrase: > "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:? doesn?t add any information to the two clauses, which read: Again, not a legal issue, an issue of this is not an exact BSD-2-Clause so I do not believe that we should tag it as such. Basically if we are doing this "close enough" thing it means the SPDX tags are actually pretty useless for anyone trying to do a legal evaluation cause they are just going have to completly redo what was done in adding the SPDX tags, and if that is the case we should seriously consider just what value do these have in the tree? > Redistributions of source code must ? > Redistributions in binary form must ... > > Pedro. > > > > >> Modified: > >> head/sbin/ipfw/altq.c > >> head/sbin/ipfw/dummynet.c > >> head/sbin/ipfw/ipfw2.c > >> head/sbin/ipfw/ipfw2.h > >> head/sbin/ipfw/ipv6.c > >> head/sbin/ipfw/main.c > >> head/sbin/ipfw/nat.c > >> head/sys/sys/msg.h > >> head/sys/sys/snoop.h > >> head/usr.sbin/watch/watch.c > > ... > > > > -- > > Rod Grimes rgrimes@freebsd.org > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Dec 20 03:20:33 2017 Return-Path: Delivered-To: svn-src-head@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 2056EE8F005; Wed, 20 Dec 2017 03:20:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id DAC7A79852; Wed, 20 Dec 2017 03:20:32 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail109.syd.optusnet.com.au (Postfix) with ESMTPS id 3DAE2D6A9C8; Wed, 20 Dec 2017 14:00:13 +1100 (AEDT) Date: Wed, 20 Dec 2017 14:00:12 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Alan Cox cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326982 - head/share/man/man9 In-Reply-To: <201712191707.vBJH7onm015225@repo.freebsd.org> Message-ID: <20171220132345.S1291@besplex.bde.org> References: <201712191707.vBJH7onm015225@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=cK6QihWN c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=sSRoe_nAf774Z2qvne8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 03:20:33 -0000 On Tue, 19 Dec 2017, Alan Cox wrote: > Log: > ... > Reorder and revise some of the existing text. For example, more > precisely describe when ordinary accesses are atomic. > ... > Modified: head/share/man/man9/atomic.9 > ============================================================================== > --- head/share/man/man9/atomic.9 Tue Dec 19 16:45:40 2017 (r326981) > +++ head/share/man/man9/atomic.9 Tue Dec 19 17:07:50 2017 (r326982) > ... > @@ -147,8 +149,7 @@ unsigned 8-bit integer > unsigned 16-bit integer > .El > .Pp > -These must not be used in MI code because the instructions to implement them > -efficiently might not be available. > +These types must not be used in machine-independent code. Example of normal use of "must". It is a requirement forthe caller. > .Pp > -When an atomic operation has acquire semantics, the effects of the operation > -must have completed before any subsequent load or store (by program order) is > +When an atomic operation has acquire semantics, the operation must have > +completed before any subsequent load or store (by program order) is Most other uses of "must" are requirements for the implementation. This commit seemed to introduce this misuse, but I just noticed that it was common and this commit only increased it a lot. POSIX uses "shall" a lot for requirements on the implementation. This is at best noise if it is copied to man pages, and we have the /usr/share/examples/mdoc/deshallify.sh script for removing the noise, e.g., by s/shall be/is/g (with complications or singular vs plural...). This is rarely used since the otherwise better wording in POSIX is rarely used in FreeBSD man pages, but the man pages are fairly shall-free, with most shalls being for requirements related to copyrights. s/must have competed/completes/g seems to be a correct demustification for the above. atomic.9 has to be more careful with tenses than most man pages since it is half about delicate ordering, so I wouldn't trust automatic translation of irregular verbs. It would be better to describe the ordering using symbols like <= than with words like "before" and complicated verbs. Bruce From owner-svn-src-head@freebsd.org Wed Dec 20 03:56:53 2017 Return-Path: Delivered-To: svn-src-head@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 61AA8E90F30 for ; Wed, 20 Dec 2017 03:56:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic314-29.consmr.mail.bf2.yahoo.com (sonic314-29.consmr.mail.bf2.yahoo.com [74.6.132.203]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 284BB7AC97 for ; Wed, 20 Dec 2017 03:56:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1513742210; bh=9WBH47vNxhEII4c/3qzShS34UxWiIcDW6QlbDFuOds4=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=fAeMhWfE1e/EvSxELlYn/8K5xqk7fbUi10wYElJuN8Bs+VQ6+wkS+G7i21XnaDi+THFks0KTzQK8TJRhpjqmxkpS0WPqf0IkwH4jmeYTEWU0fhjU0E9JuUE9+FHLTrr6dxyVl7A1ro+0UulLH1hqxQNAQKw1L99yI2XTrbBOkBGEePmhcJvZ8Jij6I1JovoGWxseTP0HPEMOntKr8TczA/LukyCpYn1+PDh9xR1TIReZnXNM0D7ecDw1bGS4A0sidqYwUQ5JdTPMsw1TxvICrl9QFpTag3uA1dJhoV/mZfJo/12nCY8UwxNv5LqS7a4oXqNPmD1B3RBbJ+Fg/6KDEQ== X-YMail-OSG: 4RIqwxsVM1mMvB2.OH.PQ41h0JCn0nzpWEl0bkaSDlM5xU8Z6bmxSVd9Foeb53X f_cm3Geeoxd827jHLLx6u5bw2nupDbLzcjvyaO03lHBSUYWq8_LUxyr1wYDTVwtS0xzYwH2Pc771 DbJrb0.AiKKB3fk4iMLETqw0xBrPZTWQEK2jCGeebMc401uIlrtFKDDycIUSo6p70WCkvFVRJ__w pmIAGcmYcExVXImARkRXChydcV88f9qRvZavq2vHOrp8E1CBSRw4_IG6wTIHxqe4evuOz._iDgKq 6y1KMwy3WnMChd3s8ZwGoleeJLCPmh25v8CeCpHrYM65beBiOUa963Mp5so5rW1IO.JNv.t6QXSb kXVk4OjGbcJX6paf_FJ0P_EZ2YzSPaRgwpveP.XYKoF_t55YCpoe2m1kTC5Za0yOxx00gyuqrU0F 5sbQi6fxJ5z.Fa2wkD1GDpFnMUh3h2hZr36yQwLrBGntM8.PCThSVfNX.vc62lyVR5SJRjVAi Received: from sonic.gate.mail.ne1.yahoo.com by sonic314.consmr.mail.bf2.yahoo.com with HTTP; Wed, 20 Dec 2017 03:56:50 +0000 Received: from smtp103.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.6]) ([98.139.230.213]) by smtp412.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID 261d837199018cfff8d03688076b2df8; Wed, 20 Dec 2017 03:54:21 +0000 (UTC) Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712200255.vBK2tWT0023724@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: <6bfed45b-df20-adf8-fc8c-0ca543cb4340@FreeBSD.org> Date: Tue, 19 Dec 2017 22:54:19 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712200255.vBK2tWT0023724@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 03:56:53 -0000 On 19/12/2017 21:55, Rodney W. Grimes wrote: >> >>> On Dec 19, 2017, at 19:15, Rodney W. Grimes wrote: >>> >>>> Author: pfg >>>> Date: Tue Dec 19 22:40:16 2017 >>>> New Revision: 327005 >>>> URL: https://svnweb.freebsd.org/changeset/base/327005 >>>> >>>> Log: >>>> SPDX: These are fundamentally BSD-2-Clause. >>>> >>>> They just omit the introductory line and numbering. >>> I again must assert that it would be better to not apply an SPDX than to >>> apply one that is not an exact match for the license. >>> >>> >> Not being a lawyer, I would normally agree, however: > This isnt about any legal issue. Only legal issues matter. If there is even a hint of a legal basis to revert the change, I won't object. >> 1) SPDX IDs are only advisory: we always keep the exact license text, which is what has legal value. > And we should do our best to provide the most accurate advisory we can, > and we know that this is not a direct copy of the BSD 2 clause, so making > advice that it is, IMHO, would be poor advice. > >> 2) The license is detected by license scanners as BSD and it has two clauses so the description fits. > And a human reading it sees it reads like a 2 clause but does not match a 2 clause exactly so > how do I trust any of this SPDX stuff as being done with some ration of sanity. > >> FWIW, according to SPDX lawyers, the numbering is not relevant and it would appear to me that the phrase: >> "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:? doesn?t add any information to the two clauses, which read: > Again, not a legal issue, an issue of this is not an exact BSD-2-Clause so I > do not believe that we should tag it as such. Basically if we are doing this > "close enough" thing it means the SPDX tags are actually pretty useless for > anyone trying to do a legal evaluation cause they are just going have to > completly redo what was done in adding the SPDX tags, and if that is the > case we should seriously consider just what value do these have in the > tree? I see it the other way around: If the text matches exactly the common license text, then the tag is redundant (which is not necessarily wrong but doesn't imply much value). Yes, there is some amount of judgement being done on my part: it would certainly be wrong from to tag some file as BSD-2-Clause when it is an MIT license under the reasoning that they are "basically" the same thing but I think I am being sufficiently reasonable by setting the best possible match. As I said the SPDX guys do consider non-substantial differences are OK. What I will do .. just to be safe, is to check with the SPDX guys to see what they think. Thanks, Pedro. >> Redistributions of source code must ? >> Redistributions in binary form must ... >> >> Pedro. >> >> >> >>>> Modified: >>>> head/sbin/ipfw/altq.c >>>> head/sbin/ipfw/dummynet.c >>>> head/sbin/ipfw/ipfw2.c >>>> head/sbin/ipfw/ipfw2.h >>>> head/sbin/ipfw/ipv6.c >>>> head/sbin/ipfw/main.c >>>> head/sbin/ipfw/nat.c >>>> head/sys/sys/msg.h >>>> head/sys/sys/snoop.h >>>> head/usr.sbin/watch/watch.c >>> ... >>> >>> -- >>> Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Dec 20 06:08:18 2017 Return-Path: Delivered-To: svn-src-head@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 11F79E97939; Wed, 20 Dec 2017 06:08:18 +0000 (UTC) (envelope-from lwhsu@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 D37477EAB2; Wed, 20 Dec 2017 06:08:17 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBK68GDR050308; Wed, 20 Dec 2017 06:08:16 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBK68Gp3050307; Wed, 20 Dec 2017 06:08:16 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201712200608.vBK68Gp3050307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 20 Dec 2017 06:08:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327017 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 06:08:18 -0000 Author: lwhsu (ports committer) Date: Wed Dec 20 06:08:16 2017 New Revision: 327017 URL: https://svnweb.freebsd.org/changeset/base/327017 Log: Add missing `;` Approved by: kevlo Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Wed Dec 20 04:08:00 2017 (r327016) +++ head/sys/net/iflib.c Wed Dec 20 06:08:16 2017 (r327017) @@ -5124,7 +5124,7 @@ find_thread(int cpu, int thread_num) static int find_thread(int cpu, int thread_num __unused) { - return cpu_id + return cpu_id; } #endif From owner-svn-src-head@freebsd.org Wed Dec 20 10:13:37 2017 Return-Path: Delivered-To: svn-src-head@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 A14CBEA4669; Wed, 20 Dec 2017 10:13:37 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from theravensnest.org (xvm-110-62.dc2.ghst.net [46.226.110.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "theravensnest.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 415E8664BA; Wed, 20 Dec 2017 10:13:36 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from [192.168.1.65] (host86-154-8-90.range86-154.btcentralplus.com [86.154.8.90]) (authenticated bits=0) by theravensnest.org (8.15.2/8.15.2) with ESMTPSA id vBK9xUDM099847 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 20 Dec 2017 09:59:31 GMT (envelope-from theraven@FreeBSD.org) X-Authentication-Warning: d60e724c-75b0-4b63-9702-f4a9d2bf6793: Host host86-154-8-90.range86-154.btcentralplus.com [86.154.8.90] claimed to be [192.168.1.65] Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: svn commit: r326758 - in head/sys/i386: conf include From: David Chisnall In-Reply-To: <1705b795-46ca-bb27-6ba7-fab4eeed0aba@FreeBSD.org> Date: Wed, 20 Dec 2017 09:59:26 +0000 Cc: Eugene Grosbein , Konstantin Belousov , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <68FECEF0-014E-4741-BE96-680E9338557B@FreeBSD.org> References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <20171211091943.GF2272@kib.kiev.ua> <5A2E5D44.9030904@grosbein.net> <4a9c76c9-8063-9420-b198-14487b089840@FreeBSD.org> <5A30378A.3040609@grosbein.net> <5A3261BD.5050404@grosbein.net> <1705b795-46ca-bb27-6ba7-fab4eeed0aba@FreeBSD.org> To: John Baldwin X-Mailer: Apple Mail (2.3273) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 10:13:37 -0000 On 16 Dec 2017, at 18:05, John Baldwin wrote: >=20 > When I build a FreeBSD/mips64 kernel with clang, > _any_ simple NFS op triggers a kernel stack overflow. Kernels = compiled > with GCC do not. That is not my experience. I haven=E2=80=99t tried a MIPS64 kernel = built with clang, but with in-tree gcc I get kernel panics as soon as I = try to use NFS, unless I use Stacey=E2=80=99s patches that increase the = kernel stack size. David From owner-svn-src-head@freebsd.org Wed Dec 20 13:13:12 2017 Return-Path: Delivered-To: svn-src-head@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 1FA45E883D6; Wed, 20 Dec 2017 13:13:12 +0000 (UTC) (envelope-from ed@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 EB7B86C8B1; Wed, 20 Dec 2017 13:13:11 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKDDB3v029413; Wed, 20 Dec 2017 13:13:11 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKDDAJu029411; Wed, 20 Dec 2017 13:13:10 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201712201313.vBKDDAJu029411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Wed, 20 Dec 2017 13:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327022 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 13:13:12 -0000 Author: ed Date: Wed Dec 20 13:13:10 2017 New Revision: 327022 URL: https://svnweb.freebsd.org/changeset/base/327022 Log: Make truss(8) work for 32-bit CloudABI executables on ARM64. This change effectively merges the existing 64-bit support for ARM64 with the 32-on-64-bit support for AMD64. Added: head/usr.bin/truss/aarch64-cloudabi32.c - copied, changed from r327021, head/usr.bin/truss/aarch64-cloudabi64.c Modified: head/usr.bin/truss/Makefile Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Wed Dec 20 07:55:47 2017 (r327021) +++ head/usr.bin/truss/Makefile Wed Dec 20 13:13:10 2017 (r327022) @@ -13,6 +13,7 @@ ABIS+= freebsd # Each ABI is expected to have an ABI.c, MACHINE_ARCH-ABI.c or # MACHINE_CPUARCH-ABI.c file that will be used to map the syscall arguments. .if ${MACHINE_ARCH} == "aarch64" +ABIS+= cloudabi32 ABIS+= cloudabi64 .endif .if ${MACHINE_CPUARCH} == "i386" Copied and modified: head/usr.bin/truss/aarch64-cloudabi32.c (from r327021, head/usr.bin/truss/aarch64-cloudabi64.c) ============================================================================== --- head/usr.bin/truss/aarch64-cloudabi64.c Wed Dec 20 07:55:47 2017 (r327021, copy source) +++ head/usr.bin/truss/aarch64-cloudabi32.c Wed Dec 20 13:13:10 2017 (r327022) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Nuxi, https://nuxi.nl/ + * Copyright (c) 2015-2017 Nuxi, https://nuxi.nl/ * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -38,51 +38,75 @@ __FBSDID("$FreeBSD$"); #include "truss.h" static int -aarch64_cloudabi64_fetch_args(struct trussinfo *trussinfo, unsigned int narg) +aarch64_cloudabi32_fetch_args(struct trussinfo *trussinfo, unsigned int narg) { struct current_syscall *cs; + struct ptrace_io_desc iorequest; struct reg regs; lwpid_t tid; - unsigned int i; - tid = trussinfo->curthread->tid; - if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { - fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); - return (-1); - } + if (narg > 0) { + /* Fetch registers, containing the address of the arguments. */ + tid = trussinfo->curthread->tid; + if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { + fprintf(trussinfo->outfile, + "-- CANNOT READ REGISTERS --\n"); + return (-1); + } - cs = &trussinfo->curthread->cs; - for (i = 0; i < narg && i < 8; i++) - cs->args[i] = regs.x[i]; + /* Fetch arguments. They are already padded to 64 bits. */ + cs = &trussinfo->curthread->cs; + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)regs.x[2]; + iorequest.piod_addr = cs->args; + iorequest.piod_len = sizeof(cs->args[0]) * narg; + if (ptrace(PT_IO, tid, (caddr_t)&iorequest, 0) == -1 || + iorequest.piod_len == 0) + return (-1); + } return (0); } static int -aarch64_cloudabi64_fetch_retval(struct trussinfo *trussinfo, long *retval, +aarch64_cloudabi32_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) { + struct ptrace_io_desc iorequest; struct reg regs; lwpid_t tid; + /* Fetch registers, containing the address of the return values. */ tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } - retval[0] = regs.x[0]; - retval[1] = regs.x[1]; - *errorp = (regs.spsr & PSR_C) != 0; + if ((regs.spsr & PSR_C) == 0) { + /* System call succeeded. Fetch return values. */ + iorequest.piod_op = PIOD_READ_D; + iorequest.piod_offs = (void *)regs.x[2]; + iorequest.piod_addr = retval; + iorequest.piod_len = sizeof(retval[0]) * 2; + if (ptrace(PT_IO, tid, (caddr_t)&iorequest, 0) == -1 || + iorequest.piod_len == 0) + return (-1); + *errorp = 0; + } else { + /* System call failed. Set error. */ + retval[0] = regs.x[0]; + *errorp = 1; + } return (0); } -static struct procabi aarch64_cloudabi64 = { - "CloudABI ELF64", - SYSDECODE_ABI_CLOUDABI64, - aarch64_cloudabi64_fetch_args, - aarch64_cloudabi64_fetch_retval, - STAILQ_HEAD_INITIALIZER(aarch64_cloudabi64.extra_syscalls), +static struct procabi aarch64_cloudabi32 = { + "CloudABI ELF32", + SYSDECODE_ABI_CLOUDABI32, + aarch64_cloudabi32_fetch_args, + aarch64_cloudabi32_fetch_retval, + STAILQ_HEAD_INITIALIZER(aarch64_cloudabi32.extra_syscalls), { NULL } }; -PROCABI(aarch64_cloudabi64); +PROCABI(aarch64_cloudabi32); From owner-svn-src-head@freebsd.org Wed Dec 20 15:21:30 2017 Return-Path: Delivered-To: svn-src-head@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 EC316E8F46D; Wed, 20 Dec 2017 15:21:30 +0000 (UTC) (envelope-from brd@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 B941973436; Wed, 20 Dec 2017 15:21:30 +0000 (UTC) (envelope-from brd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKFLTwM089512; Wed, 20 Dec 2017 15:21:29 GMT (envelope-from brd@FreeBSD.org) Received: (from brd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKFLTB9089511; Wed, 20 Dec 2017 15:21:29 GMT (envelope-from brd@FreeBSD.org) Message-Id: <201712201521.vBKFLTB9089511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brd set sender to brd@FreeBSD.org using -f From: Brad Davis Date: Wed, 20 Dec 2017 15:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327025 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: brd X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 327025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 15:21:31 -0000 Author: brd (doc,ports committer) Date: Wed Dec 20 15:21:29 2017 New Revision: 327025 URL: https://svnweb.freebsd.org/changeset/base/327025 Log: Save others some forehead damange by noting that -r require tmpfs. Reviewed by: bapt Modified: head/sbin/reboot/reboot.8 Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Wed Dec 20 14:26:54 2017 (r327024) +++ head/sbin/reboot/reboot.8 Wed Dec 20 15:21:29 2017 (r327025) @@ -28,7 +28,7 @@ .\" @(#)reboot.8 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd October 23, 2017 +.Dd December 20, 2017 .Dt REBOOT 8 .Os .Sh NAME @@ -142,6 +142,9 @@ After changing vfs.root.mountfrom with .Xr kenv 1 , .Nm Fl r can be used to change the root filesystem while preserving kernel state. +This requires the +.Xr tmpfs 5 +kernel module to be loaded. .El .Pp The From owner-svn-src-head@freebsd.org Wed Dec 20 16:02:12 2017 Return-Path: Delivered-To: svn-src-head@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 E1BA9E91D45; Wed, 20 Dec 2017 16:02:12 +0000 (UTC) (envelope-from imp@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 AEDE174F83; Wed, 20 Dec 2017 16:02:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKG2BUN006029; Wed, 20 Dec 2017 16:02:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKG2BqG006028; Wed, 20 Dec 2017 16:02:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201602.vBKG2BqG006028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 16:02:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327027 - head/sbin/reboot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sbin/reboot X-SVN-Commit-Revision: 327027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 16:02:13 -0000 Author: imp Date: Wed Dec 20 16:02:11 2017 New Revision: 327027 URL: https://svnweb.freebsd.org/changeset/base/327027 Log: Flesh out the reason for the need for tmpfs a little. Sponsored by: Netflix Modified: head/sbin/reboot/reboot.8 Modified: head/sbin/reboot/reboot.8 ============================================================================== --- head/sbin/reboot/reboot.8 Wed Dec 20 15:50:21 2017 (r327026) +++ head/sbin/reboot/reboot.8 Wed Dec 20 16:02:11 2017 (r327027) @@ -144,7 +144,10 @@ After changing vfs.root.mountfrom with can be used to change the root filesystem while preserving kernel state. This requires the .Xr tmpfs 5 -kernel module to be loaded. +kernel module to be loaded because +.Xr init 8 +needs a place to store itself after the old root is unmounted, but +before the new root is in place. .El .Pp The From owner-svn-src-head@freebsd.org Wed Dec 20 16:49:47 2017 Return-Path: Delivered-To: svn-src-head@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 389D1E946D8; Wed, 20 Dec 2017 16:49:47 +0000 (UTC) (envelope-from jhibbits@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 02CCA767B6; Wed, 20 Dec 2017 16:49:46 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKGnkvC025217; Wed, 20 Dec 2017 16:49:46 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKGnkkD025216; Wed, 20 Dec 2017 16:49:46 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201712201649.vBKGnkkD025216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 20 Dec 2017 16:49:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327028 - head/sys/powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/include X-SVN-Commit-Revision: 327028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 16:49:47 -0000 Author: jhibbits Date: Wed Dec 20 16:49:45 2017 New Revision: 327028 URL: https://svnweb.freebsd.org/changeset/base/327028 Log: Increase default MAXDSIZ to 32G on powerpc64 Linking LLVM now seems to require more than 1GB data size, so increase the default to 32G, which matches amd64. Reviewed by: nwhitehorn Modified: head/sys/powerpc/include/vmparam.h Modified: head/sys/powerpc/include/vmparam.h ============================================================================== --- head/sys/powerpc/include/vmparam.h Wed Dec 20 16:02:11 2017 (r327027) +++ head/sys/powerpc/include/vmparam.h Wed Dec 20 16:49:45 2017 (r327028) @@ -48,7 +48,11 @@ #endif #ifndef MAXDSIZ +#ifdef __powerpc64__ +#define MAXDSIZ (32UL*1024*1024*1024) /* max data size */ +#else #define MAXDSIZ (1*1024*1024*1024) /* max data size */ +#endif #endif #ifndef DFLSSIZ From owner-svn-src-head@freebsd.org Wed Dec 20 17:33:34 2017 Return-Path: Delivered-To: svn-src-head@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 C0EC3E98188; Wed, 20 Dec 2017 17:33:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 975D578D22; Wed, 20 Dec 2017 17:33:34 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 38E6910AF2A; Wed, 20 Dec 2017 12:33:33 -0500 (EST) From: John Baldwin To: David Chisnall Cc: Eugene Grosbein , Konstantin Belousov , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326758 - in head/sys/i386: conf include Date: Wed, 20 Dec 2017 09:14:07 -0800 Message-ID: <1839614.eNG2DjLqvF@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <68FECEF0-014E-4741-BE96-680E9338557B@FreeBSD.org> References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1705b795-46ca-bb27-6ba7-fab4eeed0aba@FreeBSD.org> <68FECEF0-014E-4741-BE96-680E9338557B@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 20 Dec 2017 12:33:33 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 17:33:34 -0000 On Wednesday, December 20, 2017 09:59:26 AM David Chisnall wrote: > On 16 Dec 2017, at 18:05, John Baldwin wrote: > >=20 > > When I build a FreeBSD/mips64 kernel with clang, > > _any_ simple NFS op triggers a kernel stack overflow. Kernels comp= iled > > with GCC do not. >=20 > That is not my experience. I haven=E2=80=99t tried a MIPS64 kernel b= uilt with clang, but with in-tree gcc I get kernel panics as soon as I = try to use NFS, unless I use Stacey=E2=80=99s patches that increase the= kernel stack size. I have primarily been using modern GCC for GCC once that was working, b= ut at least when running a MALTA64 kernel under qemu I was not triggering pan= ics even with old GCC. With the in-tree clang 5.0 or with CHERI clang, jus= t doing an 'ls' of a NFS directory or even a tab-complete of a path that is on NFS reliably triggers a kernel stack overflow for MALTA64 in qemu= . With Stacey's kstack pages, a clang kernel does survive, but those are = not in stock FreeBSD which is where I have been testing this. --=20 John Baldwin From owner-svn-src-head@freebsd.org Wed Dec 20 17:44:32 2017 Return-Path: Delivered-To: svn-src-head@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 9C62BE98C94; Wed, 20 Dec 2017 17:44:32 +0000 (UTC) (envelope-from ume@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 6681979455; Wed, 20 Dec 2017 17:44:32 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKHiVru050016; Wed, 20 Dec 2017 17:44:31 GMT (envelope-from ume@FreeBSD.org) Received: (from ume@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKHiVLY050015; Wed, 20 Dec 2017 17:44:31 GMT (envelope-from ume@FreeBSD.org) Message-Id: <201712201744.vBKHiVLY050015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ume set sender to ume@FreeBSD.org using -f From: Hajimu UMEMOTO Date: Wed, 20 Dec 2017 17:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327029 - head/lib/libc/net X-SVN-Group: head X-SVN-Commit-Author: ume X-SVN-Commit-Paths: head/lib/libc/net X-SVN-Commit-Revision: 327029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 17:44:32 -0000 Author: ume Date: Wed Dec 20 17:44:31 2017 New Revision: 327029 URL: https://svnweb.freebsd.org/changeset/base/327029 Log: Don't ignore trailing spaces after numerical IP addresses. PR: 224403 Reported by: Michael Kaufmann Reviewed by: Michael Kaufmann MFC after: 1 week Modified: head/lib/libc/net/getaddrinfo.c Modified: head/lib/libc/net/getaddrinfo.c ============================================================================== --- head/lib/libc/net/getaddrinfo.c Wed Dec 20 16:49:45 2017 (r327028) +++ head/lib/libc/net/getaddrinfo.c Wed Dec 20 17:44:31 2017 (r327029) @@ -1277,7 +1277,8 @@ explore_numeric(const struct addrinfo *pai, const char * does not accept. So we need to separate the case for * AF_INET. */ - if (inet_aton(hostname, (struct in_addr *)pton) != 1) + if (inet_aton(hostname, (struct in_addr *)pton) != 1 || + hostname[strspn(hostname, "0123456789.xabcdefXABCDEF")] != '\0') return 0; p = pton; break; From owner-svn-src-head@freebsd.org Wed Dec 20 18:15:07 2017 Return-Path: Delivered-To: svn-src-head@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 F1B7FE9A7CC; Wed, 20 Dec 2017 18:15:07 +0000 (UTC) (envelope-from erj@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 8E1D67A5E3; Wed, 20 Dec 2017 18:15:07 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKIF68d062354; Wed, 20 Dec 2017 18:15:06 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKIF6IN062349; Wed, 20 Dec 2017 18:15:06 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201712201815.vBKIF6IN062349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 20 Dec 2017 18:15:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327031 - in head/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: conf dev/ixgbe modules/ix modules/ixv X-SVN-Commit-Revision: 327031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 18:15:08 -0000 Author: erj Date: Wed Dec 20 18:15:06 2017 New Revision: 327031 URL: https://svnweb.freebsd.org/changeset/base/327031 Log: ixgbe(4): Convert driver to use iflib Initial update to the ixgbe PF and VF drivers to support the iflib interface. The PF driver version is bumped to 4.0.0, and the VF driver version is bumped to 2.0.0. Special thanks to sbruno@ for the support in helping make this conversion happen. Submitted by: Jeb Cramer , Krzysztof Galazka (Chris) , Piotr Pietruszewski Reviewed by: sbruno@, shurd@, #IntelNetworking Tested by: Jeffrey Pieper , Sergey Kozlov Sponsored by: Limelight Networks, Intel Corporation Differential Revision: https://reviews.freebsd.org/D11727 Deleted: head/sys/dev/ixgbe/ixgbe_netmap.c head/sys/dev/ixgbe/ixgbe_netmap.h Modified: head/sys/conf/files head/sys/dev/ixgbe/if_bypass.c head/sys/dev/ixgbe/if_fdir.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixgbe/if_sriov.c head/sys/dev/ixgbe/ix_txrx.c head/sys/dev/ixgbe/ixgbe.h head/sys/dev/ixgbe/ixgbe_common.c head/sys/dev/ixgbe/ixgbe_fdir.h head/sys/dev/ixgbe/ixgbe_osdep.c head/sys/dev/ixgbe/ixgbe_osdep.h head/sys/dev/ixgbe/ixgbe_phy.c head/sys/dev/ixgbe/ixgbe_sriov.h head/sys/dev/ixgbe/ixgbe_type.h head/sys/dev/ixgbe/ixgbe_vf.h head/sys/modules/ix/Makefile head/sys/modules/ixv/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Dec 20 18:06:09 2017 (r327030) +++ head/sys/conf/files Wed Dec 20 18:15:06 2017 (r327031) @@ -2223,11 +2223,9 @@ dev/ixgbe/if_ixv.c optional ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe -DSMP" dev/ixgbe/if_bypass.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/ixgbe_netmap.c optional ix inet \ - compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/if_fdir.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" -dev/ixgbe/if_sriov.c optional ix inet | ixv inet \ +dev/ixgbe/if_sriov.c optional ix inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ix_txrx.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" Modified: head/sys/dev/ixgbe/if_bypass.c ============================================================================== --- head/sys/dev/ixgbe/if_bypass.c Wed Dec 20 18:06:09 2017 (r327030) +++ head/sys/dev/ixgbe/if_bypass.c Wed Dec 20 18:15:06 2017 (r327031) @@ -165,12 +165,12 @@ ixgbe_bp_set_state(SYSCTL_HANDLER_ARGS) error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL0, &state); ixgbe_bypass_mutex_clear(adapter); - if (error) + if (error != 0) return (error); state = (state >> BYPASS_STATUS_OFF_SHIFT) & 0x3; error = sysctl_handle_int(oidp, &state, 0, req); - if ((error) || (req->newptr == NULL)) + if ((error != 0) || (req->newptr == NULL)) return (error); /* Sanity check new state */ @@ -437,7 +437,7 @@ ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS) struct ixgbe_hw *hw = &adapter->hw; int error, tmp; static int timeout = 0; - u32 mask, arg = BYPASS_PAGE_CTL0; + u32 mask, arg; /* Get the current hardware value */ ixgbe_bypass_mutex_enter(adapter); @@ -456,48 +456,38 @@ ixgbe_bp_wd_set(SYSCTL_HANDLER_ARGS) if ((error) || (req->newptr == NULL)) return (error); - mask = BYPASS_WDT_ENABLE_M; + arg = 0x1 << BYPASS_WDT_ENABLE_SHIFT; + mask = BYPASS_WDT_ENABLE_M | BYPASS_WDT_VALUE_M; switch (timeout) { - case 0: /* disables the timer */ - break; - case 1: - arg = BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 2: - arg = BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 3: - arg = BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 4: - arg = BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 8: - arg = BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 16: - arg = BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - case 32: - arg = BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT; - arg |= 0x1 << BYPASS_WDT_ENABLE_SHIFT; - mask |= BYPASS_WDT_VALUE_M; - break; - default: - return (EINVAL); + case 0: /* disables the timer */ + arg = BYPASS_PAGE_CTL0; + mask = BYPASS_WDT_ENABLE_M; + break; + case 1: + arg |= BYPASS_WDT_1_5 << BYPASS_WDT_TIME_SHIFT; + break; + case 2: + arg |= BYPASS_WDT_2 << BYPASS_WDT_TIME_SHIFT; + break; + case 3: + arg |= BYPASS_WDT_3 << BYPASS_WDT_TIME_SHIFT; + break; + case 4: + arg |= BYPASS_WDT_4 << BYPASS_WDT_TIME_SHIFT; + break; + case 8: + arg |= BYPASS_WDT_8 << BYPASS_WDT_TIME_SHIFT; + break; + case 16: + arg |= BYPASS_WDT_16 << BYPASS_WDT_TIME_SHIFT; + break; + case 32: + arg |= BYPASS_WDT_32 << BYPASS_WDT_TIME_SHIFT; + break; + default: + return (EINVAL); } + /* Set the new watchdog */ ixgbe_bypass_mutex_enter(adapter); error = hw->mac.ops.bypass_set(hw, BYPASS_PAGE_CTL0, mask, arg); @@ -541,7 +531,8 @@ ixgbe_bp_wd_reset(SYSCTL_HANDLER_ARGS) error = IXGBE_BYPASS_FW_WRITE_FAILURE; break; } - if (hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd)) { + error = hw->mac.ops.bypass_rw(hw, BYPASS_PAGE_CTL1, &reset_wd); + if (error != 0) { error = IXGBE_ERR_INVALID_ARGUMENT; break; } @@ -615,7 +606,7 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS) &data); ixgbe_bypass_mutex_clear(adapter); if (error) - return (-EINVAL); + return (EINVAL); eeprom[count].logs += data << (8 * i); } @@ -624,7 +615,7 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS) log_off + i, &eeprom[count].actions); ixgbe_bypass_mutex_clear(adapter); if (error) - return (-EINVAL); + return (EINVAL); /* Quit if not a unread log */ if (!(eeprom[count].logs & BYPASS_LOG_CLEAR_M)) @@ -696,21 +687,21 @@ ixgbe_bp_log(SYSCTL_HANDLER_ARGS) ixgbe_bypass_mutex_clear(adapter); if (error) - return (-EINVAL); + return (EINVAL); } status = 0; /* reset */ /* Another log command can now run */ while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0) usec_delay(3000); - return(error); + return (error); unlock_err: ixgbe_bypass_mutex_clear(adapter); status = 0; /* reset */ while (atomic_cmpset_int(&adapter->bypass.log, 1, 0) == 0) usec_delay(3000); - return (-EINVAL); + return (EINVAL); } /* ixgbe_bp_log */ /************************************************************************ @@ -802,7 +793,5 @@ ixgbe_bypass_init(struct adapter *adapter) adapter, 0, ixgbe_bp_wd_reset, "S", "Bypass WD Reset"); adapter->feat_en |= IXGBE_FEATURE_BYPASS; - - return; } /* ixgbe_bypass_init */ Modified: head/sys/dev/ixgbe/if_fdir.c ============================================================================== --- head/sys/dev/ixgbe/if_fdir.c Wed Dec 20 18:06:09 2017 (r327030) +++ head/sys/dev/ixgbe/if_fdir.c Wed Dec 20 18:15:06 2017 (r327031) @@ -50,10 +50,11 @@ ixgbe_init_fdir(struct adapter *adapter) } /* ixgbe_init_fdir */ void -ixgbe_reinit_fdir(void *context, int pending) +ixgbe_reinit_fdir(void *context) { - struct adapter *adapter = context; - struct ifnet *ifp = adapter->ifp; + if_ctx_t ctx = context; + struct adapter *adapter = iflib_get_softc(ctx); + struct ifnet *ifp = iflib_get_ifp(ctx); if (!(adapter->feat_en & IXGBE_FEATURE_FDIR)) return; @@ -146,9 +147,9 @@ ixgbe_atr(struct tx_ring *txr, struct mbuf *mp) /* TASK_INIT needs this function defined regardless if it's enabled */ void -ixgbe_reinit_fdir(void *context, int pending) +ixgbe_reinit_fdir(void *context) { - UNREFERENCED_2PARAMETER(context, pending); + UNREFERENCED_PARAMETER(context); } /* ixgbe_reinit_fdir */ void Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Wed Dec 20 18:06:09 2017 (r327030) +++ head/sys/dev/ixgbe/if_ix.c Wed Dec 20 18:15:06 2017 (r327031) @@ -33,18 +33,21 @@ /*$FreeBSD$*/ -#ifndef IXGBE_STANDALONE_BUILD #include "opt_inet.h" #include "opt_inet6.h" #include "opt_rss.h" -#endif #include "ixgbe.h" +#include "ixgbe_sriov.h" +#include "ifdi_if.h" +#include +#include + /************************************************************************ * Driver version ************************************************************************/ -char ixgbe_driver_version[] = "3.2.12-k"; +char ixgbe_driver_version[] = "4.0.0-k"; /************************************************************************ @@ -56,180 +59,173 @@ char ixgbe_driver_version[] = "3.2.12-k"; * * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } ************************************************************************/ -static ixgbe_vendor_info_t ixgbe_vendor_info_array[] = +static pci_vendor_info_t ixgbe_vendor_info_array[] = { - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_1G_T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII_L, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_10G_T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T_L, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_BYPASS, 0, 0, 0}, - {IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS, 0, 0, 0}, + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AF_SINGLE_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_CX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598AT2, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_DA_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_CX4_DUAL_PORT, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_XF_LR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82598EB_SFP_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_KX4_MEZZ, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_XAUI_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_CX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_T3_LOM, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_COMBO_BACKPLANE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BACKPLANE_FCOE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF2, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_FCOE, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599EN_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_SFP_SF_QP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_QSFP_SF_QP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540T1, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550T1, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_KX4, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_10G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_X_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_KR_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SFP_N, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_SGMII_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_10G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X550EM_A_1G_T_L, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_X540_BYPASS, "Intel(R) PRO/10GbE PCI-Express Network Driver"), + PVID(IXGBE_INTEL_VENDOR_ID, IXGBE_DEV_ID_82599_BYPASS, "Intel(R) PRO/10GbE PCI-Express Network Driver"), /* required last entry */ - {0, 0, 0, 0, 0} + PVID_END }; -/************************************************************************ - * Table of branding strings - ************************************************************************/ -static char *ixgbe_strings[] = { - "Intel(R) PRO/10GbE PCI-Express Network Driver" -}; +static void *ixgbe_register(device_t dev); +static int ixgbe_if_attach_pre(if_ctx_t ctx); +static int ixgbe_if_attach_post(if_ctx_t ctx); +static int ixgbe_if_detach(if_ctx_t ctx); +static int ixgbe_if_shutdown(if_ctx_t ctx); +static int ixgbe_if_suspend(if_ctx_t ctx); +static int ixgbe_if_resume(if_ctx_t ctx); +static void ixgbe_if_stop(if_ctx_t ctx); +void ixgbe_if_enable_intr(if_ctx_t ctx); +static void ixgbe_if_disable_intr(if_ctx_t ctx); +static int ixgbe_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t qid); +static void ixgbe_if_media_status(if_ctx_t ctx, struct ifmediareq * ifmr); +static int ixgbe_if_media_change(if_ctx_t ctx); +static int ixgbe_if_msix_intr_assign(if_ctx_t, int); +static int ixgbe_if_mtu_set(if_ctx_t ctx, uint32_t mtu); +static void ixgbe_if_crcstrip_set(if_ctx_t ctx, int onoff, int strip); +static void ixgbe_if_multi_set(if_ctx_t ctx); +static int ixgbe_if_promisc_set(if_ctx_t ctx, int flags); +static int ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, + uint64_t *paddrs, int nrxqs, int nrxqsets); +static int ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, + uint64_t *paddrs, int nrxqs, int nrxqsets); +static void ixgbe_if_queues_free(if_ctx_t ctx); +static void ixgbe_if_timer(if_ctx_t ctx, uint16_t); +static void ixgbe_if_update_admin_status(if_ctx_t ctx); +static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); +static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); + +int ixgbe_intr(void *arg); + /************************************************************************ * Function prototypes ************************************************************************/ -static int ixgbe_probe(device_t); -static int ixgbe_attach(device_t); -static int ixgbe_detach(device_t); -static int ixgbe_shutdown(device_t); -static int ixgbe_suspend(device_t); -static int ixgbe_resume(device_t); -static int ixgbe_ioctl(struct ifnet *, u_long, caddr_t); -static void ixgbe_init(void *); -static void ixgbe_init_locked(struct adapter *); -static void ixgbe_stop(void *); #if __FreeBSD_version >= 1100036 -static uint64_t ixgbe_get_counter(struct ifnet *, ift_counter); +static uint64_t ixgbe_if_get_counter(if_ctx_t, ift_counter); #endif -static void ixgbe_init_device_features(struct adapter *); -static void ixgbe_check_fan_failure(struct adapter *, u32, bool); -static void ixgbe_add_media_types(struct adapter *); -static void ixgbe_media_status(struct ifnet *, struct ifmediareq *); -static int ixgbe_media_change(struct ifnet *); -static int ixgbe_allocate_pci_resources(struct adapter *); -static void ixgbe_get_slot_info(struct adapter *); -static int ixgbe_allocate_msix(struct adapter *); -static int ixgbe_allocate_legacy(struct adapter *); -static int ixgbe_configure_interrupts(struct adapter *); -static void ixgbe_free_pci_resources(struct adapter *); -static void ixgbe_local_timer(void *); -static int ixgbe_setup_interface(device_t, struct adapter *); -static void ixgbe_config_gpie(struct adapter *); -static void ixgbe_config_dmac(struct adapter *); -static void ixgbe_config_delay_values(struct adapter *); -static void ixgbe_config_link(struct adapter *); -static void ixgbe_check_wol_support(struct adapter *); -static int ixgbe_setup_low_power_mode(struct adapter *); -static void ixgbe_rearm_queues(struct adapter *, u64); -static void ixgbe_initialize_transmit_units(struct adapter *); -static void ixgbe_initialize_receive_units(struct adapter *); -static void ixgbe_enable_rx_drop(struct adapter *); -static void ixgbe_disable_rx_drop(struct adapter *); -static void ixgbe_initialize_rss_mapping(struct adapter *); +static void ixgbe_enable_queue(struct adapter *adapter, u32 vector); +static void ixgbe_disable_queue(struct adapter *adapter, u32 vector); +static void ixgbe_add_device_sysctls(if_ctx_t ctx); +static int ixgbe_allocate_pci_resources(if_ctx_t ctx); +static int ixgbe_setup_low_power_mode(if_ctx_t ctx); -static void ixgbe_enable_intr(struct adapter *); -static void ixgbe_disable_intr(struct adapter *); -static void ixgbe_update_stats_counters(struct adapter *); -static void ixgbe_set_promisc(struct adapter *); -static void ixgbe_set_multi(struct adapter *); -static void ixgbe_update_link_status(struct adapter *); -static void ixgbe_set_ivar(struct adapter *, u8, u8, s8); -static void ixgbe_configure_ivars(struct adapter *); -static u8 *ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); +static void ixgbe_config_dmac(struct adapter *adapter); +static void ixgbe_configure_ivars(struct adapter *adapter); +static void ixgbe_set_ivar(struct adapter *adapter, u8 entry, u8 vector, + s8 type); +static u8 *ixgbe_mc_array_itr(struct ixgbe_hw *, u8 **, u32 *); +static bool ixgbe_sfp_probe(if_ctx_t ctx); -static void ixgbe_setup_vlan_hw_support(struct adapter *); -static void ixgbe_register_vlan(void *, struct ifnet *, u16); -static void ixgbe_unregister_vlan(void *, struct ifnet *, u16); +static void ixgbe_free_pci_resources(if_ctx_t ctx); -static void ixgbe_add_device_sysctls(struct adapter *); -static void ixgbe_add_hw_stats(struct adapter *); -static int ixgbe_set_flowcntl(struct adapter *, int); -static int ixgbe_set_advertise(struct adapter *, int); -static int ixgbe_get_advertise(struct adapter *); +static int ixgbe_msix_link(void *arg); +static int ixgbe_msix_que(void *arg); +static void ixgbe_initialize_rss_mapping(struct adapter *adapter); +static void ixgbe_initialize_receive_units(if_ctx_t ctx); +static void ixgbe_initialize_transmit_units(if_ctx_t ctx); +static int ixgbe_setup_interface(if_ctx_t ctx); +static void ixgbe_init_device_features(struct adapter *adapter); +static void ixgbe_check_fan_failure(struct adapter *, u32, bool); +static void ixgbe_add_media_types(if_ctx_t ctx); +static void ixgbe_update_stats_counters(struct adapter *adapter); +static void ixgbe_config_link(struct adapter *adapter); +static void ixgbe_get_slot_info(struct adapter *); +static void ixgbe_check_wol_support(struct adapter *adapter); +static void ixgbe_enable_rx_drop(struct adapter *); +static void ixgbe_disable_rx_drop(struct adapter *); + +static void ixgbe_add_hw_stats(struct adapter *adapter); +static int ixgbe_set_flowcntl(struct adapter *, int); +static int ixgbe_set_advertise(struct adapter *, int); +static int ixgbe_get_advertise(struct adapter *); +static void ixgbe_setup_vlan_hw_support(if_ctx_t ctx); +static void ixgbe_config_gpie(struct adapter *adapter); +static void ixgbe_config_delay_values(struct adapter *adapter); + /* Sysctl handlers */ -static void ixgbe_set_sysctl_value(struct adapter *, const char *, - const char *, int *, int); -static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_flowcntl(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_advertise(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_interrupt_rate_handler(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_dmac(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_phy_temp(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_phy_overtemp_occurred(SYSCTL_HANDLER_ARGS); #ifdef IXGBE_DEBUG -static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_power_state(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_print_rss_config(SYSCTL_HANDLER_ARGS); #endif -static int ixgbe_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_eee_state(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); -static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_rdh_handler(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_rdt_handler(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_tdt_handler(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_tdh_handler(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_eee_state(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_wol_enable(SYSCTL_HANDLER_ARGS); +static int ixgbe_sysctl_wufc(SYSCTL_HANDLER_ARGS); -/* Support for pluggable optic modules */ -static bool ixgbe_sfp_probe(struct adapter *); - -/* Legacy (single vector) interrupt handler */ -static void ixgbe_legacy_irq(void *); - -/* The MSI/MSI-X Interrupt handlers */ -static void ixgbe_msix_que(void *); -static void ixgbe_msix_link(void *); - /* Deferred interrupt tasklets */ -static void ixgbe_handle_que(void *, int); -static void ixgbe_handle_link(void *, int); -static void ixgbe_handle_msf(void *, int); -static void ixgbe_handle_mod(void *, int); -static void ixgbe_handle_phy(void *, int); +static void ixgbe_handle_msf(void *); +static void ixgbe_handle_mod(void *); +static void ixgbe_handle_phy(void *); - /************************************************************************ * FreeBSD Device Interface Entry Points ************************************************************************/ static device_method_t ix_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ixgbe_probe), - DEVMETHOD(device_attach, ixgbe_attach), - DEVMETHOD(device_detach, ixgbe_detach), - DEVMETHOD(device_shutdown, ixgbe_shutdown), - DEVMETHOD(device_suspend, ixgbe_suspend), - DEVMETHOD(device_resume, ixgbe_resume), + DEVMETHOD(device_register, ixgbe_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + DEVMETHOD(device_shutdown, iflib_device_shutdown), + DEVMETHOD(device_suspend, iflib_device_suspend), + DEVMETHOD(device_resume, iflib_device_resume), #ifdef PCI_IOV - DEVMETHOD(pci_iov_init, ixgbe_init_iov), - DEVMETHOD(pci_iov_uninit, ixgbe_uninit_iov), - DEVMETHOD(pci_iov_add_vf, ixgbe_add_vf), + DEVMETHOD(pci_iov_init, iflib_device_iov_init), + DEVMETHOD(pci_iov_uninit, iflib_device_iov_uninit), + DEVMETHOD(pci_iov_add_vf, iflib_device_iov_add_vf), #endif /* PCI_IOV */ DEVMETHOD_END }; @@ -243,41 +239,57 @@ DRIVER_MODULE(ix, pci, ix_driver, ix_devclass, 0, 0); MODULE_DEPEND(ix, pci, 1, 1, 1); MODULE_DEPEND(ix, ether, 1, 1, 1); -#ifdef DEV_NETMAP -MODULE_DEPEND(ix, netmap, 1, 1, 1); -#endif +MODULE_DEPEND(ix, iflib, 1, 1, 1); +static device_method_t ixgbe_if_methods[] = { + DEVMETHOD(ifdi_attach_pre, ixgbe_if_attach_pre), + DEVMETHOD(ifdi_attach_post, ixgbe_if_attach_post), + DEVMETHOD(ifdi_detach, ixgbe_if_detach), + DEVMETHOD(ifdi_shutdown, ixgbe_if_shutdown), + DEVMETHOD(ifdi_suspend, ixgbe_if_suspend), + DEVMETHOD(ifdi_resume, ixgbe_if_resume), + DEVMETHOD(ifdi_init, ixgbe_if_init), + DEVMETHOD(ifdi_stop, ixgbe_if_stop), + DEVMETHOD(ifdi_msix_intr_assign, ixgbe_if_msix_intr_assign), + DEVMETHOD(ifdi_intr_enable, ixgbe_if_enable_intr), + DEVMETHOD(ifdi_intr_disable, ixgbe_if_disable_intr), + DEVMETHOD(ifdi_tx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, ixgbe_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queues_alloc, ixgbe_if_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, ixgbe_if_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, ixgbe_if_queues_free), + DEVMETHOD(ifdi_update_admin_status, ixgbe_if_update_admin_status), + DEVMETHOD(ifdi_multi_set, ixgbe_if_multi_set), + DEVMETHOD(ifdi_mtu_set, ixgbe_if_mtu_set), + DEVMETHOD(ifdi_crcstrip_set, ixgbe_if_crcstrip_set), + DEVMETHOD(ifdi_media_status, ixgbe_if_media_status), + DEVMETHOD(ifdi_media_change, ixgbe_if_media_change), + DEVMETHOD(ifdi_promisc_set, ixgbe_if_promisc_set), + DEVMETHOD(ifdi_timer, ixgbe_if_timer), + DEVMETHOD(ifdi_vlan_register, ixgbe_if_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), + DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), +#ifdef PCI_IOV + DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), + DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), + DEVMETHOD(ifdi_iov_vf_add, ixgbe_if_iov_vf_add), +#endif /* PCI_IOV */ + DEVMETHOD_END +}; + /* * TUNEABLE PARAMETERS: */ static SYSCTL_NODE(_hw, OID_AUTO, ix, CTLFLAG_RD, 0, "IXGBE driver parameters"); +static driver_t ixgbe_if_driver = { + "ixgbe_if", ixgbe_if_methods, sizeof(struct adapter) +}; -/* - * AIM: Adaptive Interrupt Moderation - * which means that the interrupt rate - * is varied over time based on the - * traffic for that interrupt vector - */ -static int ixgbe_enable_aim = TRUE; -SYSCTL_INT(_hw_ix, OID_AUTO, enable_aim, CTLFLAG_RDTUN, &ixgbe_enable_aim, 0, - "Enable adaptive interrupt moderation"); - static int ixgbe_max_interrupt_rate = (4000000 / IXGBE_LOW_LATENCY); SYSCTL_INT(_hw_ix, OID_AUTO, max_interrupt_rate, CTLFLAG_RDTUN, &ixgbe_max_interrupt_rate, 0, "Maximum interrupts per second"); -/* How many packets rxeof tries to clean at a time */ -static int ixgbe_rx_process_limit = 256; -SYSCTL_INT(_hw_ix, OID_AUTO, rx_process_limit, CTLFLAG_RDTUN, - &ixgbe_rx_process_limit, 0, "Maximum number of received packets to process at a time, -1 means unlimited"); - -/* How many packets txeof tries to clean at a time */ -static int ixgbe_tx_process_limit = 256; -SYSCTL_INT(_hw_ix, OID_AUTO, tx_process_limit, CTLFLAG_RDTUN, - &ixgbe_tx_process_limit, 0, - "Maximum number of sent packets to process at a time, -1 means unlimited"); - /* Flow control setting, default to full */ static int ixgbe_flow_control = ixgbe_fc_full; SYSCTL_INT(_hw_ix, OID_AUTO, flow_control, CTLFLAG_RDTUN, @@ -306,30 +318,6 @@ SYSCTL_INT(_hw_ix, OID_AUTO, enable_msix, CTLFLAG_RDTU "Enable MSI-X interrupts"); /* - * Number of Queues, can be set to 0, - * it then autoconfigures based on the - * number of cpus with a max of 8. This - * can be overriden manually here. - */ -static int ixgbe_num_queues = 0; -SYSCTL_INT(_hw_ix, OID_AUTO, num_queues, CTLFLAG_RDTUN, &ixgbe_num_queues, 0, - "Number of queues to configure, 0 indicates autoconfigure"); - -/* - * Number of TX descriptors per ring, - * setting higher than RX as this seems - * the better performing choice. - */ -static int ixgbe_txd = PERFORM_TXD; -SYSCTL_INT(_hw_ix, OID_AUTO, txd, CTLFLAG_RDTUN, &ixgbe_txd, 0, - "Number of transmit descriptors per queue"); - -/* Number of RX descriptors per ring */ -static int ixgbe_rxd = PERFORM_RXD; -SYSCTL_INT(_hw_ix, OID_AUTO, rxd, CTLFLAG_RDTUN, &ixgbe_rxd, 0, - "Number of receive descriptors per queue"); - -/* * Defining this on will allow the use * of unsupported SFP+ modules, note that * doing so you are on your own :) @@ -347,25 +335,218 @@ static int ixgbe_enable_fdir = 0; SYSCTL_INT(_hw_ix, OID_AUTO, enable_fdir, CTLFLAG_RDTUN, &ixgbe_enable_fdir, 0, "Enable Flow Director"); -/* Legacy Transmit (single queue) */ -static int ixgbe_enable_legacy_tx = 0; -SYSCTL_INT(_hw_ix, OID_AUTO, enable_legacy_tx, CTLFLAG_RDTUN, - &ixgbe_enable_legacy_tx, 0, "Enable Legacy TX flow"); - /* Receive-Side Scaling */ static int ixgbe_enable_rss = 1; SYSCTL_INT(_hw_ix, OID_AUTO, enable_rss, CTLFLAG_RDTUN, &ixgbe_enable_rss, 0, "Enable Receive-Side Scaling (RSS)"); +#if 0 /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; +#endif -static int (*ixgbe_start_locked)(struct ifnet *, struct tx_ring *); -static int (*ixgbe_ring_empty)(struct ifnet *, struct buf_ring *); - MALLOC_DEFINE(M_IXGBE, "ix", "ix driver allocations"); +/* + * For Flow Director: this is the number of TX packets we sample + * for the filter pool, this means every 20th packet will be probed. + * + * This feature can be disabled by setting this to 0. + */ +static int atr_sample_rate = 20; + +extern struct if_txrx ixgbe_txrx; + +static struct if_shared_ctx ixgbe_sctx_init = { + .isc_magic = IFLIB_MAGIC, + .isc_q_align = PAGE_SIZE,/* max(DBA_ALIGN, PAGE_SIZE) */ + .isc_tx_maxsize = IXGBE_TSO_SIZE, + + .isc_tx_maxsegsize = PAGE_SIZE, + + .isc_rx_maxsize = PAGE_SIZE*4, + .isc_rx_nsegments = 1, + .isc_rx_maxsegsize = PAGE_SIZE*4, + .isc_nfl = 1, + .isc_ntxqs = 1, + .isc_nrxqs = 1, + + .isc_admin_intrcnt = 1, + .isc_vendor_info = ixgbe_vendor_info_array, + .isc_driver_version = ixgbe_driver_version, + .isc_driver = &ixgbe_if_driver, + + .isc_nrxd_min = {MIN_RXD}, + .isc_ntxd_min = {MIN_TXD}, + .isc_nrxd_max = {MAX_RXD}, + .isc_ntxd_max = {MAX_TXD}, + .isc_nrxd_default = {DEFAULT_RXD}, + .isc_ntxd_default = {DEFAULT_TXD}, +}; + +if_shared_ctx_t ixgbe_sctx = &ixgbe_sctx_init; + /************************************************************************ + * ixgbe_if_tx_queues_alloc + ************************************************************************/ +static int +ixgbe_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, + int ntxqs, int ntxqsets) +{ + struct adapter *adapter = iflib_get_softc(ctx); + if_softc_ctx_t scctx = adapter->shared; + struct ix_tx_queue *que; + int i, j, error; + + MPASS(adapter->num_tx_queues > 0); + MPASS(adapter->num_tx_queues == ntxqsets); + MPASS(ntxqs == 1); + + /* Allocate queue structure memory */ + adapter->tx_queues = + (struct ix_tx_queue *)malloc(sizeof(struct ix_tx_queue) * ntxqsets, + M_IXGBE, M_NOWAIT | M_ZERO); + if (!adapter->tx_queues) { + device_printf(iflib_get_dev(ctx), + "Unable to allocate TX ring memory\n"); + return (ENOMEM); + } + + for (i = 0, que = adapter->tx_queues; i < ntxqsets; i++, que++) { + struct tx_ring *txr = &que->txr; + + /* In case SR-IOV is enabled, align the index properly */ + txr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool, + i); + + txr->adapter = que->adapter = adapter; + adapter->active_queues |= (u64)1 << txr->me; + + /* Allocate report status array */ + txr->tx_rsq = (qidx_t *)malloc(sizeof(qidx_t) * scctx->isc_ntxd[0], M_IXGBE, M_NOWAIT | M_ZERO); + if (txr->tx_rsq == NULL) { + error = ENOMEM; + goto fail; + } + for (j = 0; j < scctx->isc_ntxd[0]; j++) + txr->tx_rsq[j] = QIDX_INVALID; + /* get the virtual and physical address of the hardware queues */ + txr->tail = IXGBE_TDT(txr->me); + txr->tx_base = (union ixgbe_adv_tx_desc *)vaddrs[i]; + txr->tx_paddr = paddrs[i]; + + txr->bytes = 0; + txr->total_packets = 0; + + /* Set the rate at which we sample packets */ + if (adapter->feat_en & IXGBE_FEATURE_FDIR) + txr->atr_sample = atr_sample_rate; + + } + + iflib_config_gtask_init(ctx, &adapter->mod_task, ixgbe_handle_mod, + "mod_task"); + iflib_config_gtask_init(ctx, &adapter->msf_task, ixgbe_handle_msf, + "msf_task"); + iflib_config_gtask_init(ctx, &adapter->phy_task, ixgbe_handle_phy, + "phy_task"); + if (adapter->feat_cap & IXGBE_FEATURE_SRIOV) + iflib_config_gtask_init(ctx, &adapter->mbx_task, + ixgbe_handle_mbx, "mbx_task"); + if (adapter->feat_en & IXGBE_FEATURE_FDIR) + iflib_config_gtask_init(ctx, &adapter->fdir_task, + ixgbe_reinit_fdir, "fdir_task"); + + device_printf(iflib_get_dev(ctx), "allocated for %d queues\n", + adapter->num_tx_queues); + + return (0); + +fail: + ixgbe_if_queues_free(ctx); + + return (error); +} /* ixgbe_if_tx_queues_alloc */ + +/************************************************************************ + * ixgbe_if_rx_queues_alloc + ************************************************************************/ +static int +ixgbe_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, + int nrxqs, int nrxqsets) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct ix_rx_queue *que; + int i; + + MPASS(adapter->num_rx_queues > 0); + MPASS(adapter->num_rx_queues == nrxqsets); + MPASS(nrxqs == 1); + + /* Allocate queue structure memory */ + adapter->rx_queues = + (struct ix_rx_queue *)malloc(sizeof(struct ix_rx_queue)*nrxqsets, + M_IXGBE, M_NOWAIT | M_ZERO); + if (!adapter->rx_queues) { + device_printf(iflib_get_dev(ctx), + "Unable to allocate TX ring memory\n"); + return (ENOMEM); + } + + for (i = 0, que = adapter->rx_queues; i < nrxqsets; i++, que++) { + struct rx_ring *rxr = &que->rxr; + + /* In case SR-IOV is enabled, align the index properly */ + rxr->me = ixgbe_vf_que_index(adapter->iov_mode, adapter->pool, + i); + + rxr->adapter = que->adapter = adapter; + + /* get the virtual and physical address of the hw queues */ + rxr->tail = IXGBE_RDT(rxr->me); + rxr->rx_base = (union ixgbe_adv_rx_desc *)vaddrs[i]; + rxr->rx_paddr = paddrs[i]; + rxr->bytes = 0; + rxr->que = que; + } + + device_printf(iflib_get_dev(ctx), "allocated for %d rx queues\n", + adapter->num_rx_queues); + + return (0); +} /* ixgbe_if_rx_queues_alloc */ + +/************************************************************************ + * ixgbe_if_queues_free + ************************************************************************/ +static void +ixgbe_if_queues_free(if_ctx_t ctx) +{ + struct adapter *adapter = iflib_get_softc(ctx); + struct ix_tx_queue *tx_que = adapter->tx_queues; + struct ix_rx_queue *rx_que = adapter->rx_queues; + int i; + + if (tx_que != NULL) { + for (i = 0; i < adapter->num_tx_queues; i++, tx_que++) { + struct tx_ring *txr = &tx_que->txr; + if (txr->tx_rsq == NULL) + break; + + free(txr->tx_rsq, M_IXGBE); + txr->tx_rsq = NULL; + } + + free(adapter->tx_queues, M_IXGBE); + adapter->tx_queues = NULL; + } + if (rx_que != NULL) { + free(adapter->rx_queues, M_IXGBE); + adapter->rx_queues = NULL; + } +} /* ixgbe_if_queues_free */ + +/************************************************************************ * ixgbe_initialize_rss_mapping ************************************************************************/ static void @@ -403,17 +584,17 @@ ixgbe_initialize_rss_mapping(struct adapter *adapter) /* Set up the redirection table */ for (i = 0, j = 0; i < table_size; i++, j++) { - if (j == adapter->num_queues) + if (j == adapter->num_rx_queues) j = 0; if (adapter->feat_en & IXGBE_FEATURE_RSS) { /* * Fetch the RSS bucket id for the given indirection * entry. Cap it at the number of configured buckets - * (which is num_queues.) + * (which is num_rx_queues.) */ queue_id = rss_get_indirection_to_bucket(i); - queue_id = queue_id % adapter->num_queues; + queue_id = queue_id % adapter->num_rx_queues; } else queue_id = (j * index_mult); @@ -483,14 +664,16 @@ ixgbe_initialize_rss_mapping(struct adapter *adapter) #define BSIZEPKT_ROUNDUP ((1<rx_rings; - struct ixgbe_hw *hw = &adapter->hw; - struct ifnet *ifp = adapter->ifp; - int i, j; - u32 bufsz, fctrl, srrctl, rxcsum; - u32 hlreg; + struct adapter *adapter = iflib_get_softc(ctx); + if_softc_ctx_t scctx = adapter->shared; + struct ixgbe_hw *hw = &adapter->hw; + struct ifnet *ifp = iflib_get_ifp(ctx); + struct ix_rx_queue *que; + int i, j; + u32 bufsz, fctrl, srrctl, rxcsum; + u32 hlreg; /* * Make sure receives are disabled while @@ -513,24 +696,16 @@ ixgbe_initialize_receive_units(struct adapter *adapter hlreg |= IXGBE_HLREG0_JUMBOEN; else hlreg &= ~IXGBE_HLREG0_JUMBOEN; - -#ifdef DEV_NETMAP - /* CRC stripping is conditional in Netmap */ - if ((adapter->feat_en & IXGBE_FEATURE_NETMAP) && - (ifp->if_capenable & IFCAP_NETMAP) && - !ix_crcstrip) - hlreg &= ~IXGBE_HLREG0_RXCRCSTRP; - else -#endif /* DEV_NETMAP */ - hlreg |= IXGBE_HLREG0_RXCRCSTRP; - IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); bufsz = (adapter->rx_mbuf_sz + BSIZEPKT_ROUNDUP) >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - for (i = 0; i < adapter->num_queues; i++, rxr++) { - u64 rdba = rxr->rxdma.dma_paddr; + /* Setup the Base and Length of the Rx Descriptor Ring */ + for (i = 0, que = adapter->rx_queues; i < adapter->num_rx_queues; i++, que++) { + struct rx_ring *rxr = &que->rxr; + u64 rdba = rxr->rx_paddr; + j = rxr->me; /* Setup the Base and Length of the Rx Descriptor Ring */ @@ -538,7 +713,7 @@ ixgbe_initialize_receive_units(struct adapter *adapter (rdba & 0x00000000ffffffffULL)); IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), - adapter->num_rx_desc * sizeof(union ixgbe_adv_rx_desc)); + scctx->isc_nrxd[0] * sizeof(union ixgbe_adv_rx_desc)); /* Set up the SRRCTL register */ srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(j)); @@ -553,7 +728,7 @@ ixgbe_initialize_receive_units(struct adapter *adapter * so we do not need to clear the bit, but do it just in case * this code is moved elsewhere. */ - if (adapter->num_queues > 1 && + if (adapter->num_rx_queues > 1 && adapter->hw.fc.requested_mode == ixgbe_fc_none) { srrctl |= IXGBE_SRRCTL_DROP_EN; } else { @@ -582,7 +757,7 @@ ixgbe_initialize_receive_units(struct adapter *adapter ixgbe_initialize_rss_mapping(adapter); - if (adapter->num_queues > 1) { + if (adapter->num_rx_queues > 1) { /* RSS and RX IPP Checksum are mutually exclusive */ rxcsum |= IXGBE_RXCSUM_PCSD; } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Dec 20 18:17:02 2017 Return-Path: Delivered-To: svn-src-head@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 E7797E9AA39; Wed, 20 Dec 2017 18:17:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from c.mail.sonic.net (c.mail.sonic.net [64.142.111.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CF4107A7A4; Wed, 20 Dec 2017 18:17:02 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by c.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id vBKIGxYA002587 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Wed, 20 Dec 2017 10:17:00 -0800 Subject: Re: svn commit: r326758 - in head/sys/i386: conf include To: John Baldwin , David Chisnall Cc: Eugene Grosbein , Konstantin Belousov , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1705b795-46ca-bb27-6ba7-fab4eeed0aba@FreeBSD.org> <68FECEF0-014E-4741-BE96-680E9338557B@FreeBSD.org> <1839614.eNG2DjLqvF@ralph.baldwin.cx> From: Nathan Whitehorn Message-ID: <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> Date: Wed, 20 Dec 2017 10:16:58 -0800 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1839614.eNG2DjLqvF@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVZcjpYFyb8x72kc5SHpnUfJoaJLXR7XBXd6RMzaAJfQkAATifu92EYBbwUupt57DbCoDNHy/xkXBuLihdks801JbK48L7KrmFg= X-Sonic-ID: C;/AIU+LHl5xG7QusnWtmBlw== M;mgaa+LHl5xG7QusnWtmBlw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 18:17:03 -0000 On 12/20/17 09:14, John Baldwin wrote: > On Wednesday, December 20, 2017 09:59:26 AM David Chisnall wrote: >> On 16 Dec 2017, at 18:05, John Baldwin wrote: >>> When I build a FreeBSD/mips64 kernel with clang, >>> _any_ simple NFS op triggers a kernel stack overflow. Kernels compiled >>> with GCC do not. >> That is not my experience. I haven’t tried a MIPS64 kernel built with clang, but with in-tree gcc I get kernel panics as soon as I try to use NFS, unless I use Stacey’s patches that increase the kernel stack size. > I have primarily been using modern GCC for GCC once that was working, but at > least when running a MALTA64 kernel under qemu I was not triggering panics > even with old GCC. With the in-tree clang 5.0 or with CHERI clang, just > doing an 'ls' of a NFS directory or even a tab-complete of a path that > is on NFS reliably triggers a kernel stack overflow for MALTA64 in qemu. > > With Stacey's kstack pages, a clang kernel does survive, but those are not > in stock FreeBSD which is where I have been testing this. > With GCC 4, it takes a little while, but trying to build ports over NFS is a sure-fire way to bring down the kernel. I haven't tried any other compilers. -Nathan From owner-svn-src-head@freebsd.org Wed Dec 20 18:23:24 2017 Return-Path: Delivered-To: svn-src-head@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 A92BCE9B051; Wed, 20 Dec 2017 18:23:24 +0000 (UTC) (envelope-from ian@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 7D2787AC73; Wed, 20 Dec 2017 18:23:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKINNWa066648; Wed, 20 Dec 2017 18:23:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKINNH1066643; Wed, 20 Dec 2017 18:23:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712201823.vBKINNH1066643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Dec 2017 18:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327032 - in head: share/man/man4 sys/conf sys/dev/md X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head: share/man/man4 sys/conf sys/dev/md X-SVN-Commit-Revision: 327032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 18:23:24 -0000 Author: ian Date: Wed Dec 20 18:23:22 2017 New Revision: 327032 URL: https://svnweb.freebsd.org/changeset/base/327032 Log: Add a new kernel config option, MD_ROOT_READONLY, which forces on the MD_READONLY flag for the md device automatically instantiated during kernel init for an mdroot filesystem. Note that there is specifically and by design no tunable or sysctl control over this feature. Without this option, you already have control over whether the mdroot fs is writeable using vfs.root.mountfrom.options from loader(8), the root_rw_mount rcvar, and by using "mount -u[rw] /" or equivelent on the fly. This option is being added to provide a way to make the mdroot fs truly immutable before userland code begins running. Differential Revision: https://reviews.freebsd.org/D13411 Modified: head/share/man/man4/md.4 head/sys/conf/NOTES head/sys/conf/options head/sys/dev/md/md.c Modified: head/share/man/man4/md.4 ============================================================================== --- head/share/man/man4/md.4 Wed Dec 20 18:15:06 2017 (r327031) +++ head/share/man/man4/md.4 Wed Dec 20 18:23:22 2017 (r327032) @@ -7,7 +7,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 5, 2017 +.Dd December 7, 2017 .Dt MD 4 .Os .Sh NAME @@ -79,7 +79,8 @@ To create a kernel with a ramdisk or MD file system, y needs the following options: .Bd -literal -offset indent options MD_ROOT # MD is a potential root device -options MD_ROOT_SIZE=8192 # 8MB ram disk +options MD_ROOT_READONLY # disallow mounting root writeable +options MD_ROOT_SIZE=8192 # 8MB ram disk makeoptions MFS_IMAGE=/h/foo/ARM-MD options ROOTDEVNAME=\\"ufs:md0\\" .Ed Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Wed Dec 20 18:15:06 2017 (r327031) +++ head/sys/conf/NOTES Wed Dec 20 18:23:22 2017 (r327032) @@ -1101,6 +1101,9 @@ options MD_ROOT_SIZE=10 # images of type mfs_root or md_root. options MD_ROOT +# Write-protect the md root device so that it may not be mounted writeable. +options MD_ROOT_READONLY + # Disk quotas are supported when this option is enabled. options QUOTA #enable disk quotas Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Wed Dec 20 18:15:06 2017 (r327031) +++ head/sys/conf/options Wed Dec 20 18:23:22 2017 (r327032) @@ -165,6 +165,7 @@ MAC_STUB opt_dontuse.h MAC_TEST opt_dontuse.h MD_ROOT opt_md.h MD_ROOT_FSTYPE opt_md.h +MD_ROOT_READONLY opt_md.h MD_ROOT_SIZE opt_md.h MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Wed Dec 20 18:15:06 2017 (r327031) +++ head/sys/dev/md/md.c Wed Dec 20 18:23:22 2017 (r327032) @@ -1791,9 +1791,15 @@ md_preloaded(u_char *image, size_t length, const char sc->start = mdstart_preload; if (name != NULL) strlcpy(sc->file, name, sizeof(sc->file)); -#if defined(MD_ROOT) && !defined(ROOTDEVNAME) - if (sc->unit == 0) +#ifdef MD_ROOT + if (sc->unit == 0) { +#ifndef ROOTDEVNAME rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; +#endif +#ifdef MD_ROOT_READONLY + sc->flags |= MD_READONLY; +#endif + } #endif mdinit(sc); if (name != NULL) { From owner-svn-src-head@freebsd.org Wed Dec 20 19:08:14 2017 Return-Path: Delivered-To: svn-src-head@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 1EE78E9D6F6; Wed, 20 Dec 2017 19:08:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDA1C7C3F8; Wed, 20 Dec 2017 19:08:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 859CF10A8CC; Wed, 20 Dec 2017 14:08:12 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Cc: David Chisnall , Eugene Grosbein , Konstantin Belousov , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326758 - in head/sys/i386: conf include Date: Wed, 20 Dec 2017 11:07:59 -0800 Message-ID: <2357779.RlDvz1mMEe@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1839614.eNG2DjLqvF@ralph.baldwin.cx> <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 20 Dec 2017 14:08:12 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:08:14 -0000 On Wednesday, December 20, 2017 10:16:58 AM Nathan Whitehorn wrote: >=20 > On 12/20/17 09:14, John Baldwin wrote: > > On Wednesday, December 20, 2017 09:59:26 AM David Chisnall wrote: > >> On 16 Dec 2017, at 18:05, John Baldwin wrote: > >>> When I build a FreeBSD/mips64 kernel with clang, > >>> _any_ simple NFS op triggers a kernel stack overflow. Kernels co= mpiled > >>> with GCC do not. > >> That is not my experience. I haven=E2=80=99t tried a MIPS64 kerne= l built with clang, but with in-tree gcc I get kernel panics as soon as= I try to use NFS, unless I use Stacey=E2=80=99s patches that increase = the kernel stack size. > > I have primarily been using modern GCC for GCC once that was workin= g, but at > > least when running a MALTA64 kernel under qemu I was not triggering= panics > > even with old GCC. With the in-tree clang 5.0 or with CHERI clang,= just > > doing an 'ls' of a NFS directory or even a tab-complete of a path t= hat > > is on NFS reliably triggers a kernel stack overflow for MALTA64 in = qemu. > > > > With Stacey's kstack pages, a clang kernel does survive, but those = are not > > in stock FreeBSD which is where I have been testing this. > > >=20 > With GCC 4, it takes a little while, but trying to build ports over N= FS=20 > is a sure-fire way to bring down the kernel. I haven't tried any othe= r=20 > compilers. Ah, I have only done things like run binaries over NFS and compile simp= le test programs over NFS with GCC 4 (I do run a gdb binary over NFS again= st itself which probably involves a bit of I/O due to debug symbols, etc. = but still not as onerous as building lots of ports. I cross-build the GDB = on the host due to qemu being too slow). clang insta-panics for even triv= ial things like 'ls' and tab-completion though. It's definitely much worse= than either version of GCC. --=20 John Baldwin From owner-svn-src-head@freebsd.org Wed Dec 20 19:13:57 2017 Return-Path: Delivered-To: svn-src-head@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 5C45EE9DCCA; Wed, 20 Dec 2017 19:13:57 +0000 (UTC) (envelope-from imp@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 26D817CB22; Wed, 20 Dec 2017 19:13:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJDuLw087196; Wed, 20 Dec 2017 19:13:56 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJDuV9087194; Wed, 20 Dec 2017 19:13:56 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201913.vBKJDuV9087194@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327034 - in head/sys: cam dev/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: cam dev/nvme X-SVN-Commit-Revision: 327034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:13:57 -0000 Author: imp Date: Wed Dec 20 19:13:55 2017 New Revision: 327034 URL: https://svnweb.freebsd.org/changeset/base/327034 Log: Return domain, bus, slot, and function for the transport settings in PATH_INQ requests for nvme. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546 Modified: head/sys/cam/cam_ccb.h head/sys/dev/nvme/nvme_sim.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Wed Dec 20 19:12:15 2017 (r327033) +++ head/sys/cam/cam_ccb.h Wed Dec 20 19:13:55 2017 (r327034) @@ -633,6 +633,11 @@ struct ccb_pathinq_settings_sas { struct ccb_pathinq_settings_nvme { uint32_t nsid; /* Namespace ID for this path */ + uint32_t domain; + uint8_t bus; + uint8_t slot; + uint8_t function; + uint8_t extra; }; #define PATHINQ_SETTINGS_SIZE 128 Modified: head/sys/dev/nvme/nvme_sim.c ============================================================================== --- head/sys/dev/nvme/nvme_sim.c Wed Dec 20 19:12:15 2017 (r327033) +++ head/sys/dev/nvme/nvme_sim.c Wed Dec 20 19:13:55 2017 (r327034) @@ -182,7 +182,8 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) break; case XPT_PATH_INQ: /* Path routing inquiry */ { - struct ccb_pathinq *cpi = &ccb->cpi; + struct ccb_pathinq *cpi = &ccb->cpi; + device_t dev = ctrlr->dev; /* * NVMe may have multiple LUNs on the same path. Current generation @@ -210,6 +211,11 @@ nvme_sim_action(struct cam_sim *sim, union ccb *ccb) cpi->protocol = PROTO_NVME; cpi->protocol_version = nvme_mmio_read_4(ctrlr, vs); cpi->xport_specific.nvme.nsid = ns->id; + cpi->xport_specific.nvme.domain = pci_get_domain(dev); + cpi->xport_specific.nvme.bus = pci_get_bus(dev); + cpi->xport_specific.nvme.slot = pci_get_slot(dev); + cpi->xport_specific.nvme.function = pci_get_function(dev); + cpi->xport_specific.nvme.extra = 0; cpi->ccb_h.status = CAM_REQ_CMP; break; } From owner-svn-src-head@freebsd.org Wed Dec 20 19:14:09 2017 Return-Path: Delivered-To: svn-src-head@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 E67EAE9DD3E; Wed, 20 Dec 2017 19:14:08 +0000 (UTC) (envelope-from imp@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 43CD17CBF7; Wed, 20 Dec 2017 19:14:06 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJE6G1087254; Wed, 20 Dec 2017 19:14:06 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJE6kd087253; Wed, 20 Dec 2017 19:14:06 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201914.vBKJE6kd087253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327035 - head/sys/dev/pci X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/pci X-SVN-Commit-Revision: 327035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:14:09 -0000 Author: imp Date: Wed Dec 20 19:14:05 2017 New Revision: 327035 URL: https://svnweb.freebsd.org/changeset/base/327035 Log: Add device location wiring to the pci bus. This allows one to specify, for example, that if there's an igb card in bus 12, slot 0, function 0, it should be assigned igb5. If there isn't, or there's one in a different slot, normal numbering rules apply (hinted units are skipped). Adding 'hint.igb.5.at="pci12:0:0"' or 'hint.igb.5.at="pci0:12:0:0"' to /boot/device.hints will accomplish this. The double quotes are important. The kernel only accepts the strings (in shell notation): pci$d:$b:$s:$f and pci$b:$s:$f where $d is the pci domain, $b is the pci bus number, $s is the slot number and $f is the function number. A string compare is done with the current device to avoid another string parser in the kernel. All numbers are unsigned decimal without leading zeros. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546 Modified: head/sys/dev/pci/pci.c Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Wed Dec 20 19:13:55 2017 (r327034) +++ head/sys/dev/pci/pci.c Wed Dec 20 19:14:05 2017 (r327035) @@ -123,6 +123,8 @@ static void pci_resume_msi(device_t dev); static void pci_resume_msix(device_t dev); static int pci_remap_intr_method(device_t bus, device_t dev, u_int irq); +static void pci_hint_device_unit(device_t acdev, device_t child, + const char *name, int *unitp); static int pci_get_id_method(device_t dev, device_t child, enum pci_id_type type, uintptr_t *rid); @@ -162,6 +164,7 @@ static device_method_t pci_methods[] = { DEVMETHOD(bus_child_detached, pci_child_detached), DEVMETHOD(bus_child_pnpinfo_str, pci_child_pnpinfo_str_method), DEVMETHOD(bus_child_location_str, pci_child_location_str_method), + DEVMETHOD(bus_hint_device_unit, pci_hint_device_unit), DEVMETHOD(bus_remap_intr, pci_remap_intr_method), DEVMETHOD(bus_suspend_child, pci_suspend_child), DEVMETHOD(bus_resume_child, pci_resume_child), @@ -4218,6 +4221,31 @@ pci_detach(device_t dev) return (error); #endif return (device_delete_children(dev)); +} + +static void +pci_hint_device_unit(device_t dev, device_t child, const char *name, int *unitp) +{ + int line, unit; + const char *at; + char me1[24], me2[32]; + uint8_t b, s, f; + uint32_t d; + + d = pci_get_domain(child); + b = pci_get_bus(child); + s = pci_get_slot(child); + f = pci_get_function(child); + snprintf(me1, sizeof(me1), "pci%u:%u:%u", b, s, f); + snprintf(me2, sizeof(me2), "pci%u:%u:%u:%u", d, b, s, f); + line = 0; + while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) { + resource_string_value(name, unit, "at", &at); + if (strcmp(at, me1) != 0 && strcmp(at, me2) != 0) + continue; /* No match, try next candidate */ + *unitp = unit; + return; + } } static void From owner-svn-src-head@freebsd.org Wed Dec 20 19:14:12 2017 Return-Path: Delivered-To: svn-src-head@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 5E22DE9DD68; Wed, 20 Dec 2017 19:14:12 +0000 (UTC) (envelope-from imp@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 0FF407CC6E; Wed, 20 Dec 2017 19:14:11 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJEBBt087308; Wed, 20 Dec 2017 19:14:11 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJEBTV087307; Wed, 20 Dec 2017 19:14:11 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201914.vBKJEBTV087307@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:14:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327036 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:14:12 -0000 Author: imp Date: Wed Dec 20 19:14:11 2017 New Revision: 327036 URL: https://svnweb.freebsd.org/changeset/base/327036 Log: Document new pci device hints wiring. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546 Modified: head/share/man/man4/pci.4 Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Wed Dec 20 19:14:05 2017 (r327035) +++ head/share/man/man4/pci.4 Wed Dec 20 19:14:11 2017 (r327036) @@ -492,6 +492,59 @@ The value of the tunable is the raw IRQ value to use f pin identified by the tunable name. Mapping of IRQ values to platform interrupt sources is machine dependent. .El +.Sh DEVICE WIRING +You can wire the device unit at a given location with device.hints. +Entries of the form +.Va hints...at="pci::" +or +.Va hints...at="pci:::" +will force the driver +.Va name +to probe and attach at unit +.Va unit +for any PCI device found to match the specification, where: +.Bl -tag -width -indent +.It +The domain +.Pq or segment +of the PCI device in decimal. +Defaults to 0 if unspecified +.It +The bus address of the PCI device in decimal. +.It +The slot of the PCI device in decimal. +.It +The function of the PCI device in decimal. +.El +.Pp +The code to do the matching requires an exact string match. +Do not specify the angle brackets +.Pq < > +in the hints file. +Wiring multiple devices to the same +.Va name +and +.Va unit +produces undefined results. +.Ss Examples +Given the following lines in +.Pa /boot/device.hints : +.Cd hint.nvme.3.at="pci6:0:0" +.Cd hint.igb.8.at="pci14:0:0" +If there is a device that supports +.Xr igb 4 +at PCI bus 14 slot 0 function 0, +then it will be assigned igb8 for probe and attach. +Likewise, if there is an +.Xr nvme 4 +card at PCI bus 6 slot 0 function 0, +then it will be assigned nvme3 for probe and attach. +If another type of card is in either of these locations, the name and +unit of that card will be the default names and will be unaffected by +these hints. +If other igb or nvme cards are located elsewhere, they will be +assigned their unit numbers sequentially, skipping the unit numbers +that have 'at' hints. .Sh FILES .Bl -tag -width /dev/pci -compact .It Pa /dev/pci From owner-svn-src-head@freebsd.org Wed Dec 20 19:14:19 2017 Return-Path: Delivered-To: svn-src-head@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 6202EE9DDB9; Wed, 20 Dec 2017 19:14:19 +0000 (UTC) (envelope-from imp@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 3EE257CD5A; Wed, 20 Dec 2017 19:14:17 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJEGLw087360; Wed, 20 Dec 2017 19:14:16 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJEG68087359; Wed, 20 Dec 2017 19:14:16 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201914.vBKJEG68087359@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:14:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327037 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 327037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:14:19 -0000 Author: imp Date: Wed Dec 20 19:14:16 2017 New Revision: 327037 URL: https://svnweb.freebsd.org/changeset/base/327037 Log: Simplify the code a bit. Replace clumsy for(;;) { if (foo) break; ...} with simpler while (!foo) { ... }. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D13546 Modified: head/sys/dev/acpica/acpi.c Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:11 2017 (r327036) +++ head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:16 2017 (r327037) @@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, * name to see if one's resources are a subset of this device. */ line = 0; - for (;;) { - if (resource_find_dev(&line, name, &unit, "at", NULL) != 0) - break; - + while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) { /* Must have an "at" for acpi or isa. */ resource_string_value(name, unit, "at", &s); if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 || From owner-svn-src-head@freebsd.org Wed Dec 20 19:14:22 2017 Return-Path: Delivered-To: svn-src-head@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 4E756E9DDEB; Wed, 20 Dec 2017 19:14:22 +0000 (UTC) (envelope-from imp@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 1480B7CDE0; Wed, 20 Dec 2017 19:14:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKJELx5087413; Wed, 20 Dec 2017 19:14:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKJELsk087412; Wed, 20 Dec 2017 19:14:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712201914.vBKJELsk087412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 20 Dec 2017 19:14:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327038 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:14:22 -0000 Author: imp Date: Wed Dec 20 19:14:20 2017 New Revision: 327038 URL: https://svnweb.freebsd.org/changeset/base/327038 Log: Add nvme wiring example Add NVMe and MMC/SD card support info. Sponsored by: Netflix Modified: head/share/man/man4/scsi.4 Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Wed Dec 20 19:14:16 2017 (r327037) +++ head/share/man/man4/scsi.4 Wed Dec 20 19:14:20 2017 (r327038) @@ -54,13 +54,17 @@ The .Nm subsystem provides a uniform and modular system for the implementation of drivers to control various -.Tn SCSI +.Tn SCSI , +.Tn ATA , +.Tn NMVe , and -.Tn ATA +.Tn MMC / SD devices, and to utilize different -.Tn SCSI +.Tn SCSI , +.Tn ATA , +.Tn NVMe , and -.Tn ATA +.Tn MMC / SD host adapters through host adapter drivers. When the system probes buses, it attaches any devices it finds to the appropriate drivers. @@ -213,6 +217,31 @@ and use the first respective counted instances. These examples can be combined together to allow a peripheral device to be wired to any particular controller, bus, target, and/or unit instance. .Pp +This also works with +.Xr nvme 4 +drives as well. +.Bd -literal -offset indent +hint.nvme.4.at="pci7:0:0" +hint.scbus.10.at="nvme4" +hint.nda.10.at="scbus10" +hint.nda.10.target="1" +hint.nda.10.unit="12" +hint.nda.11.at="scbus10" +hint.nda.11.target="1" +hint.nda.11.unit="2" +.Ed +.Pp +This assigns the NVMe card living at PCI bus 7 to scbus 10 (in PCIe, +slot and function are rarely used and usually 0). +The target for +.Xr nda 4 +devices is always 1. +The unit is the namespace identifier from the drive. +The namespace id 1 is exported as +.Tn nda10 +and namespace id 2 is exported as +.Tn nda11 . +.Pp When you have a mixture of wired down and counted devices then the counting begins with the first non-wired down unit for a particular type. @@ -225,9 +254,11 @@ The system allows common device drivers to work throug types of adapters. The adapters take requests from the upper layers and do all IO between the -.Tn SCSI +.Tn SCSI , +.Tn ATA , +.Tn NVMe , or -.Tn ATA +.Tn MMC / SD bus and the system. The maximum size of a transfer is governed by the adapter. @@ -322,6 +353,7 @@ for details. .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr nvme 4 , .Xr pass 4 , .Xr pt 4 , .Xr sa 4 , @@ -351,3 +383,8 @@ The .Tn ATA support was added by .An Alexander Motin Aq Mt mav@FreeBSD.org . +The +.Nm +.Tn NVMe +support was added by +.An Warner Losh Aq Mt imp@FreeBSD.org . From owner-svn-src-head@freebsd.org Wed Dec 20 19:15:10 2017 Return-Path: Delivered-To: svn-src-head@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 66301E9DFD0; Wed, 20 Dec 2017 19:15:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wr0-x230.google.com (mail-wr0-x230.google.com [IPv6:2a00:1450:400c:c0c::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EBD757D1AD; Wed, 20 Dec 2017 19:15:09 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-wr0-x230.google.com with SMTP id f8so12425103wre.4; Wed, 20 Dec 2017 11:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=djiBRCiwF7+/iEoukM+sp/6B/PBydAcJQgcd3AAeVwo=; b=Exen+j4/FglJ5T7K+pDrvHt6yCJoIw3uJmolKSCz4ekmLg2s8xokm9ab4lmWQZ83Aa sIFp+EBWVUlEkjm8Aa6i4BA3ryWuNXPzWTW1LXmXY0Jx0DWW4DJT+8Ayr9SqxArygnFP dYvVszFf5r/Ps27GZtfDbl2M6Vwiy2S4+vbVAJae6vDTGSQbMr55d7q/r+GNBbMxwJQ4 HQCnPg3QWL3sfC92ra1ZEVvYWlgmHGRWYda0RM0zK5LH1HvK0NjHQNogOcWRRpzWpK+B XouUXEggjpVz5xuZka81a5TVVG5nFPUQtt1AuhulLWk2qoSTX5Wi7YvlcEdd+XcuHtYs F0aA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=djiBRCiwF7+/iEoukM+sp/6B/PBydAcJQgcd3AAeVwo=; b=m16l7uoQhJKIibC8kj/9wUw/EPzXGYhciSJ6XWQeVlioaBnd3NrVpIhE9APA+u0o9A FSUtVCn2h3QOHbtzMoZyh+G5ie29Az7QaKnBX4kWz9XSfLQSDOS1LiyJIZXxvWuKdRKF 5ExHykiaZD2vDtcJvyyCZ6h97uPupn9g3Ymnw10BdRJXMvIUTAF8KeU6Uo/r5gQvg29h BSnDT2cmHyEQ9Y6qY0y3SlNon5Q2gaZ5TSO8Pa4gfhlryY6rXvAGrOzVOasVR43dAmIO tj1M5QqRbSc9fMcs8vR4qDp9WmIR7EdUxdbBF4UXtRJkBO6Ie6+J2jPtT1/MEgDb8r5k QAag== X-Gm-Message-State: AKGB3mIVGSERMCc47fhd6Mc1LXzKNWdSUT2JiA80JYXbGWQ53GJjF0Mr FUcohGnoc7vJcvLRW018cANC4csrpm8MpRJNhwWAWw== X-Google-Smtp-Source: ACJfBov1UPVQuXw/yUWSy0WBjaZkLPYyY0ig3exw27gx4AYZoj/VdeHUT8WsvdYk/VenbBBjZvm2BObyXEDZLYgMngE= X-Received: by 10.223.188.66 with SMTP id a2mr9945497wrh.249.1513797307611; Wed, 20 Dec 2017 11:15:07 -0800 (PST) MIME-Version: 1.0 Sender: adrian.chadd@gmail.com Received: by 10.28.213.11 with HTTP; Wed, 20 Dec 2017 11:15:06 -0800 (PST) In-Reply-To: <2357779.RlDvz1mMEe@ralph.baldwin.cx> References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1839614.eNG2DjLqvF@ralph.baldwin.cx> <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> <2357779.RlDvz1mMEe@ralph.baldwin.cx> From: Adrian Chadd Date: Wed, 20 Dec 2017 11:15:06 -0800 X-Google-Sender-Auth: Sh046Tkh5N-TEbPQV3JOa7JVaoo Message-ID: Subject: Re: svn commit: r326758 - in head/sys/i386: conf include To: John Baldwin Cc: Nathan Whitehorn , David Chisnall , Eugene Grosbein , Konstantin Belousov , Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:15:10 -0000 Hi, I kinda bet that this will just get worse over time, so maybe it's time we revisited figuring out a better way of dispatching work instead of (a) lots of kernel threads for different subsystems and (b) lots of deep stack frames. eg - NFS over wifi == hilarious pain -adrian From owner-svn-src-head@freebsd.org Wed Dec 20 19:32:46 2017 Return-Path: Delivered-To: svn-src-head@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 24150E9F2DC; Wed, 20 Dec 2017 19:32:46 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x233.google.com (mail-qk0-x233.google.com [IPv6:2607:f8b0:400d:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D8B327E018; Wed, 20 Dec 2017 19:32:45 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x233.google.com with SMTP id v188so657876qkh.11; Wed, 20 Dec 2017 11:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Powhx1tBSgER5xwF26j77rVHX0HpSX+DsUoyJVogNkA=; b=Lh/Wxql1Z6TgKUyGP9699R4gA50PS5kBOkGmdEnZB/H+iG7bFm0aDD49IHabzYsRl3 hCqT85Af1ITpzbv1Irfp62MoK0gIMGLt7DGWazM5pfm16kp4ZH1Gw6PAOZZkQVG+oQxH yPcRrD3Bx44+o5xUxXsQdEkK+rnn74lMLz+5IoDMJ/TGJZIS4WZKxy2UiWvSxTgvX/we 6d84witIJkluKWC2U+v0sEDFzd7fT5bIDc2CFXZL/aA3KVLoOBIfRLcELR+8BHALv6qr xtvmJEbEoa2Xa0g8Q0BnWJB1Q4wNhiMZxBIUQQRNdS/Sq1kanPV2xw8qPz+HEsrcZXA4 ckkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Powhx1tBSgER5xwF26j77rVHX0HpSX+DsUoyJVogNkA=; b=nYSCP2b21iPT2dvmLq3ccOiQIy7A4BMGMGAi8Ebx2tVOA5hDVedTBWdKvHzOpM0Tah 2UREvO+6mhF/Ya226/Ky1pLNB34dshYE3IjBPC11y5FgRjd1sJj3PNgquRv6J3MXRmXD 1dl6NZo5KcPqEYxl+B2sxB5HtOm92FSNglFCqa7T/E/MnNQZ5b82ZdmIrpzMD8SOOhRV BNq4ithZwus3J8ZNOAVFGW/ISj6+4tl7YLWmQd+cmX49+vMw+juV5uIXy/dNjsaozhF+ XNFwX1d+D6tO66cpTPlQTys7SgqqNtO57FI8dmW1QVk+PqM25nZJ+bUZ1ZEpSzccQqxc Vfyg== X-Gm-Message-State: AKGB3mIj9tU3PpiXrfZlOeTDdw9/oTNQUn8/Ue1BUR+r4wQMRpU/rub9 BFs0nyK9FD5WXt57bd5gTqtPuw== X-Google-Smtp-Source: ACJfBotD3rdJlypatQ3Q+ijJkaNTyay45Z7LreccWvFBx1dXIAncciu7Fb2bjLvCamBN8r+rKn8qxA== X-Received: by 10.55.123.135 with SMTP id w129mr10602915qkc.273.1513798364210; Wed, 20 Dec 2017 11:32:44 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id w41sm11260788qtc.19.2017.12.20.11.32.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 11:32:42 -0800 (PST) Sender: Mark Johnston Date: Wed, 20 Dec 2017 14:32:37 -0500 From: Mark Johnston To: Eric Joyner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327031 - in head/sys: conf dev/ixgbe modules/ix modules/ixv Message-ID: <20171220193237.GA11032@raichu> References: <201712201815.vBKIF6IN062349@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712201815.vBKIF6IN062349@repo.freebsd.org> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:32:46 -0000 On Wed, Dec 20, 2017 at 06:15:06PM +0000, Eric Joyner wrote: > Author: erj > Date: Wed Dec 20 18:15:06 2017 > New Revision: 327031 > URL: https://svnweb.freebsd.org/changeset/base/327031 > > Log: > ixgbe(4): Convert driver to use iflib > > Initial update to the ixgbe PF and VF drivers to support the iflib interface. > > The PF driver version is bumped to 4.0.0, and the VF driver version is bumped to 2.0.0. > > Special thanks to sbruno@ for the support in helping make this conversion happen. > > Submitted by: Jeb Cramer , Krzysztof Galazka (Chris) , Piotr Pietruszewski > Reviewed by: sbruno@, shurd@, #IntelNetworking > Tested by: Jeffrey Pieper , Sergey Kozlov > Sponsored by: Limelight Networks, Intel Corporation > Differential Revision: https://reviews.freebsd.org/D11727 This seems to have broken at least the i386 kernel build. Could you please take a look? https://ci.freebsd.org/job/FreeBSD-head-i386-build/5330/console From owner-svn-src-head@freebsd.org Wed Dec 20 19:20:28 2017 Return-Path: Delivered-To: svn-src-head@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 728C8E9E4DF for ; Wed, 20 Dec 2017 19:20:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2ED627D5F7 for ; Wed, 20 Dec 2017 19:20:28 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id 87so14298529ior.5 for ; Wed, 20 Dec 2017 11:20:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=mmZzcqVpGmCKyIOf6RPY4RTOIcqJw6YvcLiyZ2gikuw=; b=Zp86OoTKen5d6W7gES/6KMSmC70F4C7TJGK1DFzxTB97pCtSDmR/WSuyX0SXk3zfrC 3McTdCyhWkPJZC0mVZ/TmzlYVNAJqRMKlPAwmJKD7ddujBZSzJoDoFpfBNf/86ApZBA2 7kTpnLH4hg3AYNmVvuhx7x31BnbCM0G5zLLfl7EYroAArMSDZyAMyWPOeGtcFRzCnaGE boervkqxpwKj4xuEeRC1d5ivXDnvekK2A1I0K+LQrwLFzsl0Jam4qaE4X7eae7CMQ1B5 EKSpYelOUm/0VExwwD5J+uFTYFNZ9gfmM3rWPHGoOY86Erk2DPA+wYU6SPibxM8OrAOB gRmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=mmZzcqVpGmCKyIOf6RPY4RTOIcqJw6YvcLiyZ2gikuw=; b=gmbmmNgGmfp4R8zrwsQRgRqP9j8Qr3GSJvV6QJAp81SLtANFE6o1IhINhHQcdSMC4+ kZldoll8lng+0W9dHncvd7zbm5107XurpsI5AKuXnmavd+wAaRESj+i+M03AVv7qQgGz 2Z2wcmawf3JuUKPE0sFN6axw7bahPcjhoLz1X5trtdU7M3whiHJhfsORUA5Pb6VPz5Rj V6v+asAZyE6YF+4GavWykBvBKUZ2Bzf3NsmWJuPPBRTRGCY1Z52L5EI7S08niVGgIRiV 9AvTvxAqY19eRswpg/wX+KHiHlM+cbEpX/tdmTRrL9XzNdGYjrliw2pkGKOiAD+r61I9 yeyg== X-Gm-Message-State: AKGB3mK+np5ILo3+409f1/DlXIpUwu11E/Vwqwnrxbx931Q9A1yr/Pw3 KB6qrNk/W5hl9EmqkLj8Dn8gf1gOpKGdcmkVraxNFA== X-Google-Smtp-Source: ACJfBoshpGLg3dAXgGLx/uL0okpL6j1oBKr3rUwyWI5gIZSuq5SIrHfi0tPKg6ZfJXRRG8lMXqG7kieb3EH+3lDMr+Y= X-Received: by 10.107.30.81 with SMTP id e78mr9431050ioe.130.1513797627091; Wed, 20 Dec 2017 11:20:27 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 20 Dec 2017 11:20:25 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1839614.eNG2DjLqvF@ralph.baldwin.cx> <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> <2357779.RlDvz1mMEe@ralph.baldwin.cx> From: Warner Losh Date: Wed, 20 Dec 2017 12:20:25 -0700 X-Google-Sender-Auth: otn6X_LiWgNJu4Y1rqx80tSQ9NA Message-ID: Subject: Re: svn commit: r326758 - in head/sys/i386: conf include To: Adrian Chadd Cc: John Baldwin , Nathan Whitehorn , David Chisnall , Eugene Grosbein , Konstantin Belousov , Conrad Meyer , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" X-Mailman-Approved-At: Wed, 20 Dec 2017 19:33:37 +0000 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 19:20:28 -0000 On Wed, Dec 20, 2017 at 12:15 PM, Adrian Chadd wrote: > Hi, > > I kinda bet that this will just get worse over time, so maybe it's > time we revisited figuring out a better way of dispatching work > instead of (a) lots of kernel threads for different subsystems and (b) > lots of deep stack frames. > > eg - NFS over wifi == hilarious pain > non-hilarious pain can be had by adding IPSEC to that recipe. Warner From owner-svn-src-head@freebsd.org Wed Dec 20 20:02:24 2017 Return-Path: Delivered-To: svn-src-head@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 CE273EA103E for ; Wed, 20 Dec 2017 20:02:24 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 ABD9D7F607 for ; Wed, 20 Dec 2017 20:02:24 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: a8d0b1df-e5c0-11e7-8486-0934409070aa X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id a8d0b1df-e5c0-11e7-8486-0934409070aa; Wed, 20 Dec 2017 20:02:09 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vBKK2FYi001773; Wed, 20 Dec 2017 13:02:15 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1513800135.29087.25.camel@freebsd.org> Subject: Re: svn commit: r327031 - in head/sys: conf dev/ixgbe modules/ix modules/ixv From: Ian Lepore To: Eric Joyner , Mark Johnston , cramerj@intel.com Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Dec 2017 13:02:15 -0700 In-Reply-To: References: <201712201815.vBKIF6IN062349@repo.freebsd.org> <20171220193237.GA11032@raichu> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:02:24 -0000 On Wed, 2017-12-20 at 19:47 +0000, Eric Joyner wrote: > On Wed, Dec 20, 2017 at 11:32 AM Mark Johnston wrote: > > > > > On Wed, Dec 20, 2017 at 06:15:06PM +0000, Eric Joyner wrote: > > > > > > Author: erj > > > Date: Wed Dec 20 18:15:06 2017 > > > New Revision: 327031 > > > URL: https://svnweb.freebsd.org/changeset/base/327031 > > > > > > Log: > > >   ixgbe(4): Convert driver to use iflib > > > [...] > > This seems to have broken at least the i386 kernel build. Could you > > please take a look? > > > > https://ci.freebsd.org/job/FreeBSD-head-i386-build/5330/console > > We probably missed this because we pretty much only use amd64 for testing; > it looks like for that error we can just change that ULONG to a UQUAD. I'll > add Jeb to this thread. > > - Eric A good way to avoid such trouble when touching kernel/module code that compiles on multiple arches is to do a "make lintkernels". Before you can do that, you need to do "make kernel-toolchains" just once, which may take a while -- it has to build clang for each arch, which is a bit annoying since every instance of clang is already a cross-compiler and our build process doesn't make use of that fact. -- Ian From owner-svn-src-head@freebsd.org Wed Dec 20 20:07:25 2017 Return-Path: Delivered-To: svn-src-head@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 C232AEA14B3 for ; Wed, 20 Dec 2017 20:07:25 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 A5F6D7FBC7 for ; Wed, 20 Dec 2017 20:07:25 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: 5fc7c740-e5c1-11e7-8486-0934409070aa X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id 5fc7c740-e5c1-11e7-8486-0934409070aa; Wed, 20 Dec 2017 20:07:16 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vBKK7MqZ001789; Wed, 20 Dec 2017 13:07:23 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1513800442.29087.28.camel@freebsd.org> Subject: Re: svn commit: r326991 - in head/sys/fs: nfs nfsclient From: Ian Lepore To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Dec 2017 13:07:22 -0700 In-Reply-To: <201712191918.vBJJImA5072223@repo.freebsd.org> References: <201712191918.vBJJImA5072223@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:07:25 -0000 On Tue, 2017-12-19 at 19:18 +0000, John Baldwin wrote: > Author: jhb > Date: Tue Dec 19 19:18:48 2017 > New Revision: 326991 > URL: https://svnweb.freebsd.org/changeset/base/326991 > > Log: >   Update NFS to handle larger link counts post ino64. > [...] > Modified: head/sys/fs/nfsclient/nfs_clvnops.c > ============================================================================== > --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:14:01 2017 (r326990) > +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:18:48 2017 (r326991) > @@ -3450,7 +3450,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) >    * For NFSv2 (or NFSv3 when not one of the above 4 a_names), >    * just fake them. >    */ > - pc.pc_linkmax = LINK_MAX; > + pc.pc_linkmax = NFS_LINK_MAX; >   pc.pc_namemax = NFS_MAXNAMLEN; >   pc.pc_notrunc = 1; >   pc.pc_chownrestricted = 1; > @@ -3460,7 +3460,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) >   } >   switch (ap->a_name) { >   case _PC_LINK_MAX: > - *ap->a_retval = pc.pc_linkmax; > + *ap->a_retval = MIN(LONG_MAX, pc.pc_linkmax); I just noticed a build error on powerpc LINT and LINT64 kernels on this line: /b/staging/freebsd/head/src/sys/fs/nfsclient/nfs_clvnops.c:3464: warning: comparison is always false due to limited range of data type -- Ian From owner-svn-src-head@freebsd.org Wed Dec 20 20:25:31 2017 Return-Path: Delivered-To: svn-src-head@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 2259CEA249B; Wed, 20 Dec 2017 20:25:31 +0000 (UTC) (envelope-from pfg@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 EF10480709; Wed, 20 Dec 2017 20:25:30 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKKPUmJ018241; Wed, 20 Dec 2017 20:25:30 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKKPTjG018231; Wed, 20 Dec 2017 20:25:29 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712202025.vBKKPTjG018231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 20 Dec 2017 20:25:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327040 - in head: sbin/ipfw sys/sys usr.sbin/watch X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head: sbin/ipfw sys/sys usr.sbin/watch X-SVN-Commit-Revision: 327040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:25:31 -0000 Author: pfg Date: Wed Dec 20 20:25:28 2017 New Revision: 327040 URL: https://svnweb.freebsd.org/changeset/base/327040 Log: Revert r327005 - SPDX tags for license similar to BSD-2-Clause. After consultation with SPDX experts and their matching guidelines[1], the licensing doesn't exactly match the BSD-2-Clause. It yet remains to be determined if they are equivalent or if there is a recognized license that matches but it is safer to just revert the tags. Let this also be a reminder that on FreeBSD, SPDX tags are only advisory and have no legal value (but IANAL). Pointyhat to: pfg Thanks to: Rodney Grimes, Gary O'Neall [1] https://spdx.org/spdx-license-list/matching-guidelines Modified: head/sbin/ipfw/altq.c head/sbin/ipfw/dummynet.c head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/ipv6.c head/sbin/ipfw/main.c head/sbin/ipfw/nat.c head/sys/sys/msg.h head/sys/sys/snoop.h head/usr.sbin/watch/watch.c Modified: head/sbin/ipfw/altq.c ============================================================================== --- head/sbin/ipfw/altq.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/altq.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/dummynet.c ============================================================================== --- head/sbin/ipfw/dummynet.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/dummynet.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ -/*. - * SPDX-License-Identifier: BSD-2-Clause - * +/*- * Codel/FQ_Codel and PIE/FQ_PIE Code: * Copyright (C) 2016 Centre for Advanced Internet Architectures, * Swinburne University of Technology, Melbourne, Australia. Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/ipfw2.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/ipfw2.h Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/ipv6.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/main.c ============================================================================== --- head/sbin/ipfw/main.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/main.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003,2010 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sbin/ipfw/nat.c ============================================================================== --- head/sbin/ipfw/nat.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/sbin/ipfw/nat.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 2002-2003 Luigi Rizzo * Copyright (c) 1996 Alex Nash, Paul Traina, Poul-Henning Kamp * Copyright (c) 1994 Ugen J.S.Antsilevich Modified: head/sys/sys/msg.h ============================================================================== --- head/sys/sys/msg.h Wed Dec 20 19:16:11 2017 (r327039) +++ head/sys/sys/msg.h Wed Dec 20 20:25:28 2017 (r327040) @@ -6,8 +6,6 @@ * * Author: Daniel Boulet * - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright 1993 Daniel Boulet and RTMX Inc. * * This system call was implemented by Daniel Boulet under contract from RTMX. Modified: head/sys/sys/snoop.h ============================================================================== --- head/sys/sys/snoop.h Wed Dec 20 19:16:11 2017 (r327039) +++ head/sys/sys/snoop.h Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 1995 Ugen J.S.Antsilevich * * Redistribution and use in source forms, with and without modification, Modified: head/usr.sbin/watch/watch.c ============================================================================== --- head/usr.sbin/watch/watch.c Wed Dec 20 19:16:11 2017 (r327039) +++ head/usr.sbin/watch/watch.c Wed Dec 20 20:25:28 2017 (r327040) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause - * * Copyright (c) 1995 Ugen J.S.Antsilevich * * Redistribution and use in source forms, with and without modification, From owner-svn-src-head@freebsd.org Wed Dec 20 20:28:09 2017 Return-Path: Delivered-To: svn-src-head@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 32ACEEA2715 for ; Wed, 20 Dec 2017 20:28:09 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic301-18.consmr.mail.bf2.yahoo.com (sonic301-18.consmr.mail.bf2.yahoo.com [74.6.129.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EC38780BE7 for ; Wed, 20 Dec 2017 20:28:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1513801682; bh=67x1t0EptFEUq5SYQDLCZ3Fa3V+l1mEF2Jf3/pDGdwI=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=Za4GMNGVxpijajh2RgxJG/fBIsXTw+Xp+gcGi8sIdX1XZz2QmRYjlOo19NGsvkuo+fFN9WbyjQSuBcJstXnSrsFOE4SoNj9g9ulnQND79WeZHlsRXUsA2xv7q8CbEovP1WObs8V2Jz2ys7heBtXD3gPizK+7vrstcYkuA+bJfxxXmPAuhvbhyg1hSuWKEqye3ZAPo5lZrkI3oGE/1v9HqH1XZ/a6mYgPtXSqrunWQqekblVowgpfvC5lU0x3JT4zkLDlEnboL3E26gkJduqvf06MTzsQKtiRpxOipLnS2zT69ScFHbrG/gONI85twr/4KIZIyTEwthzuhlURhylDwg== X-YMail-OSG: wQ5BAmYVM1lJUOqSexZuqgYWg3oRO_DQsc1OjBV0RGbyBLWUOMtPvPl_9aM_bbM LnK0Rj.7IrvNUw7qQDuBgrm4tFeNQ2dOHi93TedpbD4urxb_dZixeYAPVmTVSA3cTEqtZ_wyvXTY hwkRNTR2yb.sR00srIEWjPqMkr.jEua78oLqmBc3U.sMipY5mgMfUqvy8sC2fYFoekXpPCzv6Bhi _PJqaYoDhynJs3MO6o.F0S9ScEyze7TMR7qd3rktsAm3q5Om_ZYKwrZm6E4.jC0stAEuBBoy4oUZ CAMjkExf6wiUOiRbcO5Ts8TodnWpBOFqN1.tLzjYKHlwfzIEMEjc1dZ0QwIfsRwNRyJhKZLB8yPK EkCAjwddvQsdo.RyWvPRLiSw.NH7tyJdN7S6da9Fia2MRC1__YSZ1rg_d.h8smFzo3YM8fRX54Zx s6GChjUiwL_JAiAq47qTH1kLrpbCROmCCeAcceQ3rtGYT4nfVCCvL56pfbfWqPwfBW8fgn2s6 Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.bf2.yahoo.com with HTTP; Wed, 20 Dec 2017 20:28:02 +0000 Received: from smtp105.rhel.mail.bf1.yahoo.com (EHLO [192.168.0.6]) ([98.139.231.38]) by smtp408.mail.bf1.yahoo.com (JAMES SMTP Server ) with ESMTPA ID f23557ce4ac3b2b7db54cc25ca128d0e; Wed, 20 Dec 2017 20:28:01 +0000 (UTC) Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch To: rgrimes@freebsd.org Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712200255.vBK2tWT0023724@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Message-ID: <34c37415-002a-f5fa-7a06-e98bcfc9c133@FreeBSD.org> Date: Wed, 20 Dec 2017 15:28:01 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <201712200255.vBK2tWT0023724@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:28:09 -0000 On 12/19/17 21:55, Rodney W. Grimes wrote: >> >>> On Dec 19, 2017, at 19:15, Rodney W. Grimes wrote: >>> >>>> Author: pfg >>>> Date: Tue Dec 19 22:40:16 2017 >>>> New Revision: 327005 >>>> URL: https://svnweb.freebsd.org/changeset/base/327005 >>>> >>>> Log: >>>> SPDX: These are fundamentally BSD-2-Clause. >>>> >>>> They just omit the introductory line and numbering. >>> I again must assert that it would be better to not apply an SPDX than to >>> apply one that is not an exact match for the license. >>> >>> >> Not being a lawyer, I would normally agree, however: > This isnt about any legal issue. > >> 1) SPDX IDs are only advisory: we always keep the exact license text, which is what has legal value. > And we should do our best to provide the most accurate advisory we can, > and we know that this is not a direct copy of the BSD 2 clause, so making > advice that it is, IMHO, would be poor advice. > >> 2) The license is detected by license scanners as BSD and it has two clauses so the description fits. > And a human reading it sees it reads like a 2 clause but does not match a 2 clause exactly so > how do I trust any of this SPDX stuff as being done with some ration of sanity. > >> FWIW, according to SPDX lawyers, the numbering is not relevant and it would appear to me that the phrase: >> "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:? doesn?t add any information to the two clauses, which read: > Again, not a legal issue, an issue of this is not an exact BSD-2-Clause so I > do not believe that we should tag it as such. Basically if we are doing this > "close enough" thing it means the SPDX tags are actually pretty useless for > anyone trying to do a legal evaluation cause they are just going have to > completly redo what was done in adding the SPDX tags, and if that is the > case we should seriously consider just what value do these have in the > tree? > > Indeed .. after having the change reviewed by someone objective, I have reverted the change in r327040. Thanks for speaking up! Pedro. From owner-svn-src-head@freebsd.org Wed Dec 20 20:32:52 2017 Return-Path: Delivered-To: svn-src-head@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 D3111EA309E; Wed, 20 Dec 2017 20:32:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x232.google.com (mail-qk0-x232.google.com [IPv6:2607:f8b0:400d:c09::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 91D0F158C; Wed, 20 Dec 2017 20:32:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x232.google.com with SMTP id i190so7938227qka.5; Wed, 20 Dec 2017 12:32:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=o6+kd9MFKMS/QX8kv3g+JrcJCDZlL6V6JIqXiFem99A=; b=P0rkdsBh1B0YExBOnx0lrmUHrVQLKO3NmS7Snyw5vom2T73T+1EP69qM906SGEgX+S jhCgrv8cX61ukG9iIqcbFo2WR4g/W1TDsGW03X/PfUMzimFAq/UEHw6oAtGtycSl8sls pj+Yg0XX4zCEJZLgUcKw+U8kWbxcl+SsMi0azigROMA5Bo5xXSYrzFD7ZTQQHubsybdq gELsQsA/Ynd/gR1grQi2goilCsO1QgJawngBa+JBHRx0zXCxmSdVfXIX/PA+xm28vhdM 2lpYhZdCws3wcxdrpGQN1tforQ6yV+qMPT1a+XSpNNmYZHYBRBuDYlcSt4eHyFthFgjd bqVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=o6+kd9MFKMS/QX8kv3g+JrcJCDZlL6V6JIqXiFem99A=; b=Ak9108t+PZ2jO7QFjARZmYPKuUNj874WOnQyu86VFLemQIYBadwxwB37zMcWklX8KB 6q6AWjhXMbJX4TTl1AlOAsuKDixx1kn9HMG6VsRWECr69EV7vEfo2sbrqdlFr/o9oV5w 34eeWYpSG+cCM5gRKW5Xh3wPk5Uo4GLEJpScw8g0l0Y3+TITFUS5ewkhcjIy659AAzzd 3WYBT9iXnb7XpxDiUA4klSDFjZQANTM/RdUFak7mrLIOz+u8yGwHIxGSNszUPv2zehb9 kYeV7faYDwL02V+jnVR1HaTthOJKgxMTG+OcO+WZoIWLMFk6xv8vySkBXvm8I7mnDVqM wkmA== X-Gm-Message-State: AKGB3mIoQYi1oyV5MHMobakyfgV9IC9qkE3XGwLAc8NQ0meGhRs3iWhi AJgRj9Z1PrnAmFJS7zG4TbJ82g== X-Google-Smtp-Source: ACJfBosFWhyrnZmzzw/0922jp6zNPY3Bw4OqrwWaeD4hi6w5VnBsoUYbT8jdN65HjMribV7E5SHdAw== X-Received: by 10.55.115.130 with SMTP id o124mr11816700qkc.260.1513801971313; Wed, 20 Dec 2017 12:32:51 -0800 (PST) Received: from raichu (toroon0560w-lp140-01-69-159-38-22.dsl.bell.ca. [69.159.38.22]) by smtp.gmail.com with ESMTPSA id q13sm12092014qta.22.2017.12.20.12.32.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 12:32:50 -0800 (PST) Sender: Mark Johnston Date: Wed, 20 Dec 2017 15:32:48 -0500 From: Mark Johnston To: Warner Losh Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r326731 - head/sys/ufs/ffs Message-ID: <20171220203248.GB11032@raichu> References: <201712091544.vB9FiVUI096790@repo.freebsd.org> <20171210031450.GB15275@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171210031450.GB15275@raichu> User-Agent: Mutt/1.9.1 (2017-09-22) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:32:52 -0000 On Sat, Dec 09, 2017 at 10:14:50PM -0500, Mark Johnston wrote: > On Sat, Dec 09, 2017 at 07:36:59PM -0700, Warner Losh wrote: > > On Sat, Dec 9, 2017 at 11:03 AM, Andriy Gapon wrote: > > > > > On 09/12/2017 17:44, Mark Johnston wrote: > > > > Some GEOMs do not appear to handle BIO_ORDERED correctly, meaning that > > > the > > > > barrier write may not work as intended. > > > > > > There's a few places we send down a BIO_ORDERED BIO_FLUSH command > > (see softdep_synchronize for one). Will those matter? > > Some classes have separate handling for BIO_FLUSH, so it depends. I > think gmirror's handling is buggy independent of BIO_ORDERED: > g_mirror_start() sends BIO_FLUSH commands directly to the mirrors, > while reads and writes are queued for handling by the gmirror worker > thread. So as far as I can tell, a BIO_WRITE which arrives at the > gmirror provider before a BIO_FLUSH might be sent to the mirrors > after that BIO_FLUSH. I would expect BIO_FLUSH to implicitly have > something like release semantics, i.e., a BIO_FLUSH shouldn't be > reordered with a BIO_WRITE that preceded it. But I might be > misunderstanding. > > > As I've noted elsewhere: I'd really like to kill BIO_ORDERED since it has > > too many icky effects (and BIO_FLUSH + BIO_ORDERED isn't guaranteed to do, > > well, anything since it can turn into a NOP in a number of places. Plus > > many of the implementations of BIO_ORDERED assume the drive is like SCSI > > and you just set the right tag to make it 'ordered'. For ATA we issue a non > > NCQ command, which is a full drain of outstanding commands, send this > > command, then start them again which really shuts down the parallelism we > > implemented NCQ for :(. We do similar for NVME which is even worse. There > > we have multiple submission queues in the hardware. To simulated it, we do > > a similar drain, but that's going to get in the way as we move to NUMA and > > systems where we try to do the I/O entirely on one CPU (both submission and > > completion) and ordered I/O is guaranteed lock contention. > > Independent of this, it doesn't really look like we have any way of > handling write errors when dependencies are enforced using BIO_ORDERED. > In the case of the babarrierwrite() consumer in FFS, what happens if the > inode block write fails due to a transient error, but the following CG > update succeeds? Looking at this some more, I think iosched is ok since bioq_disksort() does in fact handle BIO_ORDERED. I'm concerned though that there are places in the tree where we should be using BIO_ORDERED but aren't. gmirror metadata writes for instance are performed synchronously but should not be reordered with preceding BIO_WRITEs. Anyway, I've posted a review for some gmirror I/O ordering fixes here if anyone is interested: https://reviews.freebsd.org/D13559 From owner-svn-src-head@freebsd.org Wed Dec 20 20:33:50 2017 Return-Path: Delivered-To: svn-src-head@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 4BC75EA31E9; Wed, 20 Dec 2017 20:33:50 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id F02991766; Wed, 20 Dec 2017 20:33:49 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id Rl3ceUPWcS7BpRl3deqAOB; Wed, 20 Dec 2017 13:33:43 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=QBFYB0sSn6BLKAkMk14A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 5226D99F; Wed, 20 Dec 2017 12:33:40 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBKKXdbF040804; Wed, 20 Dec 2017 12:33:39 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBKKXdbS040801; Wed, 20 Dec 2017 12:33:39 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712202033.vBKKXdbS040801@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327037 - head/sys/dev/acpica In-Reply-To: Message from Warner Losh of "Wed, 20 Dec 2017 19:14:16 +0000." <201712201914.vBKJEG68087359@repo.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Dec 2017 12:33:39 -0800 X-CMAE-Envelope: MS4wfE76oorjWowxD4zx9B6SUlT/Eyyr/pjq6+UQ8RsskhIumz6lYQYCuAkKAocQiakfy+6v93r6fkexS0ZoDXRKXa9NjNPwUI6rYuVRLNwJ7izr72OSZ2G+ /YqZ2aDUXuoYZGzR3y4q6UOmRQPBS3cYb7FUCv/6IxfGnAXDN9iktp/dOtC0pWJiTu/TMHsX/DJgfypLWiubdvk/inOeaSG8fDLHyDMCcU/CirqnuZWX9mAY JCNM3hZfKovbsUst5ddXRrDErYO7OmZwr1nUhLdtluNnEupAzqnJJy/wlmyXuBUu X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:33:50 -0000 In message <201712201914.vBKJEG68087359@repo.freebsd.org>, Warner Losh writes: > Author: imp > Date: Wed Dec 20 19:14:16 2017 > New Revision: 327037 > URL: https://svnweb.freebsd.org/changeset/base/327037 > > Log: > Simplify the code a bit. > > Replace clumsy for(;;) { if (foo) break; ...} with simpler > while (!foo) { ... }. > > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D13546 > > Modified: > head/sys/dev/acpica/acpi.c > > Modified: head/sys/dev/acpica/acpi.c > ============================================================================= > = > --- head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:11 2017 (r32703 > 6) > +++ head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:16 2017 (r32703 > 7) > @@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, > * name to see if one's resources are a subset of this device. > */ > line = 0; > - for (;;) { > - if (resource_find_dev(&line, name, &unit, "at", NULL) != 0) > - break; > - > + while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) { > /* Must have an "at" for acpi or isa. */ > resource_string_value(name, unit, "at", &s); > if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 || > Would it make sense we upline this to reduce future MFV diffs? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Dec 20 20:41:52 2017 Return-Path: Delivered-To: svn-src-head@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 7217DEA3A4E; Wed, 20 Dec 2017 20:41:52 +0000 (UTC) (envelope-from ian@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 3D2422108; Wed, 20 Dec 2017 20:41:52 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKKfpUg027532; Wed, 20 Dec 2017 20:41:51 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKKfpCq027531; Wed, 20 Dec 2017 20:41:51 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712202041.vBKKfpCq027531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Dec 2017 20:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327047 - head/sys/arm/include X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/include X-SVN-Commit-Revision: 327047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:41:52 -0000 Author: ian Date: Wed Dec 20 20:41:51 2017 New Revision: 327047 URL: https://svnweb.freebsd.org/changeset/base/327047 Log: Remove arm-specific implementations of atomic_load/store_xxx() now that they are provided by sys/atomic_common.h. Modified: head/sys/arm/include/atomic.h Modified: head/sys/arm/include/atomic.h ============================================================================== --- head/sys/arm/include/atomic.h Wed Dec 20 20:29:15 2017 (r327046) +++ head/sys/arm/include/atomic.h Wed Dec 20 20:41:51 2017 (r327047) @@ -55,32 +55,6 @@ #include #endif /* Arch >= v6 */ -static __inline int -atomic_load_32(volatile uint32_t *v) -{ - - return (*v); -} - -static __inline void -atomic_store_32(volatile uint32_t *dst, uint32_t src) -{ - *dst = src; -} - -static __inline int -atomic_load_long(volatile u_long *v) -{ - - return (*v); -} - -static __inline void -atomic_store_long(volatile u_long *dst, u_long src) -{ - *dst = src; -} - #define atomic_clear_ptr atomic_clear_32 #define atomic_clear_acq_ptr atomic_clear_acq_32 #define atomic_clear_rel_ptr atomic_clear_rel_32 @@ -94,7 +68,6 @@ atomic_store_long(volatile u_long *dst, u_long src) #define atomic_cmpset_acq_ptr atomic_cmpset_acq_32 #define atomic_cmpset_rel_ptr atomic_cmpset_rel_32 #define atomic_load_acq_ptr atomic_load_acq_32 -#define atomic_store_ptr atomic_store_32 #define atomic_store_rel_ptr atomic_store_rel_32 #define atomic_swap_ptr atomic_swap_32 #define atomic_readandclear_ptr atomic_readandclear_32 From owner-svn-src-head@freebsd.org Wed Dec 20 20:44:56 2017 Return-Path: Delivered-To: svn-src-head@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 759F3EA3CFE for ; Wed, 20 Dec 2017 20:44:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x236.google.com (mail-io0-x236.google.com [IPv6:2607:f8b0:4001:c06::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32FB3245A for ; Wed, 20 Dec 2017 20:44:56 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x236.google.com with SMTP id x129so18720490iod.13 for ; Wed, 20 Dec 2017 12:44:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=cc/BVmZQofRbDYfMdBVVti9zcwPqoiKYGlUAyIBqJS0=; b=ocPzECtYB822T3M/+5ikvhMijaDNmK6lNFCZdGEQ80v+V0jjQG79/y5gvavIkoTqLJ gfQq9ktNpSD74Cw9y5ojvctTjemh2/GCpP3cZR+8Y0cH1nOEpg2zxaHdLFuozmrv5uQ/ e74m+AyMjoNRZtkYwuU3oyacj9uigQic/EpUwXOsLz/TJ3Ai3RuLsVGiB76wYgO1iGFb H9OM8LWW6ZwqU+VFnbvqjzXmqHt+Ue8JSLQZYpbPNPMwZQxrKwRdjOpwU5N3qWeVXsQs xiTsvXSc84TTqYl1zsuqUgMRdeGC6M0LZ8lq399MCTdgEX/G2p9jcmkOJ8Q429dES7dv IzAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=cc/BVmZQofRbDYfMdBVVti9zcwPqoiKYGlUAyIBqJS0=; b=itKzE1iiVATW57nqB2zUCIXxlz2bpwYyCv4hSsZDC9zJMnCdzjh0FpTVolHKzPd2ke GUiBDWm0JEB1FCHo+fiVQ5faO38cgEt4jcrjSybBrWl96myPfTdV2IjoaM4r6VTCtHRF 7GzhmRxBG3Uza28qFYEeQIKSlyzrVcZDdN2dfOTa8fPLrQaf+6WIpkBVdpQagK7wP6MS h2SqH7KELKWtncI9p3sFLJunjy+3qmaMj1tSwWUFeWgXkYHD6n+QgB+lqw/Nt7Mt3Gfp 9nWqsbDVwPemBQKDh4RlGdCNCFGFFxkZCN024SFob5CD1ZJlyECNJw+IyEOSVoYmdhCv WgCw== X-Gm-Message-State: AKGB3mKN5qFaTZMVGoOc969lufvqLbf1TSbJhHIaKuWTlI81HcFX1cvd wpIC0NU9vRoiO0O8C9+fkfNvkBVlnM8grGyBEMveYg== X-Google-Smtp-Source: ACJfBovvDj0jk2P92ZKFgof/rBBVYUekRLP9ZRPeha/Mbw0fFlueoJ4wQgEpmmYxGUREi4Hi0cLZhWDK+jZxfpSyS2s= X-Received: by 10.107.149.5 with SMTP id x5mr7442458iod.136.1513802695221; Wed, 20 Dec 2017 12:44:55 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 20 Dec 2017 12:44:54 -0800 (PST) X-Originating-IP: [2607:fb90:6e9a:9802:7050:335d:139f:7109] Received: by 10.79.108.204 with HTTP; Wed, 20 Dec 2017 12:44:54 -0800 (PST) In-Reply-To: <201712202033.vBKKXdbS040801@slippy.cwsent.com> References: <201712201914.vBKJEG68087359@repo.freebsd.org> <201712202033.vBKKXdbS040801@slippy.cwsent.com> From: Warner Losh Date: Wed, 20 Dec 2017 13:44:54 -0700 X-Google-Sender-Auth: dsnR-_NQXjegxJExDgwo2E2lbGk Message-ID: Subject: Re: svn commit: r327037 - head/sys/dev/acpica To: Cy Schubert Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:44:56 -0000 On Dec 20, 2017 1:33 PM, "Cy Schubert" wrote: In message <201712201914.vBKJEG68087359@repo.freebsd.org>, Warner Losh writes: > Author: imp > Date: Wed Dec 20 19:14:16 2017 > New Revision: 327037 > URL: https://svnweb.freebsd.org/changeset/base/327037 > > Log: > Simplify the code a bit. > > Replace clumsy for(;;) { if (foo) break; ...} with simpler > while (!foo) { ... }. > > Sponsored by: Netflix > Differential Revision: https://reviews.freebsd.org/D13546 > > Modified: > head/sys/dev/acpica/acpi.c > > Modified: head/sys/dev/acpica/acpi.c > ============================================================ ================= > = > --- head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:11 2017 (r32703 > 6) > +++ head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:16 2017 (r32703 > 7) > @@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t child, > * name to see if one's resources are a subset of this device. > */ > line = 0; > - for (;;) { > - if (resource_find_dev(&line, name, &unit, "at", NULL) != 0) > - break; > - > + while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) { > /* Must have an "at" for acpi or isa. */ > resource_string_value(name, unit, "at", &s); > if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 || > Would it make sense we upline this to reduce future MFV diffs? No. This is 100% FreeBSD code. Warner -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Dec 20 20:46:14 2017 Return-Path: Delivered-To: svn-src-head@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 55C99EA3EC1; Wed, 20 Dec 2017 20:46:14 +0000 (UTC) (envelope-from ian@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 22CAD2682; Wed, 20 Dec 2017 20:46:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKKkDkl027724; Wed, 20 Dec 2017 20:46:13 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKKkD0N027723; Wed, 20 Dec 2017 20:46:13 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712202046.vBKKkD0N027723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Dec 2017 20:46:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327048 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 327048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:46:14 -0000 Author: ian Date: Wed Dec 20 20:46:12 2017 New Revision: 327048 URL: https://svnweb.freebsd.org/changeset/base/327048 Log: Restore the ability to use EARLY_PRINTF support during most of initarm(). The real kernel page tables are set up much earlier in initarm() now than they were when early printf support was first added, and they end up undoing the mapping made in locore.S for early printf support. This re-adds the mapping after switching to the new/real kernel page tables, making early printf work again right after switching to them. Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Dec 20 20:41:51 2017 (r327047) +++ head/sys/arm/arm/machdep.c Wed Dec 20 20:46:12 2017 (r327048) @@ -1129,6 +1129,19 @@ initarm(struct arm_boot_params *abp) pmap_bootstrap_prepare(lastaddr); /* + * If EARLY_PRINTF support is enabled, we need to re-establish the + * mapping after pmap_bootstrap_prepare() switches to new page tables. + * Note that we can only do the remapping if the VA is outside the + * kernel, now that we have real virtual (not VA=PA) mappings in effect. + * Early printf does not work between the time pmap_set_tex() does + * cp15_prrr_set() and this code remaps the VA. + */ +#if defined(EARLY_PRINTF) && defined(SOCDEV_PA) && defined(SOCDEV_VA) && SOCDEV_VA < KERNBASE + pmap_preboot_map_attr(SOCDEV_PA, SOCDEV_VA, 1024 * 1024, + VM_PROT_READ | VM_PROT_WRITE, VM_MEMATTR_DEVICE); +#endif + + /* * Now that proper page tables are installed, call cpu_setup() to enable * instruction and data caches and other chip-specific features. */ From owner-svn-src-head@freebsd.org Wed Dec 20 20:47:41 2017 Return-Path: Delivered-To: svn-src-head@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 01814EA406A for ; Wed, 20 Dec 2017 20:47:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (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 D89D028B7 for ; Wed, 20 Dec 2017 20:47:40 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: f8c9a010-e5c6-11e7-93a5-cd02e7dc7692 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 73.78.92.27 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [73.78.92.27]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id f8c9a010-e5c6-11e7-93a5-cd02e7dc7692; Wed, 20 Dec 2017 20:47:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id vBKKlWKZ001885; Wed, 20 Dec 2017 13:47:32 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1513802852.29087.29.camel@freebsd.org> Subject: Re: svn commit: r327047 - head/sys/arm/include From: Ian Lepore To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Dec 2017 13:47:32 -0700 In-Reply-To: <201712202041.vBKKfpCq027531@repo.freebsd.org> References: <201712202041.vBKKfpCq027531@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:47:41 -0000 On Wed, 2017-12-20 at 20:41 +0000, Ian Lepore wrote: > Author: ian > Date: Wed Dec 20 20:41:51 2017 > New Revision: 327047 > URL: https://svnweb.freebsd.org/changeset/base/327047 > > Log: >   Remove arm-specific implementations of atomic_load/store_xxx() now that >   they are provided by sys/atomic_common.h. I think something similar to this may be happening on sparc64 as well. I noticed the sparc64 build died during a 'make lintkernels' but I haven't investigated why. -- Ian From owner-svn-src-head@freebsd.org Wed Dec 20 20:54:51 2017 Return-Path: Delivered-To: svn-src-head@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 DD514EA46BF; Wed, 20 Dec 2017 20:54:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A01AA2DF1; Wed, 20 Dec 2017 20:54:51 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id vBKKsnPN027868; Wed, 20 Dec 2017 12:54:49 -0800 (PST) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id vBKKsnPV027867; Wed, 20 Dec 2017 12:54:49 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201712202054.vBKKsnPV027867@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r327005 - in head: sbin/ipfw sys/sys usr.sbin/watch In-Reply-To: <34c37415-002a-f5fa-7a06-e98bcfc9c133@FreeBSD.org> To: Pedro Giffuni Date: Wed, 20 Dec 2017 12:54:49 -0800 (PST) CC: rgrimes@FreeBSD.org, src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Reply-To: rgrimes@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 20:54:52 -0000 > On 12/19/17 21:55, Rodney W. Grimes wrote: > >> > >>> On Dec 19, 2017, at 19:15, Rodney W. Grimes wrote: > >>> > >>>> Author: pfg > >>>> Date: Tue Dec 19 22:40:16 2017 > >>>> New Revision: 327005 > >>>> URL: https://svnweb.freebsd.org/changeset/base/327005 > >>>> > >>>> Log: > >>>> SPDX: These are fundamentally BSD-2-Clause. > >>>> > >>>> They just omit the introductory line and numbering. > >>> I again must assert that it would be better to not apply an SPDX than to > >>> apply one that is not an exact match for the license. > >>> > >>> > >> Not being a lawyer, I would normally agree, however: > > This isnt about any legal issue. > > > >> 1) SPDX IDs are only advisory: we always keep the exact license text, which is what has legal value. > > And we should do our best to provide the most accurate advisory we can, > > and we know that this is not a direct copy of the BSD 2 clause, so making > > advice that it is, IMHO, would be poor advice. > > > >> 2) The license is detected by license scanners as BSD and it has two clauses so the description fits. > > And a human reading it sees it reads like a 2 clause but does not match a 2 clause exactly so > > how do I trust any of this SPDX stuff as being done with some ration of sanity. > > > >> FWIW, according to SPDX lawyers, the numbering is not relevant and it would appear to me that the phrase: > >> "Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:? doesn?t add any information to the two clauses, which read: > > Again, not a legal issue, an issue of this is not an exact BSD-2-Clause so I > > do not believe that we should tag it as such. Basically if we are doing this > > "close enough" thing it means the SPDX tags are actually pretty useless for > > anyone trying to do a legal evaluation cause they are just going have to > > completly redo what was done in adding the SPDX tags, and if that is the > > case we should seriously consider just what value do these have in the > > tree? > > > > > Indeed .. after having the change reviewed by someone objective, I have > reverted the change in r327040. > > Thanks for speaking up! No problem, and I have now also read the guidlines and to a larger extent most of the SPDX spec so I am now also more informed. Thanks for going the extra mile to get clarification! > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Wed Dec 20 21:05:11 2017 Return-Path: Delivered-To: svn-src-head@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 1F2ADEA4FDB; Wed, 20 Dec 2017 21:05:11 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id C10E034DE; Wed, 20 Dec 2017 21:05:10 +0000 (UTC) (envelope-from cy.schubert@komquats.com) Received: from spqr.komquats.com ([96.50.22.10]) by shaw.ca with ESMTPA id RlY4eUbFoS7BpRlY5eqHKv; Wed, 20 Dec 2017 14:05:09 -0700 X-Authority-Analysis: v=2.2 cv=NKylwwyg c=1 sm=1 tr=0 a=jvE2nwUzI0ECrNeyr98KWA==:117 a=jvE2nwUzI0ECrNeyr98KWA==:17 a=kj9zAlcOel0A:10 a=ocR9PWop10UA:10 a=BWvPGDcYAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=R67WUro0QPnyWkeQu6IA:9 a=CjuIK1q_8ugA:10 a=pxhY87DP9d2VeQe4joPk:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id D888AA13; Wed, 20 Dec 2017 13:05:07 -0800 (PST) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id vBKL57rJ041386; Wed, 20 Dec 2017 13:05:07 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id vBKL57R2041383; Wed, 20 Dec 2017 13:05:07 -0800 (PST) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201712202105.vBKL57R2041383@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Warner Losh cc: Cy Schubert , Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327037 - head/sys/dev/acpica In-Reply-To: Message from Warner Losh of "Wed, 20 Dec 2017 13:44:54 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Dec 2017 13:05:07 -0800 X-CMAE-Envelope: MS4wfCj6aUWtImuqzEisYYq1E4+jjYzsFGn/DLmHcBb8C3bmM72LxqFN6ZeQiDT/Stfun1MdwyD9iWn6/jRq7x/0AnitVK+BExX5pWqCt7Neq4YxFUDOM4OA uzKUpphE7CyqZxFFfKnNZNB80j8tTi0fd8qXspcNL61ltpCuCbJ2VvDqYsAiHu4HDukwFpuugTnkbnGRYlodbDSa9ItqDMa4QsYrRMISmzWhKaucvw8sO197 j8Kwv3lIzxvxe+OwpfZgCt5vf04xijPc/odGIQQ0pfN/O31FYP6gqO8pjklAk7SMeNpoddcAHB84+GD1rj75t+yPYKUI/Md9ZcL4ML1hPsg= X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 21:05:11 -0000 In message , Warner Losh writes: > --001a1140eeb8e8b5ac0560cba79f > Content-Type: text/plain; charset="UTF-8" > > On Dec 20, 2017 1:33 PM, "Cy Schubert" wrote: > > In message <201712201914.vBKJEG68087359@repo.freebsd.org>, Warner Losh > writes: > > Author: imp > > Date: Wed Dec 20 19:14:16 2017 > > New Revision: 327037 > > URL: https://svnweb.freebsd.org/changeset/base/327037 > > > > Log: > > Simplify the code a bit. > > > > Replace clumsy for(;;) { if (foo) break; ...} with simpler > > while (!foo) { ... }. > > > > Sponsored by: Netflix > > Differential Revision: https://reviews.freebsd.org/D13546 > > > > Modified: > > head/sys/dev/acpica/acpi.c > > > > Modified: head/sys/dev/acpica/acpi.c > > ============================================================ > ================= > > = > > --- head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:11 2017 > (r32703 > > 6) > > +++ head/sys/dev/acpica/acpi.c Wed Dec 20 19:14:16 2017 > (r32703 > > 7) > > @@ -1014,10 +1014,7 @@ acpi_hint_device_unit(device_t acdev, device_t > child, > > * name to see if one's resources are a subset of this device. > > */ > > line = 0; > > - for (;;) { > > - if (resource_find_dev(&line, name, &unit, "at", NULL) != 0) > > - break; > > - > > + while (resource_find_dev(&line, name, &unit, "at", NULL) == 0) { > > /* Must have an "at" for acpi or isa. */ > > resource_string_value(name, unit, "at", &s); > > if (!(strcmp(s, "acpi0") == 0 || strcmp(s, "acpi") == 0 || > > > > > Would it make sense we upline this to reduce future MFV diffs? > > > No. This is 100% FreeBSD code. My mistake then. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-head@freebsd.org Wed Dec 20 22:17:28 2017 Return-Path: Delivered-To: svn-src-head@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 DE89DE82A34; Wed, 20 Dec 2017 22:17:28 +0000 (UTC) (envelope-from ian@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 A945D6502F; Wed, 20 Dec 2017 22:17:28 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKMHRjX065575; Wed, 20 Dec 2017 22:17:27 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKMHRKl065574; Wed, 20 Dec 2017 22:17:27 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712202217.vBKMHRKl065574@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Dec 2017 22:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327049 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 327049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 22:17:29 -0000 Author: ian Date: Wed Dec 20 22:17:27 2017 New Revision: 327049 URL: https://svnweb.freebsd.org/changeset/base/327049 Log: Allow pmap_kremove() to remove 1MB section mappings as well as 4K pages. This will allow it to undo temporary device mappings such as those made with pmap_preboot_map_attr(). Reviewed by: cognet Modified: head/sys/arm/arm/pmap-v6.c Modified: head/sys/arm/arm/pmap-v6.c ============================================================================== --- head/sys/arm/arm/pmap-v6.c Wed Dec 20 20:46:12 2017 (r327048) +++ head/sys/arm/arm/pmap-v6.c Wed Dec 20 22:17:27 2017 (r327049) @@ -1310,10 +1310,16 @@ pmap_kenter(vm_offset_t va, vm_paddr_t pa) PMAP_INLINE void pmap_kremove(vm_offset_t va) { + pt1_entry_t *pte1p; pt2_entry_t *pte2p; - pte2p = pt2map_entry(va); - pte2_clear(pte2p); + pte1p = kern_pte1(va); + if (pte1_is_section(pte1_load(pte1p))) { + pte1_clear(pte1p); + } else { + pte2p = pt2map_entry(va); + pte2_clear(pte2p); + } } /* From owner-svn-src-head@freebsd.org Wed Dec 20 22:19:12 2017 Return-Path: Delivered-To: svn-src-head@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 CF7BEE82B9C; Wed, 20 Dec 2017 22:19:12 +0000 (UTC) (envelope-from ian@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 99C7A651D4; Wed, 20 Dec 2017 22:19:12 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBKMJBKS065680; Wed, 20 Dec 2017 22:19:11 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBKMJBRP065679; Wed, 20 Dec 2017 22:19:11 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201712202219.vBKMJBRP065679@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Wed, 20 Dec 2017 22:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327050 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 327050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 22:19:12 -0000 Author: ian Date: Wed Dec 20 22:19:11 2017 New Revision: 327050 URL: https://svnweb.freebsd.org/changeset/base/327050 Log: If a temporary mapping is made to support EARLY_PRINTF, undo that mapping after cninit() runs, otherwise we leave a bogus device-memory mapping in userspace VA in the kernel pmap forever. Pointed out by: cognet Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Wed Dec 20 22:17:27 2017 (r327049) +++ head/sys/arm/arm/machdep.c Wed Dec 20 22:19:11 2017 (r327050) @@ -1204,6 +1204,14 @@ initarm(struct arm_boot_params *abp) platform_gpio_init(); cninit(); + /* + * If we made a mapping for EARLY_PRINTF after pmap_bootstrap_prepare(), + * undo it now that the normal console printf works. + */ +#if defined(EARLY_PRINTF) && defined(SOCDEV_PA) && defined(SOCDEV_VA) && SOCDEV_VA < KERNBASE + pmap_kremove(SOCDEV_VA); +#endif + debugf("initarm: console initialized\n"); debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); debugf(" boothowto = 0x%08x\n", boothowto); From owner-svn-src-head@freebsd.org Wed Dec 20 22:31:10 2017 Return-Path: Delivered-To: svn-src-head@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 8C103E835C9 for ; Wed, 20 Dec 2017 22:31:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x230.google.com (mail-io0-x230.google.com [IPv6:2607:f8b0:4001:c06::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49C876593D for ; Wed, 20 Dec 2017 22:31:10 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x230.google.com with SMTP id w127so18980656iow.11 for ; Wed, 20 Dec 2017 14:31:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=DUWqV47Dshl74hqBwqRAVHfE0OjCvQR0gnARX2ZDOxk=; b=J33yQscwqVAmPz1t70m3PyawxRMT2bI09Or4sh5lQNEUu1LpQLrMA5hzCXq6447/Gg qsc0edMh3eTUBHoN+/JBLQ7MWbrSJEAn6+oZ1d09ebwqekxVGD+vmfQbJAx6E4xkkvpn vPekEyk5ab9dRDeMfZQbj5Primj1U7pogOEmThhnqclu+zaJnlbY3HazsE9T9cJ+KPZS 431YE6Ck1Zm6vH+SN+EdC9La1+2UsXBxQBEDZ4zL8Lc/54M1O4pz6mHx7UGP2UgjG7i/ ExhV2mF71FNgcJmLD55DsbqtfIiQ4ugVfN3q+c1Rmv1YdUc89HzvnLr2G846U05uIjxS N7eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=DUWqV47Dshl74hqBwqRAVHfE0OjCvQR0gnARX2ZDOxk=; b=cXJx7He6D5l0y85flKH2BFGihIvoAmhlKGNvnIGystgvOVc264YbY14jcJjO8u524h ox5MydvVRsTcdea+qOg79Kn9YiAgQ6qWfnSs6wz/naN/WFHRgl0sQwLxDrXfaVX2h37M MdzkQxd+igHKtqjFJ0w8UL048TjFPKHusf5VYcKXVqFJIa439rO/MVa3llBcSS+CRUYR m2gnXQAMrzG/eysZm0RGVgzZfq8NaRLpMLSPXHhuV7+usXpCNULB9qZxgJSbSjZKOXvD 1RSZOd2lVtj4JYGbeSWVj1Uzv4gdldq+51Tlfv7DRlqqXEa6i6f7kauEDjPapI990ZuM 42CA== X-Gm-Message-State: AKGB3mJmzOr7TMBAkcePYyw9z2N60FNi1zv6a9sVC+Lam8VEDdxg/lpf 9qBOiEA07RY7VSchEVS6kXA65IMKf3quJ4cAolCAjg== X-Google-Smtp-Source: ACJfBovPFTN7s7ziQkZyJAaqQkjKdqK1JBOjjR5WVGoHOeVsRBQI4yEgbQ6gWXGhB4t2DODka+1eiKrMCiXs9AGPTpI= X-Received: by 10.107.149.5 with SMTP id x5mr7796099iod.136.1513809069049; Wed, 20 Dec 2017 14:31:09 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Wed, 20 Dec 2017 14:31:08 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <20171220203248.GB11032@raichu> References: <201712091544.vB9FiVUI096790@repo.freebsd.org> <20171210031450.GB15275@raichu> <20171220203248.GB11032@raichu> From: Warner Losh Date: Wed, 20 Dec 2017 15:31:08 -0700 X-Google-Sender-Auth: GcbEfCWlIx677E20_TvUAO0ejao Message-ID: Subject: Re: svn commit: r326731 - head/sys/ufs/ffs To: Mark Johnston Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 22:31:10 -0000 On Wed, Dec 20, 2017 at 1:32 PM, Mark Johnston wrote: > On Sat, Dec 09, 2017 at 10:14:50PM -0500, Mark Johnston wrote: > > On Sat, Dec 09, 2017 at 07:36:59PM -0700, Warner Losh wrote: > > > On Sat, Dec 9, 2017 at 11:03 AM, Andriy Gapon wrote: > > > > > > > On 09/12/2017 17:44, Mark Johnston wrote: > > > > > Some GEOMs do not appear to handle BIO_ORDERED correctly, meaning > that > > > > the > > > > > barrier write may not work as intended. > > > > > > > > > There's a few places we send down a BIO_ORDERED BIO_FLUSH command > > > (see softdep_synchronize for one). Will those matter? > > > > Some classes have separate handling for BIO_FLUSH, so it depends. I > > think gmirror's handling is buggy independent of BIO_ORDERED: > > g_mirror_start() sends BIO_FLUSH commands directly to the mirrors, > > while reads and writes are queued for handling by the gmirror worker > > thread. So as far as I can tell, a BIO_WRITE which arrives at the > > gmirror provider before a BIO_FLUSH might be sent to the mirrors > > after that BIO_FLUSH. I would expect BIO_FLUSH to implicitly have > > something like release semantics, i.e., a BIO_FLUSH shouldn't be > > reordered with a BIO_WRITE that preceded it. But I might be > > misunderstanding. > > > > > As I've noted elsewhere: I'd really like to kill BIO_ORDERED since it > has > > > too many icky effects (and BIO_FLUSH + BIO_ORDERED isn't guaranteed to > do, > > > well, anything since it can turn into a NOP in a number of places. Plus > > > many of the implementations of BIO_ORDERED assume the drive is like > SCSI > > > and you just set the right tag to make it 'ordered'. For ATA we issue > a non > > > NCQ command, which is a full drain of outstanding commands, send this > > > command, then start them again which really shuts down the parallelism > we > > > implemented NCQ for :(. We do similar for NVME which is even worse. > There > > > we have multiple submission queues in the hardware. To simulated it, > we do > > > a similar drain, but that's going to get in the way as we move to NUMA > and > > > systems where we try to do the I/O entirely on one CPU (both > submission and > > > completion) and ordered I/O is guaranteed lock contention. > > > > Independent of this, it doesn't really look like we have any way of > > handling write errors when dependencies are enforced using BIO_ORDERED. > > In the case of the babarrierwrite() consumer in FFS, what happens if the > > inode block write fails due to a transient error, but the following CG > > update succeeds? > > Looking at this some more, I think iosched is ok since bioq_disksort() > does in fact handle BIO_ORDERED. Except when it doesn't. BIO_READs are posted to the device completely independent of BIO_ORDERED commands. I believe this is OK, but since BIO_ORDERED is so ill defined, I can't be sure. > I'm concerned though that there are > places in the tree where we should be using BIO_ORDERED but aren't. > I maintain that there are no such places :) If you want to do ORDERED I/O, you have to order it yourself by flushing all the other outstanding I/O, then issuing the I/O you want to follow the completion of all the others, then issue new I/O. With tagged queueing, otherwise, you get non-determinate write order to the disk. > gmirror metadata writes for instance are performed synchronously but > should not be reordered with preceding BIO_WRITEs. > Right, gmirror should freeze the software bioq, drain the hardware queue, issue the right, then unfreeze its bioq in these cases. BIO_ORDERED and BIO_FLUSH isn't going to help much. It assumes there's only one 'flow' of these to the device from the upper layers, when in fact there can be several for multiple partitions. If gmirror needs strong ordering semantics, it needs to actually enforce the exact semantics it wants. Otherwise, tagged queueing can get in the way (though right now, to its credit, the ATA driver schedules the ordered I/O as non-tagged-queue so that it causes this mini-freeze, SCSI just tags it and hopes for the best, giving slightly different semantics, and NVMe I think drains all queue, then schedules the I/O then starts again). NVMe is an even poorer match to whatever BIO_ORDERED is supposed to mean than even ATA since it can do multiple streams to the drive at once. In that environment, BIO_ORDERED makes as much sense as SPLHIGH does on a MP machine. > Anyway, I've posted a review for some gmirror I/O ordering fixes here if > anyone is interested: https://reviews.freebsd.org/D13559 > I'll take a look at it, thanks. Warner From owner-svn-src-head@freebsd.org Wed Dec 20 22:36:34 2017 Return-Path: Delivered-To: svn-src-head@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 E85C9E83947 for ; Wed, 20 Dec 2017 22:36:34 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-io0-f179.google.com (mail-io0-f179.google.com [209.85.223.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6A0165D38 for ; Wed, 20 Dec 2017 22:36:34 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-io0-f179.google.com with SMTP id 14so12505108iou.2 for ; Wed, 20 Dec 2017 14:36:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=LoDfOMTCNBWR/zQMGmtuh03Mx6FA/swCWrPXcI94aeo=; b=Vr5qZ0oEKOhUs4uoetgMXbHJJCp0R/Vu2jhx9DF1GizxKkI39w4CEpriDHu21pDSq5 K4bFUnym9FZiIDXlokmgcqtxCzWw4fa1MdFZLti5U/9z4/aj2Bkr0aPMeGEt/RbIJ9u1 sQ6Xz/2QoPkl0KIr4mEUizET+RsheLBAcdlUWkEl/tod9C1h02QrUI+RVXxVDwz2fY0w 8WClacC71Jnauw7SdGXS1i/kOAswRPylx9pBfbNrETQb+b7AEsHrV20g/gdEF3EDfTUt hqTiFTyYotc5uIE5EzuadObpfoIQtM5otvqKbS1cLxAzu45e9uEZIkmN98PsGBdmtMoO kHpQ== X-Gm-Message-State: AKGB3mJfcTQ8OcNmN29jjokgfM0r1OQmE82H9HWRiUAB/SrbYb6uHxmk xbTJKErrGlmltjjtY3ozo/NrEyrn X-Google-Smtp-Source: ACJfBov74HWrizB8YqI0LIhIq3+4IknrDnAjNPJEP303B13oybQClnx9XtKgiYGlu1wwSAOKEdRLpQ== X-Received: by 10.107.183.76 with SMTP id h73mr10136634iof.154.1513799239646; Wed, 20 Dec 2017 11:47:19 -0800 (PST) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com. [209.85.223.172]) by smtp.gmail.com with ESMTPSA id f11sm9459747iob.52.2017.12.20.11.47.18 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Dec 2017 11:47:19 -0800 (PST) Received: by mail-io0-f172.google.com with SMTP id 87so14377169ior.5 for ; Wed, 20 Dec 2017 11:47:18 -0800 (PST) X-Received: by 10.107.200.151 with SMTP id y145mr9627937iof.302.1513799238643; Wed, 20 Dec 2017 11:47:18 -0800 (PST) MIME-Version: 1.0 References: <201712201815.vBKIF6IN062349@repo.freebsd.org> <20171220193237.GA11032@raichu> In-Reply-To: <20171220193237.GA11032@raichu> From: Eric Joyner Date: Wed, 20 Dec 2017 19:47:08 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327031 - in head/sys: conf dev/ixgbe modules/ix modules/ixv To: Mark Johnston , cramerj@intel.com Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Dec 2017 22:36:35 -0000 On Wed, Dec 20, 2017 at 11:32 AM Mark Johnston wrote: > On Wed, Dec 20, 2017 at 06:15:06PM +0000, Eric Joyner wrote: > > Author: erj > > Date: Wed Dec 20 18:15:06 2017 > > New Revision: 327031 > > URL: https://svnweb.freebsd.org/changeset/base/327031 > > > > Log: > > ixgbe(4): Convert driver to use iflib > > > > Initial update to the ixgbe PF and VF drivers to support the iflib > interface. > > > > The PF driver version is bumped to 4.0.0, and the VF driver version is > bumped to 2.0.0. > > > > Special thanks to sbruno@ for the support in helping make this > conversion happen. > > > > Submitted by: Jeb Cramer , Krzysztof Galazka > (Chris) , Piotr Pietruszewski < > piotr.pietruszewski@intel.com> > > Reviewed by: sbruno@, shurd@, #IntelNetworking > > Tested by: Jeffrey Pieper , Sergey > Kozlov > > Sponsored by: Limelight Networks, Intel Corporation > > Differential Revision: https://reviews.freebsd.org/D11727 > > This seems to have broken at least the i386 kernel build. Could you > please take a look? > > https://ci.freebsd.org/job/FreeBSD-head-i386-build/5330/console We probably missed this because we pretty much only use amd64 for testing; it looks like for that error we can just change that ULONG to a UQUAD. I'll add Jeb to this thread. - Eric From owner-svn-src-head@freebsd.org Thu Dec 21 00:20:03 2017 Return-Path: Delivered-To: svn-src-head@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 3F531E8973F; Thu, 21 Dec 2017 00:20:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1944469697; Thu, 21 Dec 2017 00:20:03 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 23F5610AF3A; Wed, 20 Dec 2017 19:20:02 -0500 (EST) From: John Baldwin To: Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326991 - in head/sys/fs: nfs nfsclient Date: Wed, 20 Dec 2017 15:11:39 -0800 Message-ID: <2816727.f1xFVHHEZ2@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1513800442.29087.28.camel@freebsd.org> References: <201712191918.vBJJImA5072223@repo.freebsd.org> <1513800442.29087.28.camel@freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 20 Dec 2017 19:20:02 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 00:20:03 -0000 On Wednesday, December 20, 2017 01:07:22 PM Ian Lepore wrote: > On Tue, 2017-12-19 at 19:18 +0000, John Baldwin wrote: > > Author: jhb > > Date: Tue Dec 19 19:18:48 2017 > > New Revision: 326991 > > URL: https://svnweb.freebsd.org/changeset/base/326991 > > > > Log: > > Update NFS to handle larger link counts post ino64. > > > [...] > > Modified: head/sys/fs/nfsclient/nfs_clvnops.c > > ============================================================================== > > --- head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:14:01 2017 (r326990) > > +++ head/sys/fs/nfsclient/nfs_clvnops.c Tue Dec 19 19:18:48 2017 (r326991) > > @@ -3450,7 +3450,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) > > * For NFSv2 (or NFSv3 when not one of the above 4 a_names), > > * just fake them. > > */ > > - pc.pc_linkmax = LINK_MAX; > > + pc.pc_linkmax = NFS_LINK_MAX; > > pc.pc_namemax = NFS_MAXNAMLEN; > > pc.pc_notrunc = 1; > > pc.pc_chownrestricted = 1; > > @@ -3460,7 +3460,7 @@ nfs_pathconf(struct vop_pathconf_args *ap) > > } > > switch (ap->a_name) { > > case _PC_LINK_MAX: > > - *ap->a_retval = pc.pc_linkmax; > > + *ap->a_retval = MIN(LONG_MAX, pc.pc_linkmax); > > I just noticed a build error on powerpc LINT and LINT64 kernels on this > line: > > /b/staging/freebsd/head/src/sys/fs/nfsclient/nfs_clvnops.c:3464: > warning: comparison is always false due to limited range of data type Ugh, ok. I'll do a full tinderbox and clean up any fallout. I had done one on an earlier version, but not the latest. :-/ Thanks. -- John Baldwin From owner-svn-src-head@freebsd.org Thu Dec 21 00:35:16 2017 Return-Path: Delivered-To: svn-src-head@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 57F70E8A83C; Thu, 21 Dec 2017 00:35:16 +0000 (UTC) (envelope-from erj@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 229976A66A; Thu, 21 Dec 2017 00:35:16 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL0ZF7V025507; Thu, 21 Dec 2017 00:35:15 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL0ZFGp025506; Thu, 21 Dec 2017 00:35:15 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201712210035.vBL0ZFGp025506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 21 Dec 2017 00:35:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327051 - head/sys/dev/ixgbe X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixgbe X-SVN-Commit-Revision: 327051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 00:35:16 -0000 Author: erj Date: Thu Dec 21 00:35:14 2017 New Revision: 327051 URL: https://svnweb.freebsd.org/changeset/base/327051 Log: ixgbe(4): Fix build error on i386. Reported by: markj Modified: head/sys/dev/ixgbe/if_ixv.c Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Wed Dec 20 22:19:11 2017 (r327050) +++ head/sys/dev/ixgbe/if_ixv.c Thu Dec 21 00:35:14 2017 (r327051) @@ -1791,7 +1791,7 @@ ixv_add_stats_sysctls(struct adapter *adapter) CTLFLAG_RD, NULL, "Queue Name"); queue_list = SYSCTL_CHILDREN(queue_node); - SYSCTL_ADD_ULONG(ctx, queue_list, OID_AUTO, "tso_tx", + SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tso_tx", CTLFLAG_RD, &(txr->tso_tx), "TSO Packets"); SYSCTL_ADD_UQUAD(ctx, queue_list, OID_AUTO, "tx_packets", CTLFLAG_RD, &(txr->total_packets), "TX Packets"); From owner-svn-src-head@freebsd.org Thu Dec 21 00:36:56 2017 Return-Path: Delivered-To: svn-src-head@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 23916E8AA59 for ; Thu, 21 Dec 2017 00:36:56 +0000 (UTC) (envelope-from erj@erj.cc) Received: from mail-it0-x241.google.com (mail-it0-x241.google.com [IPv6:2607:f8b0:4001:c0b::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE3766A8AC for ; Thu, 21 Dec 2017 00:36:55 +0000 (UTC) (envelope-from erj@erj.cc) Received: by mail-it0-x241.google.com with SMTP id o130so13050587itg.0 for ; Wed, 20 Dec 2017 16:36:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=erj.cc; s=ericroxx; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SXo7LrkGYF6d7/YbzGUxtE8+FcImt8Qxx3Zeb8KEr+k=; b=TPOLhMI/FYiPzoLcLUx8fEIwAfI3gL4tiH6U7mn886WNhsWgED7bc2JgqtMcEPMU7J J22wHHiXH9H49ZrCvujjuxzeHrTqLaGf8xaDMMUeZtSzndtJ6E2yk/KCbmUmozVcNSaF lvAeZoaqlprKjfJbo4bTxcev0pdrTr//dpkf0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SXo7LrkGYF6d7/YbzGUxtE8+FcImt8Qxx3Zeb8KEr+k=; b=DMtPx4m5+FArWU/hrbuq6jjlB4Vz8pi7TXeBRQohStDINUTNXVKNQGEk0MafHx5lrd agmaqcO42soWsIpKNiq3Vo1C3brTDggA4CQrBjekbj1q/QuaNslrndW4+EOvKKlZV/Dm 0SZqrowb7xgGqBlNP8v+r/XF3D9KW3E+Bsni6CUqvmWk1qMxdCSd/qzOQ1a9j2mUi7wZ /Ouas8kwrHFUPnxJ6FoMO90yVyemoTVSN/5Psqf1HtLLtAlJNejgcx2Fjt5VOK2stwxW govsRDZkYam1Nb5lINZIDQqBTcJgqEnJxialKvztpkAFDH0QOTK67cbSbSeUMhUoAcfG cPwg== X-Gm-Message-State: AKGB3mIPAtGFEjZYAueMvOAQdIvCWijcVc8NVQuWYWO9iDCSIhcL53qq xgNx/+dIpswVCNMWt2E1JmwUTSJXHM8n0preV/TazQ== X-Google-Smtp-Source: ACJfBovNOQH5ojwKrW5J7YVq3LLLRepT6jpTaghsTea/n2mdHNbNUncJv+oQDDIs6hGdE/RWXsTqZqmSuSd/ljUUf2k= X-Received: by 10.36.145.216 with SMTP id i207mr10567224ite.73.1513816615150; Wed, 20 Dec 2017 16:36:55 -0800 (PST) MIME-Version: 1.0 References: <201712201815.vBKIF6IN062349@repo.freebsd.org> <20171220193237.GA11032@raichu> <1513800135.29087.25.camel@freebsd.org> In-Reply-To: <1513800135.29087.25.camel@freebsd.org> From: Eric Joyner Date: Thu, 21 Dec 2017 00:36:44 +0000 Message-ID: Subject: Re: svn commit: r327031 - in head/sys: conf dev/ixgbe modules/ix modules/ixv To: Ian Lepore Cc: Mark Johnston , cramerj@intel.com, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 00:36:56 -0000 On Wed, Dec 20, 2017 at 12:02 PM Ian Lepore wrote: > On Wed, 2017-12-20 at 19:47 +0000, Eric Joyner wrote: > > On Wed, Dec 20, 2017 at 11:32 AM Mark Johnston > wrote: > > > > > > > > On Wed, Dec 20, 2017 at 06:15:06PM +0000, Eric Joyner wrote: > > > > > > > > Author: erj > > > > Date: Wed Dec 20 18:15:06 2017 > > > > New Revision: 327031 > > > > URL: https://svnweb.freebsd.org/changeset/base/327031 > > > > > > > > Log: > > > > ixgbe(4): Convert driver to use iflib > > > > [...] > > > This seems to have broken at least the i386 kernel build. Could you > > > please take a look? > > > > > > https://ci.freebsd.org/job/FreeBSD-head-i386-build/5330/console > > > > We probably missed this because we pretty much only use amd64 for > testing; > > it looks like for that error we can just change that ULONG to a UQUAD. > I'll > > add Jeb to this thread. > > > > - Eric > > A good way to avoid such trouble when touching kernel/module code that > compiles on multiple arches is to do a "make lintkernels". > > Before you can do that, you need to do "make kernel-toolchains" just > once, which may take a while -- it has to build clang for each arch, > which is a bit annoying since every instance of clang is already a > cross-compiler and our build process doesn't make use of that fact. > > -- Ian > > Thanks for the report and tips, guys. It should be fixed in r327051. An i386 build didn't show any other errors. - Eric From owner-svn-src-head@freebsd.org Thu Dec 21 01:22:37 2017 Return-Path: Delivered-To: svn-src-head@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 C2DDCE8E027; Thu, 21 Dec 2017 01:22:37 +0000 (UTC) (envelope-from shurd@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 8FD0C6C59F; Thu, 21 Dec 2017 01:22:37 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL1Magq046070; Thu, 21 Dec 2017 01:22:36 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL1Maqw046069; Thu, 21 Dec 2017 01:22:36 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201712210122.vBL1Maqw046069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Thu, 21 Dec 2017 01:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327052 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 01:22:37 -0000 Author: shurd Date: Thu Dec 21 01:22:36 2017 New Revision: 327052 URL: https://svnweb.freebsd.org/changeset/base/327052 Log: Don't call tcp_lro_rx() unless hardware verified TCP/UDP csum It seems that tcp_lro_rx() doesn't verify TCP checksums, so if there are bad checksums in the packets caused by invalid data, the invalid data will pass through without errors. This was noticed with the igb driver and a specific internet host: fetch http://www.mpfr.org/mpfr-current/mpfr-3.1.6.tar.xz -o test.bin && sha256 test.bin Would result in a different value sometimes. This ends up making LRO require RXCSUM to be enabled, and RXCSUM to support TCP and UDP checksums. PR: 224346 Reported by: gjb Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D13561 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Dec 21 00:35:14 2017 (r327051) +++ head/sys/net/iflib.c Thu Dec 21 01:22:36 2017 (r327052) @@ -2632,8 +2632,11 @@ iflib_rxeof(iflib_rxq_t rxq, qidx_t budget) mt = mf = NULL; } } - if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) + if ((m->m_pkthdr.csum_flags & (CSUM_L4_CALC|CSUM_L4_VALID)) == + (CSUM_L4_CALC|CSUM_L4_VALID)) { + if (lro_possible && tcp_lro_rx(&rxq->ifr_lc, m, 0) == 0) continue; + } } #endif if (lro_possible) { From owner-svn-src-head@freebsd.org Thu Dec 21 01:27:34 2017 Return-Path: Delivered-To: svn-src-head@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 316A0E8E81F; Thu, 21 Dec 2017 01:27:34 +0000 (UTC) (envelope-from marius@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 F26606CA98; Thu, 21 Dec 2017 01:27:33 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL1RXGc046424; Thu, 21 Dec 2017 01:27:33 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL1RXFC046423; Thu, 21 Dec 2017 01:27:33 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201712210127.vBL1RXFC046423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Thu, 21 Dec 2017 01:27:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327053 - head/sys/sparc64/include X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/sparc64/include X-SVN-Commit-Revision: 327053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 01:27:34 -0000 Author: marius Date: Thu Dec 21 01:27:32 2017 New Revision: 327053 URL: https://svnweb.freebsd.org/changeset/base/327053 Log: Remove MD atomic_load_{32,64,int,long,ptr}(9) obsolete since the addition of (conflicting) MI ones in r326971. Modified: head/sys/sparc64/include/atomic.h Modified: head/sys/sparc64/include/atomic.h ============================================================================== --- head/sys/sparc64/include/atomic.h Thu Dec 21 01:22:36 2017 (r327052) +++ head/sys/sparc64/include/atomic.h Thu Dec 21 01:27:32 2017 (r327053) @@ -258,11 +258,6 @@ atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *e } \ \ static __inline vtype \ -atomic_load_ ## name(volatile ptype p) \ -{ \ - return ((vtype)atomic_cas((p), 0, 0, sz)); \ -} \ -static __inline vtype \ atomic_load_acq_ ## name(volatile ptype p) \ { \ return ((vtype)atomic_cas_acq((p), 0, 0, sz)); \ From owner-svn-src-head@freebsd.org Thu Dec 21 04:22:00 2017 Return-Path: Delivered-To: svn-src-head@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 CBCB1E9D31B; Thu, 21 Dec 2017 04:22:00 +0000 (UTC) (envelope-from imp@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 9465073B53; Thu, 21 Dec 2017 04:22:00 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL4Lxsa019862; Thu, 21 Dec 2017 04:21:59 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL4Lxw0019861; Thu, 21 Dec 2017 04:21:59 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712210421.vBL4Lxw0019861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Dec 2017 04:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327054 - head/lib/libdevinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/lib/libdevinfo X-SVN-Commit-Revision: 327054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 04:22:00 -0000 Author: imp Date: Thu Dec 21 04:21:59 2017 New Revision: 327054 URL: https://svnweb.freebsd.org/changeset/base/327054 Log: Bump number that's an insane number of devices from 1,000 to 10,000. I have access to machines that are pushing 400 devices. When 1,000 was selected, it was rare to get even 40 or 50 devices. Bump the limit by 10x to keep up with the times. Sponsored by: Netflix Modified: head/lib/libdevinfo/devinfo.c Modified: head/lib/libdevinfo/devinfo.c ============================================================================== --- head/lib/libdevinfo/devinfo.c Thu Dec 21 01:27:32 2017 (r327053) +++ head/lib/libdevinfo/devinfo.c Thu Dec 21 04:21:59 2017 (r327054) @@ -204,7 +204,7 @@ devinfo_init_devices(int generation) * Stop after a fairly insane number to avoid death in the case * of kernel corruption. */ - for (dev_idx = 0; dev_idx < 1000; dev_idx++) { + for (dev_idx = 0; dev_idx < 10000; dev_idx++) { /* * Get the device information. From owner-svn-src-head@freebsd.org Thu Dec 21 04:23:02 2017 Return-Path: Delivered-To: svn-src-head@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 78C72E9D4FB; Thu, 21 Dec 2017 04:23:02 +0000 (UTC) (envelope-from imp@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 4EDEF73D3D; Thu, 21 Dec 2017 04:23:02 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL4N1sY022150; Thu, 21 Dec 2017 04:23:01 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL4N0Ap022144; Thu, 21 Dec 2017 04:23:00 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712210423.vBL4N0Ap022144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Dec 2017 04:23:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327055 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 327055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 04:23:02 -0000 Author: imp Date: Thu Dec 21 04:23:00 2017 New Revision: 327055 URL: https://svnweb.freebsd.org/changeset/base/327055 Log: Provide a nda man page. Add cross referneces. Bump dates. Also, CAM is a storage subsystem, not a SCSI/ATA one these days. Sponsored by: Netflix Added: head/share/man/man4/nda.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/ada.4 head/share/man/man4/da.4 head/share/man/man4/pci.4 head/share/man/man4/scsi.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/Makefile Thu Dec 21 04:23:00 2017 (r327055) @@ -382,6 +382,7 @@ MAN= aac.4 \ ${_ntb_hw_intel.4} \ ${_ntb_hw_plx.4} \ ${_ntb_transport.4} \ + ${_nda.4} \ ${_if_ntb.4} \ null.4 \ numa.4 \ @@ -808,6 +809,7 @@ _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 _linux.4= linux.4 +_nda.4= nda.4 _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/ada.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2015 +.Dd December 20, 2017 .Dt ADA 4 .Os .Sh NAME @@ -157,6 +157,7 @@ ATA device nodes .Xr cam 4 , .Xr da 4 , .Xr mvs 4 , +.Xr nda 4 , .Xr siis 4 .Sh HISTORY The Modified: head/share/man/man4/da.4 ============================================================================== --- head/share/man/man4/da.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/da.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2015 +.Dd December 20, 2017 .Dt DA 4 .Os .Sh NAME @@ -214,6 +214,7 @@ None. .Xr ada 4 , .Xr cam 4 , .Xr geom 4 , +.Xr nda 4 , .Xr gpart 8 .Sh HISTORY The Added: head/share/man/man4/nda.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/nda.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -0,0 +1,87 @@ +.\" Copyright (c) 2017 Netflix, Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 20, 2017 +.Dt NDA 4 +.Os +.Sh NAME +.Nm nda +.Nd NVMe Direct Access device driver +.Sh SYNOPSIS +.Cd device nvme +.Cd device scbus +.Sh DESCRIPTION +The +.Nm +driver provides support for direct access devices, implementing the +.Tn NVMe +command protocol, that are attached to the system through a host adapter +supported by the CAM subsystem. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width 12 +.It Va kern.cam.nda.sort_io_queue +.Pp +This variable determines whether the software queued entries are +sorted in LBA order or not. +Sorting is almost always a waste of time. +The default is to not sort. +.El +.Pp +The following report per-device settings, and are read-only unless +otherwise indicated. Replace +.Va N +with the device unit number. +.Bl -tag -width 12 +.It Va kern.cam.nda.N.rotating +.Pp +This variable reports whether the storage volume is spinning or +flash. +It's value is hard coded to 0 indicating flash. +.It Va kern.cam.nda.N.unmapped_io +This variable reports whether the +.Nm +driver accepts unmapped I/O for this unit. +.Sh FILES +.Bl -tag -width ".Pa /dev/nda*" -compact +.It Pa /dev/nda* +NVMe storage device nodes +.El +.Sh SEE ALSO +.Xr nvme 4 , +.Xr nvd 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An Warner Losh Aq Mt imp@FreeBSD.org Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/pci.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2016 +.Dd December 20, 2017 .Dt PCI 4 .Os .Sh NAME Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/scsi.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -24,12 +24,12 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 15, 2017 +.Dd December 20, 2017 .Dt CAM 4 .Os .Sh NAME .Nm CAM -.Nd Common Access Method SCSI/ATA subsystem +.Nd Common Access Method Storage subsystem .Sh SYNOPSIS .Cd "device scbus" .Cd "device ada" @@ -353,6 +353,7 @@ for details. .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr nda 4 , .Xr nvme 4 , .Xr pass 4 , .Xr pt 4 , From owner-svn-src-head@freebsd.org Thu Dec 21 04:31:17 2017 Return-Path: Delivered-To: svn-src-head@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 3838FE9DEFC; Thu, 21 Dec 2017 04:31:17 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B564741CF; Thu, 21 Dec 2017 04:31:17 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from process-dkim-sign-daemon.mr11p00im-asmtp004.me.com by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) id <0P1A00N00N1JK100@mr11p00im-asmtp004.me.com>; Thu, 21 Dec 2017 04:30:49 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mac.com; s=04042017; t=1513830649; bh=FT5jbm1qvrG08bIGfGueoLva5rGJ5RoOLO7yK72ZrAI=; h=Date:Subject:From:To:Message-id:MIME-version:Content-type; b=CDiFlb9E19Kcyf9e9ibmhwfU/xGvaz5TBsJjLEJZkuKpvknc7yOC88qLlRLOitDhN ZHxwGBMUusZhnBLEm6oMuQRJWX0dIJZxLDi/bkMeKKU0spanB1g6qzjQqW/jtz0rK+ /D05BIuenCxMCDAoXcCxX6Ju56B5zAU7d0p4HdTFxSyf634JH5SfT2eYW8y5RqO5IZ NM9sROW6E6B987tshbgWbFiOyAz2U6bR5KHmjD9/kcd8eZjRewStcMfgXF6at6neZe bAEQm72h5XUnrqvITNjiH5AkvHN+KouRx6opQwBONTP2vxwcFFiSbkzb2pM6IYK1KA /J+0EZXjdFGDQ== Received: from icloud.com ([127.0.0.1]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 8.0.1.2.20170607 64bit (built Jun 7 2017)) with ESMTPSA id <0P1A004CYN7CEK00@mr11p00im-asmtp004.me.com>; Thu, 21 Dec 2017 04:30:49 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-12-21_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1712210060 User-Agent: Microsoft-MacOutlook/f.29.0.171205 Date: Wed, 20 Dec 2017 20:30:48 -0800 Subject: Re: svn commit: r327055 - head/share/man/man4 From: Ravi Pokala To: Warner Losh , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <8B11940F-93BF-429B-A64C-2538036992B9@mac.com> Thread-topic: svn commit: r327055 - head/share/man/man4 References: <201712210423.vBL4N0Ap022144@repo.freebsd.org> In-reply-to: <201712210423.vBL4N0Ap022144@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 04:31:17 -0000 Also updates the date on pci.4, in light of r327036 earlier today. -Ravi (rpokala@) -----Original Message----- From: on behalf of Warner Losh Date: 2017-12-20, Wednesday at 20:23 To: , , Subject: svn commit: r327055 - head/share/man/man4 Author: imp Date: Thu Dec 21 04:23:00 2017 New Revision: 327055 URL: https://svnweb.freebsd.org/changeset/base/327055 Log: Provide a nda man page. Add cross referneces. Bump dates. Also, CAM is a storage subsystem, not a SCSI/ATA one these days. Sponsored by: Netflix Added: head/share/man/man4/nda.4 (contents, props changed) Modified: head/share/man/man4/Makefile head/share/man/man4/ada.4 head/share/man/man4/da.4 head/share/man/man4/pci.4 head/share/man/man4/scsi.4 Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/Makefile Thu Dec 21 04:23:00 2017 (r327055) @@ -382,6 +382,7 @@ MAN= aac.4 \ ${_ntb_hw_intel.4} \ ${_ntb_hw_plx.4} \ ${_ntb_transport.4} \ + ${_nda.4} \ ${_if_ntb.4} \ null.4 \ numa.4 \ @@ -808,6 +809,7 @@ _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 _io.4= io.4 _linux.4= linux.4 +_nda.4= nda.4 _ndis.4= ndis.4 _nfe.4= nfe.4 _nfsmb.4= nfsmb.4 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/ada.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 19, 2015 +.Dd December 20, 2017 .Dt ADA 4 .Os .Sh NAME @@ -157,6 +157,7 @@ ATA device nodes .Xr cam 4 , .Xr da 4 , .Xr mvs 4 , +.Xr nda 4 , .Xr siis 4 .Sh HISTORY The Modified: head/share/man/man4/da.4 ============================================================================== --- head/share/man/man4/da.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/da.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 11, 2015 +.Dd December 20, 2017 .Dt DA 4 .Os .Sh NAME @@ -214,6 +214,7 @@ None. .Xr ada 4 , .Xr cam 4 , .Xr geom 4 , +.Xr nda 4 , .Xr gpart 8 .Sh HISTORY The Added: head/share/man/man4/nda.4 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/nda.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -0,0 +1,87 @@ +.\" Copyright (c) 2017 Netflix, Inc +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd December 20, 2017 +.Dt NDA 4 +.Os +.Sh NAME +.Nm nda +.Nd NVMe Direct Access device driver +.Sh SYNOPSIS +.Cd device nvme +.Cd device scbus +.Sh DESCRIPTION +The +.Nm +driver provides support for direct access devices, implementing the +.Tn NVMe +command protocol, that are attached to the system through a host adapter +supported by the CAM subsystem. +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width 12 +.It Va kern.cam.nda.sort_io_queue +.Pp +This variable determines whether the software queued entries are +sorted in LBA order or not. +Sorting is almost always a waste of time. +The default is to not sort. +.El +.Pp +The following report per-device settings, and are read-only unless +otherwise indicated. Replace +.Va N +with the device unit number. +.Bl -tag -width 12 +.It Va kern.cam.nda.N.rotating +.Pp +This variable reports whether the storage volume is spinning or +flash. +It's value is hard coded to 0 indicating flash. +.It Va kern.cam.nda.N.unmapped_io +This variable reports whether the +.Nm +driver accepts unmapped I/O for this unit. +.Sh FILES +.Bl -tag -width ".Pa /dev/nda*" -compact +.It Pa /dev/nda* +NVMe storage device nodes +.El +.Sh SEE ALSO +.Xr nvme 4 , +.Xr nvd 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An Warner Losh Aq Mt imp@FreeBSD.org Modified: head/share/man/man4/pci.4 ============================================================================== --- head/share/man/man4/pci.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/pci.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 8, 2016 +.Dd December 20, 2017 .Dt PCI 4 .Os .Sh NAME Modified: head/share/man/man4/scsi.4 ============================================================================== --- head/share/man/man4/scsi.4 Thu Dec 21 04:21:59 2017 (r327054) +++ head/share/man/man4/scsi.4 Thu Dec 21 04:23:00 2017 (r327055) @@ -24,12 +24,12 @@ .\" SUCH DAMAGE. .\" .\" $FreeBSD$ -.Dd January 15, 2017 +.Dd December 20, 2017 .Dt CAM 4 .Os .Sh NAME .Nm CAM -.Nd Common Access Method SCSI/ATA subsystem +.Nd Common Access Method Storage subsystem .Sh SYNOPSIS .Cd "device scbus" .Cd "device ada" @@ -353,6 +353,7 @@ for details. .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr nda 4 , .Xr nvme 4 , .Xr pass 4 , .Xr pt 4 , From owner-svn-src-head@freebsd.org Thu Dec 21 07:04:24 2017 Return-Path: Delivered-To: svn-src-head@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 E172AE80709; Thu, 21 Dec 2017 07:04:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 96F0C7933C; Thu, 21 Dec 2017 07:04:24 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 9AE391A3339; Thu, 21 Dec 2017 18:04:13 +1100 (AEDT) Date: Thu, 21 Dec 2017 18:04:13 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: John Baldwin cc: Nathan Whitehorn , David Chisnall , Eugene Grosbein , Konstantin Belousov , Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326758 - in head/sys/i386: conf include In-Reply-To: <2357779.RlDvz1mMEe@ralph.baldwin.cx> Message-ID: <20171221173611.U1760@besplex.bde.org> References: <201712110432.vBB4WbnE021090@repo.freebsd.org> <1839614.eNG2DjLqvF@ralph.baldwin.cx> <28f2f06b-dc46-99f1-70be-260bb408c827@freebsd.org> <2357779.RlDvz1mMEe@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=KeqiiUQD c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=xqhh-0-aH2icw2QaH4QA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 07:04:25 -0000 On Wed, 20 Dec 2017, John Baldwin wrote: > On Wednesday, December 20, 2017 10:16:58 AM Nathan Whitehorn wrote: >> ... >> With GCC 4, it takes a little while, but trying to build ports over NFS >> is a sure-fire way to bring down the kernel. I haven't tried any other >> compilers. > > Ah, I have only done things like run binaries over NFS and compile simple > test programs over NFS with GCC 4 (I do run a gdb binary over NFS against > itself which probably involves a bit of I/O due to debug symbols, etc. but > still not as onerous as building lots of ports. I cross-build the GDB on > the host due to qemu being too slow). I use gcc-4.2.1 on i386 and amd64 with no problems except source code breakage. I use nfs a lot, but not zfs or newer networking. > clang insta-panics for even trivial > things like 'ls' and tab-completion though. It's definitely much worse > than either version of GCC. It is is indeed worse in every way :-) except it can build kernels that run a couple of percent faster, so I don't use it. It doesn't support standard flags like -fno-inline-functions-called-once. I use anti-inlining flags like this mainly to simplify debugging, but they help reduce stack bloat. Kernels build with excessive inlining still don't crash here. The mechanism for stack bloat by inlining might be that when inlining a bunch of functions, say all leaf functions, the stacks for all the functions get added to the callee and don't get combined. I wonder if -fstack-protector is any use. I tried using the correct value for KSTACK_PAGES (1) on i386, but there was always too much bloat for that so it crashed fast. -fstack-protector didn't help, and it crashed with a double fault so there was no usable stack trace. Automatically expanding the stack by 1 page in the double fault handler would be not much harder than finding the old stack to trace it. Bruce From owner-svn-src-head@freebsd.org Thu Dec 21 09:17:49 2017 Return-Path: Delivered-To: svn-src-head@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 D1C65E88BBB; Thu, 21 Dec 2017 09:17:49 +0000 (UTC) (envelope-from bde@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 A8FE77E785; Thu, 21 Dec 2017 09:17:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL9Hmnk042740; Thu, 21 Dec 2017 09:17:48 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL9Hmd0042736; Thu, 21 Dec 2017 09:17:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201712210917.vBL9Hmd0042736@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 21 Dec 2017 09:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327056 - in head/sys: kern sys x86/acpica x86/x86 X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: in head/sys: kern sys x86/acpica x86/x86 X-SVN-Commit-Revision: 327056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 09:17:49 -0000 Author: bde Date: Thu Dec 21 09:17:48 2017 New Revision: 327056 URL: https://svnweb.freebsd.org/changeset/base/327056 Log: Use resume_cpus() instead of restart_cpus() to resume from ACPI suspension. restart_cpus() worked well enough by accident. Before this set of fixes, resume_cpus() used the same cpuset (started_cpus, meaning CPUs directed to restart) as restart_cpus(). resume_cpus() waited for the wrong cpuset (stopped_cpus) to become empty, but since mixtures of stopped and suspended CPUs are not close to working, stopped_cpus must be empty when resuming so the wait is null -- restart_cpus just allows the other CPUs to restart and returns without waiting. Fix resume_cpus() to wait on a non-wrong cpuset for the ACPI case, and add further kludges to try to keep it working for the XEN case. It was only used for XEN. It waited on suspended_cpus. This works for XEN. However, for ACPI, resuming is a 2-step process. ACPI has already woken up the other CPUs and removed them from suspended_cpus. This fix records the move by putting them in a new cpuset resuming_cpus. Waiting on suspended_cpus would give the same null wait as waiting on stopped_cpus. Wait on resuming_cpus instead. Add a cpuset toresume_cpus to map the CPUs being told to resume to keep this separate from the cpuset started_cpus for mapping the CPUs being told to restart. Mixtures of stopped and suspended/resuming CPUs are still far from working. Describe new and some old cpusets in comments. Add further kludges to cpususpend_handler() to try to avoid breaking it for XEN. XEN doesn't use resumectx(), so it doesn't use the second return path for savectx(), and it goes from the suspended state directly to the restarted state, while ACPI resume goes through the resuming state. Enter the resuming state early for all cases so that resume_cpus can test for being in this state and not have to worry about the intermediate !suspended state for ACPI only. Reviewed by: kib Modified: head/sys/kern/subr_smp.c head/sys/sys/smp.h head/sys/x86/acpica/acpi_wakeup.c head/sys/x86/x86/mp_x86.c Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Thu Dec 21 04:23:00 2017 (r327055) +++ head/sys/kern/subr_smp.c Thu Dec 21 09:17:48 2017 (r327056) @@ -351,13 +351,18 @@ generic_restart_cpus(cpuset_t map, u_int type) #if X86 if (type == IPI_SUSPEND) - cpus = &suspended_cpus; + cpus = &resuming_cpus; else #endif cpus = &stopped_cpus; /* signal other cpus to restart */ - CPU_COPY_STORE_REL(&map, &started_cpus); +#if X86 + if (type == IPI_SUSPEND) + CPU_COPY_STORE_REL(&map, &toresume_cpus); + else +#endif + CPU_COPY_STORE_REL(&map, &started_cpus); #if X86 if (!nmi_is_broadcast || nmi_kdb_lock == 0) { Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Thu Dec 21 04:23:00 2017 (r327055) +++ head/sys/sys/smp.h Thu Dec 21 09:17:48 2017 (r327056) @@ -155,10 +155,13 @@ struct cpu_group *smp_topo_find(struct cpu_group *top, extern void (*cpustop_restartfunc)(void); extern int smp_cpus; -extern volatile cpuset_t started_cpus; -extern volatile cpuset_t stopped_cpus; -extern volatile cpuset_t suspended_cpus; -extern cpuset_t hlt_cpus_mask; +/* The suspend/resume cpusets are x86 only, but minimize ifdefs. */ +extern volatile cpuset_t resuming_cpus; /* woken up cpus in suspend pen */ +extern volatile cpuset_t started_cpus; /* cpus to let out of stop pen */ +extern volatile cpuset_t stopped_cpus; /* cpus in stop pen */ +extern volatile cpuset_t suspended_cpus; /* cpus [near] sleeping in susp pen */ +extern volatile cpuset_t toresume_cpus; /* cpus to let out of suspend pen */ +extern cpuset_t hlt_cpus_mask; /* XXX 'mask' is detail in old impl */ extern cpuset_t logical_cpus_mask; #endif /* SMP */ Modified: head/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- head/sys/x86/acpica/acpi_wakeup.c Thu Dec 21 04:23:00 2017 (r327055) +++ head/sys/x86/acpica/acpi_wakeup.c Thu Dec 21 09:17:48 2017 (r327056) @@ -310,7 +310,7 @@ acpi_wakeup_machdep(struct acpi_softc *sc, int state, #ifdef SMP if (!CPU_EMPTY(&suspcpus)) - restart_cpus(suspcpus); + resume_cpus(suspcpus); #endif mca_resume(); #ifdef __amd64__ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Thu Dec 21 04:23:00 2017 (r327055) +++ head/sys/x86/x86/mp_x86.c Thu Dec 21 09:17:48 2017 (r327056) @@ -124,6 +124,9 @@ struct cpu_ops cpu_ops; static volatile cpuset_t ipi_stop_nmi_pending; +volatile cpuset_t resuming_cpus; +volatile cpuset_t toresume_cpus; + /* used to hold the AP's until we are ready to release them */ struct mtx ap_boot_mtx; @@ -1379,6 +1382,13 @@ cpususpend_handler(void) #endif wbinvd(); CPU_SET_ATOMIC(cpu, &suspended_cpus); + /* + * Hack for xen, which does not use resumectx() so never + * uses the next clause: set resuming_cpus early so that + * resume_cpus() can wait on the same bitmap for acpi and + * xen. resuming_cpus now means eventually_resumable_cpus. + */ + CPU_SET_ATOMIC(cpu, &resuming_cpus); } else { #ifdef __amd64__ fpuresume(susppcbs[cpu]->sp_fpususpend); @@ -1390,12 +1400,12 @@ cpususpend_handler(void) PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - /* Indicate that we are resumed */ + /* Indicate that we are resuming */ CPU_CLR_ATOMIC(cpu, &suspended_cpus); } - /* Wait for resume */ - while (!CPU_ISSET(cpu, &started_cpus)) + /* Wait for resume directive */ + while (!CPU_ISSET(cpu, &toresume_cpus)) ia32_pause(); #ifdef __i386__ @@ -1416,8 +1426,9 @@ cpususpend_handler(void) lapic_setup(0); /* Indicate that we are resumed */ + CPU_CLR_ATOMIC(cpu, &resuming_cpus); CPU_CLR_ATOMIC(cpu, &suspended_cpus); - CPU_CLR_ATOMIC(cpu, &started_cpus); + CPU_CLR_ATOMIC(cpu, &toresume_cpus); } From owner-svn-src-head@freebsd.org Thu Dec 21 09:21:41 2017 Return-Path: Delivered-To: svn-src-head@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 AC298E8901D; Thu, 21 Dec 2017 09:21:41 +0000 (UTC) (envelope-from ed@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 83C717EB52; Thu, 21 Dec 2017 09:21:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBL9LenM046741; Thu, 21 Dec 2017 09:21:40 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBL9Leuu046739; Thu, 21 Dec 2017 09:21:40 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201712210921.vBL9Leuu046739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 21 Dec 2017 09:21:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327057 - head/usr.bin/truss X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.bin/truss X-SVN-Commit-Revision: 327057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 09:21:41 -0000 Author: ed Date: Thu Dec 21 09:21:40 2017 New Revision: 327057 URL: https://svnweb.freebsd.org/changeset/base/327057 Log: Make truss work for CloudABI executables on i386. The system call convention is different from i386 binaries running on FreeBSD/amd64, but this is not noticeable by executables. On FreeBSD/amd64, the vDSO already does padding of arguments and return values to 64-bit values. On i386, it does not, meaning that system call return values are simply stored in registers. Added: head/usr.bin/truss/i386-cloudabi32.c - copied, changed from r327055, head/usr.bin/truss/amd64-cloudabi32.c Modified: head/usr.bin/truss/Makefile Modified: head/usr.bin/truss/Makefile ============================================================================== --- head/usr.bin/truss/Makefile Thu Dec 21 09:17:48 2017 (r327056) +++ head/usr.bin/truss/Makefile Thu Dec 21 09:21:40 2017 (r327057) @@ -18,6 +18,7 @@ ABIS+= cloudabi64 .endif .if ${MACHINE_CPUARCH} == "i386" ABIS+= i386-linux +ABIS+= cloudabi32 .endif .if ${MACHINE_CPUARCH} == "amd64" ABIS+= amd64-linux Copied and modified: head/usr.bin/truss/i386-cloudabi32.c (from r327055, head/usr.bin/truss/amd64-cloudabi32.c) ============================================================================== --- head/usr.bin/truss/amd64-cloudabi32.c Thu Dec 21 04:23:00 2017 (r327055, copy source) +++ head/usr.bin/truss/i386-cloudabi32.c Thu Dec 21 09:21:40 2017 (r327057) @@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$"); #include "truss.h" static int -amd64_cloudabi32_fetch_args(struct trussinfo *trussinfo, unsigned int narg) +i386_cloudabi32_fetch_args(struct trussinfo *trussinfo, unsigned int narg) { struct current_syscall *cs; struct ptrace_io_desc iorequest; @@ -46,7 +46,7 @@ amd64_cloudabi32_fetch_args(struct trussinfo *trussinf lwpid_t tid; if (narg > 0) { - /* Fetch registers, containing the address of the arguments. */ + /* Fetch registers, containing the stack pointer. */ tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { fprintf(trussinfo->outfile, @@ -54,10 +54,10 @@ amd64_cloudabi32_fetch_args(struct trussinfo *trussinf return (-1); } - /* Fetch arguments. They are already padded to 64 bits. */ + /* Fetch arguments. */ cs = &trussinfo->curthread->cs; iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)regs.r_rcx; + iorequest.piod_offs = (void **)regs.r_esp + 1; iorequest.piod_addr = cs->args; iorequest.piod_len = sizeof(cs->args[0]) * narg; if (ptrace(PT_IO, tid, (caddr_t)&iorequest, 0) == -1 || @@ -68,45 +68,31 @@ amd64_cloudabi32_fetch_args(struct trussinfo *trussinf } static int -amd64_cloudabi32_fetch_retval(struct trussinfo *trussinfo, long *retval, +i386_cloudabi32_fetch_retval(struct trussinfo *trussinfo, long *retval, int *errorp) { - struct ptrace_io_desc iorequest; struct reg regs; lwpid_t tid; - /* Fetch registers, containing the address of the return values. */ tid = trussinfo->curthread->tid; if (ptrace(PT_GETREGS, tid, (caddr_t)®s, 0) == -1) { fprintf(trussinfo->outfile, "-- CANNOT READ REGISTERS --\n"); return (-1); } - if (regs.r_rax == 0) { - /* System call succeeded. Fetch return values. */ - iorequest.piod_op = PIOD_READ_D; - iorequest.piod_offs = (void *)regs.r_rcx; - iorequest.piod_addr = retval; - iorequest.piod_len = sizeof(retval[0]) * 2; - if (ptrace(PT_IO, tid, (caddr_t)&iorequest, 0) == -1 || - iorequest.piod_len == 0) - return (-1); - *errorp = 0; - } else { - /* System call failed. Set error. */ - retval[0] = regs.r_rax; - *errorp = 1; - } + retval[0] = regs.r_eax; + retval[1] = regs.r_edx; + *errorp = (regs.r_eflags & PSL_C) != 0; return (0); } -static struct procabi amd64_cloudabi32 = { +static struct procabi i386_cloudabi32 = { "CloudABI ELF32", SYSDECODE_ABI_CLOUDABI32, - amd64_cloudabi32_fetch_args, - amd64_cloudabi32_fetch_retval, - STAILQ_HEAD_INITIALIZER(amd64_cloudabi32.extra_syscalls), + i386_cloudabi32_fetch_args, + i386_cloudabi32_fetch_retval, + STAILQ_HEAD_INITIALIZER(i386_cloudabi32.extra_syscalls), { NULL } }; -PROCABI(amd64_cloudabi32); +PROCABI(i386_cloudabi32); From owner-svn-src-head@freebsd.org Thu Dec 21 09:50:37 2017 Return-Path: Delivered-To: svn-src-head@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 71A08E8ABFE; Thu, 21 Dec 2017 09:50:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 E03757FCEE; Thu, 21 Dec 2017 09:50:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id vBL9oRml009075 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 21 Dec 2017 11:50:30 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua vBL9oRml009075 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id vBL9oRl5009074; Thu, 21 Dec 2017 11:50:27 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 21 Dec 2017 11:50:27 +0200 From: Konstantin Belousov To: Marius Strobl , Ian Lepore Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327053 - head/sys/sparc64/include Message-ID: <20171221095027.GN12785@kib.kiev.ua> References: <201712210127.vBL1RXFC046423@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712210127.vBL1RXFC046423@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 09:50:37 -0000 On Thu, Dec 21, 2017 at 01:27:33AM +0000, Marius Strobl wrote: > Author: marius > Date: Thu Dec 21 01:27:32 2017 > New Revision: 327053 > URL: https://svnweb.freebsd.org/changeset/base/327053 > > Log: > Remove MD atomic_load_{32,64,int,long,ptr}(9) obsolete since the addition > of (conflicting) MI ones in r326971. I am sorry. Initially I wrote the patch with only support for required MI types int long ptr and run the tinderbox. Then I decided that there is no reason to not provide the rest, but did not realized that tb is needed again. > > Modified: > head/sys/sparc64/include/atomic.h > > Modified: head/sys/sparc64/include/atomic.h > ============================================================================== > --- head/sys/sparc64/include/atomic.h Thu Dec 21 01:22:36 2017 (r327052) > +++ head/sys/sparc64/include/atomic.h Thu Dec 21 01:27:32 2017 (r327053) > @@ -258,11 +258,6 @@ atomic_fcmpset_rel_ ## name(volatile ptype p, vtype *e > } \ > \ > static __inline vtype \ > -atomic_load_ ## name(volatile ptype p) \ > -{ \ > - return ((vtype)atomic_cas((p), 0, 0, sz)); \ atomic_cas() does not have any barrier behavior, am I right ? I.e., it does not prevent a reordering in RMO and PSO models. > -} \ > -static __inline vtype \ > atomic_load_acq_ ## name(volatile ptype p) \ > { \ > return ((vtype)atomic_cas_acq((p), 0, 0, sz)); \ From owner-svn-src-head@freebsd.org Thu Dec 21 12:21:36 2017 Return-Path: Delivered-To: svn-src-head@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 B2285E93202; Thu, 21 Dec 2017 12:21:36 +0000 (UTC) (envelope-from mizhka@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 7C145640D4; Thu, 21 Dec 2017 12:21:36 +0000 (UTC) (envelope-from mizhka@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLCLZoC017821; Thu, 21 Dec 2017 12:21:35 GMT (envelope-from mizhka@FreeBSD.org) Received: (from mizhka@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLCLZ5p017820; Thu, 21 Dec 2017 12:21:35 GMT (envelope-from mizhka@FreeBSD.org) Message-Id: <201712211221.vBLCLZ5p017820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mizhka set sender to mizhka@FreeBSD.org using -f From: Michael Zhilin Date: Thu, 21 Dec 2017 12:21:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327058 - head/stand/efi/boot1 X-SVN-Group: head X-SVN-Commit-Author: mizhka X-SVN-Commit-Paths: head/stand/efi/boot1 X-SVN-Commit-Revision: 327058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 12:21:36 -0000 Author: mizhka Date: Thu Dec 21 12:21:35 2017 New Revision: 327058 URL: https://svnweb.freebsd.org/changeset/base/327058 Log: [boot/efi] scan all display modes rather than sequential try-fail way This patch allows to scan all display modes in boot1 as loader does. Before system tried to select optimal display mode by sequential scan of modes and if error then stop scanning. This way is not good, because if mode N is not present, mode N+1 may exist. In loader we use conout->Mode->MaxMode to identify maximum number of modes. This commit is to use same way in boot1 as in loader. Reported by: Andrey Pustovetov Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D13541 Modified: head/stand/efi/boot1/boot1.c Modified: head/stand/efi/boot1/boot1.c ============================================================================== --- head/stand/efi/boot1/boot1.c Thu Dec 21 09:21:40 2017 (r327057) +++ head/stand/efi/boot1/boot1.c Thu Dec 21 12:21:35 2017 (r327058) @@ -430,10 +430,10 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) conout = ST->ConOut; conout->Reset(conout, TRUE); max_dim = best_mode = 0; - for (i = 0; ; i++) { + for (i = 0; i < conout->Mode->MaxMode; i++) { status = conout->QueryMode(conout, i, &cols, &rows); if (EFI_ERROR(status)) - break; + continue; if (cols * rows > max_dim) { max_dim = cols * rows; best_mode = i; From owner-svn-src-head@freebsd.org Thu Dec 21 15:19:45 2017 Return-Path: Delivered-To: svn-src-head@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 13979E9D575; Thu, 21 Dec 2017 15:19:45 +0000 (UTC) (envelope-from np@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 C73556A20D; Thu, 21 Dec 2017 15:19:44 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLFJhg1092929; Thu, 21 Dec 2017 15:19:43 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLFJh2c092926; Thu, 21 Dec 2017 15:19:43 GMT (envelope-from np@FreeBSD.org) Message-Id: <201712211519.vBLFJh2c092926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 21 Dec 2017 15:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327062 - in head/sys/dev/cxgbe: . common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: in head/sys/dev/cxgbe: . common X-SVN-Commit-Revision: 327062 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 15:19:45 -0000 Author: np Date: Thu Dec 21 15:19:43 2017 New Revision: 327062 URL: https://svnweb.freebsd.org/changeset/base/327062 Log: cxgbe(4): Read the MFG diags version from the VPD and make it available in the sysctl MIB. MFC after: 1 week Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/common.h head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/common.h ============================================================================== --- head/sys/dev/cxgbe/common/common.h Thu Dec 21 14:09:06 2017 (r327061) +++ head/sys/dev/cxgbe/common/common.h Thu Dec 21 15:19:43 2017 (r327062) @@ -44,6 +44,7 @@ enum { EC_LEN = 16, /* E/C length */ ID_LEN = 16, /* ID length */ PN_LEN = 16, /* Part Number length */ + MD_LEN = 16, /* MFG diags version length */ MACADDR_LEN = 12, /* MAC Address length */ }; @@ -258,6 +259,7 @@ struct vpd_params { u8 id[ID_LEN + 1]; u8 pn[PN_LEN + 1]; u8 na[MACADDR_LEN + 1]; + u8 md[MD_LEN + 1]; }; struct pci_params { @@ -590,7 +592,7 @@ int t4_get_vpd_version(struct adapter *adapter, u32 *v int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); -int t4_prep_adapter(struct adapter *adapter, u8 *buf); +int t4_prep_adapter(struct adapter *adapter, u32 *buf); int t4_shutdown_adapter(struct adapter *adapter); int t4_init_devlog_params(struct adapter *adapter, int fw_attach); int t4_init_sge_params(struct adapter *adapter); Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Dec 21 14:09:06 2017 (r327061) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Dec 21 15:19:43 2017 (r327062) @@ -2664,13 +2664,16 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t } /* - * Partial EEPROM Vital Product Data structure. Includes only the ID and - * VPD-R sections. + * Partial EEPROM Vital Product Data structure. The VPD starts with one ID + * header followed by one or more VPD-R sections, each with its own header. */ struct t4_vpd_hdr { u8 id_tag; u8 id_len[2]; u8 id_data[ID_LEN]; +}; + +struct t4_vpdr_hdr { u8 vpdr_tag; u8 vpdr_len[2]; }; @@ -2905,32 +2908,43 @@ int t4_seeprom_wp(struct adapter *adapter, int enable) /** * get_vpd_keyword_val - Locates an information field keyword in the VPD - * @v: Pointer to buffered vpd data structure + * @vpd: Pointer to buffered vpd data structure * @kw: The keyword to search for + * @region: VPD region to search (starting from 0) * * Returns the value of the information field keyword or * -ENOENT otherwise. */ -static int get_vpd_keyword_val(const struct t4_vpd_hdr *v, const char *kw) +static int get_vpd_keyword_val(const u8 *vpd, const char *kw, int region) { - int i; - unsigned int offset , len; - const u8 *buf = (const u8 *)v; - const u8 *vpdr_len = &v->vpdr_len[0]; + int i, tag; + unsigned int offset, len; + const struct t4_vpdr_hdr *vpdr; + offset = sizeof(struct t4_vpd_hdr); - len = (u16)vpdr_len[0] + ((u16)vpdr_len[1] << 8); + vpdr = (const void *)(vpd + offset); + tag = vpdr->vpdr_tag; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + while (region--) { + offset += sizeof(struct t4_vpdr_hdr) + len; + vpdr = (const void *)(vpd + offset); + if (++tag != vpdr->vpdr_tag) + return -ENOENT; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + } + offset += sizeof(struct t4_vpdr_hdr); - if (len + sizeof(struct t4_vpd_hdr) > VPD_LEN) { + if (offset + len > VPD_LEN) { return -ENOENT; } for (i = offset; i + VPD_INFO_FLD_HDR_SIZE <= offset + len;) { - if(memcmp(buf + i , kw , 2) == 0){ + if (memcmp(vpd + i , kw , 2) == 0){ i += VPD_INFO_FLD_HDR_SIZE; return i; } - i += VPD_INFO_FLD_HDR_SIZE + buf[i+2]; + i += VPD_INFO_FLD_HDR_SIZE + vpd[i+2]; } return -ENOENT; @@ -2946,18 +2960,18 @@ static int get_vpd_keyword_val(const struct t4_vpd_hdr * Reads card parameters stored in VPD EEPROM. */ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p, - u8 *vpd) + u32 *buf) { int i, ret, addr; - int ec, sn, pn, na; + int ec, sn, pn, na, md; u8 csum; - const struct t4_vpd_hdr *v; + const u8 *vpd = (const u8 *)buf; /* * Card information normally starts at VPD_BASE but early cards had * it at 0. */ - ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); + ret = t4_seeprom_read(adapter, VPD_BASE, buf); if (ret) return (ret); @@ -2971,14 +2985,13 @@ static int get_vpd_params(struct adapter *adapter, str addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < VPD_LEN; i += 4) { - ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); + ret = t4_seeprom_read(adapter, addr + i, buf++); if (ret) return ret; } - v = (const struct t4_vpd_hdr *)vpd; #define FIND_VPD_KW(var,name) do { \ - var = get_vpd_keyword_val(v , name); \ + var = get_vpd_keyword_val(vpd, name, 0); \ if (var < 0) { \ CH_ERR(adapter, "missing VPD keyword " name "\n"); \ return -EINVAL; \ @@ -3001,7 +3014,7 @@ static int get_vpd_params(struct adapter *adapter, str FIND_VPD_KW(na, "NA"); #undef FIND_VPD_KW - memcpy(p->id, v->id_data, ID_LEN); + memcpy(p->id, vpd + offsetof(struct t4_vpd_hdr, id_data), ID_LEN); strstrip(p->id); memcpy(p->ec, vpd + ec, EC_LEN); strstrip(p->ec); @@ -3015,6 +3028,14 @@ static int get_vpd_params(struct adapter *adapter, str memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); + md = get_vpd_keyword_val(vpd, "VF", 1); + if (md < 0) { + snprintf(p->md, sizeof(p->md), "unknown"); + } else { + i = vpd[md - VPD_INFO_FLD_HDR_SIZE + 2]; + memcpy(p->md, vpd + md, min(i, MD_LEN)); + } + return 0; } @@ -7997,7 +8018,7 @@ const struct chip_params *t4_get_chip_params(int chipi * values for some adapter tunables, take PHYs out of reset, and * initialize the MDIO interface. */ -int t4_prep_adapter(struct adapter *adapter, u8 *buf) +int t4_prep_adapter(struct adapter *adapter, u32 *buf) { int ret; uint16_t device_id; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Dec 21 14:09:06 2017 (r327061) +++ head/sys/dev/cxgbe/t4_main.c Thu Dec 21 15:19:43 2017 (r327062) @@ -836,7 +836,7 @@ t4_attach(device_t dev) struct make_dev_args mda; struct intrs_and_queues iaq; struct sge *s; - uint8_t *buf; + uint32_t *buf; #ifdef TCP_OFFLOAD int ofld_rqidx, ofld_tqidx; #endif @@ -5126,6 +5126,9 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "ec", CTLFLAG_RD, sc->params.vpd.ec, 0, "engineering change"); + + SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "md_version", + CTLFLAG_RD, sc->params.vpd.md, 0, "manufacturing diags version"); SYSCTL_ADD_STRING(ctx, children, OID_AUTO, "na", CTLFLAG_RD, sc->params.vpd.na, 0, "network address"); From owner-svn-src-head@freebsd.org Thu Dec 21 16:19:12 2017 Return-Path: Delivered-To: svn-src-head@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 5665FEA0B29; Thu, 21 Dec 2017 16:19:12 +0000 (UTC) (envelope-from pfg@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 212DC6C427; Thu, 21 Dec 2017 16:19:12 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLGJBnJ018486; Thu, 21 Dec 2017 16:19:11 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLGJBKN018485; Thu, 21 Dec 2017 16:19:11 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712211619.vBLGJBKN018485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Dec 2017 16:19:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327063 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 327063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 16:19:12 -0000 Author: pfg Date: Thu Dec 21 16:19:10 2017 New Revision: 327063 URL: https://svnweb.freebsd.org/changeset/base/327063 Log: patch: rejname[] is also -r option buffer, and should be PATH_MAX. Obtained from: OpenBSD (CVS 1.64) Modified: head/usr.bin/patch/patch.c Modified: head/usr.bin/patch/patch.c ============================================================================== --- head/usr.bin/patch/patch.c Thu Dec 21 15:19:43 2017 (r327062) +++ head/usr.bin/patch/patch.c Thu Dec 21 16:19:10 2017 (r327063) @@ -112,7 +112,7 @@ static bool reverse_flag_specified = false; static bool Vflag = false; /* buffer holding the name of the rejected patch file. */ -static char rejname[NAME_MAX + 1]; +static char rejname[PATH_MAX]; /* how many input lines have been irretractibly output */ static LINENUM last_frozen_line = 0; From owner-svn-src-head@freebsd.org Thu Dec 21 16:25:34 2017 Return-Path: Delivered-To: svn-src-head@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 57EF7EA162E; Thu, 21 Dec 2017 16:25:34 +0000 (UTC) (envelope-from pfg@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 2077E6CA78; Thu, 21 Dec 2017 16:25:34 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLGPX4x022370; Thu, 21 Dec 2017 16:25:33 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLGPXpY022369; Thu, 21 Dec 2017 16:25:33 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712211625.vBLGPXpY022369@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Thu, 21 Dec 2017 16:25:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327064 - head/usr.bin/patch X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/usr.bin/patch X-SVN-Commit-Revision: 327064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 16:25:34 -0000 Author: pfg Date: Thu Dec 21 16:25:33 2017 New Revision: 327064 URL: https://svnweb.freebsd.org/changeset/base/327064 Log: patch: further cleanup to git-style diffs. Fix adding and removing files with git-style a/ b/ diffs: only skip six letters if they actually match "--- a/" and "+++ b/" instead of laxer checks. Obtained from: OpenBSD (CVS 1.59) Modified: head/usr.bin/patch/pch.c Modified: head/usr.bin/patch/pch.c ============================================================================== --- head/usr.bin/patch/pch.c Thu Dec 21 16:19:10 2017 (r327063) +++ head/usr.bin/patch/pch.c Thu Dec 21 16:25:33 2017 (r327064) @@ -311,14 +311,16 @@ intuit_diff_type(void) &names[OLD_FILE].exists, strippath); else if (strnEQ(s, "--- ", 4)) { size_t off = 4; - if (piece_of_git && strippath == 957) + if (piece_of_git && strippath == 957 && + strnEQ(s, "--- a/", 6)) off = 6; names[NEW_FILE].path = fetchname(s + off, &names[NEW_FILE].exists, strippath); } else if (strnEQ(s, "+++ ", 4)) { /* pretend it is the old name */ size_t off = 4; - if (piece_of_git && strippath == 957) + if (piece_of_git && strippath == 957 && + strnEQ(s, "+++ b/", 6)) off = 6; names[OLD_FILE].path = fetchname(s + off, &names[OLD_FILE].exists, strippath); From owner-svn-src-head@freebsd.org Thu Dec 21 18:24:34 2017 Return-Path: Delivered-To: svn-src-head@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 BB8DEE81245; Thu, 21 Dec 2017 18:24:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [78.47.246.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FE8C722B9; Thu, 21 Dec 2017 18:24:34 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id vBLIOGMj013814 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Dec 2017 19:24:17 +0100 (CET) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: imp@bsdimp.com Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id vBLIO5gC044052 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 22 Dec 2017 01:24:05 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r326809 - head/sys/dev/cardbus To: Warner Losh References: <201712131338.vBDDcHCM091865@pdx.rh.CN85.dnsmgr.net> <5A3167E1.2000201@grosbein.net> <20171213180801.GA28514@FreeBSD.org> <5A316E7B.8030504@grosbein.net> <20171213182452.GA51526@FreeBSD.org> <5A318150.1000601@grosbein.net> <20171214133854.GB51526@FreeBSD.org> <5A328C81.4040501@grosbein.net> Cc: Alexey Dokuchaev , "Rodney W. Grimes" , Warner Losh , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers From: Eugene Grosbein Message-ID: <5A3BFC42.3020703@grosbein.net> Date: Fri, 22 Dec 2017 01:24:02 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS * 2.6 LOCAL_FROM From my domains X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 18:24:34 -0000 On Thu, Dec 14, 2017 at 2:36 PM, Eugene Grosbein > wrote: > > - zfsloader(8) failing to find any ZFS pool after zfsboot(8) successfully > loaded and started zfsload(8) from zpool (PR pending, need to collect more info) I've discovered the source of the problem. Here is scenario: 1. Take disk prevously used for FreeBSD. Erase its first and last megabytes with dd to start from scratch: dd if=/dev/zero bs=1m count=1 of=... etc. 2. Create MBR with gpart, add two "freebsd" slices: first one for 8GB swap, second one for ZFS (rest of space), make second slice active. 3. Install boot-loaders: /boot/boot0 (or /boot/mbr, it does not matter) with gpart to the MBR and zfsboot with dd to second second slice just as zfsboot(8) manual page instructs. Note that this does NOT change contents of *second* 512-bytes block of this slice. 4. Create zpool using whole second slice, install FreeBSD 11.1/amd64 there and try to boot it. MBR loader successfully uses second slice to load and run zfsboot. zfsboot does its job just fine running zfsloader from ZFS and passes needed ZFS it to zfsloader. zfsloader uses libstand(3) trying to find its pool: zfs_probe_partition() successfully calls libstand's version of open("disk0s1:", O_RDONLY) and skips it as there is no ZFS. Then, it tries to open("disk0s2:", O_RDONLY) and it fails returning -1 with errno==2 (ENOENT), so zfsloader fails. src/tools/tools/bootparttest shows that libstand looks at *second* sector of the slice and sees leftover of (now non-existing) BSD label there. And for some reason it prevents zfsloader from using such slice. I "fixed" this by booting from USB flash drive and dd-ing second sector with zeroes and now zfsloader runs just fine and starts installed FreeBSD 11 from the pool. This seems to me as bug in libstand, isn't it? From owner-svn-src-head@freebsd.org Thu Dec 21 18:30:13 2017 Return-Path: Delivered-To: svn-src-head@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 3318EE81760; Thu, 21 Dec 2017 18:30:13 +0000 (UTC) (envelope-from tychon@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 F13847258C; Thu, 21 Dec 2017 18:30:12 +0000 (UTC) (envelope-from tychon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLIUBnO075063; Thu, 21 Dec 2017 18:30:11 GMT (envelope-from tychon@FreeBSD.org) Received: (from tychon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLIUBYE075062; Thu, 21 Dec 2017 18:30:11 GMT (envelope-from tychon@FreeBSD.org) Message-Id: <201712211830.vBLIUBYE075062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tychon set sender to tychon@FreeBSD.org using -f From: Tycho Nightingale Date: Thu, 21 Dec 2017 18:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327065 - head/sys/amd64/vmm/intel X-SVN-Group: head X-SVN-Commit-Author: tychon X-SVN-Commit-Paths: head/sys/amd64/vmm/intel X-SVN-Commit-Revision: 327065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 18:30:13 -0000 Author: tychon Date: Thu Dec 21 18:30:11 2017 New Revision: 327065 URL: https://svnweb.freebsd.org/changeset/base/327065 Log: Recognize a pending virtual interrupt while emulating the halt instruction. Reviewed by: grehan, rgrimes Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D13573 Modified: head/sys/amd64/vmm/intel/vmx.c Modified: head/sys/amd64/vmm/intel/vmx.c ============================================================================== --- head/sys/amd64/vmm/intel/vmx.c Thu Dec 21 16:25:33 2017 (r327064) +++ head/sys/amd64/vmm/intel/vmx.c Thu Dec 21 18:30:11 2017 (r327065) @@ -3174,9 +3174,29 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) pir_desc = vlapic_vtx->pir_desc; pending = atomic_load_acq_long(&pir_desc->pending); - if (!pending) - return (0); /* common case */ + if (!pending) { + /* + * While a virtual interrupt may have already been + * processed the actual delivery maybe pending the + * interruptibility of the guest. Recognize a pending + * interrupt by reevaluating virtual interrupts + * following Section 29.2.1 in the Intel SDM Volume 3. + */ + uint64_t val; + uint8_t rvi, ppr; + vmx_getreg(vlapic_vtx->vmx, vlapic->vcpuid, + VMCS_IDENT(VMCS_GUEST_INTR_STATUS), &val); + rvi = val & APIC_TPR_INT; + lapic = vlapic->apic_page; + ppr = lapic->ppr & APIC_TPR_INT; + if (rvi > ppr) { + return (1); + } + + return (0); + } + /* * If there is an interrupt pending then it will be recognized only * if its priority is greater than the processor priority. @@ -3185,7 +3205,7 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) * interrupt will be recognized. */ lapic = vlapic->apic_page; - ppr = lapic->ppr & 0xf0; + ppr = lapic->ppr & APIC_TPR_INT; if (ppr == 0) return (1); @@ -3195,7 +3215,7 @@ vmx_pending_intr(struct vlapic *vlapic, int *vecptr) for (i = 3; i >= 0; i--) { pirval = pir_desc->pir[i]; if (pirval != 0) { - vpr = (i * 64 + flsl(pirval) - 1) & 0xf0; + vpr = (i * 64 + flsl(pirval) - 1) & APIC_TPR_INT; return (vpr > ppr); } } From owner-svn-src-head@freebsd.org Thu Dec 21 18:51:48 2017 Return-Path: Delivered-To: svn-src-head@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 657B9E82C4E; Thu, 21 Dec 2017 18:51:48 +0000 (UTC) (envelope-from imp@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 3D39873656; Thu, 21 Dec 2017 18:51:48 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLIpldA084269; Thu, 21 Dec 2017 18:51:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLIpl64084267; Thu, 21 Dec 2017 18:51:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712211851.vBLIpl64084267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Dec 2017 18:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327066 - head/usr.sbin/devinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devinfo X-SVN-Commit-Revision: 327066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 18:51:48 -0000 Author: imp Date: Thu Dec 21 18:51:47 2017 New Revision: 327066 URL: https://svnweb.freebsd.org/changeset/base/327066 Log: Implement "-p dev" to print the path to the given device back to the nexus. With redirection, could also be used to test if the device exists in the device tree. Sponsored by: Netflix Modified: head/usr.sbin/devinfo/devinfo.8 head/usr.sbin/devinfo/devinfo.c Modified: head/usr.sbin/devinfo/devinfo.8 ============================================================================== --- head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 18:30:11 2017 (r327065) +++ head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 18:51:47 2017 (r327066) @@ -38,6 +38,8 @@ .Op Fl rv .Nm .Fl u +.Nm +.Fl p dev .Sh DESCRIPTION The .Nm @@ -62,6 +64,8 @@ the IRQ consumers together. Display all devices in the driver tree, not just those that are attached or busy. Without this flag, only those devices that have attached are reported. +.It Fl p dev +Display the path of dev back to the root of the device tree. .El .Sh SEE ALSO .Xr systat 1 , Modified: head/usr.sbin/devinfo/devinfo.c ============================================================================== --- head/usr.sbin/devinfo/devinfo.c Thu Dec 21 18:30:11 2017 (r327065) +++ head/usr.sbin/devinfo/devinfo.c Thu Dec 21 18:51:47 2017 (r327066) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "devinfo.h" @@ -196,15 +197,47 @@ print_rman(struct devinfo_rman *rman, void *arg __unus return(0); } +static void __dead2 +usage(void) +{ + fprintf(stderr, "%s\n%s\n%s\n", + "usage: devinfo [-rv]", + " devinfo -u", + " devifno -p dev"); + exit(1); +} + + +static int +print_path(struct devinfo_dev *dev, void *xname) +{ + const char *name = xname; + int rv; + + if (strcmp(dev->dd_name, name) == 0) { + printf("%s", dev->dd_name); + return (1); + } + + rv = devinfo_foreach_device_child(dev, print_path, xname); + if (rv == 1) + printf(" %s", dev->dd_name[0] ? dev->dd_name : "unknown"); + return (rv); +} + int main(int argc, char *argv[]) { struct devinfo_dev *root; int c, uflag; + char *path; uflag = 0; - while ((c = getopt(argc, argv, "ruv")) != -1) { + while ((c = getopt(argc, argv, "p:ruv")) != -1) { switch(c) { + case 'p': + path = optarg; + break; case 'r': rflag++; break; @@ -215,21 +248,25 @@ main(int argc, char *argv[]) vflag++; break; default: - fprintf(stderr, "%s\n%s\n", - "usage: devinfo [-rv]", - " devinfo -u"); - exit(1); + usage(); } } + if (path && (rflag || uflag)) + usage(); + if (devinfo_init()) err(1, "devinfo_init"); if ((root = devinfo_handle_to_device(DEVINFO_ROOT_DEVICE)) == NULL) errx(1, "can't find root device"); - /* print resource usage? */ - if (uflag) { + if (path) { + if (devinfo_foreach_device_child(root, print_path, (void *)path) == 0) + errx(1, "%s: Not found", path); + printf("\n"); + } else if (uflag) { + /* print resource usage? */ devinfo_foreach_rman(print_rman, NULL); } else { /* print device hierarchy */ From owner-svn-src-head@freebsd.org Thu Dec 21 18:58:16 2017 Return-Path: Delivered-To: svn-src-head@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 59963E8334E; Thu, 21 Dec 2017 18:58:16 +0000 (UTC) (envelope-from imp@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 23D9073989; Thu, 21 Dec 2017 18:58:16 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLIwFOt087795; Thu, 21 Dec 2017 18:58:15 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLIwFgb087794; Thu, 21 Dec 2017 18:58:15 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712211858.vBLIwFgb087794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Dec 2017 18:58:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327067 - head/usr.sbin/devinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devinfo X-SVN-Commit-Revision: 327067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 18:58:16 -0000 Author: imp Date: Thu Dec 21 18:58:14 2017 New Revision: 327067 URL: https://svnweb.freebsd.org/changeset/base/327067 Log: Fix markup and bump .Dd. Modified: head/usr.sbin/devinfo/devinfo.8 Modified: head/usr.sbin/devinfo/devinfo.8 ============================================================================== --- head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 18:51:47 2017 (r327066) +++ head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 18:58:14 2017 (r327067) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 28, 2005 +.Dd December 21, 2017 .Dt DEVINFO 8 .Os .Sh NAME @@ -39,7 +39,7 @@ .Nm .Fl u .Nm -.Fl p dev +.Fl p Ar dev .Sh DESCRIPTION The .Nm @@ -64,8 +64,10 @@ the IRQ consumers together. Display all devices in the driver tree, not just those that are attached or busy. Without this flag, only those devices that have attached are reported. -.It Fl p dev -Display the path of dev back to the root of the device tree. +.It Fl p Ar dev +Display the path of +.Ar dev +back to the root of the device tree. .El .Sh SEE ALSO .Xr systat 1 , From owner-svn-src-head@freebsd.org Thu Dec 21 19:19:44 2017 Return-Path: Delivered-To: svn-src-head@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 AFA0DE846BB; Thu, 21 Dec 2017 19:19:44 +0000 (UTC) (envelope-from imp@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 8697074581; Thu, 21 Dec 2017 19:19:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLJJhnr096001; Thu, 21 Dec 2017 19:19:43 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLJJhsY095999; Thu, 21 Dec 2017 19:19:43 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712211919.vBLJJhsY095999@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Thu, 21 Dec 2017 19:19:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327068 - head/usr.sbin/devinfo X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.sbin/devinfo X-SVN-Commit-Revision: 327068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 19:19:44 -0000 Author: imp Date: Thu Dec 21 19:19:43 2017 New Revision: 327068 URL: https://svnweb.freebsd.org/changeset/base/327068 Log: When -v is specified with -p dev, print the same verbose output as when listing the whole tree. The list, however, is from the requested device to the root (so it backwards from the normal tree). Sponsored by: Netflix Modified: head/usr.sbin/devinfo/devinfo.8 head/usr.sbin/devinfo/devinfo.c Modified: head/usr.sbin/devinfo/devinfo.8 ============================================================================== --- head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 18:58:14 2017 (r327067) +++ head/usr.sbin/devinfo/devinfo.8 Thu Dec 21 19:19:43 2017 (r327068) @@ -39,7 +39,7 @@ .Nm .Fl u .Nm -.Fl p Ar dev +.Fl p Ar dev Op Fl v .Sh DESCRIPTION The .Nm @@ -64,6 +64,7 @@ the IRQ consumers together. Display all devices in the driver tree, not just those that are attached or busy. Without this flag, only those devices that have attached are reported. +This flag also displays verbose information about each device. .It Fl p Ar dev Display the path of .Ar dev Modified: head/usr.sbin/devinfo/devinfo.c ============================================================================== --- head/usr.sbin/devinfo/devinfo.c Thu Dec 21 18:58:14 2017 (r327067) +++ head/usr.sbin/devinfo/devinfo.c Thu Dec 21 19:19:43 2017 (r327068) @@ -131,6 +131,22 @@ print_device_rman_resources(struct devinfo_rman *rman, return(0); } +static void +print_dev(struct devinfo_dev *dev) +{ + + printf("%s", dev->dd_name[0] ? dev->dd_name : "unknown"); + if (vflag && *dev->dd_pnpinfo) + printf(" pnpinfo %s", dev->dd_pnpinfo); + if (vflag && *dev->dd_location) + printf(" at %s", dev->dd_location); + if (!(dev->dd_flags & DF_ENABLED)) + printf(" (disabled)"); + else if (dev->dd_flags & DF_SUSPENDED) + printf(" (suspended)"); +} + + /* * Print information about a device. */ @@ -144,15 +160,7 @@ print_device(struct devinfo_dev *dev, void *arg) indent = (int)(intptr_t)arg; for (i = 0; i < indent; i++) printf(" "); - printf("%s", dev->dd_name[0] ? dev->dd_name : "unknown"); - if (vflag && *dev->dd_pnpinfo) - printf(" pnpinfo %s", dev->dd_pnpinfo); - if (vflag && *dev->dd_location) - printf(" at %s", dev->dd_location); - if (!(dev->dd_flags & DF_ENABLED)) - printf(" (disabled)"); - else if (dev->dd_flags & DF_SUSPENDED) - printf(" (suspended)"); + print_dev(dev); printf("\n"); if (rflag) { ia.indent = indent + 4; @@ -197,17 +205,6 @@ print_rman(struct devinfo_rman *rman, void *arg __unus return(0); } -static void __dead2 -usage(void) -{ - fprintf(stderr, "%s\n%s\n%s\n", - "usage: devinfo [-rv]", - " devinfo -u", - " devifno -p dev"); - exit(1); -} - - static int print_path(struct devinfo_dev *dev, void *xname) { @@ -215,22 +212,38 @@ print_path(struct devinfo_dev *dev, void *xname) int rv; if (strcmp(dev->dd_name, name) == 0) { - printf("%s", dev->dd_name); + print_dev(dev); + if (vflag) + printf("\n"); return (1); } rv = devinfo_foreach_device_child(dev, print_path, xname); - if (rv == 1) - printf(" %s", dev->dd_name[0] ? dev->dd_name : "unknown"); + if (rv == 1) { + printf(" "); + print_dev(dev); + if (vflag) + printf("\n"); + } return (rv); } +static void __dead2 +usage(void) +{ + fprintf(stderr, "%s\n%s\n%s\n", + "usage: devinfo [-rv]", + " devinfo -u", + " devifno -p dev [-v]"); + exit(1); +} + int main(int argc, char *argv[]) { struct devinfo_dev *root; int c, uflag; - char *path; + char *path = NULL; uflag = 0; while ((c = getopt(argc, argv, "p:ruv")) != -1) { @@ -264,7 +277,8 @@ main(int argc, char *argv[]) if (path) { if (devinfo_foreach_device_child(root, print_path, (void *)path) == 0) errx(1, "%s: Not found", path); - printf("\n"); + if (!vflag) + printf("\n"); } else if (uflag) { /* print resource usage? */ devinfo_foreach_rman(print_rman, NULL); From owner-svn-src-head@freebsd.org Thu Dec 21 23:05:15 2017 Return-Path: Delivered-To: svn-src-head@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 2FA79E919E5; Thu, 21 Dec 2017 23:05:15 +0000 (UTC) (envelope-from kib@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 EE0417CE30; Thu, 21 Dec 2017 23:05:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLN5DER091405; Thu, 21 Dec 2017 23:05:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLN5Did091404; Thu, 21 Dec 2017 23:05:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712212305.vBLN5Did091404@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Dec 2017 23:05:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327072 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 23:05:15 -0000 Author: kib Date: Thu Dec 21 23:05:13 2017 New Revision: 327072 URL: https://svnweb.freebsd.org/changeset/base/327072 Log: Fix build for kernels with SCHED_4BSD. Sponsored by: The FreeBSD Foundation Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Dec 21 22:48:02 2017 (r327071) +++ head/sys/net/iflib.c Thu Dec 21 23:05:13 2017 (r327072) @@ -5127,7 +5127,7 @@ find_thread(int cpu, int thread_num) static int find_thread(int cpu, int thread_num __unused) { - return cpu_id; + return cpu; } #endif From owner-svn-src-head@freebsd.org Thu Dec 21 23:08:12 2017 Return-Path: Delivered-To: svn-src-head@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 13CEFE91C7C; Thu, 21 Dec 2017 23:08:12 +0000 (UTC) (envelope-from kib@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 D20DB7D06D; Thu, 21 Dec 2017 23:08:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLN8AWe091537; Thu, 21 Dec 2017 23:08:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLN8AWr091536; Thu, 21 Dec 2017 23:08:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712212308.vBLN8AWr091536@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Dec 2017 23:08:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327073 - head/sys/fs/nfsclient X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/fs/nfsclient X-SVN-Commit-Revision: 327073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 23:08:12 -0000 Author: kib Date: Thu Dec 21 23:08:10 2017 New Revision: 327073 URL: https://svnweb.freebsd.org/changeset/base/327073 Log: Fix build for LP64 arches with gcc. gcc complaints that the comparision is always false due to the value range, and the cast does not prevent the analysis. Split the LP64 vs. ILP32 clamping as a workaround. Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/nfsclient/nfs_clvnops.c Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 21 23:05:13 2017 (r327072) +++ head/sys/fs/nfsclient/nfs_clvnops.c Thu Dec 21 23:08:10 2017 (r327073) @@ -3461,7 +3461,11 @@ nfs_pathconf(struct vop_pathconf_args *ap) } switch (ap->a_name) { case _PC_LINK_MAX: +#ifdef _LP64 + *ap->a_retval = pc.pc_linkmax; +#else *ap->a_retval = MIN(LONG_MAX, pc.pc_linkmax); +#endif break; case _PC_NAME_MAX: *ap->a_retval = pc.pc_namemax; From owner-svn-src-head@freebsd.org Thu Dec 21 23:39:01 2017 Return-Path: Delivered-To: svn-src-head@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 DBCCDE9362E; Thu, 21 Dec 2017 23:39:01 +0000 (UTC) (envelope-from kib@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 B28617E001; Thu, 21 Dec 2017 23:39:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBLNd0cR004112; Thu, 21 Dec 2017 23:39:00 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBLNd0nE004110; Thu, 21 Dec 2017 23:39:00 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712212339.vBLNd0nE004110@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Dec 2017 23:39:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327074 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 327074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 Dec 2017 23:39:02 -0000 Author: kib Date: Thu Dec 21 23:39:00 2017 New Revision: 327074 URL: https://svnweb.freebsd.org/changeset/base/327074 Log: Fix mips build after introduction of MD definitions of atomic_load_64 and atomic_store_64. The MD definitions are provided for LP64 only, while mips also uses them for 32bit and n32. Only define mips variants for 32bit and n32 and change the syntax to match common definitions. Note that this commit does not fix 32bit asm implementation to follow new KBI, this will be fixed later. The functions are only used for 8 byte ddb accesses so the known bug does not prevent normal kernel operations. Sponsored by: The FreeBSD Foundation Modified: head/sys/mips/include/atomic.h head/sys/mips/mips/db_interface.c Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Thu Dec 21 23:08:10 2017 (r327073) +++ head/sys/mips/include/atomic.h Thu Dec 21 23:39:00 2017 (r327074) @@ -342,20 +342,21 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) #if !defined(__mips_n64) && !defined(__mips_n32) -void atomic_store_64(__volatile uint64_t *, uint64_t *); -void atomic_load_64(__volatile uint64_t *, uint64_t *); -#else +void atomic_store_64(__volatile uint64_t *, uint64_t); +uint64_t atomic_load_64(__volatile uint64_t *); +#elif defined (__mips_n32) static __inline void -atomic_store_64(__volatile uint64_t *p, uint64_t *v) +atomic_store_64(__volatile uint64_t *p, uint64_t v) { - *p = *v; + *p = v; } -static __inline void -atomic_load_64(__volatile uint64_t *p, uint64_t *v) +static __inline uint64_t +atomic_load_64(__volatile uint64_t *p) { - *v = *p; + return (*p); } +/* #else atomic_common.h definitions of atomic_load/store_64 are used */ #endif #undef ATOMIC_STORE_LOAD Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Thu Dec 21 23:08:10 2017 (r327073) +++ head/sys/mips/mips/db_interface.c Thu Dec 21 23:39:00 2017 (r327074) @@ -164,9 +164,9 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat *(uint32_t *)data = *(uint32_t *)addr; break; case 8: - atomic_load_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + *(uint64_t *)data = atomic_load_64( + (void *)addr); + break; } } else { char *src; @@ -207,9 +207,9 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da *(uint32_t *)addr = *(uint32_t *)data; break; case 8: - atomic_store_64((volatile u_int64_t *)addr, - (u_int64_t *)data); - break; + atomic_store_64((uint64_t *)addr, + *(uint64_t *)data); + break; } } else { char *dst; From owner-svn-src-head@freebsd.org Fri Dec 22 01:46:27 2017 Return-Path: Delivered-To: svn-src-head@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 2BB84E9A83A; Fri, 22 Dec 2017 01:46:27 +0000 (UTC) (envelope-from kevlo@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 EAB861AE5; Fri, 22 Dec 2017 01:46:26 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBM1kQhZ057631; Fri, 22 Dec 2017 01:46:26 GMT (envelope-from kevlo@FreeBSD.org) Received: (from kevlo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBM1kQsw057630; Fri, 22 Dec 2017 01:46:26 GMT (envelope-from kevlo@FreeBSD.org) Message-Id: <201712220146.vBM1kQsw057630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevlo set sender to kevlo@FreeBSD.org using -f From: Kevin Lo Date: Fri, 22 Dec 2017 01:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327075 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: kevlo X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 327075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 01:46:27 -0000 Author: kevlo Date: Fri Dec 22 01:46:25 2017 New Revision: 327075 URL: https://svnweb.freebsd.org/changeset/base/327075 Log: Add soft float abi caching form armv7, it would allow people with old binaries to run them. Reviewed by: imp Modified: head/etc/rc.d/ldconfig Modified: head/etc/rc.d/ldconfig ============================================================================== --- head/etc/rc.d/ldconfig Thu Dec 21 23:39:00 2017 (r327074) +++ head/etc/rc.d/ldconfig Fri Dec 22 01:46:25 2017 (r327075) @@ -63,7 +63,7 @@ ldconfig_start() esac case `sysctl -n hw.machine_arch` in - armv6) + armv[67]) for i in ${ldconfig_localsoft_dirs}; do if [ -d "${i}" ]; then _files=`find ${i} -type f` From owner-svn-src-head@freebsd.org Fri Dec 22 12:03:39 2017 Return-Path: Delivered-To: svn-src-head@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 EFCB9E941C8; Fri, 22 Dec 2017 12:03:39 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 752B8740FC; Fri, 22 Dec 2017 12:03:39 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id F1CD292F; Fri, 22 Dec 2017 14:58:25 +0300 (MSK) Date: Fri, 22 Dec 2017 14:58:25 +0300 From: Oleg Bulyzhin To: Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327013 - head/sys/net Message-ID: <20171222115825.GA69149@lath.RINET.ru> References: <201712200103.vBK13YgS025896@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201712200103.vBK13YgS025896@repo.freebsd.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 12:03:40 -0000 On Wed, Dec 20, 2017 at 01:03:34AM +0000, Stephen Hurd wrote: > Author: shurd > Date: Wed Dec 20 01:03:34 2017 > New Revision: 327013 > URL: https://svnweb.freebsd.org/changeset/base/327013 > > Log: > Support attaching tx queues to cpus > > This will attempt to use a different thread/core on the same L2 > cache when possible, or use the same cpu as the rx thread when not. > If SMP isn't enabled, don't go looking for cores to use. This is mostly > useful when using shared TX/RX queues. > > Reviewed by: sbruno > Sponsored by: Limelight Networks > Differential Revision: https://reviews.freebsd.org/D12446 i'm getting this panic: [skipped] ix0: port 0xcc00-0xcc1f mem 0xfde80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 ix0: using 2048 tx descriptors and 2048 rx descriptors ix0: msix_init qsets capped at 16 ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 ix0: using 4 rx queues 4 tx queues ix0: attempting to allocate 5 MSI-X vectors (64 supported) msi: routing MSI-X IRQ 259 to local APIC 0 vector 54 msi: routing MSI-X IRQ 260 to local APIC 0 vector 55 msi: routing MSI-X IRQ 261 to local APIC 0 vector 56 msi: routing MSI-X IRQ 262 to local APIC 0 vector 57 msi: routing MSI-X IRQ 263 to local APIC 0 vector 58 ix0: using IRQs 259-263 for MSI-X ix0: Using MSIX interrupts with 5 vectors ix0: allocated for 4 queues ix0: allocated for 4 rx queues panic: Assertion gtask->gt_taskqueue != NULL failed at /usr/src/sys/net/iflib.c:5177 cpuid = 0 time = 1 KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> bt Tracing pid 0 tid 100000 td 0xffffffff80bf63c0 kdb_enter() at kdb_enter+0x3b/frame 0xffffffff81004130 vpanic() at vpanic+0x1b9/frame 0xffffffff810041b0 kassert_panic() at kassert_panic+0x173/frame 0xffffffff81004220 iflib_irq_set_affinity() at iflib_irq_set_affinity+0xae2/frame 0xffffffff810042e0 iflib_irq_alloc_generic() at iflib_irq_alloc_generic+0x1f7/frame 0xffffffff81004350 ixgbe_if_msix_intr_assign() at ixgbe_if_msix_intr_assign+0xa2/frame 0xffffffff810043d0 iflib_device_register() at iflib_device_register+0x2a6a/frame 0xffffffff810046f0 iflib_device_attach() at iflib_device_attach+0xb7/frame 0xffffffff81004720 device_attach() at device_attach+0x3f7/frame 0xffffffff81004770 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004790 pci_attach() at pci_attach+0xd5/frame 0xffffffff810047d0 device_attach() at device_attach+0x3f7/frame 0xffffffff81004820 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004840 acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0xa1/frame 0xffffffff81004880 device_attach() at device_attach+0x3f7/frame 0xffffffff810048d0 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff810048f0 pci_attach() at pci_attach+0xd5/frame 0xffffffff81004930 device_attach() at device_attach+0x3f7/frame 0xffffffff81004980 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff810049a0 acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x3bc/frame 0xffffffff81004a10 device_attach() at device_attach+0x3f7/frame 0xffffffff81004a60 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004a80 acpi_attach() at acpi_attach+0xe85/frame 0xffffffff81004b30 device_attach() at device_attach+0x3f7/frame 0xffffffff81004b80 bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004ba0 nexus_acpi_attach() at nexus_acpi_attach+0x73/frame 0xffffffff81004bd0 device_attach() at device_attach+0x3f7/frame 0xffffffff81004c20 bus_generic_new_pass() at bus_generic_new_pass+0x116/frame 0xffffffff81004c50 bus_set_pass() at bus_set_pass+0x8c/frame 0xffffffff81004c80 configure() at configure+0x9/frame 0xffffffff81004c90 mi_startup() at mi_startup+0x9c/frame 0xffffffff81004cb0 btext() at btext+0x2c -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-head@freebsd.org Fri Dec 22 16:59:51 2017 Return-Path: Delivered-To: svn-src-head@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 7F81BEA456C; Fri, 22 Dec 2017 16:59:51 +0000 (UTC) (envelope-from imp@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 4BE7E7E2B3; Fri, 22 Dec 2017 16:59:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMGxonV038448; Fri, 22 Dec 2017 16:59:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMGxoUH038447; Fri, 22 Dec 2017 16:59:50 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712221659.vBMGxoUH038447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Dec 2017 16:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327084 - head/sys/dev/pccard X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/pccard X-SVN-Commit-Revision: 327084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 16:59:51 -0000 Author: imp Date: Fri Dec 22 16:59:50 2017 New Revision: 327084 URL: https://svnweb.freebsd.org/changeset/base/327084 Log: PC Card PNP tables are terminated by a NULL sentinel. This shouldn't be recorded in the linker hints, so subtract one to omit it. Modified: head/sys/dev/pccard/pccardvar.h Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:27:29 2017 (r327083) +++ head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:59:50 2017 (r327084) @@ -95,7 +95,7 @@ struct pccard_product { */ #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" #define PCCARD_PNP_INFO(t) \ - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); \ + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]) - 1); \ typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); From owner-svn-src-head@freebsd.org Fri Dec 22 17:13:55 2017 Return-Path: Delivered-To: svn-src-head@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 8A6C1EA539D; Fri, 22 Dec 2017 17:13:55 +0000 (UTC) (envelope-from imp@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 57CBA7EFA3; Fri, 22 Dec 2017 17:13:55 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMHDso6046803; Fri, 22 Dec 2017 17:13:54 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMHDs4Q046802; Fri, 22 Dec 2017 17:13:54 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712221713.vBMHDs4Q046802@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Dec 2017 17:13:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327085 - head/sys/dev/fdc X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/fdc X-SVN-Commit-Revision: 327085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 17:13:55 -0000 Author: imp Date: Fri Dec 22 17:13:54 2017 New Revision: 327085 URL: https://svnweb.freebsd.org/changeset/base/327085 Log: Need to NULL terminate this list. It worked before by accidental data in the module following it that terminated the search. Modified: head/sys/dev/fdc/fdc_pccard.c Modified: head/sys/dev/fdc/fdc_pccard.c ============================================================================== --- head/sys/dev/fdc/fdc_pccard.c Fri Dec 22 16:59:50 2017 (r327084) +++ head/sys/dev/fdc/fdc_pccard.c Fri Dec 22 17:13:54 2017 (r327085) @@ -49,6 +49,7 @@ static int fdc_pccard_attach(device_t); static const struct pccard_product fdc_pccard_products[] = { PCMCIA_CARD(YEDATA, EXTERNAL_FDD), + { NULL } }; static int From owner-svn-src-head@freebsd.org Fri Dec 22 17:15:03 2017 Return-Path: Delivered-To: svn-src-head@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 958A2EA54AE; Fri, 22 Dec 2017 17:15:03 +0000 (UTC) (envelope-from pfg@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 620157F12C; Fri, 22 Dec 2017 17:15:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMHF2I4046896; Fri, 22 Dec 2017 17:15:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMHF27m046894; Fri, 22 Dec 2017 17:15:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201712221715.vBMHF27m046894@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 22 Dec 2017 17:15:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327086 - head/sys/dev/lmc X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/sys/dev/lmc X-SVN-Commit-Revision: 327086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 17:15:03 -0000 Author: pfg Date: Fri Dec 22 17:15:02 2017 New Revision: 327086 URL: https://svnweb.freebsd.org/changeset/base/327086 Log: SPDX: Reverse License ID tags from the lmc driver. While the BSD-2-Clause license is there, the GPLv2 is also present. I am unsure of the implications of having both licenses as they are here. I'll just leave it untagged and open for interpretation. Modified: head/sys/dev/lmc/if_lmc.c head/sys/dev/lmc/if_lmc.h Modified: head/sys/dev/lmc/if_lmc.c ============================================================================== --- head/sys/dev/lmc/if_lmc.c Fri Dec 22 17:13:54 2017 (r327085) +++ head/sys/dev/lmc/if_lmc.c Fri Dec 22 17:15:02 2017 (r327086) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * $FreeBSD$ * * Copyright (c) 2002-2004 David Boggs. Modified: head/sys/dev/lmc/if_lmc.h ============================================================================== --- head/sys/dev/lmc/if_lmc.h Fri Dec 22 17:13:54 2017 (r327085) +++ head/sys/dev/lmc/if_lmc.h Fri Dec 22 17:15:02 2017 (r327086) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * $FreeBSD$ * * Copyright (c) 2002-2004 David Boggs. (boggs@boggs.palo-alto.ca.us) From owner-svn-src-head@freebsd.org Fri Dec 22 17:31:03 2017 Return-Path: Delivered-To: svn-src-head@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 23146EA605D; Fri, 22 Dec 2017 17:31:03 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mx0b-0010f301.pphosted.com (mx0b-0010f301.pphosted.com [148.163.153.244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF8CA7FC41; Fri, 22 Dec 2017 17:31:02 +0000 (UTC) (envelope-from alc@rice.edu) Received: from pps.filterd (m0102859.ppops.net [127.0.0.1]) by mx0b-0010f301.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vBMHQUaE015630; Fri, 22 Dec 2017 11:31:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rice.edu; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=ricemail; bh=lNOxlsPQ78flGiKNbLRZCXG5fhAyW7VqF0kuQeR5W7A=; b=V2Gn3XzazaxI3pwvLt1xU50Q7RHrkWsRky0f7BFsLrH38FdSJaSkwhsy+DpefmUqafLC OhmOAve3PbkL+V8SJQCaFRGzElKek6PAAutWfuWCGOCH60RwR/m5yB/tJCcsA/z150av wnNFSetyMymEDK78jUhu2EvMTx5wEriclFOm7kSh5SvWG6n8ScCFk7qQ/jx9PrcNcy9o vh+jKlbf4V5Rl9ghQDrpy0pLvgRZjryE5ghWklKaUbrFov2I1mPkCvoWVe1aA9iPkK2T DWYaN8sdcCNUbUYeSoTrjsWFsK2EOwWCMI2wBwJycvSsoo8scsXa3ANWSWoD7iiUi16Z 1w== Received: from mh11.mail.rice.edu (mh11.mail.rice.edu [128.42.199.30]) by mx0b-0010f301.pphosted.com with ESMTP id 2eyanu43xf-1; Fri, 22 Dec 2017 11:31:00 -0600 Received-X: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 065564C07BE; Fri, 22 Dec 2017 11:31:00 -0600 (CST) Received-X: from mh11.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh11.mail.rice.edu (Postfix) with ESMTP id 0473E4C07AC; Fri, 22 Dec 2017 11:31:00 -0600 (CST) X-Virus-Scanned: by amavis-2.7.0 at mh11.mail.rice.edu, auth channel Received-X: from mh11.mail.rice.edu ([127.0.0.1]) by mh11.mail.rice.edu (mh11.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id zy4n5eQChmWT; Fri, 22 Dec 2017 11:30:59 -0600 (CST) Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh11.mail.rice.edu (Postfix) with ESMTPSA id 927124C06CA; Fri, 22 Dec 2017 11:30:59 -0600 (CST) Subject: Re: svn commit: r326982 - head/share/man/man9 To: Bruce Evans , Alan Cox Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201712191707.vBJH7onm015225@repo.freebsd.org> <20171220132345.S1291@besplex.bde.org> From: Alan Cox Message-ID: Date: Fri, 22 Dec 2017 11:30:59 -0600 User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20171220132345.S1291@besplex.bde.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-12-22_06:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=13 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=357 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1712220246 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 17:31:03 -0000 On 12/19/2017 21:00, Bruce Evans wrote: > On Tue, 19 Dec 2017, Alan Cox wrote: > >> Log: >> ... >> Reorder and revise some of the existing text. For example, more >> precisely describe when ordinary accesses are atomic. >> ... >> Modified: head/share/man/man9/atomic.9 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> >> --- head/share/man/man9/atomic.9 Tue Dec 19 16:45:40 2017 =20 >> (r326981) >> +++ head/share/man/man9/atomic.9 Tue Dec 19 17:07:50 2017 =20 >> (r326982) >> ... >> @@ -147,8 +149,7 @@ unsigned 8-bit integer >> unsigned 16-bit integer >> .El >> .Pp >> -These must not be used in MI code because the instructions to >> implement them >> -efficiently might not be available. >> +These types must not be used in machine-independent code. > > Example of normal use of "must". It is a requirement forthe caller. > >> .Pp >> -When an atomic operation has acquire semantics, the effects of the >> operation >> -must have completed before any subsequent load or store (by program >> order) is >> +When an atomic operation has acquire semantics, the operation must ha= ve >> +completed before any subsequent load or store (by program order) is > > Most other uses of "must" are requirements for the implementation. Thi= s > commit seemed to introduce this misuse, but I just noticed that it was > common and this commit only increased it a lot. > > POSIX uses "shall" a lot for requirements on the implementation. This = is > at best noise if it is copied to man pages, and we have the > /usr/share/examples/mdoc/deshallify.sh script for removing the noise, > e.g., by s/shall be/is/g (with complications or singular vs plural...).= > This is rarely used since the otherwise better wording in POSIX is rare= ly > used in FreeBSD man pages, but the man pages are fairly shall-free, wit= h > most shalls being for requirements related to copyrights. > > s/must have competed/completes/g seems to be a correct demustification > for > the above. atomic.9 has to be more careful with tenses than most man > pages > since it is half about delicate ordering, so I wouldn't trust automatic= > translation of irregular verbs. It would be better to describe the > ordering using symbols like <=3D than with words like "before" and > complicated verbs.=20 Okay, I'll take a look at this. From owner-svn-src-head@freebsd.org Fri Dec 22 17:52:40 2017 Return-Path: Delivered-To: svn-src-head@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 23049EA6FD6; Fri, 22 Dec 2017 17:52:40 +0000 (UTC) (envelope-from kib@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 E2D0F80ACB; Fri, 22 Dec 2017 17:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMHqdXb063409; Fri, 22 Dec 2017 17:52:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMHqdhV063408; Fri, 22 Dec 2017 17:52:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712221752.vBMHqdhV063408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Dec 2017 17:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327088 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 327088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 17:52:40 -0000 Author: kib Date: Fri Dec 22 17:52:38 2017 New Revision: 327088 URL: https://svnweb.freebsd.org/changeset/base/327088 Log: Update HISTORY section for the atomic(9) page. In collaboration with: alc Sponsored by: The FreeBSD Foundation (kib) MFC after: 1 week Modified: head/share/man/man9/atomic.9 Modified: head/share/man/man9/atomic.9 ============================================================================== --- head/share/man/man9/atomic.9 Fri Dec 22 17:19:08 2017 (r327087) +++ head/share/man/man9/atomic.9 Fri Dec 22 17:52:38 2017 (r327088) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2017 +.Dd December 22, 2017 .Dt ATOMIC 9 .Os .Sh NAME @@ -175,8 +175,11 @@ and semantics. .Pp Atomic operations on memory have up to three variants. -The first variant performs the operation without imposing any ordering -constraints on memory accesses to other locations. +The first, or +.Em relaxed +variant, performs the operation without imposing any ordering constraints on +accesses to other memory locations. +This variant is the default. The second variant has acquire semantics, and the third variant has release semantics. .Pp @@ -546,43 +549,54 @@ The .Fn atomic_set , and .Fn atomic_subtract -operations were first introduced in +operations were introduced in .Fx 3.0 . -This first set only supported the types +Initially, these operations were defined on the types .Dq Li char , .Dq Li short , .Dq Li int , and .Dq Li long . +.Pp The .Fn atomic_cmpset , -.Fn atomic_load , +.Fn atomic_load_acq , .Fn atomic_readandclear , and -.Fn atomic_store +.Fn atomic_store_rel operations were added in .Fx 5.0 . -The types +Simultaneously, the acquire and release variants were introduced, and +support was added for operation on the types .Dq Li 8 , .Dq Li 16 , .Dq Li 32 , .Dq Li 64 , and -.Dq Li ptr -and all of the acquire and release variants -were added in -.Fx 5.0 -as well. +.Dq Li ptr . +.Pp The .Fn atomic_fetchadd -operations were added in +operation was added in .Fx 6.0 . +.Pp The .Fn atomic_swap and .Fn atomic_testandset operations were added in .Fx 10.0 . +.Pp +The .Fn atomic_testandclear -operation was added in +and +.Fn atomic_thread_fence +operations were added in .Fx 11.0 . +.Pp +The relaxed variants of +.Fn atomic_load +and +.Fn atomic_store +were added in +.Fx 12.0 . From owner-svn-src-head@freebsd.org Fri Dec 22 17:53:29 2017 Return-Path: Delivered-To: svn-src-head@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 CE475E800C1; Fri, 22 Dec 2017 17:53:29 +0000 (UTC) (envelope-from imp@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 A861B80C2B; Fri, 22 Dec 2017 17:53:29 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMHrSx4063487; Fri, 22 Dec 2017 17:53:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMHrStl063480; Fri, 22 Dec 2017 17:53:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712221753.vBMHrStl063480@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Dec 2017 17:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327089 - in head/sys: dev/drm2/i915 dev/drm2/radeon dev/ed dev/intpm dev/ioat dev/ntb/ntb_hw net X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/drm2/i915 dev/drm2/radeon dev/ed dev/intpm dev/ioat dev/ntb/ntb_hw net X-SVN-Commit-Revision: 327089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 17:53:29 -0000 Author: imp Date: Fri Dec 22 17:53:27 2017 New Revision: 327089 URL: https://svnweb.freebsd.org/changeset/base/327089 Log: Use '#' rather than some made up name for fields we want to ignore. Modified: head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/intpm/intpm.c head/sys/dev/ioat/ioat.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c head/sys/net/iflib.h Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:53:27 2017 (r327089) @@ -1236,7 +1236,7 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1); MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); MODULE_DEPEND(i915kms, iic, 1, 1, 1); MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, i915, pciidlist, +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); /* We give fast paths for the really cool registers */ Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:53:27 2017 (r327089) @@ -401,5 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms, +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:@", vgapci, radeonkms, pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:53:27 2017 (r327089) @@ -145,6 +145,6 @@ static driver_t ed_pci_driver = { DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids, sizeof(pci_ids[0]), +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ed, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids) - 1); Modified: head/sys/dev/intpm/intpm.c ============================================================================== --- head/sys/dev/intpm/intpm.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/intpm/intpm.c Fri Dec 22 17:53:27 2017 (r327089) @@ -895,5 +895,5 @@ DRIVER_MODULE_ORDERED(intsmb, pci, intsmb_driver, ints DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0); MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); MODULE_VERSION(intsmb, 1); -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, intpm, intsmb_products, +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products, sizeof(intsmb_products[0]), nitems(intsmb_products)); Modified: head/sys/dev/ioat/ioat.c ============================================================================== --- head/sys/dev/ioat/ioat.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/ioat/ioat.c Fri Dec 22 17:53:27 2017 (r327089) @@ -240,7 +240,7 @@ static struct _pcsid { 0x20218086, "SKX IOAT" }, }; -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ioat, pci_ids, +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids)); /* Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:53:27 2017 (r327089) @@ -3119,5 +3119,5 @@ static DEFINE_CLASS_0(ntb_hw, ntb_intel_driver, ntb_in DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL, NULL); MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); MODULE_VERSION(ntb_hw_intel, 1); -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ntb_hw_intel, pci_ids, +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ntb_hw_intel, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids)); Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Fri Dec 22 17:52:38 2017 (r327088) +++ head/sys/net/iflib.h Fri Dec 22 17:53:27 2017 (r327089) @@ -174,7 +174,7 @@ typedef struct pci_vendor_info { #define PVID_END {0, 0, 0, 0, 0, 0, NULL} #define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ - "U32:revision;U32:class;D:human" + "U32:revision;U32:class;D:#" #define IFLIB_PNP_INFO(b, u, t) \ MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t)) From owner-svn-src-head@freebsd.org Fri Dec 22 18:12:59 2017 Return-Path: Delivered-To: svn-src-head@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 ABBFCE81046 for ; Fri, 22 Dec 2017 18:12:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E18919DE for ; Fri, 22 Dec 2017 18:12:59 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-wm0-x234.google.com with SMTP id b199so23413122wme.1 for ; Fri, 22 Dec 2017 10:12:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=17Z+qi2vywWV5X4u42j1Sxty/ylNDhMI3eP+4jAm1FQ=; b=IzQO0j9NDFSPK8MU1NLmLzxxSGU30e/ckySNXWMgrGrXeipxfEqgWeDoQQJdsMlZgI PWz0O0AFbgCGOaDly5sltaoq7L1vCVc/NiU3Rm8suh3RwXZlYHe5B1zj/0xZX5PxZGIO AcUOB4E2/tyMctp/Dq6mebiT+nb7LfJovQZ7qaH9Pxob1b36HdtmnG0voma/iBo/BJh6 BZVRfk/+i4WbPUOrodXPvhVPIb6bwQc3p3wNUW0lbLIljgJHYmGCh1HnwaNQbiUJfZcJ gUOFPy3O4bEAtuFOOzxKuBORXdcSS5PhVrPiDbA6LGtYgKH3E0PE1ZV7Zx3WHfAmOhXS Dd0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=17Z+qi2vywWV5X4u42j1Sxty/ylNDhMI3eP+4jAm1FQ=; b=Iyc3MvZy81NM4VXlCAtfLFtizSh8BSG8MJu7RsSDdoFy1e27zwmSCUTkq2RoXATpvC MflNbPVHMUdFTmqvgt0/KaYrPVi7cixLd9hmm1VyEHZGaRR0e3nY4KV42tPYxhQa5nrr DyEOg96TFqsp8tzmBHSiHpNXJrwLpbeHbdevunITlEbfWfK1HJJF77UJCbqhO6Q7byV+ i/CuagOS2u+Gt+DiUOBHIiyjTZEgNWy5nZaz9jNl7lEBw10+L70NyGrydOB0bnpRlVb/ lH00mEkDS+/2aZ6e98O1hB+flttIj5EJKbbHp5914g92q4oSNuQsCGHpYZ3qpxGovArQ /C2g== X-Gm-Message-State: AKGB3mJZlPgJdZlLagh2jVHbxgjn6GIpquQkGfF9To6q7NugwNKvtv+U D9jc+yThK+Wlow8D9aRtWJwvmp4Ofcb7OsuhLymoPQ== X-Google-Smtp-Source: ACJfBov4nH+eC/nEdPGnbc9G+xUUxN3LFEbZs5LlbpsxT/2/G3vZKTy/Cmb4JxPdrHkJNwF8ViO8OqOCPo4UdqaBp7s= X-Received: by 10.80.145.195 with SMTP id h3mr16719072eda.240.1513966377483; Fri, 22 Dec 2017 10:12:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.149.174 with HTTP; Fri, 22 Dec 2017 10:12:56 -0800 (PST) In-Reply-To: <201712221753.vBMHrStl063480@repo.freebsd.org> References: <201712221753.vBMHrStl063480@repo.freebsd.org> From: Oliver Pinter Date: Fri, 22 Dec 2017 19:12:56 +0100 Message-ID: Subject: Re: svn commit: r327089 - in head/sys: dev/drm2/i915 dev/drm2/radeon dev/ed dev/intpm dev/ioat dev/ntb/ntb_hw net To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 18:12:59 -0000 On 12/22/17, Warner Losh wrote: > Author: imp > Date: Fri Dec 22 17:53:27 2017 > New Revision: 327089 > URL: https://svnweb.freebsd.org/changeset/base/327089 > > Log: > Use '#' rather than some made up name for fields we want to ignore. > > Modified: > head/sys/dev/drm2/i915/i915_drv.c > head/sys/dev/drm2/radeon/radeon_drv.c > head/sys/dev/ed/if_ed_pci.c > head/sys/dev/intpm/intpm.c > head/sys/dev/ioat/ioat.c > head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > head/sys/net/iflib.h > > Modified: head/sys/dev/drm2/i915/i915_drv.c > ============================================================================== > --- head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/drm2/i915/i915_drv.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -1236,7 +1236,7 @@ MODULE_DEPEND(i915kms, agp, 1, 1, 1); > MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); > MODULE_DEPEND(i915kms, iic, 1, 1, 1); > MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); > -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, i915, > pciidlist, > +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, > sizeof(pciidlist[0]), nitems(pciidlist)); > > /* We give fast paths for the really cool registers */ > > Modified: head/sys/dev/drm2/radeon/radeon_drv.c > ============================================================================== > --- head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:52:38 > 2017 (r327088) > +++ head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:53:27 > 2017 (r327089) > @@ -401,5 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); > MODULE_DEPEND(radeonkms, iic, 1, 1, 1); > MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); > MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); > -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms, > +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:@", vgapci, radeonkms, @ vs # > pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); > > Modified: head/sys/dev/ed/if_ed_pci.c > ============================================================================== > --- head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -145,6 +145,6 @@ static driver_t ed_pci_driver = { > DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); > MODULE_DEPEND(ed, pci, 1, 1, 1); > MODULE_DEPEND(ed, ether, 1, 1, 1); > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids, > sizeof(pci_ids[0]), > +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ed, pci_ids, @ vs # > sizeof(pci_ids[0]), > nitems(pci_ids) - 1); > > > Modified: head/sys/dev/intpm/intpm.c > ============================================================================== > --- head/sys/dev/intpm/intpm.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/intpm/intpm.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -895,5 +895,5 @@ DRIVER_MODULE_ORDERED(intsmb, pci, intsmb_driver, ints > DRIVER_MODULE(smbus, intsmb, smbus_driver, smbus_devclass, 0, 0); > MODULE_DEPEND(intsmb, smbus, SMBUS_MINVER, SMBUS_PREFVER, SMBUS_MAXVER); > MODULE_VERSION(intsmb, 1); > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, intpm, intsmb_products, > +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, intpm, intsmb_products, > sizeof(intsmb_products[0]), nitems(intsmb_products)); > > Modified: head/sys/dev/ioat/ioat.c > ============================================================================== > --- head/sys/dev/ioat/ioat.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/ioat/ioat.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -240,7 +240,7 @@ static struct _pcsid > { 0x20218086, "SKX IOAT" }, > }; > > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ioat, pci_ids, > +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ioat, pci_ids, > sizeof(pci_ids[0]), nitems(pci_ids)); > > /* > > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > ============================================================================== > --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:52:38 > 2017 (r327088) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:53:27 > 2017 (r327089) > @@ -3119,5 +3119,5 @@ static DEFINE_CLASS_0(ntb_hw, ntb_intel_driver, > ntb_in > DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL, > NULL); > MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); > MODULE_VERSION(ntb_hw_intel, 1); > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ntb_hw_intel, pci_ids, > +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ntb_hw_intel, pci_ids, @ vs # > sizeof(pci_ids[0]), nitems(pci_ids)); > > Modified: head/sys/net/iflib.h > ============================================================================== > --- head/sys/net/iflib.h Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/net/iflib.h Fri Dec 22 17:53:27 2017 (r327089) > @@ -174,7 +174,7 @@ typedef struct pci_vendor_info { > #define PVID_END {0, 0, 0, 0, 0, 0, NULL} > > #define IFLIB_PNP_DESCR > "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ > - "U32:revision;U32:class;D:human" > + "U32:revision;U32:class;D:#" > #define IFLIB_PNP_INFO(b, u, t) \ > MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t)) > > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" > From owner-svn-src-head@freebsd.org Fri Dec 22 18:34:42 2017 Return-Path: Delivered-To: svn-src-head@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 E7992E82360 for ; Fri, 22 Dec 2017 18:34:42 +0000 (UTC) (envelope-from shurd@freebsd.org) Received: from fed1rmwml304.cox.net (fed1rmwml304.cox.net [68.230.241.172]) by mx1.freebsd.org (Postfix) with ESMTP id C20552B27 for ; Fri, 22 Dec 2017 18:34:42 +0000 (UTC) (envelope-from shurd@freebsd.org) Received: from eastrmimpo209.cox.net ([68.230.241.224]) by eastrmfepo203.cox.net (InterMail vM.8.01.05.28 201-2260-151-171-20160122) with ESMTP id <20171222182222.NRIM4081.eastrmfepo203.cox.net@eastrmimpo209.cox.net> for ; Fri, 22 Dec 2017 13:22:22 -0500 Received: from [192.168.0.33] ([107.5.177.180]) by eastrmimpo209.cox.net with cox id p6NL1w00s3tujNK016NNjY; Fri, 22 Dec 2017 13:22:22 -0500 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A020205.5A3D4D5E.01E9, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=2.2 cv=DKj/22Fb c=1 sm=1 tr=0 a=qjOqI3gpwxmQgA7j5BgDJQ==:117 a=qjOqI3gpwxmQgA7j5BgDJQ==:17 a=IkcTkHD0fZMA:10 a=EqGS7fucKS0A:10 a=6I5d2MoRAAAA:8 a=9OJ7zOEqpIwYj0Q8kDsA:9 a=JW_fZDZ7YfCKXYhO:21 a=QEXdDO2ut3YA:10 a=IjZwj45LgO3ly-622nXo:22 X-CM-Score: 0.00 Authentication-Results: cox.net; auth=pass (PLAIN) smtp.auth=myhuge@cox.net Subject: Re: svn commit: r327013 - head/sys/net To: Oleg Bulyzhin , Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> From: Stephen Hurd Message-ID: <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> Date: Fri, 22 Dec 2017 13:22:20 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: <20171222115825.GA69149@lath.RINET.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 18:34:43 -0000 Oleg Bulyzhin wrote: > On Wed, Dec 20, 2017 at 01:03:34AM +0000, Stephen Hurd wrote: >> Author: shurd >> Date: Wed Dec 20 01:03:34 2017 >> New Revision: 327013 >> URL: https://svnweb.freebsd.org/changeset/base/327013 >> >> Log: >> Support attaching tx queues to cpus >> >> This will attempt to use a different thread/core on the same L2 >> cache when possible, or use the same cpu as the rx thread when not. >> If SMP isn't enabled, don't go looking for cores to use. This is mostly >> useful when using shared TX/RX queues. >> >> Reviewed by: sbruno >> Sponsored by: Limelight Networks >> Differential Revision: https://reviews.freebsd.org/D12446 > i'm getting this panic: > > [skipped] > ix0: port 0xcc00-0xcc1f mem 0xfde80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 > ix0: using 2048 tx descriptors and 2048 rx descriptors > ix0: msix_init qsets capped at 16 > ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 > ix0: using 4 rx queues 4 tx queues > ix0: attempting to allocate 5 MSI-X vectors (64 supported) > msi: routing MSI-X IRQ 259 to local APIC 0 vector 54 > msi: routing MSI-X IRQ 260 to local APIC 0 vector 55 > msi: routing MSI-X IRQ 261 to local APIC 0 vector 56 > msi: routing MSI-X IRQ 262 to local APIC 0 vector 57 > msi: routing MSI-X IRQ 263 to local APIC 0 vector 58 > ix0: using IRQs 259-263 for MSI-X > ix0: Using MSIX interrupts with 5 vectors > ix0: allocated for 4 queues > ix0: allocated for 4 rx queues > panic: Assertion gtask->gt_taskqueue != NULL failed at /usr/src/sys/net/iflib.c:5177 > cpuid = 0 > time = 1 > KDB: enter: panic > [ thread pid 0 tid 100000 ] > Stopped at kdb_enter+0x3b: movq $0,kdb_why > db> bt > Tracing pid 0 tid 100000 td 0xffffffff80bf63c0 > kdb_enter() at kdb_enter+0x3b/frame 0xffffffff81004130 > vpanic() at vpanic+0x1b9/frame 0xffffffff810041b0 > kassert_panic() at kassert_panic+0x173/frame 0xffffffff81004220 > iflib_irq_set_affinity() at iflib_irq_set_affinity+0xae2/frame 0xffffffff810042e0 > iflib_irq_alloc_generic() at iflib_irq_alloc_generic+0x1f7/frame 0xffffffff81004350 > ixgbe_if_msix_intr_assign() at ixgbe_if_msix_intr_assign+0xa2/frame 0xffffffff810043d0 > iflib_device_register() at iflib_device_register+0x2a6a/frame 0xffffffff810046f0 > iflib_device_attach() at iflib_device_attach+0xb7/frame 0xffffffff81004720 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004770 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004790 > pci_attach() at pci_attach+0xd5/frame 0xffffffff810047d0 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004820 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004840 > acpi_pcib_pci_attach() at acpi_pcib_pci_attach+0xa1/frame 0xffffffff81004880 > device_attach() at device_attach+0x3f7/frame 0xffffffff810048d0 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff810048f0 > pci_attach() at pci_attach+0xd5/frame 0xffffffff81004930 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004980 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff810049a0 > acpi_pcib_acpi_attach() at acpi_pcib_acpi_attach+0x3bc/frame 0xffffffff81004a10 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004a60 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004a80 > acpi_attach() at acpi_attach+0xe85/frame 0xffffffff81004b30 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004b80 > bus_generic_attach() at bus_generic_attach+0x5a/frame 0xffffffff81004ba0 > nexus_acpi_attach() at nexus_acpi_attach+0x73/frame 0xffffffff81004bd0 > device_attach() at device_attach+0x3f7/frame 0xffffffff81004c20 > bus_generic_new_pass() at bus_generic_new_pass+0x116/frame 0xffffffff81004c50 > bus_set_pass() at bus_set_pass+0x8c/frame 0xffffffff81004c80 > configure() at configure+0x9/frame 0xffffffff81004c90 > mi_startup() at mi_startup+0x9c/frame 0xffffffff81004cb0 > btext() at btext+0x2c Can you provide me with the output of ``sysctl kern.sched.topology_spec''? It would also be useful to add a line in iflib.c at the beginning of iflib_irq_set_affinity() to show the parameters: int cpuid; int err, tid; +device_printf(ctx->ifc_dev, "irq=%d, type=%d, qid=%d, name=%s\n", irq, type, qid, name); cpuid = find_nth(ctx, qid); tid = get_thread_num(ctx, type, qid); MPASS(tid >= 0); And provide the new dmesg with this added output. From owner-svn-src-head@freebsd.org Fri Dec 22 19:10:21 2017 Return-Path: Delivered-To: svn-src-head@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 477D5E83E8D; Fri, 22 Dec 2017 19:10:21 +0000 (UTC) (envelope-from np@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 EBFE23B65; Fri, 22 Dec 2017 19:10:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMJAKIT092576; Fri, 22 Dec 2017 19:10:20 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMJAJLj092570; Fri, 22 Dec 2017 19:10:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201712221910.vBMJAJLj092570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 22 Dec 2017 19:10:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327093 - head/sys/dev/cxgbe X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe X-SVN-Commit-Revision: 327093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 19:10:21 -0000 Author: np Date: Fri Dec 22 19:10:19 2017 New Revision: 327093 URL: https://svnweb.freebsd.org/changeset/base/327093 Log: cxgbe(4): Do not forward interrupts to queues with freelists. This leaves the firmware event queue (fwq) as the only queue that can take interrupts for others. This simplifies cfg_itype_and_nqueues and queue allocation in the driver at the cost of a little (never?) used configuration. It also allows service_iq to be split into two specialized variants in the future. MFC after: 2 months Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_main.c head/sys/dev/cxgbe/t4_netmap.c head/sys/dev/cxgbe/t4_sge.c head/sys/dev/cxgbe/t4_vf.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Fri Dec 22 19:10:19 2017 (r327092) +++ head/sys/dev/cxgbe/adapter.h Fri Dec 22 19:10:19 2017 (r327093) @@ -169,9 +169,6 @@ enum { DOOMED = (1 << 0), VI_INIT_DONE = (1 << 1), VI_SYSCTL_CTX = (1 << 2), - INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ - INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ - INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), /* adapter debug_flags */ DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ @@ -349,7 +346,7 @@ enum { /* iq flags */ IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ - IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + /* 1 << 2 Used to be IQ_INTR */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ @@ -955,6 +952,13 @@ struct adapter { /* One for firmware events */ #define T4VF_EXTRA_INTR 1 + +static inline int +forwarding_intr_to_fwq(struct adapter *sc) +{ + + return (sc->intr_count == 1); +} static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Fri Dec 22 19:10:19 2017 (r327092) +++ head/sys/dev/cxgbe/t4_main.c Fri Dec 22 19:10:19 2017 (r327093) @@ -470,7 +470,6 @@ struct intrs_and_queues { uint16_t intr_type; /* INTx, MSI, or MSI-X */ uint16_t num_vis; /* number of VIs for each port */ uint16_t nirq; /* Total # of vectors */ - uint16_t intr_flags; /* Interrupt flags for each port */ uint16_t ntxq; /* # of NIC txq's for each port */ uint16_t nrxq; /* # of NIC rxq's for each port */ uint16_t nofldtxq; /* # of TOE txq's for each port */ @@ -1118,7 +1117,6 @@ t4_attach(device_t dev) vi->first_txq = tqidx; vi->tmr_idx = t4_tmr_idx; vi->pktc_idx = t4_pktc_idx; - vi->flags |= iaq.intr_flags & INTR_RXQ; vi->nrxq = j == 0 ? iaq.nrxq : iaq.nrxq_vi; vi->ntxq = j == 0 ? iaq.ntxq : iaq.ntxq_vi; @@ -1135,7 +1133,6 @@ t4_attach(device_t dev) vi->ofld_pktc_idx = t4_pktc_idx_ofld; vi->first_ofld_rxq = ofld_rqidx; vi->first_ofld_txq = ofld_tqidx; - vi->flags |= iaq.intr_flags & INTR_OFLD_RXQ; vi->nofldrxq = j == 0 ? iaq.nofldrxq : iaq.nofldrxq_vi; vi->nofldtxq = j == 0 ? iaq.nofldtxq : iaq.nofldtxq_vi; @@ -2648,26 +2645,43 @@ fixup_devlog_params(struct adapter *sc) return (rc); } -static int -cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) +static void +update_nirq(struct intrs_and_queues *iaq, int nports) { - int rc, itype, navail, nrxq, nports, n; - int nofldrxq = 0; + int extra = T4_EXTRA_INTR; - nports = sc->params.nports; + iaq->nirq = extra; + iaq->nirq += nports * (iaq->nrxq + iaq->nofldrxq); + iaq->nirq += nports * (iaq->num_vis - 1) * + max(iaq->nrxq_vi, iaq->nnmrxq_vi); + iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi; +} + +/* + * Adjust requirements to fit the number of interrupts available. + */ +static void +calculate_iaq(struct adapter *sc, struct intrs_and_queues *iaq, int itype, + int navail) +{ + int old_nirq; + const int nports = sc->params.nports; + MPASS(nports > 0); + MPASS(navail > 0); bzero(iaq, sizeof(*iaq)); + iaq->intr_type = itype; iaq->num_vis = t4_num_vis; iaq->ntxq = t4_ntxq; iaq->ntxq_vi = t4_ntxq_vi; - iaq->nrxq = nrxq = t4_nrxq; + iaq->nrxq = t4_nrxq; iaq->nrxq_vi = t4_nrxq_vi; #ifdef TCP_OFFLOAD if (is_offload(sc)) { iaq->nofldtxq = t4_nofldtxq; iaq->nofldtxq_vi = t4_nofldtxq_vi; - iaq->nofldrxq = nofldrxq = t4_nofldrxq; + iaq->nofldrxq = t4_nofldrxq; iaq->nofldrxq_vi = t4_nofldrxq_vi; } #endif @@ -2676,6 +2690,105 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs iaq->nnmrxq_vi = t4_nnmrxq_vi; #endif + update_nirq(iaq, nports); + if (iaq->nirq <= navail && + (itype != INTR_MSI || powerof2(iaq->nirq))) { + /* + * This is the normal case -- there are enough interrupts for + * everything. + */ + goto done; + } + + /* + * If extra VIs have been configured try reducing their count and see if + * that works. + */ + while (iaq->num_vis > 1) { + iaq->num_vis--; + update_nirq(iaq, nports); + if (iaq->nirq <= navail && + (itype != INTR_MSI || powerof2(iaq->nirq))) { + device_printf(sc->dev, "virtual interfaces per port " + "reduced to %d from %d. nrxq=%u, nofldrxq=%u, " + "nrxq_vi=%u nofldrxq_vi=%u, nnmrxq_vi=%u. " + "itype %d, navail %u, nirq %d.\n", + iaq->num_vis, t4_num_vis, iaq->nrxq, iaq->nofldrxq, + iaq->nrxq_vi, iaq->nofldrxq_vi, iaq->nnmrxq_vi, + itype, navail, iaq->nirq); + goto done; + } + } + + /* + * Extra VIs will not be created. Log a message if they were requested. + */ + MPASS(iaq->num_vis == 1); + iaq->ntxq_vi = iaq->nrxq_vi = 0; + iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; + iaq->nnmtxq_vi = iaq->nnmrxq_vi = 0; + if (iaq->num_vis != t4_num_vis) { + device_printf(sc->dev, "extra virtual interfaces disabled. " + "nrxq=%u, nofldrxq=%u, nrxq_vi=%u nofldrxq_vi=%u, " + "nnmrxq_vi=%u. itype %d, navail %u, nirq %d.\n", + iaq->nrxq, iaq->nofldrxq, iaq->nrxq_vi, iaq->nofldrxq_vi, + iaq->nnmrxq_vi, itype, navail, iaq->nirq); + } + + /* + * Keep reducing the number of NIC rx queues to the next lower power of + * 2 (for even RSS distribution) and halving the TOE rx queues and see + * if that works. + */ + do { + if (iaq->nrxq > 1) { + do { + iaq->nrxq--; + } while (!powerof2(iaq->nrxq)); + } + if (iaq->nofldrxq > 1) + iaq->nofldrxq >>= 1; + + old_nirq = iaq->nirq; + update_nirq(iaq, nports); + if (iaq->nirq <= navail && + (itype != INTR_MSI || powerof2(iaq->nirq))) { + device_printf(sc->dev, "running with reduced number of " + "rx queues because of shortage of interrupts. " + "nrxq=%u, nofldrxq=%u. " + "itype %d, navail %u, nirq %d.\n", iaq->nrxq, + iaq->nofldrxq, itype, navail, iaq->nirq); + goto done; + } + } while (old_nirq != iaq->nirq); + + /* One interrupt for everything. Ugh. */ + device_printf(sc->dev, "running with minimal number of queues. " + "itype %d, navail %u.\n", itype, navail); + iaq->nirq = 1; + MPASS(iaq->nrxq == 1); + iaq->ntxq = 1; + if (iaq->nofldrxq > 1) + iaq->nofldtxq = 1; +done: + MPASS(iaq->num_vis > 0); + if (iaq->num_vis > 1) { + MPASS(iaq->nrxq_vi > 0); + MPASS(iaq->ntxq_vi > 0); + } + MPASS(iaq->nirq > 0); + MPASS(iaq->nrxq > 0); + MPASS(iaq->ntxq > 0); + if (itype == INTR_MSI) { + MPASS(powerof2(iaq->nirq)); + } +} + +static int +cfg_itype_and_nqueues(struct adapter *sc, struct intrs_and_queues *iaq) +{ + int rc, itype, navail, nalloc; + for (itype = INTR_MSIX; itype; itype >>= 1) { if ((itype & t4_intr_types) == 0) @@ -2691,126 +2804,33 @@ restart: if (navail == 0) continue; - iaq->intr_type = itype; - iaq->intr_flags = 0; - - /* - * Best option: an interrupt vector for errors, one for the - * firmware event queue, and one for every rxq (NIC and TOE) of - * every VI. The VIs that support netmap use the same - * interrupts for the NIC rx queues and the netmap rx queues - * because only one set of queues is active at a time. - */ - iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += nports * (nrxq + nofldrxq); - iaq->nirq += nports * (iaq->num_vis - 1) * - max(iaq->nrxq_vi, iaq->nnmrxq_vi); /* See comment above. */ - iaq->nirq += nports * (iaq->num_vis - 1) * iaq->nofldrxq_vi; - if (iaq->nirq <= navail && - (itype != INTR_MSI || powerof2(iaq->nirq))) { - iaq->intr_flags = INTR_ALL; - goto allocate; - } - - /* Disable the VIs (and netmap) if there aren't enough intrs */ - if (iaq->num_vis > 1) { - device_printf(sc->dev, "virtual interfaces disabled " - "because num_vis=%u with current settings " - "(nrxq=%u, nofldrxq=%u, nrxq_vi=%u nofldrxq_vi=%u, " - "nnmrxq_vi=%u) would need %u interrupts but " - "only %u are available.\n", iaq->num_vis, nrxq, - nofldrxq, iaq->nrxq_vi, iaq->nofldrxq_vi, - iaq->nnmrxq_vi, iaq->nirq, navail); - iaq->num_vis = 1; - iaq->ntxq_vi = iaq->nrxq_vi = 0; - iaq->nofldtxq_vi = iaq->nofldrxq_vi = 0; - iaq->nnmtxq_vi = iaq->nnmrxq_vi = 0; - goto restart; - } - - /* - * Second best option: a vector for errors, one for the firmware - * event queue, and vectors for either all the NIC rx queues or - * all the TOE rx queues. The queues that don't get vectors - * will forward their interrupts to those that do. - */ - iaq->nirq = T4_EXTRA_INTR; - if (nrxq >= nofldrxq) { - iaq->intr_flags = INTR_RXQ; - iaq->nirq += nports * nrxq; - } else { - iaq->intr_flags = INTR_OFLD_RXQ; - iaq->nirq += nports * nofldrxq; - } - if (iaq->nirq <= navail && - (itype != INTR_MSI || powerof2(iaq->nirq))) - goto allocate; - - /* - * Next best option: an interrupt vector for errors, one for the - * firmware event queue, and at least one per main-VI. At this - * point we know we'll have to downsize nrxq and/or nofldrxq to - * fit what's available to us. - */ - iaq->nirq = T4_EXTRA_INTR; - iaq->nirq += nports; - if (iaq->nirq <= navail) { - int leftover = navail - iaq->nirq; - int target = max(nrxq, nofldrxq); - - iaq->intr_flags = nrxq >= nofldrxq ? - INTR_RXQ : INTR_OFLD_RXQ; - - n = 1; - while (n < target && leftover >= nports) { - leftover -= nports; - iaq->nirq += nports; - n++; - } - iaq->nrxq = min(n, nrxq); -#ifdef TCP_OFFLOAD - iaq->nofldrxq = min(n, nofldrxq); -#endif - - if (itype != INTR_MSI || powerof2(iaq->nirq)) - goto allocate; - } - - /* - * Least desirable option: one interrupt vector for everything. - */ - iaq->nirq = iaq->nrxq = 1; - iaq->intr_flags = 0; -#ifdef TCP_OFFLOAD - if (is_offload(sc)) - iaq->nofldrxq = 1; -#endif -allocate: - navail = iaq->nirq; + calculate_iaq(sc, iaq, itype, navail); + nalloc = iaq->nirq; rc = 0; if (itype == INTR_MSIX) - rc = pci_alloc_msix(sc->dev, &navail); + rc = pci_alloc_msix(sc->dev, &nalloc); else if (itype == INTR_MSI) - rc = pci_alloc_msi(sc->dev, &navail); + rc = pci_alloc_msi(sc->dev, &nalloc); - if (rc == 0) { - if (navail == iaq->nirq) + if (rc == 0 && nalloc > 0) { + if (nalloc == iaq->nirq) return (0); /* * Didn't get the number requested. Use whatever number - * the kernel is willing to allocate (it's in navail). + * the kernel is willing to allocate. */ device_printf(sc->dev, "fewer vectors than requested, " "type=%d, req=%d, rcvd=%d; will downshift req.\n", - itype, iaq->nirq, navail); + itype, iaq->nirq, nalloc); pci_release_msi(sc->dev); + navail = nalloc; goto restart; } device_printf(sc->dev, "failed to allocate vectors:%d, type=%d, req=%d, rcvd=%d\n", - itype, rc, iaq->nirq, navail); + itype, rc, iaq->nirq, nalloc); } device_printf(sc->dev, @@ -4352,7 +4372,7 @@ t4_setup_intr_handlers(struct adapter *sc) */ irq = &sc->irq[0]; rid = sc->intr_type == INTR_INTX ? 0 : 1; - if (sc->intr_count == 1) + if (forwarding_intr_to_fwq(sc)) return (t4_alloc_irq(sc, irq, rid, t4_intr_all, sc, "all")); /* Multiple interrupts. */ @@ -4387,8 +4407,6 @@ t4_setup_intr_handlers(struct adapter *sc) if (vi->nnmrxq > 0) { int n = max(vi->nrxq, vi->nnmrxq); - MPASS(vi->flags & INTR_RXQ); - rxq = &sge->rxq[vi->first_rxq]; #ifdef DEV_NETMAP nm_rxq = &sge->nm_rxq[vi->first_nm_rxq]; @@ -4406,11 +4424,17 @@ t4_setup_intr_handlers(struct adapter *sc) t4_vi_intr, irq, s); if (rc != 0) return (rc); +#ifdef RSS + if (q < vi->nrxq) { + bus_bind_intr(sc->dev, irq->res, + rss_getcpu(q % nbuckets)); + } +#endif irq++; rid++; vi->nintr++; } - } else if (vi->flags & INTR_RXQ) { + } else { for_each_rxq(vi, q, rxq) { snprintf(s, sizeof(s), "%x%c%x", p, 'a' + v, q); @@ -4428,18 +4452,15 @@ t4_setup_intr_handlers(struct adapter *sc) } } #ifdef TCP_OFFLOAD - if (vi->flags & INTR_OFLD_RXQ) { - for_each_ofld_rxq(vi, q, ofld_rxq) { - snprintf(s, sizeof(s), "%x%c%x", p, - 'A' + v, q); - rc = t4_alloc_irq(sc, irq, rid, - t4_intr, ofld_rxq, s); - if (rc != 0) - return (rc); - irq++; - rid++; - vi->nintr++; - } + for_each_ofld_rxq(vi, q, ofld_rxq) { + snprintf(s, sizeof(s), "%x%c%x", p, 'A' + v, q); + rc = t4_alloc_irq(sc, irq, rid, t4_intr, + ofld_rxq, s); + if (rc != 0) + return (rc); + irq++; + rid++; + vi->nintr++; } #endif } Modified: head/sys/dev/cxgbe/t4_netmap.c ============================================================================== --- head/sys/dev/cxgbe/t4_netmap.c Fri Dec 22 19:10:19 2017 (r327092) +++ head/sys/dev/cxgbe/t4_netmap.c Fri Dec 22 19:10:19 2017 (r327093) @@ -108,16 +108,10 @@ alloc_nm_rxq_hwq(struct vi_info *vi, struct sge_nm_rxq V_FW_IQ_CMD_VFN(0)); c.alloc_to_len16 = htobe32(F_FW_IQ_CMD_ALLOC | F_FW_IQ_CMD_IQSTART | FW_LEN16(c)); - if (vi->flags & INTR_RXQ) { - KASSERT(nm_rxq->intr_idx < sc->intr_count, - ("%s: invalid direct intr_idx %d", __func__, - nm_rxq->intr_idx)); - v = V_FW_IQ_CMD_IQANDSTINDEX(nm_rxq->intr_idx); - } else { - CXGBE_UNIMPLEMENTED(__func__); /* XXXNM: needs review */ - v = V_FW_IQ_CMD_IQANDSTINDEX(nm_rxq->intr_idx) | - F_FW_IQ_CMD_IQANDST; - } + MPASS(!forwarding_intr_to_fwq(sc)); + KASSERT(nm_rxq->intr_idx < sc->intr_count, + ("%s: invalid direct intr_idx %d", __func__, nm_rxq->intr_idx)); + v = V_FW_IQ_CMD_IQANDSTINDEX(nm_rxq->intr_idx); c.type_to_iqandstindex = htobe32(v | V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) | V_FW_IQ_CMD_VIID(vi->viid) | Modified: head/sys/dev/cxgbe/t4_sge.c ============================================================================== --- head/sys/dev/cxgbe/t4_sge.c Fri Dec 22 19:10:19 2017 (r327092) +++ head/sys/dev/cxgbe/t4_sge.c Fri Dec 22 19:10:19 2017 (r327093) @@ -953,70 +953,6 @@ t4_teardown_adapter_queues(struct adapter *sc) return (0); } -static inline int -first_vector(struct vi_info *vi) -{ - struct adapter *sc = vi->pi->adapter; - - if (sc->intr_count == 1) - return (0); - - return (vi->first_intr); -} - -/* - * Given an arbitrary "index," come up with an iq that can be used by other - * queues (of this VI) for interrupt forwarding, SGE egress updates, etc. - * The iq returned is guaranteed to be something that takes direct interrupts. - */ -static struct sge_iq * -vi_intr_iq(struct vi_info *vi, int idx) -{ - struct adapter *sc = vi->pi->adapter; - struct sge *s = &sc->sge; - struct sge_iq *iq = NULL; - int nintr, i; - - if (sc->intr_count == 1) - return (&sc->sge.fwq); - - nintr = vi->nintr; -#ifdef DEV_NETMAP - /* Do not consider any netmap-only interrupts */ - if (vi->flags & INTR_RXQ && vi->nnmrxq > vi->nrxq) - nintr -= vi->nnmrxq - vi->nrxq; -#endif - KASSERT(nintr != 0, - ("%s: vi %p has no exclusive interrupts, total interrupts = %d", - __func__, vi, sc->intr_count)); - i = idx % nintr; - - if (vi->flags & INTR_RXQ) { - if (i < vi->nrxq) { - iq = &s->rxq[vi->first_rxq + i].iq; - goto done; - } - i -= vi->nrxq; - } -#ifdef TCP_OFFLOAD - if (vi->flags & INTR_OFLD_RXQ) { - if (i < vi->nofldrxq) { - iq = &s->ofld_rxq[vi->first_ofld_rxq + i].iq; - goto done; - } - i -= vi->nofldrxq; - } -#endif - panic("%s: vi %p, intr_flags 0x%lx, idx %d, total intr %d\n", __func__, - vi, vi->flags & INTR_ALL, idx, nintr); -done: - MPASS(iq != NULL); - KASSERT(iq->flags & IQ_INTR, - ("%s: iq %p (vi %p, intr_flags 0x%lx, idx %d)", __func__, iq, vi, - vi->flags & INTR_ALL, idx)); - return (iq); -} - /* Maximum payload that can be delivered with a single iq descriptor */ static inline int mtu_to_max_payload(struct adapter *sc, int mtu, const int toe) @@ -1042,7 +978,7 @@ mtu_to_max_payload(struct adapter *sc, int mtu, const int t4_setup_vi_queues(struct vi_info *vi) { - int rc = 0, i, j, intr_idx, iqid; + int rc = 0, i, intr_idx, iqidx; struct sge_rxq *rxq; struct sge_txq *txq; struct sge_wrq *ctrlq; @@ -1064,14 +1000,14 @@ t4_setup_vi_queues(struct vi_info *vi) int maxp, mtu = ifp->if_mtu; /* Interrupt vector to start from (when using multiple vectors) */ - intr_idx = first_vector(vi); + intr_idx = vi->first_intr; #ifdef DEV_NETMAP saved_idx = intr_idx; if (ifp->if_capabilities & IFCAP_NETMAP) { /* netmap is supported with direct interrupts only. */ - MPASS(vi->flags & INTR_RXQ); + MPASS(!forwarding_intr_to_fwq(sc)); /* * We don't have buffers to back the netmap rx queues @@ -1090,8 +1026,8 @@ t4_setup_vi_queues(struct vi_info *vi) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "nm_txq", CTLFLAG_RD, NULL, "tx queues"); for_each_nm_txq(vi, i, nm_txq) { - iqid = vi->first_nm_rxq + (i % vi->nnmrxq); - rc = alloc_nm_txq(vi, nm_txq, iqid, i, oid); + iqidx = vi->first_nm_rxq + (i % vi->nnmrxq); + rc = alloc_nm_txq(vi, nm_txq, iqidx, i, oid); if (rc != 0) goto done; } @@ -1102,15 +1038,12 @@ t4_setup_vi_queues(struct vi_info *vi) #endif /* - * First pass over all NIC and TOE rx queues: - * a) initialize iq and fl - * b) allocate queue iff it will take direct interrupts. + * Allocate rx queues first because a default iqid is required when + * creating a tx queue. */ maxp = mtu_to_max_payload(sc, mtu, 0); - if (vi->flags & INTR_RXQ) { - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", - CTLFLAG_RD, NULL, "rx queues"); - } + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", + CTLFLAG_RD, NULL, "rx queues"); for_each_rxq(vi, i, rxq) { init_iq(&rxq->iq, sc, vi->tmr_idx, vi->pktc_idx, vi->qsize_rxq); @@ -1119,13 +1052,11 @@ t4_setup_vi_queues(struct vi_info *vi) device_get_nameunit(vi->dev), i); init_fl(sc, &rxq->fl, vi->qsize_rxq / 8, maxp, name); - if (vi->flags & INTR_RXQ) { - rxq->iq.flags |= IQ_INTR; - rc = alloc_rxq(vi, rxq, intr_idx, i, oid); - if (rc != 0) - goto done; - intr_idx++; - } + rc = alloc_rxq(vi, rxq, + forwarding_intr_to_fwq(sc) ? -1 : intr_idx, i, oid); + if (rc != 0) + goto done; + intr_idx++; } #ifdef DEV_NETMAP if (ifp->if_capabilities & IFCAP_NETMAP) @@ -1133,11 +1064,8 @@ t4_setup_vi_queues(struct vi_info *vi) #endif #ifdef TCP_OFFLOAD maxp = mtu_to_max_payload(sc, mtu, 1); - if (vi->flags & INTR_OFLD_RXQ) { - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", - CTLFLAG_RD, NULL, - "rx queues for offloaded TCP connections"); - } + oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", + CTLFLAG_RD, NULL, "rx queues for offloaded TCP connections"); for_each_ofld_rxq(vi, i, ofld_rxq) { init_iq(&ofld_rxq->iq, sc, vi->ofld_tmr_idx, vi->ofld_pktc_idx, @@ -1147,70 +1075,29 @@ t4_setup_vi_queues(struct vi_info *vi) device_get_nameunit(vi->dev), i); init_fl(sc, &ofld_rxq->fl, vi->qsize_rxq / 8, maxp, name); - if (vi->flags & INTR_OFLD_RXQ) { - ofld_rxq->iq.flags |= IQ_INTR; - rc = alloc_ofld_rxq(vi, ofld_rxq, intr_idx, i, oid); - if (rc != 0) - goto done; - intr_idx++; - } + rc = alloc_ofld_rxq(vi, ofld_rxq, + forwarding_intr_to_fwq(sc) ? -1 : intr_idx, i, oid); + if (rc != 0) + goto done; + intr_idx++; } #endif /* - * Second pass over all NIC and TOE rx queues. The queues forwarding - * their interrupts are allocated now. + * Now the tx queues. */ - j = 0; - if (!(vi->flags & INTR_RXQ)) { - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "rxq", - CTLFLAG_RD, NULL, "rx queues"); - for_each_rxq(vi, i, rxq) { - MPASS(!(rxq->iq.flags & IQ_INTR)); - - intr_idx = vi_intr_iq(vi, j)->abs_id; - - rc = alloc_rxq(vi, rxq, intr_idx, i, oid); - if (rc != 0) - goto done; - j++; - } - } -#ifdef TCP_OFFLOAD - if (vi->nofldrxq != 0 && !(vi->flags & INTR_OFLD_RXQ)) { - oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_rxq", - CTLFLAG_RD, NULL, - "rx queues for offloaded TCP connections"); - for_each_ofld_rxq(vi, i, ofld_rxq) { - MPASS(!(ofld_rxq->iq.flags & IQ_INTR)); - - intr_idx = vi_intr_iq(vi, j)->abs_id; - - rc = alloc_ofld_rxq(vi, ofld_rxq, intr_idx, i, oid); - if (rc != 0) - goto done; - j++; - } - } -#endif - - /* - * Now the tx queues. Only one pass needed. - */ oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "txq", CTLFLAG_RD, NULL, "tx queues"); - j = 0; for_each_txq(vi, i, txq) { - iqid = vi_intr_iq(vi, j)->cntxt_id; + iqidx = vi->first_rxq + (i % vi->nrxq); snprintf(name, sizeof(name), "%s txq%d", device_get_nameunit(vi->dev), i); - init_eq(sc, &txq->eq, EQ_ETH, vi->qsize_txq, pi->tx_chan, iqid, - name); + init_eq(sc, &txq->eq, EQ_ETH, vi->qsize_txq, pi->tx_chan, + sc->sge.rxq[iqidx].iq.cntxt_id, name); rc = alloc_txq(vi, txq, i, oid); if (rc != 0) goto done; - j++; } #ifdef TCP_OFFLOAD oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ofld_txq", @@ -1218,11 +1105,11 @@ t4_setup_vi_queues(struct vi_info *vi) for_each_ofld_txq(vi, i, ofld_txq) { struct sysctl_oid *oid2; - iqid = vi_intr_iq(vi, j)->cntxt_id; + iqidx = vi->first_ofld_rxq + (i % vi->nofldrxq); snprintf(name, sizeof(name), "%s ofld_txq%d", device_get_nameunit(vi->dev), i); init_eq(sc, &ofld_txq->eq, EQ_OFLD, vi->qsize_txq, pi->tx_chan, - iqid, name); + sc->sge.ofld_rxq[iqidx].iq.cntxt_id, name); snprintf(name, sizeof(name), "%d", i); oid2 = SYSCTL_ADD_NODE(&vi->ctx, SYSCTL_CHILDREN(oid), OID_AUTO, @@ -1231,7 +1118,6 @@ t4_setup_vi_queues(struct vi_info *vi) rc = alloc_wrq(sc, vi, ofld_txq, oid2); if (rc != 0) goto done; - j++; } #endif @@ -1243,10 +1129,9 @@ t4_setup_vi_queues(struct vi_info *vi) oid = SYSCTL_ADD_NODE(&vi->ctx, children, OID_AUTO, "ctrlq", CTLFLAG_RD, NULL, "ctrl queue"); ctrlq = &sc->sge.ctrlq[pi->port_id]; - iqid = vi_intr_iq(vi, 0)->cntxt_id; snprintf(name, sizeof(name), "%s ctrlq", device_get_nameunit(vi->dev)); - init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, pi->tx_chan, iqid, - name); + init_eq(sc, &ctrlq->eq, EQ_CTRL, CTRL_EQ_QSIZE, pi->tx_chan, + sc->sge.rxq[vi->first_rxq].iq.cntxt_id, name); rc = alloc_wrq(sc, vi, ctrlq, oid); done: @@ -1312,36 +1197,18 @@ t4_teardown_vi_queues(struct vi_info *vi) #endif /* - * Then take down the rx queues that forward their interrupts, as they - * reference other rx queues. + * Then take down the rx queues. */ for_each_rxq(vi, i, rxq) { - if ((rxq->iq.flags & IQ_INTR) == 0) - free_rxq(vi, rxq); + free_rxq(vi, rxq); } #ifdef TCP_OFFLOAD for_each_ofld_rxq(vi, i, ofld_rxq) { - if ((ofld_rxq->iq.flags & IQ_INTR) == 0) - free_ofld_rxq(vi, ofld_rxq); + free_ofld_rxq(vi, ofld_rxq); } #endif - /* - * Then take down the rx queues that take direct interrupts. - */ - - for_each_rxq(vi, i, rxq) { - if (rxq->iq.flags & IQ_INTR) - free_rxq(vi, rxq); - } -#ifdef TCP_OFFLOAD - for_each_ofld_rxq(vi, i, ofld_rxq) { - if (ofld_rxq->iq.flags & IQ_INTR) - free_ofld_rxq(vi, ofld_rxq); - } -#endif - return (0); } @@ -2715,9 +2582,9 @@ free_ring(struct adapter *sc, bus_dma_tag_t tag, bus_d * Returns errno on failure. Resources allocated up to that point may still be * allocated. Caller is responsible for cleanup in case this function fails. * - * If the ingress queue will take interrupts directly (iq->flags & IQ_INTR) then - * the intr_idx specifies the vector, starting from 0. Otherwise it specifies - * the abs_id of the ingress queue to which its interrupts should be forwarded. + * If the ingress queue will take interrupts directly then the intr_idx + * specifies the vector, starting from 0. -1 means the interrupts for this + * queue should be forwarded to the fwq. */ static int alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, struct sge_fl *fl, @@ -2749,12 +2616,15 @@ alloc_iq_fl(struct vi_info *vi, struct sge_iq *iq, str if (iq == &sc->sge.fwq) v |= F_FW_IQ_CMD_IQASYNCH; - if (iq->flags & IQ_INTR) { + if (intr_idx < 0) { + /* Forwarded interrupts, all headed to fwq */ + v |= F_FW_IQ_CMD_IQANDST; + v |= V_FW_IQ_CMD_IQANDSTINDEX(sc->sge.fwq.cntxt_id); + } else { KASSERT(intr_idx < sc->intr_count, ("%s: invalid direct intr_idx %d", __func__, intr_idx)); - } else - v |= F_FW_IQ_CMD_IQANDST; - v |= V_FW_IQ_CMD_IQANDSTINDEX(intr_idx); + v |= V_FW_IQ_CMD_IQANDSTINDEX(intr_idx); + } c.type_to_iqandstindex = htobe32(v | V_FW_IQ_CMD_TYPE(FW_IQ_TYPE_FL_INT_CAP) | @@ -3004,7 +2874,6 @@ alloc_fwq(struct adapter *sc) struct sysctl_oid_list *children = SYSCTL_CHILDREN(oid); init_iq(fwq, sc, 0, 0, FW_IQ_QSIZE); - fwq->flags |= IQ_INTR; /* always */ if (sc->flags & IS_VF) intr_idx = 0; else { Modified: head/sys/dev/cxgbe/t4_vf.c ============================================================================== --- head/sys/dev/cxgbe/t4_vf.c Fri Dec 22 19:10:19 2017 (r327092) +++ head/sys/dev/cxgbe/t4_vf.c Fri Dec 22 19:10:19 2017 (r327093) @@ -62,7 +62,6 @@ __FBSDID("$FreeBSD$"); struct intrs_and_queues { uint16_t intr_type; /* MSI, or MSI-X */ uint16_t nirq; /* Total # of vectors */ - uint16_t intr_flags; /* Interrupt flags for each port */ uint16_t ntxq; /* # of NIC txq's for each port */ uint16_t nrxq; /* # of NIC rxq's for each port */ }; @@ -330,7 +329,6 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs continue; iaq->intr_type = itype; - iaq->intr_flags = 0; /* * XXX: The Linux driver reserves an Ingress Queue for @@ -438,7 +436,6 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs return (rc); } if (navail == iaq->nirq) { - iaq->intr_flags = INTR_RXQ; return (0); } pci_release_msi(sc->dev); @@ -455,7 +452,6 @@ cfg_itype_and_nqueues(struct adapter *sc, struct intrs device_printf(sc->dev, "failed to allocate vectors:%d, type=%d, req=%d, rcvd=%d\n", itype, rc, iaq->nirq, navail); - iaq->intr_flags = 0; return (rc); } @@ -702,7 +698,6 @@ t4vf_attach(device_t dev) vi->first_txq = tqidx; vi->tmr_idx = t4_tmr_idx; vi->pktc_idx = t4_pktc_idx; - vi->flags |= iaq.intr_flags & INTR_RXQ; vi->nrxq = j == 0 ? iaq.nrxq: 1; vi->ntxq = j == 0 ? iaq.ntxq: 1; From owner-svn-src-head@freebsd.org Fri Dec 22 20:44:22 2017 Return-Path: Delivered-To: svn-src-head@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 8204EE88DA1; Fri, 22 Dec 2017 20:44:22 +0000 (UTC) (envelope-from mav@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 4E4AD66216; Fri, 22 Dec 2017 20:44:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMKiLST033741; Fri, 22 Dec 2017 20:44:21 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMKiLPd033739; Fri, 22 Dec 2017 20:44:21 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201712222044.vBMKiLPd033739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Fri, 22 Dec 2017 20:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327094 - in head/sys/dev: ahci usb/controller X-SVN-Group: head X-SVN-Commit-Author: mav X-SVN-Commit-Paths: in head/sys/dev: ahci usb/controller X-SVN-Commit-Revision: 327094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 20:44:22 -0000 Author: mav Date: Fri Dec 22 20:44:21 2017 New Revision: 327094 URL: https://svnweb.freebsd.org/changeset/base/327094 Log: Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system. MFC after: 2 weeks Modified: head/sys/dev/ahci/ahci_pci.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/ahci/ahci_pci.c ============================================================================== --- head/sys/dev/ahci/ahci_pci.c Fri Dec 22 19:10:19 2017 (r327093) +++ head/sys/dev/ahci/ahci_pci.c Fri Dec 22 20:44:21 2017 (r327094) @@ -68,6 +68,7 @@ static const struct { AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI}, /* Not sure SB8x0/SB9x0 needs this quirk. Be conservative though */ {0x43951002, 0x00, "AMD SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, + {0x43b71022, 0x00, "AMD 300 Series", 0}, {0x78001022, 0x00, "AMD Hudson-2", 0}, {0x78011022, 0x00, "AMD Hudson-2", 0}, {0x78021022, 0x00, "AMD Hudson-2", 0}, Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Fri Dec 22 19:10:19 2017 (r327093) +++ head/sys/dev/usb/controller/xhci_pci.c Fri Dec 22 20:44:21 2017 (r327094) @@ -97,6 +97,10 @@ xhci_pci_match(device_t self) uint32_t device_id = pci_get_devid(self); switch (device_id) { + case 0x145c1022: + return ("AMD KERNCZ USB 3.0 controller"); + case 0x43bb1022: + return ("AMD 300 Series USB 3.0 controller"); case 0x78141022: return ("AMD FCH USB 3.0 controller"); From owner-svn-src-head@freebsd.org Fri Dec 22 20:48:51 2017 Return-Path: Delivered-To: svn-src-head@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 27848E8902A; Fri, 22 Dec 2017 20:48:51 +0000 (UTC) (envelope-from imp@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 E3AEB663F3; Fri, 22 Dec 2017 20:48:50 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMKmo3b033933; Fri, 22 Dec 2017 20:48:50 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMKmn34033930; Fri, 22 Dec 2017 20:48:49 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712222048.vBMKmn34033930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Fri, 22 Dec 2017 20:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327095 - in head/sys/dev: drm2/radeon ed ntb/ntb_hw X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev: drm2/radeon ed ntb/ntb_hw X-SVN-Commit-Revision: 327095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 20:48:51 -0000 Author: imp Date: Fri Dec 22 20:48:49 2017 New Revision: 327095 URL: https://svnweb.freebsd.org/changeset/base/327095 Log: Fix typos from last commit, these should have been #. Modified: head/sys/dev/drm2/radeon/radeon_drv.c head/sys/dev/ed/if_ed_pci.c head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 20:44:21 2017 (r327094) +++ head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 20:48:49 2017 (r327095) @@ -401,5 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:@", vgapci, radeonkms, +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms, pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); Modified: head/sys/dev/ed/if_ed_pci.c ============================================================================== --- head/sys/dev/ed/if_ed_pci.c Fri Dec 22 20:44:21 2017 (r327094) +++ head/sys/dev/ed/if_ed_pci.c Fri Dec 22 20:48:49 2017 (r327095) @@ -145,6 +145,6 @@ static driver_t ed_pci_driver = { DRIVER_MODULE(ed, pci, ed_pci_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, pci, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ed, pci_ids, sizeof(pci_ids[0]), +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ed, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids) - 1); Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c ============================================================================== --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 20:44:21 2017 (r327094) +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 20:48:49 2017 (r327095) @@ -3119,5 +3119,5 @@ static DEFINE_CLASS_0(ntb_hw, ntb_intel_driver, ntb_in DRIVER_MODULE(ntb_hw_intel, pci, ntb_intel_driver, ntb_hw_devclass, NULL, NULL); MODULE_DEPEND(ntb_hw_intel, ntb, 1, 1, 1); MODULE_VERSION(ntb_hw_intel, 1); -MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ntb_hw_intel, pci_ids, +MODULE_PNP_INFO("W32:vendor/device;D:#", pci, ntb_hw_intel, pci_ids, sizeof(pci_ids[0]), nitems(pci_ids)); From owner-svn-src-head@freebsd.org Fri Dec 22 21:54:41 2017 Return-Path: Delivered-To: svn-src-head@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 219BCE8B143; Fri, 22 Dec 2017 21:54:41 +0000 (UTC) (envelope-from sevan@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 E302E680AC; Fri, 22 Dec 2017 21:54:40 +0000 (UTC) (envelope-from sevan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMLsdTG062746; Fri, 22 Dec 2017 21:54:39 GMT (envelope-from sevan@FreeBSD.org) Received: (from sevan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMLsdFH062745; Fri, 22 Dec 2017 21:54:39 GMT (envelope-from sevan@FreeBSD.org) Message-Id: <201712222154.vBMLsdFH062745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sevan set sender to sevan@FreeBSD.org using -f From: Sevan Janiyan Date: Fri, 22 Dec 2017 21:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327096 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: sevan X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 327096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 21:54:41 -0000 Author: sevan (doc committer) Date: Fri Dec 22 21:54:39 2017 New Revision: 327096 URL: https://svnweb.freebsd.org/changeset/base/327096 Log: Drop the NetBSD rcs tag introduced in r326868. Approved by: bcr (mentor) Differential Revision: https://reviews.freebsd.org/D13511 Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Dec 22 20:48:49 2017 (r327095) +++ head/share/misc/bsd-family-tree Fri Dec 22 21:54:39 2017 (r327096) @@ -794,4 +794,3 @@ Copyright (c) 1997-2012 Wolfram Schneider Delivered-To: svn-src-head@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 0F1C0E8BD96; Fri, 22 Dec 2017 22:57:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DFCEF6957E; Fri, 22 Dec 2017 22:57:47 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (astound-66-234-202-155.ca.astound.net [66.234.202.155]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3E6C510A8BC; Fri, 22 Dec 2017 17:57:40 -0500 (EST) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r327089 - in head/sys: dev/drm2/i915 dev/drm2/radeon dev/ed dev/intpm dev/ioat dev/ntb/ntb_hw net Date: Fri, 22 Dec 2017 12:32:40 -0800 Message-ID: <58258659.AhZTnNN286@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <201712221753.vBMHrStl063480@repo.freebsd.org> References: <201712221753.vBMHrStl063480@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Fri, 22 Dec 2017 17:57:40 -0500 (EST) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 22:57:48 -0000 On Friday, December 22, 2017 05:53:28 PM Warner Losh wrote: > Author: imp > Date: Fri Dec 22 17:53:27 2017 > New Revision: 327089 > URL: https://svnweb.freebsd.org/changeset/base/327089 > > Log: > Use '#' rather than some made up name for fields we want to ignore. Some of these used '@' rather than '#'? > Modified: head/sys/dev/drm2/radeon/radeon_drv.c > ============================================================================== > --- head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/drm2/radeon/radeon_drv.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -401,5 +401,5 @@ MODULE_DEPEND(radeonkms, iicbus, 1, 1, 1); > -MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:human", vgapci, radeonkms, > +MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:@", vgapci, radeonkms, > pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); > > Modified: head/sys/dev/ed/if_ed_pci.c > ============================================================================== > --- head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/ed/if_ed_pci.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -145,6 +145,6 @@ static driver_t ed_pci_driver = { > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ed, pci_ids, sizeof(pci_ids[0]), > +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ed, pci_ids, sizeof(pci_ids[0]), > nitems(pci_ids) - 1); > > > Modified: head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c > ============================================================================== > --- head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:52:38 2017 (r327088) > +++ head/sys/dev/ntb/ntb_hw/ntb_hw_intel.c Fri Dec 22 17:53:27 2017 (r327089) > @@ -3119,5 +3119,5 @@ static DEFINE_CLASS_0(ntb_hw, ntb_intel_driver, ntb_in > -MODULE_PNP_INFO("W32:vendor/device;D:human", pci, ntb_hw_intel, pci_ids, > +MODULE_PNP_INFO("W32:vendor/device;D:@", pci, ntb_hw_intel, pci_ids, > sizeof(pci_ids[0]), nitems(pci_ids)); -- John Baldwin From owner-svn-src-head@freebsd.org Fri Dec 22 22:58:43 2017 Return-Path: Delivered-To: svn-src-head@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 9A66BE8BE31; Fri, 22 Dec 2017 22:58:43 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 5CA2C696F6; Fri, 22 Dec 2017 22:58:42 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id E35C1F16; Sat, 23 Dec 2017 01:58:40 +0300 (MSK) Date: Sat, 23 Dec 2017 01:58:40 +0300 From: Oleg Bulyzhin To: Stephen Hurd Cc: Oleg Bulyzhin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org Subject: Re: svn commit: r327013 - head/sys/net Message-ID: <20171222225840.GA78272@lath.RINET.ru> References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 22:58:43 -0000 On Fri, Dec 22, 2017 at 01:22:20PM -0500, Stephen Hurd wrote: > Can you provide me with the output of ``sysctl kern.sched.topology_spec''? # sysctl kern.sched.topology_spec kern.sched.topology_spec: 0, 1, 2, 3 0 1 2 3 > And provide the new dmesg with this added output. ix0: port 0xcc00-0xcc1f mem 0xfde80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 ix0: using 2048 tx descriptors and 2048 rx descriptors ix0: msix_init qsets capped at 16 ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 ix0: using 4 rx queues 4 tx queues ix0: attempting to allocate 5 MSI-X vectors (64 supported) msi: routing MSI-X IRQ 259 to local APIC 0 vector 54 msi: routing MSI-X IRQ 260 to local APIC 0 vector 55 msi: routing MSI-X IRQ 261 to local APIC 0 vector 56 msi: routing MSI-X IRQ 262 to local APIC 0 vector 57 msi: routing MSI-X IRQ 263 to local APIC 0 vector 58 ix0: using IRQs 259-263 for MSI-X ix0: Using MSIX interrupts with 5 vectors ix0: allocated for 4 queues ix0: allocated for 4 rx queues ix0: irq=259, type=0, qid=0, name=rxq0 panic: Assertion gtask->gt_taskqueue != NULL failed at /usr/src/sys/net/iflib.c:5178 cpuid = 0 time = 1 KDB: enter: panic -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ From owner-svn-src-head@freebsd.org Fri Dec 22 23:27:05 2017 Return-Path: Delivered-To: svn-src-head@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 436EDE8C82F; Fri, 22 Dec 2017 23:27:05 +0000 (UTC) (envelope-from kib@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 147056B13D; Fri, 22 Dec 2017 23:27:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBMNR4Rd002898; Fri, 22 Dec 2017 23:27:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBMNR3w7002893; Fri, 22 Dec 2017 23:27:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712222327.vBMNR3w7002893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Dec 2017 23:27:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327097 - in head/sys/mips: include mips X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/mips: include mips X-SVN-Commit-Revision: 327097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Dec 2017 23:27:05 -0000 Author: kib Date: Fri Dec 22 23:27:03 2017 New Revision: 327097 URL: https://svnweb.freebsd.org/changeset/base/327097 Log: Remove mips MD atomic_load_64 and atomic_store_64. The only users of the functions were db_read_bytes() and db_write_bytes() ddb(4) interfaces. Replace the calls with direct reads and writes, which are automatically atomic on 64bits and n32. Note that removed assembler implementation for mips32 is not atomic anyway. Reviewed by: jhb Discussed with: imp Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D13586 Modified: head/sys/mips/include/atomic.h head/sys/mips/mips/db_interface.c head/sys/mips/mips/support.S Modified: head/sys/mips/include/atomic.h ============================================================================== --- head/sys/mips/include/atomic.h Fri Dec 22 21:54:39 2017 (r327096) +++ head/sys/mips/include/atomic.h Fri Dec 22 23:27:03 2017 (r327097) @@ -341,24 +341,6 @@ atomic_store_rel_##WIDTH(__volatile uint##WIDTH##_t *p ATOMIC_STORE_LOAD(32) ATOMIC_STORE_LOAD(64) -#if !defined(__mips_n64) && !defined(__mips_n32) -void atomic_store_64(__volatile uint64_t *, uint64_t); -uint64_t atomic_load_64(__volatile uint64_t *); -#elif defined (__mips_n32) -static __inline void -atomic_store_64(__volatile uint64_t *p, uint64_t v) -{ - *p = v; -} - -static __inline uint64_t -atomic_load_64(__volatile uint64_t *p) -{ - return (*p); -} -/* #else atomic_common.h definitions of atomic_load/store_64 are used */ -#endif - #undef ATOMIC_STORE_LOAD /* Modified: head/sys/mips/mips/db_interface.c ============================================================================== --- head/sys/mips/mips/db_interface.c Fri Dec 22 21:54:39 2017 (r327096) +++ head/sys/mips/mips/db_interface.c Fri Dec 22 23:27:03 2017 (r327097) @@ -152,6 +152,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat /* * 'addr' could be a memory-mapped I/O address. Try to * do atomic load/store in unit of size requested. + * size == 8 is only atomic on 64bit or n32 kernel. */ if ((size == 2 || size == 4 || size == 8) && ((addr & (size -1)) == 0) && @@ -164,8 +165,7 @@ db_read_bytes(vm_offset_t addr, size_t size, char *dat *(uint32_t *)data = *(uint32_t *)addr; break; case 8: - *(uint64_t *)data = atomic_load_64( - (void *)addr); + *(uint64_t *)data = *(uint64_t *)addr; break; } } else { @@ -195,6 +195,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da /* * 'addr' could be a memory-mapped I/O address. Try to * do atomic load/store in unit of size requested. + * size == 8 is only atomic on 64bit or n32 kernel. */ if ((size == 2 || size == 4 || size == 8) && ((addr & (size -1)) == 0) && @@ -207,8 +208,7 @@ db_write_bytes(vm_offset_t addr, size_t size, char *da *(uint32_t *)addr = *(uint32_t *)data; break; case 8: - atomic_store_64((uint64_t *)addr, - *(uint64_t *)data); + *(uint64_t *)addr = *(uint64_t *)data; break; } } else { Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Fri Dec 22 21:54:39 2017 (r327096) +++ head/sys/mips/mips/support.S Fri Dec 22 23:27:03 2017 (r327097) @@ -839,74 +839,7 @@ LEAF(atomic_subtract_8) nop END(atomic_subtract_8) -/* - * atomic 64-bit register read/write assembly language support routines. - */ - .set noreorder # Noreorder is default style! - -#if !defined(__mips_n64) && !defined(__mips_n32) - /* - * I don't know if these routines have the right number of - * NOPs in it for all processors. XXX - * - * Maybe it would be better to just leave this undefined in that case. - * - * XXX These routines are not safe in the case of a TLB miss on a1 or - * a0 unless the trapframe is 64-bit, which it just isn't with O32. - * If we take any exception, not just an interrupt, the upper - * 32-bits will be clobbered. Use only N32 and N64 kernels if you - * want to use 64-bit registers while interrupts are enabled or - * with memory operations. Since this isn't even using load-linked - * and store-conditional, perhaps it should just use two registers - * instead, as is right and good with the O32 ABI. - */ -LEAF(atomic_store_64) - mfc0 t1, MIPS_COP_0_STATUS - and t2, t1, ~MIPS_SR_INT_IE - mtc0 t2, MIPS_COP_0_STATUS - nop - nop - nop - nop - ld t0, (a1) - nop - nop - sd t0, (a0) - nop - nop - mtc0 t1,MIPS_COP_0_STATUS - nop - nop - nop - nop - j ra - nop -END(atomic_store_64) - -LEAF(atomic_load_64) - mfc0 t1, MIPS_COP_0_STATUS - and t2, t1, ~MIPS_SR_INT_IE - mtc0 t2, MIPS_COP_0_STATUS - nop - nop - nop - nop - ld t0, (a0) - nop - nop - sd t0, (a1) - nop - nop - mtc0 t1,MIPS_COP_0_STATUS - nop - nop - nop - nop - j ra - nop -END(atomic_load_64) -#endif #if defined(DDB) || defined(DEBUG) From owner-svn-src-head@freebsd.org Sat Dec 23 00:40:06 2017 Return-Path: Delivered-To: svn-src-head@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 45780E8DE9B; Sat, 23 Dec 2017 00:40:06 +0000 (UTC) (envelope-from shurd@sasktel.net) Received: from mail101c7.megamailservers.com (mail501c7.megamailservers.com [209.235.141.1]) (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 6F9DF6CF6F; Sat, 23 Dec 2017 00:40:04 +0000 (UTC) (envelope-from shurd@sasktel.net) X-Authenticated-User: hurds.sasktel.net X-VIP: 69.49.109.87 Received: from [192.168.0.33] (c-107-5-177-180.hsd1.mi.comcast.net [107.5.177.180]) (authenticated bits=0) by mail101c7.megamailservers.com (8.14.9/8.13.1) with ESMTP id vBN0BacF009476; Fri, 22 Dec 2017 19:11:38 -0500 Subject: Re: svn commit: r327013 - head/sys/net To: Oleg Bulyzhin , Stephen Hurd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> <20171222225840.GA78272@lath.RINET.ru> From: Stephen Hurd Message-ID: Date: Fri, 22 Dec 2017 19:11:36 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:51.0) Gecko/20100101 Firefox/51.0 SeaMonkey/2.48 MIME-Version: 1.0 In-Reply-To: <20171222225840.GA78272@lath.RINET.ru> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CTCH-RefID: str=0001.0A020203.5A3D9F3A.00AB, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.2 cv=VcCHBBh9 c=1 sm=1 tr=0 a=qjOqI3gpwxmQgA7j5BgDJQ==:117 a=qjOqI3gpwxmQgA7j5BgDJQ==:17 a=IkcTkHD0fZMA:10 a=lXmGUxgZMlm7YPxNZJAA:9 a=QEXdDO2ut3YA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 00:40:06 -0000 Oleg Bulyzhin wrote: > On Fri, Dec 22, 2017 at 01:22:20PM -0500, Stephen Hurd wrote: >> Can you provide me with the output of ``sysctl kern.sched.topology_spec''? > # sysctl kern.sched.topology_spec > kern.sched.topology_spec: > > 0, 1, 2, 3 > > > 0 > > > 1 > > > 2 > > > 3 > > > > > >> And provide the new dmesg with this added output. > ix0: port 0xcc00-0xcc1f mem 0xfde80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 > ix0: using 2048 tx descriptors and 2048 rx descriptors > ix0: msix_init qsets capped at 16 > ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 > ix0: using 4 rx queues 4 tx queues > ix0: attempting to allocate 5 MSI-X vectors (64 supported) > msi: routing MSI-X IRQ 259 to local APIC 0 vector 54 > msi: routing MSI-X IRQ 260 to local APIC 0 vector 55 > msi: routing MSI-X IRQ 261 to local APIC 0 vector 56 > msi: routing MSI-X IRQ 262 to local APIC 0 vector 57 > msi: routing MSI-X IRQ 263 to local APIC 0 vector 58 > ix0: using IRQs 259-263 for MSI-X > ix0: Using MSIX interrupts with 5 vectors > ix0: allocated for 4 queues > ix0: allocated for 4 rx queues > ix0: irq=259, type=0, qid=0, name=rxq0 > panic: Assertion gtask->gt_taskqueue != NULL failed at /usr/src/sys/net/iflib.c:5178 > cpuid = 0 > time = 1 > KDB: enter: panic Interesting... is this a standard GENERIC kernel, or is this a custom config? If a custom config, can you send it to me? Also, does this system have any other iflib drivers? igb, em, or bnxt? Can you include the log info (if any) for them as well? From owner-svn-src-head@freebsd.org Sat Dec 23 04:50:54 2017 Return-Path: Delivered-To: svn-src-head@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 6E160E98726; Sat, 23 Dec 2017 04:50:54 +0000 (UTC) (envelope-from imp@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 38430751CD; Sat, 23 Dec 2017 04:50:54 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN4oro8038019; Sat, 23 Dec 2017 04:50:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN4or10038018; Sat, 23 Dec 2017 04:50:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712230450.vBN4or10038018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 04:50:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327098 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 04:50:54 -0000 Author: imp Date: Sat Dec 23 04:50:52 2017 New Revision: 327098 URL: https://svnweb.freebsd.org/changeset/base/327098 Log: The device tables end with a sentinel in iflib. Don't include the sentinel in the output. Modified: head/sys/net/iflib.h Modified: head/sys/net/iflib.h ============================================================================== --- head/sys/net/iflib.h Fri Dec 22 23:27:03 2017 (r327097) +++ head/sys/net/iflib.h Sat Dec 23 04:50:52 2017 (r327098) @@ -176,7 +176,7 @@ typedef struct pci_vendor_info { #define IFLIB_PNP_DESCR "U32:vendor;U32:device;U32:subvendor;U32:subdevice;" \ "U32:revision;U32:class;D:#" #define IFLIB_PNP_INFO(b, u, t) \ - MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t)) + MODULE_PNP_INFO(IFLIB_PNP_DESCR, b, u, t, sizeof(t[0]), nitems(t) - 1) typedef struct if_txrx { int (*ift_txd_encap) (void *, if_pkt_info_t); From owner-svn-src-head@freebsd.org Sat Dec 23 05:13:40 2017 Return-Path: Delivered-To: svn-src-head@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 B795DE99380; Sat, 23 Dec 2017 05:13:40 +0000 (UTC) (envelope-from eadler@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 81DC075DE5; Sat, 23 Dec 2017 05:13:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN5DdT5050413; Sat, 23 Dec 2017 05:13:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN5Ddi3050412; Sat, 23 Dec 2017 05:13:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712230513.vBN5Ddi3050412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Dec 2017 05:13:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327099 - head/lib/libc/stdio X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libc/stdio X-SVN-Commit-Revision: 327099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 05:13:40 -0000 Author: eadler Date: Sat Dec 23 05:13:39 2017 New Revision: 327099 URL: https://svnweb.freebsd.org/changeset/base/327099 Log: fopen.1: document truncation This documentation truncation similar to POSIX and glibc. PR: 202545 Reported by: intron@intron.ac Modified: head/lib/libc/stdio/fopen.3 Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Sat Dec 23 04:50:52 2017 (r327098) +++ head/lib/libc/stdio/fopen.3 Sat Dec 23 05:13:39 2017 (r327099) @@ -72,7 +72,7 @@ Fail if the file does not exist. .It Dq Li w Open for writing. The stream is positioned at the beginning of the file. -Create the file if it does not exist. +Truncate the file to zero length if it exists or create the file if it does not exist. .It Dq Li a Open for writing. The stream is positioned at the end of the file. From owner-svn-src-head@freebsd.org Sat Dec 23 05:32:22 2017 Return-Path: Delivered-To: svn-src-head@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 2F0A2E9A044; Sat, 23 Dec 2017 05:32:22 +0000 (UTC) (envelope-from imp@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 EBF8976982; Sat, 23 Dec 2017 05:32:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN5WKTA056510; Sat, 23 Dec 2017 05:32:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN5WK8d056508; Sat, 23 Dec 2017 05:32:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712230532.vBN5WK8d056508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 05:32:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327100 - in head/sys/dev/drm2: i915 radeon X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/dev/drm2: i915 radeon X-SVN-Commit-Revision: 327100 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 05:32:22 -0000 Author: imp Date: Sat Dec 23 05:32:20 2017 New Revision: 327100 URL: https://svnweb.freebsd.org/changeset/base/327100 Log: These drivers have a sentinel at the end of the device list. Exclude it. Modified: head/sys/dev/drm2/i915/i915_drv.c head/sys/dev/drm2/radeon/radeon_drv.c Modified: head/sys/dev/drm2/i915/i915_drv.c ============================================================================== --- head/sys/dev/drm2/i915/i915_drv.c Sat Dec 23 05:13:39 2017 (r327099) +++ head/sys/dev/drm2/i915/i915_drv.c Sat Dec 23 05:32:20 2017 (r327100) @@ -1237,7 +1237,7 @@ MODULE_DEPEND(i915kms, iicbus, 1, 1, 1); MODULE_DEPEND(i915kms, iic, 1, 1, 1); MODULE_DEPEND(i915kms, iicbb, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, i915, pciidlist, - sizeof(pciidlist[0]), nitems(pciidlist)); + sizeof(pciidlist[0]), nitems(pciidlist) - 1); /* We give fast paths for the really cool registers */ #define NEEDS_FORCE_WAKE(dev_priv, reg) \ Modified: head/sys/dev/drm2/radeon/radeon_drv.c ============================================================================== --- head/sys/dev/drm2/radeon/radeon_drv.c Sat Dec 23 05:13:39 2017 (r327099) +++ head/sys/dev/drm2/radeon/radeon_drv.c Sat Dec 23 05:32:20 2017 (r327100) @@ -402,4 +402,4 @@ MODULE_DEPEND(radeonkms, iic, 1, 1, 1); MODULE_DEPEND(radeonkms, iicbb, 1, 1, 1); MODULE_DEPEND(radeonkms, firmware, 1, 1, 1); MODULE_PNP_INFO("U32:vendor;U32:device;P:#;D:#", vgapci, radeonkms, - pciidlist, sizeof(pciidlist[0]), nitems(pciidlist)); + pciidlist, sizeof(pciidlist[0]), nitems(pciidlist) - 1); From owner-svn-src-head@freebsd.org Sat Dec 23 06:11:21 2017 Return-Path: Delivered-To: svn-src-head@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 3B8E0E9B4CB; Sat, 23 Dec 2017 06:11:21 +0000 (UTC) (envelope-from imp@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 05C8D77C3B; Sat, 23 Dec 2017 06:11:20 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN6BKO8074530; Sat, 23 Dec 2017 06:11:20 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN6BK7W074529; Sat, 23 Dec 2017 06:11:20 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712230611.vBN6BK7W074529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 06:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327101 - head/sys/dev/pccard X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/dev/pccard X-SVN-Commit-Revision: 327101 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 06:11:21 -0000 Author: imp Date: Sat Dec 23 06:11:19 2017 New Revision: 327101 URL: https://svnweb.freebsd.org/changeset/base/327101 Log: Expand cryptic comment with inforation I've learned in the mean time about CIS3/CIS4, including studies I've done on my large collection of PC Cards bought off e-bay over the years since the original entry as well as conversations I've had at conferences. Modified: head/sys/dev/pccard/pccardvar.h Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Sat Dec 23 05:32:20 2017 (r327100) +++ head/sys/dev/pccard/pccardvar.h Sat Dec 23 06:11:19 2017 (r327101) @@ -88,10 +88,18 @@ struct pccard_product { }; /** - * Note: There's no cis3 or cis4 reported for NOMATCH / pnpinfo events for pccard - * It's unclear if we actually need that for automatic loading or not. These stirngs - * are informative, according to the standard, but I have a dim memory of using these - * strings to match things, though I can't find the example right now. + * Note: There's no cis3 or cis4 reported for NOMATCH / pnpinfo events for + * pccard It's unclear if we actually need that for automatic loading or + * not. These stirngs are informative, according to the standard. Some Linux + * drivers match on them, for example. However, FreeBSD's hardware probing is a + * little different than Linux so it turns out we don't need them. Some cards + * use CIS3 or CIS4 for a textual representation of the MAC address. In short, + * they aren't needed even though our friends in Linux have them. It is my + * belief that all the entries in Linux don't actually need to be separate there + * either, but it's hard to eliminate them and retest on old, possibly rare, + * hardware so they persist. Despite years of collecting ~300 different PC Cards + * off E-Bay, I've not been able to find any that need CIS3/CIS4 to select which + * device attaches. */ #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" #define PCCARD_PNP_INFO(t) \ From owner-svn-src-head@freebsd.org Sat Dec 23 06:49:30 2017 Return-Path: Delivered-To: svn-src-head@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 ABF33E9D260; Sat, 23 Dec 2017 06:49:30 +0000 (UTC) (envelope-from imp@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 62B7978C12; Sat, 23 Dec 2017 06:49:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN6nT6V088200; Sat, 23 Dec 2017 06:49:29 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN6nRDO088177; Sat, 23 Dec 2017 06:49:27 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712230649.vBN6nRDO088177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 06:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327102 - in head/sys: dev/aha dev/aic dev/an dev/atkbdc dev/cs dev/ed dev/ep dev/ex dev/fdc dev/fe dev/joy dev/le dev/mse dev/pccard dev/pccbb dev/ppc dev/sbni dev/sio dev/uart isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: dev/aha dev/aic dev/an dev/atkbdc dev/cs dev/ed dev/ep dev/ex dev/fdc dev/fe dev/joy dev/le dev/mse dev/pccard dev/pccbb dev/ppc dev/sbni dev/sio dev/uart isa X-SVN-Commit-Revision: 327102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 06:49:30 -0000 Author: imp Date: Sat Dec 23 06:49:27 2017 New Revision: 327102 URL: https://svnweb.freebsd.org/changeset/base/327102 Log: Create a new ISA_PNP_INFO macro. Use this macro every where we have ISA PNP card support (replace by hand version in if_ed). Move module declarations to the end of some files. Fix PCCARD_PNP_INFO to use nitems(). Remove some stale comments about pc98, turns out the comment was simply wrong. Modified: head/sys/dev/aha/aha_isa.c head/sys/dev/aic/aic_isa.c head/sys/dev/an/if_an_isa.c head/sys/dev/atkbdc/atkbdc_isa.c head/sys/dev/cs/if_cs_isa.c head/sys/dev/ed/if_ed_isa.c head/sys/dev/ep/if_ep_isa.c head/sys/dev/ex/if_ex_isa.c head/sys/dev/fdc/fdc_isa.c head/sys/dev/fe/if_fe_isa.c head/sys/dev/joy/joy_isa.c head/sys/dev/le/if_le_isa.c head/sys/dev/mse/mse_isa.c head/sys/dev/pccard/pccardvar.h head/sys/dev/pccbb/pccbb_isa.c head/sys/dev/ppc/ppc_isa.c head/sys/dev/sbni/if_sbni_isa.c head/sys/dev/sio/sio_isa.c head/sys/dev/uart/uart_bus_isa.c head/sys/isa/isavar.h Modified: head/sys/dev/aha/aha_isa.c ============================================================================== --- head/sys/dev/aha/aha_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/aha/aha_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -362,3 +362,4 @@ static devclass_t aha_devclass; DRIVER_MODULE(aha, isa, aha_isa_driver, aha_devclass, 0, 0); MODULE_DEPEND(aha, isa, 1, 1, 1); +ISA_PNP_INFO(aha_ids); Modified: head/sys/dev/aic/aic_isa.c ============================================================================== --- head/sys/dev/aic/aic_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/aic/aic_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -242,3 +242,4 @@ extern devclass_t aic_devclass; MODULE_DEPEND(aic, cam, 1,1,1); DRIVER_MODULE(aic, isa, aic_isa_driver, aic_devclass, 0, 0); +ISA_PNP_INFO(aic_ids); Modified: head/sys/dev/an/if_an_isa.c ============================================================================== --- head/sys/dev/an/if_an_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/an/if_an_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -150,3 +150,4 @@ static devclass_t an_isa_devclass; DRIVER_MODULE(an, isa, an_isa_driver, an_isa_devclass, 0, 0); MODULE_DEPEND(an, isa, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); +ISA_PNP_INFO(an_ids); Modified: head/sys/dev/atkbdc/atkbdc_isa.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/atkbdc/atkbdc_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -322,3 +322,4 @@ atkbdc_isa_release_resource(device_t dev, device_t chi DRIVER_MODULE(atkbdc, isa, atkbdc_isa_driver, atkbdc_devclass, 0, 0); DRIVER_MODULE(atkbdc, acpi, atkbdc_isa_driver, atkbdc_devclass, 0, 0); +ISA_PNP_INFO(atkbdc_ids); Modified: head/sys/dev/cs/if_cs_isa.c ============================================================================== --- head/sys/dev/cs/if_cs_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/cs/if_cs_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -120,3 +120,4 @@ extern devclass_t cs_devclass; DRIVER_MODULE(cs, isa, cs_isa_driver, cs_devclass, 0, 0); MODULE_DEPEND(cs, isa, 1, 1, 1); MODULE_DEPEND(cs, ether, 1, 1, 1); +ISA_PNP_INFO(cs_ids); Modified: head/sys/dev/ed/if_ed_isa.c ============================================================================== --- head/sys/dev/ed/if_ed_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/ed/if_ed_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -203,6 +203,4 @@ static driver_t ed_isa_driver = { DRIVER_MODULE(ed, isa, ed_isa_driver, ed_devclass, 0, 0); MODULE_DEPEND(ed, isa, 1, 1, 1); MODULE_DEPEND(ed, ether, 1, 1, 1); -MODULE_PNP_INFO("E:pnpid;", isa, ed, ed_ids, sizeof(ed_ids[0]), - nitems(ed_ids) - 1); - +ISA_PNP_INFO(ed_ids); Modified: head/sys/dev/ep/if_ep_isa.c ============================================================================== --- head/sys/dev/ep/if_ep_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/ep/if_ep_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -395,3 +395,4 @@ DRIVER_MODULE(ep, isa, ep_isa_driver, ep_devclass, 0, #ifdef __i386__ MODULE_DEPEND(ep, elink, 1, 1, 1); #endif +ISA_PNP_INFO(ep_ids); Modified: head/sys/dev/ex/if_ex_isa.c ============================================================================== --- head/sys/dev/ex/if_ex_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/ex/if_ex_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -82,8 +82,6 @@ static driver_t ex_isa_driver = { sizeof(struct ex_softc), }; -DRIVER_MODULE(ex, isa, ex_isa_driver, ex_devclass, 0, 0); - static struct isa_pnp_id ex_ids[] = { { 0x3110d425, NULL }, /* INT1031 */ { 0x3010d425, NULL }, /* INT1030 */ @@ -337,3 +335,6 @@ ex_look_for_card(struct ex_softc *sc) return((count2 & Counter_bits) == ((count1 + 0xc0) & Counter_bits)); } + +DRIVER_MODULE(ex, isa, ex_isa_driver, ex_devclass, 0, 0); +ISA_PNP_INFO(ex_ids); Modified: head/sys/dev/fdc/fdc_isa.c ============================================================================== --- head/sys/dev/fdc/fdc_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/fdc/fdc_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -224,3 +224,4 @@ static driver_t fdc_driver = { }; DRIVER_MODULE(fdc, isa, fdc_driver, fdc_devclass, 0, 0); +ISA_PNP_INFO(fdc_ids); Modified: head/sys/dev/fe/if_fe_isa.c ============================================================================== --- head/sys/dev/fe/if_fe_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/fe/if_fe_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -68,9 +68,6 @@ static driver_t fe_isa_driver = { sizeof (struct fe_softc) }; -DRIVER_MODULE(fe, isa, fe_isa_driver, fe_devclass, 0, 0); - - static int fe_probe_ssi(device_t); static int fe_probe_jli(device_t); static int fe_probe_fmv(device_t); @@ -1062,3 +1059,5 @@ fe_probe_ubn(device_t dev) return 0; } + +DRIVER_MODULE(fe, isa, fe_isa_driver, fe_devclass, 0, 0); Modified: head/sys/dev/joy/joy_isa.c ============================================================================== --- head/sys/dev/joy/joy_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/joy/joy_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -85,3 +85,4 @@ static driver_t joy_isa_driver = { DRIVER_MODULE(joy, isa, joy_isa_driver, joy_devclass, 0, 0); DRIVER_MODULE(joy, acpi, joy_isa_driver, joy_devclass, 0, 0); +ISA_PNP_INFO(joy_ids); Modified: head/sys/dev/le/if_le_isa.c ============================================================================== --- head/sys/dev/le/if_le_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/le/if_le_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -135,10 +135,6 @@ static device_method_t le_isa_methods[] = { { 0, 0 } }; -DEFINE_CLASS_0(le, le_isa_driver, le_isa_methods, sizeof(struct le_isa_softc)); -DRIVER_MODULE(le, isa, le_isa_driver, le_devclass, 0, 0); -MODULE_DEPEND(le, ether, 1, 1, 1); - struct le_isa_param { const char *name; u_long iosize; @@ -496,3 +492,8 @@ le_isa_resume(device_t dev) return (0); } + +DEFINE_CLASS_0(le, le_isa_driver, le_isa_methods, sizeof(struct le_isa_softc)); +DRIVER_MODULE(le, isa, le_isa_driver, le_devclass, 0, 0); +MODULE_DEPEND(le, ether, 1, 1, 1); +ISA_PNP_INFO(le_isa_ids); Modified: head/sys/dev/mse/mse_isa.c ============================================================================== --- head/sys/dev/mse/mse_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/mse/mse_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -107,8 +107,6 @@ static driver_t mse_driver = { sizeof(mse_softc_t), }; -DRIVER_MODULE(mse, isa, mse_driver, mse_devclass, 0, 0); - static struct isa_pnp_id mse_ids[] = { { 0x000fd041, "Bus mouse" }, /* PNP0F00 */ { 0x020fd041, "InPort mouse" }, /* PNP0F02 */ @@ -390,3 +388,6 @@ mse_getati(struct resource *port, int *dx, int *dy, in bus_write_1(port, MSE_PORTA, MSE_INPORT_MODE); bus_write_1(port, MSE_PORTB, MSE_INPORT_INTREN); } + +DRIVER_MODULE(mse, isa, mse_driver, mse_devclass, 0, 0); +ISA_PNP_INFO(mse_ids); Modified: head/sys/dev/pccard/pccardvar.h ============================================================================== --- head/sys/dev/pccard/pccardvar.h Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/pccard/pccardvar.h Sat Dec 23 06:49:27 2017 (r327102) @@ -103,7 +103,7 @@ struct pccard_product { */ #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" #define PCCARD_PNP_INFO(t) \ - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]) - 1); \ + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \ typedef int (*pccard_product_match_fn) (device_t dev, const struct pccard_product *ent, int vpfmatch); Modified: head/sys/dev/pccbb/pccbb_isa.c ============================================================================== --- head/sys/dev/pccbb/pccbb_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/pccbb/pccbb_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -106,7 +106,6 @@ SYSCTL_INT(_hw_pcic, OID_AUTO, pd6722_vsense, CTLFLAG_ #define DPRINTF(x) do { if (cbb_debug) printf x; } while (0) #define DEVPRINTF(x) do { if (cbb_debug) device_printf x; } while (0) -/* XXX Not sure that PNP0E03 should be claimed, except maybe on pc98 */ static struct isa_pnp_id pcic_ids[] = { {EXCA_PNP_ACTIONTEC, NULL}, /* AEI0218 */ {EXCA_PNP_IBM3765, NULL}, /* IBM3765 */ @@ -255,3 +254,4 @@ static driver_t cbb_isa_driver = { DRIVER_MODULE(cbb, isa, cbb_isa_driver, cbb_devclass, 0, 0); MODULE_DEPEND(cbb, exca, 1, 1, 1); +ISA_PNP_INFO(pcic_ids); Modified: head/sys/dev/ppc/ppc_isa.c ============================================================================== --- head/sys/dev/ppc/ppc_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/ppc/ppc_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -274,3 +274,4 @@ error: } DRIVER_MODULE(ppc, isa, ppc_isa_driver, ppc_devclass, 0, 0); +ISA_PNP_INFO(lpc_ids); Modified: head/sys/dev/sbni/if_sbni_isa.c ============================================================================== --- head/sys/dev/sbni/if_sbni_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/sbni/if_sbni_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -71,9 +71,6 @@ static struct isa_pnp_id sbni_ids[] = { { 0, NULL } /* we have no pnp sbni cards atm. */ }; -DRIVER_MODULE(sbni, isa, sbni_isa_driver, sbni_isa_devclass, 0, 0); -MODULE_DEPEND(sbni, isa, 1, 1, 1); - static int sbni_probe_isa(device_t dev) { @@ -166,3 +163,6 @@ sbni_attach_isa(device_t dev) return (0); } + +DRIVER_MODULE(sbni, isa, sbni_isa_driver, sbni_isa_devclass, 0, 0); +MODULE_DEPEND(sbni, isa, 1, 1, 1); Modified: head/sys/dev/sio/sio_isa.c ============================================================================== --- head/sys/dev/sio/sio_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/sio/sio_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -175,3 +175,4 @@ DRIVER_MODULE(sio, isa, sio_isa_driver, sio_devclass, #ifndef COM_NO_ACPI DRIVER_MODULE(sio, acpi, sio_isa_driver, sio_devclass, 0, 0); #endif +ISA_PNP_INFO(sio_ids); Modified: head/sys/dev/uart/uart_bus_isa.c ============================================================================== --- head/sys/dev/uart/uart_bus_isa.c Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/dev/uart/uart_bus_isa.c Sat Dec 23 06:49:27 2017 (r327102) @@ -172,3 +172,4 @@ uart_isa_probe(device_t dev) } DRIVER_MODULE(uart, isa, uart_isa_driver, uart_devclass, 0, 0); +ISA_PNP_INFO(isa_ns8250_ids); Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sat Dec 23 06:11:19 2017 (r327101) +++ head/sys/isa/isavar.h Sat Dec 23 06:49:27 2017 (r327102) @@ -140,6 +140,10 @@ enum isa_device_ivars { #define ISACFGATTR_DYNAMIC (1 << 1) /* dynamic configuration */ #define ISACFGATTR_HINTS (1 << 3) /* source of config is hints */ +#define ISA_PNP_DESCR "E:pnpid;D:#" +#define ISA_PNP_INFO(t) \ + MODULE_PNP_INFO(ISA_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \ + /* * Simplified accessors for isa devices */ From owner-svn-src-head@freebsd.org Sat Dec 23 07:02:46 2017 Return-Path: Delivered-To: svn-src-head@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 E9F95E9D77A; Sat, 23 Dec 2017 07:02:46 +0000 (UTC) (envelope-from imp@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 B77237934B; Sat, 23 Dec 2017 07:02:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBN72j5Y096945; Sat, 23 Dec 2017 07:02:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBN72jqs096944; Sat, 23 Dec 2017 07:02:45 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712230702.vBN72jqs096944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 07:02:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327103 - head/sys/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/isa X-SVN-Commit-Revision: 327103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 07:02:47 -0000 Author: imp Date: Sat Dec 23 07:02:45 2017 New Revision: 327103 URL: https://svnweb.freebsd.org/changeset/base/327103 Log: Fix cut-and-paste error s/pccard/isa/ Modified: head/sys/isa/isavar.h Modified: head/sys/isa/isavar.h ============================================================================== --- head/sys/isa/isavar.h Sat Dec 23 06:49:27 2017 (r327102) +++ head/sys/isa/isavar.h Sat Dec 23 07:02:45 2017 (r327103) @@ -142,7 +142,7 @@ enum isa_device_ivars { #define ISA_PNP_DESCR "E:pnpid;D:#" #define ISA_PNP_INFO(t) \ - MODULE_PNP_INFO(ISA_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1); \ + MODULE_PNP_INFO(ISA_PNP_DESCR, isa, t, t, sizeof(t[0]), nitems(t) - 1); \ /* * Simplified accessors for isa devices From owner-svn-src-head@freebsd.org Sat Dec 23 08:47:04 2017 Return-Path: Delivered-To: svn-src-head@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 F00A1EA0250 for ; Sat, 23 Dec 2017 08:47:04 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from dec.sakura.ne.jp (dec.sakura.ne.jp [210.188.226.8]) (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 B0C2B7BC44; Sat, 23 Dec 2017 08:47:04 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from fortune.joker.local (124-18-70-98.dz.commufa.jp [124.18.70.98]) (authenticated bits=0) by dec.sakura.ne.jp (8.15.2/8.15.2/[SAKURA-WEB]/20080708) with ESMTPA id vBN7vBrC095080; Sat, 23 Dec 2017 16:57:12 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Sat, 23 Dec 2017 16:57:11 +0900 From: Tomoaki AOKI To: svn-src-head@freebsd.org Cc: mizhka@FreeBSD.org Subject: Re: svn commit: r327058 - head/stand/efi/boot1 Message-Id: <20171223165711.0d11906f601133e66289105a@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; amd64-portbld-freebsd11.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 08:47:05 -0000 This broke screen after kernel starts. ThinkPad T420 with nvidia NVS 4200M. boot1 screen and loader screen (beastie menu) shows up smaller (but not broken) than usual, and small five interlaced kernel outputs (not actually readable at all) are shown on top of screen. So screen resolution setting should be different and not re-initialized in kernel properly. *Setting hw.vga.textmode (0 and 1) didn't help. *Setting resolution (assuming it wouldn't work, though) via kern.vt.fb.default_mode didn't work as expected. (the option is for scfb, not for UEFI fb.) *Removing nvidia.ko and nvidia-modeset.ko from loader.conf didn't help. *Last known-to-be-OK revision was r326876 and no other commit is done to boot1 codes before this rev. *Using known-to-be-OK rev of boot1.efi, all goes fine. As some commits are done to toolchain codes, I tried rebuilding known-to-be-OK boot1.efi with current toolchains and confirmed working OK. > Author: mizhka > Date: Thu Dec 21 12:21:35 2017 > New Revision: 327058 > URL: https://svnweb.freebsd.org/changeset/base/327058 > > Log: > [boot/efi] scan all display modes rather than sequential try-fail way > > This patch allows to scan all display modes in boot1 as loader does. > > Before system tried to select optimal display mode by sequential scan of > modes and if error then stop scanning. This way is not good, because > if mode N is not present, mode N+1 may exist. > > In loader we use conout->Mode->MaxMode to identify maximum number of modes. > This commit is to use same way in boot1 as in loader. > Reported by: Andrey Pustovetov > Reviewed by: tsoome > Differential Revision: https://reviews.freebsd.org/D13541 > > Modified: > head/stand/efi/boot1/boot1.c > > Modified: head/stand/efi/boot1/boot1.c > ============================================================================== > --- head/stand/efi/boot1/boot1.c Thu Dec 21 09:21:40 2017 (r327057) > +++ head/stand/efi/boot1/boot1.c Thu Dec 21 12:21:35 2017 (r327058) > @@ -430,10 +430,10 @@ efi_main(EFI_HANDLE Ximage, EFI_SYSTEM_TABLE *Xsystab) > conout = ST->ConOut; > conout->Reset(conout, TRUE); > max_dim = best_mode = 0; > - for (i = 0; ; i++) { > + for (i = 0; i < conout->Mode->MaxMode; i++) { > status = conout->QueryMode(conout, i, &cols, &rows); > if (EFI_ERROR(status)) > - break; > + continue; > if (cols * rows > max_dim) { > max_dim = cols * rows; > best_mode = i; -- Tomoaki AOKI From owner-svn-src-head@freebsd.org Sat Dec 23 10:57:08 2017 Return-Path: Delivered-To: svn-src-head@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 D32C0EA28F2; Sat, 23 Dec 2017 10:57:08 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: from lath.rinet.ru (lath.rinet.ru [195.54.192.90]) by mx1.freebsd.org (Postfix) with ESMTP id 3F7507F602; Sat, 23 Dec 2017 10:57:07 +0000 (UTC) (envelope-from oleg@lath.rinet.ru) Received: by lath.rinet.ru (Postfix, from userid 222) id 8B72D4D8; Sat, 23 Dec 2017 13:57:06 +0300 (MSK) Date: Sat, 23 Dec 2017 13:57:06 +0300 From: Oleg Bulyzhin To: Stephen Hurd Cc: Oleg Bulyzhin , Stephen Hurd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Sean Bruno , erj@freebsd.org Subject: Re: svn commit: r327013 - head/sys/net Message-ID: <20171223105706.GA86594@lath.RINET.ru> References: <201712200103.vBK13YgS025896@repo.freebsd.org> <20171222115825.GA69149@lath.RINET.ru> <16beab6b-3252-1f84-33f4-f9fc49f158a2@FreeBSD.org> <20171222225840.GA78272@lath.RINET.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qDbXVdCdHGoSgWSk" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 10:57:08 -0000 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 22, 2017 at 07:11:36PM -0500, Stephen Hurd wrote: > Interesting... is this a standard GENERIC kernel, or is this a custom > config? If a custom config, can you send it to me? > > Also, does this system have any other iflib drivers? igb, em, or bnxt? > Can you include the log info (if any) for them as well? It's custom kernel on my testing machine. It has em too but ix is probed first.. If i comment out if_ix.ko load - it boots just fine (looks like if_em is not calling iflib_irq_set_affinity()): em0: port 0xdc00-0xdc1f mem 0xfeae0000-0x feafffff,0xfeac0000-0xfeadffff irq 17 at device 0.0 on pci3 em0: attach_pre capping queues at 1 em0: using 1024 tx descriptors and 1024 rx descriptors em0: msix_init qsets capped at 1 em0: PCIY_MSIX capability not found; or rid 0 == 0. em0: Using a Legacy interrupt em0: allocated for 1 tx_queues em0: allocated for 1 rx_queues ioapic0: routing intpin 17 (PCI IRQ 17) to lapic 0 vector 54 em0: bpf attached em0: Ethernet address: 00:15:17:3a:0c:7a em0: netmap queues/slots: TX 1/1024, RX 1/1024 P.S. verbose dmesg & kernel conf attached -- Oleg. ================================================================ === Oleg Bulyzhin -- OBUL-RIPN -- OBUL-RIPE -- oleg@rinet.ru === ================================================================ --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=dmesg /boot/config: 0:ad(0,a)/boot/loader -Dh -S115200 FreeBSD/x86 boot Default: 0:ad(0,a)/boot/loader boot: Consoles: internal video/keyboard serial port BIOS drive C: is disk0 BIOS 619kB/3111360kB available memory FreeBSD/x86 bootstrap loader, Revision 1.1 (Thu Dec 21 19:31:04 MSK 2017 root@slave.rinet.ru) Loading /boot/defaults/loader.conf /boot/kernel/kernel text=0x5826b8 data=0x7d500+0x2b3378 syms=[0x8+0x9e880+0x8+0xa0fbf] /boot/entropy size=0x1000 /boot/kernel/nullfs.ko size 0xbd30 at 0xdf4000 /boot/kernel/geom_mirror.ko size 0x2c968 at 0xe00000 /boot/kernel/ipfw.ko size 0x47820 at 0xe2d000 /boot/kernel/carp.ko size 0x13420 at 0xe75000 /boot/kernel/if_bge.ko size 0x247c8 at 0xe89000 loading required module 'miibus' /boot/kernel/miibus.ko size 0x414b8 at 0xeae000 /boot/kernel/if_em.ko size 0x6ca88 at 0xef0000 /boot/kernel/if_nfe.ko size 0x13480 at 0xf5d000 /boot/kernel/if_re.ko size 0x13e98 at 0xf71000 /boot/kernel/if_ix.ko size 0x52bc0 at 0xf85000 /boot/kernel/libalias.ko size 0x19dd8 at 0xfd8000 Hit [Enter] to boot immediately, or any other key for command prompt. Booting [/boot/kernel/kernel]... GDB: no debug ports present KDB: debugger backends: ddb KDB: current backend: ddb Table 'FACP' at 0xbdf70290 Table 'APIC' at 0xbdf70390 APIC: Found table at 0xbdf70390 APIC: Using the MADT enumerator. Copyright (c) 1992-2017 The FreeBSD Project. Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 12.0-CURRENT #5 r327061M: Sat Dec 23 01:53:58 MSK 2017 root@slave.rinet.ru:/usr/obj/usr/src/amd64.amd64/sys/slave-amd64-smp-debug amd64 FreeBSD clang version 5.0.1 (tags/RELEASE_501/final 320880) (based on LLVM 5.0.1) WARNING: WITNESS option enabled, expect reduced performance. WARNING: DIAGNOSTIC option enabled, expect reduced performance. Table 'FACP' at 0xbdf70290 Table 'APIC' at 0xbdf70390 Table 'MCFG' at 0xbdf70420 Table 'OEMB' at 0xbdf88040 Table 'HPET' at 0xbdf7f8b0 Table 'SSDT' at 0xbdf7f8f0 ACPI: No SRAT table found Preloaded elf kernel "/boot/kernel/kernel" at 0xffffffff80ff2000. Preloaded boot_entropy_cache "/boot/entropy" at 0xffffffff80ffacd8. Preloaded elf obj module "/boot/kernel/nullfs.ko" at 0xffffffff80ffad30. Preloaded elf obj module "/boot/kernel/geom_mirror.ko" at 0xffffffff80ffb358. Preloaded elf obj module "/boot/kernel/ipfw.ko" at 0xffffffff80ffba48. Preloaded elf obj module "/boot/kernel/carp.ko" at 0xffffffff80ffc0f0. Preloaded elf obj module "/boot/kernel/if_bge.ko" at 0xffffffff80ffc7d8. Preloaded elf obj module "/boot/kernel/miibus.ko" at 0xffffffff80ffce40. Preloaded elf obj module "/boot/kernel/if_em.ko" at 0xffffffff80ffd428. Preloaded elf obj module "/boot/kernel/if_nfe.ko" at 0xffffffff80ffda90. Preloaded elf obj module "/boot/kernel/if_re.ko" at 0xffffffff80ffe038. Preloaded elf obj module "/boot/kernel/if_ix.ko" at 0xffffffff80ffe5e0. Preloaded elf obj module "/boot/kernel/libalias.ko" at 0xffffffff80ffed08. link_elf_obj: symbol sctp_calculate_cksum undefined KLD file ipfw.ko - could not finalize loading Calibrating TSC clock ... TSC clock: 3515725584 Hz CPU: AMD Phenom(tm) II X4 970 Processor (3515.73-MHz K8-class CPU) Origin="AuthenticAMD" Id=0x100f43 Family=0x10 Model=0x4 Stepping=3 Features=0x178bfbff Features2=0x802009 AMD Features=0xee500800 AMD Features2=0x837ff SVM: (disabled in BIOS) Features=0xf Revision=1, ASIDs=64 TSC: P-state invariant L1 2MB data TLB: 48 entries, fully associative L1 2MB instruction TLB: 16 entries, fully associative L1 4KB data TLB: 48 entries, fully associative L1 4KB instruction TLB: 32 entries, fully associative L1 data cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L1 instruction cache: 64 kbytes, 64 bytes/line, 1 lines/tag, 2-way associative L2 2MB data TLB: 128 entries, 2-way associative L2 2MB instruction TLB: 0 entries, 2-way associative L2 4KB data TLB: 512 entries, 4-way associative L2 4KB instruction TLB: 512 entries, 4-way associative L2 unified cache: 512 kbytes, 64 bytes/line, 1 lines/tag, 16-way associative real memory = 4294967296 (4096 MB) Physical memory chunk(s): 0x0000000000010000 - 0x0000000000096fff, 552960 bytes (135 pages) 0x0000000000100000 - 0x00000000001fffff, 1048576 bytes (256 pages) 0x0000000001039000 - 0x00000000b938dfff, 3090501632 bytes (754517 pages) avail memory = 3070300160 (2928 MB) MADT: Found CPU APIC ID 0 ACPI ID 1: enabled SMP: Added CPU 0 (AP) MADT: Found CPU APIC ID 1 ACPI ID 2: enabled SMP: Added CPU 1 (AP) MADT: Found CPU APIC ID 2 ACPI ID 3: enabled SMP: Added CPU 2 (AP) MADT: Found CPU APIC ID 3 ACPI ID 4: enabled SMP: Added CPU 3 (AP) MADT: Found CPU APIC ID 132 ACPI ID 5: disabled MADT: Found CPU APIC ID 133 ACPI ID 6: disabled MADT: Found CPU APIC ID 134 ACPI ID 7: disabled MADT: Found CPU APIC ID 135 ACPI ID 8: disabled Event timer "LAPIC" quality 100 LAPIC: ipi_wait() us multiplier 55 (r 6300328 tsc 3515725584) ACPI APIC Table: <112714 APIC1018> Package ID shift: 2 L3 cache ID shift: 2 L2 cache ID shift: 0 L1 cache ID shift: 0 Core ID shift: 0 INTR: Adding local APIC 1 as a target INTR: Adding local APIC 2 as a target INTR: Adding local APIC 3 as a target FreeBSD/SMP: Multiprocessor System Detected: 4 CPUs FreeBSD/SMP: 1 package(s) x 4 core(s) Package HW ID = 0 Core HW ID = 0 CPU0 (BSP): APIC ID: 0 Core HW ID = 1 CPU1 (AP): APIC ID: 1 Core HW ID = 2 CPU2 (AP): APIC ID: 2 Core HW ID = 3 CPU3 (AP): APIC ID: 3 APIC: CPU 0 has ACPI ID 1 APIC: CPU 1 has ACPI ID 2 APIC: CPU 2 has ACPI ID 3 APIC: CPU 3 has ACPI ID 4 Pentium Pro MTRR support enabled x86bios: IVT 0x000000-0x0004ff at 0xfffff80000000000 x86bios: SSEG 0x096000-0x096fff at 0xfffffe001edfa000 x86bios: EBDA 0x09a000-0x09ffff at 0xfffff8000009a000 x86bios: ROM 0x0a0000-0x0fefff at 0xfffff800000a0000 lapic0: MCE Thresholding ELVT unmasked amd_thresholding_monitor: Starting AMD thresholding on bank 4 random: read 3840 bytes from preloaded cache random: unblocking device. arc4random: read 32 bytes from preloaded cache ULE: setup cpu 0 ULE: setup cpu 1 ULE: setup cpu 2 ULE: setup cpu 3 ACPI: RSDP 0x00000000000FB610 000024 (v02 ACPIAM) ACPI: XSDT 0x00000000BDF70100 000054 (v01 112714 XSDT1018 20141127 MSFT 00000097) ACPI: FACP 0x00000000BDF70290 0000F4 (v03 112714 FACP1018 20141127 MSFT 00000097) Firmware Warning (ACPI): 32/64X length mismatch in FADT/Gpe0Block: 64/32 (20171214/tbfadt-748) ACPI: DSDT 0x00000000BDF70460 00F248 (v01 A1873 A1873001 00000001 INTL 20060113) ACPI: FACS 0x00000000BDF88000 000040 ACPI: APIC 0x00000000BDF70390 00008C (v01 112714 APIC1018 20141127 MSFT 00000097) ACPI: MCFG 0x00000000BDF70420 00003C (v01 112714 OEMMCFG 20141127 MSFT 00000097) ACPI: OEMB 0x00000000BDF88040 000072 (v01 112714 OEMB1018 20141127 MSFT 00000097) ACPI: HPET 0x00000000BDF7F8B0 000038 (v01 112714 OEMHPET 20141127 MSFT 00000097) ACPI: SSDT 0x00000000BDF7F8F0 0008BC (v01 A M I POWERNOW 00000001 AMD 00000001) MADT: Found IO APIC ID 4, Interrupt 0 at 0xfec00000 ioapic0: ver 0x21 maxredir 0x17 ioapic0: Routing external 8259A's -> intpin 0 MADT: Interrupt override: source 0, irq 2 ioapic0: Routing IRQ 0 -> intpin 2 MADT: Interrupt override: source 9, irq 9 ioapic0: intpin 9 trigger: level ioapic0: intpin 9 polarity: low ioapic0 irqs 0-23 on motherboard cpu0 BSP: ID: 0x00000000 VER: 0x80050010 LDR: 0x00000000 DFR: 0xffffffff lint0: 0x00010700 lint1: 0x00000400 TPR: 0x00000000 SVR: 0x000001ff timer: 0x000100ef therm: 0x00010000 err: 0x000000f0 pmc: 0x00010400 AMD ext features: 0x00040007 AMD elvt0: 0x00010000 AMD elvt1: 0x000000f2 AMD elvt2: 0x00010000 AMD elvt3: 0x00010000 random: entropy device external interface io: kbd: new array size 4 kbd1 at kbdmux0 mem: netmap: loaded module null: nexus0 random: harvesting attach, 8 bytes (4 bits) from ram0 acpi0: <112714 XSDT1018> on motherboard ACPI: Executed 3 blocks of module-level executable AML code ACPI: 2 ACPI AML tables successfully acquired and loaded PCIe: Memory Mapped configuration base @ 0xe0000000 ioapic0: routing intpin 9 (ISA IRQ 9) to lapic 0 vector 48 acpi0: Power Button (fixed) random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource0 random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource1 random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource2 random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource3 random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource4 random: harvesting attach, 8 bytes (4 bits) from acpi_sysresource5 acpi0: reservation of fee00000, 1000 (3) failed acpi0: reservation of ffb80000, 80000 (3) failed acpi0: reservation of fec10000, 20 (3) failed acpi0: reservation of fed40000, 5000 (3) failed acpi0: reservation of fed80000, 1000 (3) failed acpi0: reservation of 0, a0000 (3) failed acpi0: reservation of 100000, bdf00000 (3) failed cpu0: Processor \_PR_.P001 (ACPI ID 1) -> APIC ID 0 cpu0: on acpi0 cpu0: switching to generic Cx mode random: harvesting attach, 8 bytes (4 bits) from cpu0 cpu1: Processor \_PR_.P002 (ACPI ID 2) -> APIC ID 1 cpu1: on acpi0 random: harvesting attach, 8 bytes (4 bits) from cpu1 cpu2: Processor \_PR_.P003 (ACPI ID 3) -> APIC ID 2 cpu2: on acpi0 random: harvesting attach, 8 bytes (4 bits) from cpu2 cpu3: Processor \_PR_.P004 (ACPI ID 4) -> APIC ID 3 cpu3: on acpi0 random: harvesting attach, 8 bytes (4 bits) from cpu3 ACPI: Processor \_PR_.P005 (ACPI ID 5) ignored ACPI: Processor \_PR_.P006 (ACPI ID 6) ignored ACPI: Processor \_PR_.P007 (ACPI ID 7) ignored ACPI: Processor \_PR_.P008 (ACPI ID 8) ignored attimer0: port 0x40-0x43 irq 0 on acpi0 Timecounter "i8254" frequency 1193182 Hz quality 0 ioapic0: routing intpin 2 (ISA IRQ 0) to lapic 0 vector 49 Event timer "i8254" frequency 1193182 Hz quality 100 random: harvesting attach, 8 bytes (4 bits) from attimer0 atrtc0: port 0x70-0x71 irq 8 on acpi0 atrtc0: registered as a time-of-day clock, resolution 1.000000s ioapic0: routing intpin 8 (ISA IRQ 8) to lapic 0 vector 50 Event timer "RTC" frequency 32768 Hz quality 0 random: harvesting attach, 8 bytes (4 bits) from atrtc0 hpet0: iomem 0xfed00000-0xfed003ff on acpi0 hpet0: vendor 0x4353, rev 0x10, 14318180Hz, 3 timers, legacy route hpet0: t0: irqs 0x00c00000 (0), MSI, periodic hpet0: t1: irqs 0x00c00000 (0), MSI, periodic hpet0: t2: irqs 0x00c00000 (0), MSI, periodic Timecounter "HPET" frequency 14318180 Hz quality 950 msi: routing MSI-X IRQ 256 to local APIC 0 vector 51 msi: routing MSI-X IRQ 257 to local APIC 0 vector 52 msi: routing MSI-X IRQ 258 to local APIC 0 vector 53 Event timer "HPET" frequency 14318180 Hz quality 450 Event timer "HPET1" frequency 14318180 Hz quality 450 Event timer "HPET2" frequency 14318180 Hz quality 450 random: harvesting attach, 8 bytes (4 bits) from hpet0 ACPI timer: 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 1/1 -> 10 Timecounter "ACPI-fast" frequency 3579545 Hz quality 900 acpi_timer0: <32-bit timer at 3.579545MHz> port 0x808-0x80b on acpi0 random: harvesting attach, 8 bytes (4 bits) from acpi_timer0 acpi_ec0: port 0x62,0x66 on acpi0 random: harvesting attach, 8 bytes (4 bits) from acpi_ec0 pci_link0: Index IRQ Rtd Ref IRQs Initial Probe 0 5 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 5 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link0 pci_link1: Index IRQ Rtd Ref IRQs Initial Probe 0 11 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 11 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link1 pci_link2: Index IRQ Rtd Ref IRQs Initial Probe 0 10 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 10 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link2 pci_link3: Index IRQ Rtd Ref IRQs Initial Probe 0 9 N 0 3 4 5 6 9 10 11 14 15 Validation 0 9 N 0 3 4 5 6 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link3 pci_link4: Index IRQ Rtd Ref IRQs Initial Probe 0 255 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 255 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link4 pci_link5: Index IRQ Rtd Ref IRQs Initial Probe 0 255 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 255 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link5 pci_link6: Index IRQ Rtd Ref IRQs Initial Probe 0 255 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 255 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link6 pci_link7: Index IRQ Rtd Ref IRQs Initial Probe 0 255 N 0 3 4 5 6 7 9 10 11 14 15 Validation 0 255 N 0 3 4 5 6 7 9 10 11 14 15 After Disable 0 255 N 0 3 4 5 6 7 9 10 11 14 15 random: harvesting attach, 8 bytes (4 bits) from pci_link7 pcib0: port 0xcf8-0xcff on acpi0 pcib0: decoding 5 range 0-0xff pcib0: decoding 4 range 0-0xcf7 pcib0: decoding 4 range 0xd00-0xffff pcib0: decoding 3 range 0xa0000-0xbffff pcib0: decoding 3 range 0xd0000-0xdffff pcib0: decoding 3 range 0xbe000000-0xdfffffff pcib0: decoding 3 range 0xf0000000-0xfebfffff pci0: on pcib0 pci0: domain=0, physical bus=0 found-> vendor=0x1022, dev=0x9601, revid=0x00 domain=0, bus=0, slot=0, func=0 class=06-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x2230, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x1043, dev=0x9602, revid=0x00 domain=0, bus=0, slot=1, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0107, statreg=0x0230, cachelnsz=0 (dwords) lattimer=0x40 (1920 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) secbus=1, subbus=1 found-> vendor=0x1022, dev=0x9603, revid=0x00 domain=0, bus=0, slot=2, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0107, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=10 powerspec 3 supports D0 D3 current D0 MSI supports 1 message pcib0: matched entry for 0.2.INTA pcib0: slot 2 INTA hardwired to IRQ 18 secbus=2, subbus=2 found-> vendor=0x1022, dev=0x9605, revid=0x00 domain=0, bus=0, slot=5, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0107, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 3 supports D0 D3 current D0 MSI supports 1 message pcib0: matched entry for 0.5.INTA pcib0: slot 5 INTA hardwired to IRQ 17 secbus=3, subbus=3 found-> vendor=0x1022, dev=0x9608, revid=0x00 domain=0, bus=0, slot=9, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 cmdreg=0x0106, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 3 supports D0 D3 current D0 MSI supports 1 message pcib0: matched entry for 0.9.INTA pcib0: slot 9 INTA hardwired to IRQ 17 secbus=4, subbus=4 found-> vendor=0x1022, dev=0x9609, revid=0x00 domain=0, bus=0, slot=10, func=0 class=06-04-00, hdrtype=0x01, mfdev=0 lot 10 INTA hardwired to IRQ 18 secbus=5, subbus=5 found-> vendor=0x1002, dev=0x4391, revid=0x40 domain=0, bus=0, hdrtype=0x00, mfdev=0 cmdreg=0x0107, statreg=0x0230, cachelnsz=16 (dwords) lattimer=0x40 (1920 ns), mingnt=0x0 range 32, base 0xfe7fe000, size 12, enabled pcib0: allocated type 3 (0xfe7fe000-0xfe7fefff) for rid 10 of pci0:0:18:0 pcib0: maa, irq=10 map[10]: type Memory, range 32, base 0xfe7fd000, size 12, enabled pcib0: allocated type 3 (0xfe7fd000-0xfe7fdf entry for 0.19.INTA pcib0: slot 19 INTA hardwired to IRQ 18 ohci early: SMM active, request owner change found-> vendor=0x1002,f pci0:0:20:2 pcib0: matched entry for 0.20.INTA pcib0: slot 20 INTA hardwired to IRQ 16 found-> vendor=0x1002, dev=0x439d, revislot=20, func=3 class=06-01-00, hdrtype=0x00, mfdev=1 cmdreg=0x000f, statreg=0x0220, cachelnsz=0 (dwords) d type 3 (0xfe7f3000-0xfe7f3fff) for rid 10 of pci0:0:22:0 pcib0: matched entry for 0.22.INTA pcib0: slot 22 INTA hardwired to Iatreg=0x0000, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) found-> vendor=0x1022, dain=0, bus=0, slot=24, func=3 class=06-00-00, hdrtype=0x00, mfdev=1 cmdreg=0x0000, statreg=0x0010, cachelnsz=0 ( powerspec 3 supports D0 D1 D2 D3 current D0 MSI supports 1 message, 64 bit map[10]: type Prefetchable Memorrt 0xb000-0xb0ff mem 0xd0000000-0xdfffffff,0xfe9f0000-0xfe9fffff,0xfe800000-0xfe8fffff irq 18 at device 5.0 on pci1 vgapci0: Boottach, 8 bytes (4 bits) from vgapci0 pci1: at device 5.1 (no driver attached) random: harvesting attach, 8 bytts 1 message, 64 bit, vector masks MSI-X supports 64 messages in map 0x20 map[10]: type Prefetchable Memory, ran enabled pcib2: allocated prefetch range (0xfde80000-0xfdefffff) for rid 10 of pci0:2:0:0 map[18]: type I/O Port, range lot 0 INTB hardwired to IRQ 19 ix0: port 0xcc00-0xcc1f mem 0xfde80000-0xfdefffff,0xfde7c000-0xfde7ffff irq 18 at device 0.0 on pci2 ix0: using 2048 tx descriptors and 2048 rx descriptors ix0: msix_init qsets capped at 16 ix0: pxm cpus: 4 queue msgs: 63 admincnt: 1 ix0: using 4 rx queues 4 tx queues ix0: attempting to allocate 5 MSI-X vectors (64 supported) msi: routing MSI-X IRQ 259 to local APIC 0 vector 54 msi: routing MSI-X IRQ 260 to local APIC 0 vector 55 msi: routing MSI-X IRQ 261 to local APIC 0 vector 56 msi: routing MSI-X IRQ 262 to local APIC 0 vector 57 msi: routing MSI-X IRQ 263 to local APIC 0 vector 58 ix0: using IRQs 259-263 for MSI-X ix0: Using MSIX interrupts with 5 vectors ix0: allocated for 4 queues ix0: allocated for 4 rx queues ix0: irq=259, type=0, qid=0, name=rxq0 panic: Assertion gtask->gt_taskqueue != NULL failed at /usr/src/sys/net/iflib.c:5178 cpuid = 0 time = 1 KDB: enter: panic [ thread pid 0 tid 100000 ] Stopped at kdb_enter+0x3b: movq $0,kdb_why db> --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=slave-amd64-smp-debug include "/s/kernconf/slave-debug" ident slave-amd64-smp-debug machine amd64 cpu HAMMER options SMP options PRINTF_BUFR_SIZE=256 --qDbXVdCdHGoSgWSk Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=slave-debug makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols # dtrace makeoptions WITH_CTF=1 options DDB_CTF options KDTRACE_HOOKS options KDTRACE_FRAME #options SCHED_4BSD # 4BSD scheduler options SCHED_ULE options PREEMPTION # Enable kernel thread preemption options FULL_PREEMPTION options INET # InterNETworking options FFS # Berkeley Fast Filesystem options SOFTUPDATES # Enable FFS soft updates support #options UFS_ACL # Support for access control lists options UFS_DIRHASH # Improve performance on big directories options COMPAT_43TTY # BSD 4.3 TTY compat [KEEP THIS!] options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options SYSVSHM # SYSV-style shared memory options SYSVMSG # SYSV-style message queues options SYSVSEM # SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev options INET6 # IPv6 communications protocols options MROUTING options VLAN_ARRAY options IPFIREWALL_DEFAULT_TO_ACCEPT #options IPFIREWALL_FORWARD #options IPFIREWALL_NAT #options LIBALIAS options GEOM_PART_GPT options GEOM_LABEL # Bus support. device acpi device pci device cpufreq device amdtemp device coretemp # Floppy drives device fdc # ATA and ATAPI devices device ata #device atadisk # ATA disk drives options ATA_STATIC_ID # Static device numbering #options ATA_CAM device scbus device pass device ahci device ada device da device cd # atkbdc0 controls both the keyboard and the PS/2 mouse device atkbdc # AT keyboard controller device atkbd # AT keyboard device psm # PS/2 mouse device kbdmux # keyboard multiplexer device vga # VGA video card driver # syscons is the default console driver, resembling an SCO console device sc device usb device ehci device uhci device xhci device ukbd device ums device umass # Serial (COM) ports #device sio # 8250, 16[45]50 based serial ports device uart # Generic UART driver # Pseudo devices. device loop # Network loopback device random # Entropy device device ether # Ethernet support device tun # Packet tunnel. device pty # Pseudo-ttys (telnet etc) device md # Memory "disks" device bpf # Berkeley packet filter device lagg device netmap # Debugging for use in -current options KDB # Enable kernel debugger support. options DDB # Support DDB. options GDB # Support remote GDB. options DIAGNOSTIC options INVARIANTS # Enable calls of extra sanity checking options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS options WITNESS # Enable checks to detect deadlocks and cycles options WITNESS_KDB options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed #options LOCK_PROFILING #options MPROF_BUFFERS="1536" #options MPROF_HASH_SIZE="1543" #options DEBUG_MEMGUARD #options DEBUG_REDZONE #options hwpmc options HWPMC_HOOKS options KTR options KTR_ENTRIES=8192 options KTR_COMPILE=(KTR_SPARE4) #options KTR_MASK=KTR_INTR options KTR_CPUMASK=0xf #options KTR_VERBOSE --qDbXVdCdHGoSgWSk-- From owner-svn-src-head@freebsd.org Sat Dec 23 14:27:44 2017 Return-Path: Delivered-To: svn-src-head@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 27D25EA6DCE; Sat, 23 Dec 2017 14:27:44 +0000 (UTC) (envelope-from kevans@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 D241164FAB; Sat, 23 Dec 2017 14:27:43 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNERgbZ004749; Sat, 23 Dec 2017 14:27:42 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNERg2M004744; Sat, 23 Dec 2017 14:27:42 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712231427.vBNERg2M004744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 23 Dec 2017 14:27:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327106 - in head/sys: conf dev/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: conf dev/syscon X-SVN-Commit-Revision: 327106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 14:27:44 -0000 Author: kevans Date: Sat Dec 23 14:27:42 2017 New Revision: 327106 URL: https://svnweb.freebsd.org/changeset/base/327106 Log: syscon: Introduce kobj and split out fdt bits Allow more flexibility by kobj'ifying syscon and splitting out fdt specific bits in preparation of a move to the extres framework. The generic fdt driver has been moved to syscon_generic.c and the fdt requirement has been removed from the syscon interface, as is common to the extres framework. Reviewed by: strejda Differential Revision: https://reviews.freebsd.org/D13521 Added: head/sys/dev/syscon/syscon.h (contents, props changed) head/sys/dev/syscon/syscon_generic.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/syscon/syscon.c head/sys/dev/syscon/syscon_if.m Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 23 13:10:36 2017 (r327105) +++ head/sys/conf/files Sat Dec 23 14:27:42 2017 (r327106) @@ -3107,8 +3107,9 @@ dev/stg/tmc18c30_subr.c optional stg dev/stge/if_stge.c optional stge dev/sym/sym_hipd.c optional sym \ dependency "$S/dev/sym/sym_{conf,defs}.h" -dev/syscon/syscon.c optional fdt syscon -dev/syscon/syscon_if.m optional fdt syscon +dev/syscon/syscon.c optional syscon +dev/syscon/syscon_generic.c optional fdt syscon +dev/syscon/syscon_if.m optional syscon dev/syscons/blank/blank_saver.c optional blank_saver dev/syscons/daemon/daemon_saver.c optional daemon_saver dev/syscons/dragon/dragon_saver.c optional dragon_saver Modified: head/sys/dev/syscon/syscon.c ============================================================================== --- head/sys/dev/syscon/syscon.c Sat Dec 23 13:10:36 2017 (r327105) +++ head/sys/dev/syscon/syscon.c Sat Dec 23 14:27:42 2017 (r327106) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2015 Michal Meloun + * Copyright (c) 2017 Kyle Evans * All rights reserved. * * Redistribution and use in source and binary forms, with or without Added: head/sys/dev/syscon/syscon.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscon/syscon.h Sat Dec 23 14:27:42 2017 (r327106) @@ -0,0 +1,77 @@ +/*- + * Copyright 2017 Kyle Evans + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_SYSCON_H +#define DEV_SYSCON_H + +#include "opt_platform.h" + +#include +#include +#ifdef FDT +#include +#endif + +struct syscon { + KOBJ_FIELDS; + + TAILQ_ENTRY(syscon) syscon_link; /* Global list entry */ + + device_t pdev; /* provider device */ +#ifdef FDT + phandle_t ofw_node; /* OFW node for syscon */ +#endif + void *softc; /* provider softc */ +}; + +/* + * Shorthands for constructing method tables. + */ +#define SYSCONMETHOD KOBJMETHOD +#define SYSCONMETHOD_END KOBJMETHOD_END +#define syscon_method_t kobj_method_t +#define syscon_class_t kobj_class_t +DECLARE_CLASS(syscon_class); + +void *syscon_get_softc(struct syscon *syscon); + +/* + * Provider interface + */ +struct syscon *syscon_create(device_t pdev, syscon_class_t syscon_class); +struct syscon *syscon_register(struct syscon *syscon); +int syscon_unregister(struct syscon *syscon); + +#ifdef FDT +struct syscon *syscon_create_ofw_node(device_t pdev, + syscon_class_t syscon_class, phandle_t node); +phandle_t syscon_get_ofw_node(struct syscon *syscon); +int syscon_get_by_ofw_property(device_t consumer, phandle_t node, char *name, + struct syscon **syscon); +#endif + +#endif /* DEV_SYSCON_H */ Added: head/sys/dev/syscon/syscon_generic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/syscon/syscon_generic.c Sat Dec 23 14:27:42 2017 (r327106) @@ -0,0 +1,211 @@ +/*- + * Copyright (c) 2015 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* + * This is a generic syscon driver, whose purpose is to provide access to + * various unrelated bits packed in a single register space. It is usually used + * as a fallback to more specific driver, but works well enough for simple + * access. + */ + +#include +__FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "syscon_if.h" +#include "syscon.h" + +MALLOC_DECLARE(M_SYSCON); + +static uint32_t syscon_generic_read_4(struct syscon *syscon, bus_size_t offset); +static int syscon_generic_write_4(struct syscon *syscon, bus_size_t offset, + uint32_t val); +static int syscon_generic_modify_4(struct syscon *syscon, bus_size_t offset, + uint32_t clear_bits, uint32_t set_bits); + +/* + * Generic syscon driver (FDT) + */ +struct syscon_generic_softc { + device_t dev; + struct syscon *syscon; + struct resource *mem_res; + struct mtx mtx; +}; + +static struct ofw_compat_data compat_data[] = { + {"syscon", 1}, + {NULL, 0} +}; + +#define SYSCON_LOCK(_sc) mtx_lock(&(_sc)->mtx) +#define SYSCON_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx) +#define SYSCON_LOCK_INIT(_sc) mtx_init(&(_sc)->mtx, \ + device_get_nameunit((_sc)->dev), "syscon", MTX_DEF) +#define SYSCON_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->mtx); +#define SYSCON_ASSERT_LOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED); +#define SYSCON_ASSERT_UNLOCKED(_sc) mtx_assert(&(_sc)->mtx, MA_NOTOWNED); + +static syscon_method_t syscon_generic_methods[] = { + SYSCONMETHOD(syscon_read_4, syscon_generic_read_4), + SYSCONMETHOD(syscon_write_4, syscon_generic_write_4), + SYSCONMETHOD(syscon_modify_4, syscon_generic_modify_4), + + SYSCONMETHOD_END +}; +DEFINE_CLASS_1(syscon_generic, syscon_generic_class, syscon_generic_methods, + 0, syscon_class); + +static uint32_t +syscon_generic_read_4(struct syscon *syscon, bus_size_t offset) +{ + struct syscon_generic_softc *sc; + uint32_t val; + + sc = device_get_softc(syscon->pdev); + + SYSCON_LOCK(sc); + val = bus_read_4(sc->mem_res, offset); + SYSCON_UNLOCK(sc); + return (val); +} + +static int +syscon_generic_write_4(struct syscon *syscon, bus_size_t offset, uint32_t val) +{ + struct syscon_generic_softc *sc; + + sc = device_get_softc(syscon->pdev); + + SYSCON_LOCK(sc); + bus_write_4(sc->mem_res, offset, val); + SYSCON_UNLOCK(sc); + return (0); +} + +static int +syscon_generic_modify_4(struct syscon *syscon, bus_size_t offset, + uint32_t clear_bits, uint32_t set_bits) +{ + struct syscon_generic_softc *sc; + uint32_t val; + + sc = device_get_softc(syscon->pdev); + + SYSCON_LOCK(sc); + val = bus_read_4(sc->mem_res, offset); + val &= ~clear_bits; + val |= set_bits; + bus_write_4(sc->mem_res, offset, val); + SYSCON_UNLOCK(sc); + return (0); +} + +static int +syscon_generic_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data == 0) + return (ENXIO); + + device_set_desc(dev, "syscon"); + return (BUS_PROBE_GENERIC); +} + +static int +syscon_generic_attach(device_t dev) +{ + struct syscon_generic_softc *sc; + int rid; + + sc = device_get_softc(dev); + sc->dev = dev; + + rid = 0; + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->mem_res == NULL) { + device_printf(dev, "Cannot allocate memory resource\n"); + return (ENXIO); + } + + SYSCON_LOCK_INIT(sc); + sc->syscon = syscon_create_ofw_node(dev, &syscon_generic_class, + ofw_bus_get_node(dev)); + if (sc->syscon == NULL) { + device_printf(dev, "Failed to create/register syscon\n"); + return (ENXIO); + } + return (0); +} + +static int +syscon_generic_detach(device_t dev) +{ + struct syscon_generic_softc *sc; + + sc = device_get_softc(dev); + + if (sc->syscon != NULL) { + syscon_unregister(sc->syscon); + free(sc->syscon, M_SYSCON); + } + + SYSCON_LOCK_DESTROY(sc); + + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->mem_res); + return (0); +} + +static device_method_t syscon_generic_dmethods[] = { + /* Device interface */ + DEVMETHOD(device_probe, syscon_generic_probe), + DEVMETHOD(device_attach, syscon_generic_attach), + DEVMETHOD(device_detach, syscon_generic_detach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(syscon_generic, syscon_generic_driver, syscon_generic_dmethods, + sizeof(struct syscon_generic_softc)); +static devclass_t syscon_generic_devclass; +EARLY_DRIVER_MODULE(syscon_generic, simplebus, syscon_generic_driver, + syscon_generic_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_LATE); +MODULE_VERSION(syscon_generic, 1); Modified: head/sys/dev/syscon/syscon_if.m ============================================================================== --- head/sys/dev/syscon/syscon_if.m Sat Dec 23 13:10:36 2017 (r327105) +++ head/sys/dev/syscon/syscon_if.m Sat Dec 23 14:27:42 2017 (r327106) @@ -30,25 +30,34 @@ INTERFACE syscon; +HEADER { + struct syscon; +} + +METHOD int init { + struct syscon *syscon; +}; + +METHOD int uninit { + struct syscon *syscon; +}; + /** * Accessor functions for syscon register space */ METHOD uint32_t read_4 { - device_t dev; - device_t consumer; + struct syscon *syscon; bus_size_t offset; }; -METHOD void write_4 { - device_t dev; - device_t consumer; +METHOD int write_4 { + struct syscon *syscon; bus_size_t offset; uint32_t val; }; -METHOD void modify_4 { - device_t dev; - device_t consumer; +METHOD int modify_4 { + struct syscon *syscon; bus_size_t offset; uint32_t clear_bits; uint32_t set_bits; From owner-svn-src-head@freebsd.org Sat Dec 23 14:30:45 2017 Return-Path: Delivered-To: svn-src-head@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 C748FEA6E67; Sat, 23 Dec 2017 14:30:45 +0000 (UTC) (envelope-from kevans@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 912ED65160; Sat, 23 Dec 2017 14:30:45 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNEUiwm004908; Sat, 23 Dec 2017 14:30:44 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNEUi6U004907; Sat, 23 Dec 2017 14:30:44 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201712231430.vBNEUi6U004907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 23 Dec 2017 14:30:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327107 - in head/sys: conf dev/extres/syscon dev/syscon X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: conf dev/extres/syscon dev/syscon X-SVN-Commit-Revision: 327107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 14:30:45 -0000 Author: kevans Date: Sat Dec 23 14:30:44 2017 New Revision: 327107 URL: https://svnweb.freebsd.org/changeset/base/327107 Log: Move syscon into extres framework This should help reduce confusion between syscon/syscons a little bit. syscon is a resource generally modeled by FDT platforms, and not to be confused with syscons. Added: head/sys/dev/extres/syscon/ - copied from r327106, head/sys/dev/syscon/ Deleted: head/sys/dev/syscon/ Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Dec 23 14:27:42 2017 (r327106) +++ head/sys/conf/files Sat Dec 23 14:30:44 2017 (r327107) @@ -1723,6 +1723,9 @@ dev/extres/regulator/regnode_if.m optional ext_resourc dev/extres/regulator/regulator.c optional ext_resources regulator fdt dev/extres/regulator/regulator_bus.c optional ext_resources regulator fdt dev/extres/regulator/regulator_fixed.c optional ext_resources regulator fdt +dev/extres/syscon/syscon.c optional ext_resources syscon +dev/extres/syscon/syscon_generic.c optional ext_resources syscon fdt +dev/extres/syscon/syscon_if.m optional ext_resources syscon dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard dev/fb/splash.c optional sc splash @@ -3107,9 +3110,6 @@ dev/stg/tmc18c30_subr.c optional stg dev/stge/if_stge.c optional stge dev/sym/sym_hipd.c optional sym \ dependency "$S/dev/sym/sym_{conf,defs}.h" -dev/syscon/syscon.c optional syscon -dev/syscon/syscon_generic.c optional fdt syscon -dev/syscon/syscon_if.m optional syscon dev/syscons/blank/blank_saver.c optional blank_saver dev/syscons/daemon/daemon_saver.c optional daemon_saver dev/syscons/dragon/dragon_saver.c optional dragon_saver From owner-svn-src-head@freebsd.org Sat Dec 23 16:23:59 2017 Return-Path: Delivered-To: svn-src-head@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 E37F3E85200; Sat, 23 Dec 2017 16:23:59 +0000 (UTC) (envelope-from kan@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 AB8856908B; Sat, 23 Dec 2017 16:23:59 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGNw0B055226; Sat, 23 Dec 2017 16:23:58 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGNwgr055225; Sat, 23 Dec 2017 16:23:58 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231623.vBNGNwgr055225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:23:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327108 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:24:00 -0000 Author: kan Date: Sat Dec 23 16:23:58 2017 New Revision: 327108 URL: https://svnweb.freebsd.org/changeset/base/327108 Log: Do not double free the memory in if_clone. if_clone_attach function will drop the reference on failure which will free the if_clone structure. No need to do it second time. Reviewed by: glebius, ae Differential Revision: https://reviews.freebsd.org/D10386 Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sat Dec 23 14:30:44 2017 (r327107) +++ head/sys/net/if_clone.c Sat Dec 23 16:23:58 2017 (r327108) @@ -387,10 +387,8 @@ if_clone_advanced(const char *name, u_int maxunit, ifc ifc->ifc_create = create; ifc->ifc_destroy = destroy; - if (if_clone_attach(ifc) != 0) { - if_clone_free(ifc); + if (if_clone_attach(ifc) != 0) return (NULL); - } EVENTHANDLER_INVOKE(if_clone_event, ifc); @@ -410,10 +408,8 @@ if_clone_simple(const char *name, ifcs_create_t create ifc->ifcs_destroy = destroy; ifc->ifcs_minifs = minifs; - if (if_clone_attach(ifc) != 0) { - if_clone_free(ifc); + if (if_clone_attach(ifc) != 0) return (NULL); - } for (unit = 0; unit < minifs; unit++) { char name[IFNAMSIZ]; From owner-svn-src-head@freebsd.org Sat Dec 23 16:24:02 2017 Return-Path: Delivered-To: svn-src-head@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 411E1E85232; Sat, 23 Dec 2017 16:24:02 +0000 (UTC) (envelope-from kan@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 0B23469090; Sat, 23 Dec 2017 16:24:01 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGO1rg055273; Sat, 23 Dec 2017 16:24:01 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGO1Zj055272; Sat, 23 Dec 2017 16:24:01 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231624.vBNGO1Zj055272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:24:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327109 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:24:02 -0000 Author: kan Date: Sat Dec 23 16:24:00 2017 New Revision: 327109 URL: https://svnweb.freebsd.org/changeset/base/327109 Log: Remove some trailing whitespace. Reviewed by: glebius, ae Differential Revision: https://reviews.freebsd.org/D10386 Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sat Dec 23 16:23:58 2017 (r327108) +++ head/sys/net/if_clone.c Sat Dec 23 16:24:00 2017 (r327109) @@ -355,7 +355,7 @@ if_clone_alloc(const char *name, int maxunit) return (ifc); } - + static int if_clone_attach(struct if_clone *ifc) { @@ -446,7 +446,7 @@ if_clone_detach(struct if_clone *ifc) /* destroy all interfaces for this cloner */ while (!LIST_EMPTY(&ifc->ifc_iflist)) if_clone_destroyif(ifc, LIST_FIRST(&ifc->ifc_iflist)); - + IF_CLONE_REMREF(ifc); } From owner-svn-src-head@freebsd.org Sat Dec 23 16:24:03 2017 Return-Path: Delivered-To: svn-src-head@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 B95D1E85243; Sat, 23 Dec 2017 16:24:03 +0000 (UTC) (envelope-from kan@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 828B4690AA; Sat, 23 Dec 2017 16:24:03 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGO2UW055316; Sat, 23 Dec 2017 16:24:02 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGO2Vm055315; Sat, 23 Dec 2017 16:24:02 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231624.vBNGO2Vm055315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:24:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327110 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 327110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:24:03 -0000 Author: kan Date: Sat Dec 23 16:24:02 2017 New Revision: 327110 URL: https://svnweb.freebsd.org/changeset/base/327110 Log: Remove dead initialization of the inode pointer. The pointer gets initialized again later in the code. This also improves code style(9). Modified: head/sys/ufs/ffs/ffs_snapshot.c Modified: head/sys/ufs/ffs/ffs_snapshot.c ============================================================================== --- head/sys/ufs/ffs/ffs_snapshot.c Sat Dec 23 16:24:00 2017 (r327109) +++ head/sys/ufs/ffs/ffs_snapshot.c Sat Dec 23 16:24:02 2017 (r327110) @@ -2502,7 +2502,7 @@ readblock(vp, bp, lbn) struct buf *bp; ufs2_daddr_t lbn; { - struct inode *ip = VTOI(vp); + struct inode *ip; struct bio *bip; struct fs *fs; From owner-svn-src-head@freebsd.org Sat Dec 23 16:45:25 2017 Return-Path: Delivered-To: svn-src-head@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 D2E55E86D6E; Sat, 23 Dec 2017 16:45:25 +0000 (UTC) (envelope-from kan@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 9E6C26A205; Sat, 23 Dec 2017 16:45:25 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGjO4r064097; Sat, 23 Dec 2017 16:45:24 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGjOYh064096; Sat, 23 Dec 2017 16:45:24 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231645.vBNGjOYh064096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:45:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327111 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 327111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:45:25 -0000 Author: kan Date: Sat Dec 23 16:45:24 2017 New Revision: 327111 URL: https://svnweb.freebsd.org/changeset/base/327111 Log: Do not pass NULL pointer to copyout in if_clone_list. Sometimes caller is only interested in how many clones are there and NULL pointer is passed for the destination buffer. Do not pass it to copyout then. Modified: head/sys/net/if_clone.c Modified: head/sys/net/if_clone.c ============================================================================== --- head/sys/net/if_clone.c Sat Dec 23 16:24:02 2017 (r327110) +++ head/sys/net/if_clone.c Sat Dec 23 16:45:24 2017 (r327111) @@ -508,7 +508,7 @@ if_clone_list(struct if_clonereq *ifcr) done: IF_CLONERS_UNLOCK(); - if (err == 0) + if (err == 0 && dst != NULL) err = copyout(outbuf, dst, buf_count*IFNAMSIZ); if (outbuf != NULL) free(outbuf, M_CLONE); From owner-svn-src-head@freebsd.org Sat Dec 23 16:45:27 2017 Return-Path: Delivered-To: svn-src-head@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 EC11EE86D87; Sat, 23 Dec 2017 16:45:27 +0000 (UTC) (envelope-from kan@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 B8DE06A206; Sat, 23 Dec 2017 16:45:27 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGjQbL064142; Sat, 23 Dec 2017 16:45:26 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGjQf5064141; Sat, 23 Dec 2017 16:45:26 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231645.vBNGjQf5064141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327112 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 327112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:45:28 -0000 Author: kan Date: Sat Dec 23 16:45:26 2017 New Revision: 327112 URL: https://svnweb.freebsd.org/changeset/base/327112 Log: Silence clang analyzer false positive. clang does not know that two lookup calls will return the same pointer, so it assumes correctly that using the old pointer after dropping the reference to it is a bit risky. Modified: head/sys/netinet6/nd6_nbr.c Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Sat Dec 23 16:45:24 2017 (r327111) +++ head/sys/netinet6/nd6_nbr.c Sat Dec 23 16:45:26 2017 (r327112) @@ -1307,7 +1307,8 @@ nd6_dad_stop(struct ifaddr *ifa) * we were waiting for it to stop, so re-do the lookup. */ nd6_dad_rele(dp); - if (nd6_dad_find(ifa, NULL) == NULL) + dp = nd6_dad_find(ifa, NULL); + if (dp == NULL) return; nd6_dad_del(dp); From owner-svn-src-head@freebsd.org Sat Dec 23 16:50:01 2017 Return-Path: Delivered-To: svn-src-head@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 12949E8744A; Sat, 23 Dec 2017 16:50:00 +0000 (UTC) (envelope-from kan@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 639B26A9BC; Sat, 23 Dec 2017 16:49:58 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNGnveA065285; Sat, 23 Dec 2017 16:49:57 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNGnvuo065284; Sat, 23 Dec 2017 16:49:57 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231649.vBNGnvuo065284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 16:49:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327113 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 16:50:02 -0000 Author: kan Date: Sat Dec 23 16:49:57 2017 New Revision: 327113 URL: https://svnweb.freebsd.org/changeset/base/327113 Log: Remove dead store to local variable. Modified: head/sys/kern/kern_shutdown.c Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Sat Dec 23 16:45:26 2017 (r327112) +++ head/sys/kern/kern_shutdown.c Sat Dec 23 16:49:57 2017 (r327113) @@ -536,7 +536,6 @@ shutdown_halt(void *junk, int howto) cpu_halt(); /* NOTREACHED */ default: - howto &= ~RB_HALT; break; } } From owner-svn-src-head@freebsd.org Sat Dec 23 17:55:20 2017 Return-Path: Delivered-To: svn-src-head@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 6A2B1E8D0AF; Sat, 23 Dec 2017 17:55:20 +0000 (UTC) (envelope-from kan@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 367A76DF7E; Sat, 23 Dec 2017 17:55:20 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNHtJSU096136; Sat, 23 Dec 2017 17:55:19 GMT (envelope-from kan@FreeBSD.org) Received: (from kan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNHtJ0M096135; Sat, 23 Dec 2017 17:55:19 GMT (envelope-from kan@FreeBSD.org) Message-Id: <201712231755.vBNHtJ0M096135@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kan set sender to kan@FreeBSD.org using -f From: Alexander Kabaev Date: Sat, 23 Dec 2017 17:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327114 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kan X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 327114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 17:55:20 -0000 Author: kan Date: Sat Dec 23 17:55:19 2017 New Revision: 327114 URL: https://svnweb.freebsd.org/changeset/base/327114 Log: Reverse the check to allocate the buffer if cached pointer is NULL. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D13596 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Sat Dec 23 16:49:57 2017 (r327113) +++ head/sys/kern/vfs_export.c Sat Dec 23 17:55:19 2017 (r327114) @@ -412,7 +412,7 @@ vfs_setpublicfs(struct mount *mp, struct netexport *ne * If an indexfile was specified, pull it in. */ if (argp->ex_indexfile != NULL) { - if (nfs_pub.np_index != NULL) + if (nfs_pub.np_index == NULL) nfs_pub.np_index = malloc(MAXNAMLEN + 1, M_TEMP, M_WAITOK); error = copyinstr(argp->ex_indexfile, nfs_pub.np_index, From owner-svn-src-head@freebsd.org Sat Dec 23 18:07:44 2017 Return-Path: Delivered-To: svn-src-head@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 8C3A9E8E122; Sat, 23 Dec 2017 18:07:44 +0000 (UTC) (envelope-from oshogbo@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 657476E756; Sat, 23 Dec 2017 18:07:44 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNI7hAd000439; Sat, 23 Dec 2017 18:07:43 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNI7hux000435; Sat, 23 Dec 2017 18:07:43 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201712231807.vBNI7hux000435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 23 Dec 2017 18:07:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327115 - in head: include lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: include lib/libc/gen X-SVN-Commit-Revision: 327115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 18:07:44 -0000 Author: oshogbo Date: Sat Dec 23 18:07:43 2017 New Revision: 327115 URL: https://svnweb.freebsd.org/changeset/base/327115 Log: Introduce the daemonfd function. The daemonfd function is equivalent to the daemon(3) function expect that arguments are descriptors. For example dhclient(8) which is sandboxed is unable to open /dev/null to close stdio instead it's allows to fail daemon(3) function to close the descriptors and then do it explicit in code. Instead of such hacks we can use now daemonfd. This API can be also helpful to migrate system to platforms like CheriBSD. Reviewed by: brooks@, bcr@, jilles@ (earlier version) Differential Revision: https://reviews.freebsd.org/D13433 Modified: head/include/stdlib.h head/lib/libc/gen/Symbol.map head/lib/libc/gen/daemon.3 head/lib/libc/gen/daemon.c Modified: head/include/stdlib.h ============================================================================== --- head/include/stdlib.h Sat Dec 23 17:55:19 2017 (r327114) +++ head/include/stdlib.h Sat Dec 23 18:07:43 2017 (r327115) @@ -274,6 +274,7 @@ int cgetstr(char *, const char *, char **); int cgetustr(char *, const char *, char **); int daemon(int, int); +int daemonfd(int, int); char *devname(__dev_t, __mode_t); char *devname_r(__dev_t, __mode_t, char *, int); char *fdevname(int); Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Sat Dec 23 17:55:19 2017 (r327114) +++ head/lib/libc/gen/Symbol.map Sat Dec 23 18:07:43 2017 (r327115) @@ -394,6 +394,7 @@ FBSD_1.4 { FBSD_1.5 { alphasort; basename; + daemonfd; devname; devname_r; dirname; Modified: head/lib/libc/gen/daemon.3 ============================================================================== --- head/lib/libc/gen/daemon.3 Sat Dec 23 17:55:19 2017 (r327114) +++ head/lib/libc/gen/daemon.3 Sat Dec 23 18:07:43 2017 (r327115) @@ -28,7 +28,7 @@ .\" @(#)daemon.3 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd June 9, 1993 +.Dd December 23, 2017 .Dt DAEMON 3 .Os .Sh NAME @@ -40,6 +40,8 @@ .In stdlib.h .Ft int .Fn daemon "int nochdir" "int noclose" +.Ft int +.Fn daemonfd "int chdirfd" "int nullfd" .Sh DESCRIPTION The .Fn daemon @@ -59,15 +61,39 @@ is non-zero, .Fn daemon will redirect standard input, standard output, and standard error to .Pa /dev/null . +.Pp +The +.Fn daemonfd +function is equivalent to the +.Fn daemon +function except that arguments are the descriptors for the current working +directory and to the descriptor to +.Pa /dev/null . +.Pp +If +.Fa chdirfd +is equal to +.Pq -1 +the current working directory is not changed. +.Pp +If +.Fa nullfd +is equals to +.Pq -1 +the redirection of standard input, standard output, and standard error is not +closed. .Sh RETURN VALUES -.Rv -std daemon +.Rv -std daemon daemonfd .Sh ERRORS The .Fn daemon +and +.Fn daemonfd function may fail and set .Va errno for any of the errors specified for the library functions .Xr fork 2 +.Xr open 2, and .Xr setsid 2 . .Sh SEE ALSO @@ -79,6 +105,10 @@ The .Fn daemon function first appeared in .Bx 4.4 . +The +.Fn daemonfd +function first appeared in +.Fx 12.0 . .Sh CAVEATS Unless the .Fa noclose Modified: head/lib/libc/gen/daemon.c ============================================================================== --- head/lib/libc/gen/daemon.c Sat Dec 23 17:55:19 2017 (r327114) +++ head/lib/libc/gen/daemon.c Sat Dec 23 18:07:43 2017 (r327115) @@ -1,8 +1,9 @@ /*- * SPDX-License-Identifier: BSD-3-Clause * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 1990, 1993 The Regents of the University of California. + * Copyright (c) 2017 Mariusz Zaborski + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -46,10 +47,9 @@ __FBSDID("$FreeBSD$"); #include "libc_private.h" int -daemon(int nochdir, int noclose) +daemonfd(int chdirfd, int nullfd) { struct sigaction osa, sa; - int fd; pid_t newgrp; int oerrno; int osa_ok; @@ -83,15 +83,39 @@ daemon(int nochdir, int noclose) return (-1); } - if (!nochdir) - (void)chdir("/"); + if (chdirfd != -1) + (void)fchdir(chdirfd); - if (!noclose && (fd = _open(_PATH_DEVNULL, O_RDWR, 0)) != -1) { - (void)_dup2(fd, STDIN_FILENO); - (void)_dup2(fd, STDOUT_FILENO); - (void)_dup2(fd, STDERR_FILENO); - if (fd > 2) - (void)_close(fd); + if (nullfd != -1) { + (void)_dup2(nullfd, STDIN_FILENO); + (void)_dup2(nullfd, STDOUT_FILENO); + (void)_dup2(nullfd, STDERR_FILENO); } return (0); +} + +int +daemon(int nochdir, int noclose) +{ + int chdirfd, nullfd, ret; + + if (!noclose) + nullfd = _open(_PATH_DEVNULL, O_RDWR, 0); + else + nullfd = -1; + + if (!nochdir) + chdirfd = _open("/", O_EXEC); + else + chdirfd = -1; + + ret = daemonfd(chdirfd, nullfd); + + if (chdirfd != -1) + _close(chdirfd); + + if (nullfd > 2) + _close(nullfd); + + return (ret); } From owner-svn-src-head@freebsd.org Sat Dec 23 19:39:43 2017 Return-Path: Delivered-To: svn-src-head@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 3A674E971DC; Sat, 23 Dec 2017 19:39:43 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BAD2720E1; Sat, 23 Dec 2017 19:39:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id e204so27705381iof.12; Sat, 23 Dec 2017 11:39:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=cSfEk825NIfso5YgqFDDTER4+nIOedCRbicoP9rEbeE=; b=oW/GLuLDz8ONDejAhmKB3hQBkP7coQ7NQE10kPfH9g4SkrJHmrEXca1BQRZWZfn1Cu ixOJ2PiB6dmcLZFGpIF1/qm4yjBMT4d2FfQoF09v6VFe4Zb5RnTdif6/3p2fCqr3iEVa wUdrzWfFU3vHaiovH5xG2KrcoAdVFk/F2hG0s/UyWuke4ZD89yFOUUKGqMsx/RrrH2Ik kra9XS7MCphJj/Cq7mHxNSlRdSA4Y0CRmBJ1pSHQ2emnGkKw0GDrBEMrmTr/HIUKaO2k xCjg+dcekyoiIqs28tsuG/GKjjWkrtkAtsy1BliyZE4CqizP0zPGXaGT8S9B1YJzp6AQ 0+7w== X-Gm-Message-State: AKGB3mIrbknhxdDvzUWsfY7CEqMNT/0AeODdTJ7jGwi+AcOSAFFTL8Of 0OIFtOt7KvQeh7+EmqUucmu8eS5Q X-Google-Smtp-Source: ACJfBosXIih7hbzhXhxzriLpk5IqTQDzhAFnAKZiBImtRcnMoTfNZhfBBcObnut/0m15UWlN+s3L8A== X-Received: by 10.107.111.13 with SMTP id k13mr5616481ioc.109.1514056491905; Sat, 23 Dec 2017 11:14:51 -0800 (PST) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id q132sm13578646iod.26.2017.12.23.11.14.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2017 11:14:51 -0800 (PST) Received: by mail-it0-f47.google.com with SMTP id b5so17520639itc.3; Sat, 23 Dec 2017 11:14:51 -0800 (PST) X-Received: by 10.36.192.2 with SMTP id u2mr22973431itf.119.1514056491645; Sat, 23 Dec 2017 11:14:51 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Sat, 23 Dec 2017 11:14:51 -0800 (PST) In-Reply-To: <201712221659.vBMGxoUH038447@repo.freebsd.org> References: <201712221659.vBMGxoUH038447@repo.freebsd.org> From: Conrad Meyer Date: Sat, 23 Dec 2017 11:14:51 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327084 - head/sys/dev/pccard To: Warner Losh Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 19:39:43 -0000 On Fri, Dec 22, 2017 at 8:59 AM, Warner Losh wrote: > ... > New Revision: 327084 > > PC Card PNP tables are terminated by a NULL sentinel. This shouldn't > be recorded in the linker hints, so subtract one to omit it. > ============================================================================== > --- head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:27:29 2017 (r327083) > +++ head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:59:50 2017 (r327084) > @@ -95,7 +95,7 @@ struct pccard_product { > */ > #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32:product;Z:cisvendor;Z:cisproduct;" > #define PCCARD_PNP_INFO(t) \ > - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0])); \ > + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), sizeof(t) / sizeof(t[0]) - 1); \ Perhaps more clearly, this could be: MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - 1) From owner-svn-src-head@freebsd.org Sat Dec 23 19:44:15 2017 Return-Path: Delivered-To: svn-src-head@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 948F5E97984 for ; Sat, 23 Dec 2017 19:44:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57A3D725D3 for ; Sat, 23 Dec 2017 19:44:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id w127so27714390iow.11 for ; Sat, 23 Dec 2017 11:44:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=emtlSQd+MzWP9qGZnDe/KgU0Lq+67/sD/VErhJQoHL4=; b=OxUrePAucm52Pkyl2yHv9yAsZVwDmvTTKkYV4BWomTYPy64UOT42LO3V5tYLjGKjEz C3lCDeuBsfYAmJ+LUNNVqiaJ3/RXmiLdRX7esSVlO0oJ5R5nvPAPqtdmrJ5LNXGHuXLo g566M5YmEVCIRnrDTzjymnPa6kC/6M3wcyDupyn8QxekG0GA0fswtEHRPXQXs+hsRrFM WVL7l8neDhk2zpVPLB7iL3+eXdft+GmQetUqaVkm+OqQJqR8fqvrmI9l780PEyuG7uMy LEK2OTuRGDfcv+Qzz2ThFwBuvFZv3Alj64TOBAv3zLzxdYTiqLzfQUsIYc3ZWFCHK1qa /BPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=emtlSQd+MzWP9qGZnDe/KgU0Lq+67/sD/VErhJQoHL4=; b=rSMepSd0UuFMAQiL4XXAccuH3gFKNcfVSHmFPkWRy8Z1EtT3XzRex0qXuXWlDzN+Rd JIKTVkWUDhmvlIugUVlyUVZjXXr+iOUoFvvVyXQySob2RYyM+FOUZVNklw/NlJ7y+5Rj 0cfYAfLnCF7XdeFfvmHsno8SnndUKWKQv7yxtIqEZdZed61Gmb0ECzHs5ylzlrx8jSEb SH6rc5aLXl9bsS2Ux4dkWMgRhxI3GLgnYBpih9yUox/w5EoO+fDBcOcIk3E25oiTkdsN 192cEtGq31jjTiJFO3nvIXiCVXMfwdj61Xq8Qr2qgRCZY6pi6Wqs6TL/4SOwhxLJBcKo A77g== X-Gm-Message-State: AKGB3mKGM3ZGqcsMO9wZxywuWsmd34k3mpcg695c4stzUVFIX0DPRU9w ws+VsgMxGCLkLz2yKjDdL6wig0tU4XBUjJkw8g6Cow== X-Google-Smtp-Source: ACJfBotqJtGEOJ37UXwGWY3vCAMsSaioMyPAwQA0sxQzt3xjmv0829XoMYlQTZwdLmIdt5jKtcYaKWDwv4HJ6GGt550= X-Received: by 10.107.142.145 with SMTP id q139mr5988562iod.63.1514058254525; Sat, 23 Dec 2017 11:44:14 -0800 (PST) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.108.204 with HTTP; Sat, 23 Dec 2017 11:44:13 -0800 (PST) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201712221659.vBMGxoUH038447@repo.freebsd.org> From: Warner Losh Date: Sat, 23 Dec 2017 12:44:13 -0700 X-Google-Sender-Auth: VuFSup_4QWMMyial2iXB8OXrxUs Message-ID: Subject: Re: svn commit: r327084 - head/sys/dev/pccard To: "Conrad E. Meyer" Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 19:44:15 -0000 On Sat, Dec 23, 2017 at 12:14 PM, Conrad Meyer wrote: > On Fri, Dec 22, 2017 at 8:59 AM, Warner Losh wrote: > > ... > > New Revision: 327084 > > > > PC Card PNP tables are terminated by a NULL sentinel. This shouldn't > > be recorded in the linker hints, so subtract one to omit it. > > ============================================================ > ================== > > --- head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:27:29 2017 > (r327083) > > +++ head/sys/dev/pccard/pccardvar.h Fri Dec 22 16:59:50 2017 > (r327084) > > @@ -95,7 +95,7 @@ struct pccard_product { > > */ > > #define PCCARD_PNP_DESCR "D:#;V32:manufacturer;V32: > product;Z:cisvendor;Z:cisproduct;" > > #define PCCARD_PNP_INFO(t) \ > > - MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), > sizeof(t) / sizeof(t[0])); \ > > + MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), > sizeof(t) / sizeof(t[0]) - 1); \ > > Perhaps more clearly, this could be: > MODULE_PNP_INFO(PCCARD_PNP_DESCR, pccard, t, t, sizeof(t[0]), nitems(t) - > 1) > Yup. A later commit did just that when I saw the construct used elsewhere. Thanks for the suggestion! Warner From owner-svn-src-head@freebsd.org Sat Dec 23 19:48:58 2017 Return-Path: Delivered-To: svn-src-head@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 780F2E97EEC; Sat, 23 Dec 2017 19:48:58 +0000 (UTC) (envelope-from eadler@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 4557172800; Sat, 23 Dec 2017 19:48:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNJmvKp042772; Sat, 23 Dec 2017 19:48:57 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNJmvfi042771; Sat, 23 Dec 2017 19:48:57 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712231948.vBNJmvfi042771@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Dec 2017 19:48:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327116 - head/usr.bin/ldd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/ldd X-SVN-Commit-Revision: 327116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 19:48:58 -0000 Author: eadler Date: Sat Dec 23 19:48:57 2017 New Revision: 327116 URL: https://svnweb.freebsd.org/changeset/base/327116 Log: ldd: avoid statically linked executables in example The example works but spews warnings if run over a directory with statically linked binaries. PR: 211024 Submitted by: mike@skew.org Modified: head/usr.bin/ldd/ldd.1 Modified: head/usr.bin/ldd/ldd.1 ============================================================================== --- head/usr.bin/ldd/ldd.1 Sat Dec 23 18:07:43 2017 (r327115) +++ head/usr.bin/ldd/ldd.1 Sat Dec 23 19:48:57 2017 (r327116) @@ -63,7 +63,7 @@ The following is an example of a shell pipeline which option. It will print a report of all ELF binaries in the current directory, which link against libc.so.6: -.Dl "find . -type f | xargs -n1 file -F ' ' | grep ELF | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep libc.so.6" +.Dl "find . -type f | xargs -n1 file -F ' ' | grep 'ELF.*dynamically' | cut -f1 -d' ' | xargs ldd -f '%A %o\en' | grep libc.so.6" .Sh SEE ALSO .Xr ld 1 , .Xr nm 1 , From owner-svn-src-head@freebsd.org Sat Dec 23 20:32:46 2017 Return-Path: Delivered-To: svn-src-head@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 29FDEE9D2CA; Sat, 23 Dec 2017 20:32:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77DFA741D6; Sat, 23 Dec 2017 20:32:45 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id t1so17596913ite.5; Sat, 23 Dec 2017 12:32:45 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=iDbhSd5VRxxx4f9SC5Y8IBr9uw0FgsW+yzP3yEcBJuU=; b=jUj2Iav/qebe1EXYeYh0AAEeGTj6dIFXufnqlp65thTzzqeSes9BI1lSQzxkfqmX1N 2wN0ayHXLHDXCTZWI3tHE9v12WTT1xQMPp9T6sDiDHhbRHj+xxcCigjLKAT6PpiIe3qC EhUm7pPfoErjBEQ3zi4KcjTR7lDj/DhH4LqgT65s/jhQxtiioAad1rbQ99wqr7BZ22Q4 rdTRWqDpy5oZcWWXYtWj2/1973e/7SSvISJ1B4vzZIXYctdze2iz+KraX5dlc+tl705k PV4Jz22U4gtxzy/rFJokkpr51oVwA94rZpfxYXIOiYPu+hxc4hRcQD4heIBcTlLX20C6 AgPw== X-Gm-Message-State: AKGB3mJGmTp+zB8jApBgyWcNu4LZU3Ixwb4rbOKVAPHU4gCS7Q5HPRRk UWD1MT9pr9iB/k/nBmRwDTTRbYWV X-Google-Smtp-Source: ACJfBovQmISwGyXD48CHHpMICDna40QhqeYhxgeaZ8ZA6q+7slqG3vLulQCPz4tZjUQlUlcvNJ6Vdw== X-Received: by 10.36.176.9 with SMTP id d9mr24407278itf.125.1514060818844; Sat, 23 Dec 2017 12:26:58 -0800 (PST) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com. [209.85.223.175]) by smtp.gmail.com with ESMTPSA id l83sm9422486ioi.79.2017.12.23.12.26.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2017 12:26:58 -0800 (PST) Received: by mail-io0-f175.google.com with SMTP id e204so27766586iof.12; Sat, 23 Dec 2017 12:26:58 -0800 (PST) X-Received: by 10.107.181.147 with SMTP id e141mr23056800iof.117.1514060818389; Sat, 23 Dec 2017 12:26:58 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.15.193 with HTTP; Sat, 23 Dec 2017 12:26:57 -0800 (PST) In-Reply-To: <201712222044.vBMKiLPd033739@repo.freebsd.org> References: <201712222044.vBMKiLPd033739@repo.freebsd.org> From: Conrad Meyer Date: Sat, 23 Dec 2017 12:26:57 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r327094 - in head/sys/dev: ahci usb/controller To: Alexander Motin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 20:32:46 -0000 I see similar devices on my AMD TR + X399 system that should be added as well. I don't have time to reboot/test a patch right now, but here are the device ids: pci1 ahci0 pnpinfo vendor=0x1022 device=0x43b6 subvendor=0x1b21 subdevice=0x1062 class=0x010601 at slot=0 function=1 dbsf=pci0:1:0:1 handle=\_SB_.PCI0.D0A0.P101 xhci0 pnpinfo vendor=0x1022 device=0x43ba subvendor=0x1b21 subdevice=0x1142 class=0x0c0330 at slot=0 function=0 dbsf=pci0:1:0:0 handle=\_SB_.PCI0.D0A0.PTXH (0x43b61022 for ahci0, 0x43ba1022 for xhci0.) If no one else commits them, I'll get to it eventually. Best, Conrad On Fri, Dec 22, 2017 at 12:44 PM, Alexander Motin wrote: > Author: mav > Date: Fri Dec 22 20:44:21 2017 > New Revision: 327094 > URL: https://svnweb.freebsd.org/changeset/base/327094 > > Log: > Add AHCI/XHCI device IDs found on AMD Ryzen+B350 system. > > MFC after: 2 weeks > > Modified: > head/sys/dev/ahci/ahci_pci.c > head/sys/dev/usb/controller/xhci_pci.c > > Modified: head/sys/dev/ahci/ahci_pci.c > ============================================================================== > --- head/sys/dev/ahci/ahci_pci.c Fri Dec 22 19:10:19 2017 (r327093) > +++ head/sys/dev/ahci/ahci_pci.c Fri Dec 22 20:44:21 2017 (r327094) > @@ -68,6 +68,7 @@ static const struct { > AHCI_Q_ATI_PMP_BUG | AHCI_Q_1MSI}, > /* Not sure SB8x0/SB9x0 needs this quirk. Be conservative though */ > {0x43951002, 0x00, "AMD SB8x0/SB9x0", AHCI_Q_ATI_PMP_BUG}, > + {0x43b71022, 0x00, "AMD 300 Series", 0}, > {0x78001022, 0x00, "AMD Hudson-2", 0}, > {0x78011022, 0x00, "AMD Hudson-2", 0}, > {0x78021022, 0x00, "AMD Hudson-2", 0}, > > Modified: head/sys/dev/usb/controller/xhci_pci.c > ============================================================================== > --- head/sys/dev/usb/controller/xhci_pci.c Fri Dec 22 19:10:19 2017 (r327093) > +++ head/sys/dev/usb/controller/xhci_pci.c Fri Dec 22 20:44:21 2017 (r327094) > @@ -97,6 +97,10 @@ xhci_pci_match(device_t self) > uint32_t device_id = pci_get_devid(self); > > switch (device_id) { > + case 0x145c1022: > + return ("AMD KERNCZ USB 3.0 controller"); > + case 0x43bb1022: > + return ("AMD 300 Series USB 3.0 controller"); > case 0x78141022: > return ("AMD FCH USB 3.0 controller"); > > From owner-svn-src-head@freebsd.org Sat Dec 23 21:04:34 2017 Return-Path: Delivered-To: svn-src-head@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 18C82E9FFA8; Sat, 23 Dec 2017 21:04:34 +0000 (UTC) (envelope-from eadler@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 DA3217568F; Sat, 23 Dec 2017 21:04:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNL4WUp075907; Sat, 23 Dec 2017 21:04:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNL4WLi075906; Sat, 23 Dec 2017 21:04:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201712232104.vBNL4WLi075906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Dec 2017 21:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327117 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 327117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 21:04:34 -0000 Author: eadler Date: Sat Dec 23 21:04:32 2017 New Revision: 327117 URL: https://svnweb.freebsd.org/changeset/base/327117 Log: calendar: add missing header file time.h is required for strftime and struct tm Reviewed by: edje Modified: head/usr.bin/calendar/io.c Modified: head/usr.bin/calendar/io.c ============================================================================== --- head/usr.bin/calendar/io.c Sat Dec 23 19:48:57 2017 (r327116) +++ head/usr.bin/calendar/io.c Sat Dec 23 21:04:32 2017 (r327117) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "pathnames.h" From owner-svn-src-head@freebsd.org Sat Dec 23 21:32:52 2017 Return-Path: Delivered-To: svn-src-head@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 476A1EA2425; Sat, 23 Dec 2017 21:32:52 +0000 (UTC) (envelope-from kib@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 14586766D4; Sat, 23 Dec 2017 21:32:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNLWpaT088559; Sat, 23 Dec 2017 21:32:51 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNLWoJr088557; Sat, 23 Dec 2017 21:32:50 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201712232132.vBNLWoJr088557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Dec 2017 21:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327118 - in head/sys/x86: include x86 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/x86: include x86 X-SVN-Commit-Revision: 327118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 21:32:52 -0000 Author: kib Date: Sat Dec 23 21:32:50 2017 New Revision: 327118 URL: https://svnweb.freebsd.org/changeset/base/327118 Log: Add missed AVX512VL (128 and 256 bit vector length) extension identification bit. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/x86/include/specialreg.h head/sys/x86/x86/identcpu.c Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Sat Dec 23 21:04:32 2017 (r327117) +++ head/sys/x86/include/specialreg.h Sat Dec 23 21:32:50 2017 (r327118) @@ -409,6 +409,7 @@ #define CPUID_STDEXT_AVX512CD 0x10000000 #define CPUID_STDEXT_SHA 0x20000000 #define CPUID_STDEXT_AVX512BW 0x40000000 +#define CPUID_STDEXT_AVX512VL 0x80000000 /* * CPUID instruction 7 Structured Extended Features, leaf 0 ecx info Modified: head/sys/x86/x86/identcpu.c ============================================================================== --- head/sys/x86/x86/identcpu.c Sat Dec 23 21:04:32 2017 (r327117) +++ head/sys/x86/x86/identcpu.c Sat Dec 23 21:32:50 2017 (r327118) @@ -963,6 +963,7 @@ printcpuinfo(void) "\035AVX512CD" "\036SHA" "\037AVX512BW" + "\040AVX512VL" ); } From owner-svn-src-head@freebsd.org Sat Dec 23 22:57:15 2017 Return-Path: Delivered-To: svn-src-head@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 AB6C0EA8459; Sat, 23 Dec 2017 22:57:15 +0000 (UTC) (envelope-from imp@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 853087A16B; Sat, 23 Dec 2017 22:57:15 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNMvEFM023098; Sat, 23 Dec 2017 22:57:14 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNMvEHk023093; Sat, 23 Dec 2017 22:57:14 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201712232257.vBNMvEHk023093@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sat, 23 Dec 2017 22:57:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327120 - in head/sys: isa x86/isa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys: isa x86/isa X-SVN-Commit-Revision: 327120 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 22:57:15 -0000 Author: imp Date: Sat Dec 23 22:57:14 2017 New Revision: 327120 URL: https://svnweb.freebsd.org/changeset/base/327120 Log: Warn when nonPNP ISA devices are attached in GENERIC that they are being removed from GENERIC in 12. Always print PNP info for ISA when it exists: it doesn't depend on ISAPNP. Add PNP ID to orm and vga to prevent us from warning about them since those devices aren't being removed from GENERIC. PNP devices will be removed from GENERIC too, but they will be automatically loaded, so need no warning. We don't warn for non-GENERIC kernels because people running them are presumed to know what they are doing. MFC After: 2 weeks Modified: head/sys/isa/isa_common.c head/sys/isa/pnp.c head/sys/isa/vga_isa.c head/sys/x86/isa/orm.c Modified: head/sys/isa/isa_common.c ============================================================================== --- head/sys/isa/isa_common.c Sat Dec 23 21:41:32 2017 (r327119) +++ head/sys/isa/isa_common.c Sat Dec 23 22:57:14 2017 (r327120) @@ -68,10 +68,12 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include +#include #include @@ -499,7 +501,7 @@ isa_probe_children(device_t dev) struct isa_device *idev; device_t *children, child; struct isa_config *cfg; - int nchildren, i; + int nchildren, i, err; /* * Create all the non-hinted children by calling drivers' @@ -569,7 +571,11 @@ isa_probe_children(device_t dev) !TAILQ_EMPTY(&idev->id_configs)) continue; - device_probe_and_attach(child); + err = device_probe_and_attach(child); + if (err == 0 && idev->id_vendorid == 0 && + strcmp(kern_ident, "GENERIC") == 0) + device_printf(child, + "non-PNP ISA device will be removed from GENERIC in FreeBSD 12."); } /* @@ -637,10 +643,8 @@ isa_print_all_resources(device_t dev) retval += resource_list_print_type(rl, "drq", SYS_RES_DRQ, "%jd"); if (device_get_flags(dev)) retval += printf(" flags %#x", device_get_flags(dev)); -#ifdef ISAPNP if (idev->id_vendorid) retval += printf(" pnpid %s", pnp_eisaformat(idev->id_vendorid)); -#endif return (retval); } @@ -1030,13 +1034,11 @@ static int isa_child_pnpinfo_str(device_t bus, device_t child, char *buf, size_t buflen) { -#ifdef ISAPNP struct isa_device *idev = DEVTOISA(child); if (idev->id_vendorid) snprintf(buf, buflen, "pnpid=%s", pnp_eisaformat(idev->id_vendorid)); -#endif return (0); } @@ -1124,4 +1126,24 @@ isab_attach(device_t dev) if (child != NULL) return (bus_generic_attach(dev)); return (ENXIO); +} + +char * +pnp_eisaformat(uint32_t id) +{ + uint8_t *data; + static char idbuf[8]; + const char hextoascii[] = "0123456789abcdef"; + + id = htole32(id); + data = (uint8_t *)&id; + idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); + idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); + idbuf[2] = '@' + (data[1] & 0x1f); + idbuf[3] = hextoascii[(data[2] >> 4)]; + idbuf[4] = hextoascii[(data[2] & 0xf)]; + idbuf[5] = hextoascii[(data[3] >> 4)]; + idbuf[6] = hextoascii[(data[3] & 0xf)]; + idbuf[7] = 0; + return(idbuf); } Modified: head/sys/isa/pnp.c ============================================================================== --- head/sys/isa/pnp.c Sat Dec 23 21:41:32 2017 (r327119) +++ head/sys/isa/pnp.c Sat Dec 23 22:57:14 2017 (r327120) @@ -103,26 +103,6 @@ static void pnp_send_initiation_key(void); static int pnp_get_serial(pnp_id *p); static int pnp_isolation_protocol(device_t parent); -char * -pnp_eisaformat(uint32_t id) -{ - uint8_t *data; - static char idbuf[8]; - const char hextoascii[] = "0123456789abcdef"; - - id = htole32(id); - data = (uint8_t *)&id; - idbuf[0] = '@' + ((data[0] & 0x7c) >> 2); - idbuf[1] = '@' + (((data[0] & 0x3) << 3) + ((data[1] & 0xe0) >> 5)); - idbuf[2] = '@' + (data[1] & 0x1f); - idbuf[3] = hextoascii[(data[2] >> 4)]; - idbuf[4] = hextoascii[(data[2] & 0xf)]; - idbuf[5] = hextoascii[(data[3] >> 4)]; - idbuf[6] = hextoascii[(data[3] & 0xf)]; - idbuf[7] = 0; - return(idbuf); -} - static void pnp_write(int d, u_char r) { Modified: head/sys/isa/vga_isa.c ============================================================================== --- head/sys/isa/vga_isa.c Sat Dec 23 21:41:32 2017 (r327119) +++ head/sys/isa/vga_isa.c Sat Dec 23 22:57:14 2017 (r327120) @@ -175,6 +175,7 @@ isavga_probe(device_t dev) adp.va_io_base, adp.va_io_size); bus_set_resource(dev, SYS_RES_MEMORY, 0, adp.va_mem_base, adp.va_mem_size); + isa_set_vendorid(dev, PNP_EISAID("PNP0900")); #if 0 isa_set_port(dev, adp.va_io_base); isa_set_portsize(dev, adp.va_io_size); Modified: head/sys/x86/isa/orm.c ============================================================================== --- head/sys/x86/isa/orm.c Sat Dec 23 21:41:32 2017 (r327119) +++ head/sys/x86/isa/orm.c Sat Dec 23 22:57:14 2017 (r327120) @@ -156,6 +156,7 @@ orm_identify(driver_t* driver, device_t parent) device_set_desc(child, "ISA Option ROM"); else device_set_desc(child, "ISA Option ROMs"); + isa_set_vendorid(child, PNP_EISAID("PNP0C80")); } static int From owner-svn-src-head@freebsd.org Sat Dec 23 22:58:20 2017 Return-Path: Delivered-To: svn-src-head@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 68AEFEA8609; Sat, 23 Dec 2017 22:58:20 +0000 (UTC) (envelope-from jilles@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 35EB07A3D1; Sat, 23 Dec 2017 22:58:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id vBNMwJuM023323; Sat, 23 Dec 2017 22:58:19 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id vBNMwJW0023322; Sat, 23 Dec 2017 22:58:19 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201712232258.vBNMwJW0023322@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 23 Dec 2017 22:58:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327121 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 327121 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Dec 2017 22:58:20 -0000 Author: jilles Date: Sat Dec 23 22:58:19 2017 New Revision: 327121 URL: https://svnweb.freebsd.org/changeset/base/327121 Log: sh(1): Markup and spelling fixes Modified: head/bin/sh/sh.1 Modified: head/bin/sh/sh.1 ============================================================================== --- head/bin/sh/sh.1 Sat Dec 23 22:57:14 2017 (r327120) +++ head/bin/sh/sh.1 Sat Dec 23 22:58:19 2017 (r327121) @@ -343,7 +343,7 @@ Write each command variable subjected to parameter expansion and arithmetic expansion) to standard error before it is executed. Useful for debugging. -.It nolog +.It Li nolog Another do-nothing option for .Tn POSIX compliance. @@ -2739,7 +2739,7 @@ were a known job that exited with exit status 127. If no operands are given, wait for all jobs to complete and return an exit status of zero. .El -.Ss Commandline Editing +.Ss Command Line Editing When .Nm is being used interactively from a terminal, the current command