From owner-svn-src-head@freebsd.org Sun Dec 30 00:27:29 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 215581431BCB; Sun, 30 Dec 2018 00:27:29 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BA1EA8B5BC; Sun, 30 Dec 2018 00:27:28 +0000 (UTC) (envelope-from 0mp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9FA781AAF8; Sun, 30 Dec 2018 00:27:28 +0000 (UTC) (envelope-from 0mp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU0RSsP063061; Sun, 30 Dec 2018 00:27:28 GMT (envelope-from 0mp@FreeBSD.org) Received: (from 0mp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU0RSpv063060; Sun, 30 Dec 2018 00:27:28 GMT (envelope-from 0mp@FreeBSD.org) Message-Id: <201812300027.wBU0RSpv063060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: 0mp set sender to 0mp@FreeBSD.org using -f From: Mateusz Piotrowski <0mp@FreeBSD.org> Date: Sun, 30 Dec 2018 00:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342602 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: 0mp X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 342602 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BA1EA8B5BC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 00:27:29 -0000 Author: 0mp (ports committer) Date: Sun Dec 30 00:27:28 2018 New Revision: 342602 URL: https://svnweb.freebsd.org/changeset/base/342602 Log: ports.7: Add an example of getting dependencies without building them While here, improve formatting of the EXAMPLES section in general. Reviewed by: bcr Approved by: bcr (doc) Approved by: krion (mentor, implicit), mat (mentor, implicit) Differential Revision: https://reviews.freebsd.org/D18682 Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Sat Dec 29 23:08:59 2018 (r342601) +++ head/share/man/man7/ports.7 Sun Dec 30 00:27:28 2018 (r342602) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2018 +.Dd December 30, 2018 .Dt PORTS 7 .Os .Sh NAME @@ -537,11 +537,33 @@ The default ports directory. The big Kahuna. .El .Sh EXAMPLES -Build and install Emacs: -.Bd -literal -offset indent -cd /usr/ports/editors/emacs -make install +.Bl -tag -width 0n +.It Sy Example 1\&: No Building and Installing a Port +.Pp +The following command builds and installs Emacs. +.Bd -literal -offset 2n +.Li # Ic cd /usr/ports/editors/emacs +.Li # Ic make install .Ed +.It Sy Example 2\&: No Installing Dependencies with Xr pkg 8 +.Pp +The following examples shows how to build and install a port without having to +build its dependencies. +Instead, the dependencies are downloaded via +.Xr pkg 8 . +.Bd -literal -offset 2n +.Li # Ic make missing | xargs pkg install --automatic --yes +.Li # Ic make install +.Ed +.Pp +It is especially useful, when the dependencies are costly +in time and resources to build +.Pq like Pa lang/rust . +The drawback is that +.Xr pkg 8 +offers only packages built with the default set of +.Va OPTIONS . +.El .Sh SEE ALSO .Xr make 1 , .Xr make.conf 5 , From owner-svn-src-head@freebsd.org Sun Dec 30 01:57:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 819F1143528F; Sun, 30 Dec 2018 01:57:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 26CB18E867; Sun, 30 Dec 2018 01:57:12 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A2341BFB1; Sun, 30 Dec 2018 01:57:12 +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 wBU1vB5l010085; Sun, 30 Dec 2018 01:57:11 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU1vBaD010084; Sun, 30 Dec 2018 01:57:11 GMT (envelope-from np@FreeBSD.org) Message-Id: <201812300157.wBU1vBaD010084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sun, 30 Dec 2018 01:57:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342603 - 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: 342603 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 26CB18E867 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 01:57:12 -0000 Author: np Date: Sun Dec 30 01:57:11 2018 New Revision: 342603 URL: https://svnweb.freebsd.org/changeset/base/342603 Log: cxgbe(4): Attach to two T540 variants. MFC after: 1 week Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Sun Dec 30 00:27:28 2018 (r342602) +++ head/sys/dev/cxgbe/t4_main.c Sun Dec 30 01:57:11 2018 (r342603) @@ -736,6 +736,10 @@ struct { {0x5419, "Chelsio T540-LP-BT"}, /* 4 x 10GBaseT */ {0x541a, "Chelsio T540-SO-BT"}, /* 4 x 10GBaseT, nomem */ {0x541b, "Chelsio T540-SO-CR"}, /* 4 x 10G, nomem */ + + /* Custom */ + {0x5483, "Custom T540-CR"}, + {0x5484, "Custom T540-BT"}, }, t6_pciids[] = { {0xc006, "Chelsio Terminator 6 FPGA"}, /* T6 PE10K6 FPGA (PF0) */ {0x6400, "Chelsio T6-DBG-25"}, /* 2 x 10/25G, debug */ From owner-svn-src-head@freebsd.org Sun Dec 30 05:03:42 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8C46143BEF3; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5F6F06ECDE; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 531C21E2E3; Sun, 30 Dec 2018 05:03:42 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU53gE4009967; Sun, 30 Dec 2018 05:03:42 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU53g2C009966; Sun, 30 Dec 2018 05:03:42 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812300503.wBU53g2C009966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 30 Dec 2018 05:03:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342609 - head/sys/ufs/ffs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ffs X-SVN-Commit-Revision: 342609 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F6F06ECDE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 05:03:42 -0000 Author: mckusick Date: Sun Dec 30 05:03:41 2018 New Revision: 342609 URL: https://svnweb.freebsd.org/changeset/base/342609 Log: For consistency with FFS2's fifoops2 and both versions of FFS's vnodeops make FFS1's fifoops1 use ffs_lock. Also delete ffs_reallocblks from fifoops1 which is needed only for fifoops2 because of its support for extended attributes that need to allocate blocks. Suggested by: kib Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Sun Dec 30 04:42:01 2018 (r342608) +++ head/sys/ufs/ffs/ffs_vnops.c Sun Dec 30 05:03:41 2018 (r342609) @@ -144,7 +144,7 @@ struct vop_vector ffs_fifoops1 = { .vop_default = &ufs_fifoops, .vop_fsync = ffs_fsync, .vop_fdatasync = ffs_fdatasync, - .vop_reallocblks = ffs_reallocblks, /* XXX: really ??? */ + .vop_lock1 = ffs_lock, .vop_vptofh = ffs_vptofh, }; From owner-svn-src-head@freebsd.org Sun Dec 30 09:35:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D788A14206BB; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CD3076BA0; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C58721189; Sun, 30 Dec 2018 09:35:48 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU9ZmMd052669; Sun, 30 Dec 2018 09:35:48 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU9Zlwg052665; Sun, 30 Dec 2018 09:35:47 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812300935.wBU9Zlwg052665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 09:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342619 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342619 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CD3076BA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.933,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 09:35:49 -0000 Author: tsoome Date: Sun Dec 30 09:35:47 2018 New Revision: 342619 URL: https://svnweb.freebsd.org/changeset/base/342619 Log: loader: create bio_alloc and bio_free for bios bounce buffer We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement bio_alloc()/bio_free() interface to make it possible to use this space for other BIOS calls (notably, from biosdisk.c). MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D17131 Added: head/stand/i386/libi386/bio.c (contents, props changed) Modified: head/stand/i386/libi386/Makefile head/stand/i386/libi386/biosdisk.c head/stand/i386/libi386/libi386.h head/stand/i386/libi386/pxe.c Modified: head/stand/i386/libi386/Makefile ============================================================================== --- head/stand/i386/libi386/Makefile Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/Makefile Sun Dec 30 09:35:47 2018 (r342619) @@ -4,7 +4,7 @@ LIB= i386 -SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ +SRCS= bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ comconsole.c devicename.c elf32_freebsd.c \ elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ Added: head/stand/i386/libi386/bio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/i386/libi386/bio.c Sun Dec 30 09:35:47 2018 (r342619) @@ -0,0 +1,65 @@ +/*- + * 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include "libi386.h" + +/* + * The idea is borrowed from pxe.c and zfsimpl.c. The original buffer + * space in pxe.c was 2x 0x2000. Allocating it from BSS will give us needed + * memory below 1MB and usable for real mode calls. + * + * Note the allocations and frees are to be done in reverse order (LIFO). + */ + +static char bio_buffer[BIO_BUFFER_SIZE]; +static char *bio_buffer_end = bio_buffer + BIO_BUFFER_SIZE; +static char *bio_buffer_ptr = bio_buffer; + +void * +bio_alloc(size_t size) +{ + char *ptr; + + ptr = bio_buffer_ptr; + if (ptr + size > bio_buffer_end) + return (NULL); + bio_buffer_ptr += size; + + return (ptr); +} + +void +bio_free(void *ptr, size_t size) +{ + + if (ptr == NULL) + return; + + bio_buffer_ptr -= size; + if (bio_buffer_ptr != ptr) + panic("bio_alloc()/bio_free() mismatch\n"); +} Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/biosdisk.c Sun Dec 30 09:35:47 2018 (r342619) @@ -469,10 +469,10 @@ bd_get_diskinfo_ext(struct bdinfo *bd) * Sector size must be a multiple of 512 bytes. * An alternate test would be to check power of 2, * powerof2(params.sector_size). - * 4K is largest read buffer we can use at this time. + * 16K is largest read buffer we can use at this time. */ if (params.sector_size >= 512 && - params.sector_size <= 4096 && + params.sector_size <= 16384 && (params.sector_size % BIOSDISK_SECSIZE) == 0) bd->bd_sectorsize = params.sector_size; @@ -861,8 +861,8 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s struct disk_devdesc *dev = (struct disk_devdesc *)devdata; bdinfo_t *bd; uint64_t disk_blocks, offset, d_offset; - size_t blks, blkoff, bsize, rest; - caddr_t bbuf; + size_t blks, blkoff, bsize, bio_size, rest; + caddr_t bbuf = NULL; int rc; bd = bd_get_bdinfo(&dev->dd); @@ -937,14 +937,25 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s DEBUG("short I/O %d", blks); } - if (V86_IO_BUFFER_SIZE / bd->bd_sectorsize == 0) - panic("BUG: Real mode buffer is too small"); + bio_size = min(BIO_BUFFER_SIZE, size); + while (bio_size > bd->bd_sectorsize) { + bbuf = bio_alloc(bio_size); + if (bbuf != NULL) + break; + bio_size -= bd->bd_sectorsize; + } + if (bbuf == NULL) { + bio_size = V86_IO_BUFFER_SIZE; + if (bio_size / bd->bd_sectorsize == 0) + panic("BUG: Real mode buffer is too small"); - bbuf = PTOV(V86_IO_BUFFER); + /* Use alternate 4k buffer */ + bbuf = PTOV(V86_IO_BUFFER); + } rest = size; - + rc = 0; while (blks > 0) { - int x = min(blks, V86_IO_BUFFER_SIZE / bd->bd_sectorsize); + int x = min(blks, bio_size / bd->bd_sectorsize); switch (rw & F_MASK) { case F_READ: @@ -953,8 +964,10 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (rest < bsize) bsize = rest; - if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) - return (EIO); + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_RD)) != 0) { + rc = EIO; + goto error; + } bcopy(bbuf + blkoff, buf, bsize); break; @@ -986,13 +999,16 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s * Put your Data In, and shake it all about */ bcopy(buf, bbuf + blkoff, bsize); - if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) - return (EIO); + if ((rc = bd_io(dev, bd, dblk, x, bbuf, BD_WR)) != 0) { + rc = EIO; + goto error; + } break; default: /* DO NOTHING */ - return (EROFS); + rc = EROFS; + goto error; } blkoff = 0; @@ -1004,7 +1020,10 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s if (rsize != NULL) *rsize = size; - return (0); +error: + if (bbuf != PTOV(V86_IO_BUFFER)) + bio_free(bbuf, bio_size); + return (rc); } static int Modified: head/stand/i386/libi386/libi386.h ============================================================================== --- head/stand/i386/libi386/libi386.h Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/libi386.h Sun Dec 30 09:35:47 2018 (r342619) @@ -121,6 +121,11 @@ extern vm_offset_t memtop_copyin; /* memtop less heap extern uint32_t high_heap_size; /* extended memory region available */ extern vm_offset_t high_heap_base; /* for use as the heap */ +/* 16KB buffer space for real mode data transfers. */ +#define BIO_BUFFER_SIZE 0x4000 +void *bio_alloc(size_t size); +void bio_free(void *ptr, size_t size); + /* * Values for width parameter to biospci_{read,write}_config */ Modified: head/stand/i386/libi386/pxe.c ============================================================================== --- head/stand/i386/libi386/pxe.c Sun Dec 30 09:13:38 2018 (r342618) +++ head/stand/i386/libi386/pxe.c Sun Dec 30 09:35:47 2018 (r342619) @@ -48,18 +48,10 @@ __FBSDID("$FreeBSD$"); #include #include +#include "libi386.h" #include "btxv86.h" #include "pxe.h" -/* - * Allocate the PXE buffers statically instead of sticking grimy fingers into - * BTX's private data area. The scratch buffer is used to send information to - * the PXE BIOS, and the data buffer is used to receive data from the PXE BIOS. - */ -#define PXE_BUFFER_SIZE 0x2000 -static char scratch_buffer[PXE_BUFFER_SIZE]; -static char data_buffer[PXE_BUFFER_SIZE]; - static pxenv_t *pxenv_p = NULL; /* PXENV+ */ static pxe_t *pxe_p = NULL; /* !PXE */ @@ -68,9 +60,9 @@ static int pxe_debug = 0; #endif void pxe_enable(void *pxeinfo); -static void (*pxe_call)(int func); -static void pxenv_call(int func); -static void bangpxe_call(int func); +static void (*pxe_call)(int func, void *ptr); +static void pxenv_call(int func, void *ptr); +static void bangpxe_call(int func, void *ptr); static int pxe_init(void); static int pxe_print(int verbose); @@ -225,12 +217,17 @@ pxe_init(void) printf("@%04x:%04x\n", pxenv_p->RMEntry.segment, pxenv_p->RMEntry.offset); - gci_p = (t_PXENV_GET_CACHED_INFO *) scratch_buffer; + gci_p = bio_alloc(sizeof(*gci_p)); + if (gci_p == NULL) { + pxe_p = NULL; + return (0); + } bzero(gci_p, sizeof(*gci_p)); gci_p->PacketType = PXENV_PACKET_TYPE_BINL_REPLY; - pxe_call(PXENV_GET_CACHED_INFO); + pxe_call(PXENV_GET_CACHED_INFO, gci_p); if (gci_p->Status != 0) { pxe_perror(gci_p->Status); + bio_free(gci_p, sizeof(*gci_p)); pxe_p = NULL; return (0); } @@ -240,6 +237,7 @@ pxe_init(void) bcopy(PTOV((gci_p->Buffer.segment << 4) + gci_p->Buffer.offset), bootp_response, bootp_response_size); } + bio_free(gci_p, sizeof(*gci_p)); return (1); } @@ -262,31 +260,37 @@ pxe_print(int verbose) static void pxe_cleanup(void) { -#ifdef PXE_DEBUG - t_PXENV_UNLOAD_STACK *unload_stack_p = - (t_PXENV_UNLOAD_STACK *)scratch_buffer; - t_PXENV_UNDI_SHUTDOWN *undi_shutdown_p = - (t_PXENV_UNDI_SHUTDOWN *)scratch_buffer; -#endif + t_PXENV_UNLOAD_STACK *unload_stack_p; + t_PXENV_UNDI_SHUTDOWN *undi_shutdown_p; if (pxe_call == NULL) return; - pxe_call(PXENV_UNDI_SHUTDOWN); + undi_shutdown_p = bio_alloc(sizeof(*undi_shutdown_p)); + if (undi_shutdown_p != NULL) { + bzero(undi_shutdown_p, sizeof(*undi_shutdown_p)); + pxe_call(PXENV_UNDI_SHUTDOWN, undi_shutdown_p); #ifdef PXE_DEBUG - if (pxe_debug && undi_shutdown_p->Status != 0) - printf("pxe_cleanup: UNDI_SHUTDOWN failed %x\n", - undi_shutdown_p->Status); + if (pxe_debug && undi_shutdown_p->Status != 0) + printf("pxe_cleanup: UNDI_SHUTDOWN failed %x\n", + undi_shutdown_p->Status); #endif + bio_free(undi_shutdown_p, sizeof(*undi_shutdown_p)); + } - pxe_call(PXENV_UNLOAD_STACK); + unload_stack_p = bio_alloc(sizeof(*unload_stack_p)); + if (unload_stack_p != NULL) { + bzero(unload_stack_p, sizeof(*unload_stack_p)); + pxe_call(PXENV_UNLOAD_STACK, unload_stack_p); #ifdef PXE_DEBUG - if (pxe_debug && unload_stack_p->Status != 0) - printf("pxe_cleanup: UNLOAD_STACK failed %x\n", - unload_stack_p->Status); + if (pxe_debug && unload_stack_p->Status != 0) + printf("pxe_cleanup: UNLOAD_STACK failed %x\n", + unload_stack_p->Status); #endif + bio_free(unload_stack_p, sizeof(*unload_stack_p)); + } } void @@ -296,7 +300,7 @@ pxe_perror(int err) } void -pxenv_call(int func) +pxenv_call(int func, void *ptr) { #ifdef PXE_DEBUG if (pxe_debug) @@ -304,14 +308,13 @@ pxenv_call(int func) #endif bzero(&v86, sizeof(v86)); - bzero(data_buffer, sizeof(data_buffer)); __pxenvseg = pxenv_p->RMEntry.segment; __pxenvoff = pxenv_p->RMEntry.offset; v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.es = VTOPSEG(scratch_buffer); - v86.edi = VTOPOFF(scratch_buffer); + v86.es = VTOPSEG(ptr); + v86.edi = VTOPOFF(ptr); v86.addr = (VTOPSEG(__pxenventry) << 16) | VTOPOFF(__pxenventry); v86.ebx = func; v86int(); @@ -319,7 +322,7 @@ pxenv_call(int func) } void -bangpxe_call(int func) +bangpxe_call(int func, void *ptr) { #ifdef PXE_DEBUG if (pxe_debug) @@ -327,14 +330,13 @@ bangpxe_call(int func) #endif bzero(&v86, sizeof(v86)); - bzero(data_buffer, sizeof(data_buffer)); __bangpxeseg = pxe_p->EntryPointSP.segment; __bangpxeoff = pxe_p->EntryPointSP.offset; v86.ctl = V86_ADDR | V86_CALLF | V86_FLAGS; - v86.edx = VTOPSEG(scratch_buffer); - v86.eax = VTOPOFF(scratch_buffer); + v86.edx = VTOPSEG(ptr); + v86.eax = VTOPOFF(ptr); v86.addr = (VTOPSEG(__bangpxeentry) << 16) | VTOPOFF(__bangpxeentry); v86.ebx = func; v86int(); @@ -362,11 +364,14 @@ pxe_netif_end(struct netif *nif) { t_PXENV_UNDI_CLOSE *undi_close_p; - undi_close_p = (t_PXENV_UNDI_CLOSE *)scratch_buffer; - bzero(undi_close_p, sizeof(*undi_close_p)); - pxe_call(PXENV_UNDI_CLOSE); - if (undi_close_p->Status != 0) - printf("undi close failed: %x\n", undi_close_p->Status); + undi_close_p = bio_alloc(sizeof(*undi_close_p)); + if (undi_close_p != NULL) { + bzero(undi_close_p, sizeof(*undi_close_p)); + pxe_call(PXENV_UNDI_CLOSE, undi_close_p); + if (undi_close_p->Status != 0) + printf("undi close failed: %x\n", undi_close_p->Status); + bio_free(undi_close_p, sizeof(*undi_close_p)); + } } static void @@ -377,11 +382,15 @@ pxe_netif_init(struct iodesc *desc, void *machdep_hint uint8_t *mac; int i, len; - undi_info_p = (t_PXENV_UNDI_GET_INFORMATION *)scratch_buffer; + undi_info_p = bio_alloc(sizeof(*undi_info_p)); + if (undi_info_p == NULL) + return; + bzero(undi_info_p, sizeof(*undi_info_p)); - pxe_call(PXENV_UNDI_GET_INFORMATION); + pxe_call(PXENV_UNDI_GET_INFORMATION, undi_info_p); if (undi_info_p->Status != 0) { printf("undi get info failed: %x\n", undi_info_p->Status); + bio_free(undi_info_p, sizeof(*undi_info_p)); return; } @@ -410,32 +419,44 @@ pxe_netif_init(struct iodesc *desc, void *machdep_hint else desc->xid = 0; - undi_open_p = (t_PXENV_UNDI_OPEN *)scratch_buffer; + bio_free(undi_info_p, sizeof(*undi_info_p)); + undi_open_p = bio_alloc(sizeof(*undi_open_p)); + if (undi_open_p == NULL) + return; bzero(undi_open_p, sizeof(*undi_open_p)); undi_open_p->PktFilter = FLTR_DIRECTED | FLTR_BRDCST; - pxe_call(PXENV_UNDI_OPEN); + pxe_call(PXENV_UNDI_OPEN, undi_open_p); if (undi_open_p->Status != 0) printf("undi open failed: %x\n", undi_open_p->Status); + bio_free(undi_open_p, sizeof(*undi_open_p)); } static int pxe_netif_receive(void **pkt) { - t_PXENV_UNDI_ISR *isr = (t_PXENV_UNDI_ISR *)scratch_buffer; + t_PXENV_UNDI_ISR *isr; char *buf, *ptr, *frame; size_t size, rsize; + isr = bio_alloc(sizeof(*isr)); + if (isr == NULL) + return (-1); + bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_START; - pxe_call(PXENV_UNDI_ISR); - if (isr->Status != 0) + pxe_call(PXENV_UNDI_ISR, isr); + if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); return (-1); + } bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_PROCESS; - pxe_call(PXENV_UNDI_ISR); - if (isr->Status != 0) + pxe_call(PXENV_UNDI_ISR, isr); + if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); return (-1); + } while (isr->FuncFlag == PXENV_UNDI_ISR_OUT_TRANSMIT) { /* @@ -443,26 +464,31 @@ pxe_netif_receive(void **pkt) */ bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); if (isr->Status != 0 || - isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) + isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) { + bio_free(isr, sizeof(*isr)); return (-1); + } } while (isr->FuncFlag != PXENV_UNDI_ISR_OUT_RECEIVE) { if (isr->Status != 0 || isr->FuncFlag == PXENV_UNDI_ISR_OUT_DONE) { + bio_free(isr, sizeof(*isr)); return (-1); } bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); } size = isr->FrameLength; buf = malloc(size + ETHER_ALIGN); - if (buf == NULL) + if (buf == NULL) { + bio_free(isr, sizeof(*isr)); return (-1); + } ptr = buf + ETHER_ALIGN; rsize = 0; @@ -475,8 +501,9 @@ pxe_netif_receive(void **pkt) bzero(isr, sizeof(*isr)); isr->FuncFlag = PXENV_UNDI_ISR_IN_GET_NEXT; - pxe_call(PXENV_UNDI_ISR); + pxe_call(PXENV_UNDI_ISR, isr); if (isr->Status != 0) { + bio_free(isr, sizeof(*isr)); free(buf); return (-1); } @@ -488,6 +515,7 @@ pxe_netif_receive(void **pkt) } *pkt = buf; + bio_free(isr, sizeof(*isr)); return (rsize); } @@ -515,26 +543,31 @@ pxe_netif_put(struct iodesc *desc, void *pkt, size_t l t_PXENV_UNDI_TRANSMIT *trans_p; t_PXENV_UNDI_TBD *tbd_p; char *data; + ssize_t rv = -1; - trans_p = (t_PXENV_UNDI_TRANSMIT *)scratch_buffer; - bzero(trans_p, sizeof(*trans_p)); - tbd_p = (t_PXENV_UNDI_TBD *)(scratch_buffer + sizeof(*trans_p)); - bzero(tbd_p, sizeof(*tbd_p)); + trans_p = bio_alloc(sizeof(*trans_p)); + tbd_p = bio_alloc(sizeof(*tbd_p)); + data = bio_alloc(len); - data = scratch_buffer + sizeof(*trans_p) + sizeof(*tbd_p); + if (trans_p != NULL && tbd_p != NULL && data != NULL) { + bzero(trans_p, sizeof(*trans_p)); + bzero(tbd_p, sizeof(*tbd_p)); - trans_p->TBD.segment = VTOPSEG(tbd_p); - trans_p->TBD.offset = VTOPOFF(tbd_p); + trans_p->TBD.segment = VTOPSEG(tbd_p); + trans_p->TBD.offset = VTOPOFF(tbd_p); - tbd_p->ImmedLength = len; - tbd_p->Xmit.segment = VTOPSEG(data); - tbd_p->Xmit.offset = VTOPOFF(data); - bcopy(pkt, data, len); + tbd_p->ImmedLength = len; + tbd_p->Xmit.segment = VTOPSEG(data); + tbd_p->Xmit.offset = VTOPOFF(data); + bcopy(pkt, data, len); - pxe_call(PXENV_UNDI_TRANSMIT); - if (trans_p->Status != 0) { - return (-1); + pxe_call(PXENV_UNDI_TRANSMIT, trans_p); + if (trans_p->Status == 0) + rv = len; } - return (len); + bio_free(data, len); + bio_free(tbd_p, sizeof(*tbd_p)); + bio_free(trans_p, sizeof(*trans_p)); + return (rv); } From owner-svn-src-head@freebsd.org Sun Dec 30 03:03:54 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 742531438A3E; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1572A6AD8C; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08FE21CD01; Sun, 30 Dec 2018 03:03:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU33rmA047397; Sun, 30 Dec 2018 03:03:53 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU33r23047396; Sun, 30 Dec 2018 03:03:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812300303.wBU33r23047396@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Sun, 30 Dec 2018 03:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342604 - head/sys/net80211 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/net80211 X-SVN-Commit-Revision: 342604 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1572A6AD8C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 03:03:54 -0000 Author: avos Date: Sun Dec 30 03:03:53 2018 New Revision: 342604 URL: https://svnweb.freebsd.org/changeset/base/342604 Log: net80211: fix duplicate sequence number bump for non-AMPDU QoS frames. This should be a part of r312972. MFC after: 4 days Modified: head/sys/net80211/ieee80211_output.c Modified: head/sys/net80211/ieee80211_output.c ============================================================================== --- head/sys/net80211/ieee80211_output.c Sun Dec 30 01:57:11 2018 (r342603) +++ head/sys/net80211/ieee80211_output.c Sun Dec 30 03:03:53 2018 (r342604) @@ -1698,7 +1698,6 @@ ieee80211_encap(struct ieee80211vap *vap, struct ieee8 * capability; this may also change when we pull * aggregation up into net80211 */ - seqno = ni->ni_txseqs[tid]++; *(uint16_t *)wh->i_seq = htole16(seqno << IEEE80211_SEQ_SEQ_SHIFT); M_SEQNO_SET(m, seqno); From owner-svn-src-head@freebsd.org Sun Dec 30 04:25:49 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C7A3143AA56; Sun, 30 Dec 2018 04:25:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FEBE6D0C4; Sun, 30 Dec 2018 04:25:49 +0000 (UTC) (envelope-from cy@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1DC5C1DBB5; Sun, 30 Dec 2018 04:25:49 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU4Pm36089025; Sun, 30 Dec 2018 04:25:48 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU4PmgB089024; Sun, 30 Dec 2018 04:25:48 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812300425.wBU4PmgB089024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sun, 30 Dec 2018 04:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342605 - head/contrib/ipfilter X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/ipfilter X-SVN-Commit-Revision: 342605 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2FEBE6D0C4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 04:25:49 -0000 Author: cy Date: Sun Dec 30 04:25:48 2018 New Revision: 342605 URL: https://svnweb.freebsd.org/changeset/base/342605 Log: TCP_PAWS_IDLE is does not exist in NetBSD and illumos. In FreeBSD TCP_PAWS_IDLE is defined in netinet/tcp_seq.h, however this header isn't included explicitly or implicitly at this point therefore as far ipfilter is concerned TCP_PAWS_IDLE is not defined. Remove the #ifdef and include netinet/tcp.h unconditionally. MFC after: 1 week Modified: head/contrib/ipfilter/ipf.h Modified: head/contrib/ipfilter/ipf.h ============================================================================== --- head/contrib/ipfilter/ipf.h Sun Dec 30 03:03:53 2018 (r342604) +++ head/contrib/ipfilter/ipf.h Sun Dec 30 04:25:48 2018 (r342605) @@ -47,9 +47,7 @@ struct file; #include #include #include -#ifndef TCP_PAWS_IDLE /* IRIX */ # include -#endif #include #include From owner-svn-src-head@freebsd.org Sun Dec 30 08:30:12 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B95C141BFA4; Sun, 30 Dec 2018 08:30:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D442C744EC; Sun, 30 Dec 2018 08:30:11 +0000 (UTC) (envelope-from delphij@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1D87204BB; Sun, 30 Dec 2018 08:30:11 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8UBVx016190; Sun, 30 Dec 2018 08:30:11 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8UB3r016189; Sun, 30 Dec 2018 08:30:11 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812300830.wBU8UB3r016189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Dec 2018 08:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342614 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 342614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D442C744EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.930,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 08:30:12 -0000 Author: delphij Date: Sun Dec 30 08:30:11 2018 New Revision: 342614 URL: https://svnweb.freebsd.org/changeset/base/342614 Log: Properly set svn:mimetype for zh_CN.UTF-8.src. MFC after: 2 weeks Modified: Directory Properties: head/share/timedef/zh_CN.UTF-8.src (props changed) From owner-svn-src-head@freebsd.org Sun Dec 30 15:55:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E22B142C0CB; Sun, 30 Dec 2018 15:55:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1BE88A57B; Sun, 30 Dec 2018 15:55:30 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DFBE525314; Sun, 30 Dec 2018 15:55:30 +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 wBUFtUtp054248; Sun, 30 Dec 2018 15:55:30 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFtUEo054247; Sun, 30 Dec 2018 15:55:30 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301555.wBUFtUEo054247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:55:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342629 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342629 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F1BE88A57B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:55:31 -0000 Author: kib Date: Sun Dec 30 15:55:30 2018 New Revision: 342629 URL: https://svnweb.freebsd.org/changeset/base/342629 Log: Bump __FreeBSD_version since r342628 changed size of struct linux_cdev on tier-1 i386 architecture. Requested by: hselasky MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Dec 30 15:46:45 2018 (r342628) +++ head/sys/sys/param.h Sun Dec 30 15:55:30 2018 (r342629) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300006 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300007 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Sun Dec 30 16:39:27 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6EC9142D477; Sun, 30 Dec 2018 16:39:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 354698BA93; Sun, 30 Dec 2018 16:39:27 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 219FD259C9; Sun, 30 Dec 2018 16:39:27 +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 wBUGdQnc075271; Sun, 30 Dec 2018 16:39:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUGdQkn075270; Sun, 30 Dec 2018 16:39:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301639.wBUGdQkn075270@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 16:39:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342631 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 342631 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 354698BA93 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 16:39:27 -0000 Author: kib Date: Sun Dec 30 16:39:26 2018 New Revision: 342631 URL: https://svnweb.freebsd.org/changeset/base/342631 Log: Fix 32bit gcc builds after r342625. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:58:18 2018 (r342630) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 16:39:26 2018 (r342631) @@ -540,7 +540,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_fault vmf; /* fill out VM fault structure */ - vmf.virtual_address = (void *)IDX_TO_OFF(pidx); + vmf.virtual_address = (void *)(uintptr_t)IDX_TO_OFF(pidx); vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; From owner-svn-src-head@freebsd.org Sun Dec 30 06:03:21 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51901143D5C3; Sun, 30 Dec 2018 06:03:21 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EB3967055A; Sun, 30 Dec 2018 06:03:20 +0000 (UTC) (envelope-from mckusick@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D10E51ED21; Sun, 30 Dec 2018 06:03:20 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU63KgR041554; Sun, 30 Dec 2018 06:03:20 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU63KFK041553; Sun, 30 Dec 2018 06:03:20 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201812300603.wBU63KFK041553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Sun, 30 Dec 2018 06:03:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342610 - head/sys/ufs/ufs X-SVN-Group: head X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: head/sys/ufs/ufs X-SVN-Commit-Revision: 342610 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB3967055A X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 06:03:21 -0000 Author: mckusick Date: Sun Dec 30 06:03:20 2018 New Revision: 342610 URL: https://svnweb.freebsd.org/changeset/base/342610 Log: Move ASSERT_VOP_LOCKED to top of ufs_vinit() as it should be true when the function is entered. Suggested by: kib Modified: head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Sun Dec 30 05:03:41 2018 (r342609) +++ head/sys/ufs/ufs/ufs_vnops.c Sun Dec 30 06:03:20 2018 (r342610) @@ -2515,6 +2515,7 @@ ufs_vinit(mntp, fifoops, vpp) struct vnode *vp; vp = *vpp; + ASSERT_VOP_LOCKED(vp, "ufs_vinit"); ip = VTOI(vp); vp->v_type = IFTOVT(ip->i_mode); /* @@ -2524,7 +2525,6 @@ ufs_vinit(mntp, fifoops, vpp) return (EINVAL); if (vp->v_type == VFIFO) vp->v_op = fifoops; - ASSERT_VOP_LOCKED(vp, "ufs_vinit"); if (ip->i_number == UFS_ROOTINO) vp->v_vflag |= VV_ROOT; *vpp = vp; From owner-svn-src-head@freebsd.org Sun Dec 30 08:22:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BFAF141BD0E; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B21D7429C; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D4CE204B2; Sun, 30 Dec 2018 08:22:37 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBU8MbHB015708; Sun, 30 Dec 2018 08:22:37 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBU8Magn015702; Sun, 30 Dec 2018 08:22:36 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812300822.wBU8Magn015702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Sun, 30 Dec 2018 08:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342613 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 342613 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4B21D7429C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.935,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 08:22:38 -0000 Author: philip Date: Sun Dec 30 08:22:35 2018 New Revision: 342613 URL: https://svnweb.freebsd.org/changeset/base/342613 Log: Import tzdata 2018h Changes: https://github.com/eggert/tz/blob/2018h/NEWS MFC after: 3 days Modified: head/contrib/tzdata/Makefile head/contrib/tzdata/NEWS head/contrib/tzdata/africa head/contrib/tzdata/asia head/contrib/tzdata/australasia head/contrib/tzdata/leapseconds head/contrib/tzdata/leapseconds.awk head/contrib/tzdata/northamerica head/contrib/tzdata/theory.html head/contrib/tzdata/version head/contrib/tzdata/ziguard.awk head/contrib/tzdata/zone.tab head/contrib/tzdata/zone1970.tab Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/Makefile ============================================================================== --- head/contrib/tzdata/Makefile Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/Makefile Sun Dec 30 08:22:35 2018 (r342613) @@ -380,15 +380,18 @@ AWK= awk # is typically nicer if it works. KSHELL= /bin/bash +# Name of curl , used for HTML validation. +CURL= curl + # The path where SGML DTDs are kept and the catalog file(s) to use when -# validating. The default should work on both Debian and Red Hat. +# validating HTML 4.01. The default should work on both Debian and Red Hat. SGML_TOPDIR= /usr SGML_DTDDIR= $(SGML_TOPDIR)/share/xml/w3c-sgml-lib/schema/dtd SGML_SEARCH_PATH= $(SGML_DTDDIR)/REC-html401-19991224 SGML_CATALOG_FILES= \ $(SGML_TOPDIR)/share/doc/w3-recs/html/www.w3.org/TR/1999/REC-html401-19991224/HTML4.cat:$(SGML_TOPDIR)/share/sgml/html/4.01/HTML4.cat -# The name, arguments and environment of a program to validate your web pages. +# The name, arguments and environment of a program to validate HTML 4.01. # See for a validator, and # for a validation library. # Set VALIDATE=':' if you do not have such a program. @@ -488,6 +491,7 @@ MANTXTS= newctime.3.txt newstrftime.3.txt newtzset.3.t COMMON= calendars CONTRIBUTING LICENSE Makefile \ NEWS README theory.html version WEB_PAGES= tz-art.html tz-how-to.html tz-link.html +CHECK_WEB_PAGES=check_tz-art.html check_tz-how-to.html check_tz-link.html DOCS= $(MANS) date.1 $(MANTXTS) $(WEB_PAGES) PRIMARY_YDATA= africa antarctica asia australasia \ europe northamerica southamerica @@ -799,9 +803,15 @@ check_tzs: $(TZS) $(TZS_NEW) fi touch $@ -# This checks only the HTML 4.01 strict page. -# To check the the other pages, use . -check_web: tz-how-to.html +check_web: $(CHECK_WEB_PAGES) +check_tz-art.html: tz-art.html +check_tz-link.html: tz-link.html +check_tz-art.html check_tz-link.html: + $(CURL) -sS --url https://validator.w3.org/nu/ -F out=gnu \ + -F file=@$$(expr $@ : 'check_\(.*\)') -o $@.out && \ + test ! -s $@.out || { cat $@.out; exit 1; } + mv $@.out $@ +check_tz-how-to.html: tz-how-to.html $(VALIDATE_ENV) $(VALIDATE) $(VALIDATE_FLAGS) tz-how-to.html touch $@ @@ -1068,7 +1078,7 @@ zic.o: private.h tzfile.h version.h .PHONY: ALL INSTALL all .PHONY: check check_time_t_alternatives -.PHONY: check_zishrink +.PHONY: check_web check_zishrink .PHONY: clean clean_misc dummy.zd force_tzs .PHONY: install install_data maintainer-clean names .PHONY: posix_only posix_packrat posix_right public Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/NEWS Sun Dec 30 08:22:35 2018 (r342613) @@ -1,14 +1,91 @@ News for the tz database +Release 2018h - 2018-12-23 17:59:32 -0800 + + Briefly: + Qyzylorda, Kazakhstan moved from +06 to +05 on 2018-12-21. + New zone Asia/Qostanay because Qostanay, Kazakhstan didn't move. + Metlakatla, Alaska observes PST this winter only. + Guess Morocco will continue to adjust clocks around Ramadan. + Add predictions for Iran from 2038 through 2090. + + Changes to future timestamps + + Guess that Morocco will continue to fall back just before and + spring forward just after Ramadan, the practice since 2012. + (Thanks to Maamar Abdelkader.) This means Morocco will observe + negative DST during Ramadan in main and vanguard formats, and in + rearguard format it stays in the +00 timezone and observes + ordinary DST in all months other than Ramadan. As before, extend + this guesswork to the year 2037. As a consequence, Morocco is + scheduled to observe three DST transitions in some Gregorian years + (e.g., 2033) due to the mismatch between the Gregorian and Islamic + calendars. + + The table of exact transitions for Iranian DST has been extended. + It formerly cut off before the year 2038 in a nod to 32-bit time_t. + It now cuts off before 2091 as there is doubt about how the Persian + calendar will treat 2091. This change predicts DST transitions in + 2038-9, 2042-3, and 2046-7 to occur one day later than previously + predicted. As before, post-cutoff transitions are approximated. + + Changes to past and future timestamps + + Qyzylorda (aka Kyzylorda) oblast in Kazakhstan moved from +06 to + +05 on 2018-12-21. This is a zone split as Qostanay (aka + Kostanay) did not switch, so create a zone Asia/Qostanay. + + Metlakatla moved from Alaska to Pacific standard time on 2018-11-04. + It did not change clocks that day and remains on -08 this winter. + (Thanks to Ryan Stanley.) It will revert to the usual Alaska + rules next spring, so this change affects only timestamps + from 2018-11-04 through 2019-03-10. + + Change to past timestamps + + Kwajalein's 1993-08-20 transition from -12 to +12 was at 24:00, + not 00:00. I transcribed the time incorrectly from Shanks. + (Thanks to Phake Nick.) + + Nauru's 1979 transition was on 02-10 at 02:00, not 05-01 at 00:00. + (Thanks to Phake Nick.) + + Guam observed DST irregularly from 1959 through 1977. + (Thanks to Phake Nick.) + + Hong Kong observed DST in 1941 starting 06-15 (not 04-01), then on + 10-01 changed standard time to +08:30 (not +08). Its transition + back to +08 after WWII was on 1945-09-15, not the previous day. + Its 1904-10-30 change took effect at 01:00 +08 (not 00:00 LMT). + (Thanks to Phake Nick, Steve Allen, and Joseph Myers.) Also, + its 1952 fallback was on 11-02 (not 10-25). + + This release contains many changes to timestamps before 1946 due + to Japanese possession or occupation of Pacific/Chuuk, + Pacific/Guam, Pacific/Kosrae, Pacific/Kwajalein, Pacific/Majuro, + Pacific/Nauru, Pacific/Palau, and Pacific/Pohnpei. + (Thanks to Phake Nick.) + + Assume that the Spanish East Indies was like the Philippines and + observed American time until the end of 1844. This affects + Pacific/Chuuk, Pacific/Kosrae, Pacific/Palau, and Pacific/Pohnpei. + + Changes to past tm_isdst flags + + For the recent Morocco change, the tm_isdst flag should be 1 from + 2018-10-27 00:00 to 2018-10-28 03:00. (Thanks to Michael Deckers.) + Give a URL to the official decree. (Thanks to Matt Johnson.) + + Release 2018g - 2018-10-26 22:22:45 -0700 Briefly: - Morocco switches to permanent +01 on 2018-10-27. + Morocco switches to permanent +01 on 2018-10-28. Changes to future timestamps - Morocco switches from +00/+01 to permanent +01 effective 2018-10-27, - so its clocks will not fall back on 2018-10-28 as previously scheduled. + Morocco switches from +00/+01 to permanent +01 effective 2018-10-28, + so its clocks will not fall back as previously scheduled. (Thanks to Mohamed Essedik Najd and Brian Inglis.) Changes to code @@ -119,7 +196,7 @@ Release 2018f - 2018-10-18 00:14:18 -0700 localtime.c no longer ignores TZif POSIX-style TZ strings that specify only standard time. Instead, these TZ strings now override the default time type for timestamps after the last - transition (or for all time stamps if there are no transitions), + transition (or for all timestamps if there are no transitions), just as DST strings specifying DST have always done. leapseconds.awk now outputs "#updated" and "#expires" comments, Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/africa Sun Dec 30 08:22:35 2018 (r342613) @@ -847,8 +847,41 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # From Mohamed Essedik Najd (2018-10-26): # Today, a Moroccan government council approved the perpetual addition # of 60 minutes to the regular Moroccan timezone. -# From Brian Inglis (2018-10-26): -# http://www.maroc.ma/fr/actualites/le-conseil-de-gouvernement-adopte-un-projet-de-decret-relatif-lheure-legale-stipulant-le +# From Matt Johnson (2018-10-28): +# http://www.sgg.gov.ma/Portals/1/BO/2018/BO_6720-bis_Ar.pdf +# +# From Maamar Abdelkader (2018-11-01): +# We usually move clocks back the previous week end and come back to the +1 +# the week end after.... The government does not announce yet the decision +# about this temporary change. But it s 99% sure that it will be the case, +# as in previous years. An unofficial survey was done these days, showing +# that 64% of asked peopke are ok for moving from +1 to +0 during Ramadan. +# https://leconomiste.com/article/1035870-enquete-l-economiste-sunergia-64-des-marocains-plebiscitent-le-gmt-pendant-ramadan +# +# From Paul Eggert (2018-11-01): +# For now, guess that Morocco will fall back at 03:00 the last Sunday +# before Ramadan, and spring forward at 02:00 the first Sunday after +# Ramadan, as this has been the practice since 2012. To implement this, +# transition dates for 2019 through 2037 were determined by running the +# following program under GNU Emacs 26.1. +# (let ((islamic-year 1440)) +# (require 'cal-islam) +# (while (< islamic-year 1460) +# (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) +# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (sunday 0)) +# (while (/= sunday (mod (setq a (1- a)) 7))) +# (while (/= sunday (mod b 7)) +# (setq b (1+ b))) +# (setq a (calendar-gregorian-from-absolute a)) +# (setq b (calendar-gregorian-from-absolute b)) +# (insert +# (format +# (concat "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 3:00\t-1:00\t-\n" +# "Rule\tMorocco\t%d\tonly\t-\t%s\t%2d\t 2:00\t0\t-\n") +# (car (cdr (cdr a))) (calendar-month-name (car a) t) (car (cdr a)) +# (car (cdr (cdr b))) (calendar-month-name (car b) t) (car (cdr b))))) +# (setq islamic-year (+ 1 islamic-year)))) # RULE NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Morocco 1939 only - Sep 12 0:00 1:00 - @@ -892,13 +925,53 @@ Rule Morocco 2017 only - May 21 3:00 0 - Rule Morocco 2017 only - Jul 2 2:00 1:00 - Rule Morocco 2018 only - May 13 3:00 0 - Rule Morocco 2018 only - Jun 17 2:00 1:00 - +Rule Morocco 2019 only - May 5 3:00 -1:00 - +Rule Morocco 2019 only - Jun 9 2:00 0 - +Rule Morocco 2020 only - Apr 19 3:00 -1:00 - +Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2021 only - Apr 11 3:00 -1:00 - +Rule Morocco 2021 only - May 16 2:00 0 - +Rule Morocco 2022 only - Mar 27 3:00 -1:00 - +Rule Morocco 2022 only - May 8 2:00 0 - +Rule Morocco 2023 only - Mar 19 3:00 -1:00 - +Rule Morocco 2023 only - Apr 23 2:00 0 - +Rule Morocco 2024 only - Mar 10 3:00 -1:00 - +Rule Morocco 2024 only - Apr 14 2:00 0 - +Rule Morocco 2025 only - Feb 23 3:00 -1:00 - +Rule Morocco 2025 only - Apr 6 2:00 0 - +Rule Morocco 2026 only - Feb 15 3:00 -1:00 - +Rule Morocco 2026 only - Mar 22 2:00 0 - +Rule Morocco 2027 only - Feb 7 3:00 -1:00 - +Rule Morocco 2027 only - Mar 14 2:00 0 - +Rule Morocco 2028 only - Jan 23 3:00 -1:00 - +Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2029 only - Jan 14 3:00 -1:00 - +Rule Morocco 2029 only - Feb 18 2:00 0 - +Rule Morocco 2029 only - Dec 30 3:00 -1:00 - +Rule Morocco 2030 only - Feb 10 2:00 0 - +Rule Morocco 2030 only - Dec 22 3:00 -1:00 - +Rule Morocco 2031 only - Jan 26 2:00 0 - +Rule Morocco 2031 only - Dec 14 3:00 -1:00 - +Rule Morocco 2032 only - Jan 18 2:00 0 - +Rule Morocco 2032 only - Nov 28 3:00 -1:00 - +Rule Morocco 2033 only - Jan 9 2:00 0 - +Rule Morocco 2033 only - Nov 20 3:00 -1:00 - +Rule Morocco 2033 only - Dec 25 2:00 0 - +Rule Morocco 2034 only - Nov 5 3:00 -1:00 - +Rule Morocco 2034 only - Dec 17 2:00 0 - +Rule Morocco 2035 only - Oct 28 3:00 -1:00 - +Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2036 only - Oct 19 3:00 -1:00 - +Rule Morocco 2036 only - Nov 23 2:00 0 - +Rule Morocco 2037 only - Oct 4 3:00 -1:00 - +Rule Morocco 2037 only - Nov 15 2:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 0:00 Morocco +00/+01 1984 Mar 16 1:00 - +01 1986 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Western Sahara # @@ -913,8 +986,8 @@ Zone Africa/Casablanca -0:30:20 - LMT 1913 Oct 26 Zone Africa/El_Aaiun -0:52:48 - LMT 1934 Jan # El Aaiún -1:00 - -01 1976 Apr 14 - 0:00 Morocco +00/+01 2018 Oct 27 - 1:00 - +01 + 0:00 Morocco +00/+01 2018 Oct 28 3:00 + 1:00 Morocco +01/+00 # Mozambique # Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/asia Sun Dec 30 08:22:35 2018 (r342613) @@ -586,12 +586,82 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # obtained from # http://www.hko.gov.hk/gts/time/Summertime.htm -# From Arthur David Olson (2009-10-28): +# From Phake Nick (2018-10-27): +# According to Singaporean newspaper +# http://eresources.nlb.gov.sg/newspapers/Digitised/Article/singfreepresswk19041102-1.2.37 +# the day that Hong Kong start using GMT+8 should be Oct 30, 1904. +# +# From Paul Eggert (2018-11-17): +# Hong Kong had a time ball near the Marine Police Station, Tsim Sha Tsui. +# "The ball was raised manually each day and dropped at exactly 1pm +# (except on Sundays and Government holidays)." +# Dyson AD. From Time Ball to Atomic Clock. Hong Kong Government. 1983. +# +# "From 1904 October 30 the time-ball at Hong Kong has been dropped by order +# of the Governor of the Colony at 17h 0m 0s G.M.T., which is 23m 18s.14 in +# advance of 1h 0m 0s of Hong Kong mean time." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 +# +# From Joseph Myers (2018-11-18): +# An astronomer before 1925 referring to GMT would have been using the old +# astronomical convention where the day started at noon, not midnight. +# +# From Steve Allen (2018-11-17): +# Meteorological Observations made at the Hongkong Observatory in the year 1904 +# page 4 +# ... the log of drop times in Table II shows that on Sunday 1904-10-30 the +# ball was dropped. So that looks like a special case drop for the sake +# of broadcasting the new local time. +# +# From Phake Nick (2018-11-18): +# According to The Hong Kong Weekly Press, 1904-10-29, p.324, the +# governor of Hong Kong at the time stated that "We are further desired to +# make it known that the change will be effected by firing the gun and by the +# dropping of the Ball at 23min. 18sec. before one." +# From Paul Eggert (2018-11-18): +# See for this; unfortunately Flash is required. + +# From Phake Nick (2018-10-26): +# I went to check microfilm records stored at Hong Kong Public Library.... +# on September 30 1941, according to Ta Kung Pao (Hong Kong edition), it was +# stated that fallback would occur on the next day (the 1st)'s "03:00 am (Hong +# Kong Time 04:00 am)" and the clock will fall back for a half hour. (03:00 +# probably refer to the time commonly used in mainland China at the time given +# the paper's background) ... the sunrise/sunset time given by South China +# Morning Post for October 1st was indeed moved by half an hour compares to +# before. After that, in December, the battle to capture Hong Kong started and +# the library doesn't seems to have any record stored about press during that +# period of time. Some media resumed publication soon after that within the +# same month, but there were not much information about time there. Later they +# started including a radio program guide when they restored radio service, +# explicitly mentioning it use Tokyo standard time, and later added a note +# saying it's half an hour ahead of the old Hong Kong standard time, and it +# also seems to indicate that Hong Kong was not using GMT+8 when it was +# captured by Japan. +# +# Image of related sections on newspaper: +# * 1941-09-30, Ta Kung Pao (Hong Kong), "Winter Time start tomorrow". +# https://i.imgur.com/6waY51Z.jpg (Chinese) +# * 1941-09-29, South China Morning Post, Information on sunrise/sunset +# time and other things for September 30 and October 1. +# https://i.imgur.com/kCiUR78.jpg +# * 1942-02-05. The Hong Kong News, Radio Program Guide. +# https://i.imgur.com/eVvDMzS.jpg +# * 1941-06-14. Hong Kong Daily Press, Daylight Saving from 3am Tomorrow. +# https://i.imgur.com/05KkvtC.png +# * 1941-09-30, Hong Kong Daily Press, Winter Time Warning. +# https://i.imgur.com/dge4kFJ.png +# Also, the Liberation day of Hong Kong after WWII which British rule +# over the territory resumed was August 30, 1945, which I think should +# be the termination date for the use of JST in the territory.... + +# From Paul Eggert (2018-11-17): # Here are the dates given at -# http://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2009-10-28: +# https://www.hko.gov.hk/gts/time/Summertime.htm +# as of 2014-06-19: # Year Period -# 1941 1 Apr to 30 Sep +# 1941 15 Jun to 30 Sep # 1942 Whole year # 1943 Whole year # 1944 Whole year @@ -602,7 +672,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1949 3 Apr to 30 Oct # 1950 2 Apr to 29 Oct # 1951 1 Apr to 28 Oct -# 1952 6 Apr to 25 Oct +# 1952 6 Apr to 2 Nov # 1953 5 Apr to 1 Nov # 1954 21 Mar to 31 Oct # 1955 20 Mar to 6 Nov @@ -631,25 +701,25 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # 1978 Nil # 1979 13 May to 21 Oct # 1980 to Now Nil -# The page does not give start or end times of day. -# The page does not give a start date for 1942. -# The page does not givw an end date for 1945. -# The Japanese occupation of Hong Kong began on 1941-12-25. -# The Japanese surrender of Hong Kong was signed 1945-09-15. -# For lack of anything better, use start of those days as the transition times. +# The page does not give times of day for transitions, +# or dates for the 1942 and 1945 transitions. +# The Japanese occupation of Hong Kong began 1941-12-25. +# The Japanese surrender of Hong Kong was signed 1945-09-16; see: +# Heaver S. The days after the Pacific war ended: unsettling times +# in Hong Kong. Post Magazine. 2016-06-13. +# https://www.scmp.com/magazines/post-magazine/article/1852990/days-after-pacific-war-ended-unsettling-times-hong-kong +# For lack of anything better, use start of those days as the +# transition times. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule HK 1941 only - Apr 1 3:30 1:00 S -Rule HK 1941 only - Sep 30 3:30 0 - Rule HK 1946 only - Apr 20 3:30 1:00 S Rule HK 1946 only - Dec 1 3:30 0 - Rule HK 1947 only - Apr 13 3:30 1:00 S Rule HK 1947 only - Dec 30 3:30 0 - Rule HK 1948 only - May 2 3:30 1:00 S Rule HK 1948 1951 - Oct lastSun 3:30 0 - -Rule HK 1952 only - Oct 25 3:30 0 - +Rule HK 1952 1953 - Nov Sun>=1 3:30 0 - Rule HK 1949 1953 - Apr Sun>=1 3:30 1:00 S -Rule HK 1953 only - Nov 1 3:30 0 - Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S Rule HK 1954 only - Oct 31 3:30 0 - Rule HK 1955 1964 - Nov Sun>=1 3:30 0 - @@ -659,9 +729,11 @@ Rule HK 1973 only - Dec 30 3:30 1:00 S Rule HK 1979 only - May Sun>=8 3:30 1:00 S Rule HK 1979 only - Oct Sun>=16 3:30 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 - 8:00 HK HK%sT 1941 Dec 25 - 9:00 - JST 1945 Sep 15 +Zone Asia/Hong_Kong 7:36:42 - LMT 1904 Oct 30 0:36:42 + 8:00 - HKT 1941 Jun 15 3:30 + 8:00 1:00 HKST 1941 Oct 1 4:00 + 8:30 - HKT 1941 Dec 25 + 9:00 - JST 1945 Sep 16 8:00 HK HK%sT ############################################################################### @@ -1057,6 +1129,16 @@ Zone Asia/Dili 8:22:20 - LMT 1912 Jan 1 # India +# British astronomer Henry Park Hollis disliked India Standard Time's offset: +# "A new time system has been proposed for India, Further India, and Burmah. +# The scheme suggested is that the times of the meridians 5½ and 6½ hours +# east of Greenwich should be adopted in these territories. No reason is +# given why hourly meridians five hours and six hours east should not be +# chosen; a plan which would bring the time of India into harmony with +# that of almost the whole of the civilised world." +# Hollis HP. Universal Time, Longitudes, and Geodesy. Mon Not R Astron Soc. +# 1905-02-10;65(4):405-6. https://doi.org/10.1093/mnras/65.4.382 + # From Ian P. Beacock, in "A brief history of (modern) time", The Atlantic # https://www.theatlantic.com/technology/archive/2015/12/the-creation-of-modern-time/421419/ # (2015-12-22): @@ -1227,12 +1309,65 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # leap year calculation involved. There has never been any serious # plan to change that law.... # -# From Paul Eggert (2006-03-22): +# From Paul Eggert (2018-11-30): # Go with Shanks & Pottenger before Sept. 1991, and with Pournader thereafter. -# I used Ed Reingold's cal-persia in GNU Emacs 21.2 to check Persian dates, -# stopping after 2037 when 32-bit time_t's overflow. -# That cal-persia used Birashk's approximation, which disagrees with the solar -# calendar predictions for the year 2025, so I corrected those dates by hand. +# I used the following code in GNU Emacs 26.1 to generate the "Rule Iran" +# lines from 2008 through 2087. Emacs 26.1 uses Ed Reingold's +# cal-persia implementation of Birashk's approximation, which in the +# 2008-2087 range disagrees with the the astronomical Persian calendar +# for Persian years 1404 (Gregorian 2025) and 1437 (Gregorian 2058), +# so the following code special-case those years. See Table 15.1, page 264, of: +# Edward M. Reingold and Nachum Dershowitz, Calendrical Calculations: +# The Ultimate Edition, Cambridge University Press (2018). +# https://www.cambridge.org/fr/academic/subjects/computer-science/computing-general-interest/calendrical-calculations-ultimate-edition-4th-edition +# Page 258, footnote 2, of this book says there is some dispute over what will +# happen in 2091 (and some other years after that), so this code +# stops in 2087, as 2088 and 2089 agree with the "max" rule below. +# (cl-loop +# initially (require 'cal-persia) +# with first-persian-year = 1387 +# with last-persian-year = 1466 +# ;; Exceptional years in the above range, +# ;; from Reingold & Dershowitz Table 15.1, page 264: +# with exceptional-persian-years = '(1404 1437) +# with range-start = nil +# for persian-year from first-persian-year to last-persian-year +# do +# (let* +# ((exceptional-year-offset +# (if (member persian-year exceptional-persian-years) 1 0)) +# (beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 persian-year)) +# exceptional-year-offset)) +# (end-dst-absolute +# (+ (calendar-persian-to-absolute (list 6 30 persian-year)) +# exceptional-year-offset)) +# (next-year-beg-dst-absolute +# (+ (calendar-persian-to-absolute (list 1 1 (1+ persian-year))) +# (if (member (1+ persian-year) exceptional-persian-years) 1 0))) +# (beg-dst (calendar-gregorian-from-absolute beg-dst-absolute)) +# (end-dst (calendar-gregorian-from-absolute end-dst-absolute)) +# (next-year-beg-dst (calendar-gregorian-from-absolute +# next-year-beg-dst-absolute)) +# (year (calendar-extract-year beg-dst)) +# (range-end (if range-start year "only"))) +# (setq range-start (or range-start year)) +# (when (or (/= (calendar-extract-day beg-dst) +# (calendar-extract-day next-year-beg-dst)) +# (= persian-year last-persian-year)) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t1:00\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month beg-dst) t) +# (calendar-extract-day beg-dst))) +# (insert +# (format +# "Rule\tIran\t%d\t%s\t-\t%s\t%2d\t24:00\t0\t-\n" +# range-start range-end +# (calendar-month-name (calendar-extract-month end-dst) t) +# (calendar-extract-day end-dst))) +# (setq range-start nil)))) # # From Oscar van Vlijmen (2005-03-30), writing about future # discrepancies between cal-persia and the Iranian calendar: @@ -1267,61 +1402,113 @@ Zone Asia/Jayapura 9:22:48 - LMT 1932 Nov # thirtieth day of Shahrivar. # # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule Iran 1978 1980 - Mar 21 0:00 1:00 - -Rule Iran 1978 only - Oct 21 0:00 0 - -Rule Iran 1979 only - Sep 19 0:00 0 - -Rule Iran 1980 only - Sep 23 0:00 0 - -Rule Iran 1991 only - May 3 0:00 1:00 - -Rule Iran 1992 1995 - Mar 22 0:00 1:00 - -Rule Iran 1991 1995 - Sep 22 0:00 0 - -Rule Iran 1996 only - Mar 21 0:00 1:00 - -Rule Iran 1996 only - Sep 21 0:00 0 - -Rule Iran 1997 1999 - Mar 22 0:00 1:00 - -Rule Iran 1997 1999 - Sep 22 0:00 0 - -Rule Iran 2000 only - Mar 21 0:00 1:00 - -Rule Iran 2000 only - Sep 21 0:00 0 - -Rule Iran 2001 2003 - Mar 22 0:00 1:00 - -Rule Iran 2001 2003 - Sep 22 0:00 0 - -Rule Iran 2004 only - Mar 21 0:00 1:00 - -Rule Iran 2004 only - Sep 21 0:00 0 - -Rule Iran 2005 only - Mar 22 0:00 1:00 - -Rule Iran 2005 only - Sep 22 0:00 0 - -Rule Iran 2008 only - Mar 21 0:00 1:00 - -Rule Iran 2008 only - Sep 21 0:00 0 - -Rule Iran 2009 2011 - Mar 22 0:00 1:00 - -Rule Iran 2009 2011 - Sep 22 0:00 0 - -Rule Iran 2012 only - Mar 21 0:00 1:00 - -Rule Iran 2012 only - Sep 21 0:00 0 - -Rule Iran 2013 2015 - Mar 22 0:00 1:00 - -Rule Iran 2013 2015 - Sep 22 0:00 0 - -Rule Iran 2016 only - Mar 21 0:00 1:00 - -Rule Iran 2016 only - Sep 21 0:00 0 - -Rule Iran 2017 2019 - Mar 22 0:00 1:00 - -Rule Iran 2017 2019 - Sep 22 0:00 0 - -Rule Iran 2020 only - Mar 21 0:00 1:00 - -Rule Iran 2020 only - Sep 21 0:00 0 - -Rule Iran 2021 2023 - Mar 22 0:00 1:00 - -Rule Iran 2021 2023 - Sep 22 0:00 0 - -Rule Iran 2024 only - Mar 21 0:00 1:00 - -Rule Iran 2024 only - Sep 21 0:00 0 - -Rule Iran 2025 2027 - Mar 22 0:00 1:00 - -Rule Iran 2025 2027 - Sep 22 0:00 0 - -Rule Iran 2028 2029 - Mar 21 0:00 1:00 - -Rule Iran 2028 2029 - Sep 21 0:00 0 - -Rule Iran 2030 2031 - Mar 22 0:00 1:00 - -Rule Iran 2030 2031 - Sep 22 0:00 0 - -Rule Iran 2032 2033 - Mar 21 0:00 1:00 - -Rule Iran 2032 2033 - Sep 21 0:00 0 - -Rule Iran 2034 2035 - Mar 22 0:00 1:00 - -Rule Iran 2034 2035 - Sep 22 0:00 0 - +Rule Iran 1978 1980 - Mar 20 24:00 1:00 - +Rule Iran 1978 only - Oct 20 24:00 0 - +Rule Iran 1979 only - Sep 18 24:00 0 - +Rule Iran 1980 only - Sep 22 24:00 0 - +Rule Iran 1991 only - May 2 24:00 1:00 - +Rule Iran 1992 1995 - Mar 21 24:00 1:00 - +Rule Iran 1991 1995 - Sep 21 24:00 0 - +Rule Iran 1996 only - Mar 20 24:00 1:00 - +Rule Iran 1996 only - Sep 20 24:00 0 - +Rule Iran 1997 1999 - Mar 21 24:00 1:00 - +Rule Iran 1997 1999 - Sep 21 24:00 0 - +Rule Iran 2000 only - Mar 20 24:00 1:00 - +Rule Iran 2000 only - Sep 20 24:00 0 - +Rule Iran 2001 2003 - Mar 21 24:00 1:00 - +Rule Iran 2001 2003 - Sep 21 24:00 0 - +Rule Iran 2004 only - Mar 20 24:00 1:00 - +Rule Iran 2004 only - Sep 20 24:00 0 - +Rule Iran 2005 only - Mar 21 24:00 1:00 - +Rule Iran 2005 only - Sep 21 24:00 0 - +Rule Iran 2008 only - Mar 20 24:00 1:00 - +Rule Iran 2008 only - Sep 20 24:00 0 - +Rule Iran 2009 2011 - Mar 21 24:00 1:00 - +Rule Iran 2009 2011 - Sep 21 24:00 0 - +Rule Iran 2012 only - Mar 20 24:00 1:00 - +Rule Iran 2012 only - Sep 20 24:00 0 - +Rule Iran 2013 2015 - Mar 21 24:00 1:00 - +Rule Iran 2013 2015 - Sep 21 24:00 0 - +Rule Iran 2016 only - Mar 20 24:00 1:00 - +Rule Iran 2016 only - Sep 20 24:00 0 - +Rule Iran 2017 2019 - Mar 21 24:00 1:00 - +Rule Iran 2017 2019 - Sep 21 24:00 0 - +Rule Iran 2020 only - Mar 20 24:00 1:00 - +Rule Iran 2020 only - Sep 20 24:00 0 - +Rule Iran 2021 2023 - Mar 21 24:00 1:00 - +Rule Iran 2021 2023 - Sep 21 24:00 0 - +Rule Iran 2024 only - Mar 20 24:00 1:00 - +Rule Iran 2024 only - Sep 20 24:00 0 - +Rule Iran 2025 2027 - Mar 21 24:00 1:00 - +Rule Iran 2025 2027 - Sep 21 24:00 0 - +Rule Iran 2028 2029 - Mar 20 24:00 1:00 - +Rule Iran 2028 2029 - Sep 20 24:00 0 - +Rule Iran 2030 2031 - Mar 21 24:00 1:00 - +Rule Iran 2030 2031 - Sep 21 24:00 0 - +Rule Iran 2032 2033 - Mar 20 24:00 1:00 - +Rule Iran 2032 2033 - Sep 20 24:00 0 - +Rule Iran 2034 2035 - Mar 21 24:00 1:00 - +Rule Iran 2034 2035 - Sep 21 24:00 0 - +Rule Iran 2036 2037 - Mar 20 24:00 1:00 - +Rule Iran 2036 2037 - Sep 20 24:00 0 - +Rule Iran 2038 2039 - Mar 21 24:00 1:00 - +Rule Iran 2038 2039 - Sep 21 24:00 0 - +Rule Iran 2040 2041 - Mar 20 24:00 1:00 - +Rule Iran 2040 2041 - Sep 20 24:00 0 - +Rule Iran 2042 2043 - Mar 21 24:00 1:00 - +Rule Iran 2042 2043 - Sep 21 24:00 0 - +Rule Iran 2044 2045 - Mar 20 24:00 1:00 - +Rule Iran 2044 2045 - Sep 20 24:00 0 - +Rule Iran 2046 2047 - Mar 21 24:00 1:00 - +Rule Iran 2046 2047 - Sep 21 24:00 0 - +Rule Iran 2048 2049 - Mar 20 24:00 1:00 - +Rule Iran 2048 2049 - Sep 20 24:00 0 - +Rule Iran 2050 2051 - Mar 21 24:00 1:00 - +Rule Iran 2050 2051 - Sep 21 24:00 0 - +Rule Iran 2052 2053 - Mar 20 24:00 1:00 - +Rule Iran 2052 2053 - Sep 20 24:00 0 - +Rule Iran 2054 2055 - Mar 21 24:00 1:00 - +Rule Iran 2054 2055 - Sep 21 24:00 0 - +Rule Iran 2056 2057 - Mar 20 24:00 1:00 - +Rule Iran 2056 2057 - Sep 20 24:00 0 - +Rule Iran 2058 2059 - Mar 21 24:00 1:00 - +Rule Iran 2058 2059 - Sep 21 24:00 0 - +Rule Iran 2060 2062 - Mar 20 24:00 1:00 - +Rule Iran 2060 2062 - Sep 20 24:00 0 - +Rule Iran 2063 only - Mar 21 24:00 1:00 - +Rule Iran 2063 only - Sep 21 24:00 0 - +Rule Iran 2064 2066 - Mar 20 24:00 1:00 - +Rule Iran 2064 2066 - Sep 20 24:00 0 - +Rule Iran 2067 only - Mar 21 24:00 1:00 - +Rule Iran 2067 only - Sep 21 24:00 0 - +Rule Iran 2068 2070 - Mar 20 24:00 1:00 - +Rule Iran 2068 2070 - Sep 20 24:00 0 - +Rule Iran 2071 only - Mar 21 24:00 1:00 - +Rule Iran 2071 only - Sep 21 24:00 0 - +Rule Iran 2072 2074 - Mar 20 24:00 1:00 - +Rule Iran 2072 2074 - Sep 20 24:00 0 - +Rule Iran 2075 only - Mar 21 24:00 1:00 - +Rule Iran 2075 only - Sep 21 24:00 0 - +Rule Iran 2076 2078 - Mar 20 24:00 1:00 - +Rule Iran 2076 2078 - Sep 20 24:00 0 - +Rule Iran 2079 only - Mar 21 24:00 1:00 - +Rule Iran 2079 only - Sep 21 24:00 0 - +Rule Iran 2080 2082 - Mar 20 24:00 1:00 - +Rule Iran 2080 2082 - Sep 20 24:00 0 - +Rule Iran 2083 only - Mar 21 24:00 1:00 - +Rule Iran 2083 only - Sep 21 24:00 0 - +Rule Iran 2084 2086 - Mar 20 24:00 1:00 - +Rule Iran 2084 2086 - Sep 20 24:00 0 - +Rule Iran 2087 only - Mar 21 24:00 1:00 - +Rule Iran 2087 only - Sep 21 24:00 0 - # -# The following rules are approximations starting in the year 2038. -# These are the best post-2037 approximations available, given the -# restrictions of a single rule using a Gregorian-based data format. +# The following rules are approximations starting in the year 2088. +# These are the best post-2088 approximations available, given the +# restrictions of a single rule using ordinary Gregorian dates. # At some point this table will need to be extended, though quite # possibly Iran will change the rules first. -Rule Iran 2036 max - Mar 21 0:00 1:00 - -Rule Iran 2036 max - Sep 21 0:00 0 - +Rule Iran 2088 max - Mar 20 24:00 1:00 - +Rule Iran 2088 max - Sep 20 24:00 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tehran 3:25:44 - LMT 1916 @@ -1691,7 +1878,9 @@ Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT -# Since 1938, all Japanese possessions have been like Asia/Tokyo. +# Since 1938, all Japanese possessions have been like Asia/Tokyo, +# except that Truk (Chuuk), Ponape (Pohnpei), and Jaluit (Kosrae) did not +# switch from +10 to +09 until 1941-04-01; see the 'australasia' file. # Jordan # @@ -1981,8 +2170,10 @@ Zone Asia/Amman 2:23:44 - LMT 1931 # and in Byalokoz) lists Ural river (plus 10 versts on its left bank) in # the third time belt (before 1930 this means +03). -# From Paul Eggert (2016-12-06): -# The tables below reflect Golosunov's remarks, with exceptions as noted. +# From Alexander Konzurovski (2018-12-20): +# Qyzyolrda Region (Asia/Qyzylorda) is changing its time zone from +# UTC+6 to UTC+5 effective December 21st, 2018. The legal document is +# located here: http://adilet.zan.kz/rus/docs/P1800000817 (russian language). # Zone NAME GMTOFF RULES FORMAT [UNTIL] # @@ -1996,8 +2187,6 @@ Zone Asia/Almaty 5:07:48 - LMT 1924 May 2 # or Alma-A 6:00 RussiaAsia +06/+07 2004 Oct 31 2:00s 6:00 - +06 # Qyzylorda (aka Kyzylorda, Kizilorda, Kzyl-Orda, etc.) (KZ-KZY) -# This currently includes Qostanay (aka Kostanay, Kustanay) (KZ-KUS); -# see comments below. Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 5:00 - +05 1981 Apr 1 @@ -2008,21 +2197,22 @@ Zone Asia/Qyzylorda 4:21:52 - LMT 1924 May 2 5:00 RussiaAsia +05/+06 1992 Jan 19 2:00s 6:00 RussiaAsia +06/+07 1992 Mar 29 2:00s 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s - 6:00 - +06 -# The following zone is like Asia/Qyzylorda except for being one -# hour earlier from 1991-09-29 to 1992-03-29. The 1991/2 rules for -# Qostanay are unclear partly because of the 1997 Turgai -# reorganization, so this zone is commented out for now. -#Zone Asia/Qostanay 4:14:20 - LMT 1924 May 2 -# 4:00 - +04 1930 Jun 21 -# 5:00 - +05 1981 Apr 1 -# 5:00 1:00 +06 1981 Oct 1 -# 6:00 - +06 1982 Apr 1 -# 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s -# 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s -# 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s -# 6:00 - +06 + 6:00 - +06 2018 Dec 21 0:00 + 5:00 - +05 # +# Qostanay (aka Kostanay, Kustanay) (KZ-KUS) +# The 1991/2 rules are unclear partly because of the 1997 Turgai +# reorganization. +Zone Asia/Qostanay 4:14:28 - LMT 1924 May 2 + 4:00 - +04 1930 Jun 21 + 5:00 - +05 1981 Apr 1 + 5:00 1:00 +06 1981 Oct 1 + 6:00 - +06 1982 Apr 1 + 5:00 RussiaAsia +05/+06 1991 Mar 31 2:00s + 4:00 RussiaAsia +04/+05 1992 Jan 19 2:00s + 5:00 RussiaAsia +05/+06 2004 Oct 31 2:00s + 6:00 - +06 + # Aqtöbe (aka Aktobe, formerly Aktyubinsk) (KZ-AKT) Zone Asia/Aqtobe 3:48:40 - LMT 1924 May 2 4:00 - +04 1930 Jun 21 @@ -2116,21 +2306,43 @@ Zone Asia/Bishkek 4:58:24 - LMT 1924 May 2 # started at June 1 in that year. For another example, the article in # 1988 said that DST started at 2:00 AM in that year. +# From Phake Nick (2018-10-27): +# 1. According to official announcement from Korean government, the DST end +# date in South Korea should be +# 1955-09-08 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027977557 +# 1956-09-29 without specifying time +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027978341 +# 1957-09-21 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027979690#3 +# 1958-09-20 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027981189 +# 1959-09-19 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0027982974#2 +# 1960-09-17 24 o'clock +# http://theme.archives.go.kr/next/common/viewEbook.do?singleData=N&archiveEventId=0028044104 +# ... +# 2.... https://namu.wiki/w/대한민국%20표준시 ... [says] +# when Korea was using GMT+8:30 as standard time, the international +# aviation/marine/meteorological industry in the country refused to +# follow and continued to use GMT+9:00 for interoperability. + + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S -Rule ROK 1948 only - Jun 1 0:00 1:00 D -Rule ROK 1948 only - Sep 13 0:00 0 S -Rule ROK 1949 only - Apr 3 0:00 1:00 D -Rule ROK 1949 1951 - Sep Sun>=8 0:00 0 S -Rule ROK 1950 only - Apr 1 0:00 1:00 D -Rule ROK 1951 only - May 6 0:00 1:00 D -Rule ROK 1955 only - May 5 0:00 1:00 D -Rule ROK 1955 only - Sep 9 0:00 0 S -Rule ROK 1956 only - May 20 0:00 1:00 D -Rule ROK 1956 only - Sep 30 0:00 0 S -Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D -Rule ROK 1957 1960 - Sep Sun>=18 0:00 0 S -Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D -Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S +Rule ROK 1948 only - Jun 1 0:00 1:00 D +Rule ROK 1948 only - Sep 12 24:00 0 S +Rule ROK 1949 only - Apr 3 0:00 1:00 D +Rule ROK 1949 1951 - Sep Sat>=7 24:00 0 S +Rule ROK 1950 only - Apr 1 0:00 1:00 D +Rule ROK 1951 only - May 6 0:00 1:00 D +Rule ROK 1955 only - May 5 0:00 1:00 D +Rule ROK 1955 only - Sep 8 24:00 0 S +Rule ROK 1956 only - May 20 0:00 1:00 D +Rule ROK 1956 only - Sep 29 24:00 0 S +Rule ROK 1957 1960 - May Sun>=1 0:00 1:00 D +Rule ROK 1957 1960 - Sep Sat>=17 24:00 0 S +Rule ROK 1987 1988 - May Sun>=8 2:00 1:00 D +Rule ROK 1987 1988 - Oct Sun>=8 3:00 0 S # From Paul Eggert (2016-08-23): # The Korean Wikipedia entry gives the following sources for UT offsets: @@ -2920,6 +3132,11 @@ Zone Asia/Hebron 2:20:23 - LMT 1900 Oct # no information # Philippines + +# From Paul Eggert (2018-11-18): +# The Spanish initially used American (west-of-Greenwich) time. +# It is unknown what time Manila kept when the British occupied it from +# 1762-10-06 through 1764-04; for now assume it kept American time. # On 1844-08-16, Narciso Clavería, governor-general of the # Philippines, issued a proclamation announcing that 1844-12-30 was to # be immediately followed by 1845-01-01; see R.H. van Gent's @@ -3005,8 +3222,8 @@ Link Asia/Qatar Asia/Bahrain # going to run on Higgins Time.' And so, until last year, it did." See: # Antar E. Dinner at When? Saudi Aramco World, 1969 March/April. 2-3. # http://archive.aramcoworld.com/issue/196902/dinner.at.when.htm -# newspapers.com says a similar story about Higgins was published in the Port -# Angeles (WA) Evening News, 1965-03-10, page 5, but I lack access to the text. +# Also see: Antar EN. Arabian flying is confusing. +# Port Angeles (WA) Evening News. 1965-03-10. page 3. # # The TZ database cannot represent quasi-solar time; airline time is the best # we can do. The 1946 foreign air news digest of the U.S. Civil Aeronautics Modified: head/contrib/tzdata/australasia ============================================================================== --- head/contrib/tzdata/australasia Sun Dec 30 08:14:09 2018 (r342612) +++ head/contrib/tzdata/australasia Sun Dec 30 08:22:35 2018 (r342613) @@ -402,10 +402,44 @@ Zone Pacific/Tahiti -9:58:16 - LMT 1912 Oct # Papeete # it is uninhabited. # Guam + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +# http://guamlegislature.com/Public_Laws_5th/PL05-025.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-59-7-Guam-Daylight-Savings-Time-May-6-1959.pdf +Rule Guam 1959 only - Jun 27 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-61-5-Revocation-of-Daylight-Saving-Time-and-Restoratio.pdf +Rule Guam 1961 only - Jan 29 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-67-13-Guam-Daylight-Savings-Time.pdf +Rule Guam 1967 only - Sep 1 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-69-2-Repeal-of-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jan 26 0:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-69-10-Guam-Daylight-Saving-Time.pdf +Rule Guam 1969 only - Jun 22 2:00 1:00 D +Rule Guam 1969 only - Aug 31 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-70-10-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-70-30-End-of-Guam-Daylight-Saving-Time.pdf +# http://documents.guam.gov/wp-content/uploads/E.O.-71-5-Guam-Daylight-Savings-Time.pdf +Rule Guam 1970 1971 - Apr lastSun 2:00 1:00 D +Rule Guam 1970 1971 - Sep Sun>=1 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-73-28.-Guam-Day-light-Saving-Time.pdf +Rule Guam 1973 only - Dec 16 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-74-7-Guam-Daylight-Savings-Time-Rescinded.pdf +Rule Guam 1974 only - Feb 24 2:00 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-76-13-Daylight-Savings-Time.pdf +Rule Guam 1976 only - May 26 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-76-25-Revocation-of-E.O.-76-13.pdf +Rule Guam 1976 only - Aug 22 2:01 0 S +# http://documents.guam.gov/wp-content/uploads/E.O.-77-4-Daylight-Savings-Time.pdf +Rule Guam 1977 only - Apr 24 2:00 1:00 D +# http://documents.guam.gov/wp-content/uploads/E.O.-77-18-Guam-Standard-Time.pdf +Rule Guam 1977 only - Aug 28 2:00 0 S + # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Guam -14:21:00 - LMT 1844 Dec 31 9:39:00 - LMT 1901 # Agana - 10:00 - GST 2000 Dec 23 # Guam + 10:00 - GST 1941 Dec 10 # Guam + 9:00 - +09 1944 Jul 31 + 10:00 Guam G%sT 2000 Dec 23 10:00 - ChST # Chamorro Standard Time Link Pacific/Guam Pacific/Saipan # N Mariana Is @@ -427,31 +461,56 @@ Zone Pacific/Kiritimati -10:29:20 - LMT 1901 # Marshall Is # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Majuro 11:24:48 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 -Zone Pacific/Kwajalein 11:09:20 - LMT 1901 - 11:00 - +11 1969 Oct - -12:00 - -12 1993 Aug 20 - 12:00 - +12 +Zone Pacific/Majuro 11:24:48 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Jan 30 + 11:00 - +11 1969 Oct + 12:00 - +12 +Zone Pacific/Kwajalein 11:09:20 - LMT 1901 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1944 Feb 6 + 11:00 - +11 1969 Oct + -12:00 - -12 1993 Aug 20 24:00 + 12:00 - +12 # Micronesia # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Chuuk 10:07:08 - LMT 1901 - 10:00 - +10 -Zone Pacific/Pohnpei 10:32:52 - LMT 1901 # Kolonia - 11:00 - +11 -Zone Pacific/Kosrae 10:51:56 - LMT 1901 - 11:00 - +11 1969 Oct - 12:00 - +12 1999 - 11:00 - +11 +Zone Pacific/Chuuk -13:52:52 - LMT 1844 Dec 31 + 10:07:08 - LMT 1901 + 10:00 - +10 1914 Oct + 9:00 - +09 1919 Feb 1 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 10:00 - +10 +Zone Pacific/Pohnpei -13:27:08 - LMT 1844 Dec 31 # Kolonia + 10:32:52 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 +Zone Pacific/Kosrae -13:08:04 - LMT 1844 Dec 31 + 10:51:56 - LMT 1901 + 11:00 - +11 1914 Oct + 9:00 - +09 1919 Feb 1 + 11:00 - +11 1937 + 10:00 - +10 1941 Apr 1 + 9:00 - +09 1945 Aug + 11:00 - +11 1969 Oct + 12:00 - +12 1999 + 11:00 - +11 # Nauru # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Pacific/Nauru 11:07:40 - LMT 1921 Jan 15 # Uaobe - 11:30 - +1130 1942 Mar 15 - 9:00 - +09 1944 Aug 15 - 11:30 - +1130 1979 May + 11:30 - +1130 1942 Aug 29 + 9:00 - +09 1945 Sep 8 + 11:30 - +1130 1979 Feb 10 2:00 12:00 - +12 # New Caledonia @@ -552,8 +611,9 @@ Zone Pacific/Norfolk 11:11:52 - LMT 1901 # Kingston # Palau (Belau) # Zone NAME GMTOFF RULES FORMAT [UNTIL] -Zone Pacific/Palau 8:57:56 - LMT 1901 # Koror - 9:00 - +09 +Zone Pacific/Palau -15:02:04 - LMT 1844 Dec 31 # Koror + 8:57:56 - LMT 1901 + 9:00 - +09 # Papua New Guinea # Zone NAME GMTOFF RULES FORMAT [UNTIL] @@ -815,7 +875,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # tz@iana.org for general use in the future). For more, please see # the file CONTRIBUTING in the tz distribution. -# From Paul Eggert (2017-02-10): +# From Paul Eggert (2018-11-18): # # Unless otherwise specified, the source for data through 1990 is: # Thomas G. Shanks and Rique Pottenger, The International Atlas (6th edition), @@ -840,6 +900,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # A reliable and entertaining source about time zones is # Derek Howse, Greenwich time and longitude, Philip Wilson Publishers (1997). # +# I invented the abbreviation marked "*". # The following abbreviations are from other sources. # Corrections are welcome! # std dst @@ -847,7 +908,7 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # 8:00 AWST AWDT Western Australia # 9:30 ACST ACDT Central Australia # 10:00 AEST AEDT Eastern Australia -# 10:00 GST Guam through 2000 +# 10:00 GST GDT* Guam through 2000 # 10:00 ChST Chamorro # 11:30 NZMT NZST New Zealand through 1945 # 12:00 NZST NZDT New Zealand 1946-present @@ -1546,29 +1607,71 @@ Zone Pacific/Wallis 12:15:20 - LMT 1901 # Kwajalein -# In comp.risks 14.87 (26 August 1993), Peter Neumann writes: -# I wonder what happened in Kwajalein, where there was NO Friday, -# 1993-08-20. Thursday night at midnight Kwajalein switched sides with *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sun Dec 30 15:28:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7881142B8AA; Sun, 30 Dec 2018 15:28:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A3B2896F7; Sun, 30 Dec 2018 15:28:32 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A8324DC9; Sun, 30 Dec 2018 15:28:32 +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 wBUFSWXI037736; Sun, 30 Dec 2018 15:28:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFSWDC037735; Sun, 30 Dec 2018 15:28:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301528.wBUFSWDC037735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:28:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342625 - head/sys/compat/linuxkpi/common/src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 342625 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6A3B2896F7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:28:33 -0000 Author: kib Date: Sun Dec 30 15:28:31 2018 New Revision: 342625 URL: https://svnweb.freebsd.org/changeset/base/342625 Log: Use IDX_TO_OFF(). Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:22:26 2018 (r342624) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:28:31 2018 (r342625) @@ -538,7 +538,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_fault vmf; /* fill out VM fault structure */ - vmf.virtual_address = (void *)((uintptr_t)pidx << PAGE_SHIFT); + vmf.virtual_address = (void *)IDX_TO_OFF(pidx); vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; From owner-svn-src-head@freebsd.org Sun Dec 30 15:38:08 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADC43142BB27; Sun, 30 Dec 2018 15:38:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 50DE689C31; Sun, 30 Dec 2018 15:38:08 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 41BC124F91; Sun, 30 Dec 2018 15:38:08 +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 wBUFc8IW042943; Sun, 30 Dec 2018 15:38:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFc79Y042941; Sun, 30 Dec 2018 15:38:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301538.wBUFc79Y042941@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:38:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342627 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 342627 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 50DE689C31 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:38:08 -0000 Author: kib Date: Sun Dec 30 15:38:07 2018 New Revision: 342627 URL: https://svnweb.freebsd.org/changeset/base/342627 Log: Implement zap_vma_ptes() for managed device objects. Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Dec 30 15:34:12 2018 (r342626) +++ head/sys/compat/linuxkpi/common/include/linux/mm.h Sun Dec 30 15:38:07 2018 (r342627) @@ -180,12 +180,8 @@ apply_to_page_range(struct mm_struct *mm, unsigned lon return (-ENOTSUP); } -static inline int -zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, - unsigned long size) -{ - return (-ENOTSUP); -} +int zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size); static inline int remap_pfn_range(struct vm_area_struct *vma, unsigned long addr, Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:34:12 2018 (r342626) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:38:07 2018 (r342627) @@ -672,6 +672,25 @@ static struct cdev_pager_ops linux_cdev_pager_ops[2] = }, }; +int +zap_vma_ptes(struct vm_area_struct *vma, unsigned long address, + unsigned long size) +{ + vm_object_t obj; + vm_page_t m; + + obj = vma->vm_obj; + if (obj == NULL || (obj->flags & OBJ_UNMANAGED) != 0) + return (-ENOTSUP); + VM_OBJECT_RLOCK(obj); + for (m = vm_page_find_least(obj, OFF_TO_IDX(address)); + m != NULL && m->pindex < OFF_TO_IDX(address + size); + m = TAILQ_NEXT(m, listq)) + pmap_remove_all(m); + VM_OBJECT_RUNLOCK(obj); + return (0); +} + #define OPW(fp,td,code) ({ \ struct file *__fpop; \ __typeof(code) __retval; \ From owner-svn-src-head@freebsd.org Sun Dec 30 15:58:19 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66BF3142C13C; Sun, 30 Dec 2018 15:58:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F398D8A66C; Sun, 30 Dec 2018 15:58:18 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8AED25315; Sun, 30 Dec 2018 15:58:18 +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 wBUFwIFq054442; Sun, 30 Dec 2018 15:58:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFwIHS054441; Sun, 30 Dec 2018 15:58:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301558.wBUFwIHS054441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:58:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342630 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 342630 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F398D8A66C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:58:19 -0000 Author: kib Date: Sun Dec 30 15:58:18 2018 New Revision: 342630 URL: https://svnweb.freebsd.org/changeset/base/342630 Log: Add 'v' modifier to the ddb 'show pginfo' command to display vm_page backing the provided kernel virtual address. Tested by: pho MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/vm/vm_page.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Sun Dec 30 15:55:30 2018 (r342629) +++ head/sys/vm/vm_page.c Sun Dec 30 15:58:18 2018 (r342630) @@ -4493,7 +4493,7 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info) DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) { vm_page_t m; - boolean_t phys; + boolean_t phys, virt; if (!have_addr) { db_printf("show pginfo addr\n"); @@ -4501,7 +4501,10 @@ DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) } phys = strchr(modif, 'p') != NULL; - if (phys) + virt = strchr(modif, 'v') != NULL; + if (virt) + m = PHYS_TO_VM_PAGE(pmap_kextract(addr)); + else if (phys) m = PHYS_TO_VM_PAGE(addr); else m = (vm_page_t)addr; From owner-svn-src-head@freebsd.org Sun Dec 30 15:21:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF705142B66A; Sun, 30 Dec 2018 15:21:14 +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 61B2A8935D; Sun, 30 Dec 2018 15:21:13 +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 wBUFL4uJ060154; Sun, 30 Dec 2018 07:21:04 -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 wBUFL4ot060153; Sun, 30 Dec 2018 07:21:04 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201812301521.wBUFL4ot060153@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342619 - head/stand/i386/libi386 In-Reply-To: <201812300935.wBU9Zlwg052665@repo.freebsd.org> To: Toomas Soome Date: Sun, 30 Dec 2018 07:21:04 -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-Rspamd-Queue-Id: 61B2A8935D X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.92 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.92)[-0.924,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:21:15 -0000 > Author: tsoome > Date: Sun Dec 30 09:35:47 2018 > New Revision: 342619 > URL: https://svnweb.freebsd.org/changeset/base/342619 > > Log: > loader: create bio_alloc and bio_free for bios bounce buffer > > We do have 16KB buffer space defined in pxe.c, move it to bio.c and implement > bio_alloc()/bio_free() interface to make it possible to use this space for > other BIOS calls (notably, from biosdisk.c). > > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D17131 > > Added: > head/stand/i386/libi386/bio.c (contents, props changed) > Modified: > head/stand/i386/libi386/Makefile > head/stand/i386/libi386/biosdisk.c > head/stand/i386/libi386/libi386.h > head/stand/i386/libi386/pxe.c > > Modified: head/stand/i386/libi386/Makefile > ============================================================================== > --- head/stand/i386/libi386/Makefile Sun Dec 30 09:13:38 2018 (r342618) > +++ head/stand/i386/libi386/Makefile Sun Dec 30 09:35:47 2018 (r342619) > @@ -4,7 +4,7 @@ > > LIB= i386 > > -SRCS= biosacpi.c biosdisk.c biosmem.c biospnp.c \ > +SRCS= bio.c biosacpi.c biosdisk.c biosmem.c biospnp.c \ > biospci.c biossmap.c bootinfo.c bootinfo32.c bootinfo64.c \ > comconsole.c devicename.c elf32_freebsd.c \ > elf64_freebsd.c multiboot.c multiboot_tramp.S relocater_tramp.S \ > > Added: head/stand/i386/libi386/bio.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/stand/i386/libi386/bio.c Sun Dec 30 09:35:47 2018 (r342619) > @@ -0,0 +1,65 @@ > +/*- > + * 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 file has no copyright... please correct that. > + > +#include > +__FBSDID("$FreeBSD$"); > + > +#include > +#include "libi386.h" > + > +/* > + * The idea is borrowed from pxe.c and zfsimpl.c. The original buffer > + * space in pxe.c was 2x 0x2000. Allocating it from BSS will give us needed > + * memory below 1MB and usable for real mode calls. > + * > + * Note the allocations and frees are to be done in reverse order (LIFO). > + */ > + > +static char bio_buffer[BIO_BUFFER_SIZE]; > +static char *bio_buffer_end = bio_buffer + BIO_BUFFER_SIZE; > +static char *bio_buffer_ptr = bio_buffer; > + > +void * > +bio_alloc(size_t size) > +{ > + char *ptr; > + > + ptr = bio_buffer_ptr; > + if (ptr + size > bio_buffer_end) > + return (NULL); > + bio_buffer_ptr += size; > + > + return (ptr); > +} > + > +void > +bio_free(void *ptr, size_t size) > +{ > + > + if (ptr == NULL) > + return; > + > + bio_buffer_ptr -= size; > + if (bio_buffer_ptr != ptr) > + panic("bio_alloc()/bio_free() mismatch\n"); > +} > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Sun Dec 30 15:34:13 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9779B142BA7D; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EB3789AD1; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 08F8624F84; Sun, 30 Dec 2018 15:34:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUFYCW8042549; Sun, 30 Dec 2018 15:34:12 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFYC5O042548; Sun, 30 Dec 2018 15:34:12 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201812301534.wBUFYC5O042548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sun, 30 Dec 2018 15:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342626 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342626 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EB3789AD1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:34:13 -0000 Author: tsoome Date: Sun Dec 30 15:34:12 2018 New Revision: 342626 URL: https://svnweb.freebsd.org/changeset/base/342626 Log: Add Copyright. Reported by: Rodney W. Grimes Modified: head/stand/i386/libi386/bio.c Modified: head/stand/i386/libi386/bio.c ============================================================================== --- head/stand/i386/libi386/bio.c Sun Dec 30 15:28:31 2018 (r342625) +++ head/stand/i386/libi386/bio.c Sun Dec 30 15:34:12 2018 (r342626) @@ -1,4 +1,6 @@ /*- + * Copyright 2018 Toomas Soome + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: From owner-svn-src-head@freebsd.org Sun Dec 30 15:46:47 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E6A22142BE11; Sun, 30 Dec 2018 15:46:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 925A58A139; Sun, 30 Dec 2018 15:46: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7542525163; Sun, 30 Dec 2018 15:46: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 wBUFkkhA049135; Sun, 30 Dec 2018 15:46:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUFkkmf049133; Sun, 30 Dec 2018 15:46:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812301546.wBUFkkmf049133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 30 Dec 2018 15:46:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342628 - in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 342628 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 925A58A139 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 15:46:47 -0000 Author: kib Date: Sun Dec 30 15:46:45 2018 New Revision: 342628 URL: https://svnweb.freebsd.org/changeset/base/342628 Log: Fix linux_destroy_dev() behaviour when there are still files open from the destroying cdev. Currently linux_destroy_dev() waits for the reference count on the linux cdev to drain, and each open file hold the reference. Practically it means that linux_destroy_dev() is blocked until all userspace processes that have the cdev open, exit. FreeBSD devfs does not have such problem, because device refcount only prevents freeing of the cdev memory, and separate 'active methods' counter blocks destroy_dev() until all threads leave the cdevsw methods. After that, attempts to enter cdevsw methods are refused with an error. Implement somewhat similar mechanism for LinuxKPI cdevs. Demote cdev refcount to only mean a hold on the linux cdev memory. Add sirefs count to track both number of threads inside the cdev methods, and for single-bit indicator that cdev is being destroyed. In the later case, the call is redirected to the dummy cdev. Reviewed by: markj Discussed with: hselasky Tested by: zeising MFC after: 1 week Sponsored by: Mellanox Technologies Differential revision: https://reviews.freebsd.org/D18606 Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h head/sys/compat/linuxkpi/common/src/linux_compat.c Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 30 15:38:07 2018 (r342627) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Sun Dec 30 15:46:45 2018 (r342628) @@ -52,7 +52,8 @@ struct linux_cdev { struct cdev *cdev; dev_t dev; const struct file_operations *ops; - atomic_long_t refs; + u_int refs; + u_int siref; }; static inline void @@ -61,7 +62,7 @@ cdev_init(struct linux_cdev *cdev, const struct file_o kobject_init(&cdev->kobj, &linux_cdev_static_ktype); cdev->ops = ops; - atomic_long_set(&cdev->refs, 0); + cdev->refs = 1; } static inline struct linux_cdev * @@ -70,8 +71,9 @@ cdev_alloc(void) struct linux_cdev *cdev; cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); - if (cdev) + if (cdev != NULL) kobject_init(&cdev->kobj, &linux_cdev_ktype); + cdev->refs = 1; return (cdev); } Modified: head/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:38:07 2018 (r342627) +++ head/sys/compat/linuxkpi/common/src/linux_compat.c Sun Dec 30 15:46:45 2018 (r342628) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -100,6 +101,7 @@ MALLOC_DEFINE(M_KMALLOC, "linux", "Linux kmalloc compa #undef cdev #define RB_ROOT(head) (head)->rbh_root +static void linux_cdev_deref(struct linux_cdev *ldev); static struct vm_area_struct *linux_cdev_handle_find(void *handle); struct kobject linux_class_root; @@ -691,6 +693,52 @@ zap_vma_ptes(struct vm_area_struct *vma, unsigned long return (0); } +static struct file_operations dummy_ldev_ops = { + /* XXXKIB */ +}; + +static struct linux_cdev dummy_ldev = { + .ops = &dummy_ldev_ops, +}; + +#define LDEV_SI_DTR 0x0001 +#define LDEV_SI_REF 0x0002 + +static void +linux_get_fop(struct linux_file *filp, const struct file_operations **fop, + struct linux_cdev **dev) +{ + struct linux_cdev *ldev; + u_int siref; + + ldev = filp->f_cdev; + *fop = filp->f_op; + if (ldev != NULL) { + for (siref = ldev->siref;;) { + if ((siref & LDEV_SI_DTR) != 0) { + ldev = &dummy_ldev; + siref = ldev->siref; + *fop = ldev->ops; + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + } else if (atomic_fcmpset_int(&ldev->siref, &siref, + siref + LDEV_SI_REF)) { + break; + } + } + } + *dev = ldev; +} + +static void +linux_drop_fop(struct linux_cdev *ldev) +{ + + if (ldev == NULL) + return; + MPASS((ldev->siref & ~LDEV_SI_DTR) != 0); + atomic_subtract_int(&ldev->siref, LDEV_SI_REF); +} + #define OPW(fp,td,code) ({ \ struct file *__fpop; \ __typeof(code) __retval; \ @@ -703,10 +751,12 @@ zap_vma_ptes(struct vm_area_struct *vma, unsigned long }) static int -linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, struct file *file) +linux_dev_fdopen(struct cdev *dev, int fflags, struct thread *td, + struct file *file) { struct linux_cdev *ldev; struct linux_file *filp; + const struct file_operations *fop; int error; ldev = dev->si_drv1; @@ -718,20 +768,17 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct filp->f_flags = file->f_flag; filp->f_vnode = file->f_vnode; filp->_file = file; + refcount_acquire(&ldev->refs); filp->f_cdev = ldev; linux_set_current(td); + linux_get_fop(filp, &fop, &ldev); - /* get a reference on the Linux character device */ - if (atomic_long_add_unless(&ldev->refs, 1, -1L) == 0) { - kfree(filp); - return (EINVAL); - } - - if (filp->f_op->open) { - error = -filp->f_op->open(file->f_vnode, filp); - if (error) { - atomic_long_dec(&ldev->refs); + if (fop->open != NULL) { + error = -fop->open(file->f_vnode, filp); + if (error != 0) { + linux_drop_fop(ldev); + linux_cdev_deref(filp->f_cdev); kfree(filp); return (error); } @@ -742,6 +789,7 @@ linux_dev_fdopen(struct cdev *dev, int fflags, struct /* release the file from devfs */ finit(file, filp->f_mode, DTYPE_DEV, filp, &linuxfileops); + linux_drop_fop(ldev); return (ENXIO); } @@ -877,7 +925,8 @@ linux_get_error(struct task_struct *task, int error) static int linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, - u_long cmd, caddr_t data, struct thread *td) + const struct file_operations *fop, u_long cmd, caddr_t data, + struct thread *td) { struct task_struct *task = current; unsigned size; @@ -902,20 +951,28 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil #if defined(__amd64__) if (td->td_proc->p_elf_machine == EM_386) { /* try the compat IOCTL handler first */ - if (filp->f_op->compat_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->compat_ioctl(filp, cmd, (u_long)data)); - else + if (fop->compat_ioctl != NULL) { + error = -OPW(fp, td, fop->compat_ioctl(filp, + cmd, (u_long)data)); + } else { error = ENOTTY; + } /* fallback to the regular IOCTL handler, if any */ - if (error == ENOTTY && filp->f_op->unlocked_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); + if (error == ENOTTY && fop->unlocked_ioctl != NULL) { + error = -OPW(fp, td, fop->unlocked_ioctl(filp, + cmd, (u_long)data)); + } } else #endif - if (filp->f_op->unlocked_ioctl != NULL) - error = -OPW(fp, td, filp->f_op->unlocked_ioctl(filp, cmd, (u_long)data)); - else - error = ENOTTY; + { + if (fop->unlocked_ioctl != NULL) { + error = -OPW(fp, td, fop->unlocked_ioctl(filp, + cmd, (u_long)data)); + } else { + error = ENOTTY; + } + } if (size > 0) { task->bsd_ioctl_data = NULL; task->bsd_ioctl_len = 0; @@ -1084,30 +1141,36 @@ static struct filterops linux_dev_kqfiltops_write = { static void linux_file_kqfilter_poll(struct linux_file *filp, int kqflags) { + struct thread *td; + const struct file_operations *fop; + struct linux_cdev *ldev; int temp; - if (filp->f_kqflags & kqflags) { - struct thread *td = curthread; + if ((filp->f_kqflags & kqflags) == 0) + return; - /* get the latest polling state */ - temp = OPW(filp->_file, td, filp->f_op->poll(filp, NULL)); + td = curthread; - spin_lock(&filp->f_kqlock); - /* clear kqflags */ - filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | - LINUX_KQ_FLAG_NEED_WRITE); - /* update kqflags */ - if (temp & (POLLIN | POLLOUT)) { - if (temp & POLLIN) - filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; - if (temp & POLLOUT) - filp->f_kqflags |= LINUX_KQ_FLAG_NEED_WRITE; + linux_get_fop(filp, &fop, &ldev); + /* get the latest polling state */ + temp = OPW(filp->_file, td, fop->poll(filp, NULL)); + linux_drop_fop(ldev); - /* make sure the "knote" gets woken up */ - KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); - } - spin_unlock(&filp->f_kqlock); + spin_lock(&filp->f_kqlock); + /* clear kqflags */ + filp->f_kqflags &= ~(LINUX_KQ_FLAG_NEED_READ | + LINUX_KQ_FLAG_NEED_WRITE); + /* update kqflags */ + if ((temp & (POLLIN | POLLOUT)) != 0) { + if ((temp & POLLIN) != 0) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_READ; + if ((temp & POLLOUT) != 0) + filp->f_kqflags |= LINUX_KQ_FLAG_NEED_WRITE; + + /* make sure the "knote" gets woken up */ + KNOTE_LOCKED(&filp->f_selinfo.si_note, 0); } + spin_unlock(&filp->f_kqlock); } static int @@ -1156,9 +1219,9 @@ linux_file_kqfilter(struct file *file, struct knote *k } static int -linux_file_mmap_single(struct file *fp, vm_ooffset_t *offset, - vm_size_t size, struct vm_object **object, int nprot, - struct thread *td) +linux_file_mmap_single(struct file *fp, const struct file_operations *fop, + vm_ooffset_t *offset, vm_size_t size, struct vm_object **object, + int nprot, struct thread *td) { struct task_struct *task; struct vm_area_struct *vmap; @@ -1170,7 +1233,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * filp = (struct linux_file *)fp->f_data; filp->f_flags = fp->f_flag; - if (filp->f_op->mmap == NULL) + if (fop->mmap == NULL) return (EOPNOTSUPP); linux_set_current(td); @@ -1200,7 +1263,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { error = linux_get_error(task, EINTR); } else { - error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); + error = -OPW(fp, td, fop->mmap(filp, vmap)); error = linux_get_error(task, error); up_write(&vmap->vm_mm->mmap_sem); } @@ -1319,6 +1382,8 @@ linux_file_read(struct file *file, struct uio *uio, st int flags, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; ssize_t bytes; int error; @@ -1331,8 +1396,10 @@ linux_file_read(struct file *file, struct uio *uio, st if (uio->uio_resid > DEVFS_IOSIZE_MAX) return (EINVAL); linux_set_current(td); - if (filp->f_op->read) { - bytes = OPW(file, td, filp->f_op->read(filp, uio->uio_iov->iov_base, + linux_get_fop(filp, &fop, &ldev); + if (fop->read != NULL) { + bytes = OPW(file, td, fop->read(filp, + uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset)); if (bytes >= 0) { uio->uio_iov->iov_base = @@ -1347,6 +1414,7 @@ linux_file_read(struct file *file, struct uio *uio, st /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ); + linux_drop_fop(ldev); return (error); } @@ -1356,10 +1424,11 @@ linux_file_write(struct file *file, struct uio *uio, s int flags, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; ssize_t bytes; int error; - error = 0; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; /* XXX no support for I/O vectors currently */ @@ -1368,14 +1437,17 @@ linux_file_write(struct file *file, struct uio *uio, s if (uio->uio_resid > DEVFS_IOSIZE_MAX) return (EINVAL); linux_set_current(td); - if (filp->f_op->write) { - bytes = OPW(file, td, filp->f_op->write(filp, uio->uio_iov->iov_base, + linux_get_fop(filp, &fop, &ldev); + if (fop->write != NULL) { + bytes = OPW(file, td, fop->write(filp, + uio->uio_iov->iov_base, uio->uio_iov->iov_len, &uio->uio_offset)); if (bytes >= 0) { uio->uio_iov->iov_base = ((uint8_t *)uio->uio_iov->iov_base) + bytes; uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; + error = 0; } else { error = linux_get_error(current, -bytes); } @@ -1385,6 +1457,8 @@ linux_file_write(struct file *file, struct uio *uio, s /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_WRITE); + linux_drop_fop(ldev); + return (error); } @@ -1393,16 +1467,21 @@ linux_file_poll(struct file *file, int events, struct struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int revents; filp = (struct linux_file *)file->f_data; filp->f_flags = file->f_flag; linux_set_current(td); - if (filp->f_op->poll != NULL) - revents = OPW(file, td, filp->f_op->poll(filp, LINUX_POLL_TABLE_NORMAL)) & events; - else + linux_get_fop(filp, &fop, &ldev); + if (fop->poll != NULL) { + revents = OPW(file, td, fop->poll(filp, + LINUX_POLL_TABLE_NORMAL)) & events; + } else { revents = 0; - + } + linux_drop_fop(ldev); return (revents); } @@ -1410,23 +1489,28 @@ static int linux_file_close(struct file *file, struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int error; filp = (struct linux_file *)file->f_data; - KASSERT(file_count(filp) == 0, ("File refcount(%d) is not zero", file_count(filp))); + KASSERT(file_count(filp) == 0, + ("File refcount(%d) is not zero", file_count(filp))); + error = 0; filp->f_flags = file->f_flag; linux_set_current(td); linux_poll_wait_dequeue(filp); - error = -OPW(file, td, filp->f_op->release(filp->f_vnode, filp)); + linux_get_fop(filp, &fop, &ldev); + if (fop->release != NULL) + error = -OPW(file, td, fop->release(filp->f_vnode, filp)); funsetown(&filp->f_sigio); if (filp->f_vnode != NULL) vdrop(filp->f_vnode); - if (filp->f_cdev != NULL) { - /* put a reference on the Linux character device */ - atomic_long_dec(&filp->f_cdev->refs); - } + linux_drop_fop(ldev); + if (filp->f_cdev != NULL) + linux_cdev_deref(filp->f_cdev); kfree(filp); return (error); @@ -1437,27 +1521,30 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; int error; + error = 0; filp = (struct linux_file *)fp->f_data; filp->f_flags = fp->f_flag; - error = 0; + linux_get_fop(filp, &fop, &ldev); linux_set_current(td); switch (cmd) { case FIONBIO: break; case FIOASYNC: - if (filp->f_op->fasync == NULL) + if (fop->fasync == NULL) break; - error = -OPW(fp, td, filp->f_op->fasync(0, filp, fp->f_flag & FASYNC)); + error = -OPW(fp, td, fop->fasync(0, filp, fp->f_flag & FASYNC)); break; case FIOSETOWN: error = fsetown(*(int *)data, &filp->f_sigio); if (error == 0) { - if (filp->f_op->fasync == NULL) + if (fop->fasync == NULL) break; - error = -OPW(fp, td, filp->f_op->fasync(0, filp, + error = -OPW(fp, td, fop->fasync(0, filp, fp->f_flag & FASYNC)); } break; @@ -1465,16 +1552,17 @@ linux_file_ioctl(struct file *fp, u_long cmd, void *da *(int *)data = fgetown(&filp->f_sigio); break; default: - error = linux_file_ioctl_sub(fp, filp, cmd, data, td); + error = linux_file_ioctl_sub(fp, filp, fop, cmd, data, td); break; } + linux_drop_fop(ldev); return (error); } static int linux_file_mmap_sub(struct thread *td, vm_size_t objsize, vm_prot_t prot, vm_prot_t *maxprotp, int *flagsp, struct file *fp, - vm_ooffset_t *foff, vm_object_t *objp) + vm_ooffset_t *foff, const struct file_operations *fop, vm_object_t *objp) { /* * Character devices do not provide private mappings @@ -1486,7 +1574,8 @@ linux_file_mmap_sub(struct thread *td, vm_size_t objsi if ((*flagsp & (MAP_PRIVATE | MAP_COPY)) != 0) return (EINVAL); - return (linux_file_mmap_single(fp, foff, objsize, objp, (int)prot, td)); + return (linux_file_mmap_single(fp, fop, foff, objsize, objp, + (int)prot, td)); } static int @@ -1495,6 +1584,8 @@ linux_file_mmap(struct file *fp, vm_map_t map, vm_offs struct thread *td) { struct linux_file *filp; + const struct file_operations *fop; + struct linux_cdev *ldev; struct mount *mp; struct vnode *vp; vm_object_t object; @@ -1541,15 +1632,18 @@ linux_file_mmap(struct file *fp, vm_map_t map, vm_offs } maxprot &= cap_maxprot; - error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, &foff, - &object); + linux_get_fop(filp, &fop, &ldev); + error = linux_file_mmap_sub(td, size, prot, &maxprot, &flags, fp, + &foff, fop, &object); if (error != 0) - return (error); + goto out; error = vm_mmap_object(map, addr, size, prot, maxprot, flags, object, foff, FALSE, td); if (error != 0) vm_object_deallocate(object); +out: + linux_drop_fop(ldev); return (error); } @@ -1971,6 +2065,14 @@ linux_completion_done(struct completion *c) } static void +linux_cdev_deref(struct linux_cdev *ldev) +{ + + if (refcount_release(&ldev->refs)) + kfree(ldev); +} + +static void linux_cdev_release(struct kobject *kobj) { struct linux_cdev *cdev; @@ -1979,7 +2081,7 @@ linux_cdev_release(struct kobject *kobj) cdev = container_of(kobj, struct linux_cdev, kobj); parent = kobj->parent; linux_destroy_dev(cdev); - kfree(cdev); + linux_cdev_deref(cdev); kobject_put(parent); } @@ -1996,20 +2098,19 @@ linux_cdev_static_release(struct kobject *kobj) } void -linux_destroy_dev(struct linux_cdev *cdev) +linux_destroy_dev(struct linux_cdev *ldev) { - if (cdev->cdev == NULL) + if (ldev->cdev == NULL) return; - atomic_long_dec(&cdev->refs); + MPASS((ldev->siref & LDEV_SI_DTR) == 0); + atomic_set_int(&ldev->siref, LDEV_SI_DTR); + while ((atomic_load_int(&ldev->siref) & ~LDEV_SI_DTR) != 0) + pause("ldevdtr", hz / 4); - /* wait for all open files to be closed */ - while (atomic_long_read(&cdev->refs) != -1L) - pause("ldevdrn", hz); - - destroy_dev(cdev->cdev); - cdev->cdev = NULL; + destroy_dev(ldev->cdev); + ldev->cdev = NULL; } const struct kobj_type linux_cdev_ktype = { From owner-svn-src-head@freebsd.org Sun Dec 30 23:04:04 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 22EB814386F0; Sun, 30 Dec 2018 23:04:04 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B65407197D; Sun, 30 Dec 2018 23:04:03 +0000 (UTC) (envelope-from delphij@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CB961D2C; Sun, 30 Dec 2018 23:04:03 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBUN43x6084055; Sun, 30 Dec 2018 23:04:03 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUN42bZ084045; Sun, 30 Dec 2018 23:04:02 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812302304.wBUN42bZ084045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sun, 30 Dec 2018 23:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342633 - head/share/timedef X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/share/timedef X-SVN-Commit-Revision: 342633 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B65407197D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 23:04:04 -0000 Author: delphij Date: Sun Dec 30 23:04:02 2018 New Revision: 342633 URL: https://svnweb.freebsd.org/changeset/base/342633 Log: Fix various issues with Chinese locales: - Change short weekday names to use only one Chinese character. (note: this is a somewhat misunfortunate compromise due to the fact that some applications are using short buffer for weekday names, and in ~1905 when 星期 system was created to replace the traditional 七曜 system, which can use 日月ç«æ°´æœ¨é‡‘土 to represent Sunday through Saturday with just one character without any confusion). - for zh_CN locales: use Arabic numerals for month names, matching the practice of all other CJK locales - Regenerate zh_CN.{GB2312,GBK} locales from zh_CN.UTF-8. Reported by: ygy Reviewed by: kevlo MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18689 Modified: head/share/timedef/zh_CN.GB2312.src head/share/timedef/zh_CN.GBK.src head/share/timedef/zh_CN.UTF-8.src (contents, props changed) head/share/timedef/zh_HK.UTF-8.src head/share/timedef/zh_TW.UTF-8.src Modified: head/share/timedef/zh_CN.GB2312.src ============================================================================== --- head/share/timedef/zh_CN.GB2312.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.GB2312.src Sun Dec 30 23:04:02 2018 (r342633) @@ -4,41 +4,41 @@ # ----------------------------------------------------------------------------- # # Short month names -!!#1TB -!!#2TB -!!#3TB -!!#4TB -!!#5TB -!!#6TB -!!#7TB -!!#8TB -!!#9TB -#1#0TB -#1#1TB -#1#2TB + 1Ô + 2Ô + 3Ô + 4Ô + 5Ô + 6Ô + 7Ô + 8Ô + 9Ô +10Ô +11Ô +12Ô # # Long month names (as in a date) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # Short weekday names -ÖÜÈÕ -ÖÜÒ» -Öܶþ -ÖÜÈý -ÖÜËÄ -ÖÜÎå -ÖÜÁù +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù # # Long weekday names ÐÇÆÚÈÕ @@ -66,18 +66,18 @@ %YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # md_order md Modified: head/share/timedef/zh_CN.GBK.src ============================================================================== --- head/share/timedef/zh_CN.GBK.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.GBK.src Sun Dec 30 23:04:02 2018 (r342633) @@ -18,27 +18,27 @@ 12Ô # # Long month names (as in a date) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # Short weekday names -ÖÜÈÕ -ÖÜÒ» -Öܶþ -ÖÜÈý -ÖÜËÄ -ÖÜÎå -ÖÜÁù +ÈÕ +Ò» +¶þ +Èý +ËÄ +Îå +Áù # # Long weekday names ÐÇÆÚÈÕ @@ -66,18 +66,18 @@ %YÄê%_mÔÂ%eÈÕ %A %X %Z # # Long month names (without case ending) -Ò»Ô -¶þÔ -ÈýÔ -ËÄÔ -ÎåÔ -ÁùÔ -ÆßÔ -°ËÔ -¾ÅÔ -ʮԠ-ʮһÔ -Ê®¶þÔ +1Ô +2Ô +3Ô +4Ô +5Ô +6Ô +7Ô +8Ô +9Ô +10Ô +11Ô +12Ô # # md_order md Modified: head/share/timedef/zh_CN.UTF-8.src ============================================================================== --- head/share/timedef/zh_CN.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_CN.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -18,27 +18,27 @@ 12月 # # Long month names (as in a date) -一月 -二月 -三月 -四月 -五月 -六月 -七月 -八月 -ä¹æœˆ -å月 -å一月 -å二月 +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 # # Short weekday names -周日 -周一 -周二 -周三 -周四 -周五 -周六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 @@ -66,18 +66,18 @@ %Yå¹´%_m月%eæ—¥ %A %X %Z # # Long month names (without case ending) -一月 -二月 -三月 -四月 -五月 -六月 -七月 -八月 -ä¹æœˆ -å月 -å一月 -å二月 +1月 +2月 +3月 +4月 +5月 +6月 +7月 +8月 +9月 +10月 +11月 +12月 # # md_order md Modified: head/share/timedef/zh_HK.UTF-8.src ============================================================================== --- head/share/timedef/zh_HK.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_HK.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -32,13 +32,13 @@ 12月 # # Short weekday names -週日 -週一 -週二 -週三 -週四 -週五 -週六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 Modified: head/share/timedef/zh_TW.UTF-8.src ============================================================================== --- head/share/timedef/zh_TW.UTF-8.src Sun Dec 30 19:44:50 2018 (r342632) +++ head/share/timedef/zh_TW.UTF-8.src Sun Dec 30 23:04:02 2018 (r342633) @@ -32,13 +32,13 @@ 12月 # # Short weekday names -週日 -週一 -週二 -週三 -週四 -週五 -週六 +æ—¥ +一 +二 +三 +å›› +五 +å…­ # # Long weekday names 星期日 From owner-svn-src-head@freebsd.org Sun Dec 30 23:08:10 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06A61438A81; Sun, 30 Dec 2018 23:08:09 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 77F7D71C72; Sun, 30 Dec 2018 23:08:09 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A78F1D35; Sun, 30 Dec 2018 23:08:09 +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 wBUN89gw084358; Sun, 30 Dec 2018 23:08:09 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUN87oG084339; Sun, 30 Dec 2018 23:08:07 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201812302308.wBUN87oG084339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 30 Dec 2018 23:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342634 - in head/sys: arm/broadcom/bcm2835 arm/nvidia arm/ti dev/sdhci X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: in head/sys: arm/broadcom/bcm2835 arm/nvidia arm/ti dev/sdhci X-SVN-Commit-Revision: 342634 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 77F7D71C72 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 23:08:10 -0000 Author: marius Date: Sun Dec 30 23:08:06 2018 New Revision: 342634 URL: https://svnweb.freebsd.org/changeset/base/342634 Log: o Don't allocate resources for SDMA in sdhci(4) if the controller or the front-end doesn't support SDMA or the latter implements a platform- specific transfer method instead. While at it, factor out allocation and freeing of SDMA resources to sdhci_dma_{alloc,free}() in order to keep the code more readable when adding support for ADMA variants. o Base the size of the SDMA bounce buffer on MAXPHYS up to the maximum of 512 KiB instead of using a fixed 4-KiB-buffer. With the default MAXPHYS of 128 KiB and depending on the controller and medium, this reduces the number of SDHCI interrupts by a factor of ~16 to ~32 on sequential reads while an increase of throughput of up to ~84 % was seen. Front-ends for broken controllers that only support an SDMA buffer boundary of a specific size may set SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY and supply a size via struct sdhci_slot. According to Linux, only Qualcomm MSM-type SDHCI controllers are affected by this, though. Requested by: Shreyank Amartya (unconditional bump to 512 KiB) o Introduce a SDHCI_DEPEND macro for specifying the dependency of the front-end modules on the sdhci(4) one and bump the module version of sdhci(4) to 2 via an also newly introduced SDHCI_VERSION in order to ensure that all components are in sync WRT struct sdhci_slot. o In sdhci(4): - Make pointers const were applicable, - replace a few device_printf(9) calls with slot_printf() for consistency, and - sync some local functions with their prototypes WRT static. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c head/sys/arm/nvidia/tegra_sdhci.c head/sys/arm/ti/ti_sdhci.c head/sys/dev/sdhci/fsl_sdhci.c head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h head/sys/dev/sdhci/sdhci_acpi.c head/sys/dev/sdhci/sdhci_fdt.c head/sys/dev/sdhci/sdhci_pci.c head/sys/dev/sdhci/sdhci_xenon.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -683,7 +683,7 @@ static driver_t bcm_sdhci_driver = { DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_bcm); #endif Modified: head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhost.c Sun Dec 30 23:08:06 2018 (r342634) @@ -1287,7 +1287,7 @@ static driver_t bcm_sdhost_driver = { DRIVER_MODULE(sdhost_bcm, simplebus, bcm_sdhost_driver, bcm_sdhost_devclass, NULL, NULL); -MODULE_DEPEND(sdhost_bcm, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhost_bcm); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhost_bcm); #endif Modified: head/sys/arm/nvidia/tegra_sdhci.c ============================================================================== --- head/sys/arm/nvidia/tegra_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/nvidia/tegra_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -465,7 +465,7 @@ static DEFINE_CLASS_0(sdhci, tegra_sdhci_driver, tegra sizeof(struct tegra_sdhci_softc)); DRIVER_MODULE(sdhci_tegra, simplebus, tegra_sdhci_driver, tegra_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_tegra, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_tegra); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci); #endif Modified: head/sys/arm/ti/ti_sdhci.c ============================================================================== --- head/sys/arm/ti/ti_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/arm/ti/ti_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -755,7 +755,7 @@ static driver_t ti_sdhci_driver = { DRIVER_MODULE(sdhci_ti, simplebus, ti_sdhci_driver, ti_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_ti, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_ti); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_ti); Modified: head/sys/dev/sdhci/fsl_sdhci.c ============================================================================== --- head/sys/dev/sdhci/fsl_sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/fsl_sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -1005,7 +1005,7 @@ static driver_t fsl_sdhci_driver = { DRIVER_MODULE(sdhci_fsl, simplebus, fsl_sdhci_driver, fsl_sdhci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fsl, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_fsl); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_fsl); Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -108,19 +109,20 @@ static void sdhci_retune(void *arg); static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock); static void sdhci_set_power(struct sdhci_slot *slot, u_char power); static void sdhci_set_transfer_mode(struct sdhci_slot *slot, - struct mmc_data *data); + const struct mmc_data *data); static void sdhci_start(struct sdhci_slot *slot); static void sdhci_timeout(void *arg); static void sdhci_start_command(struct sdhci_slot *slot, struct mmc_command *cmd); -static void sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data); +static void sdhci_start_data(struct sdhci_slot *slot, + const struct mmc_data *data); static void sdhci_write_block_pio(struct sdhci_slot *slot); static void sdhci_transfer_pio(struct sdhci_slot *slot); #ifdef MMCCAM /* CAM-related */ static void sdhci_cam_action(struct cam_sim *sim, union ccb *ccb); -static int sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, +static int sdhci_cam_get_possible_host_clock(const struct sdhci_slot *slot, int proposed_clock); static void sdhci_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb); static void sdhci_cam_poll(struct cam_sim *sim); @@ -130,12 +132,14 @@ static int sdhci_cam_update_ios(struct sdhci_slot *slo #endif /* helper routines */ +static int sdhci_dma_alloc(struct sdhci_slot *slot); +static void sdhci_dma_free(struct sdhci_slot *slot); static void sdhci_dumpregs(struct sdhci_slot *slot); static void sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int nsegs, int error); -static int slot_printf(struct sdhci_slot *slot, const char * fmt, ...) +static int slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) __printflike(2, 3); -static uint32_t sdhci_tuning_intmask(struct sdhci_slot *slot); +static uint32_t sdhci_tuning_intmask(const struct sdhci_slot *slot); #define SDHCI_LOCK(_slot) mtx_lock(&(_slot)->mtx) #define SDHCI_UNLOCK(_slot) mtx_unlock(&(_slot)->mtx) @@ -179,7 +183,7 @@ sdhci_getaddr(void *arg, bus_dma_segment_t *segs, int } static int -slot_printf(struct sdhci_slot *slot, const char * fmt, ...) +slot_printf(const struct sdhci_slot *slot, const char * fmt, ...) { va_list ap; int retval; @@ -290,7 +294,7 @@ sdhci_reset(struct sdhci_slot *slot, uint8_t mask) } static uint32_t -sdhci_tuning_intmask(struct sdhci_slot *slot) +sdhci_tuning_intmask(const struct sdhci_slot *slot) { uint32_t intmask; @@ -737,55 +741,94 @@ sdhci_card_poll(void *arg) sdhci_card_poll, slot); } -int -sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) +static int +sdhci_dma_alloc(struct sdhci_slot *slot) { - kobjop_desc_t kobj_desc; - kobj_method_t *kobj_method; - uint32_t caps, caps2, freq, host_caps; int err; - SDHCI_LOCK_INIT(slot); + if (!(slot->quirks & SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY)) { + if (MAXPHYS <= 1024 * 4) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; + else if (MAXPHYS <= 1024 * 8) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_8K; + else if (MAXPHYS <= 1024 * 16) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_16K; + else if (MAXPHYS <= 1024 * 32) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_32K; + else if (MAXPHYS <= 1024 * 64) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_64K; + else if (MAXPHYS <= 1024 * 128) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_128K; + else if (MAXPHYS <= 1024 * 256) + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_256K; + else + slot->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_512K; + } + slot->sdma_bbufsz = SDHCI_SDMA_BNDRY_TO_BBUFSZ(slot->sdma_boundary); - slot->num = num; - slot->bus = dev; - - /* Allocate DMA tag. */ - err = bus_dma_tag_create(bus_get_dma_tag(dev), - DMA_BLOCK_SIZE, 0, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR, NULL, NULL, - DMA_BLOCK_SIZE, 1, DMA_BLOCK_SIZE, - BUS_DMA_ALLOCNOW, NULL, NULL, - &slot->dmatag); + /* + * Allocate the DMA tag for an SDMA bounce buffer. + * Note that the SDHCI specification doesn't state any alignment + * constraint for the SDMA system address. However, controllers + * typically ignore the SDMA boundary bits in SDHCI_DMA_ADDRESS when + * forming the actual address of data, requiring the SDMA buffer to + * be aligned to the SDMA boundary. + */ + err = bus_dma_tag_create(bus_get_dma_tag(slot->bus), slot->sdma_bbufsz, + 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, + slot->sdma_bbufsz, 1, slot->sdma_bbufsz, BUS_DMA_ALLOCNOW, + NULL, NULL, &slot->dmatag); if (err != 0) { - device_printf(dev, "Can't create DMA tag\n"); - SDHCI_LOCK_DESTROY(slot); + slot_printf(slot, "Can't create DMA tag for SDMA\n"); return (err); } - /* Allocate DMA memory. */ + /* Allocate DMA memory for the SDMA bounce buffer. */ err = bus_dmamem_alloc(slot->dmatag, (void **)&slot->dmamem, BUS_DMA_NOWAIT, &slot->dmamap); if (err != 0) { - device_printf(dev, "Can't alloc DMA memory\n"); + slot_printf(slot, "Can't alloc DMA memory for SDMA\n"); bus_dma_tag_destroy(slot->dmatag); - SDHCI_LOCK_DESTROY(slot); return (err); } - /* Map the memory. */ + /* Map the memory of the SDMA bounce buffer. */ err = bus_dmamap_load(slot->dmatag, slot->dmamap, - (void *)slot->dmamem, DMA_BLOCK_SIZE, - sdhci_getaddr, &slot->paddr, 0); + (void *)slot->dmamem, slot->sdma_bbufsz, sdhci_getaddr, + &slot->paddr, 0); if (err != 0 || slot->paddr == 0) { - device_printf(dev, "Can't load DMA memory\n"); + slot_printf(slot, "Can't load DMA memory for SDMA\n"); bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); bus_dma_tag_destroy(slot->dmatag); - SDHCI_LOCK_DESTROY(slot); if (err) return (err); else return (EFAULT); } + return (0); +} + +static void +sdhci_dma_free(struct sdhci_slot *slot) +{ + + bus_dmamap_unload(slot->dmatag, slot->dmamap); + bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); + bus_dma_tag_destroy(slot->dmatag); +} + +int +sdhci_init_slot(device_t dev, struct sdhci_slot *slot, int num) +{ + kobjop_desc_t kobj_desc; + kobj_method_t *kobj_method; + uint32_t caps, caps2, freq, host_caps; + int err; + + SDHCI_LOCK_INIT(slot); + + slot->num = num; + slot->bus = dev; + slot->version = (RD2(slot, SDHCI_HOST_VERSION) >> SDHCI_SPEC_VER_SHIFT) & SDHCI_SPEC_VER_MASK; if (slot->quirks & SDHCI_QUIRK_MISSING_CAPS) { @@ -801,12 +844,8 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if (slot->version >= SDHCI_SPEC_300) { if ((caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_REMOVABLE && (caps & SDHCI_SLOTTYPE_MASK) != SDHCI_SLOTTYPE_EMBEDDED) { - device_printf(dev, + slot_printf(slot, "Driver doesn't support shared bus slots\n"); - bus_dmamap_unload(slot->dmatag, slot->dmamap); - bus_dmamem_free(slot->dmatag, slot->dmamem, - slot->dmamap); - bus_dma_tag_destroy(slot->dmatag); SDHCI_LOCK_DESTROY(slot); return (ENXIO); } else if ((caps & SDHCI_SLOTTYPE_MASK) == @@ -830,7 +869,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, */ if (slot->max_clk == 0) { slot->max_clk = SDHCI_DEFAULT_MAX_FREQ * 1000000; - device_printf(dev, "Hardware doesn't specify base clock " + slot_printf(slot, "Hardware doesn't specify base clock " "frequency, using %dMHz as default.\n", SDHCI_DEFAULT_MAX_FREQ); } @@ -851,7 +890,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, * max timeout, but still mention it. */ if (slot->timeout_clk == 0) { - device_printf(dev, "Hardware doesn't specify timeout clock " + slot_printf(slot, "Hardware doesn't specify timeout clock " "frequency, setting BROKEN_TIMEOUT quirk.\n"); slot->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; } @@ -867,7 +906,7 @@ sdhci_init_slot(device_t dev, struct sdhci_slot *slot, if ((caps & SDHCI_CAN_VDD_180) && (slot->opt & SDHCI_SLOT_EMBEDDED)) slot->host.host_ocr |= MMC_OCR_LOW_VOLTAGE; if (slot->host.host_ocr == 0) { - device_printf(dev, "Hardware doesn't report any " + slot_printf(slot, "Hardware doesn't report any " "support voltages.\n"); } @@ -953,7 +992,7 @@ no_tuning: slot->retune_count = (caps2 & SDHCI_RETUNE_CNT_MASK) >> SDHCI_RETUNE_CNT_SHIFT; if (slot->retune_count > 0xb) { - device_printf(dev, "Unknown re-tuning count " + slot_printf(slot, "Unknown re-tuning count " "%x, using 1 sec\n", slot->retune_count); slot->retune_count = 1; } else if (slot->retune_count != 0) @@ -1012,6 +1051,19 @@ no_tuning: if (slot->opt & SDHCI_PLATFORM_TRANSFER) slot->opt &= ~SDHCI_HAVE_DMA; + if (slot->opt & SDHCI_HAVE_DMA) { + err = sdhci_dma_alloc(slot); + if (err != 0) { + if (slot->opt & SDHCI_TUNING_SUPPORTED) { + free(slot->tune_req, M_DEVBUF); + free(slot->tune_cmd, M_DEVBUF); + free(slot->tune_data, M_DEVBUF); + } + SDHCI_LOCK_DESTROY(slot); + return (err); + } + } + if (bootverbose || sdhci_debug) { slot_printf(slot, "%uMHz%s %s VDD:%s%s%s VCCQ: 3.3V%s%s DRV: B%s%s%s %s %s\n", @@ -1109,9 +1161,8 @@ sdhci_cleanup_slot(struct sdhci_slot *slot) SDHCI_LOCK(slot); sdhci_reset(slot, SDHCI_RESET_ALL); SDHCI_UNLOCK(slot); - bus_dmamap_unload(slot->dmatag, slot->dmamap); - bus_dmamem_free(slot->dmatag, slot->dmamem, slot->dmamap); - bus_dma_tag_destroy(slot->dmatag); + if (slot->opt & SDHCI_HAVE_DMA) + sdhci_dma_free(slot); if (slot->opt & SDHCI_TUNING_SUPPORTED) { free(slot->tune_req, M_DEVBUF); free(slot->tune_cmd, M_DEVBUF); @@ -1175,7 +1226,7 @@ sdhci_generic_get_card_present(device_t brdev __unused void sdhci_generic_set_uhs_timing(device_t brdev __unused, struct sdhci_slot *slot) { - struct mmc_ios *ios; + const struct mmc_ios *ios; uint16_t hostctrl2; if (slot->version < SDHCI_SPEC_300) @@ -1308,7 +1359,7 @@ int sdhci_generic_tune(device_t brdev __unused, device_t reqdev, bool hs400) { struct sdhci_slot *slot = device_get_ivars(reqdev); - struct mmc_ios *ios = &slot->host.ios; + const struct mmc_ios *ios = &slot->host.ios; struct mmc_command *tune_cmd; struct mmc_data *tune_data; uint32_t opcode; @@ -1564,7 +1615,7 @@ sdhci_timeout(void *arg) } static void -sdhci_set_transfer_mode(struct sdhci_slot *slot, struct mmc_data *data) +sdhci_set_transfer_mode(struct sdhci_slot *slot, const struct mmc_data *data) { uint16_t mode; @@ -1766,9 +1817,9 @@ sdhci_finish_command(struct sdhci_slot *slot) } static void -sdhci_start_data(struct sdhci_slot *slot, struct mmc_data *data) +sdhci_start_data(struct sdhci_slot *slot, const struct mmc_data *data) { - uint32_t target_timeout, current_timeout; + uint32_t blkcnt, blksz, current_timeout, sdma_bbufsz, target_timeout; uint8_t div; if (data == NULL && (slot->curcmd->flags & MMC_RSP_BUSY) == 0) { @@ -1804,7 +1855,7 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d /* Use DMA if possible. */ if ((slot->opt & SDHCI_HAVE_DMA)) slot->flags |= SDHCI_USE_DMA; - /* If data is small, broken DMA may return zeroes instead of data, */ + /* If data is small, broken DMA may return zeroes instead of data. */ if ((slot->quirks & SDHCI_QUIRK_BROKEN_TIMINGS) && (data->len <= 512)) slot->flags &= ~SDHCI_USE_DMA; @@ -1814,20 +1865,22 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d slot->flags &= ~SDHCI_USE_DMA; /* Load DMA buffer. */ if (slot->flags & SDHCI_USE_DMA) { + sdma_bbufsz = slot->sdma_bbufsz; if (data->flags & MMC_DATA_READ) bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); else { - memcpy(slot->dmamem, data->data, - (data->len < DMA_BLOCK_SIZE) ? - data->len : DMA_BLOCK_SIZE); + memcpy(slot->dmamem, data->data, ulmin(data->len, + sdma_bbufsz)); bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } WR4(slot, SDHCI_DMA_ADDRESS, slot->paddr); - /* Interrupt aggregation: Mask border interrupt - * for the last page and unmask else. */ - if (data->len == DMA_BLOCK_SIZE) + /* + * Interrupt aggregation: Mask border interrupt for the last + * bounce buffer and unmask otherwise. + */ + if (data->len == sdma_bbufsz) slot->intmask &= ~SDHCI_INT_DMA_END; else slot->intmask |= SDHCI_INT_DMA_END; @@ -1835,16 +1888,15 @@ sdhci_start_data(struct sdhci_slot *slot, struct mmc_d } /* Current data offset for both PIO and DMA. */ slot->offset = 0; - /* Set block size and request IRQ on 4K border. */ - WR2(slot, SDHCI_BLOCK_SIZE, SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, - (data->len < 512) ? data->len : 512)); + /* Set block size and request border interrupts on the SDMA boundary. */ + blksz = SDHCI_MAKE_BLKSZ(slot->sdma_boundary, ulmin(data->len, 512)); + WR2(slot, SDHCI_BLOCK_SIZE, blksz); /* Set block count. */ - WR2(slot, SDHCI_BLOCK_COUNT, (data->len + 511) / 512); - + blkcnt = howmany(data->len, 512); + WR2(slot, SDHCI_BLOCK_COUNT, blkcnt); if (__predict_false(sdhci_debug > 1)) - slot_printf(slot, "Block size: %02x, count %lu\n", - (unsigned int)SDHCI_MAKE_BLKSZ(DMA_BOUNDARY, (data->len < 512) ? data->len : 512), - (unsigned long)(data->len + 511) / 512); + slot_printf(slot, "Blk size: 0x%08x | Blk cnt: 0x%08x\n", + blksz, blkcnt); } void @@ -1868,7 +1920,7 @@ sdhci_finish_data(struct sdhci_slot *slot) bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); + ulmin(left, slot->sdma_bbufsz)); } else bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); @@ -1892,15 +1944,14 @@ sdhci_finish_data(struct sdhci_slot *slot) static void sdhci_start(struct sdhci_slot *slot) { - union ccb *ccb; + union ccb *ccb; + struct ccb_mmcio *mmcio; ccb = slot->ccb; if (ccb == NULL) return; - struct ccb_mmcio *mmcio; mmcio = &ccb->mmcio; - if (!(slot->flags & CMD_STARTED)) { slot->flags |= CMD_STARTED; sdhci_start_command(slot, &mmcio->cmd); @@ -1932,7 +1983,7 @@ sdhci_start(struct sdhci_slot *slot) static void sdhci_start(struct sdhci_slot *slot) { - struct mmc_request *req; + const struct mmc_request *req; req = slot->req; if (req == NULL) @@ -2061,6 +2112,7 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma { struct mmc_data *data; size_t left; + uint32_t sdma_bbufsz; if (!slot->curcmd) { slot_printf(slot, "Got data interrupt 0x%08x, but " @@ -2115,6 +2167,7 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma /* Handle DMA border. */ if (intmask & SDHCI_INT_DMA_END) { data = slot->curcmd->data; + sdma_bbufsz = slot->sdma_bbufsz; /* Unload DMA buffer ... */ left = data->len - slot->offset; @@ -2122,26 +2175,28 @@ sdhci_data_irq(struct sdhci_slot *slot, uint32_t intma bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTREAD); memcpy((u_char*)data->data + slot->offset, slot->dmamem, - (left < DMA_BLOCK_SIZE) ? left : DMA_BLOCK_SIZE); + ulmin(left, sdma_bbufsz)); } else { bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_POSTWRITE); } /* ... and reload it again. */ - slot->offset += DMA_BLOCK_SIZE; + slot->offset += sdma_bbufsz; left = data->len - slot->offset; if (data->flags & MMC_DATA_READ) { bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREREAD); } else { memcpy(slot->dmamem, (u_char*)data->data + slot->offset, - (left < DMA_BLOCK_SIZE)? left : DMA_BLOCK_SIZE); + ulmin(left, sdma_bbufsz)); bus_dmamap_sync(slot->dmatag, slot->dmamap, BUS_DMASYNC_PREWRITE); } - /* Interrupt aggregation: Mask border interrupt - * for the last page. */ - if (left == DMA_BLOCK_SIZE) { + /* + * Interrupt aggregation: Mask border interrupt for the last + * bounce buffer. + */ + if (left == sdma_bbufsz) { slot->intmask &= ~SDHCI_INT_DMA_END; WR4(slot, SDHCI_SIGNAL_ENABLE, slot->intmask); } @@ -2264,7 +2319,7 @@ int sdhci_generic_read_ivar(device_t bus, device_t child, int which, uintptr_t *result) { - struct sdhci_slot *slot = device_get_ivars(child); + const struct sdhci_slot *slot = device_get_ivars(child); switch (which) { default: @@ -2427,6 +2482,7 @@ sdhci_generic_write_ivar(device_t bus, device_t child, void sdhci_start_slot(struct sdhci_slot *slot) { + if ((slot->devq = cam_simq_alloc(1)) == NULL) { goto fail; } @@ -2586,7 +2642,8 @@ sdhci_cam_poll(struct cam_sim *sim) } static int -sdhci_cam_get_possible_host_clock(struct sdhci_slot *slot, int proposed_clock) +sdhci_cam_get_possible_host_clock(const struct sdhci_slot *slot, + int proposed_clock) { int max_clock, clock, i; @@ -2613,15 +2670,14 @@ sdhci_cam_get_possible_host_clock(struct sdhci_slot *s return clock; } -int +static int sdhci_cam_settran_settings(struct sdhci_slot *slot, union ccb *ccb) { struct mmc_ios *ios; - struct mmc_ios *new_ios; - struct ccb_trans_settings_mmc *cts; + const struct mmc_ios *new_ios; + const struct ccb_trans_settings_mmc *cts; ios = &slot->host.ios; - cts = &ccb->cts.proto_specific.mmc; new_ios = &cts->ios; @@ -2659,7 +2715,7 @@ sdhci_cam_settran_settings(struct sdhci_slot *slot, un return (sdhci_cam_update_ios(slot)); } -int +static int sdhci_cam_update_ios(struct sdhci_slot *slot) { struct mmc_ios *ios = &slot->host.ios; @@ -2701,10 +2757,10 @@ sdhci_cam_update_ios(struct sdhci_slot *slot) return (0); } -int +static int sdhci_cam_request(struct sdhci_slot *slot, union ccb *ccb) { - struct ccb_mmcio *mmcio; + const struct ccb_mmcio *mmcio; mmcio = &ccb->mmcio; @@ -2739,4 +2795,4 @@ sdhci_cam_request(struct sdhci_slot *slot, union ccb * } #endif /* MMCCAM */ -MODULE_VERSION(sdhci, 1); +MODULE_VERSION(sdhci, SDHCI_VERSION); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci.h Sun Dec 30 23:08:06 2018 (r342634) @@ -32,8 +32,8 @@ #include "opt_mmccam.h" -#define DMA_BLOCK_SIZE 4096 -#define DMA_BOUNDARY 0 /* DMA reload every 4K */ +/* Macro for sizing the SDMA bounce buffer on the SDMA buffer boundary. */ +#define SDHCI_SDMA_BNDRY_TO_BBUFSZ(bndry) (4096 * (1 << bndry)) /* Controller doesn't honor resets unless we touch the clock register */ #define SDHCI_QUIRK_CLOCK_BEFORE_RESET (1 << 0) @@ -95,6 +95,8 @@ #define SDHCI_QUIRK_BROKEN_AUTO_STOP (1 << 28) /* Controller supports eMMC HS400 mode if SDHCI_CAN_SDR104 is set. */ #define SDHCI_QUIRK_MMC_HS400_IF_CAN_SDR104 (1 << 29) +/* SDMA boundary in SDHCI_BLOCK_SIZE broken - use front-end supplied value. */ +#define SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY (1 << 30) /* * Controller registers @@ -102,6 +104,14 @@ #define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_BLOCK_SIZE 0x04 +#define SDHCI_BLKSZ_SDMA_BNDRY_4K 0x00 +#define SDHCI_BLKSZ_SDMA_BNDRY_8K 0x01 +#define SDHCI_BLKSZ_SDMA_BNDRY_16K 0x02 +#define SDHCI_BLKSZ_SDMA_BNDRY_32K 0x03 +#define SDHCI_BLKSZ_SDMA_BNDRY_64K 0x04 +#define SDHCI_BLKSZ_SDMA_BNDRY_128K 0x05 +#define SDHCI_BLKSZ_SDMA_BNDRY_256K 0x06 +#define SDHCI_BLKSZ_SDMA_BNDRY_512K 0x07 #define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF)) #define SDHCI_BLOCK_COUNT 0x06 @@ -362,6 +372,8 @@ struct sdhci_slot { bus_dmamap_t dmamap; u_char *dmamem; bus_addr_t paddr; /* DMA buffer address */ + uint32_t sdma_bbufsz; /* SDMA bounce buffer size */ + uint8_t sdma_boundary; /* SDMA boundary */ struct task card_task; /* Card presence check task */ struct timeout_task card_delayed_task;/* Card insert delayed task */ @@ -433,5 +445,10 @@ uint32_t sdhci_generic_min_freq(device_t brdev, struct bool sdhci_generic_get_card_present(device_t brdev, struct sdhci_slot *slot); void sdhci_generic_set_uhs_timing(device_t brdev, struct sdhci_slot *slot); void sdhci_handle_card_present(struct sdhci_slot *slot, bool is_present); + +#define SDHCI_VERSION 2 + +#define SDHCI_DEPEND(name) \ + MODULE_DEPEND(name, sdhci, SDHCI_VERSION, SDHCI_VERSION, SDHCI_VERSION); #endif /* __SDHCI_H__ */ Modified: head/sys/dev/sdhci/sdhci_acpi.c ============================================================================== --- head/sys/dev/sdhci/sdhci_acpi.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_acpi.c Sun Dec 30 23:08:06 2018 (r342634) @@ -457,7 +457,7 @@ static devclass_t sdhci_acpi_devclass; DRIVER_MODULE(sdhci_acpi, acpi, sdhci_acpi_driver, sdhci_acpi_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_acpi, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_acpi); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_acpi); Modified: head/sys/dev/sdhci/sdhci_fdt.c ============================================================================== --- head/sys/dev/sdhci/sdhci_fdt.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_fdt.c Sun Dec 30 23:08:06 2018 (r342634) @@ -80,6 +80,7 @@ struct sdhci_fdt_softc { u_int quirks; /* Chip specific quirks */ u_int caps; /* If we override SDHCI_CAPABILITIES */ uint32_t max_clk; /* Max possible freq */ + uint8_t sdma_boundary; /* If we override the SDMA boundary */ struct resource *irq_res; /* IRQ resource */ void *intrhand; /* Interrupt handle */ @@ -206,7 +207,9 @@ sdhci_fdt_probe(device_t dev) device_set_desc(dev, "generic fdt SDHCI controller"); break; case SDHCI_FDT_QUALCOMM: - sc->quirks = SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE; + sc->quirks = SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE | + SDHCI_QUIRK_BROKEN_SDMA_BOUNDARY; + sc->sdma_boundary = SDHCI_BLKSZ_SDMA_BNDRY_4K; device_set_desc(dev, "Qualcomm FDT SDHCI controller"); break; case SDHCI_FDT_XLNX_ZY7: @@ -271,6 +274,7 @@ sdhci_fdt_attach(device_t dev) slot->quirks = sc->quirks; slot->caps = sc->caps; slot->max_clk = sc->max_clk; + slot->sdma_boundary = sc->sdma_boundary; if (sdhci_init_slot(dev, slot, i) != 0) continue; @@ -353,7 +357,7 @@ static devclass_t sdhci_fdt_devclass; DRIVER_MODULE(sdhci_fdt, simplebus, sdhci_fdt_driver, sdhci_fdt_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_fdt, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_fdt); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_fdt); #endif Modified: head/sys/dev/sdhci/sdhci_pci.c ============================================================================== --- head/sys/dev/sdhci/sdhci_pci.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_pci.c Sun Dec 30 23:08:06 2018 (r342634) @@ -526,7 +526,7 @@ static devclass_t sdhci_pci_devclass; DRIVER_MODULE(sdhci_pci, pci, sdhci_pci_driver, sdhci_pci_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_pci, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_pci); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_pci); Modified: head/sys/dev/sdhci/sdhci_xenon.c ============================================================================== --- head/sys/dev/sdhci/sdhci_xenon.c Sun Dec 30 23:04:02 2018 (r342633) +++ head/sys/dev/sdhci/sdhci_xenon.c Sun Dec 30 23:08:06 2018 (r342634) @@ -550,7 +550,7 @@ static devclass_t sdhci_xenon_devclass; DRIVER_MODULE(sdhci_xenon, simplebus, sdhci_xenon_driver, sdhci_xenon_devclass, NULL, NULL); -MODULE_DEPEND(sdhci_xenon, sdhci, 1, 1, 1); +SDHCI_DEPEND(sdhci_xenon); #ifndef MMCCAM MMC_DECLARE_BRIDGE(sdhci_xenon); #endif From owner-svn-src-head@freebsd.org Mon Dec 31 03:08:01 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DFF67141E4B1; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8806E8360F; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7202048CC; Mon, 31 Dec 2018 03:08:01 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV381rC013160; Mon, 31 Dec 2018 03:08:01 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV381ep013159; Mon, 31 Dec 2018 03:08:01 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201812310308.wBV381ep013159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 31 Dec 2018 03:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342640 - head/lib/libutil X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libutil X-SVN-Commit-Revision: 342640 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8806E8360F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 03:08:02 -0000 Author: delphij Date: Mon Dec 31 03:08:01 2018 New Revision: 342640 URL: https://svnweb.freebsd.org/changeset/base/342640 Log: Ensure buffer is nul-terminated. MFC after: 2 weeks Modified: head/lib/libutil/quotafile.c Modified: head/lib/libutil/quotafile.c ============================================================================== --- head/lib/libutil/quotafile.c Mon Dec 31 01:09:23 2018 (r342639) +++ head/lib/libutil/quotafile.c Mon Dec 31 03:08:01 2018 (r342640) @@ -103,7 +103,7 @@ hasquota(struct fstab *fs, int type, char *qfnamep, in return (0); } if (cp) { - strncpy(qfnamep, cp, qfbufsize); + strlcpy(qfnamep, cp, qfbufsize); } else { (void)snprintf(qfnamep, qfbufsize, "%s/%s.%s", fs->fs_file, QUOTAFILENAME, qfextension[type]); From owner-svn-src-head@freebsd.org Mon Dec 31 00:09:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4152A143A7D4; Mon, 31 Dec 2018 00:09:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D61927429D; Mon, 31 Dec 2018 00:09:45 +0000 (UTC) (envelope-from bcran@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C43C9275E; Mon, 31 Dec 2018 00:09:45 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV09jU8017570; Mon, 31 Dec 2018 00:09:45 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV09jZO017569; Mon, 31 Dec 2018 00:09:45 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310009.wBV09jZO017569@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:09:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342635 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342635 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D61927429D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 00:09:46 -0000 Author: bcran Date: Mon Dec 31 00:09:45 2018 New Revision: 342635 URL: https://svnweb.freebsd.org/changeset/base/342635 Log: Change the way efibootmgr works by specifying bootnum via -b parameter Instead of passing the bootnum to each different parameter, require users to specify -b when running operations that need a bootnum. This allows activation of a new boot entry at the same time it's created by adding -a onto the command line. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18648 Modified: head/usr.sbin/efibootmgr/efibootmgr.c Modified: head/usr.sbin/efibootmgr/efibootmgr.c ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.c Sun Dec 30 23:08:06 2018 (r342634) +++ head/usr.sbin/efibootmgr/efibootmgr.c Mon Dec 31 00:09:45 2018 (r342635) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Netflix, Inc. + * Copyright (c) 2017-2018 Netflix, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -94,16 +94,16 @@ typedef struct _bmgr_opts { } bmgr_opts_t; static struct option lopts[] = { - {"activate", required_argument, NULL, 'a'}, - {"bootnext", required_argument, NULL, 'n'}, /* set bootnext */ + {"activate", no_argument, NULL, 'a'}, + {"bootnext", no_argument, NULL, 'n'}, /* set bootnext */ {"bootnum", required_argument, NULL, 'b'}, {"bootorder", required_argument, NULL, 'o'}, /* set order */ {"copy", required_argument, NULL, 'C'}, /* Copy boot method */ {"create", no_argument, NULL, 'c'}, - {"deactivate", required_argument, NULL, 'A'}, + {"deactivate", no_argument, NULL, 'A'}, {"del-timout", no_argument, NULL, 'T'}, - {"delete", required_argument, NULL, 'B'}, - {"delete-bootnext", required_argument, NULL, 'N'}, + {"delete", no_argument, NULL, 'B'}, + {"delete-bootnext", no_argument, NULL, 'N'}, {"dry-run", no_argument, NULL, 'D'}, {"env", required_argument, NULL, 'e'}, {"help", no_argument, NULL, 'h'}, @@ -171,37 +171,35 @@ set_bootvar(const char *name, uint8_t *data, size_t si #define USAGE \ - " [-aAnNB Bootvar] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help] \n\ - [-c -l loader [-k kernel ] [-L label] [--dry-run] [-b Bootvar]]" + " [-aAnB -b bootnum] [-N] [-t timeout] [-T] [-o bootorder] [-O] [--verbose] [--help]\n\ + [-c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum]]" #define CREATE_USAGE \ - " efibootmgr -c -l loader [-k kernel] [-L label] [--dry-run]" + " efibootmgr -c -l loader [-k kernel] [-L label] [--dry-run] [-b bootnum] [-a]" #define ORDER_USAGE \ " efibootmgr -o bootvarnum1,bootvarnum2,..." #define TIMEOUT_USAGE \ " efibootmgr -t seconds" #define DELETE_USAGE \ - " efibootmgr -B bootvarnum" + " efibootmgr -B -b bootnum" #define ACTIVE_USAGE \ - " efibootmgr [-a | -A] bootvarnum" + " efibootmgr [-a | -A] -b bootnum" #define BOOTNEXT_USAGE \ - " efibootmgr [-n | -N] bootvarnum" + " efibootmgr [-n | -N] -b bootnum" static void parse_args(int argc, char *argv[]) { int ch; - while ((ch = getopt_long(argc, argv, "A:a:B:b:C:cDe:hk:L:l:Nn:Oo:Tt:v", + while ((ch = getopt_long(argc, argv, "AaBb:C:cDe:hk:L:l:NnOo:Tt:v", lopts, NULL)) != -1) { switch (ch) { case 'A': opts.set_inactive = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'a': opts.set_active = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'b': opts.has_bootnum = true; @@ -209,7 +207,6 @@ parse_args(int argc, char *argv[]) break; case 'B': opts.delete = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'C': opts.copy = true; @@ -246,7 +243,6 @@ parse_args(int argc, char *argv[]) break; case 'n': opts.set_bootnext = true; - opts.bootnum = strtoul(optarg, NULL, 16); break; case 'O': opts.once = true; @@ -275,6 +271,15 @@ parse_args(int argc, char *argv[]) if (opts.order && !(opts.order)) errx(1, "%s", ORDER_USAGE); + + if ((opts.set_inactive || opts.set_active) && !opts.has_bootnum) + errx(1, "%s", ACTIVE_USAGE); + + if (opts.delete && !opts.has_bootnum) + errx(1, "%s", DELETE_USAGE); + + if (opts.set_bootnext && !opts.has_bootnum) + errx(1, "%s", BOOTNEXT_USAGE); } From owner-svn-src-head@freebsd.org Mon Dec 31 00:15:06 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE1BE143AA53; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 86F3A74779; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A1692935; Mon, 31 Dec 2018 00:15:05 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0F5Bp023243; Mon, 31 Dec 2018 00:15:05 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0F5Y6023242; Mon, 31 Dec 2018 00:15:05 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310015.wBV0F5Y6023242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342636 - head X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 342636 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 86F3A74779 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 00:15:06 -0000 Author: bcran Date: Mon Dec 31 00:15:05 2018 New Revision: 342636 URL: https://svnweb.freebsd.org/changeset/base/342636 Log: Add UPDATING entry for r342635. Sponsored by: Netflix Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Mon Dec 31 00:09:45 2018 (r342635) +++ head/UPDATING Mon Dec 31 00:15:05 2018 (r342636) @@ -31,6 +31,12 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 13.x IS SLOW: disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20181230: + r342635 changes the way efibootmgr(8) works by requiring users to add + the -b (bootnum) parameter for commands where the bootnum was previously + specified with each option. For example 'efibootmgr -B 0001' is now + 'efibootmgr -B -b 0001'. + 20181220: r342286 modifies the NFSv4 server so that it obeys vfs.nfsd.nfs_privport in the same as it is applied to NFSv2 and 3. This implies that NFSv4 From owner-svn-src-head@freebsd.org Mon Dec 31 00:26:36 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE236143B291; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65C5874EC9; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5806A2AEE; Mon, 31 Dec 2018 00:26:36 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0Qato028647; Mon, 31 Dec 2018 00:26:36 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0QahE028646; Mon, 31 Dec 2018 00:26:36 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310026.wBV0QahE028646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:26:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342638 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 342638 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 65C5874EC9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 00:26:36 -0000 Author: bcran Date: Mon Dec 31 00:26:35 2018 New Revision: 342638 URL: https://svnweb.freebsd.org/changeset/base/342638 Log: Use the --activate efibootmgr(8) flag when creating entries in bootconfig Sponsored by: Netflix Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:20:58 2018 (r342637) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:26:35 2018 (r342638) @@ -143,18 +143,12 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi echo "Creating UEFI boot entry" - efibootmgr --create --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + efibootmgr --create --activate --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null echo "Unmounting ESP" umount "${mntpt}" rmdir "${mntpt}" - # When creating new entries, efibootmgr doesn't mark them active, so we need to - # do so. It doesn't make it easy to find which entry it just added, so rely on - # the fact that it places the new entry first in BootOrder. - bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) - bootentry=$(echo "$bootorder" | cut -w -f 3)$(echo "$bootorder" | cut -w -f 2) - efibootmgr --activate "$bootentry" > /dev/null echo "Finished configuring /dev/${esp} as ESP" done fi From owner-svn-src-head@freebsd.org Sun Dec 30 19:44:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A8A11433393; Sun, 30 Dec 2018 19:44:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CB286B94D; Sun, 30 Dec 2018 19:44:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1A7AA27A87; Sun, 30 Dec 2018 19:44:51 +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 wBUJioUl077030; Sun, 30 Dec 2018 19:44:50 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBUJioTd077028; Sun, 30 Dec 2018 19:44:50 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812301944.wBUJioTd077028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sun, 30 Dec 2018 19:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342632 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 342632 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CB286B94D X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 30 Dec 2018 19:44:51 -0000 Author: pfg Date: Sun Dec 30 19:44:50 2018 New Revision: 342632 URL: https://svnweb.freebsd.org/changeset/base/342632 Log: ext2fs.5: Update the manpage. General update of the driver description and mention some important credits. Add a symlink for ext4fs as it is of special interest nowadays. Fic some `mandoc -Tlint` issues while here. MFC after: 15 days Differential Revision: https://reviews.freebsd.org/D18445 Modified: head/share/man/man5/Makefile head/share/man/man5/ext2fs.5 Modified: head/share/man/man5/Makefile ============================================================================== --- head/share/man/man5/Makefile Sun Dec 30 16:39:26 2018 (r342631) +++ head/share/man/man5/Makefile Sun Dec 30 19:44:50 2018 (r342632) @@ -71,6 +71,7 @@ MAN= acct.5 \ tmpfs.5 MLINKS= dir.5 dirent.5 +MLINKS+=ext2fs.5 ext4fs.5 MLINKS+=fs.5 inode.5 MLINKS+=hosts.equiv.5 rhosts.5 MLINKS+=msdosfs.5 msdos.5 Modified: head/share/man/man5/ext2fs.5 ============================================================================== --- head/share/man/man5/ext2fs.5 Sun Dec 30 16:39:26 2018 (r342631) +++ head/share/man/man5/ext2fs.5 Sun Dec 30 19:44:50 2018 (r342632) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 4, 2018 +.Dd December 30, 2018 .Dt EXT2FS 5 .Os .Sh NAME @@ -47,13 +47,15 @@ The driver will permit the .Fx kernel to access -.Tn ext2 , -.Tn ext3 , +ext2 +file systems and its derivatives. +It currently implements most of the features required by +.Em ext3 and -.Tn ext4 +.Em ext4 file systems. Support for Extended Attributes in -.Tn ext4 +.Em ext4 is experimental. Journalling and encryption are currently not supported. .Sh EXAMPLES @@ -77,14 +79,28 @@ driver first appeared in .An -nosplit The .Nm -kernel implementation was written by +kernel implementation is derived from code written, +or modified, +by .An Godmar Back -or modified by him using the CSRG sources. +using the UFS CSRG sources for CMU Mach. .Pp .An John Dyson -and others in the +did the initial port to +.Fx . +.An Aditya Sarawgi +merged important parts of the allocation code from a clean-room +.Nx +implementation. +.An Zheng Liu +and +.An Fedor Upurov +implemented the read and write support respectively for +.Em ext4 +filesystems. +The .Fx -Project made modifications. +community has contributed a huge amount of modifications. .Pp -This manual page was written by +The initial version of this manual page was written by .An Craig Rodrigues Aq Mt rodrigc@FreeBSD.org . From owner-svn-src-head@freebsd.org Mon Dec 31 01:09:24 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36BEF143C7DD; Mon, 31 Dec 2018 01:09:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 860AD765D6; Mon, 31 Dec 2018 01:09:23 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 76FFE31C8; Mon, 31 Dec 2018 01:09:23 +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 wBV19NVd049647; Mon, 31 Dec 2018 01:09:23 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV19N7s049646; Mon, 31 Dec 2018 01:09:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201812310109.wBV19N7s049646@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Dec 2018 01:09:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342639 - head/sys/dev/vt X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dev/vt X-SVN-Commit-Revision: 342639 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 860AD765D6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.954,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 01:09:24 -0000 Author: ian Date: Mon Dec 31 01:09:23 2018 New Revision: 342639 URL: https://svnweb.freebsd.org/changeset/base/342639 Log: When allocating a new keyboard at vt_upgrade() time, unwind any cngrabs done on the old keyboard and then do the corresponding number of grabs on the new keyboard. This fixes a race that can leave the system with a non-functioning keyboard. It goes like this... - The bios claims there is an AT keyboard, atkbd attaches. - SI_SUB_INT_CONFIG_HOOKS runs. - USB probes devices. Devices begin attaching, including disks. - GELI prompts for a password for a just-attached disk, which results in a cngrab() while atkbd is the keyboard. - A USB keyboard attaches. - vt_upgrade() runs and switches the keyboard to the new USB keyboard, but because cngrab was never called for it, it's not activated and keystrokes are ignored. - Now there is no functional keyboard and no way to get one; even plugging in a different USB keyboard doesn't help, because the console is still grabbed, still waiting for a GELI pw. Discussed with: ray@ Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Mon Dec 31 00:26:35 2018 (r342638) +++ head/sys/dev/vt/vt_core.c Mon Dec 31 01:09:23 2018 (r342639) @@ -977,10 +977,22 @@ vt_kbdevent(keyboard_t *kbd, int event, void *arg) static int vt_allocate_keyboard(struct vt_device *vd) { - int idx0, idx; + int grabbed, i, idx0, idx; keyboard_t *k0, *k; keyboard_info_t ki; + /* + * If vt_upgrade() happens while the console is grabbed, we are + * potentially going to switch keyboard devices while the keyboard is in + * use. Unwind the grabbing of the current keyboard first, then we will + * re-grab the new keyboard below, before we return. + */ + if (vd->vd_curwindow == &vt_conswindow) { + grabbed = vd->vd_curwindow->vw_grabbed; + for (i = 0; i < grabbed; ++i) + vtterm_cnungrab(vd->vd_curwindow->vw_terminal); + } + idx0 = kbd_allocate("kbdmux", -1, vd, vt_kbdevent, vd); if (idx0 >= 0) { DPRINTF(20, "%s: kbdmux allocated, idx = %d\n", __func__, idx0); @@ -1011,6 +1023,11 @@ vt_allocate_keyboard(struct vt_device *vd) } vd->vd_keyboard = idx0; DPRINTF(20, "%s: vd_keyboard = %d\n", __func__, vd->vd_keyboard); + + if (vd->vd_curwindow == &vt_conswindow) { + for (i = 0; i < grabbed; ++i) + vtterm_cngrab(vd->vd_curwindow->vw_terminal); + } return (idx0); } From owner-svn-src-head@freebsd.org Mon Dec 31 00:20:59 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05307143ADBB; Mon, 31 Dec 2018 00:20:59 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AAB274A2B; Mon, 31 Dec 2018 00:20:58 +0000 (UTC) (envelope-from bcran@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88AD12967; Mon, 31 Dec 2018 00:20:58 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV0Kwfl024309; Mon, 31 Dec 2018 00:20:58 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV0Kwbo024308; Mon, 31 Dec 2018 00:20:58 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201812310020.wBV0Kwbo024308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Mon, 31 Dec 2018 00:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342637 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 342637 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9AAB274A2B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 00:20:59 -0000 Author: bcran Date: Mon Dec 31 00:20:58 2018 New Revision: 342637 URL: https://svnweb.freebsd.org/changeset/base/342637 Log: Fix ESP generation when using a gmirror, and when booting from RO medium When using a gmirror, entries in /dev can be removed. So instead of using kern.disks, get the list of disks from "gpart status -sg" instead. We assume that any 'efi' partition that can't be mounted as msdosfs should be used as an ESP. However, the ESP on the CD/DVD can't be mounted read-write and so was being treated as if unformatted. Try the mount as read-only instead, to catch cases like this. Relnotes: yes Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18645 Modified: head/usr.sbin/bsdinstall/scripts/bootconfig Modified: head/usr.sbin/bsdinstall/scripts/bootconfig ============================================================================== --- head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:15:05 2018 (r342636) +++ head/usr.sbin/bsdinstall/scripts/bootconfig Mon Dec 31 00:20:58 2018 (r342637) @@ -84,10 +84,11 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" # The installer hasn't given us any ESPs to use. # Try and figure out which to use by looking for an # unformatted efi partition - for disk in $(sysctl -n kern.disks); do - hasfreebsd=$(gpart show "$disk" | cut -w -f 4,5 | grep "freebsd") + + for geom in $(gpart status -sg | awk '{print $1}'); do + hasfreebsd=$(gpart show "${geom}" | cut -w -f 4,5 | grep "freebsd") if [ -n "$hasfreebsd" ]; then - index=$(gpart show "$disk" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) + index=$(gpart show "${geom}" | cut -w -f 4,5 | grep "efi" | cut -w -f 1) # Check that $index is a valid integer [ -n "$index" ] && [ "$index" -eq "$index" ] && [ "$index" -ge 0 ] 2> /dev/null if [ $? -ne 0 ]; then @@ -95,17 +96,17 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) - if [ -e "/dev/${disk}p${index}" ]; then - dev=${disk}p${index} - elif [ -e "/dev/${disk}s${index}" ]; then - dev=/${disk}s${index} + if [ -e "/dev/${geom}p${index}" ]; then + dev=${geom}p${index} + elif [ -e "/dev/${geom}s${index}" ]; then + dev=/${geom}s${index} else continue fi # Try and mount it. If it fails, assume it's # unformatted and should be used. - mount -t msdosfs "/dev/${dev}" "${mntpt}" + mount -t msdosfs -o ro "/dev/${dev}" "${mntpt}" if [ $? -ne 0 ]; then ESPS="$ESPS ${dev}" num_esps=$((num_esps + 1)) @@ -118,17 +119,20 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" fi for esp in $ESPS; do + echo "Formatting /dev/${esp} as FAT32" newfs_msdos -F 32 -c 1 -L EFISYS "/dev/$esp" > /dev/null 2>&1 if [ $? -ne 0 ]; then die "Failed to format ESP $esp as FAT32" fi mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + echo "Mounting ESP /dev/${esp}" mount -t msdosfs "/dev/${esp}" "${mntpt}" if [ $? -ne 0 ]; then die "Failed to mount ESP ${dev} on ${mntpt}" fi + echo "Installing loader.efi onto ESP" mkdir -p "$mntpt/EFI/freebsd" cp "$BSDINSTALL_CHROOT/boot/loader.efi" "${mntpt}/EFI/freebsd/loader.efi" @@ -138,8 +142,10 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" bootlabel="FreeBSD" fi + echo "Creating UEFI boot entry" efibootmgr --create --label "$bootlabel" --loader "${mntpt}/EFI/freebsd/loader.efi" > /dev/null + echo "Unmounting ESP" umount "${mntpt}" rmdir "${mntpt}" @@ -149,6 +155,7 @@ if [ "$(uname -m)" = "arm64" ] || [ "$X86_BOOTMETHOD" bootorder=$(efivar --name 8be4df61-93ca-11d2-aa0d-00e098032b8c-BootOrder --print --no-name --hex | head -1) bootentry=$(echo "$bootorder" | cut -w -f 3)$(echo "$bootorder" | cut -w -f 2) efibootmgr --activate "$bootentry" > /dev/null + echo "Finished configuring /dev/${esp} as ESP" done fi From owner-svn-src-head@freebsd.org Mon Dec 31 07:57:39 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F02D142A7F4; Mon, 31 Dec 2018 07:57:39 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93518EA50; Mon, 31 Dec 2018 07:57:38 +0000 (UTC) (envelope-from philip@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 829357A1F; Mon, 31 Dec 2018 07:57:38 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBV7vckF066178; Mon, 31 Dec 2018 07:57:38 GMT (envelope-from philip@FreeBSD.org) Received: (from philip@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBV7vbVw066175; Mon, 31 Dec 2018 07:57:37 GMT (envelope-from philip@FreeBSD.org) Message-Id: <201812310757.wBV7vbVw066175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: philip set sender to philip@FreeBSD.org using -f From: Philip Paeps Date: Mon, 31 Dec 2018 07:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342644 - head/contrib/tzdata X-SVN-Group: head X-SVN-Commit-Author: philip X-SVN-Commit-Paths: head/contrib/tzdata X-SVN-Commit-Revision: 342644 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A93518EA50 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.957,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 07:57:39 -0000 Author: philip Date: Mon Dec 31 07:57:37 2018 New Revision: 342644 URL: https://svnweb.freebsd.org/changeset/base/342644 Log: Import tzdata 2018i Changes: https://github.com/eggert/tz/blob/2018i/NEWS MFC after: 2 days Modified: head/contrib/tzdata/NEWS head/contrib/tzdata/africa head/contrib/tzdata/version Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/NEWS ============================================================================== --- head/contrib/tzdata/NEWS Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/NEWS Mon Dec 31 07:57:37 2018 (r342644) @@ -1,5 +1,17 @@ News for the tz database +Release 2018i - 2018-12-30 11:05:43 -0800 + + Briefly: + São Tomé and Príncipe switches from +01 to +00 on 2019-01-01. + + Changes to future timestamps + + Due to a change in government, São Tomé and Príncipe switches back + from +01 to +00 on 2019-01-01 at 02:00. (Thanks to Vadim + Nasardinov and Michael Deckers.) + + Release 2018h - 2018-12-23 17:59:32 -0800 Briefly: Modified: head/contrib/tzdata/africa ============================================================================== --- head/contrib/tzdata/africa Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/africa Mon Dec 31 07:57:37 2018 (r342644) @@ -1144,10 +1144,20 @@ Zone Indian/Reunion 3:41:52 - LMT 1911 Jun # Saint-Den # the switch is from 01:00 to 02:00 ... [Decree No. 25/2017] # http://www.mnec.gov.st/index.php/publicacoes/documentos/file/90-decreto-lei-n-25-2017 +# From Vadim Nasardinov (2018-12-29): +# São Tomé and Príncipe is about to do the following on Jan 1, 2019: +# https://www.stp-press.st/2018/12/05/governo-jesus-ja-decidiu-repor-hora-legal-sao-tomense/ +# +# From Michael Deckers (2018-12-30): +# https://www.legis-palop.org/download.jsp?idFile=102818 +# ... [The legal time of the country, which coincides with universal +# coordinated time, will be restituted at 2 o'clock on day 1 of January, 2019.] + Zone Africa/Sao_Tome 0:26:56 - LMT 1884 -0:36:45 - LMT 1912 Jan 1 00:00u # Lisbon MT 0:00 - GMT 2018 Jan 1 01:00 - 1:00 - WAT + 1:00 - WAT 2019 Jan 1 02:00 + 0:00 - GMT # Senegal # See Africa/Abidjan. Modified: head/contrib/tzdata/version ============================================================================== --- head/contrib/tzdata/version Mon Dec 31 07:55:48 2018 (r342643) +++ head/contrib/tzdata/version Mon Dec 31 07:57:37 2018 (r342644) @@ -1 +1 @@ -2018h +2018i From owner-svn-src-head@freebsd.org Mon Dec 31 10:17:43 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BF6142E30B; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68EAC92E84; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A7689188; Mon, 31 Dec 2018 10:17:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVAHhCL039292; Mon, 31 Dec 2018 10:17:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVAHhRo039291; Mon, 31 Dec 2018 10:17:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201812311017.wBVAHhRo039291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 31 Dec 2018 10:17:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342645 - head/share/skel X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/skel X-SVN-Commit-Revision: 342645 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 68EAC92E84 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 10:17:43 -0000 Author: trasz Date: Mon Dec 31 10:17:42 2018 New Revision: 342645 URL: https://svnweb.freebsd.org/changeset/base/342645 Log: Add current working directory to the default (although commented out) sh(1) prompt, so it looks just like the tcsh(1) one when you uncomment it. Reviewed by: jilles MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D18673 Modified: head/share/skel/dot.shrc Modified: head/share/skel/dot.shrc ============================================================================== --- head/share/skel/dot.shrc Mon Dec 31 07:57:37 2018 (r342644) +++ head/share/skel/dot.shrc Mon Dec 31 10:17:42 2018 (r342645) @@ -32,8 +32,8 @@ alias g='egrep -i' # alias rm='rm -i' -# # set prompt: ``username@hostname$ '' -# PS1="`whoami`@\h\\$ " +# # set prompt: ``username@hostname:directory $ '' +# PS1="`whoami`@\h:\w \\$ " # search path for cd(1) # CDPATH=:$HOME From owner-svn-src-head@freebsd.org Mon Dec 31 11:18:00 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EA6142FA56; Mon, 31 Dec 2018 11:18:00 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A2C9A94D27; Mon, 31 Dec 2018 11:17:59 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84FDE9B93; Mon, 31 Dec 2018 11:17:59 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVBHxI8071851; Mon, 31 Dec 2018 11:17:59 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVBHwGO071847; Mon, 31 Dec 2018 11:17:58 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311117.wBVBHwGO071847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 11:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342649 - in head: etc/mtree tests/sys tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: in head: etc/mtree tests/sys tests/sys/netmap X-SVN-Commit-Revision: 342649 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A2C9A94D27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.983,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 11:18:01 -0000 Author: vmaffione Date: Mon Dec 31 11:17:58 2018 New Revision: 342649 URL: https://svnweb.freebsd.org/changeset/base/342649 Log: netmap: add suite of unit tests Import the unit tests from upstream (https://github.com/luigirizzo/netmap ba02539859d46d33), and make them ready for use with Kyua. There are currently 38 regression tests, which test the kernel control ABI exposed by netmap to userspace applications: 1: test for port info get 2-5: tests for basic port registration 6-9: tests for VALE 10-11: tests for getting netmap allocator info 12-15: tests for netmap pipes 16: test on polling mode 17-18: tests on options 19-27: tests for sync-kloop subsystem 28-39: tests for null ports 31-38: tests for the legacy NIOCREGIF registers Reviewed by: ngie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18490 Added: head/tests/sys/netmap/ head/tests/sys/netmap/Makefile (contents, props changed) head/tests/sys/netmap/ctrl-api-test.c (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/tests/sys/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Mon Dec 31 11:10:02 2018 (r342648) +++ head/etc/mtree/BSD.tests.dist Mon Dec 31 11:17:58 2018 (r342649) @@ -760,6 +760,8 @@ tunnel .. .. + netmap + .. netpfil pf ioctl Modified: head/tests/sys/Makefile ============================================================================== --- head/tests/sys/Makefile Mon Dec 31 11:10:02 2018 (r342648) +++ head/tests/sys/Makefile Mon Dec 31 11:17:58 2018 (r342649) @@ -20,6 +20,7 @@ TESTS_SUBDIRS+= mac TESTS_SUBDIRS+= mqueue TESTS_SUBDIRS+= netinet TESTS_SUBDIRS+= netipsec +TESTS_SUBDIRS+= netmap TESTS_SUBDIRS+= netpfil TESTS_SUBDIRS+= opencrypto TESTS_SUBDIRS+= posixshm Added: head/tests/sys/netmap/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netmap/Makefile Mon Dec 31 11:17:58 2018 (r342649) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/sys/netmap +TEST_METADATA+= required_user="root" +TEST_METADATA+= is_exclusive=true + +LDFLAGS+= -lpthread +PLAIN_TESTS_C+= ctrl-api-test + +WARNS?= 6 + +.include Added: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 11:17:58 2018 (r342649) @@ -0,0 +1,1905 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Vincenzo Maffione + * + * 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$ + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef __linux__ +#include +#else +static int +eventfd(int x __unused, int y __unused) +{ + errno = ENODEV; + return -1; +} +#endif /* __linux__ */ + +static int +exec_command(int argc, const char *const argv[]) +{ + pid_t child_pid; + pid_t wret; + int child_status; + int i; + + printf("Executing command: "); + for (i = 0; i < argc - 1; i++) { + if (!argv[i]) { + /* Invalid argument. */ + return -1; + } + if (i > 0) { + putchar(' '); + } + printf("%s", argv[i]); + } + putchar('\n'); + + child_pid = fork(); + if (child_pid == 0) { + char **av; + + /* Child process. Redirect stdin, stdout + * and stderr. */ + close(0); + close(1); + close(2); + if (open("/dev/null", O_RDONLY) < 0 || + open("/dev/null", O_RDONLY) < 0 || + open("/dev/null", O_RDONLY) < 0) { + return -1; + } + + /* Make a copy of the arguments, passing them to execvp. */ + av = calloc(argc, sizeof(av[0])); + if (!av) { + exit(EXIT_FAILURE); + } + for (i = 0; i < argc - 1; i++) { + av[i] = strdup(argv[i]); + if (!av[i]) { + exit(EXIT_FAILURE); + } + } + execvp(av[0], av); + perror("execvp()"); + exit(EXIT_FAILURE); + } + + wret = waitpid(child_pid, &child_status, 0); + if (wret < 0) { + fprintf(stderr, "waitpid() failed: %s\n", strerror(errno)); + return wret; + } + if (WIFEXITED(child_status)) { + return WEXITSTATUS(child_status); + } + + return -1; +} + + +#define THRET_SUCCESS ((void *)128) +#define THRET_FAILURE ((void *)0) + +struct TestContext { + char ifname[128]; + char bdgname[64]; + uint32_t nr_tx_slots; /* slots in tx rings */ + uint32_t nr_rx_slots; /* slots in rx rings */ + uint16_t nr_tx_rings; /* number of tx rings */ + uint16_t nr_rx_rings; /* number of rx rings */ + uint16_t nr_mem_id; /* id of the memory allocator */ + uint16_t nr_ringid; /* ring(s) we care about */ + uint32_t nr_mode; /* specify NR_REG_* modes */ + uint32_t nr_extra_bufs; /* number of requested extra buffers */ + uint64_t nr_flags; /* additional flags (see below) */ + uint32_t nr_hdr_len; /* for PORT_HDR_SET and PORT_HDR_GET */ + uint32_t nr_first_cpu_id; /* vale polling */ + uint32_t nr_num_polling_cpus; /* vale polling */ + int fd; /* netmap file descriptor */ + + void *csb; /* CSB entries (atok and ktoa) */ + struct nmreq_option *nr_opt; /* list of options */ + sem_t *sem; /* for thread synchronization */ + struct nmport_d *nmport; /* nmport descriptor from libnetmap */ +}; + +static struct TestContext ctx_; + +typedef int (*testfunc_t)(struct TestContext *ctx); + +static void +nmreq_hdr_init(struct nmreq_header *hdr, const char *ifname) +{ + memset(hdr, 0, sizeof(*hdr)); + hdr->nr_version = NETMAP_API; + strncpy(hdr->nr_name, ifname, sizeof(hdr->nr_name) - 1); +} + +/* Single NETMAP_REQ_PORT_INFO_GET. */ +static int +port_info_get(struct TestContext *ctx) +{ + struct nmreq_port_info_get req; + struct nmreq_header hdr; + int success; + int ret; + + printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)"); + return ret; + } + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_mem_id %u\n", req.nr_mem_id); + + success = req.nr_memsize && req.nr_tx_slots && req.nr_rx_slots && + req.nr_tx_rings && req.nr_rx_rings && req.nr_tx_rings; + if (!success) { + return -1; + } + + /* Write back results to the context structure. */ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_mem_id; + + return 0; +} + +/* Single NETMAP_REQ_REGISTER, no use. */ +static int +port_register(struct TestContext *ctx) +{ + struct nmreq_register req; + struct nmreq_header hdr; + int success; + int ret; + + printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," + "flags=0x%lx) on '%s'\n", + ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_REGISTER; + hdr.nr_body = (uintptr_t)&req; + hdr.nr_options = (uintptr_t)ctx->nr_opt; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + req.nr_mode = ctx->nr_mode; + req.nr_ringid = ctx->nr_ringid; + req.nr_flags = ctx->nr_flags; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + req.nr_extra_bufs = ctx->nr_extra_bufs; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)"); + return ret; + } + printf("nr_offset 0x%lx\n", req.nr_offset); + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_mem_id %u\n", req.nr_mem_id); + printf("nr_extra_bufs %u\n", req.nr_extra_bufs); + + success = req.nr_memsize && (ctx->nr_mode == req.nr_mode) && + (ctx->nr_ringid == req.nr_ringid) && + (ctx->nr_flags == req.nr_flags) && + ((!ctx->nr_tx_slots && req.nr_tx_slots) || + (ctx->nr_tx_slots == req.nr_tx_slots)) && + ((!ctx->nr_rx_slots && req.nr_rx_slots) || + (ctx->nr_rx_slots == req.nr_rx_slots)) && + ((!ctx->nr_tx_rings && req.nr_tx_rings) || + (ctx->nr_tx_rings == req.nr_tx_rings)) && + ((!ctx->nr_rx_rings && req.nr_rx_rings) || + (ctx->nr_rx_rings == req.nr_rx_rings)) && + ((!ctx->nr_mem_id && req.nr_mem_id) || + (ctx->nr_mem_id == req.nr_mem_id)) && + (ctx->nr_extra_bufs == req.nr_extra_bufs); + if (!success) { + return -1; + } + + /* Write back results to the context structure.*/ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_mem_id; + ctx->nr_extra_bufs = req.nr_extra_bufs; + + return 0; +} + +static int +niocregif(struct TestContext *ctx, int netmap_api) +{ + struct nmreq req; + int success; + int ret; + + printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname); + + memset(&req, 0, sizeof(req)); + memcpy(req.nr_name, ctx->ifname, sizeof(req.nr_name)); + req.nr_name[sizeof(req.nr_name) - 1] = '\0'; + req.nr_version = netmap_api; + req.nr_ringid = ctx->nr_ringid; + req.nr_flags = ctx->nr_mode | ctx->nr_flags; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + req.nr_arg2 = ctx->nr_mem_id; + req.nr_arg3 = ctx->nr_extra_bufs; + + ret = ioctl(ctx->fd, NIOCREGIF, &req); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCREGIF)"); + return ret; + } + + printf("nr_offset 0x%x\n", req.nr_offset); + printf("nr_memsize %u\n", req.nr_memsize); + printf("nr_tx_slots %u\n", req.nr_tx_slots); + printf("nr_rx_slots %u\n", req.nr_rx_slots); + printf("nr_tx_rings %u\n", req.nr_tx_rings); + printf("nr_rx_rings %u\n", req.nr_rx_rings); + printf("nr_version %d\n", req.nr_version); + printf("nr_ringid %x\n", req.nr_ringid); + printf("nr_flags %x\n", req.nr_flags); + printf("nr_arg2 %u\n", req.nr_arg2); + printf("nr_arg3 %u\n", req.nr_arg3); + + success = req.nr_memsize && + (ctx->nr_ringid == req.nr_ringid) && + ((ctx->nr_mode | ctx->nr_flags) == req.nr_flags) && + ((!ctx->nr_tx_slots && req.nr_tx_slots) || + (ctx->nr_tx_slots == req.nr_tx_slots)) && + ((!ctx->nr_rx_slots && req.nr_rx_slots) || + (ctx->nr_rx_slots == req.nr_rx_slots)) && + ((!ctx->nr_tx_rings && req.nr_tx_rings) || + (ctx->nr_tx_rings == req.nr_tx_rings)) && + ((!ctx->nr_rx_rings && req.nr_rx_rings) || + (ctx->nr_rx_rings == req.nr_rx_rings)) && + ((!ctx->nr_mem_id && req.nr_arg2) || + (ctx->nr_mem_id == req.nr_arg2)) && + (ctx->nr_extra_bufs == req.nr_arg3); + if (!success) { + return -1; + } + + /* Write back results to the context structure.*/ + ctx->nr_tx_slots = req.nr_tx_slots; + ctx->nr_rx_slots = req.nr_rx_slots; + ctx->nr_tx_rings = req.nr_tx_rings; + ctx->nr_rx_rings = req.nr_rx_rings; + ctx->nr_mem_id = req.nr_arg2; + ctx->nr_extra_bufs = req.nr_arg3; + + return ret; +} + +/* The 11 ABI is the one right before the introduction of the new NIOCCTRL + * ABI. The 11 ABI is useful to perform tests with legacy applications + * (which use the 11 ABI) and new kernel (which uses 12, or higher). */ +#define NETMAP_API_NIOCREGIF 11 + +static int +legacy_regif_default(struct TestContext *ctx) +{ + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_all_nic(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return niocregif(ctx, NETMAP_API); +} + +static int +legacy_regif_12(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return niocregif(ctx, NETMAP_API_NIOCREGIF+1); +} + +static int +legacy_regif_sw(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_SW; + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_future(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + /* Test forward compatibility for the legacy ABI. This means + * using an older kernel (with ABI 12 or higher) and a newer + * application (with ABI greater than NETMAP_API). */ + return niocregif(ctx, NETMAP_API+2); +} + +static int +legacy_regif_extra_bufs(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_extra_bufs = 20; /* arbitrary number of extra bufs */ + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_extra_bufs_pipe(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{pipeexbuf", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_extra_bufs = 58; /* arbitrary number of extra bufs */ + + return niocregif(ctx, NETMAP_API_NIOCREGIF); +} + +static int +legacy_regif_extra_bufs_pipe_vale(struct TestContext *ctx) +{ + strncpy(ctx->ifname, "valeX1:Y4", sizeof(ctx->ifname)); + return legacy_regif_extra_bufs_pipe(ctx); +} + +/* Only valid after a successful port_register(). */ +static int +num_registered_rings(struct TestContext *ctx) +{ + if (ctx->nr_flags & NR_TX_RINGS_ONLY) { + return ctx->nr_tx_rings; + } + if (ctx->nr_flags & NR_RX_RINGS_ONLY) { + return ctx->nr_rx_rings; + } + + return ctx->nr_tx_rings + ctx->nr_rx_rings; +} + +static int +port_register_hwall_host(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + return port_register(ctx); +} + +static int +port_register_host(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_SW; + return port_register(ctx); +} + +static int +port_register_hwall(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + return port_register(ctx); +} + +static int +port_register_single_ring_couple(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ONE_NIC; + ctx->nr_ringid = 0; + return port_register(ctx); +} + +static int +port_register_hwall_tx(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_flags |= NR_TX_RINGS_ONLY; + return port_register(ctx); +} + +static int +port_register_hwall_rx(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_ALL_NIC; + ctx->nr_flags |= NR_RX_RINGS_ONLY; + return port_register(ctx); +} + +/* NETMAP_REQ_VALE_ATTACH */ +static int +vale_attach(struct TestContext *ctx) +{ + struct nmreq_vale_attach req; + struct nmreq_header hdr; + char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname)]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + + printf("Testing NETMAP_REQ_VALE_ATTACH on '%s'\n", vpname); + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_ATTACH; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.reg.nr_mem_id = ctx->nr_mem_id; + if (ctx->nr_mode == 0) { + ctx->nr_mode = NR_REG_ALL_NIC; /* default */ + } + req.reg.nr_mode = ctx->nr_mode; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_ATTACH)"); + return ret; + } + printf("nr_mem_id %u\n", req.reg.nr_mem_id); + + return ((!ctx->nr_mem_id && req.reg.nr_mem_id > 1) || + (ctx->nr_mem_id == req.reg.nr_mem_id)) && + (ctx->nr_flags == req.reg.nr_flags) + ? 0 + : -1; +} + +/* NETMAP_REQ_VALE_DETACH */ +static int +vale_detach(struct TestContext *ctx) +{ + struct nmreq_header hdr; + struct nmreq_vale_detach req; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + + printf("Testing NETMAP_REQ_VALE_DETACH on '%s'\n", vpname); + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_DETACH; + hdr.nr_body = (uintptr_t)&req; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_DETACH)"); + return ret; + } + + return 0; +} + +/* First NETMAP_REQ_VALE_ATTACH, then NETMAP_REQ_VALE_DETACH. */ +static int +vale_attach_detach(struct TestContext *ctx) +{ + int ret; + + if ((ret = vale_attach(ctx)) != 0) { + return ret; + } + + return vale_detach(ctx); +} + +static int +vale_attach_detach_host_rings(struct TestContext *ctx) +{ + ctx->nr_mode = NR_REG_NIC_SW; + return vale_attach_detach(ctx); +} + +/* First NETMAP_REQ_PORT_HDR_SET and the NETMAP_REQ_PORT_HDR_GET + * to check that we get the same value. */ +static int +port_hdr_set_and_get(struct TestContext *ctx) +{ + struct nmreq_port_hdr req; + struct nmreq_header hdr; + int ret; + + printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_hdr_len = ctx->nr_hdr_len; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_HDR_SET)"); + return ret; + } + + if (req.nr_hdr_len != ctx->nr_hdr_len) { + return -1; + } + + printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; + req.nr_hdr_len = 0; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, PORT_HDR_SET)"); + return ret; + } + printf("nr_hdr_len %u\n", req.nr_hdr_len); + + return (req.nr_hdr_len == ctx->nr_hdr_len) ? 0 : -1; +} + +/* + * Possible lengths for the VirtIO network header, as specified by + * the standard: + * http://docs.oasis-open.org/virtio/virtio/v1.0/cs04/virtio-v1.0-cs04.html + */ +#define VIRTIO_NET_HDR_LEN 10 +#define VIRTIO_NET_HDR_LEN_WITH_MERGEABLE_RXBUFS 12 + +static int +vale_ephemeral_port_hdr_manipulation(struct TestContext *ctx) +{ + int ret; + + strncpy(ctx->ifname, "vale:eph0", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + if ((ret = port_register(ctx))) { + return ret; + } + /* Try to set and get all the acceptable values. */ + ctx->nr_hdr_len = VIRTIO_NET_HDR_LEN_WITH_MERGEABLE_RXBUFS; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + ctx->nr_hdr_len = 0; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + ctx->nr_hdr_len = VIRTIO_NET_HDR_LEN; + if ((ret = port_hdr_set_and_get(ctx))) { + return ret; + } + return 0; +} + +static int +vale_persistent_port(struct TestContext *ctx) +{ + struct nmreq_vale_newif req; + struct nmreq_header hdr; + int result; + int ret; + + strncpy(ctx->ifname, "per4", sizeof(ctx->ifname)); + + printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_VALE_NEWIF; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + req.nr_tx_slots = ctx->nr_tx_slots; + req.nr_rx_slots = ctx->nr_rx_slots; + req.nr_tx_rings = ctx->nr_tx_rings; + req.nr_rx_rings = ctx->nr_rx_rings; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_NEWIF)"); + return ret; + } + + /* Attach the persistent VALE port to a switch and then detach. */ + result = vale_attach_detach(ctx); + + printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_VALE_DELIF; + hdr.nr_body = (uintptr_t)NULL; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_NEWIF)"); + if (result == 0) { + result = ret; + } + } + + return result; +} + +/* Single NETMAP_REQ_POOLS_INFO_GET. */ +static int +pools_info_get(struct TestContext *ctx) +{ + struct nmreq_pools_info req; + struct nmreq_header hdr; + int ret; + + printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname); + + nmreq_hdr_init(&hdr, ctx->ifname); + hdr.nr_reqtype = NETMAP_REQ_POOLS_INFO_GET; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mem_id = ctx->nr_mem_id; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)"); + return ret; + } + printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_mem_id %u\n", req.nr_mem_id); + printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal); + printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize); + printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal); + printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize); + printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset); + printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal); + printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize); + + return req.nr_memsize && req.nr_if_pool_objtotal && + req.nr_if_pool_objsize && + req.nr_ring_pool_objtotal && + req.nr_ring_pool_objsize && + req.nr_buf_pool_objtotal && + req.nr_buf_pool_objsize + ? 0 + : -1; +} + +static int +pools_info_get_and_register(struct TestContext *ctx) +{ + int ret; + + /* Check that we can get pools info before we register + * a netmap interface. */ + ret = pools_info_get(ctx); + if (ret != 0) { + return ret; + } + + ctx->nr_mode = NR_REG_ONE_NIC; + ret = port_register(ctx); + if (ret != 0) { + return ret; + } + ctx->nr_mem_id = 1; + + /* Check that we can get pools info also after we register. */ + return pools_info_get(ctx); +} + +static int +pools_info_get_empty_ifname(struct TestContext *ctx) +{ + strncpy(ctx->ifname, "", sizeof(ctx->ifname)); + return pools_info_get(ctx) != 0 ? 0 : -1; +} + +static int +pipe_master(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{pipeid1", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_NIC_SW; + + if (port_register(ctx) == 0) { + printf("pipes should not accept NR_REG_NIC_SW\n"); + return -1; + } + ctx->nr_mode = NR_REG_ALL_NIC; + + return port_register(ctx); +} + +static int +pipe_slave(struct TestContext *ctx) +{ + strncat(ctx->ifname, "}pipeid2", sizeof(ctx->ifname)); + ctx->nr_mode = NR_REG_ALL_NIC; + + return port_register(ctx); +} + +/* Test PORT_INFO_GET and POOLS_INFO_GET on a pipe. This is useful to test the + * registration request used internall by netmap. */ +static int +pipe_port_info_get(struct TestContext *ctx) +{ + strncat(ctx->ifname, "}pipeid3", sizeof(ctx->ifname)); + + return port_info_get(ctx); +} + +static int +pipe_pools_info_get(struct TestContext *ctx) +{ + strncat(ctx->ifname, "{xid", sizeof(ctx->ifname)); + + return pools_info_get(ctx); +} + +/* NETMAP_REQ_VALE_POLLING_ENABLE */ +static int +vale_polling_enable(struct TestContext *ctx) +{ + struct nmreq_vale_polling req; + struct nmreq_header hdr; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + printf("Testing NETMAP_REQ_VALE_POLLING_ENABLE on '%s'\n", vpname); + + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_POLLING_ENABLE; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + req.nr_mode = ctx->nr_mode; + req.nr_first_cpu_id = ctx->nr_first_cpu_id; + req.nr_num_polling_cpus = ctx->nr_num_polling_cpus; + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_POLLING_ENABLE)"); + return ret; + } + + return (req.nr_mode == ctx->nr_mode && + req.nr_first_cpu_id == ctx->nr_first_cpu_id && + req.nr_num_polling_cpus == ctx->nr_num_polling_cpus) + ? 0 + : -1; +} + +/* NETMAP_REQ_VALE_POLLING_DISABLE */ +static int +vale_polling_disable(struct TestContext *ctx) +{ + struct nmreq_vale_polling req; + struct nmreq_header hdr; + char vpname[256]; + int ret; + + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + printf("Testing NETMAP_REQ_VALE_POLLING_DISABLE on '%s'\n", vpname); + + nmreq_hdr_init(&hdr, vpname); + hdr.nr_reqtype = NETMAP_REQ_VALE_POLLING_DISABLE; + hdr.nr_body = (uintptr_t)&req; + memset(&req, 0, sizeof(req)); + ret = ioctl(ctx->fd, NIOCCTRL, &hdr); + if (ret != 0) { + perror("ioctl(/dev/netmap, NIOCCTRL, VALE_POLLING_DISABLE)"); + return ret; + } + + return 0; +} + +static int +vale_polling_enable_disable(struct TestContext *ctx) +{ + int ret = 0; + + if ((ret = vale_attach(ctx)) != 0) { + return ret; + } + + ctx->nr_mode = NETMAP_POLLING_MODE_SINGLE_CPU; + ctx->nr_num_polling_cpus = 1; + ctx->nr_first_cpu_id = 0; + if ((ret = vale_polling_enable(ctx))) { + vale_detach(ctx); +#ifdef __FreeBSD__ + /* NETMAP_REQ_VALE_POLLING_DISABLE is disabled on FreeBSD, + * because it is currently broken. We are happy to see that + * it fails. */ + return 0; +#endif + return ret; + } + + if ((ret = vale_polling_disable(ctx))) { + vale_detach(ctx); + return ret; + } + + return vale_detach(ctx); +} + +static void +push_option(struct nmreq_option *opt, struct TestContext *ctx) +{ + opt->nro_next = (uintptr_t)ctx->nr_opt; + ctx->nr_opt = opt; +} + +static void +clear_options(struct TestContext *ctx) +{ + ctx->nr_opt = NULL; +} + +static int +checkoption(struct nmreq_option *opt, struct nmreq_option *exp) +{ + if (opt->nro_next != exp->nro_next) { + printf("nro_next %p expected %p\n", + (void *)(uintptr_t)opt->nro_next, + (void *)(uintptr_t)exp->nro_next); + return -1; + } + if (opt->nro_reqtype != exp->nro_reqtype) { + printf("nro_reqtype %u expected %u\n", opt->nro_reqtype, + exp->nro_reqtype); + return -1; + } + if (opt->nro_status != exp->nro_status) { + printf("nro_status %u expected %u\n", opt->nro_status, + exp->nro_status); + return -1; + } + return 0; +} + +static int +unsupported_option(struct TestContext *ctx) +{ + struct nmreq_option opt, save; + + printf("Testing unsupported option on %s\n", ctx->ifname); + + memset(&opt, 0, sizeof(opt)); + opt.nro_reqtype = 1234; + push_option(&opt, ctx); + save = opt; + + if (port_register_hwall(ctx) >= 0) + return -1; + + clear_options(ctx); + save.nro_status = EOPNOTSUPP; + return checkoption(&opt, &save); +} + +static int +infinite_options(struct TestContext *ctx) +{ + struct nmreq_option opt; + + printf("Testing infinite list of options on %s\n", ctx->ifname); + + opt.nro_reqtype = 1234; + push_option(&opt, ctx); + opt.nro_next = (uintptr_t)&opt; + if (port_register_hwall(ctx) >= 0) + return -1; + clear_options(ctx); + return (errno == EMSGSIZE ? 0 : -1); +} + +#ifdef CONFIG_NETMAP_EXTMEM +int +change_param(const char *pname, unsigned long newv, unsigned long *poldv) +{ +#ifdef __linux__ + char param[256] = "/sys/module/netmap/parameters/"; + unsigned long oldv; + FILE *f; + + strncat(param, pname, sizeof(param) - 1); + + f = fopen(param, "r+"); + if (f == NULL) { + perror(param); + return -1; + } + if (fscanf(f, "%ld", &oldv) != 1) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Mon Dec 31 12:07:18 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 842741431A70; Mon, 31 Dec 2018 12:07:18 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D343E96931; Mon, 31 Dec 2018 12:07:17 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9EB0AA406; Mon, 31 Dec 2018 12:07:17 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVC7Hfr098278; Mon, 31 Dec 2018 12:07:17 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVC7HwL098277; Mon, 31 Dec 2018 12:07:17 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201812311207.wBVC7HwL098277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Mon, 31 Dec 2018 12:07:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342650 - head/tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tests/sys/netmap X-SVN-Commit-Revision: 342650 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D343E96931 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 12:07:18 -0000 Author: vmaffione Date: Mon Dec 31 12:07:17 2018 New Revision: 342650 URL: https://svnweb.freebsd.org/changeset/base/342650 Log: netmap: fix warnings on unit tests Fix some printf() format string warnings raised for ctrl-api-test.c on some architectures. MFC after: 1 week Sponsored by: Sunny Valley Networks Modified: head/tests/sys/netmap/ctrl-api-test.c Modified: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 11:17:58 2018 (r342649) +++ head/tests/sys/netmap/ctrl-api-test.c Mon Dec 31 12:07:17 2018 (r342650) @@ -183,7 +183,7 @@ port_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, PORT_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -216,8 +216,9 @@ port_register(struct TestContext *ctx) int ret; printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," - "flags=0x%lx) on '%s'\n", - ctx->nr_mode, ctx->nr_ringid, ctx->nr_flags, ctx->ifname); + "flags=0x%llx) on '%s'\n", + ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags, + ctx->ifname); nmreq_hdr_init(&hdr, ctx->ifname); hdr.nr_reqtype = NETMAP_REQ_REGISTER; @@ -238,8 +239,8 @@ port_register(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, REGISTER)"); return ret; } - printf("nr_offset 0x%lx\n", req.nr_offset); - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_offset 0x%llx\n", (unsigned long long)req.nr_offset); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_tx_slots %u\n", req.nr_tx_slots); printf("nr_rx_slots %u\n", req.nr_rx_slots); printf("nr_tx_rings %u\n", req.nr_tx_rings); @@ -687,15 +688,18 @@ pools_info_get(struct TestContext *ctx) perror("ioctl(/dev/netmap, NIOCCTRL, POOLS_INFO_GET)"); return ret; } - printf("nr_memsize %lu\n", req.nr_memsize); + printf("nr_memsize %llu\n", (unsigned long long)req.nr_memsize); printf("nr_mem_id %u\n", req.nr_mem_id); - printf("nr_if_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_if_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_if_pool_objtotal %u\n", req.nr_if_pool_objtotal); printf("nr_if_pool_objsize %u\n", req.nr_if_pool_objsize); - printf("nr_ring_pool_offset 0x%lx\n", req.nr_if_pool_offset); + printf("nr_ring_pool_offset 0x%llx\n", + (unsigned long long)req.nr_if_pool_offset); printf("nr_ring_pool_objtotal %u\n", req.nr_ring_pool_objtotal); printf("nr_ring_pool_objsize %u\n", req.nr_ring_pool_objsize); - printf("nr_buf_pool_offset 0x%lx\n", req.nr_buf_pool_offset); + printf("nr_buf_pool_offset 0x%llx\n", + (unsigned long long)req.nr_buf_pool_offset); printf("nr_buf_pool_objtotal %u\n", req.nr_buf_pool_objtotal); printf("nr_buf_pool_objsize %u\n", req.nr_buf_pool_objsize); From owner-svn-src-head@freebsd.org Mon Dec 31 15:43:07 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 362EF14385AD; Mon, 31 Dec 2018 15:43:07 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAF817133F; Mon, 31 Dec 2018 15:43:06 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7ACACAE4; Mon, 31 Dec 2018 15:43:06 +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 wBVFh6ZA017937; Mon, 31 Dec 2018 15:43:06 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVFh6JT017935; Mon, 31 Dec 2018 15:43:06 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201812311543.wBVFh6JT017935@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 31 Dec 2018 15:43:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342651 - in head/lib/msun: ld128 src X-SVN-Group: head X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: in head/lib/msun: ld128 src X-SVN-Commit-Revision: 342651 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CAF817133F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 15:43:07 -0000 Author: pfg Date: Mon Dec 31 15:43:06 2018 New Revision: 342651 URL: https://svnweb.freebsd.org/changeset/base/342651 Log: msun: Fix some old typos. Seen in a posting from July 27 by "CM Graff" in musl-libc. Modified: head/lib/msun/ld128/e_powl.c head/lib/msun/src/k_rem_pio2.c Modified: head/lib/msun/ld128/e_powl.c ============================================================================== --- head/lib/msun/ld128/e_powl.c Mon Dec 31 12:07:17 2018 (r342650) +++ head/lib/msun/ld128/e_powl.c Mon Dec 31 15:43:06 2018 (r342651) @@ -32,7 +32,7 @@ * 1. Compute and return log2(x) in two pieces: * log2(x) = w1 + w2, * where w1 has 113-53 = 60 bit trailing zeros. - * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * 2. Perform y*log2(x) = n+y' by simulating multi-precision * arithmetic, where |y'|<=0.5. * 3. Return x**y = 2**n*exp(y'*log2) * Modified: head/lib/msun/src/k_rem_pio2.c ============================================================================== --- head/lib/msun/src/k_rem_pio2.c Mon Dec 31 12:07:17 2018 (r342650) +++ head/lib/msun/src/k_rem_pio2.c Mon Dec 31 15:43:06 2018 (r342651) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); * 64-bit precision 2 * 113-bit precision 3 * The actual value is the sum of them. Thus for 113-bit - * precison, one may have to do something like: + * precision, one may have to do something like: * * long double t,w,r_head, r_tail; * t = (long double)y[2] + (long double)y[1]; From owner-svn-src-head@freebsd.org Mon Dec 31 16:01:23 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 072CA1438AA7; Mon, 31 Dec 2018 16:01:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A0CB471B11; Mon, 31 Dec 2018 16:01:22 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 947C3CCE7; Mon, 31 Dec 2018 16:01:22 +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 wBVG1Mfh024423; Mon, 31 Dec 2018 16:01:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVG1MKi024422; Mon, 31 Dec 2018 16:01:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201812311601.wBVG1MKi024422@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Mon, 31 Dec 2018 16:01:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342652 - head/sys/arm/ti X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/ti X-SVN-Commit-Revision: 342652 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A0CB471B11 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.980,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 16:01:23 -0000 Author: ian Date: Mon Dec 31 16:01:22 2018 New Revision: 342652 URL: https://svnweb.freebsd.org/changeset/base/342652 Log: Support the SPI mode and bus clock frequency parameters set by the devices requesting SPI transfers. Reported by: SAITOU Toshihide Modified: head/sys/arm/ti/ti_spi.c Modified: head/sys/arm/ti/ti_spi.c ============================================================================== --- head/sys/arm/ti/ti_spi.c Mon Dec 31 15:43:06 2018 (r342651) +++ head/sys/arm/ti/ti_spi.c Mon Dec 31 16:01:22 2018 (r342652) @@ -446,7 +446,7 @@ ti_spi_transfer(device_t dev, device_t child, struct s { int err; struct ti_spi_softc *sc; - uint32_t reg, cs; + uint32_t clockhz, cs, mode, reg; sc = device_get_softc(dev); @@ -457,6 +457,8 @@ ti_spi_transfer(device_t dev, device_t child, struct s /* Get the proper chip select for this child. */ spibus_get_cs(child, &cs); + spibus_get_clock(child, &clockhz); + spibus_get_mode(child, &mode); cs &= ~SPIBUS_CS_HIGH; @@ -466,6 +468,13 @@ ti_spi_transfer(device_t dev, device_t child, struct s return (EINVAL); } + if (mode > 3) + { + device_printf(dev, "Invalid mode %d requested by %s\n", mode, + device_get_nameunit(child)); + return (EINVAL); + } + TI_SPI_LOCK(sc); /* If the controller is in use wait until it is available. */ @@ -487,8 +496,8 @@ ti_spi_transfer(device_t dev, device_t child, struct s /* Disable FIFO for now. */ sc->sc_fifolvl = 1; - /* Use a safe clock - 500kHz. */ - ti_spi_set_clock(sc, sc->sc_cs, 500000); + /* Set the bus frequency. */ + ti_spi_set_clock(sc, sc->sc_cs, clockhz); /* Disable the FIFO. */ TI_SPI_WRITE(sc, MCSPI_XFERLEVEL, 0); @@ -500,6 +509,7 @@ ti_spi_transfer(device_t dev, device_t child, struct s MCSPI_CONF_DPE1 | MCSPI_CONF_DPE0 | MCSPI_CONF_DMAR | MCSPI_CONF_DMAW | MCSPI_CONF_EPOL); reg |= MCSPI_CONF_DPE0 | MCSPI_CONF_EPOL | MCSPI_CONF_WL8BITS; + reg |= mode; /* POL and PHA are the low bits, we can just OR-in mode */ TI_SPI_WRITE(sc, MCSPI_CONF_CH(sc->sc_cs), reg); #if 0 From owner-svn-src-head@freebsd.org Mon Dec 31 18:05:50 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0D72143B7D5; Mon, 31 Dec 2018 18:05:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A94176098; Mon, 31 Dec 2018 18:05:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4A67BE264; Mon, 31 Dec 2018 18:05:49 +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 wBVI5nlX000960; Mon, 31 Dec 2018 18:05:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVI5nMb000959; Mon, 31 Dec 2018 18:05:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812311805.wBVI5nMb000959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 31 Dec 2018 18:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342653 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 342653 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5A94176098 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 18:05:50 -0000 Author: kib Date: Mon Dec 31 18:05:48 2018 New Revision: 342653 URL: https://svnweb.freebsd.org/changeset/base/342653 Log: Update comments: paging is initialized in pmap_cold(). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Mon Dec 31 16:01:22 2018 (r342652) +++ head/sys/i386/i386/pmap.c Mon Dec 31 18:05:48 2018 (r342653) @@ -569,9 +569,9 @@ pmap_cold(void) /* * Bootstrap the system enough to run with virtual memory. * - * On the i386 this is called after mapping has already been enabled - * in locore.s with the page table created in pmap_cold(), - * and just syncs the pmap module with what has already been done. + * On the i386 this is called after pmap_cold() created intial + * kernel page table and enabled paging, and just syncs the pmap + * module with what has already been done. */ void pmap_bootstrap(vm_paddr_t firstaddr) @@ -594,11 +594,12 @@ pmap_bootstrap(vm_paddr_t firstaddr) vm_phys_add_seg(KPTphys, KPTphys + ptoa(nkpt)); /* - * Initialize the first available kernel virtual address. However, - * using "firstaddr" may waste a few pages of the kernel virtual - * address space, because locore may not have mapped every physical - * page that it allocated. Preferably, locore would provide a first - * unused virtual address in addition to "firstaddr". + * Initialize the first available kernel virtual address. + * However, using "firstaddr" may waste a few pages of the + * kernel virtual address space, because pmap_cold() may not + * have mapped every physical page that it allocated. + * Preferably, pmap_cold() would provide a first unused + * virtual address in addition to "firstaddr". */ virtual_avail = (vm_offset_t)firstaddr; virtual_end = VM_MAX_KERNEL_ADDRESS; @@ -665,7 +666,7 @@ pmap_bootstrap(vm_paddr_t firstaddr) /* * KPTmap is used by pmap_kextract(). * - * KPTmap is first initialized by locore. However, that initial + * KPTmap is first initialized by pmap_cold(). However, that initial * KPTmap can only support NKPT page table pages. Here, a larger * KPTmap is created that can support KVA_PAGES page table pages. */ From owner-svn-src-head@freebsd.org Mon Dec 31 18:11:05 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7858F143BADE; Mon, 31 Dec 2018 18:11:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1BF1676572; Mon, 31 Dec 2018 18:11: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3CBEE290; Mon, 31 Dec 2018 18:11:04 +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 wBVIB4Cf002023; Mon, 31 Dec 2018 18:11:04 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVIB4AA002022; Mon, 31 Dec 2018 18:11:04 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812311811.wBVIB4AA002022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 31 Dec 2018 18:11:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342654 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342654 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1BF1676572 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 18:11:05 -0000 Author: kib Date: Mon Dec 31 18:11:04 2018 New Revision: 342654 URL: https://svnweb.freebsd.org/changeset/base/342654 Log: More references to pmap_cold(). MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Mon Dec 31 18:05:48 2018 (r342653) +++ head/sys/i386/include/pmap.h Mon Dec 31 18:11:04 2018 (r342654) @@ -125,7 +125,7 @@ /* * The initial number of kernel page table pages that are constructed - * by locore must be sufficient to map vm_page_array. That number can + * by pmap_cold() must be sufficient to map vm_page_array[]. That number can * be calculated as follows: * max_phys / PAGE_SIZE * sizeof(struct vm_page) / NBPDR * PAE: max_phys 16G, sizeof(vm_page) 76, NBPDR 2M, 152 page table pages. @@ -228,7 +228,7 @@ extern pd_entry_t *IdlePTD; /* physical address of "Id * a kernel page table page after the corresponding virtual addresses have * been promoted to a 2/4MB page mapping. * - * KPTmap is first initialized by locore to support just NPKT page table + * KPTmap is first initialized by pmap_cold() to support just NPKT page table * pages. Later, it is reinitialized by pmap_bootstrap() to allow for * expansion of the kernel page table. */ From owner-svn-src-head@freebsd.org Mon Dec 31 22:20:31 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1AE96141BCE2; Mon, 31 Dec 2018 22:20:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3EEA877D9; Mon, 31 Dec 2018 22:20: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9DD2D18D47; Mon, 31 Dec 2018 22:20: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 wBVMKUIn037339; Mon, 31 Dec 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVMKUUF037338; Mon, 31 Dec 2018 22:20:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201812312220.wBVMKUUF037338@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 31 Dec 2018 22:20:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342657 - head/sys/cam/scsi X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/scsi X-SVN-Commit-Revision: 342657 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B3EEA877D9 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 22:20:31 -0000 Author: imp Date: Mon Dec 31 22:20:30 2018 New Revision: 342657 URL: https://svnweb.freebsd.org/changeset/base/342657 Log: Add NO_RC16 quirk for Chipfancier 16GB USB stick... Submitted by: osef.lar@gmail.com PR: 234503 Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Dec 31 22:09:08 2018 (r342656) +++ head/sys/cam/scsi/scsi_da.c Mon Dec 31 22:20:30 2018 (r342657) @@ -861,6 +861,14 @@ static struct da_quirk_entry da_quirk_table[] = {T_DIRECT, SIP_MEDIA_REMOVABLE, "I-O DATA", "USB Flash Disk*", "*"}, /*quirks*/ DA_Q_NO_RC16 }, + { + /* + * 16GB SLC CHIPFANCIER + * PR: usb/234503 + */ + {T_DIRECT, SIP_MEDIA_REMOVABLE, "16G SLC", "CHIPFANCIER", + "1.00"}, /*quirks*/ DA_Q_NO_RC16 + }, /* ATA/SATA devices over SAS/USB/... */ { /* Hitachi Advanced Format (4k) drives */ From owner-svn-src-head@freebsd.org Mon Dec 31 22:46:44 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0F96141EABB; Mon, 31 Dec 2018 22:46:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF0988998; Mon, 31 Dec 2018 22:46:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 19A6219248; Mon, 31 Dec 2018 22:46:44 +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 wBVMkhpV053048; Mon, 31 Dec 2018 22:46:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVMkhCm053047; Mon, 31 Dec 2018 22:46:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201812312246.wBVMkhCm053047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 31 Dec 2018 22:46:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342658 - in head/sys/x86: x86 xen X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head/sys/x86: x86 xen X-SVN-Commit-Revision: 342658 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BF0988998 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 22:46:45 -0000 Author: jhb Date: Mon Dec 31 22:46:43 2018 New Revision: 342658 URL: https://svnweb.freebsd.org/changeset/base/342658 Log: Correct variable name in two panic messages: num_msi_irq -> num_msi_irqs. MFC after: 1 week Modified: head/sys/x86/x86/msi.c head/sys/x86/xen/xen_msi.c Modified: head/sys/x86/x86/msi.c ============================================================================== --- head/sys/x86/x86/msi.c Mon Dec 31 22:20:30 2018 (r342657) +++ head/sys/x86/x86/msi.c Mon Dec 31 22:46:43 2018 (r342658) @@ -343,7 +343,7 @@ msi_init(void) first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) - panic("num_msi_irq too high"); + panic("num_msi_irqs too high"); num_io_irqs = first_msi_irq + num_msi_irqs; msi_enabled = 1; Modified: head/sys/x86/xen/xen_msi.c ============================================================================== --- head/sys/x86/xen/xen_msi.c Mon Dec 31 22:20:30 2018 (r342657) +++ head/sys/x86/xen/xen_msi.c Mon Dec 31 22:46:43 2018 (r342658) @@ -59,7 +59,7 @@ xen_msi_init(void) MPASS(num_io_irqs > 0); first_msi_irq = num_io_irqs; if (num_msi_irqs > UINT_MAX - first_msi_irq) - panic("num_msi_irq too high"); + panic("num_msi_irqs too high"); num_io_irqs = first_msi_irq + num_msi_irqs; mtx_init(&msi_lock, "msi", NULL, MTX_DEF); From owner-svn-src-head@freebsd.org Mon Dec 31 23:27:57 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B41141F3E5; Mon, 31 Dec 2018 23:27:57 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A306D89E43; Mon, 31 Dec 2018 23:27:56 +0000 (UTC) (envelope-from scottl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84E1D198F0; Mon, 31 Dec 2018 23:27:56 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVNRuAl074287; Mon, 31 Dec 2018 23:27:56 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVNRuTl074286; Mon, 31 Dec 2018 23:27:56 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812312327.wBVNRuTl074286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Dec 2018 23:27:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342659 - head/sys/dev/mpr X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mpr X-SVN-Commit-Revision: 342659 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A306D89E43 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 23:27:57 -0000 Author: scottl Date: Mon Dec 31 23:27:56 2018 New Revision: 342659 URL: https://svnweb.freebsd.org/changeset/base/342659 Log: Fix whitespace from r342528 Modified: head/sys/dev/mpr/mpr_user.c Modified: head/sys/dev/mpr/mpr_user.c ============================================================================== --- head/sys/dev/mpr/mpr_user.c Mon Dec 31 22:46:43 2018 (r342658) +++ head/sys/dev/mpr/mpr_user.c Mon Dec 31 23:27:56 2018 (r342659) @@ -1107,9 +1107,8 @@ mpr_user_pass_thru(struct mpr_softc *sc, mpr_pass_thru SenseCount)), sizeof(struct scsi_sense_data)); mpr_unlock(sc); - copyout(cm->cm_sense, - (PTRIN(data->PtrReply + sizeof(MPI2_SCSI_IO_REPLY))), - sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mpr_lock(sc); } } From owner-svn-src-head@freebsd.org Mon Dec 31 23:30:32 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D366141F47A; Mon, 31 Dec 2018 23:30:32 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D604A89FB5; Mon, 31 Dec 2018 23:30:31 +0000 (UTC) (envelope-from scottl@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE670198F6; Mon, 31 Dec 2018 23:30:31 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBVNUVf0074487; Mon, 31 Dec 2018 23:30:31 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBVNUVx5074486; Mon, 31 Dec 2018 23:30:31 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201812312330.wBVNUVx5074486@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Mon, 31 Dec 2018 23:30:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342660 - head/sys/dev/mps X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/dev/mps X-SVN-Commit-Revision: 342660 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D604A89FB5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 31 Dec 2018 23:30:32 -0000 Author: scottl Date: Mon Dec 31 23:30:31 2018 New Revision: 342660 URL: https://svnweb.freebsd.org/changeset/base/342660 Log: Port over the SCSI sense handling fix from mpr(4) in r342528, and fix whitespace to match. Modified: head/sys/dev/mps/mps_user.c Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Mon Dec 31 23:27:56 2018 (r342659) +++ head/sys/dev/mps/mps_user.c Mon Dec 31 23:30:31 2018 (r342660) @@ -1043,10 +1043,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru if (((MPI2_SCSI_IO_REPLY *)rpl)->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { sense_len = - MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)->SenseCount)), - sizeof(struct scsi_sense_data)); + MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)-> + SenseCount)), sizeof(struct + scsi_sense_data)); mps_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mps_lock(sc); } } From owner-svn-src-head@freebsd.org Tue Jan 1 00:25:27 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F47414206D1; Tue, 1 Jan 2019 00:25:27 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E8F138BA6C; Tue, 1 Jan 2019 00:25:26 +0000 (UTC) (envelope-from delphij@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CC1F41A2EC; Tue, 1 Jan 2019 00:25:26 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x010PQg6007177; Tue, 1 Jan 2019 00:25:26 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x010PQjI007175; Tue, 1 Jan 2019 00:25:26 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201901010025.x010PQjI007175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 1 Jan 2019 00:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342661 - in head: . sys/sys X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in head: . sys/sys X-SVN-Commit-Revision: 342661 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E8F138BA6C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.977,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 00:25:27 -0000 Author: delphij Date: Tue Jan 1 00:25:25 2019 New Revision: 342661 URL: https://svnweb.freebsd.org/changeset/base/342661 Log: Happy New Year 2019! Modified: head/COPYRIGHT head/sys/sys/copyright.h Modified: head/COPYRIGHT ============================================================================== --- head/COPYRIGHT Mon Dec 31 23:30:31 2018 (r342660) +++ head/COPYRIGHT Tue Jan 1 00:25:25 2019 (r342661) @@ -4,7 +4,7 @@ The compilation of software known as FreeBSD is distributed under the following terms: -Copyright (c) 1992-2018 The FreeBSD Project. +Copyright (c) 1992-2019 The FreeBSD Project. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions Modified: head/sys/sys/copyright.h ============================================================================== --- head/sys/sys/copyright.h Mon Dec 31 23:30:31 2018 (r342660) +++ head/sys/sys/copyright.h Tue Jan 1 00:25:25 2019 (r342661) @@ -36,7 +36,7 @@ /* FreeBSD */ #define COPYRIGHT_FreeBSD \ - "Copyright (c) 1992-2018 The FreeBSD Project.\n" + "Copyright (c) 1992-2019 The FreeBSD Project.\n" /* Foundation */ #define TRADEMARK_Foundation \ From owner-svn-src-head@freebsd.org Tue Jan 1 01:15:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F1A51421A02; Tue, 1 Jan 2019 01:15:28 +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 F39328D788; Tue, 1 Jan 2019 01:15:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-3.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0874510B707; Mon, 31 Dec 2018 20:15:24 -0500 (EST) Subject: Re: svn commit: r342599 - head/sys/kern To: Kristof Provost , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812292136.wBTLa25i072560@repo.freebsd.org> From: John Baldwin Openpgp: preference=signencrypt Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Mon, 31 Dec 2018 17:15:23 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <201812292136.wBTLa25i072560@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 31 Dec 2018 20:15:25 -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.29 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, 01 Jan 2019 01:15:28 -0000 On 12/29/18 1:36 PM, Kristof Provost wrote: > Author: kp > Date: Sat Dec 29 21:36:02 2018 > New Revision: 342599 > URL: https://svnweb.freebsd.org/changeset/base/342599 > > Log: > Simplify jail ID printing on process exit > > As suggested by kib@, we don't need to check p_ucred, because that's only NULL > during process creation, and cr_prison is never NULL. > > Modified: > head/sys/kern/kern_sig.c > > Modified: head/sys/kern/kern_sig.c > ============================================================================== > --- head/sys/kern/kern_sig.c Sat Dec 29 21:18:01 2018 (r342598) > +++ head/sys/kern/kern_sig.c Sat Dec 29 21:36:02 2018 (r342599) > @@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p) > void > killproc(struct proc *p, char *why) > { > - int jid = -1; > > - if (p->p_ucred && p->p_ucred->cr_prison) > - jid = p->p_ucred->cr_prison->pr_id; > - > PROC_LOCK_ASSERT(p, MA_OWNED); > CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, > p->p_comm); > log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", > - p->p_pid, p->p_comm, jid, > + p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, > p->p_ucred ? p->p_ucred->cr_uid : -1, why); Could you fix the cr_uid cases to remove the ?: as a follow up? -- John Baldwin                                                                              From owner-svn-src-head@freebsd.org Tue Jan 1 04:57:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36C2D1429C3F; Tue, 1 Jan 2019 04:57:47 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D284F6E15C; Tue, 1 Jan 2019 04:57:46 +0000 (UTC) (envelope-from bcran@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C54981D176; Tue, 1 Jan 2019 04:57:46 +0000 (UTC) (envelope-from bcran@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x014vkiR049315; Tue, 1 Jan 2019 04:57:46 GMT (envelope-from bcran@FreeBSD.org) Received: (from bcran@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x014vkYR049314; Tue, 1 Jan 2019 04:57:46 GMT (envelope-from bcran@FreeBSD.org) Message-Id: <201901010457.x014vkYR049314@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcran set sender to bcran@FreeBSD.org using -f From: Rebecca Cran Date: Tue, 1 Jan 2019 04:57:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342666 - head/usr.sbin/efibootmgr X-SVN-Group: head X-SVN-Commit-Author: bcran X-SVN-Commit-Paths: head/usr.sbin/efibootmgr X-SVN-Commit-Revision: 342666 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D284F6E15C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 04:57:47 -0000 Author: bcran Date: Tue Jan 1 04:57:46 2019 New Revision: 342666 URL: https://svnweb.freebsd.org/changeset/base/342666 Log: Update the efibootmgr(8) man page to document changes to options. Modified: head/usr.sbin/efibootmgr/efibootmgr.8 Modified: head/usr.sbin/efibootmgr/efibootmgr.8 ============================================================================== --- head/usr.sbin/efibootmgr/efibootmgr.8 Tue Jan 1 00:48:25 2019 (r342665) +++ head/usr.sbin/efibootmgr/efibootmgr.8 Tue Jan 1 04:57:46 2019 (r342666) @@ -31,12 +31,13 @@ .Nm efibootmgr .Nd manipulate the EFI Boot Manager .Sh SYNOPSIS -.Op Fl aAnNB Ar bootnum +.Op Fl aAnNB +.Op Fl b Ar bootnum .Op Fl t Ar timeout .Op Fl T .Op Fl o Ar bootorder .Op Fl v -.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] [ Fl b Ar bootnum ] +.Op Fl c l Ar loader [ Fl k Ar kernel ] [ Fl L Ar label ] [ Fl -dry-run ] .Sh "DESCRIPTION" .Nm manipulates how UEFI Boot Managers boot the system. @@ -71,19 +72,19 @@ The path to and name of the loader. .It Fl k -kernel Ar kernel The path to and name of the kernel. .It Fl b -bootnum Ar bootnum -When creating a new entry, use bootnum as the index. -Fail if it already exists. +When creating or modifying an entry, use bootnum as the index. +When creating a new entry, fail if it already exists. .It Fl L -label Ar label An optional description for the entry. .It Fl D -dry-run Process but do not change any variables. -.It Fl B -delete Ar bootnum +.It Fl B -delete Delete the given bootnum boot entry. -.It Fl a -activate Ar bootnum -Activate the given bootnum boot entry. -.It Fl A -deactivate Ar bootnum +.It Fl a -activate +Activate the given bootnum boot entry, or the new entry when used with -c. +.It Fl A -deactivate Deactivate the given bootnum boot entry. -.It Fl n -bootnext Ar bootnum +.It Fl n -bootnext Set bootnum boot entry as the BootNext variable. .It Fl N -delete-bootnext Delete the BootNext optional variable. @@ -100,7 +101,7 @@ Display the device path of boot entries in the output. .Pp .Sh Examples .Pp -To Display the current Boot related variables in the system: +To display the current Boot related variables in the system: .Pp .Dl efibootmgr [-v] .Pp @@ -130,18 +131,18 @@ into the first position of current BootOrder variable must first be set to active before being considered available to attempt booting from, else they are ignored. .Pp -.Dl efibootmgr -B 0009 +.Dl efibootmgr -B -b 0009 .Pp Will delete the given boot entry Boot0009 .Pp To set a given newly created boot entry active use: .Pp -.Dl efibootmgr -a 0009 +.Dl efibootmgr -a -b 0009 .Pp To set a given boot entry to be used as the BootNext variable, irrespective of its active state, use: .Pp -.Dl efibootmgr -n 0009 +.Dl efibootmgr -n -b 0009 .Pp To set the BootOrder for the next reboot use: .Pp From owner-svn-src-head@freebsd.org Tue Jan 1 08:27:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81A971425E8A; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 213668A850; Tue, 1 Jan 2019 08:27:28 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from venus.codepro.be (venus.codepro.be [5.9.86.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.codepro.be", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: kp) by smtp.freebsd.org (Postfix) with ESMTPSA id C7194517; Tue, 1 Jan 2019 08:27:27 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from [10.0.2.193] (ptr-8rh08jyvagy17tghbsd.18120a2.ip6.access.telenet.be [IPv6:2a02:1811:240e:402:34da:bb47:a884:a9ed]) (Authenticated sender: kp) by venus.codepro.be (Postfix) with ESMTPSA id 15A05348AC; Tue, 1 Jan 2019 09:27:26 +0100 (CET) From: "Kristof Provost" To: "John Baldwin" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342599 - head/sys/kern Date: Tue, 01 Jan 2019 09:27:24 +0100 X-Mailer: MailMate (2.0BETAr6133) Message-ID: <99BBC967-981C-41CD-8928-98FEC7532F27@FreeBSD.org> In-Reply-To: References: <201812292136.wBTLa25i072560@repo.freebsd.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 213668A850 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.94 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.94)[-0.939,0] Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 08:27:28 -0000 On 1 Jan 2019, at 2:15, John Baldwin wrote: > On 12/29/18 1:36 PM, Kristof Provost wrote: >> Author: kp >> Date: Sat Dec 29 21:36:02 2018 >> New Revision: 342599 >> URL: https://svnweb.freebsd.org/changeset/base/342599 >> >> Log: >> Simplify jail ID printing on process exit >> >> As suggested by kib@, we don't need to check p_ucred, because = >> that's only NULL >> during process creation, and cr_prison is never NULL. >> >> Modified: >> head/sys/kern/kern_sig.c >> >> Modified: head/sys/kern/kern_sig.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/sys/kern/kern_sig.c Sat Dec 29 21:18:01 2018 (r342598) >> +++ head/sys/kern/kern_sig.c Sat Dec 29 21:36:02 2018 (r342599) >> @@ -3094,16 +3094,12 @@ proc_wkilled(struct proc *p) >> void >> killproc(struct proc *p, char *why) >> { >> - int jid =3D -1; >> >> - if (p->p_ucred && p->p_ucred->cr_prison) >> - jid =3D p->p_ucred->cr_prison->pr_id; >> - >> PROC_LOCK_ASSERT(p, MA_OWNED); >> CTR3(KTR_PROC, "killproc: proc %p (pid %d, %s)", p, p->p_pid, >> p->p_comm); >> log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", >> - p->p_pid, p->p_comm, jid, >> + p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, >> p->p_ucred ? p->p_ucred->cr_uid : -1, why); > > Could you fix the cr_uid cases to remove the ?: as a follow up? > Yes, although it=E2=80=99ll be a couple of days. Regards, Kristof=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 From owner-svn-src-head@freebsd.org Tue Jan 1 10:13:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 09B9414339BF; Tue, 1 Jan 2019 10:13:37 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4C648DD97; Tue, 1 Jan 2019 10:13:36 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from weatherwax.trouble.is (weatherwax.trouble.is [IPv6:2a00:dd80:3c::62e]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "weatherwax.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) (Authenticated sender: philip/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 67B50114E; Tue, 1 Jan 2019 10:13:36 +0000 (UTC) (envelope-from philip@freebsd.org) Received: from rincewind.trouble.is (rincewind.trouble.is [IPv6:2a01:4f9:2a:1715::1:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "rincewind.trouble.is", Issuer "Let's Encrypt Authority X3" (verified OK)) by weatherwax.trouble.is (Postfix) with ESMTPS id 43TVPn3Fqvz4fYY; Tue, 1 Jan 2019 10:13:33 +0000 (UTC) Received: by rincewind.trouble.is (Postfix, from userid 1001) id 43TVPl0xVZztG6; Tue, 1 Jan 2019 10:13:31 +0000 (UTC) Date: Tue, 1 Jan 2019 11:13:31 +0100 From: Philip Paeps To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342644 - head/contrib/tzdata Message-ID: <20190101101330.GC6386@rincewind.trouble.is> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201812310757.wBV7vbVw066175@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <201812310757.wBV7vbVw066175@repo.freebsd.org> X-PGP-Fingerprint: 2CD1 92C2 6EE7 B7D1 F552 6619 31AE B9B5 FDBB CB0E X-Date: Today is Sweetmorn, the 1st day of Chaos in the YOLD 3185 X-Phase-of-Moon: The Moon is Waning Crescent (21% of Full) X-Clacks-Overhead: GNU Terry Pratchett Organization: Happily Disorganized User-Agent: Mutt/1.11.1 (2018-12-01) X-Rspamd-Queue-Id: A4C648DD97 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[freebsd.org]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:96.47.64.0/20, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 10:13:37 -0000 On 2018-12-31 07:57:37 (+0000), Philip Paeps wrote: >Log: > Import tzdata 2018i > > Changes: https://github.com/eggert/tz/blob/2018i/NEWS > > MFC after: 2 days I merged this (and 2018h) back to stable/{12,11,10} a day early (today) because someone affected asked. I don't think the extra day of waiting in HEAD would have benefited anyone. Philip -- Philip Paeps Senior Reality Engineer Ministry of Information From owner-svn-src-head@freebsd.org Tue Jan 1 19:56:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D6961426B13; Tue, 1 Jan 2019 19:56:50 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA06283991; Tue, 1 Jan 2019 19:56:49 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCA6426C38; Tue, 1 Jan 2019 19:56:49 +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 x01JunIB027057; Tue, 1 Jan 2019 19:56:49 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01JunAj027056; Tue, 1 Jan 2019 19:56:49 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901011956.x01JunAj027056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 1 Jan 2019 19:56:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342670 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 342670 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DA06283991 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 19:56:50 -0000 Author: cem Date: Tue Jan 1 19:56:49 2019 New Revision: 342670 URL: https://svnweb.freebsd.org/changeset/base/342670 Log: linuxkpi: Remove extraneous NULL check on M_WAITOK allocation The check was not introduced in r342628, but the subsequent unchecked access to refs was added then, prompting a Coverity warning about "Null pointer dereferences (FORWARD_NULL)." The warning is bogus due to M_WAITOK, but so is the NULL check that hints it, so just remove it. CID: 1398588 Reported by: Coverity Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h Modified: head/sys/compat/linuxkpi/common/include/linux/cdev.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue Jan 1 10:05:36 2019 (r342669) +++ head/sys/compat/linuxkpi/common/include/linux/cdev.h Tue Jan 1 19:56:49 2019 (r342670) @@ -71,8 +71,7 @@ cdev_alloc(void) struct linux_cdev *cdev; cdev = kzalloc(sizeof(struct linux_cdev), M_WAITOK); - if (cdev != NULL) - kobject_init(&cdev->kobj, &linux_cdev_ktype); + kobject_init(&cdev->kobj, &linux_cdev_ktype); cdev->refs = 1; return (cdev); } From owner-svn-src-head@freebsd.org Tue Jan 1 20:12:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10991427246; Tue, 1 Jan 2019 20:12:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 440328440B; Tue, 1 Jan 2019 20:12:59 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 330CB26F95; Tue, 1 Jan 2019 20:12:59 +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 x01KCxeE037205; Tue, 1 Jan 2019 20:12:59 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01KCxZJ037204; Tue, 1 Jan 2019 20:12:59 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201901012012.x01KCxZJ037204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 1 Jan 2019 20:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342671 - head/libexec/rtld-elf/powerpc64 X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/libexec/rtld-elf/powerpc64 X-SVN-Commit-Revision: 342671 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 440328440B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.95)[-0.951,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 20:12:59 -0000 Author: jhibbits Date: Tue Jan 1 20:12:58 2019 New Revision: 342671 URL: https://svnweb.freebsd.org/changeset/base/342671 Log: rtld-elf: Fix powerpc64 TLS handling, matching powerpc's fix We need to subtract the TLS_TCB_SIZE to get to the real data pointer, since r13 points to the end of the TCB structure. Prior to this, devel/protobuf-c port broke with recent update to devel/protobuf, which exposed this issue. Submitted by: andreast Reported by: Piotr Kubaj MFC after: 1 week Modified: head/libexec/rtld-elf/powerpc64/reloc.c Modified: head/libexec/rtld-elf/powerpc64/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc64/reloc.c Tue Jan 1 19:56:49 2019 (r342670) +++ head/libexec/rtld-elf/powerpc64/reloc.c Tue Jan 1 20:12:58 2019 (r342671) @@ -256,7 +256,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_ *(Elf_Addr **)where = *where * sizeof(Elf_Addr) + (Elf_Addr *)(def->st_value + rela->r_addend - + defobj->tlsoffset - TLS_TP_OFFSET); + + defobj->tlsoffset - TLS_TP_OFFSET - TLS_TCB_SIZE); break; From owner-svn-src-head@freebsd.org Tue Jan 1 23:41:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E07B142DF6B; Tue, 1 Jan 2019 23:41:17 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 02FFE68242; Tue, 1 Jan 2019 23:41:17 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBA98129D; Tue, 1 Jan 2019 23:41:16 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x01NfGEM057006; Tue, 1 Jan 2019 23:41:16 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x01NfGtN057005; Tue, 1 Jan 2019 23:41:16 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901012341.x01NfGtN057005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 1 Jan 2019 23:41:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342672 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342672 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 02FFE68242 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 01 Jan 2019 23:41:17 -0000 Author: avos Date: Tue Jan 1 23:41:16 2019 New Revision: 342672 URL: https://svnweb.freebsd.org/changeset/base/342672 Log: rtwn_pci: fix excessive packet loss on Tx with RTL8188EE. Use proper flags for bus_dmamap_sync() in Tx path. Tested with: RTL8188EE, STA mode MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_tx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_tx.c Tue Jan 1 20:12:58 2019 (r342671) +++ head/sys/dev/rtwn/pci/rtwn_pci_tx.c Tue Jan 1 23:41:16 2019 (r342672) @@ -174,8 +174,8 @@ rtwn_pci_tx_start_frame(struct rtwn_softc *sc, struct rtwn_dump_tx_desc(sc, txd); bus_dmamap_sync(ring->desc_dmat, ring->desc_map, - BUS_DMASYNC_POSTWRITE); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTWRITE); + BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE); + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_PREWRITE); data->m = m; data->ni = ni; From owner-svn-src-head@freebsd.org Wed Jan 2 04:08:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6DF951433B4E; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F702709C0; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03E69431B; Wed, 2 Jan 2019 04:08:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0248bBf096293; Wed, 2 Jan 2019 04:08:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0248bw2096291; Wed, 2 Jan 2019 04:08:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020408.x0248bw2096291@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342673 - in head/sys/dev/rtwn/rtl8192c: . pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8192c: . pci X-SVN-Commit-Revision: 342673 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F702709C0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 04:08:38 -0000 Author: avos Date: Wed Jan 2 04:08:37 2019 New Revision: 342673 URL: https://svnweb.freebsd.org/changeset/base/342673 Log: rtwn(4): provide register definitions for RTL8188CE calibration routines. No functional change intended. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c head/sys/dev/rtwn/rtl8192c/r92c_reg.h Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c Tue Jan 1 23:41:16 2019 (r342672) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_calib.c Wed Jan 2 04:08:37 2019 (r342673) @@ -75,55 +75,58 @@ r92ce_iq_calib_chain(struct rtwn_softc *sc, int chain, uint16_t rx[2]) { uint32_t status; - int offset = chain * 0x20; if (chain == 0) { /* IQ calibration for chain 0. */ /* IQ calibration settings for chain 0. */ - rtwn_bb_write(sc, 0xe30, 0x10008c1f); - rtwn_bb_write(sc, 0xe34, 0x10008c1f); - rtwn_bb_write(sc, 0xe38, 0x82140102); + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x10008c1f); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x10008c1f); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82140102); if (sc->ntxchains > 1) { - rtwn_bb_write(sc, 0xe3c, 0x28160202); /* 2T */ + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160202); /* IQ calibration settings for chain 1. */ - rtwn_bb_write(sc, 0xe50, 0x10008c22); - rtwn_bb_write(sc, 0xe54, 0x10008c22); - rtwn_bb_write(sc, 0xe58, 0x82140102); - rtwn_bb_write(sc, 0xe5c, 0x28160202); + rtwn_bb_write(sc, R92C_TX_IQK_TONE(1), 0x10008c22); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(1), 0x10008c22); + rtwn_bb_write(sc, R92C_TX_IQK_PI(1), 0x82140102); + rtwn_bb_write(sc, R92C_RX_IQK_PI(1), 0x28160202); } else - rtwn_bb_write(sc, 0xe3c, 0x28160502); /* 1T */ + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160502); /* LO calibration settings. */ - rtwn_bb_write(sc, 0xe4c, 0x001028d1); + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x001028d1); /* We're doing LO and IQ calibration in one shot. */ - rtwn_bb_write(sc, 0xe48, 0xf9000000); - rtwn_bb_write(sc, 0xe48, 0xf8000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); } else { /* IQ calibration for chain 1. */ /* We're doing LO and IQ calibration in one shot. */ - rtwn_bb_write(sc, 0xe60, 0x00000002); - rtwn_bb_write(sc, 0xe60, 0x00000000); + rtwn_bb_write(sc, R92C_IQK_AGC_CONT, 2); + rtwn_bb_write(sc, R92C_IQK_AGC_CONT, 0); } /* Give LO and IQ calibrations the time to complete. */ rtwn_delay(sc, 1000); /* Read IQ calibration status. */ - status = rtwn_bb_read(sc, 0xeac); + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); if (status & (1 << (28 + chain * 3))) return (0); /* Tx failed. */ /* Read Tx IQ calibration results. */ - tx[0] = (rtwn_bb_read(sc, 0xe94 + offset) >> 16) & 0x3ff; - tx[1] = (rtwn_bb_read(sc, 0xe9c + offset) >> 16) & 0x3ff; + tx[0] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_BEFORE(chain)), + R92C_POWER_IQK_RESULT); + tx[1] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_AFTER(chain)), + R92C_POWER_IQK_RESULT); if (tx[0] == 0x142 || tx[1] == 0x042) return (0); /* Tx failed. */ if (status & (1 << (27 + chain * 3))) return (1); /* Rx failed. */ /* Read Rx IQ calibration results. */ - rx[0] = (rtwn_bb_read(sc, 0xea4 + offset) >> 16) & 0x3ff; - rx[1] = (rtwn_bb_read(sc, 0xeac + offset) >> 16) & 0x3ff; + rx[0] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_BEFORE(chain)), + R92C_POWER_IQK_RESULT); + rx[1] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(chain)), + R92C_POWER_IQK_RESULT); if (rx[0] == 0x132 || rx[1] == 0x036) return (1); /* Rx failed. */ @@ -200,18 +203,18 @@ r92ce_iq_calib_run(struct rtwn_softc *sc, int n, uint1 if (sc->ntxchains > 1) rtwn_bb_write(sc, 0x0b6c, 0x00080000); - rtwn_bb_write(sc, 0x0e28, 0x80800000); - rtwn_bb_write(sc, 0x0e40, 0x01007c00); - rtwn_bb_write(sc, 0x0e44, 0x01004800); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); rtwn_bb_write(sc, 0x0b68, 0x00080000); for (chain = 0; chain < sc->ntxchains; chain++) { if (chain > 0) { /* Put chain 0 on standby. */ - rtwn_bb_write(sc, 0x0e28, 0x00); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00010000); - rtwn_bb_write(sc, 0x0e28, 0x80800000); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); /* Enable chain 1. */ for (i = 0; i < nitems(reg_adda); i++) @@ -257,7 +260,7 @@ r92ce_iq_calib_run(struct rtwn_softc *sc, int n, uint1 vals->fpga0_rfifacesw1); rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, vals->ofdm0_trmuxpar); - rtwn_bb_write(sc, 0x0e28, 0x00); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00032ed3); if (sc->ntxchains > 1) rtwn_bb_write(sc, R92C_LSSI_PARAM(1), 0x00032ed3); Modified: head/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_reg.h Tue Jan 1 23:41:16 2019 (r342672) +++ head/sys/dev/rtwn/rtl8192c/r92c_reg.h Wed Jan 2 04:08:37 2019 (r342673) @@ -691,6 +691,7 @@ #define R92C_FPGA1_TXINFO 0x90c #define R92C_CCK0_SYSTEM 0xa00 #define R92C_CCK0_AFESETTING 0xa04 +#define R92C_CONFIG_ANT(chain) (0xb68 + (chain) * 4) #define R92C_OFDM0_TRXPATHENA 0xc04 #define R92C_OFDM0_TRMUXPAR 0xc08 #define R92C_OFDM0_RXIQIMBALANCE(chain) (0xc14 + (chain) * 8) @@ -703,6 +704,20 @@ #define R92C_OFDM0_RXIQEXTANTA 0xca0 #define R92C_OFDM0_TXPSEUDONOISEWGT 0xce4 #define R92C_OFDM1_LSTF 0xd00 +#define R92C_FPGA0_IQK 0xe28 +#define R92C_TX_IQK_TONE(chain) (0xe30 + (chain) * 32) +#define R92C_RX_IQK_TONE(chain) (0xe34 + (chain) * 32) +#define R92C_TX_IQK_PI(chain) (0xe38 + (chain) * 32) +#define R92C_RX_IQK_PI(chain) (0xe3c + (chain) * 32) +#define R92C_TX_IQK 0xe40 +#define R92C_RX_IQK 0xe44 +#define R92C_IQK_AGC_PTS 0xe48 +#define R92C_IQK_AGC_RSP 0xe4c +#define R92C_IQK_AGC_CONT 0xe60 +#define R92C_TX_POWER_IQK_BEFORE(chain) (0xe94 + (chain) * 32) +#define R92C_TX_POWER_IQK_AFTER(chain) (0xe9c + (chain) * 32) +#define R92C_RX_POWER_IQK_BEFORE(chain) (0xea4 + (chain) * 32) +#define R92C_RX_POWER_IQK_AFTER(chain) (0xeac + (chain) * 32) /* Bits for R92C_FPGA[01]_RFMOD. */ #define R92C_RFMOD_40MHZ 0x00000001 @@ -827,6 +842,10 @@ /* Bits for R92C_OFDM0_AGCCORE1(i). */ #define R92C_OFDM0_AGCCORE1_GAIN_M 0x0000007f #define R92C_OFDM0_AGCCORE1_GAIN_S 0 + +/* Bits for R92C_[RT]X_POWER_IQK*. */ +#define R92C_POWER_IQK_RESULT_S 16 +#define R92C_POWER_IQK_RESULT_M 0x03ff0000 /* From owner-svn-src-head@freebsd.org Wed Jan 2 04:19:30 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08D0D1433E25; Wed, 2 Jan 2019 04:19:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F4E870E27; Wed, 2 Jan 2019 04:19:29 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52E9A44C1; Wed, 2 Jan 2019 04:19:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024JT9H001413; Wed, 2 Jan 2019 04:19:29 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024JSPP001411; Wed, 2 Jan 2019 04:19:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020419.x024JSPP001411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:19:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342674 - head/sys/dev/rtwn/rtl8188e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/rtl8188e X-SVN-Commit-Revision: 342674 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F4E870E27 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 04:19:30 -0000 Author: avos Date: Wed Jan 2 04:19:28 2019 New Revision: 342674 URL: https://svnweb.freebsd.org/changeset/base/342674 Log: rtwn(4): add IQ calibration support for RTL8188E* Tested with: * RTL8188EE, STA mode. * RTL8188EU, STA mode. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_calib.c head/sys/dev/rtwn/rtl8188e/r88e_reg.h Modified: head/sys/dev/rtwn/rtl8188e/r88e_calib.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_calib.c Wed Jan 2 04:08:37 2019 (r342673) +++ head/sys/dev/rtwn/rtl8188e/r88e_calib.c Wed Jan 2 04:19:28 2019 (r342674) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2016 Andriy Voskoboinyk + * Copyright (c) 2016-2019 Andriy Voskoboinyk * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -42,16 +42,343 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include +/* Registers to save and restore during IQ calibration. */ +struct r88e_iq_cal_reg_vals { + uint32_t adda[16]; + uint8_t txpause; + uint8_t bcn_ctrl[2]; + uint32_t gpio_muxcfg; + uint32_t cck0_afesetting; + uint32_t ofdm0_trxpathena; + uint32_t ofdm0_trmuxpar; + uint32_t fpga0_rfifacesw0; + uint32_t fpga0_rfifacesw1; + uint32_t fpga0_rfifaceoe0; + uint32_t fpga0_rfifaceoe1; + uint32_t config_ant0; + uint32_t config_ant1; +}; + +static int +r88e_iq_calib_chain(struct rtwn_softc *sc, uint16_t tx[2], uint16_t rx[2]) +{ + uint32_t status; + + /* Set Rx IQ calibration mode table. */ + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_rf_write(sc, 0, R88E_RF_WE_LUT, 0x800a0); + rtwn_rf_write(sc, 0, R92C_RF_RCK_OS, 0x30000); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(0), 0xf); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(1), 0xf117b); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + + /* IQ calibration settings. */ + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x81004800); + + /* IQ calibration settings for chain 0. */ + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x10008c1c); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x30008c1c); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82160804); + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160000); + + /* LO calibration settings. */ + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x0046a911); + + /* We're doing LO and IQ calibration in one shot. */ + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); + + /* Give LO and IQ calibrations the time to complete. */ + rtwn_delay(sc, 10000); + + /* Read IQ calibration status. */ + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); + if (status & (1 << 28)) + return (0); /* Tx failed. */ + + /* Read Tx IQ calibration results. */ + tx[0] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_BEFORE(0)), + R92C_POWER_IQK_RESULT); + tx[1] = MS(rtwn_bb_read(sc, R92C_TX_POWER_IQK_AFTER(0)), + R92C_POWER_IQK_RESULT); + if (tx[0] == 0x142 || tx[1] == 0x042) + return (0); /* Tx failed. */ + + rtwn_bb_write(sc, R92C_TX_IQK, 0x80007c00 | (tx[0] << 16) | tx[1]); + + /* Set Rx IQ calibration mode table. */ + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_rf_write(sc, 0, R88E_RF_WE_LUT, 0x800a0); + rtwn_rf_write(sc, 0, R92C_RF_RCK_OS, 0x30000); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(0), 0xf); + rtwn_rf_write(sc, 0, R92C_RF_TXPA_G(1), 0xf7ffa); + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + + /* IQ calibration settings. */ + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); + + /* IQ calibration settings for chain 0. */ + rtwn_bb_write(sc, R92C_TX_IQK_TONE(0), 0x30008c1c); + rtwn_bb_write(sc, R92C_RX_IQK_TONE(0), 0x10008c1c); + rtwn_bb_write(sc, R92C_TX_IQK_PI(0), 0x82160c05); + rtwn_bb_write(sc, R92C_RX_IQK_PI(0), 0x28160c05); + + /* LO calibration settings. */ + rtwn_bb_write(sc, R92C_IQK_AGC_RSP, 0x0046a911); + + /* We're doing LO and IQ calibration in one shot. */ + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf9000000); + rtwn_bb_write(sc, R92C_IQK_AGC_PTS, 0xf8000000); + + /* Give LO and IQ calibrations the time to complete. */ + rtwn_delay(sc, 10000); + + /* Read IQ calibration status. */ + status = rtwn_bb_read(sc, R92C_RX_POWER_IQK_AFTER(0)); + if (status & (1 << 27)) + return (1); /* Rx failed. */ + + /* Read Rx IQ calibration results. */ + rx[0] = MS(rtwn_bb_read(sc, R92C_RX_POWER_IQK_BEFORE(0)), + R92C_POWER_IQK_RESULT); + rx[1] = MS(status, R92C_POWER_IQK_RESULT); + if (rx[0] == 0x132 || rx[1] == 0x036) + return (1); /* Rx failed. */ + + return (3); /* Both Tx and Rx succeeded. */ +} + +static void +r88e_iq_calib_run(struct rtwn_softc *sc, int n, uint16_t tx[2], + uint16_t rx[2], struct r88e_iq_cal_reg_vals *vals) +{ + /* Registers to save and restore during IQ calibration. */ + static const uint16_t reg_adda[16] = { + 0x85c, 0xe6c, 0xe70, 0xe74, + 0xe78, 0xe7c, 0xe80, 0xe84, + 0xe88, 0xe8c, 0xed0, 0xed4, + 0xed8, 0xedc, 0xee0, 0xeec + }; + int i; + uint32_t hssi_param1; + + if (n == 0) { + for (i = 0; i < nitems(reg_adda); i++) + vals->adda[i] = rtwn_bb_read(sc, reg_adda[i]); + + vals->txpause = rtwn_read_1(sc, R92C_TXPAUSE); + vals->bcn_ctrl[0] = rtwn_read_1(sc, R92C_BCN_CTRL(0)); + vals->bcn_ctrl[1] = rtwn_read_1(sc, R92C_BCN_CTRL(1)); + vals->gpio_muxcfg = rtwn_read_4(sc, R92C_GPIO_MUXCFG); + } + + rtwn_bb_write(sc, reg_adda[0], 0x0b1b25a0); + for (i = 1; i < nitems(reg_adda); i++) + rtwn_bb_write(sc, reg_adda[i], 0x0bdb25a0); + + hssi_param1 = rtwn_bb_read(sc, R92C_HSSI_PARAM1(0)); + if (!(hssi_param1 & R92C_HSSI_PARAM1_PI)) { + rtwn_bb_write(sc, R92C_HSSI_PARAM1(0), + hssi_param1 | R92C_HSSI_PARAM1_PI); + rtwn_bb_write(sc, R92C_HSSI_PARAM1(1), + hssi_param1 | R92C_HSSI_PARAM1_PI); + } + + if (n == 0) { + vals->cck0_afesetting = rtwn_bb_read(sc, R92C_CCK0_AFESETTING); + vals->ofdm0_trxpathena = + rtwn_bb_read(sc, R92C_OFDM0_TRXPATHENA); + vals->ofdm0_trmuxpar = rtwn_bb_read(sc, R92C_OFDM0_TRMUXPAR); + vals->fpga0_rfifacesw0 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACESW(0)); + vals->fpga0_rfifacesw1 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACESW(1)); + vals->fpga0_rfifaceoe0 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(0)); + vals->fpga0_rfifaceoe1 = + rtwn_bb_read(sc, R92C_FPGA0_RFIFACEOE(1)); + vals->config_ant0 = rtwn_bb_read(sc, R92C_CONFIG_ANT(0)); + vals->config_ant1 = rtwn_bb_read(sc, R92C_CONFIG_ANT(1)); + } + + rtwn_bb_setbits(sc, R92C_CCK0_AFESETTING, 0, 0x0f000000); + rtwn_bb_write(sc, R92C_OFDM0_TRXPATHENA, 0x03a05600); + rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, 0x000800e4); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(1), 0x22204000); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACESW(0), 0, 0x04000400); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACEOE(0), 0x400, 0); + rtwn_bb_setbits(sc, R92C_FPGA0_RFIFACEOE(1), 0x400, 0); + + rtwn_write_1(sc, R92C_TXPAUSE, + R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | R92C_TX_QUEUE_HIGH); + rtwn_write_1(sc, R92C_BCN_CTRL(0), + vals->bcn_ctrl[0] & ~R92C_BCN_CTRL_EN_BCN); + rtwn_write_1(sc, R92C_BCN_CTRL(1), + vals->bcn_ctrl[1] & ~R92C_BCN_CTRL_EN_BCN); + rtwn_write_1(sc, R92C_GPIO_MUXCFG, + vals->gpio_muxcfg & ~R92C_GPIO_MUXCFG_ENBT); + + rtwn_bb_write(sc, R92C_CONFIG_ANT(0), 0x0f600000); + + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0x80800000); + rtwn_bb_write(sc, R92C_TX_IQK, 0x01007c00); + rtwn_bb_write(sc, R92C_RX_IQK, 0x01004800); + + /* Run IQ calibration twice. */ + for (i = 0; i < 2; i++) { + int ret; + + ret = r88e_iq_calib_chain(sc, tx, rx); + if (ret == 0) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Tx failed.\n", + __func__); + tx[0] = 0xff; + tx[1] = 0xff; + rx[0] = 0xff; + rx[1] = 0xff; + } else if (ret == 1) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Rx failed.\n", + __func__); + rx[0] = 0xff; + rx[1] = 0xff; + } else if (ret == 3) { + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, "%s: Both Tx and Rx" + " succeeded.\n", __func__); + } + } + + RTWN_DPRINTF(sc, RTWN_DEBUG_CALIB, + "%s: results for run %d: tx[0] 0x%x, tx[1] 0x%x, rx[0] 0x%x, " + "rx[1] 0x%x\n", __func__, n, tx[0], tx[1], rx[0], rx[1]); + + rtwn_bb_write(sc, R92C_CCK0_AFESETTING, vals->cck0_afesetting); + rtwn_bb_write(sc, R92C_OFDM0_TRXPATHENA, vals->ofdm0_trxpathena); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(0), vals->fpga0_rfifacesw0); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACESW(1), vals->fpga0_rfifacesw1); + rtwn_bb_write(sc, R92C_OFDM0_TRMUXPAR, vals->ofdm0_trmuxpar); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(0), vals->fpga0_rfifaceoe0); + rtwn_bb_write(sc, R92C_FPGA0_RFIFACEOE(1), vals->fpga0_rfifaceoe1); + rtwn_bb_write(sc, R92C_CONFIG_ANT(0), vals->config_ant0); + rtwn_bb_write(sc, R92C_CONFIG_ANT(1), vals->config_ant1); + + rtwn_bb_write(sc, R92C_FPGA0_IQK, 0); + rtwn_bb_write(sc, R92C_LSSI_PARAM(0), 0x00032ed3); + + if (n != 0) { + if (!(hssi_param1 & R92C_HSSI_PARAM1_PI)) { + rtwn_bb_write(sc, R92C_HSSI_PARAM1(0), hssi_param1); + rtwn_bb_write(sc, R92C_HSSI_PARAM1(1), hssi_param1); + } + + for (i = 0; i < nitems(reg_adda); i++) + rtwn_bb_write(sc, reg_adda[i], vals->adda[i]); + + rtwn_write_1(sc, R92C_TXPAUSE, vals->txpause); + rtwn_write_1(sc, R92C_BCN_CTRL(0), vals->bcn_ctrl[0]); + rtwn_write_1(sc, R92C_BCN_CTRL(1), vals->bcn_ctrl[1]); + rtwn_write_4(sc, R92C_GPIO_MUXCFG, vals->gpio_muxcfg); + } +} + +#define RTWN_IQ_CAL_MAX_TOLERANCE 5 +static int +r88e_iq_calib_compare_results(struct rtwn_softc *sc, uint16_t tx1[2], + uint16_t rx1[2], uint16_t tx2[2], uint16_t rx2[2]) +{ + int i, tx_ok, rx_ok; + + tx_ok = rx_ok = 0; + for (i = 0; i < 2; i++) { + if (tx1[i] == 0xff || tx2[i] == 0xff || + rx1[i] == 0xff || rx2[i] == 0xff) + continue; + + tx_ok = (abs(tx1[i] - tx2[i]) <= RTWN_IQ_CAL_MAX_TOLERANCE); + rx_ok = (abs(rx1[i] - rx2[i]) <= RTWN_IQ_CAL_MAX_TOLERANCE); + } + + return (tx_ok && rx_ok); +} +#undef RTWN_IQ_CAL_MAX_TOLERANCE + +static void +r88e_iq_calib_write_results(struct rtwn_softc *sc, uint16_t tx[2], + uint16_t rx[2]) +{ + uint32_t reg, val, x; + long y, tx_c; + + if (tx[0] == 0xff || tx[1] == 0xff) + return; + + reg = rtwn_bb_read(sc, R92C_OFDM0_TXIQIMBALANCE(0)); + val = ((reg >> 22) & 0x3ff); + x = tx[0]; + if (x & 0x00000200) + x |= 0xfffffc00; + reg = (((x * val) >> 8) & 0x3ff); + rtwn_bb_setbits(sc, R92C_OFDM0_TXIQIMBALANCE(0), 0x3ff, reg); + rtwn_bb_setbits(sc, R92C_OFDM0_ECCATHRESHOLD, 0x80000000, + ((x * val) & 0x80) << 24); + + y = tx[1]; + if (y & 0x00000200) + y |= 0xfffffc00; + tx_c = (y * val) >> 8; + rtwn_bb_setbits(sc, R92C_OFDM0_TXAFE(0), 0xf0000000, + (tx_c & 0x3c0) << 22); + rtwn_bb_setbits(sc, R92C_OFDM0_TXIQIMBALANCE(0), 0x003f0000, + (tx_c & 0x3f) << 16); + rtwn_bb_setbits(sc, R92C_OFDM0_ECCATHRESHOLD, 0x20000000, + ((y * val) & 0x80) << 22); + + if (rx[0] == 0xff || rx[1] == 0xff) + return; + + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQIMBALANCE(0), 0x3ff, + rx[0] & 0x3ff); + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQIMBALANCE(0), 0xfc00, + (rx[1] & 0x3f) << 10); + rtwn_bb_setbits(sc, R92C_OFDM0_RXIQEXTANTA, 0xf0000000, + (rx[1] & 0x3c0) << 22); +} + +#define RTWN_IQ_CAL_NRUN 3 void r88e_iq_calib(struct rtwn_softc *sc) { - /* XXX TODO */ + struct r88e_iq_cal_reg_vals vals; + uint16_t tx[RTWN_IQ_CAL_NRUN][2], rx[RTWN_IQ_CAL_NRUN][2]; + int n, valid; + + KASSERT(sc->ntxchains == 1, + ("%s: only 1T1R configuration is supported!\n", __func__)); + + valid = 0; + for (n = 0; n < RTWN_IQ_CAL_NRUN; n++) { + r88e_iq_calib_run(sc, n, tx[n], rx[n], &vals); + + if (n == 0) + continue; + + /* Valid results remain stable after consecutive runs. */ + valid = r88e_iq_calib_compare_results(sc, tx[n - 1], + rx[n - 1], tx[n], rx[n]); + if (valid) + break; + } + + if (valid) + r88e_iq_calib_write_results(sc, tx[n], rx[n]); } +#undef RTWN_IQ_CAL_NRUN void r88e_temp_measure(struct rtwn_softc *sc) Modified: head/sys/dev/rtwn/rtl8188e/r88e_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_reg.h Wed Jan 2 04:08:37 2019 (r342673) +++ head/sys/dev/rtwn/rtl8188e/r88e_reg.h Wed Jan 2 04:19:28 2019 (r342674) @@ -79,6 +79,7 @@ * RF (6052) registers. */ #define R88E_RF_T_METER 0x42 +#define R88E_RF_WE_LUT 0xef /* Bits for R92C_RF_CHNLBW. */ #define R88E_RF_CHNLBW_BW20 0x00c00 From owner-svn-src-head@freebsd.org Wed Jan 2 04:27:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83A8C14340EA; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2515D712E8; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09D7D46B9; Wed, 2 Jan 2019 04:27:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024RdVt006769; Wed, 2 Jan 2019 04:27:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024RdrK006768; Wed, 2 Jan 2019 04:27:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020427.x024RdrK006768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:27:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342675 - in head/sys/dev/rtwn: rtl8188e/usb rtl8192e/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e/usb rtl8192e/usb X-SVN-Commit-Revision: 342675 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2515D712E8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 04:27:40 -0000 Author: avos Date: Wed Jan 2 04:27:39 2019 New Revision: 342675 URL: https://svnweb.freebsd.org/changeset/base/342675 Log: rtwn(4): drop obsolete comment + use 'nop' function for 92eu calibration RTL8192EU was not tested with previously added code. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:19:28 2019 (r342674) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:27:39 2019 (r342675) @@ -149,7 +149,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_llt_init = r92c_llt_init; sc->sc_set_page_size = r92c_set_page_size; sc->sc_lc_calib = r92c_lc_calib; - sc->sc_iq_calib = r88e_iq_calib; /* XXX TODO */ + sc->sc_iq_calib = r88e_iq_calib; sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; sc->sc_adj_devcaps = r88eu_adj_devcaps; sc->sc_vap_preattach = rtwn_nop_softc_vap; Modified: head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Wed Jan 2 04:19:28 2019 (r342674) +++ head/sys/dev/rtwn/rtl8192e/usb/r92eu_attach.c Wed Jan 2 04:27:39 2019 (r342675) @@ -135,7 +135,7 @@ r92eu_attach(struct rtwn_usb_softc *uc) sc->sc_llt_init = r92e_llt_init; sc->sc_set_page_size = rtwn_nop_int_softc; sc->sc_lc_calib = r92c_lc_calib; - sc->sc_iq_calib = r88e_iq_calib; /* XXX TODO */ + sc->sc_iq_calib = rtwn_nop_softc; /* XXX TODO */ sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; sc->sc_adj_devcaps = r92eu_adj_devcaps; sc->sc_vap_preattach = rtwn_nop_softc_vap; From owner-svn-src-head@freebsd.org Wed Jan 2 04:56:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E87B71434E5C; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8A1A972284; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 747BF4BC1; Wed, 2 Jan 2019 04:56:36 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x024uaAT022299; Wed, 2 Jan 2019 04:56:36 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x024ua0O022298; Wed, 2 Jan 2019 04:56:36 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020456.x024ua0O022298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 04:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342676 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342676 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A1A972284 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 04:56:37 -0000 Author: avos Date: Wed Jan 2 04:56:36 2019 New Revision: 342676 URL: https://svnweb.freebsd.org/changeset/base/342676 Log: rtwn_pci(4): use proper bus_dmamap_sync flags after Tx (sync with r342672) MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:27:39 2019 (r342675) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:56:36 2019 (r342676) @@ -197,7 +197,8 @@ rtwn_pci_tx_done(struct rtwn_softc *sc, int qid) RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: qid %d, last %d, cur %d\n", __func__, qid, ring->last, ring->cur); - bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); while(ring->last != ring->cur) { data = &ring->tx_data[ring->last]; From owner-svn-src-head@freebsd.org Wed Jan 2 05:21:10 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 659411435BE8; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 16EF272FC7; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 095AC4F54; Wed, 2 Jan 2019 05:21:10 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025LAgo033517; Wed, 2 Jan 2019 05:21:10 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025L7rY033503; Wed, 2 Jan 2019 05:21:07 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020521.x025L7rY033503@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:21:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342677 - in head/sys: dev/rtwn/pci dev/rtwn/rtl8188e dev/rtwn/rtl8188e/usb dev/rtwn/rtl8192c dev/rtwn/rtl8192c/pci dev/rtwn/rtl8192c/usb modules/rtwn_usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys: dev/rtwn/pci dev/rtwn/rtl8188e dev/rtwn/rtl8188e/usb dev/rtwn/rtl8192c dev/rtwn/rtl8192c/pci dev/rtwn/rtl8192c/usb modules/rtwn_usb X-SVN-Commit-Revision: 342677 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 16EF272FC7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 05:21:10 -0000 Author: avos Date: Wed Jan 2 05:21:06 2019 New Revision: 342677 URL: https://svnweb.freebsd.org/changeset/base/342677 Log: rtwn_pci(4): add support for event-based Tx reports. It will be used for RTL8188EE (and, probably, others). MFC after: 4 days Deleted: head/sys/dev/rtwn/rtl8188e/usb/r88eu_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c head/sys/dev/rtwn/pci/rtwn_pci_var.h head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_rx.c head/sys/dev/rtwn/rtl8188e/usb/r88eu.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce.h head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c head/sys/dev/rtwn/rtl8192c/r92c.h head/sys/dev/rtwn/rtl8192c/r92c_rx.c head/sys/dev/rtwn/rtl8192c/usb/r92cu.h head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c head/sys/modules/rtwn_usb/Makefile Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -83,12 +83,12 @@ rtwn_pci_setup_rx_desc(struct rtwn_pci_softc *pc, } static void -rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_rx_stat_pci *rx_desc, - int desc_idx) +rtwn_pci_rx_frame(struct rtwn_pci_softc *pc) { - struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); + struct rtwn_softc *sc = &pc->pc_sc; struct rtwn_rx_ring *ring = &pc->rx_ring; - struct rtwn_rx_data *rx_data = &ring->rx_data[desc_idx]; + struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni; uint32_t rxdw0; @@ -148,9 +148,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_r panic("%s: could not load old RX mbuf", device_get_name(sc->sc_dev)); - /* Physical address may have changed. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, - MJUMPAGESIZE, desc_idx); goto fail; } @@ -165,10 +162,6 @@ rtwn_pci_rx_frame(struct rtwn_softc *sc, struct rtwn_r "%s: Rx frame len %d, infosz %d, shift %d\n", __func__, pktlen, infosz, shift); - /* Update RX descriptor. */ - rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, MJUMPAGESIZE, - desc_idx); - /* Send the frame to the 802.11 layer. */ RTWN_UNLOCK(sc); if (ni != NULL) { @@ -186,7 +179,73 @@ fail: counter_u64_add(ic->ic_ierrors, 1); } +static int +rtwn_pci_rx_buf_copy(struct rtwn_pci_softc *pc) +{ + struct rtwn_rx_ring *ring = &pc->rx_ring; + struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + struct rtwn_rx_data *rx_data = &ring->rx_data[ring->cur]; + uint32_t rxdw0; + int desc_size, pktlen; + + /* + * NB: tx_report() / c2h_report() expects to see USB Rx + * descriptor - same as for PCIe, but without rxbufaddr* fields. + */ + desc_size = sizeof(struct rtwn_rx_stat_common); + KASSERT(sizeof(pc->pc_rx_buf) < desc_size, + ("adjust size for PCIe Rx buffer!")); + + memcpy(pc->pc_rx_buf, rx_desc, desc_size); + + rxdw0 = le32toh(rx_desc->rxdw0); + pktlen = MS(rxdw0, RTWN_RXDW0_PKTLEN); + + if (pktlen > sizeof(pc->pc_rx_buf) - desc_size) + { + /* Looks like an ordinary Rx frame. */ + return (desc_size); + } + + bus_dmamap_sync(ring->data_dmat, rx_data->map, BUS_DMASYNC_POSTREAD); + memcpy(pc->pc_rx_buf + desc_size, mtod(rx_data->m, void *), pktlen); + + return (desc_size + pktlen); +} + static void +rtwn_pci_tx_report(struct rtwn_pci_softc *pc, int len) +{ + struct rtwn_softc *sc = &pc->pc_sc; + + if (sc->sc_ratectl != RTWN_RATECTL_NET80211) { + /* shouldn't happen */ + device_printf(sc->sc_dev, + "%s called while ratectl = %d!\n", + __func__, sc->sc_ratectl); + return; + } + + RTWN_NT_LOCK(sc); + rtwn_handle_tx_report(sc, pc->pc_rx_buf, len); + RTWN_NT_UNLOCK(sc); + +#ifdef IEEE80211_SUPPORT_SUPERG + /* + * NB: this will executed only when 'report' bit is set. + */ + if (sc->sc_tx_n_active > 0 && --sc->sc_tx_n_active <= 1) + rtwn_cmd_sleepable(sc, NULL, 0, rtwn_ff_flush_all); +#endif +} + +static void +rtwn_pci_c2h_report(struct rtwn_pci_softc *pc, int len) +{ + rtwn_handle_c2h_report(&pc->pc_sc, pc->pc_rx_buf, len); +} + +static void rtwn_pci_tx_done(struct rtwn_softc *sc, int qid) { struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); @@ -263,21 +322,50 @@ rtwn_pci_rx_done(struct rtwn_softc *sc) { struct rtwn_pci_softc *pc = RTWN_PCI_SOFTC(sc); struct rtwn_rx_ring *ring = &pc->rx_ring; + struct rtwn_rx_stat_pci *rx_desc; + struct rtwn_rx_data *rx_data; + int len; bus_dmamap_sync(ring->desc_dmat, ring->desc_map, BUS_DMASYNC_POSTREAD); for (;;) { - struct rtwn_rx_stat_pci *rx_desc = &ring->desc[ring->cur]; + rx_desc = &ring->desc[ring->cur]; + rx_data = &ring->rx_data[ring->cur]; if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) break; - rtwn_pci_rx_frame(sc, rx_desc, ring->cur); + len = rtwn_pci_rx_buf_copy(pc); + switch (rtwn_classify_intr(sc, pc->pc_rx_buf, len)) { + case RTWN_RX_DATA: + rtwn_pci_rx_frame(pc); + break; + case RTWN_RX_TX_REPORT: + rtwn_pci_tx_report(pc, len); + break; + case RTWN_RX_OTHER: + rtwn_pci_c2h_report(pc, len); + break; + default: + /* NOTREACHED */ + KASSERT(0, ("unknown Rx classification code")); + break; + } + + /* Update / reset RX descriptor (and set OWN bit). */ + rtwn_pci_setup_rx_desc(pc, rx_desc, rx_data->paddr, + MJUMPAGESIZE, ring->cur); + if (!(sc->sc_flags & RTWN_RUNNING)) return; - ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; + /* NB: device can reuse current descriptor. */ + bus_dmamap_sync(ring->desc_dmat, ring->desc_map, + BUS_DMASYNC_POSTREAD); + + if (le32toh(rx_desc->rxdw0) & RTWN_RXDW0_OWN) + ring->cur = (ring->cur + 1) % RTWN_PCI_RX_LIST_COUNT; } } @@ -289,13 +377,13 @@ rtwn_pci_intr(void *arg) int i, status, tx_rings; RTWN_LOCK(sc); - status = rtwn_classify_intr(sc, &tx_rings, 0); + status = rtwn_pci_get_intr_status(pc, &tx_rings); RTWN_DPRINTF(sc, RTWN_DEBUG_INTR, "%s: status %08X, tx_rings %08X\n", __func__, status, tx_rings); if (status == 0 && tx_rings == 0) goto unlock; - if (status & RTWN_PCI_INTR_RX) { + if (status & (RTWN_PCI_INTR_RX | RTWN_PCI_INTR_TX_REPORT)) { rtwn_pci_rx_done(sc); if (!(sc->sc_flags & RTWN_RUNNING)) goto unlock; Modified: head/sys/dev/rtwn/pci/rtwn_pci_var.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_var.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/pci/rtwn_pci_var.h Wed Jan 2 05:21:06 2019 (r342677) @@ -26,6 +26,9 @@ #define RTWN_PCI_RX_LIST_COUNT 256 #define RTWN_PCI_TX_LIST_COUNT 256 +/* sizeof(struct rtwn_rx_stat_common) + R88E_INTR_MSG_LEN */ +#define RTWN_PCI_RX_TMP_BUF_SIZE 84 + struct rtwn_rx_data { bus_dmamap_t map; struct mbuf *m; @@ -95,8 +98,8 @@ enum { /* Shortcuts */ /* Vendor driver treats RX errors like ROK... */ #define RTWN_PCI_INTR_RX \ - (RTWN_PCI_INTR_RX_OVERFLOW | RTWN_PCI_INTR_RX_DESC_UNAVAIL | \ - RTWN_PCI_INTR_RX_DONE) + (RTWN_PCI_INTR_RX_ERROR | RTWN_PCI_INTR_RX_OVERFLOW | \ + RTWN_PCI_INTR_RX_DESC_UNAVAIL | RTWN_PCI_INTR_RX_DONE) struct rtwn_pci_softc { @@ -109,6 +112,7 @@ struct rtwn_pci_softc { void *pc_ih; bus_size_t pc_mapsize; + uint8_t pc_rx_buf[RTWN_PCI_RX_TMP_BUF_SIZE]; struct rtwn_rx_ring rx_ring; struct rtwn_tx_ring tx_ring[RTWN_PCI_NTXQUEUES]; @@ -122,6 +126,8 @@ struct rtwn_pci_softc { void *, bus_dma_segment_t *); void (*pc_copy_tx_desc)(void *, const void *); void (*pc_enable_intr)(struct rtwn_pci_softc *); + int (*pc_get_intr_status)(struct rtwn_pci_softc *, + int *); }; #define RTWN_PCI_SOFTC(sc) ((struct rtwn_pci_softc *)(sc)) @@ -133,5 +139,7 @@ struct rtwn_pci_softc { (((_pc)->pc_copy_tx_desc)((_dest), (_src))) #define rtwn_pci_enable_intr(_pc) \ (((_pc)->pc_enable_intr)((_pc))) +#define rtwn_pci_get_intr_status(_pc, _tx_rings) \ + (((_pc)->pc_get_intr_status)((_pc), (_tx_rings))) #endif /* RTWN_PCI_VAR_H */ Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:21:06 2019 (r342677) @@ -81,6 +81,7 @@ void r88e_rf_write(struct rtwn_softc *, int, uint8_t, void r88e_parse_rom(struct rtwn_softc *, uint8_t *); /* r88e_rx.c */ +int r88e_classify_intr(struct rtwn_softc *, void *, int); void r88e_ratectl_tx_complete(struct rtwn_softc *, uint8_t *, int); void r88e_handle_c2h_report(struct rtwn_softc *, uint8_t *, int); int8_t r88e_get_rssi_cck(struct rtwn_softc *, void *); Modified: head/sys/dev/rtwn/rtl8188e/r88e_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/r88e_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -56,6 +56,25 @@ __FBSDID("$FreeBSD$"); #include +int +r88e_classify_intr(struct rtwn_softc *sc, void *buf, int len) +{ + struct r92c_rx_stat *stat = buf; + int report_sel = MS(le32toh(stat->rxdw3), R88E_RXDW3_RPT); + + switch (report_sel) { + case R88E_RXDW3_RPT_RX: + return (RTWN_RX_DATA); + case R88E_RXDW3_RPT_TX1: /* per-packet Tx report */ + case R88E_RXDW3_RPT_TX2: /* periodical Tx report */ + return (RTWN_RX_TX_REPORT); + case R88E_RXDW3_RPT_HIS: + return (RTWN_RX_OTHER); + default: /* shut up the compiler */ + return (RTWN_RX_DATA); + } +} + void r88e_ratectl_tx_complete(struct rtwn_softc *sc, uint8_t *buf, int len) { Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:21:06 2019 (r342677) @@ -33,7 +33,4 @@ void r88eu_init_intr(struct rtwn_softc *); void r88eu_init_rx_agg(struct rtwn_softc *); void r88eu_post_init(struct rtwn_softc *); -/* r88eu_rx.c */ -int r88eu_classify_intr(struct rtwn_softc *, void *, int); - #endif /* RTL8188EU_H */ Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -130,7 +130,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_get_rx_stats = r88e_get_rx_stats; sc->sc_get_rssi_cck = r88e_get_rssi_cck; sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; - sc->sc_classify_intr = r88eu_classify_intr; + sc->sc_classify_intr = r88e_classify_intr; sc->sc_handle_tx_report = r88e_ratectl_tx_complete; sc->sc_handle_c2h_report = r88e_handle_c2h_report; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce.h Wed Jan 2 05:21:06 2019 (r342677) @@ -60,7 +60,7 @@ void r92ce_post_init(struct rtwn_softc *); void r92ce_set_led(struct rtwn_softc *, int, int); /* r92ce_rx.c */ -int r92ce_classify_intr(struct rtwn_softc *, void *, int); +int r92ce_get_intr_status(struct rtwn_pci_softc *, int *); void r92ce_enable_intr(struct rtwn_pci_softc *); void r92ce_start_xfers(struct rtwn_softc *); Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -155,6 +155,7 @@ r92ce_attach(struct rtwn_pci_softc *pc) pc->pc_tx_postsetup = r92ce_tx_postsetup; pc->pc_copy_tx_desc = r92ce_copy_tx_desc; pc->pc_enable_intr = r92ce_enable_intr; + pc->pc_get_intr_status = r92ce_get_intr_status; pc->pc_qmap = 0xf771; pc->tcr = @@ -175,7 +176,7 @@ r92ce_attach(struct rtwn_pci_softc *pc) sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; - sc->sc_classify_intr = r92ce_classify_intr; + sc->sc_classify_intr = r92c_classify_intr; sc->sc_handle_tx_report = rtwn_nop_softc_uint8_int; sc->sc_handle_c2h_report = rtwn_nop_softc_uint8_int; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -58,10 +58,10 @@ __FBSDID("$FreeBSD$"); int -r92ce_classify_intr(struct rtwn_softc *sc, void *arg, int len __unused) +r92ce_get_intr_status(struct rtwn_pci_softc *pc, int *rings) { + struct rtwn_softc *sc = &pc->pc_sc; uint32_t status; - int *rings = arg; int ret; *rings = 0; Modified: head/sys/dev/rtwn/rtl8192c/r92c.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/r92c.h Wed Jan 2 05:21:06 2019 (r342677) @@ -102,6 +102,7 @@ void r92c_efuse_postread(struct rtwn_softc *); void r92c_parse_rom(struct rtwn_softc *, uint8_t *); /* r92c_rx.c */ +int r92c_classify_intr(struct rtwn_softc *, void *, int); int8_t r92c_get_rssi_cck(struct rtwn_softc *, void *); int8_t r92c_get_rssi_ofdm(struct rtwn_softc *, void *); uint8_t r92c_rx_radiotap_flags(const void *); Modified: head/sys/dev/rtwn/rtl8192c/r92c_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/r92c_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -52,6 +52,13 @@ __FBSDID("$FreeBSD$"); #include +int +r92c_classify_intr(struct rtwn_softc *sc, void *buf, int len) +{ + /* NB: reports are fetched from C2H_MSG register. */ + return (RTWN_RX_DATA); +} + int8_t r92c_get_rssi_cck(struct rtwn_softc *sc, void *physt) { Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu.h Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu.h Wed Jan 2 05:21:06 2019 (r342677) @@ -47,7 +47,6 @@ void r92cu_post_init(struct rtwn_softc *); void r92cu_set_led(struct rtwn_softc *, int, int); /* r92cu_rx.c */ -int r92cu_classify_intr(struct rtwn_softc *, void *, int); int r92cu_align_rx(int, int); /* r92cu_tx.c */ Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 05:21:06 2019 (r342677) @@ -168,7 +168,7 @@ r92cu_attach(struct rtwn_usb_softc *uc) sc->sc_get_rx_stats = r92c_get_rx_stats; sc->sc_get_rssi_cck = r92c_get_rssi_cck; sc->sc_get_rssi_ofdm = r92c_get_rssi_ofdm; - sc->sc_classify_intr = r92cu_classify_intr; + sc->sc_classify_intr = r92c_classify_intr; sc->sc_handle_tx_report = rtwn_nop_softc_uint8_int; sc->sc_handle_c2h_report = rtwn_nop_softc_uint8_int; sc->sc_check_frame = rtwn_nop_int_softc_mbuf; Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_rx.c Wed Jan 2 05:21:06 2019 (r342677) @@ -50,13 +50,6 @@ __FBSDID("$FreeBSD$"); int -r92cu_classify_intr(struct rtwn_softc *sc, void *buf, int len) -{ - /* NB: reports are fetched from C2H_MSG register. */ - return (RTWN_RX_DATA); -} - -int r92cu_align_rx(int totlen, int len) { return (roundup2(totlen, 128)); Modified: head/sys/modules/rtwn_usb/Makefile ============================================================================== --- head/sys/modules/rtwn_usb/Makefile Wed Jan 2 04:56:36 2019 (r342676) +++ head/sys/modules/rtwn_usb/Makefile Wed Jan 2 05:21:06 2019 (r342677) @@ -13,7 +13,7 @@ SRCS = rtwn_usb_attach.c rtwn_usb_ep.c rtwn_usb_reg.c opt_bus.h opt_rtwn.h opt_usb.h opt_wlan.h usb_if.h usbdevs.h .PATH: ${SRCTOP}/sys/dev/rtwn/rtl8188e/usb -SRCS += r88eu_attach.c r88eu_init.c r88eu_rx.c \ +SRCS += r88eu_attach.c r88eu_init.c \ r88eu.h r88eu_reg.h .PATH: ${SRCTOP}/sys/dev/rtwn/rtl8192c/usb From owner-svn-src-head@freebsd.org Wed Jan 2 05:30:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57CEA1435E80; Wed, 2 Jan 2019 05:30:43 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF56D734A8; Wed, 2 Jan 2019 05:30:42 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E34DF50D7; Wed, 2 Jan 2019 05:30:42 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025UgxW037919; Wed, 2 Jan 2019 05:30:42 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025UfIV037915; Wed, 2 Jan 2019 05:30:41 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020530.x025UfIV037915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:30:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342678 - in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Commit-Revision: 342678 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EF56D734A8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 05:30:43 -0000 Author: avos Date: Wed Jan 2 05:30:41 2019 New Revision: 342678 URL: https://svnweb.freebsd.org/changeset/base/342678 Log: Move USB-specific parts from rtwn(4) to rtwn_usb(4) MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e.h head/sys/dev/rtwn/rtl8188e/r88e_init.c head/sys/dev/rtwn/rtl8188e/usb/r88eu.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Modified: head/sys/dev/rtwn/rtl8188e/r88e.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/r88e.h Wed Jan 2 05:30:41 2019 (r342678) @@ -24,9 +24,7 @@ /* * Global definitions. */ -#define R88E_PUBQ_NPAGES 142 #define R88E_TXPKTBUF_COUNT 177 -#define R88E_TX_PAGE_COUNT 169 #define R88E_MACID_MAX 63 #define R88E_RX_DMA_BUFFER_SIZE 0x2400 @@ -67,9 +65,8 @@ int r88e_set_pwrmode(struct rtwn_softc *, struct ieee8 #endif /* r88e_init.c */ -void r88e_init_bb(struct rtwn_softc *); +void r88e_init_bb_common(struct rtwn_softc *); void r88e_init_rf(struct rtwn_softc *); -int r88e_power_on(struct rtwn_softc *); /* r88e_led.c */ void r88e_set_led(struct rtwn_softc *, int, int); Modified: head/sys/dev/rtwn/rtl8188e/r88e_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_init.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/r88e_init.c Wed Jan 2 05:30:41 2019 (r342678) @@ -70,20 +70,8 @@ r88e_crystalcap_write(struct rtwn_softc *sc) } void -r88e_init_bb(struct rtwn_softc *sc) +r88e_init_bb_common(struct rtwn_softc *sc) { - - /* Enable BB and RF. */ - rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, - R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | - R92C_SYS_FUNC_EN_DIO_RF); - - rtwn_write_1(sc, R92C_RF_CTRL, - R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); - rtwn_write_1(sc, R92C_SYS_FUNC_EN, - R92C_SYS_FUNC_EN_USBA | R92C_SYS_FUNC_EN_USBD | - R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); - r92c_init_bb_common(sc); rtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553422); @@ -92,67 +80,4 @@ r88e_init_bb(struct rtwn_softc *sc) rtwn_delay(sc, 1); r88e_crystalcap_write(sc); -} - -int -r88e_power_on(struct rtwn_softc *sc) -{ -#define RTWN_CHK(res) do { \ - if (res != 0) \ - return (EIO); \ -} while(0) - int ntries; - - /* Wait for power ready bit. */ - for (ntries = 0; ntries < 5000; ntries++) { - if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) - break; - rtwn_delay(sc, 10); - } - if (ntries == 5000) { - device_printf(sc->sc_dev, - "timeout waiting for chip power up\n"); - return (ETIMEDOUT); - } - - /* Reset BB. */ - RTWN_CHK(rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, - R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0)); - - RTWN_CHK(rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80)); - - /* Disable HWPDN. */ - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - R92C_APS_FSMCO_APDM_HPDN, 0, 1)); - - /* Disable WL suspend. */ - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1)); - - RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, - 0, R92C_APS_FSMCO_APFM_ONMAC, 1)); - for (ntries = 0; ntries < 5000; ntries++) { - if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & - R92C_APS_FSMCO_APFM_ONMAC)) - break; - rtwn_delay(sc, 10); - } - if (ntries == 5000) - return (ETIMEDOUT); - - /* Enable LDO normal mode. */ - RTWN_CHK(rtwn_setbits_1(sc, R92C_LPLDO_CTRL, - R92C_LPLDO_CTRL_SLEEP, 0)); - - /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ - RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); - RTWN_CHK(rtwn_setbits_2(sc, R92C_CR, 0, - R92C_CR_HCI_TXDMA_EN | R92C_CR_TXDMA_EN | - R92C_CR_HCI_RXDMA_EN | R92C_CR_RXDMA_EN | - R92C_CR_PROTOCOL_EN | R92C_CR_SCHEDULE_EN | - ((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | - R92C_CR_CALTMR_EN)); - - return (0); -#undef RTWN_CHK } Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu.h Wed Jan 2 05:30:41 2019 (r342678) @@ -25,9 +25,18 @@ /* + * Global definitions. + */ +#define R88EU_PUBQ_NPAGES 142 +#define R88EU_TX_PAGE_COUNT 169 + + +/* * Function declarations. */ /* r88eu_init.c */ +void r88eu_init_bb(struct rtwn_softc *); +int r88eu_power_on(struct rtwn_softc *); void r88eu_power_off(struct rtwn_softc *); void r88eu_init_intr(struct rtwn_softc *); void r88eu_init_rx_agg(struct rtwn_softc *); Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:30:41 2019 (r342678) @@ -140,7 +140,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_efuse_postread = rtwn_nop_softc; sc->sc_parse_rom = r88e_parse_rom; sc->sc_set_led = r88e_set_led; - sc->sc_power_on = r88e_power_on; + sc->sc_power_on = r88eu_power_on; sc->sc_power_off = r88eu_power_off; #ifndef RTWN_WITHOUT_UCODE sc->sc_fw_reset = r88e_fw_reset; @@ -172,7 +172,7 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_init_ampdu = rtwn_nop_softc; sc->sc_init_intr = r88eu_init_intr; sc->sc_init_edca = r92c_init_edca; - sc->sc_init_bb = r88e_init_bb; + sc->sc_init_bb = r88eu_init_bb; sc->sc_init_rf = r92c_init_rf; sc->sc_init_antsel = rtwn_nop_softc; sc->sc_post_init = r88eu_post_init; @@ -190,11 +190,11 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->fwname = "rtwn-rtl8188eufw"; sc->fwsig = 0x88e; - sc->page_count = R88E_TX_PAGE_COUNT; + sc->page_count = R88EU_TX_PAGE_COUNT; sc->pktbuf_count = R88E_TXPKTBUF_COUNT; sc->ackto = 0x40; - sc->npubqpages = R88E_PUBQ_NPAGES; + sc->npubqpages = R88EU_PUBQ_NPAGES; sc->page_size = R92C_TX_PAGE_SIZE; sc->txdesc_len = sizeof(struct r92cu_tx_desc); Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Wed Jan 2 05:21:06 2019 (r342677) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_init.c Wed Jan 2 05:30:41 2019 (r342678) @@ -55,6 +55,87 @@ __FBSDID("$FreeBSD$"); void +r88eu_init_bb(struct rtwn_softc *sc) +{ + + /* Enable BB and RF. */ + rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | + R92C_SYS_FUNC_EN_DIO_RF); + + rtwn_write_1(sc, R92C_RF_CTRL, + R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); + rtwn_write_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_USBA | R92C_SYS_FUNC_EN_USBD | + R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); + + r88e_init_bb_common(sc); +} + +int +r88eu_power_on(struct rtwn_softc *sc) +{ +#define RTWN_CHK(res) do { \ + if (res != 0) \ + return (EIO); \ +} while(0) + int ntries; + + /* Wait for power ready bit. */ + for (ntries = 0; ntries < 5000; ntries++) { + if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) { + device_printf(sc->sc_dev, + "timeout waiting for chip power up\n"); + return (ETIMEDOUT); + } + + /* Reset BB. */ + RTWN_CHK(rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0)); + + RTWN_CHK(rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80)); + + /* Disable HWPDN. */ + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_APDM_HPDN, 0, 1)); + + /* Disable WL suspend. */ + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1)); + + RTWN_CHK(rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + 0, R92C_APS_FSMCO_APFM_ONMAC, 1)); + for (ntries = 0; ntries < 5000; ntries++) { + if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) + return (ETIMEDOUT); + + /* Enable LDO normal mode. */ + RTWN_CHK(rtwn_setbits_1(sc, R92C_LPLDO_CTRL, + R92C_LPLDO_CTRL_SLEEP, 0)); + + /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ + RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); + RTWN_CHK(rtwn_setbits_2(sc, R92C_CR, 0, + R92C_CR_HCI_TXDMA_EN | R92C_CR_TXDMA_EN | + R92C_CR_HCI_RXDMA_EN | R92C_CR_RXDMA_EN | + R92C_CR_PROTOCOL_EN | R92C_CR_SCHEDULE_EN | + ((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | + R92C_CR_CALTMR_EN)); + + return (0); +#undef RTWN_CHK +} + +void r88eu_power_off(struct rtwn_softc *sc) { uint8_t reg; From owner-svn-src-head@freebsd.org Wed Jan 2 05:37:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 491801436169; Wed, 2 Jan 2019 05:37:31 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E5B3573901; Wed, 2 Jan 2019 05:37:30 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9AC0528B; Wed, 2 Jan 2019 05:37:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025bUm7042973; Wed, 2 Jan 2019 05:37:30 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025bUgg042972; Wed, 2 Jan 2019 05:37:30 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020537.x025bUgg042972@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:37:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342679 - head/sys/dev/rtwn/rtl8188e X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/rtl8188e X-SVN-Commit-Revision: 342679 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E5B3573901 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 05:37:31 -0000 Author: avos Date: Wed Jan 2 05:37:30 2019 New Revision: 342679 URL: https://svnweb.freebsd.org/changeset/base/342679 Log: rtwn(4): do not try to start RTL8188E* MCU during device shutdown. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_fw.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_fw.c Wed Jan 2 05:30:41 2019 (r342678) +++ head/sys/dev/rtwn/rtl8188e/r88e_fw.c Wed Jan 2 05:37:30 2019 (r342679) @@ -109,7 +109,11 @@ r88e_fw_reset(struct rtwn_softc *sc, int reason) reg = rtwn_read_2(sc, R92C_SYS_FUNC_EN); rtwn_write_2(sc, R92C_SYS_FUNC_EN, reg & ~R92C_SYS_FUNC_EN_CPUEN); - rtwn_write_2(sc, R92C_SYS_FUNC_EN, reg | R92C_SYS_FUNC_EN_CPUEN); + + if (reason != RTWN_FW_RESET_SHUTDOWN) { + rtwn_write_2(sc, R92C_SYS_FUNC_EN, + reg | R92C_SYS_FUNC_EN_CPUEN); + } } void From owner-svn-src-head@freebsd.org Wed Jan 2 05:43:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68FCF14363E4; Wed, 2 Jan 2019 05:43:34 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D98373D13; Wed, 2 Jan 2019 05:43:34 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F0E3B542E; Wed, 2 Jan 2019 05:43:33 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x025hX3s047745; Wed, 2 Jan 2019 05:43:33 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x025hXBj047743; Wed, 2 Jan 2019 05:43:33 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020543.x025hXBj047743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 05:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342680 - in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn/rtl8188e: . usb X-SVN-Commit-Revision: 342680 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0D98373D13 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 05:43:34 -0000 Author: avos Date: Wed Jan 2 05:43:33 2019 New Revision: 342680 URL: https://svnweb.freebsd.org/changeset/base/342680 Log: rtwn(4): rename common RTL8188E* structures. No functional change intended. MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_priv.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_priv.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_priv.h Wed Jan 2 05:37:30 2019 (r342679) +++ head/sys/dev/rtwn/rtl8188e/r88e_priv.h Wed Jan 2 05:43:33 2019 (r342680) @@ -37,7 +37,7 @@ struct rtwn_r88e_txpwr { /* * MAC initialization values. */ -static const struct rtwn_mac_prog rtl8188eu_mac[] = { +static const struct rtwn_mac_prog rtl8188e_mac[] = { { 0x026, 0x41 }, { 0x027, 0x35 }, { 0x040, 0x00 }, { 0x428, 0x0a }, { 0x429, 0x10 }, { 0x430, 0x00 }, { 0x431, 0x01 }, { 0x432, 0x02 }, { 0x433, 0x04 }, { 0x434, 0x05 }, { 0x435, 0x06 }, { 0x436, 0x07 }, @@ -66,7 +66,7 @@ static const struct rtwn_mac_prog rtl8188eu_mac[] = { /* * Baseband initialization values. */ -static const uint16_t rtl8188eu_bb_regs[] = { +static const uint16_t rtl8188e_bb_regs[] = { 0x800, 0x804, 0x808, 0x80c, 0x810, 0x814, 0x818, 0x81c, 0x820, 0x824, 0x828, 0x82c, 0x830, 0x834, 0x838, 0x83c, 0x840, 0x844, 0x848, 0x84c, 0x850, 0x854, 0x858, 0x85c, @@ -93,7 +93,7 @@ static const uint16_t rtl8188eu_bb_regs[] = { 0xed8, 0xedc, 0xee0, 0xee8, 0xeec, 0xf14, 0xf4c, 0xf00 }; -static const uint32_t rtl8188eu_bb_vals[] = { +static const uint32_t rtl8188e_bb_vals[] = { 0x80040000, 0x00000003, 0x0000fc00, 0x0000000a, 0x10001331, 0x020c3d10, 0x02200385, 0x00000000, 0x01000100, 0x00390204, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, @@ -135,17 +135,17 @@ static const uint32_t rtl8188eu_bb_vals[] = { 0x00000000, 0x00000300 }; -static const struct rtwn_bb_prog rtl8188eu_bb[] = { +static const struct rtwn_bb_prog rtl8188e_bb[] = { { - nitems(rtl8188eu_bb_regs), - rtl8188eu_bb_regs, - rtl8188eu_bb_vals, + nitems(rtl8188e_bb_regs), + rtl8188e_bb_regs, + rtl8188e_bb_vals, { 0 }, NULL } }; -static const uint32_t rtl8188eu_agc_vals[] = { +static const uint32_t rtl8188e_agc_vals[] = { 0xfb000001, 0xfb010001, 0xfb020001, 0xfb030001, 0xfb040001, 0xfb050001, 0xfa060001, 0xf9070001, 0xf8080001, 0xf7090001, 0xf60a0001, 0xf50b0001, 0xf40c0001, 0xf30d0001, 0xf20e0001, @@ -174,10 +174,10 @@ static const uint32_t rtl8188eu_agc_vals[] = { 0x407d0001, 0x407e0001, 0x407f0001 }; -static const struct rtwn_agc_prog rtl8188eu_agc[] = { +static const struct rtwn_agc_prog rtl8188e_agc[] = { { - nitems(rtl8188eu_agc_vals), - rtl8188eu_agc_vals, + nitems(rtl8188e_agc_vals), + rtl8188e_agc_vals, { 0 }, NULL } @@ -186,7 +186,7 @@ static const struct rtwn_agc_prog rtl8188eu_agc[] = { /* * RF initialization values. */ -static const uint8_t rtl8188eu_rf_regs[] = { +static const uint8_t rtl8188e_rf_regs[] = { 0x00, 0x08, 0x18, 0x19, 0x1e, 0x1f, 0x2f, 0x3f, 0x42, 0x57, 0x58, 0x67, 0x83, 0xb0, 0xb1, 0xb2, 0xb4, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbf, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, @@ -199,7 +199,7 @@ static const uint8_t rtl8188eu_rf_regs[] = { 0x1f, 0xfe, 0xfe, 0x1e, 0x1f, 0x00 }; -static const uint32_t rtl8188eu_rf_vals[] = { +static const uint32_t rtl8188e_rf_vals[] = { 0x30000, 0x84000, 0x00407, 0x00012, 0x80009, 0x00880, 0x1a060, 0x00000, 0x060c0, 0xd0000, 0xbe180, 0x01552, 0x00000, 0xff8fc, 0x54400, 0xccc19, 0x43003, 0x4953e, 0x1c718, 0x060ff, 0x80001, @@ -216,11 +216,11 @@ static const uint32_t rtl8188eu_rf_vals[] = { 0x0c350, 0x0c350, 0x00001, 0x80000, 0x33e60 }; -static const struct rtwn_rf_prog rtl8188eu_rf[] = { +static const struct rtwn_rf_prog rtl8188e_rf[] = { { - nitems(rtl8188eu_rf_regs), - rtl8188eu_rf_regs, - rtl8188eu_rf_vals, + nitems(rtl8188e_rf_regs), + rtl8188e_rf_regs, + rtl8188e_rf_vals, { 0 }, NULL }, Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:37:30 2019 (r342679) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:43:33 2019 (r342680) @@ -178,13 +178,13 @@ r88eu_attach(struct rtwn_usb_softc *uc) sc->sc_post_init = r88eu_post_init; sc->sc_init_bcnq1_boundary = rtwn_nop_int_softc; - sc->mac_prog = &rtl8188eu_mac[0]; - sc->mac_size = nitems(rtl8188eu_mac); - sc->bb_prog = &rtl8188eu_bb[0]; - sc->bb_size = nitems(rtl8188eu_bb); - sc->agc_prog = &rtl8188eu_agc[0]; - sc->agc_size = nitems(rtl8188eu_agc); - sc->rf_prog = &rtl8188eu_rf[0]; + sc->mac_prog = &rtl8188e_mac[0]; + sc->mac_size = nitems(rtl8188e_mac); + sc->bb_prog = &rtl8188e_bb[0]; + sc->bb_size = nitems(rtl8188e_bb); + sc->agc_prog = &rtl8188e_agc[0]; + sc->agc_size = nitems(rtl8188e_agc); + sc->rf_prog = &rtl8188e_rf[0]; sc->name = "RTL8188EU"; sc->fwname = "rtwn-rtl8188eufw"; From owner-svn-src-head@freebsd.org Wed Jan 2 06:03:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BD3E1436D3C; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2762874C8F; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1569A5797; Wed, 2 Jan 2019 06:03:21 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0263KCM058228; Wed, 2 Jan 2019 06:03:20 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0263JQA058221; Wed, 2 Jan 2019 06:03:19 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020603.x0263JQA058221@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 06:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342681 - in head/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8188e/usb rtl8192c rtl8192c/pci rtl8192c/usb X-SVN-Commit-Revision: 342681 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2762874C8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 06:03:21 -0000 Author: avos Date: Wed Jan 2 06:03:19 2019 New Revision: 342681 URL: https://svnweb.freebsd.org/changeset/base/342681 Log: rtwn(4): rename set_name -> set_rom_opts method and reuse it for RTL8188E* MFC after: 4 days Modified: head/sys/dev/rtwn/rtl8188e/r88e_rom.c head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c head/sys/dev/rtwn/rtl8192c/r92c_rom.c head/sys/dev/rtwn/rtl8192c/r92c_var.h head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Modified: head/sys/dev/rtwn/rtl8188e/r88e_rom.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_rom.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8188e/r88e_rom.c Wed Jan 2 06:03:19 2019 (r342681) @@ -81,5 +81,6 @@ r88e_parse_rom(struct rtwn_softc *sc, uint8_t *buf) __func__,rs->regulatory); sc->thermal_meter = rom->thermal_meter; - IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr); + + rtwn_r92c_set_rom_opts(sc, buf); } Modified: head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -57,6 +57,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include /* for 'macaddr' field */ #include @@ -66,6 +67,14 @@ static struct rtwn_r88e_txpwr r88e_txpwr; void r88eu_attach(struct rtwn_usb_softc *); static void +r88eu_set_macaddr(struct rtwn_softc *sc, uint8_t *buf) +{ + struct r88e_rom *rom = (struct r88e_rom *)buf; + + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->macaddr); +} + +static void r88e_postattach(struct rtwn_softc *sc) { struct r92c_softc *rs = sc->sc_priv; @@ -93,7 +102,7 @@ r88eu_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r88e_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r88e_tx_setup_hwseq; rs->rs_tx_setup_macid = r88e_tx_setup_macid; - rs->rs_set_name = rtwn_nop_softc; /* not used */ + rs->rs_set_rom_opts = r88eu_set_macaddr; rs->rf_read_delay[0] = 10; rs->rf_read_delay[1] = 100; Modified: head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/pci/r92ce_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -92,7 +92,7 @@ r92ce_postattach(struct rtwn_softc *sc) } static void -r92ce_set_name(struct rtwn_softc *sc) +r92ce_set_name(struct rtwn_softc *sc, uint8_t *buf) { struct r92c_softc *rs = sc->sc_priv; @@ -117,7 +117,7 @@ r92ce_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq; rs->rs_tx_setup_macid = r92c_tx_setup_macid; - rs->rs_set_name = r92ce_set_name; + rs->rs_set_rom_opts = r92ce_set_name; /* XXX TODO: test with net80211 ratectl! */ #ifndef RTWN_WITHOUT_UCODE Modified: head/sys/dev/rtwn/rtl8192c/r92c_rom.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_rom.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/r92c_rom.c Wed Jan 2 06:03:19 2019 (r342681) @@ -96,7 +96,7 @@ r92c_parse_rom(struct rtwn_softc *sc, uint8_t *buf) __func__, rs->regulatory); /* Need to be set before postinit() (but after preinit()). */ - rtwn_r92c_set_name(sc); + rtwn_r92c_set_rom_opts(sc, buf); r92c_set_chains(sc); for (j = 0; j < R92C_GROUP_2G; j++) { Modified: head/sys/dev/rtwn/rtl8192c/r92c_var.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_var.h Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/r92c_var.h Wed Jan 2 06:03:19 2019 (r342681) @@ -58,7 +58,7 @@ struct r92c_softc { void (*rs_tx_enable_ampdu)(void *, int); void (*rs_tx_setup_hwseq)(void *); void (*rs_tx_setup_macid)(void *, int); - void (*rs_set_name)(struct rtwn_softc *); + void (*rs_set_rom_opts)(struct rtwn_softc *, uint8_t *); int rf_read_delay[3]; uint32_t rf_chnlbw[R92C_MAX_CHAINS]; @@ -77,7 +77,7 @@ struct r92c_softc { ((R92C_SOFTC(_sc)->rs_tx_setup_hwseq)((_buf))) #define rtwn_r92c_tx_setup_macid(_sc, _buf, _id) \ ((R92C_SOFTC(_sc)->rs_tx_setup_macid)((_buf), (_id))) -#define rtwn_r92c_set_name(_sc) \ - ((R92C_SOFTC(_sc)->rs_set_name)((_sc))) +#define rtwn_r92c_set_rom_opts(_sc, _buf) \ + ((R92C_SOFTC(_sc)->rs_set_rom_opts)((_sc), (_buf))) #endif /* R92C_VAR_H */ Modified: head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 05:43:33 2019 (r342680) +++ head/sys/dev/rtwn/rtl8192c/usb/r92cu_attach.c Wed Jan 2 06:03:19 2019 (r342681) @@ -94,7 +94,7 @@ r92cu_postattach(struct rtwn_softc *sc) } static void -r92cu_set_name(struct rtwn_softc *sc) +r92cu_set_name(struct rtwn_softc *sc, uint8_t *buf) { struct r92c_softc *rs = sc->sc_priv; @@ -124,7 +124,7 @@ r92cu_attach_private(struct rtwn_softc *sc) rs->rs_tx_enable_ampdu = r92c_tx_enable_ampdu; rs->rs_tx_setup_hwseq = r92c_tx_setup_hwseq; rs->rs_tx_setup_macid = r92c_tx_setup_macid; - rs->rs_set_name = r92cu_set_name; + rs->rs_set_rom_opts = r92cu_set_name; #ifndef RTWN_WITHOUT_UCODE rs->rs_c2h_timeout = hz; From owner-svn-src-head@freebsd.org Wed Jan 2 06:48:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66A801437C9F; Wed, 2 Jan 2019 06:48:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 149B375FA0; Wed, 2 Jan 2019 06:48:55 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DBA0A5E58; Wed, 2 Jan 2019 06:48:54 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x026ms8B079339; Wed, 2 Jan 2019 06:48:54 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x026mrmC079331; Wed, 2 Jan 2019 06:48:53 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901020648.x026mrmC079331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 06:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342682 - in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw... X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw sys/modules/rtwnfw/rtwnr... X-SVN-Commit-Revision: 342682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 149B375FA0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 06:48:55 -0000 Author: avos Date: Wed Jan 2 06:48:53 2019 New Revision: 342682 URL: https://svnweb.freebsd.org/changeset/base/342682 Log: rtwn_pci(4): add support for RTL8188EE chipset. Initially based on https://reviews.freebsd.org/D15692; later deduplicated and improved a bit (Tx reports, IQ calibration support). Submitted by: Farhan Khan MFC after: 4 days Relnotes: yes Differential Revision: https://reviews.freebsd.org/D15692 Added: head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu head/sys/dev/rtwn/rtl8188e/pci/ head/sys/dev/rtwn/rtl8188e/pci/r88ee.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_reg.h (contents, props changed) head/sys/dev/rtwn/rtl8188e/pci/r88ee_rx.c (contents, props changed) head/sys/modules/rtwnfw/rtwnrtl8188ee/ head/sys/modules/rtwnfw/rtwnrtl8188ee/Makefile (contents, props changed) Modified: head/share/man/man4/rtwn.4 head/share/man/man4/rtwn_pci.4 head/sys/dev/rtwn/pci/rtwn_pci_attach.h head/sys/dev/rtwn/rtl8188e/r88e_reg.h head/sys/dev/rtwn/rtl8188e/r88e_rom_image.h head/sys/dev/rtwn/rtl8188e/usb/r88eu_attach.c head/sys/modules/rtwn_pci/Makefile head/sys/modules/rtwnfw/Makefile Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Wed Jan 2 06:03:19 2019 (r342681) +++ head/share/man/man4/rtwn.4 Wed Jan 2 06:48:53 2019 (r342682) @@ -93,6 +93,7 @@ The driver (if not compiled with ) may use following firmware files, which are loaded when an interface is brought up: .Bl -tag -width Ds -offset indent -compact +.It Pa /boot/kernel/rtwn-rtl8188eefw.ko .It Pa /boot/kernel/rtwn-rtl8188eufw.ko .It Pa /boot/kernel/rtwn-rtl8192cfwE_B.ko .It Pa /boot/kernel/rtwn-rtl8192cfwE.ko Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Wed Jan 2 06:03:19 2019 (r342681) +++ head/share/man/man4/rtwn_pci.4 Wed Jan 2 06:48:53 2019 (r342682) @@ -48,11 +48,11 @@ kernel configuration file: The .Nm driver supports PCIe wireless network devices based on the Realtek -RTL8188CE chipset. +RTL8188CE/RTL8188EE chipsets. .Pp -The RTL8188CE is a highly integrated 802.11n adapter that combines a MAC, -a 1T1R capable baseband and an RF in a single chip. -It operates in the 2GHz spectrum only. +Both RTL8188CE and RTL8188EE are highly integrated 802.11n adapters +that combines a MAC, a 1T1R capable baseband and an RF in a single chip. +They are operate in the 2GHz spectrum only. .Sh SEE ALSO .Xr pci 4 , .Xr rtwn 4 , Added: head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,506 @@ +begin 644 rtwn-rtl8188eefw.fw +MX8@0``@````0)2%6L"L``*($```````````````````"134````````````` +M````````P58````````````````````````````````````````````````` +M````````````H01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01<5T`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7%D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`!@J$"XY).C^N23H_CDDZ/(Q8+(RL6#RO"CR,6" +MR,K%@\K?Z=[G@+X`08&7`$&!F`!!@:0`43172EK3I_51(R'JT[?U82,AZM/']7$C(>4Y'O(L#@P/#`@\""P-!U +MT`#``,`!P`+``\`$P`7`!L`'D`'$=%;P=$:C\!)C(N5!,.0$?P*1)^5#,.`" +MT?3E0S#A`Q)-N^5#,.(#$DX*Y4,PXP,28W_E0S#D`O&PY4,PY0+QWN5#,.8" +M\8OE1##A`M'J=%8$D`'$\'1&H_#0!]`&T`70!-`#T`+0`=``T-#0@M"#T/#0 +MX#*0@.?@8`,23H0BD($*X&`/Y/"0!5/@1`+PD`7\X`3PY/^0@.?@8'F0@*/@ +M9`%P<9"`YN#$5`]@)"3^8`,$3U'9"`\."`#>3U'9"`\.!U\`.D +M)/[_D(#OX"\23O.0`5=T!?"0@.K@(.(#$DK`(I"`H^"T`1.0@.?@8`V0@.O@ +M5/[P5`=P`O&F(I"`Z>#_?0$"2L20@*/@9`%P)9"`Y^!@'Y`!5^3PD`$\=`+P +MD(#DX%3[\)"`Z^!4_?!4!W`"\:8BD("CX+0!%I"`Y^!@$)"`YN!4#V0"8`," +M:DH23CTBP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T_/!T1Z/P +M$F-/Y4DPX0(1E.5),.(#$F.AY4DPXP,28]WE2C#@`Q)D&>5*,.0#$F2XY4PP +MX05_`Q)$)^5,,.0"$9[E3##E`Q)DSN5,,.8#$F5D=/P$D`'$\'1'H_#0!]`& +MT`70!-`#T`+0`=``T-#0@M"#T/#0X#*0@.?@8`,2:OLBL2J0@.W@%)`%<_!] +M`G\"46.0@0'@,.`MD("CX+0!)I"!I.`$\."T"@N0@0/@!/#DD(&D\)"!`^#_ +MD($"X+4'!>2C\!'D(N3_CU.0!!W@8!B0!2+@]59T__#Q\;\!`C%0@9O@D`0E\)"!G.!@#G0/+_6"Y#3\]8/@1(#PKP5T""_U@N0T_/6#Y/!T +M"2_U@N0T_/6#X%3P\'0A+?6"Y#3\]8/@5/?PK@2O!=#0DJ\B=#TO^.9-_O9T +M,"_U@N0T`?6#[O`BD`$V='CPHW0"\'UX_U%C?0)_`U%CD`8*X$0'\)"`\J/@ +MD`58\)"`H^"T`120@.7@5/OPD(#JX"#B#7T!?P2`#)"`Y>!$!/`B?0%_!-,0 +MKP'#P-"0@:'M\)"`ZN"0@:+PD(#DX/[$$Q-4`S#@`H$6[L03$Q-4`3#@`H$6 +MD(&BX/YO<`*!%N]P`F&-)/YP`F'&)/Y@223\<`*!`23\8`*!%NZT#@*1EI"! +MHN!P!'\!D;Z0@:+@M`8"D7"0@:+@M`0.D(&AX/]@!1)I@H`"\5>0@:+@9`A@ +M`H$6$F:'@1:0@:+@<`1_`9&^D(&BX+0&`I%PD(&BX+0.!Y$;OP$"D9:0@:+@ +M9`Q@`H$6D1OO9`%@`H$6D=B!%I"!HN"T#@>1&[\!`I&6D(&BX+0&`I%PD(&B +MX+0,!Y$;OP$"D=B0@:+@9`1P7!)HU.]D`7!4L0Z`4)"!HN"T#@>1&[\!`I&6 +MD(&BX+0&`I%PD(&BX+0,!Y$;OP$"D=B0@:+@<`1_`9&^D(&BX+0$&A)IQ(`5 +MD(&BX+0,#I"`Y>#_$Q-4/S#@`O'GT-"2KR+Q:N]D`6`(D`&X=`'P@#V0@.3@ +M_Q,3$U0?,.`(D`&X=`+P@"COQ%0/,.`(D`&X=`3P@!F0@.G@TY0$0`B0`;AT +M"/"`")`!N.3P?P$BD`&Y=`+P?P`BD(#EX)`&!"#@#.!$0/"0@.IT!/"`"N!4 +M?_"0@.IT#/"0!2+D\"*0@.7@PQ,@X`B0@.IT#/"`$9`&!.!$0/#@1(#PD(#J +M=`3PD`4BY/`BD(&C[_`29@R0@:/@8`60!2+D\)"`ZG0$\"*0@*/@9`%P+9"` +MY>!4_?"0!2)T;_!_`1'FOP$.D(#DX$2`\)"`ZG0.\"*0`;ET`?"0`;@$\"*0 +M!2)T__#Q\9`!-W0"\/U_`U%C$F:0Y)"`ZO`BD(#GX&`MD("CX&0!<"60@.[P +M!&`>D(#KX$00\.3U'9"`[]'RD`%7=`7PD(#JX"#B`E'`(N]P-GUX?P*QHWT" +M?P.QHWW(?P(29VZ0`5?D\)`!/'0"\'T!?PQ1Q)"`Y.!4]_!4[_"0!@K@5/CP +M(D%X?0)_`K&C?0%_`G0]+_CF_NWT7O[V=#`O]8+D-`'U@^[P(I"`Y^!@19"` +MY>#_$Q,35!\PX!*0`3O@,.0+L9F0@.W@%)`%<_"0@9GD=?`!$D2IPY"!FN"4 +M@)"!F>!D@)2`0`N0`9C@5/[PX$0!\/&S`:^0@.K@9`)@*A)J99"`Y>`3$Q-4 +M'S#@%9"`[>#_H^!O<`L29TJQF9"`[N`4\)`!YN`$\"*0`5_D\)`!/'0(\.3U +M'9"`^N##$U1_]1[D^_U_7'X!T?R0`5]T!?"0!I)T`O"0@.3@1!#PD(#JX&0, +M8`KD_7\,4<3D_Q'F(I"`Y^!D`7!>D(#FX%0/8$Z0@.K@<`/_D;Z0@.K@9`Q@ +M`O%7D`%;Y/"0`3QT!/#Q:N]D`7`Q]1V0@/K@PQ-4?_4>Y/O]?UA^`='\D`%; +M=`7PD`:2=`'PD(#DX$0(\"*0@.K@<`)1P"+PY/4=D(#YX/4>Y/O]?U1^`8X9 +MCQKE'E0'Q#-4X(49@X4:@O#E'50'Q#-4X/_E'A,3$U0?3Z/PZU0'Q#-4X/_E +M'1,3$U0?3X4:@H49@Z.C\+T!#(4:@HZ#HZ.C=`/P(H4:@H49@Z.CHW0!\"*0 +M!@3@5'_PD`4BY/"0@.IT#/`BD`0:X/1@`W\`(I`$&^!4!V0'?P%@`G\`(I"! +M>!)%!A)HDI"`Y^#_L5Z0@.?@8!F0@7@21/V0``$2'[U4#_^0``(2'[W]$FBC +M(I"!!.`PX"R0@0?@!/#@_Y"!!>"U!QV0!I+@5!QP"A'DD($(X`3P@`:0!I)T +M'/#DD($'\"(29I"0@.IT"/`BY)"!G?"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\! +M(M.0@9[@E.B0@9W@E`-`"I`!P.!$(/!_`")_,GX`$C*JD(&=Y'7P`1)$J8"_ +MD`#WX"#G">!_`2#F#'\"(I``]^`PY@)_`R(1.9"``>_P$660`61T`?`"+:<1 +MTS$#$9(1L>3U-?4V]3?U.*TU?U`2,AZM-G]1$C(>K3=_4A(R'JTX?U,",AYU +M/1#D]3YU/P=U0`*0`3#E/?"CY3[PH^4_\*/E0/`B=44.=48!0T80=4<#=4AB +MD`$XY47PH^5&\*/E1_"CY4CP(I`!,.3PH_"C\*/PD`$X\*/PH_"C\/U_4!(R +M'N3]?U$2,A[D_7]2$C(>Y/U_4P(R'I`!-'3_\*/PH_"C\)`!//"C\*/PH_#] +M?U02,AY]_W]5$C(>??]_5A(R'GW_?U<",AZ0`(#@1(#]?X`2,AZ0_0#@5+_P +M,<`2,G=Q>S&G?P$20Q60@0!T`O#_$D,5D($`X`3P?P,20Q60@0#@!/`14S&, +MD`"`X$1`_7^`$C(>=2#_,;&1<>3_`D.>,:LQN+%#,!)$_9```A(?O9"! +M?/"`!9"!?._PD(%[[O"0@7S@_I"!>^#_TYY0.)"!>!)$_1(?I%0!_G2C+_6" +MY#2`]8/N\'2C+_6"Y#2`]8/@<`1Q,(`'D(%[X/]Q+Y"!>^`$\("ZD("CX'`E +MD(#JX'`$_Q),OI"`ZN!D#&`#$D]7D(#DX%3W\%3O\%2_\%1_\"(B(A(?I)"` +M\?`B$A^DD(#_\)"`_^"0`>?P(A(?I)"!"?"0``$2'[V0@0KP(A(?I/]4`?Z0 +M@0'@5/Y.\._#$S#@"I```1(?O9"!`O`BD`$!X$0$\)`!G'1^\*-TDO"C=*#P +MHW0D\)`!FW1)\)`!FG3@\)`!F>3PD`&8!/`BTQ"O`"4,I"!$."4`$"YD`'&X##CLB(2'Z3_ +M5'^0@.?P[\03$Q-4`:/PD``!$A^]_U3PQ%0/_I"`YN!4\$[PD``#$A^]5`$E +MX/Z0@.3@5/U.\.]4#\14\/^0@.;@5`]/\)``!!(?O9"`Z?`23X.0`;ET`?"0 +M`;CPD(#GX)`!NO"0@.G@D`&[\)"`YN!4#Y`!OO`BY)"`Y_"C\)"`YN!4#_!4 +M\/"0@.3@5/WP5/?P5._PD(#M=`'PH_"0@.3@5/OPH^!4^_#DD(#P\)"`[W0' +M\)"`\N3PHW0"\.20@.OPD(#DX%3^\)"`Z70,\)"`Y.!4W_"0@.IT#/"0@.3@ +M5+_P5'_PH^!4_O!4_?!4]_"0@/02(-H`````D(`!X+0!")"`\729\(`2D(`! +MX)"`\;0#!720\(`#=$#PD(#X=`'PHW0'\*/@5`%$*/"C=`7PY*/PH_"C\*/P +M(M,0KP'#P-"0`H%Y +M;1(K[9"!E^!U\`20`=$21/'@D(%N\)"!E^!U\`20`=(21/'@D(%O\)"!E^!U +M\`20`=,21/'@D(%P\)"!E^!U\`20`?`21/'@D(%Q\)"!E^!U\`20`?$21/'@ +MD(%R\)"!E^!U\`20`?(21/'@D(%S\)"!E^!U\`20`?,21/'@D(%T\)"!:^#_ +MD(&7X/YT`:@&"(`"PS/8_/1?D(%K\)"!E^#_=`&H!PB``L,SV/R0`6Y1!I"!E^`$\.!4`_#!&)`!P.!$`O#0T)*O(N3[^OU_`1)$3I"! +M:N_P8/#1!X#LY)"!$O"0@1+@9`'P)$J0`<3P=%>C\)"`ZN#_D(#IX&]@`Q)' +MIA)B^[\!`O&%$C*>OP$#$EY&$D)-@,K3$*\!P\#0D(#DX##@`O&:T-"2KR*0 +M@.K@<`X2:52_`0CQKY`!Y>`$\"+3$*\!P\#0$F<$\<#0T)*O(A)F_)``".!4 +M[_U_"!(R'N3_CU#DD($3\*/PD`$)X'\`,.<"?P'O95!@/L.0@13@E(B0@1/@ +ME!-`")`!P.!$$/`BD($3Y'7P`1)$J7\4?@`2,JK3D($4X)0RD($3X)0`0+F0 +M`<;@,."R(N3[^OU_`1)$3I"!?>_P8/`1/8#LTQ"O`X/Z0@)W@ +M_;4&!'X!@`)^`.YD`6`RD`&OX'`3[77P#Z0D!_ET@#7P^GL!$95_`>]@%I"` +MG>`$\.!_`+0*`G\![V`%Y)"`G?#0T)*O(M,0KP'#P-"0@7X210:0@9C@_P3P +MD``![Q(?_'^O?@$1^.]@.I"!?A)$_8L3BA2)%9``#A(?O20"]19[`7H!>:`2 +M*^V0@7X21/V0``X2'[V0`:[PHW3_\)`!R^!D@/#0T)*O(M,0KP'#P-"0@8ON +M\*/O\.2C\*/PD(&+X/ZCX/6"CH/@8"W#D(&.X)3HD(&-X)0#0`N0`<#@1(#P +M?P"`%9"!C>1U\`$21*E_"GX`$C*J@,5_`=#0DJ\BD(%%[_"C[?"C$B#:```` +M`.20@5/P?R1^"!(M7)"!2Q(@SI"!1>#[<`B0@4L21-F`%NMU\`BD)&+U@N0T +MA_6#X/ZCX/\2+5R0@4\2(,Z0@4;@_^3\_?YX%Q(@NZ@$J06J!JL'D(%/$D39 +M[51__>Q4@/P21,SL1(#\D(%/$B#.D(%+$D39[%1__)"%NQ(@SG\D?@@2+J*0 +M@47@=?`(I"1B]8+D-(?U@^#^H^#_P`;`!Y"!3Q)$V9"%NQ(@SM`'T`82+J*0 +M@4L21-GL1(#\D(6[$B#.?R1^"!(NHI"!1>!P!'\@@`F0@47@M`$6?RA^"!(M +M7'@($B"H[U0!_^20@5/O\)"!4^"0@45@#N!U\`BD)&;U@N0TAX`,X'7P"*0D +M9/6"Y#2']8/@_J/@_Q(M7.U4#_WD_)"!1Q(@SI"!1P)$V=,0KP'#P-`Q3M#0 +MDJ\BD($E$D4&$A^DD($I\)```1(?O9"!*/"0``(2'[V0@3OPD``#$A^]D($\ +M\)"!)1)$_>DD!/GD.HL3]12)%746!'L!>H%Y/1(K[9"!)1)$_>DD"/GD.HL3 +M]12)%746!'L!>H%Y01(K[9"!*>`D^&!Y)/Q@=20(8`*!W)"!*."T`042*<6! +MWY"!*."T`@42$;V!WY"!*."T`P42!NN!WY"!*."T$!F0@3S@_I"!.^#][?^0 +M@2KN\*/O\!(RJH'?D($HX+01&9"!/.#^D($[X/WM_Y"!*N[PH^_P$C(&@=^0 +M@2C@]&`"@=__(I"!*>"T#`B0@3IT`?"`!>20@3KPD($HX&0'8`*!KY"!.^"0 +M@3CPD($\X)"!.?"0@3[@_^3\_?YX"!(@NZ@$J06J!JL'D($]X/_D_/W^$D3, +MP`3`!<`&P`>0@3_@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($L$B#.D($YX/^0 +M@3C@_5&-D($P$B#.D($ZX'`"@9>0@4+@_^3\_?YX"!(@NZ@$J06J!JL'D(%! +MX/_D_/W^$D3,P`3`!<`&P`>0@4/@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($T +M$B#.D($T$D39$B";D($P$D3E$D2_P`3`!<`&P`>0@2P21-F0@3021.421+_0 +M`]`"T`'0`!)$S)"!+!(@SI"!+!)$V9"!1Q(@SI"!..#]H^#_D>*`,)"!.^#_ +MH^#]D($ZX)"!2/![`7J!>3VC$D4&>H%Y09"!3!)%!I"!*.#[\9.``W\"(G\! +M(M,0KP'#P-#`!\`%D(%'$D39D(%-$B#.T`70![$$T-"2KR*0@4OO\*L%D(%1 +M$B#:`````*\#Y/S]_G@4$B"[J`2I!:H&JP>0@4T21-GM5`_]Y/P21,SL5`_\ +MD(%1$B#.D(%+X'7P"*0D8/6"Y#2']8/@_J/@_\`&P`>0@5$21-F0A;L2(,[0 +M!]`&`BZBD`()X)"!$_"C="#PD($3X/\PX`6CX"2`\._#$Y#]$/#DD($D\)"! +M%.`D`/6"Y#3\]8/@D($6\)"!).!D`?`D;I`!Q/!T7:/PD($6X/]D!&`*[V0( +M8`7O9`QP>N20@17PD($6X/^0@17@_L.?4#_@_Y"!%.#]+R0`]8+D-/SU@^#\ +M=!1=1FY"!(^_PPY0"4!:0@2/@8`V0@17@_Y"!%.`O\*&3?P$B?P`B$BVG +MY/52$C*>[V!R8U(!Y5(D1I`!Q/!T7J/PD`"(X/50]5%4#V#?Y5`PX`L@Y`,2 +M*<534>Z`/N50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`(^50,.(+(.8#$@;K +M4U'[@!/E4##C#B#G"+%N[W`#0U&`4U'WK5%_B!(R'H"((I"!@>_PH^WPK0.L +M`N20@8GPH_"0`<1TQ?!T7J/P[%0__)`!0.WPK@3NH_"0@8'@)(%@-"3:8!PD +M/'!!D(&"X,0S,S-4@)"!AO"C=&GPHW2`\(`LD(&"X%0!D(&&\*-TI?"C=`'P +M@!B0@8+@Q%00D(&&\*-T?_"C=!#P@`-_`"*0@8?@D`$&\)"!AN!@#I`!0O"0 +M@87@D`%#\(`-D`%#Y/"0@8;@D`%"\)"!B.#_D`%"X%__D(&&X&]@[G3%!)`! +MQ/!T7J/PD`%#Y/!_`2(BD(%%[_"C[?"CZ_"0@4D21/V+$XH4B15U%@1[`7J! +M>6(2*^V0@4P21/V+$XH4B15U%@1[`7J!>682*^V0@4;@_I"!1>#][?^0@4_N +M\*/O\)"!1^#_M`0(D(%2=`'P@`_OD(%2M`4%=`+P@`-T!/#3D(%0X)3_D(%/ +MX)0`0`(!DN20@5'PD(%2X/^0@5'@_L.?0`)!]'1B+O6"Y#2!]8/@D(%3\.[_ +MD(%0X"__D(%/X#0`CX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D-('U@^"0@5WP +MX/_T_I"!5.!>_I"!4^#][UU.\)"!3Z/@_Z/@+_^0@5/@_1(R'I"!4>`$\("% +MTY"!4."4_Y"!3^"4!U!XY)"!4?"0@5+@_Y"!4>#^PY]``D'T=&(N]8+D-('U +M@^"0@5/P[O^0@5#@+_N0@4_@-`#ZBX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D +M-('U@^"0@5WPX/_T_I"!5.!>_I"!4^#][UU.\)"!4^"+@HJ#\)"!4>`$\("- +MY)"!4_"0@5X2(-H`````D(%5$B#:`````)"!2.!@$9"!3^#^H^#_$BU#^PY]``D$?=&(N]8+D-('U@^"0@5/PD(%(X&!W +MD(%1X/LD9O6"Y#2!]8/@D(%=\)"!61)$V>MU\`BD^?@2(*B0@5W@_O1?_Y"! +M4^#][EU/\)"!7A)$Y<``P`'``L`#D(%=X/]^`)"!4>!U\`BD_>^H!0B`!<,S +MSC/.V/G_[C.5X/W\T`/0`M`!T``21,R0@5X2(,Z0@5421.7``,`!D(%3X/_D +M_/W^D(%1X'7P"*3Y^!(@N]`!T``21,R0@542(,Z0@5'@!/`A3I"!2.!@.I"! +M7A)$V1(@FY"!61)$Y1)$O\`$P`7`!L`'D(%5$D39D(%>$D3E$D2_T`/0`M`! +MT``21,R0@542(,Z0@5421-F0A;L2(,Z0@4_@_J/@_Q(NHI"!1^"0`:#PD(%2 +MX)`!H?"0@4C@D`&B\)"!21)$_1(?I)`!I/"0``$2'[V0`:7PD``"$A^]D`&F +M\)```Q(?O9`!I_"0@5421-F0`:CO\)"!51)$V7@($B"HD`&I[_"0@5421-EX +M$!(@J)`!JN_PD(%5$D39>!@2(*B0`:OO\"*/#2*/#B)_`I"!`.#^[\.>4!CO +M)>`D@?CF,.0+D`&X=`CPH_!_`"(/@-Y_`2*0`33@53WU0:/@53[U0J/@53_U +M0Z/@54#U1)`!-.5!\*/E0O"CY4/PH^5$\"*0`3S@547U2:/@54;U2J/@54?U +M2Z/@54CU3)`!/.5)\*/E2O"CY4OPH^5,\%.1WR*0@*/@9`%P&9"`Y^!@$Y`! +M5^3PD`$\=`(23NN0`5=T!?`BD(#GX&`UD`:2X##@).3U'9"`^N##$U1_]1[D +M^_U_6'X!$D[\D`%;=`7PD`:2=`'P(I"`Y.!4]_`21Z8BD(#GX&`UD`:2X##A +M).3U'9"`^N##$U1_]1[D^_U_7'X!$D[\D`%?=`7PD`:2=`+P(I"`Y.!4[_`2 +M1Z8BD7&0@0SO\)"`Y##@!N!$`?"`!.!4_O"0@0S@,.81D`$OX##G!.3P@`:0 +M`2]T@/"0@.3@,.`:D(#RY/"C=`?PD(#RH^"0!5CPD`3LX%3=\"*0!.S@1"+P +M(N20@0WPH_"C\)``@^"0@0WPD`"#X/Z0@0W@_[4&`2+#D($/X)1DD($.X)0` +M0`V0`<#@1$#PD($-X/\BD($.Y'7P`1)$J8#"D($)X&`/Y/"0!5/@1`'PD`7] +MX`3P(I"`Y.#_Q!,35`,PX"?O5+_PD`3@X)"`Y3#@!N!$`?"`$.!4_O"0`;ET +M`?"0`;AT!/`21Z;D_Y"!!.`PX$B0@0C@_6!!=`%^`*@'"(`%PS/.,\[8^?^0 +M!.#@^^];8`;DD($(\"*0@0;@TYU0$)`!QW00\+%4D($$X%3^\"(22.20@0C@ +M!/`BD(`!X&0"8`>0!I#@1`'P(I"`Y.#_Q!,3$U0!,.`L[U1_\)`$X."0@.4P +MX0;@1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@.?@8`,21Z9_`:$$TQ"O`!@&I`%(N!4D&`'D`'`X$0(\)`!QN`PX>1_`(`"?P'0T)*O(L/NE`%`"@WM +M$Y#]$/#D+_\BP^Z4`4`DD/T1X&UP&I`!%^"U!0V0`>1T=_"0_1'D\(`&[020 +M_1'PY"__(M,0KP'#P-"0`0'@1`+PD`$`=/_PD`:W=`GPD`:T=(;P?WQ^"!(M +M7.Q4?_R0@8\2(,Z0@8\21-F0A;L2(,Y_?'X($BZBD(6[$B#:S,``P'^,?@@2 +M+J*0A;L2(-H`P``4?W!^#A(NHI"%EA(@V@`#/F#D_?\2,4W0T)*O(M$,D(#J +M=`SP(A)/\9"%NQ(@VLSP`,!_C'X($BZBD(6[$B#:````%']P?@X2+J*0A982 +M(-H`````Y/W_$C%-?WQ^"!(M7.Q$@/R0@9,2(,Z0@9,21-F0A;L2(,Y_?'X( +M$BZBD`$`=#_PH^!4_?"0!5/@1"#P(I``D.`@X/DBD(#QX/U_DQ(R'I"`Z.!@ +M$I`!+^`PYP5T$/"`!I`!+W20\)``".!$$/U_"!(R'G\!$E?1D`"0X$0!_7^0 +M$C(>?Q1^``(RJN\4D`5S\)`!/W00\/U_`W1%+_CF3?[V=#@O]8+D-`'U@^[P +M(G1%+_CF_NWT7O[V=#@O]8+D-`'U@^[P(M,0KP'#P-"0@:#M\)"!G^_PTY0' +M4'#@_W0!J`<(@`+#,]C\]/^0`$?@7_U_1Q(R'I"!G^#_=`&H!PB``L,SV/S_ +MD`!&X$_]?T82,AZ0@:#@8!B0@9_@_W0!J`<(@`+#,]C\_Y``1>!/@!>0@9_@ +M_W0!J`<(@`+#,]C\]/^0`$7@7_U_18!^D(&?X"3X\.`D!/]T`:@'"(`"PS/8 +M_/3_D`!#X%_]?T,2,AZ0@9_@_W0!J`<(@`+#,]C\_Y``0^!/_7]#$C(>D(&@ +MX&`=D(&?X"0$_W0!J`<(@`+#,]C\_Y``0N!/_7]"@!R0@9_@)`3_=`&H!PB` +M`L,SV/ST_Y``0N!?_7]"$C(>T-"2KR*0@.3@5/OPY)"`\/"0@.OP(N\D_F`, +M!'`HD(#M=`'PH_`B[7`*D(#[X)"`[?"`!9"`[>WPD(#MX*/PD(#EX$0(\"(2 +M3VKO9`%@")`!N'0!\(!GD(#KX/]4`V`(D`&X=`+P@%:0@.G@_N3#GE`(D`&X +M=`3P@$3O,.((D`&X=`CP@#B0@.O@,.0(D`&X=!#P@"F0@.7@$Q-4/R#@")`! +MN'0@\(`6D(#_X&`(D`&X=(#P@`B0`;CD\'\!(I`!N70$\'\`(I`"A^!@")`! +MN'0!\(`7D`*&X"#A")`!N'0$\(`(D`&XY/!_`2*0`;ET"/!_`"+O8#Z0@*/@ +M9`%P-I"`Y>!4_O"0!2)T#_"0!@3@5+_PY/\22.:_`0Z0@.3@1$#PD(#J=`;P +M(I`!N70!\)`!N'0(\"*0!2)T;_"0!2?@5+_PD(#J=`+P(N20@0OPD`:IX)"! +M"_#@5,!P#9"`Z^!4_O!4_?`"1Z:0@0O@,.8BD(#GX&0!<"&0@.O@1`'PD(#F +MX%0/9`)@!%%*@`P23CV`!Y"`Z^!4_O"0@0O@D(#K,.<4X$0"$D[KD`%7=`7P +MD(#DX$0$\"+@5/WP(I`$'>!P%)"``^#_Y/T22?F.3H]/D`0?="#P(I"`H^!D +M`6`"0?J0@.?@<`)!^I"`YN#$5`]D`7`BD`:KX)"`[O"0!JK@D(#M\*/@_W`( +MD(#MX/[_@`"0@.[O\)"`Y>!$!/#DD(#P\)"`\J/@D`58\)`!5^3PD`$\=`+P +MD(#KX%3]\%3O\)"`YN#_Q%0/)/U0`H`",=B0@.7@$Q,35!\PX!"0@.W@_Z/@ +MM0<&$F=*$DV?(I"`Y.#_$Q-4/S#@$>]4^_"0@.O@5/WP5`=P0H`]D(#PX`3P +MD(#KX%3O\)"`\.#_M`$"@`3OM`(&D`58X`3PD(#XX/^0@/#@TY]`#Y"`H^"T +M`0N0@.7@5/OP(A)'IB+D_N_#$_WO,.`$[B2`_I#]$.WPKP8BJP>J!NTK^^0Z +M^L.0@*#@FY"`G^":4!.CX"0!_Y"`G^`T`/[#ZY_[ZI[ZZI#]$?"O`W0`+_6" ++Y#3[]8/@_R(`,@@` +` +end +begin 644 rtwn-rtl8188eefw.fw +MX8@0``@````0)2%6L"L``*($```````````````````"134````````````` +M````````P58````````````````````````````````````````````````` +M````````````H01X@!;F"'`+PJ_F,.$#1!CVTJ\(V>WJB]`BY0S_(R2!^`\( +M"+\$!'\`>('F,.3R`.4,PY]0(`4,=(@E#/CF_::!".:N#+X#`G3_S?CH;6#@ +M".;`X(#VY0S3GT`GY0PDB?CFK@R^`P)T__T8YLWXY8%M8`;0X/88@/7E#"2( +MR/85#(#3Y0PC)('X?P3"K^8PX`,0X@Q_`##A!S#C!'\(5/14?,;2KU2`0@(BF@70#8`;_"';_W_M_!.1X@/8(]@C?^GB!=C"01<5T`9/`X.23P.!#B0%U +MBF!UC'G2C-*O(@/OTY0#0`-__R)T@2\O^.8@Y?3"K^9$,/;2KZX,[L.?4"$. +M=(@N^.;Y".88O@,"=/_][6E@"0GG&1GW"0F`\Q86@-KNTY]`!`6!!8'NTY]` +M(G2(+O@(YOGNM0P"J8$8!@;F_>UI8`D9&><)"?<9@/,>@-GO)(CXY@3X[R\$ +MD$7%D_8([R^3]G\`(N_3E`-``W__(N\C)('XYC#E],*OYE2,]M*OY0RU!PIT +MB"_XYO6!`D)-4"YTB2_XYK\#`G3__1CF^72(+_C[YOSI;&`(J`7G]AT9@/2H +M`Z8%'^4,M0?C?P`B=(DO^.;]&(8!#W2(+_BF`0B&!.4,M0<"K('M;&`(#0FH +M!>;W@/3E#+4'WHF!?P`B[].4`T`#?_\B[R,D@?C"K^8PY04PX`+2Y-+BQM*O +M?P`PX@$/`D),C_#D__[E#",D@/C"J3#W#7\(YF`++?9@,%`N@`!@J$"XY).C^N23H_CDDZ/(Q8+(RL6#RO"CR,6" +MR,K%@\K?Z=[G@+X`08&7`$&!F`!!@:0`43172EK3I_51(R'JT[?U82,AZM/']7$C(>4Y'O(L#@P/#`@\""P-!U +MT`#``,`!P`+``\`$P`7`!L`'D`'$=%;P=$:C\!)C(N5!,.0$?P*1)^5#,.`" +MT?3E0S#A`Q)-N^5#,.(#$DX*Y4,PXP,28W_E0S#D`O&PY4,PY0+QWN5#,.8" +M\8OE1##A`M'J=%8$D`'$\'1&H_#0!]`&T`70!-`#T`+0`=``T-#0@M"#T/#0 +MX#*0@.?@8`,23H0BD($*X&`/Y/"0!5/@1`+PD`7\X`3PY/^0@.?@8'F0@*/@ +M9`%P<9"`YN#$5`]@)"3^8`,$3U'9"`\."`#>3U'9"`\.!U\`.D +M)/[_D(#OX"\23O.0`5=T!?"0@.K@(.(#$DK`(I"`H^"T`1.0@.?@8`V0@.O@ +M5/[P5`=P`O&F(I"`Z>#_?0$"2L20@*/@9`%P)9"`Y^!@'Y`!5^3PD`$\=`+P +MD(#DX%3[\)"`Z^!4_?!4!W`"\:8BD("CX+0!%I"`Y^!@$)"`YN!4#V0"8`," +M:DH23CTBP.#`\,"#P(+`T'70`,``P`'``L`#P`3`!<`&P`>0`<1T_/!T1Z/P +M$F-/Y4DPX0(1E.5),.(#$F.AY4DPXP,28]WE2C#@`Q)D&>5*,.0#$F2XY4PP +MX05_`Q)$)^5,,.0"$9[E3##E`Q)DSN5,,.8#$F5D=/P$D`'$\'1'H_#0!]`& +MT`70!-`#T`+0`=``T-#0@M"#T/#0X#*0@.?@8`,2:OLBL2J0@.W@%)`%<_!] +M`G\"46.0@0'@,.`MD("CX+0!)I"!I.`$\."T"@N0@0/@!/#DD(&D\)"!`^#_ +MD($"X+4'!>2C\!'D(N3_CU.0!!W@8!B0!2+@]59T__#Q\;\!`C%0@9O@D`0E\)"!G.!@#G0/+_6"Y#3\]8/@1(#PKP5T""_U@N0T_/6#Y/!T +M"2_U@N0T_/6#X%3P\'0A+?6"Y#3\]8/@5/?PK@2O!=#0DJ\B=#TO^.9-_O9T +M,"_U@N0T`?6#[O`BD`$V='CPHW0"\'UX_U%C?0)_`U%CD`8*X$0'\)"`\J/@ +MD`58\)"`H^"T`120@.7@5/OPD(#JX"#B#7T!?P2`#)"`Y>!$!/`B?0%_!-,0 +MKP'#P-"0@:'M\)"`ZN"0@:+PD(#DX/[$$Q-4`S#@`H$6[L03$Q-4`3#@`H$6 +MD(&BX/YO<`*!%N]P`F&-)/YP`F'&)/Y@223\<`*!`23\8`*!%NZT#@*1EI"! +MHN!P!'\!D;Z0@:+@M`8"D7"0@:+@M`0.D(&AX/]@!1)I@H`"\5>0@:+@9`A@ +M`H$6$F:'@1:0@:+@<`1_`9&^D(&BX+0&`I%PD(&BX+0.!Y$;OP$"D9:0@:+@ +M9`Q@`H$6D1OO9`%@`H$6D=B!%I"!HN"T#@>1&[\!`I&6D(&BX+0&`I%PD(&B +MX+0,!Y$;OP$"D=B0@:+@9`1P7!)HU.]D`7!4L0Z`4)"!HN"T#@>1&[\!`I&6 +MD(&BX+0&`I%PD(&BX+0,!Y$;OP$"D=B0@:+@<`1_`9&^D(&BX+0$&A)IQ(`5 +MD(&BX+0,#I"`Y>#_$Q-4/S#@`O'GT-"2KR+Q:N]D`6`(D`&X=`'P@#V0@.3@ +M_Q,3$U0?,.`(D`&X=`+P@"COQ%0/,.`(D`&X=`3P@!F0@.G@TY0$0`B0`;AT +M"/"`")`!N.3P?P$BD`&Y=`+P?P`BD(#EX)`&!"#@#.!$0/"0@.IT!/"`"N!4 +M?_"0@.IT#/"0!2+D\"*0@.7@PQ,@X`B0@.IT#/"`$9`&!.!$0/#@1(#PD(#J +M=`3PD`4BY/`BD(&C[_`29@R0@:/@8`60!2+D\)"`ZG0$\"*0@*/@9`%P+9"` +MY>!4_?"0!2)T;_!_`1'FOP$.D(#DX$2`\)"`ZG0.\"*0`;ET`?"0`;@$\"*0 +M!2)T__#Q\9`!-W0"\/U_`U%C$F:0Y)"`ZO`BD(#GX&`MD("CX&0!<"60@.[P +M!&`>D(#KX$00\.3U'9"`[]'RD`%7=`7PD(#JX"#B`E'`(N]P-GUX?P*QHWT" +M?P.QHWW(?P(29VZ0`5?D\)`!/'0"\'T!?PQ1Q)"`Y.!4]_!4[_"0!@K@5/CP +M(D%X?0)_`K&C?0%_`G0]+_CF_NWT7O[V=#`O]8+D-`'U@^[P(I"`Y^!@19"` +MY>#_$Q,35!\PX!*0`3O@,.0+L9F0@.W@%)`%<_"0@9GD=?`!$D2IPY"!FN"4 +M@)"!F>!D@)2`0`N0`9C@5/[PX$0!\/&S`:^0@.K@9`)@*A)J99"`Y>`3$Q-4 +M'S#@%9"`[>#_H^!O<`L29TJQF9"`[N`4\)`!YN`$\"*0`5_D\)`!/'0(\.3U +M'9"`^N##$U1_]1[D^_U_7'X!T?R0`5]T!?"0!I)T`O"0@.3@1!#PD(#JX&0, +M8`KD_7\,4<3D_Q'F(I"`Y^!D`7!>D(#FX%0/8$Z0@.K@<`/_D;Z0@.K@9`Q@ +M`O%7D`%;Y/"0`3QT!/#Q:N]D`7`Q]1V0@/K@PQ-4?_4>Y/O]?UA^`='\D`%; +M=`7PD`:2=`'PD(#DX$0(\"*0@.K@<`)1P"+PY/4=D(#YX/4>Y/O]?U1^`8X9 +MCQKE'E0'Q#-4X(49@X4:@O#E'50'Q#-4X/_E'A,3$U0?3Z/PZU0'Q#-4X/_E +M'1,3$U0?3X4:@H49@Z.C\+T!#(4:@HZ#HZ.C=`/P(H4:@H49@Z.CHW0!\"*0 +M!@3@5'_PD`4BY/"0@.IT#/`BD`0:X/1@`W\`(I`$&^!4!V0'?P%@`G\`(I"! +M>!)%!A)HDI"`Y^#_L5Z0@.?@8!F0@7@21/V0``$2'[U4#_^0``(2'[W]$FBC +M(I"!!.`PX"R0@0?@!/#@_Y"!!>"U!QV0!I+@5!QP"A'DD($(X`3P@`:0!I)T +M'/#DD($'\"(29I"0@.IT"/`BY)"!G?"C\)`%^.!P#Z/@<`NCX'`'H^!P`W\! +M(M.0@9[@E.B0@9W@E`-`"I`!P.!$(/!_`")_,GX`$C*JD(&=Y'7P`1)$J8"_ +MD`#WX"#G">!_`2#F#'\"(I``]^`PY@)_`R(1.9"``>_P$660`61T`?`"+:<1 +MTS$#$9(1L>3U-?4V]3?U.*TU?U`2,AZM-G]1$C(>K3=_4A(R'JTX?U,",AYU +M/1#D]3YU/P=U0`*0`3#E/?"CY3[PH^4_\*/E0/`B=44.=48!0T80=4<#=4AB +MD`$XY47PH^5&\*/E1_"CY4CP(I`!,.3PH_"C\*/PD`$X\*/PH_"C\/U_4!(R +M'N3]?U$2,A[D_7]2$C(>Y/U_4P(R'I`!-'3_\*/PH_"C\)`!//"C\*/PH_#] +M?U02,AY]_W]5$C(>??]_5A(R'GW_?U<",AZ0`(#@1(#]?X`2,AZ0_0#@5+_P +M,<`2,G=Q>S&G?P$20Q60@0!T`O#_$D,5D($`X`3P?P,20Q60@0#@!/`14S&, +MD`"`X$1`_7^`$C(>=2#_,;&1<>3_`D.>,:LQN+%#,!)$_9```A(?O9"! +M?/"`!9"!?._PD(%[[O"0@7S@_I"!>^#_TYY0.)"!>!)$_1(?I%0!_G2C+_6" +MY#2`]8/N\'2C+_6"Y#2`]8/@<`1Q,(`'D(%[X/]Q+Y"!>^`$\("ZD("CX'`E +MD(#JX'`$_Q),OI"`ZN!D#&`#$D]7D(#DX%3W\%3O\%2_\%1_\"(B(A(?I)"` +M\?`B$A^DD(#_\)"`_^"0`>?P(A(?I)"!"?"0``$2'[V0@0KP(A(?I/]4`?Z0 +M@0'@5/Y.\._#$S#@"I```1(?O9"!`O`BD`$!X$0$\)`!G'1^\*-TDO"C=*#P +MHW0D\)`!FW1)\)`!FG3@\)`!F>3PD`&8!/`BTQ"O`"4,I"!$."4`$"YD`'&X##CLB(2'Z3_ +M5'^0@.?P[\03$Q-4`:/PD``!$A^]_U3PQ%0/_I"`YN!4\$[PD``#$A^]5`$E +MX/Z0@.3@5/U.\.]4#\14\/^0@.;@5`]/\)``!!(?O9"`Z?`23X.0`;ET`?"0 +M`;CPD(#GX)`!NO"0@.G@D`&[\)"`YN!4#Y`!OO`BY)"`Y_"C\)"`YN!4#_!4 +M\/"0@.3@5/WP5/?P5._PD(#M=`'PH_"0@.3@5/OPH^!4^_#DD(#P\)"`[W0' +M\)"`\N3PHW0"\.20@.OPD(#DX%3^\)"`Z70,\)"`Y.!4W_"0@.IT#/"0@.3@ +M5+_P5'_PH^!4_O!4_?!4]_"0@/02(-H`````D(`!X+0!")"`\729\(`2D(`! +MX)"`\;0#!720\(`#=$#PD(#X=`'PHW0'\*/@5`%$*/"C=`7PY*/PH_"C\*/P +M(M,0KP'#P-"0`H%Y +M;1(K[9"!E^!U\`20`=$21/'@D(%N\)"!E^!U\`20`=(21/'@D(%O\)"!E^!U +M\`20`=,21/'@D(%P\)"!E^!U\`20`?`21/'@D(%Q\)"!E^!U\`20`?$21/'@ +MD(%R\)"!E^!U\`20`?(21/'@D(%S\)"!E^!U\`20`?,21/'@D(%T\)"!:^#_ +MD(&7X/YT`:@&"(`"PS/8_/1?D(%K\)"!E^#_=`&H!PB``L,SV/R0`6Y1!I"!E^`$\.!4`_#!&)`!P.!$`O#0T)*O(N3[^OU_`1)$3I"! +M:N_P8/#1!X#LY)"!$O"0@1+@9`'P)$J0`<3P=%>C\)"`ZN#_D(#IX&]@`Q)' +MIA)B^[\!`O&%$C*>OP$#$EY&$D)-@,K3$*\!P\#0D(#DX##@`O&:T-"2KR*0 +M@.K@<`X2:52_`0CQKY`!Y>`$\"+3$*\!P\#0$F<$\<#0T)*O(A)F_)``".!4 +M[_U_"!(R'N3_CU#DD($3\*/PD`$)X'\`,.<"?P'O95!@/L.0@13@E(B0@1/@ +ME!-`")`!P.!$$/`BD($3Y'7P`1)$J7\4?@`2,JK3D($4X)0RD($3X)0`0+F0 +M`<;@,."R(N3[^OU_`1)$3I"!?>_P8/`1/8#LTQ"O`X/Z0@)W@ +M_;4&!'X!@`)^`.YD`6`RD`&OX'`3[77P#Z0D!_ET@#7P^GL!$95_`>]@%I"` +MG>`$\.!_`+0*`G\![V`%Y)"`G?#0T)*O(M,0KP'#P-"0@7X210:0@9C@_P3P +MD``![Q(?_'^O?@$1^.]@.I"!?A)$_8L3BA2)%9``#A(?O20"]19[`7H!>:`2 +M*^V0@7X21/V0``X2'[V0`:[PHW3_\)`!R^!D@/#0T)*O(M,0KP'#P-"0@8ON +M\*/O\.2C\*/PD(&+X/ZCX/6"CH/@8"W#D(&.X)3HD(&-X)0#0`N0`<#@1(#P +M?P"`%9"!C>1U\`$21*E_"GX`$C*J@,5_`=#0DJ\BD(%%[_"C[?"C$B#:```` +M`.20@5/P?R1^"!(M7)"!2Q(@SI"!1>#[<`B0@4L21-F`%NMU\`BD)&+U@N0T +MA_6#X/ZCX/\2+5R0@4\2(,Z0@4;@_^3\_?YX%Q(@NZ@$J06J!JL'D(%/$D39 +M[51__>Q4@/P21,SL1(#\D(%/$B#.D(%+$D39[%1__)"%NQ(@SG\D?@@2+J*0 +M@47@=?`(I"1B]8+D-(?U@^#^H^#_P`;`!Y"!3Q)$V9"%NQ(@SM`'T`82+J*0 +M@4L21-GL1(#\D(6[$B#.?R1^"!(NHI"!1>!P!'\@@`F0@47@M`$6?RA^"!(M +M7'@($B"H[U0!_^20@5/O\)"!4^"0@45@#N!U\`BD)&;U@N0TAX`,X'7P"*0D +M9/6"Y#2']8/@_J/@_Q(M7.U4#_WD_)"!1Q(@SI"!1P)$V=,0KP'#P-`Q3M#0 +MDJ\BD($E$D4&$A^DD($I\)```1(?O9"!*/"0``(2'[V0@3OPD``#$A^]D($\ +M\)"!)1)$_>DD!/GD.HL3]12)%746!'L!>H%Y/1(K[9"!)1)$_>DD"/GD.HL3 +M]12)%746!'L!>H%Y01(K[9"!*>`D^&!Y)/Q@=20(8`*!W)"!*."T`042*<6! +MWY"!*."T`@42$;V!WY"!*."T`P42!NN!WY"!*."T$!F0@3S@_I"!.^#][?^0 +M@2KN\*/O\!(RJH'?D($HX+01&9"!/.#^D($[X/WM_Y"!*N[PH^_P$C(&@=^0 +M@2C@]&`"@=__(I"!*>"T#`B0@3IT`?"`!>20@3KPD($HX&0'8`*!KY"!.^"0 +M@3CPD($\X)"!.?"0@3[@_^3\_?YX"!(@NZ@$J06J!JL'D($]X/_D_/W^$D3, +MP`3`!<`&P`>0@3_@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($L$B#.D($YX/^0 +M@3C@_5&-D($P$B#.D($ZX'`"@9>0@4+@_^3\_?YX"!(@NZ@$J06J!JL'D(%! +MX/_D_/W^$D3,P`3`!<`&P`>0@4/@_^3\_?YX$!(@N]`#T`+0`=``$D3,D($T +M$B#.D($T$D39$B";D($P$D3E$D2_P`3`!<`&P`>0@2P21-F0@3021.421+_0 +M`]`"T`'0`!)$S)"!+!(@SI"!+!)$V9"!1Q(@SI"!..#]H^#_D>*`,)"!.^#_ +MH^#]D($ZX)"!2/![`7J!>3VC$D4&>H%Y09"!3!)%!I"!*.#[\9.``W\"(G\! +M(M,0KP'#P-#`!\`%D(%'$D39D(%-$B#.T`70![$$T-"2KR*0@4OO\*L%D(%1 +M$B#:`````*\#Y/S]_G@4$B"[J`2I!:H&JP>0@4T21-GM5`_]Y/P21,SL5`_\ +MD(%1$B#.D(%+X'7P"*0D8/6"Y#2']8/@_J/@_\`&P`>0@5$21-F0A;L2(,[0 +M!]`&`BZBD`()X)"!$_"C="#PD($3X/\PX`6CX"2`\._#$Y#]$/#DD($D\)"! +M%.`D`/6"Y#3\]8/@D($6\)"!).!D`?`D;I`!Q/!T7:/PD($6X/]D!&`*[V0( +M8`7O9`QP>N20@17PD($6X/^0@17@_L.?4#_@_Y"!%.#]+R0`]8+D-/SU@^#\ +M=!1=1FY"!(^_PPY0"4!:0@2/@8`V0@17@_Y"!%.`O\*&3?P$B?P`B$BVG +MY/52$C*>[V!R8U(!Y5(D1I`!Q/!T7J/PD`"(X/50]5%4#V#?Y5`PX`L@Y`,2 +M*<534>Z`/N50,.$6(.4.$A&][W`#0U$@D`$&Y/!34?V`(^50,.(+(.8#$@;K +M4U'[@!/E4##C#B#G"+%N[W`#0U&`4U'WK5%_B!(R'H"((I"!@>_PH^WPK0.L +M`N20@8GPH_"0`<1TQ?!T7J/P[%0__)`!0.WPK@3NH_"0@8'@)(%@-"3:8!PD +M/'!!D(&"X,0S,S-4@)"!AO"C=&GPHW2`\(`LD(&"X%0!D(&&\*-TI?"C=`'P +M@!B0@8+@Q%00D(&&\*-T?_"C=!#P@`-_`"*0@8?@D`$&\)"!AN!@#I`!0O"0 +M@87@D`%#\(`-D`%#Y/"0@8;@D`%"\)"!B.#_D`%"X%__D(&&X&]@[G3%!)`! +MQ/!T7J/PD`%#Y/!_`2(BD(%%[_"C[?"CZ_"0@4D21/V+$XH4B15U%@1[`7J! +M>6(2*^V0@4P21/V+$XH4B15U%@1[`7J!>682*^V0@4;@_I"!1>#][?^0@4_N +M\*/O\)"!1^#_M`0(D(%2=`'P@`_OD(%2M`4%=`+P@`-T!/#3D(%0X)3_D(%/ +MX)0`0`(!DN20@5'PD(%2X/^0@5'@_L.?0`)!]'1B+O6"Y#2!]8/@D(%3\.[_ +MD(%0X"__D(%/X#0`CX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D-('U@^"0@5WP +MX/_T_I"!5.!>_I"!4^#][UU.\)"!3Z/@_Z/@+_^0@5/@_1(R'I"!4>`$\("% +MTY"!4."4_Y"!3^"4!U!XY)"!4?"0@5+@_Y"!4>#^PY]``D'T=&(N]8+D-('U +M@^"0@5/P[O^0@5#@+_N0@4_@-`#ZBX+U@^"0@53PD(%(X&`ED(%1X"1F]8+D +M-('U@^"0@5WPX/_T_I"!5.!>_I"!4^#][UU.\)"!4^"+@HJ#\)"!4>`$\("- +MY)"!4_"0@5X2(-H`````D(%5$B#:`````)"!2.!@$9"!3^#^H^#_$BU#^PY]``D$?=&(N]8+D-('U@^"0@5/PD(%(X&!W +MD(%1X/LD9O6"Y#2!]8/@D(%=\)"!61)$V>MU\`BD^?@2(*B0@5W@_O1?_Y"! +M4^#][EU/\)"!7A)$Y<``P`'``L`#D(%=X/]^`)"!4>!U\`BD_>^H!0B`!<,S +MSC/.V/G_[C.5X/W\T`/0`M`!T``21,R0@5X2(,Z0@5421.7``,`!D(%3X/_D +M_/W^D(%1X'7P"*3Y^!(@N]`!T``21,R0@542(,Z0@5'@!/`A3I"!2.!@.I"! +M7A)$V1(@FY"!61)$Y1)$O\`$P`7`!L`'D(%5$D39D(%>$D3E$D2_T`/0`M`! +MT``21,R0@542(,Z0@5421-F0A;L2(,Z0@4_@_J/@_Q(NHI"!1^"0`:#PD(%2 +MX)`!H?"0@4C@D`&B\)"!21)$_1(?I)`!I/"0``$2'[V0`:7PD``"$A^]D`&F +M\)```Q(?O9`!I_"0@5421-F0`:CO\)"!51)$V7@($B"HD`&I[_"0@5421-EX +M$!(@J)`!JN_PD(%5$D39>!@2(*B0`:OO\"*/#2*/#B)_`I"!`.#^[\.>4!CO +M)>`D@?CF,.0+D`&X=`CPH_!_`"(/@-Y_`2*0`33@53WU0:/@53[U0J/@53_U +M0Z/@54#U1)`!-.5!\*/E0O"CY4/PH^5$\"*0`3S@547U2:/@54;U2J/@54?U +M2Z/@54CU3)`!/.5)\*/E2O"CY4OPH^5,\%.1WR*0@*/@9`%P&9"`Y^!@$Y`! +M5^3PD`$\=`(23NN0`5=T!?`BD(#GX&`UD`:2X##@).3U'9"`^N##$U1_]1[D +M^_U_6'X!$D[\D`%;=`7PD`:2=`'P(I"`Y.!4]_`21Z8BD(#GX&`UD`:2X##A +M).3U'9"`^N##$U1_]1[D^_U_7'X!$D[\D`%?=`7PD`:2=`+P(I"`Y.!4[_`2 +M1Z8BD7&0@0SO\)"`Y##@!N!$`?"`!.!4_O"0@0S@,.81D`$OX##G!.3P@`:0 +M`2]T@/"0@.3@,.`:D(#RY/"C=`?PD(#RH^"0!5CPD`3LX%3=\"*0!.S@1"+P +M(N20@0WPH_"C\)``@^"0@0WPD`"#X/Z0@0W@_[4&`2+#D($/X)1DD($.X)0` +M0`V0`<#@1$#PD($-X/\BD($.Y'7P`1)$J8#"D($)X&`/Y/"0!5/@1`'PD`7] +MX`3P(I"`Y.#_Q!,35`,PX"?O5+_PD`3@X)"`Y3#@!N!$`?"`$.!4_O"0`;ET +M`?"0`;AT!/`21Z;D_Y"!!.`PX$B0@0C@_6!!=`%^`*@'"(`%PS/.,\[8^?^0 +M!.#@^^];8`;DD($(\"*0@0;@TYU0$)`!QW00\+%4D($$X%3^\"(22.20@0C@ +M!/`BD(`!X&0"8`>0!I#@1`'P(I"`Y.#_Q!,3$U0!,.`L[U1_\)`$X."0@.4P +MX0;@1`+P@`_@5/WPD`&Y=`'PD`&X!/"0@.?@8`,21Z9_`:$$TQ"O`!@&I`%(N!4D&`'D`'`X$0(\)`!QN`PX>1_`(`"?P'0T)*O(L/NE`%`"@WM +M$Y#]$/#D+_\BP^Z4`4`DD/T1X&UP&I`!%^"U!0V0`>1T=_"0_1'D\(`&[020 +M_1'PY"__(M,0KP'#P-"0`0'@1`+PD`$`=/_PD`:W=`GPD`:T=(;P?WQ^"!(M +M7.Q4?_R0@8\2(,Z0@8\21-F0A;L2(,Y_?'X($BZBD(6[$B#:S,``P'^,?@@2 +M+J*0A;L2(-H`P``4?W!^#A(NHI"%EA(@V@`#/F#D_?\2,4W0T)*O(M$,D(#J +M=`SP(A)/\9"%NQ(@VLSP`,!_C'X($BZBD(6[$B#:````%']P?@X2+J*0A982 +M(-H`````Y/W_$C%-?WQ^"!(M7.Q$@/R0@9,2(,Z0@9,21-F0A;L2(,Y_?'X( +M$BZBD`$`=#_PH^!4_?"0!5/@1"#P(I``D.`@X/DBD(#QX/U_DQ(R'I"`Z.!@ +M$I`!+^`PYP5T$/"`!I`!+W20\)``".!$$/U_"!(R'G\!$E?1D`"0X$0!_7^0 +M$C(>?Q1^``(RJN\4D`5S\)`!/W00\/U_`W1%+_CF3?[V=#@O]8+D-`'U@^[P +M(G1%+_CF_NWT7O[V=#@O]8+D-`'U@^[P(M,0KP'#P-"0@:#M\)"!G^_PTY0' +M4'#@_W0!J`<(@`+#,]C\]/^0`$?@7_U_1Q(R'I"!G^#_=`&H!PB``L,SV/S_ +MD`!&X$_]?T82,AZ0@:#@8!B0@9_@_W0!J`<(@`+#,]C\_Y``1>!/@!>0@9_@ +M_W0!J`<(@`+#,]C\]/^0`$7@7_U_18!^D(&?X"3X\.`D!/]T`:@'"(`"PS/8 +M_/3_D`!#X%_]?T,2,AZ0@9_@_W0!J`<(@`+#,]C\_Y``0^!/_7]#$C(>D(&@ +MX&`=D(&?X"0$_W0!J`<(@`+#,]C\_Y``0N!/_7]"@!R0@9_@)`3_=`&H!PB` +M`L,SV/ST_Y``0N!?_7]"$C(>T-"2KR*0@.3@5/OPY)"`\/"0@.OP(N\D_F`, +M!'`HD(#M=`'PH_`B[7`*D(#[X)"`[?"`!9"`[>WPD(#MX*/PD(#EX$0(\"(2 +M3VKO9`%@")`!N'0!\(!GD(#KX/]4`V`(D`&X=`+P@%:0@.G@_N3#GE`(D`&X +M=`3P@$3O,.((D`&X=`CP@#B0@.O@,.0(D`&X=!#P@"F0@.7@$Q-4/R#@")`! +MN'0@\(`6D(#_X&`(D`&X=(#P@`B0`;CD\'\!(I`!N70$\'\`(I`"A^!@")`! +MN'0!\(`7D`*&X"#A")`!N'0$\(`(D`&XY/!_`2*0`;ET"/!_`"+O8#Z0@*/@ +M9`%P-I"`Y>!4_O"0!2)T#_"0!@3@5+_PY/\22.:_`0Z0@.3@1$#PD(#J=`;P +M(I`!N70!\)`!N'0(\"*0!2)T;_"0!2?@5+_PD(#J=`+P(N20@0OPD`:IX)"! +M"_#@5,!P#9"`Z^!4_O!4_?`"1Z:0@0O@,.8BD(#GX&0!<"&0@.O@1`'PD(#F +MX%0/9`)@!%%*@`P23CV`!Y"`Z^!4_O"0@0O@D(#K,.<4X$0"$D[KD`%7=`7P +MD(#DX$0$\"+@5/WP(I`$'>!P%)"``^#_Y/T22?F.3H]/D`0?="#P(I"`H^!D +M`6`"0?J0@.?@<`)!^I"`YN#$5`]D`7`BD`:KX)"`[O"0!JK@D(#M\*/@_W`( +MD(#MX/[_@`"0@.[O\)"`Y>!$!/#DD(#P\)"`\J/@D`58\)`!5^3PD`$\=`+P +MD(#KX%3]\%3O\)"`YN#_Q%0/)/U0`H`",=B0@.7@$Q,35!\PX!"0@.W@_Z/@ +MM0<&$F=*$DV?(I"`Y.#_$Q-4/S#@$>]4^_"0@.O@5/WP5`=P0H`]D(#PX`3P +MD(#KX%3O\)"`\.#_M`$"@`3OM`(&D`58X`3PD(#XX/^0@/#@TY]`#Y"`H^"T +M`0N0@.7@5/OP(A)'IB+D_N_#$_WO,.`$[B2`_I#]$.WPKP8BJP>J!NTK^^0Z +M^L.0@*#@FY"`G^":4!.CX"0!_Y"`G^`T`/[#ZY_[ZI[ZZI#]$?"O`W0`+_6" ++Y#3[]8/@_R(`,@@` +` +end Modified: head/sys/dev/rtwn/pci/rtwn_pci_attach.h ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_attach.h Wed Jan 2 06:03:19 2019 (r342681) +++ head/sys/dev/rtwn/pci/rtwn_pci_attach.h Wed Jan 2 06:48:53 2019 (r342682) @@ -17,9 +17,11 @@ */ void r92ce_attach(struct rtwn_pci_softc *); +void r88ee_attach(struct rtwn_pci_softc *); enum { RTWN_CHIP_RTL8192CE, + RTWN_CHIP_RTL8188EE, RTWN_CHIP_MAX_PCI }; @@ -32,13 +34,15 @@ struct rtwn_pci_ident { static const struct rtwn_pci_ident rtwn_pci_ident_table[] = { { 0x10ec, 0x8176, "Realtek RTL8188CE", RTWN_CHIP_RTL8192CE }, + { 0x10ec, 0x8179, "Realtek RTL8188EE", RTWN_CHIP_RTL8188EE }, { 0, 0, NULL, RTWN_CHIP_MAX_PCI } }; typedef void (*chip_pci_attach)(struct rtwn_pci_softc *); static const chip_pci_attach rtwn_chip_pci_attach[RTWN_CHIP_MAX_PCI] = { - [RTWN_CHIP_RTL8192CE] = r92ce_attach + [RTWN_CHIP_RTL8192CE] = r92ce_attach, + [RTWN_CHIP_RTL8188EE] = r88ee_attach }; static __inline void Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee.h Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,53 @@ +/*- + * Copyright (c) 2018 Farhan Khan + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $FreeBSD$ + */ + +#ifndef RTL8188EE_H +#define RTL8188EE_H + +#include + + +/* + * Global definitions. + */ +#define R88EE_PUBQ_NPAGES 115 +#define R88EE_HPQ_NPAGES 41 +#define R88EE_NPQ_NPAGES 1 +#define R88EE_LPQ_NPAGES 13 +#define R88EE_TX_PAGE_COUNT \ + (R88EE_PUBQ_NPAGES + R88EE_HPQ_NPAGES + \ + R88EE_NPQ_NPAGES + R88EE_LPQ_NPAGES) + + +/* + * Function declarations. + */ +/* r88ee_init.c */ +void r88ee_init_bb(struct rtwn_softc *); +void r88ee_init_intr(struct rtwn_softc *); +int r88ee_power_on(struct rtwn_softc *); +void r88ee_power_off(struct rtwn_softc *); + +/* r88ee_rx.c */ +int r88ee_get_intr_status(struct rtwn_pci_softc *, int *); +void r88ee_enable_intr(struct rtwn_pci_softc *); +void r88ee_start_xfers(struct rtwn_softc *); +void r88ee_post_init(struct rtwn_softc *); + +#endif /* RTL8188EE_H */ + Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_attach.c Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,242 @@ +/*- + * Copyright (c) 2018 Farhan Khan + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include + +#include + +#include +#include /* for 'macaddr' field */ + +#include +#include + +#include +#include + +static struct rtwn_r88e_txpwr r88ee_txpwr; + +void r88ee_attach(struct rtwn_pci_softc *); + +static void +r88ee_set_macaddr(struct rtwn_softc *sc, uint8_t *buf) +{ + struct r88e_rom *rom = (struct r88e_rom *)buf; + + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, rom->diff_d0.pci.macaddr); +} + +static void +r88ee_postattach(struct rtwn_softc *sc) +{ + struct r92c_softc *rs = sc->sc_priv; + struct ieee80211com *ic = &sc->sc_ic; + + rs->rs_scan_start = ic->ic_scan_start; + ic->ic_scan_start = r92c_scan_start; + rs->rs_scan_end = ic->ic_scan_end; + ic->ic_scan_end = r92c_scan_end; +} + +static void +r88ee_attach_private(struct rtwn_softc *sc) +{ + struct r92c_softc *rs; + + rs = malloc(sizeof(struct r92c_softc), M_RTWN_PRIV, M_WAITOK | M_ZERO); + + rs->rs_txpwr = &r88ee_txpwr; + + rs->rs_set_bw20 = r88e_set_bw20; + rs->rs_get_txpower = r88e_get_txpower; + rs->rs_set_gain = r88e_set_gain; + rs->rs_tx_enable_ampdu = r88e_tx_enable_ampdu; + rs->rs_tx_setup_hwseq = r88e_tx_setup_hwseq; + rs->rs_tx_setup_macid = r88e_tx_setup_macid; + rs->rs_set_rom_opts = r88ee_set_macaddr; + + rs->rf_read_delay[0] = 1000; + rs->rf_read_delay[1] = 1000; + rs->rf_read_delay[2] = 1000; + + sc->sc_priv = rs; + +} + +static void +r88ee_adj_devcaps(struct rtwn_softc *sc) +{ + /* XXX TODO */ +} + +void +r88ee_attach(struct rtwn_pci_softc *pc) +{ + struct rtwn_softc *sc = &pc->pc_sc; + + /* PCIe part. */ + pc->pc_setup_tx_desc = r92ce_setup_tx_desc; + pc->pc_tx_postsetup = r92ce_tx_postsetup; + pc->pc_copy_tx_desc = r92ce_copy_tx_desc; + pc->pc_enable_intr = r88ee_enable_intr; + pc->pc_get_intr_status = r88ee_get_intr_status; + + pc->pc_qmap = 0xe771; + pc->tcr = 0x8200; + + /* Common part. */ + sc->sc_flags = RTWN_FLAG_EXT_HDR; + + sc->sc_start_xfers = r88ee_start_xfers; + sc->sc_set_chan = r92c_set_chan; + sc->sc_fill_tx_desc = r92c_fill_tx_desc; + sc->sc_fill_tx_desc_raw = r92c_fill_tx_desc_raw; + sc->sc_fill_tx_desc_null = r92c_fill_tx_desc_null; /* XXX recheck */ + sc->sc_dump_tx_desc = r92ce_dump_tx_desc; + sc->sc_tx_radiotap_flags = r92c_tx_radiotap_flags; + sc->sc_rx_radiotap_flags = r92c_rx_radiotap_flags; + sc->sc_get_rx_stats = r88e_get_rx_stats; + sc->sc_get_rssi_cck = r88e_get_rssi_cck; + sc->sc_get_rssi_ofdm = r88e_get_rssi_ofdm; + sc->sc_classify_intr = r88e_classify_intr; + sc->sc_handle_tx_report = r88e_ratectl_tx_complete; + sc->sc_handle_c2h_report = r88e_handle_c2h_report; + sc->sc_check_frame = rtwn_nop_int_softc_mbuf; + sc->sc_rf_read = r92c_rf_read; + sc->sc_rf_write = r88e_rf_write; + sc->sc_check_condition = r92c_check_condition; + sc->sc_efuse_postread = rtwn_nop_softc; + sc->sc_parse_rom = r88e_parse_rom; + sc->sc_set_led = r88e_set_led; + sc->sc_power_on = r88ee_power_on; + sc->sc_power_off = r88ee_power_off; +#ifndef RTWN_WITHOUT_UCODE + sc->sc_fw_reset = r88e_fw_reset; + sc->sc_fw_download_enable = r88e_fw_download_enable; +#endif + sc->sc_llt_init = r92c_llt_init; + sc->sc_set_page_size = r92c_set_page_size; + sc->sc_lc_calib = r92c_lc_calib; + sc->sc_iq_calib = r88e_iq_calib; + sc->sc_read_chipid_vendor = rtwn_nop_softc_uint32; + sc->sc_adj_devcaps = r88ee_adj_devcaps; + sc->sc_vap_preattach = rtwn_nop_softc_vap; + sc->sc_postattach = r88ee_postattach; + sc->sc_detach_private = r92c_detach_private; + sc->sc_set_media_status = r88e_set_media_status; +#ifndef RTWN_WITHOUT_UCODE + sc->sc_set_rsvd_page = r88e_set_rsvd_page; + sc->sc_set_pwrmode = r88e_set_pwrmode; + sc->sc_set_rssi = r92c_set_rssi; +#endif + sc->sc_beacon_init = r92c_beacon_init; + sc->sc_beacon_enable = r88e_beacon_enable; + sc->sc_beacon_set_rate = rtwn_nop_void_int; + sc->sc_beacon_select = rtwn_nop_softc_int; + sc->sc_temp_measure = r88e_temp_measure; + sc->sc_temp_read = r88e_temp_read; + sc->sc_init_tx_agg = rtwn_nop_softc; + sc->sc_init_rx_agg = rtwn_nop_softc; + sc->sc_init_ampdu = r92ce_init_ampdu; + sc->sc_init_intr = r88ee_init_intr; + sc->sc_init_edca = r92ce_init_edca; + sc->sc_init_bb = r88ee_init_bb; + sc->sc_init_rf = r92c_init_rf; + sc->sc_init_antsel = rtwn_nop_softc; + sc->sc_post_init = r88ee_post_init; + sc->sc_init_bcnq1_boundary = rtwn_nop_int_softc; + + sc->mac_prog = &rtl8188e_mac[0]; + sc->mac_size = nitems(rtl8188e_mac); + sc->bb_prog = &rtl8188e_bb[0]; + sc->bb_size = nitems(rtl8188e_bb); + sc->agc_prog = &rtl8188e_agc[0]; + sc->agc_size = nitems(rtl8188e_agc); + sc->rf_prog = &rtl8188e_rf[0]; + + sc->name = "RTL8188EE"; + sc->fwname = "rtwn-rtl8188eefw"; + sc->fwsig = 0x88e; + + sc->page_count = R88EE_TX_PAGE_COUNT; + sc->pktbuf_count = R88E_TXPKTBUF_COUNT; + + sc->ackto = 0x40; + sc->npubqpages = R88EE_PUBQ_NPAGES; + sc->nhqpages = R88EE_HPQ_NPAGES; + sc->nnqpages = R88EE_NPQ_NPAGES; + sc->nlqpages = R88EE_LPQ_NPAGES; + sc->page_size = R92C_TX_PAGE_SIZE; + + sc->txdesc_len = sizeof(struct r92ce_tx_desc); + sc->efuse_maxlen = R88E_EFUSE_MAX_LEN; + sc->efuse_maplen = R88E_EFUSE_MAP_LEN; + sc->rx_dma_size = R88E_RX_DMA_BUFFER_SIZE; + + sc->macid_limit = R88E_MACID_MAX + 1; + sc->cam_entry_limit = R92C_CAM_ENTRY_COUNT; + sc->fwsize_limit = R92C_MAX_FW_SIZE; + sc->temp_delta = R88E_CALIB_THRESHOLD; + + sc->bcn_status_reg[0] = R92C_TDECTRL; + /* + * TODO: some additional setup is required + * to maintain few beacons at the same time. + * + * XXX BCNQ1 mechanism is not needed here; move it to the USB module. + */ + sc->bcn_status_reg[1] = R92C_TDECTRL; + sc->rcr = 0; + + sc->ntxchains = 1; + sc->nrxchains = 1; + + r88ee_attach_private(sc); +} Added: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Wed Jan 2 06:48:53 2019 (r342682) @@ -0,0 +1,276 @@ +/*- + * Copyright (c) 2017 Farhan Khan + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include + +#include + +#include +#include + +void +r88ee_init_bb(struct rtwn_softc *sc) +{ + + /* Enable BB and RF. */ + rtwn_setbits_2(sc, R92C_SYS_FUNC_EN, 0, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST | + R92C_SYS_FUNC_EN_DIO_RF); + + rtwn_write_1(sc, R92C_RF_CTRL, + R92C_RF_CTRL_EN | R92C_RF_CTRL_RSTB | R92C_RF_CTRL_SDMRSTB); + rtwn_write_1(sc, R92C_SYS_FUNC_EN, R92C_SYS_FUNC_EN_PPLL | + R92C_SYS_FUNC_EN_PCIEA | R92C_SYS_FUNC_EN_DIO_PCIE | + R92C_SYS_FUNC_EN_BB_GLB_RST | R92C_SYS_FUNC_EN_BBRSTB); + + r88e_init_bb_common(sc); +} + +void +r88ee_init_intr(struct rtwn_softc *sc) +{ + /* Disable interrupts. */ + rtwn_write_4(sc, R88E_HIMR, 0x00000000); + rtwn_write_4(sc, R88E_HIMRE, 0x00000000); +} + +int +r88ee_power_on(struct rtwn_softc *sc) +{ + int ntries; + + /* Wait for power ready bit. */ + for (ntries = 0; ntries < 5000; ntries++) { + if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) { + device_printf(sc->sc_dev, + "timeout waiting for chip power up\n"); + return (ETIMEDOUT); + } + + /* Unlock ISO/CLK/Power control register. */ + rtwn_write_1(sc, R92C_RSV_CTRL, 0); + + /* Reset BB. */ + rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, + R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0); + + /* schmit trigger */ + rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL + 2, 0, 0x80); + + /* Disable HWPDN. */ + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_APDM_HPDN, 0, 1); + + /* Disable WL suspend. */ + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1); + + rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, + 0, R92C_APS_FSMCO_APFM_ONMAC, 1); + for (ntries = 0; ntries < 5000; ntries++) { + if (!(rtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) + break; + rtwn_delay(sc, 10); + } + if (ntries == 5000) + return (ETIMEDOUT); + + rtwn_setbits_1(sc, R92C_PCIE_CTRL_REG + 2, 0, 0x04); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Jan 2 06:59:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E620A1438030; Wed, 2 Jan 2019 06:59:55 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D1D2764A2; Wed, 2 Jan 2019 06:59:55 +0000 (UTC) (envelope-from andriyvos@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id b20so20347022lfa.12; Tue, 01 Jan 2019 22:59:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:subject:references:date:mime-version :content-transfer-encoding:from:message-id:in-reply-to:user-agent; bh=QYqERu8GeyYdieNESg3IS2cfx8Dbbj+NCHLEYSZkdPQ=; b=rp0Bs7nny/ivx6L9zFlTZKVL/rzZSfJ7YRsMjS9YGEGee+mJsvwGh7mGbrKZbfWiDV phkyuE5cCQjRtp/GuKJU3Mtcw2Wl520bhUGHeJmPyD1r9NiprM0/wn61dX6SpjM8axEt M/cRuk31JQk1TMUmAmK1rREe3XKtl4BN/kEl7nxiy8tvBC0wIVBTnmZQHsEKJ7pF29eG 1XMs4rYO7eoJafYzzPNbpwGdOPpHzfwxZpAgiQdoMwDcR6bspLU9i7FDCUYFD5mVwZ0K 5NC4GqL+lqtGcagIgy/JAJzcwfNa01pfUFDysL7Np7IHrF3voacqAEfPYfht5uQFKAqh bYCQ== X-Gm-Message-State: AA+aEWZmA0k+0lQXIH0XIfXPDHxMpF0Dq/7Idbu1uWYpQu/UPTHTCZ2V LV3t4KP6mdqJPPVDRM0V52jZwPUb X-Google-Smtp-Source: AFSGD/V4kTi3Twwei3vewqQL/63HchzJR2C7XoJX8/tCyWRYjYk+jieRmn29Mfp7mFkykLfXvLEMkw== X-Received: by 2002:a19:24c6:: with SMTP id k189mr21980186lfk.77.1546411928071; Tue, 01 Jan 2019 22:52:08 -0800 (PST) Received: from localhost (46-133-39-7.dialup.umc.net.ua. [46.133.39.7]) by smtp.gmail.com with ESMTPSA id q3sm10013659lff.42.2019.01.01.22.52.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 01 Jan 2019 22:52:07 -0800 (PST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r342682 - in head: share/man/man4 sys/contrib/dev/rtwn sys/dev/rtwn/pci sys/dev/rtwn/rtl8188e sys/dev/rtwn/rtl8188e/pci sys/dev/rtwn/rtl8188e/usb sys/modules/rtwn_pci sys/modules/rtwnfw... References: <201901020648.x026mrmC079331@repo.freebsd.org> Date: Wed, 02 Jan 2019 06:52:02 +0200 MIME-Version: 1.0 Content-Transfer-Encoding: Quoted-Printable From: "Andriy Voskoboinyk" Message-ID: In-Reply-To: <201901020648.x026mrmC079331@repo.freebsd.org> User-Agent: Opera Mail/12.15 (FreeBSD) X-Rspamd-Queue-Id: 4D1D2764A2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.98 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[]; NEURAL_HAM_SHORT(-0.98)[-0.979,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 06:59:56 -0000 Wed, 02 Jan 2019 08:48:53 +0200 =D0=B1=D1=83=D0=BB=D0=BE =D0=BD=D0=B0=D0= =BF=D0=B8=D1=81=D0=B0=D0=BD=D0=BE Andriy Voskoboinyk = : Tested with: RTL8188CUS, RTL8188EE, RTL8188EU and RTL8821AU From owner-svn-src-head@freebsd.org Wed Jan 2 15:01:56 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49D0814233B1; Wed, 2 Jan 2019 15:01:56 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B971A8FB96; Wed, 2 Jan 2019 15:01:55 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A9F27B399; Wed, 2 Jan 2019 15:01:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02F1tD0038438; Wed, 2 Jan 2019 15:01:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02F1tWK038437; Wed, 2 Jan 2019 15:01:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021501.x02F1tWK038437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 15:01:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342684 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342684 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B971A8FB96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 15:01:56 -0000 Author: avos Date: Wed Jan 2 15:01:55 2019 New Revision: 342684 URL: https://svnweb.freebsd.org/changeset/base/342684 Log: Refresh sys/conf/files after recent rtwn(4) update. MFC after: 4 days Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jan 2 07:30:27 2019 (r342683) +++ head/sys/conf/files Wed Jan 2 15:01:55 2019 (r342684) @@ -2859,9 +2859,11 @@ dev/rtwn/rtl8188e/r88e_tx.c optional rtwn dev/rtwn/rtl8188e/r88e_rf.c optional rtwn dev/rtwn/rtl8188e/r88e_rom.c optional rtwn dev/rtwn/rtl8188e/r88e_rx.c optional rtwn +dev/rtwn/rtl8188e/pci/r88ee_attach.c optional rtwn_pci pci +dev/rtwn/rtl8188e/pci/r88ee_init.c optional rtwn_pci pci +dev/rtwn/rtl8188e/pci/r88ee_rx.c optional rtwn_pci pci dev/rtwn/rtl8188e/usb/r88eu_attach.c optional rtwn_usb dev/rtwn/rtl8188e/usb/r88eu_init.c optional rtwn_usb -dev/rtwn/rtl8188e/usb/r88eu_rx.c optional rtwn_usb # RTL8192C dev/rtwn/rtl8192c/r92c_attach.c optional rtwn dev/rtwn/rtl8192c/r92c_beacon.c optional rtwn @@ -2924,6 +2926,20 @@ dev/rtwn/rtl8821a/r21a_rx.c optional rtwn dev/rtwn/rtl8821a/usb/r21au_attach.c optional rtwn_usb dev/rtwn/rtl8821a/usb/r21au_dfs.c optional rtwn_usb dev/rtwn/rtl8821a/usb/r21au_init.c optional rtwn_usb +rtwn-rtl8188eefw.c optional rtwn-rtl8188eefw | rtwnfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eefw.fw:rtwn-rtl8188eefw:111 -mrtwn-rtl8188eefw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "rtwn-rtl8188eefw.c" +rtwn-rtl8188eefw.fwo optional rtwn-rtl8188eefw | rtwnfw \ + dependency "rtwn-rtl8188eefw.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "rtwn-rtl8188eefw.fwo" +rtwn-rtl8188eefw.fw optional rtwn-rtl8188eefw | rtwnfw \ + dependency "$S/contrib/dev/rtwn/rtwn-rtl8188eefw.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "rtwn-rtl8188eefw.fw" rtwn-rtl8188eufw.c optional rtwn-rtl8188eufw | rtwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk rtwn-rtl8188eufw.fw:rtwn-rtl8188eufw:111 -mrtwn-rtl8188eufw -c${.TARGET}" \ no-implicit-rule before-depend local \ From owner-svn-src-head@freebsd.org Wed Jan 2 15:36:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC32C1424F56; Wed, 2 Jan 2019 15:36:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5395791A33; Wed, 2 Jan 2019 15:36:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47B55B8F0; Wed, 2 Jan 2019 15:36:36 +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 x02FaaWL055813; Wed, 2 Jan 2019 15:36:36 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FaZtB055811; Wed, 2 Jan 2019 15:36:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021536.x02FaZtB055811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 15:36:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342686 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 342686 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5395791A33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 15:36:36 -0000 Author: markj Date: Wed Jan 2 15:36:35 2019 New Revision: 342686 URL: https://svnweb.freebsd.org/changeset/base/342686 Log: Avoid setting PG_U unconditionally in pmap_enter_quick_locked(). This KPI may in principle be used to create kernel mappings, in which case we certainly should not be setting PG_U. In any case, PG_U must be set on all layers in the page tables to grant user mode access, and we were only setting it on leaf entries. Thus, this change should have no functional impact. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Wed Jan 2 15:13:08 2019 (r342685) +++ head/sys/amd64/amd64/pmap.c Wed Jan 2 15:36:35 2019 (r342686) @@ -5453,8 +5453,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp) { struct spglist free; - pt_entry_t *pte, PG_V; - vm_paddr_t pa; + pt_entry_t newpte, *pte, PG_V; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -5544,17 +5543,15 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap_resident_count_inc(pmap, 1); - pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 0); + newpte = VM_PAGE_TO_PHYS(m) | PG_V | + pmap_cache_bits(pmap, m->md.pat_mode, 0); + if ((m->oflags & VPO_UNMANAGED) == 0) + newpte |= PG_MANAGED; if ((prot & VM_PROT_EXECUTE) == 0) - pa |= pg_nx; - - /* - * Now validate mapping with RO protection - */ - if ((m->oflags & VPO_UNMANAGED) != 0) - pte_store(pte, pa | PG_V | PG_U); - else - pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); + newpte |= pg_nx; + if (va < VM_MAXUSER_ADDRESS) + newpte |= PG_U; + pte_store(pte, newpte); return (mpte); } Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Wed Jan 2 15:13:08 2019 (r342685) +++ head/sys/i386/i386/pmap.c Wed Jan 2 15:36:35 2019 (r342686) @@ -4095,8 +4095,7 @@ static vm_page_t pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, vm_prot_t prot, vm_page_t mpte) { - pt_entry_t *pte; - vm_paddr_t pa; + pt_entry_t newpte, *pte; struct spglist free; KASSERT(pmap != kernel_pmap || va < kmi.clean_sva || @@ -4179,19 +4178,17 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap->pm_stats.resident_count++; - pa = VM_PAGE_TO_PHYS(m) | pmap_cache_bits(pmap, m->md.pat_mode, 0); + newpte = VM_PAGE_TO_PHYS(m) | PG_V | + pmap_cache_bits(pmap, m->md.pat_mode, 0); + if ((m->oflags & VPO_UNMANAGED) == 0) + newpte |= PG_MANAGED; #if defined(PAE) || defined(PAE_TABLES) if ((prot & VM_PROT_EXECUTE) == 0) - pa |= pg_nx; + newpte |= pg_nx; #endif - - /* - * Now validate mapping with RO protection - */ - if ((m->oflags & VPO_UNMANAGED) != 0) - pte_store(pte, pa | PG_V | PG_U); - else - pte_store(pte, pa | PG_V | PG_U | PG_MANAGED); + if (pmap != kernel_pmap) + newpte |= PG_U; + pte_store(pte, newpte); sched_unpin(); return (mpte); } From owner-svn-src-head@freebsd.org Wed Jan 2 15:52:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8902D1425B44; Wed, 2 Jan 2019 15:52:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F2B8928CB; Wed, 2 Jan 2019 15:52:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 23867BDE0; Wed, 2 Jan 2019 15:52:17 +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 x02FqHpi066262; Wed, 2 Jan 2019 15:52:17 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02FqGPX066259; Wed, 2 Jan 2019 15:52:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021552.x02FqGPX066259@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 15:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342687 - in head/sys/geom: concat mirror raid X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys/geom: concat mirror raid X-SVN-Commit-Revision: 342687 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2F2B8928CB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 15:52:17 -0000 Author: markj Date: Wed Jan 2 15:52:16 2019 New Revision: 342687 URL: https://svnweb.freebsd.org/changeset/base/342687 Log: Use g_handleattr() to reply to GEOM::candelete queries. g_handleattr() fills out bp->bio_completed; otherwise, g_getattr() returns an error in response to the query. This caused BIO_DELETE support to not be propagated through stacked configurations, e.g., a gconcat of gmirror volumes would not handle BIO_DELETE even when the gmirrors do. g_io_getattr() was not affected by the problem. PR: 232676 Reported and tested by: noah.bergbauer@tum.de MFC after: 1 week Modified: head/sys/geom/concat/g_concat.c head/sys/geom/mirror/g_mirror.c head/sys/geom/raid/g_raid.c Modified: head/sys/geom/concat/g_concat.c ============================================================================== --- head/sys/geom/concat/g_concat.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/concat/g_concat.c Wed Jan 2 15:52:16 2019 (r342687) @@ -210,20 +210,16 @@ g_concat_candelete(struct bio *bp) { struct g_concat_softc *sc; struct g_concat_disk *disk; - int i, *val; + int i, val; - val = (int *)bp->bio_data; - *val = 0; - sc = bp->bio_to->geom->softc; for (i = 0; i < sc->sc_ndisks; i++) { disk = &sc->sc_disks[i]; - if (!disk->d_removed && disk->d_candelete) { - *val = 1; + if (!disk->d_removed && disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < sc->sc_ndisks; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void Modified: head/sys/geom/mirror/g_mirror.c ============================================================================== --- head/sys/geom/mirror/g_mirror.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/mirror/g_mirror.c Wed Jan 2 15:52:16 2019 (r342687) @@ -1086,16 +1086,15 @@ g_mirror_candelete(struct bio *bp) { struct g_mirror_softc *sc; struct g_mirror_disk *disk; - int *val; + int val; sc = bp->bio_to->private; LIST_FOREACH(disk, &sc->sc_disks, d_next) { if (disk->d_flags & G_MIRROR_DISK_FLAG_CANDELETE) break; } - val = (int *)bp->bio_data; - *val = (disk != NULL); - g_io_deliver(bp, 0); + val = disk != NULL; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Wed Jan 2 15:36:35 2019 (r342686) +++ head/sys/geom/raid/g_raid.c Wed Jan 2 15:52:16 2019 (r342687) @@ -1075,23 +1075,19 @@ g_raid_candelete(struct g_raid_softc *sc, struct bio * struct g_provider *pp; struct g_raid_volume *vol; struct g_raid_subdisk *sd; - int *val; - int i; + int i, val; - val = (int *)bp->bio_data; pp = bp->bio_to; vol = pp->private; - *val = 0; for (i = 0; i < vol->v_disks_count; i++) { sd = &vol->v_subdisks[i]; if (sd->sd_state == G_RAID_SUBDISK_S_NONE) continue; - if (sd->sd_disk->d_candelete) { - *val = 1; + if (sd->sd_disk->d_candelete) break; - } } - g_io_deliver(bp, 0); + val = i < vol->v_disks_count; + g_handleattr(bp, "GEOM::candelete", &val, sizeof(val)); } static void From owner-svn-src-head@freebsd.org Wed Jan 2 16:01:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2E691426221; Wed, 2 Jan 2019 16:01:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9882593135; Wed, 2 Jan 2019 16:01:54 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B941BF80; Wed, 2 Jan 2019 16:01:54 +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 x02G1slH071363; Wed, 2 Jan 2019 16:01:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02G1sBF071362; Wed, 2 Jan 2019 16:01:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021601.x02G1sBF071362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 16:01:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342688 - head/share/man/man3 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/share/man/man3 X-SVN-Commit-Revision: 342688 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9882593135 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 16:01:55 -0000 Author: markj Date: Wed Jan 2 16:01:54 2019 New Revision: 342688 URL: https://svnweb.freebsd.org/changeset/base/342688 Log: Typo. Reported by: Christian Barthel MFC after: 3 days Modified: head/share/man/man3/timeradd.3 Modified: head/share/man/man3/timeradd.3 ============================================================================== --- head/share/man/man3/timeradd.3 Wed Jan 2 15:52:16 2019 (r342687) +++ head/share/man/man3/timeradd.3 Wed Jan 2 16:01:54 2019 (r342688) @@ -94,7 +94,7 @@ structure is defined in as: .Bd -literal struct timespec { - time_t tv_nsec; /* seconds */ + time_t tv_sec; /* seconds */ long tv_nsec; /* and nanoseconds */ }; .Ed From owner-svn-src-head@freebsd.org Wed Jan 2 16:22:34 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF3DA1427092; Wed, 2 Jan 2019 16:22:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93F1B94141; Wed, 2 Jan 2019 16:22:33 +0000 (UTC) (envelope-from gjb@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 872DFC36F; Wed, 2 Jan 2019 16:22:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02GMXLD082187; Wed, 2 Jan 2019 16:22:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02GMXpE082186; Wed, 2 Jan 2019 16:22:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201901021622.x02GMXpE082186@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Wed, 2 Jan 2019 16:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342690 - head/release/i386 X-SVN-Group: head X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: head/release/i386 X-SVN-Commit-Revision: 342690 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 93F1B94141 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 16:22:34 -0000 Author: gjb Date: Wed Jan 2 16:22:33 2019 New Revision: 342690 URL: https://svnweb.freebsd.org/changeset/base/342690 Log: Escape a new line following r342283. Sponsored by: The FreeBSD Foundation Modified: head/release/i386/make-memstick.sh Modified: head/release/i386/make-memstick.sh ============================================================================== --- head/release/i386/make-memstick.sh Wed Jan 2 16:11:02 2019 (r342689) +++ head/release/i386/make-memstick.sh Wed Jan 2 16:22:33 2019 (r342690) @@ -45,7 +45,7 @@ make_esp_file ${espfilename} ${fat32min} ${1}/boot/loa mkimg -s mbr \ -b ${1}/boot/mbr \ - -p efi:=${espfilename} + -p efi:=${espfilename} \ -p freebsd:-"mkimg -s bsd -b ${1}/boot/boot -p freebsd-ufs:=${2}.part" \ -o ${2} rm ${espfilename} From owner-svn-src-head@freebsd.org Wed Jan 2 17:09:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E1971429AA1; Wed, 2 Jan 2019 17:09:36 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E2383964A5; Wed, 2 Jan 2019 17:09:35 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D5A9ECA88; Wed, 2 Jan 2019 17:09:35 +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 x02H9ZLk004187; Wed, 2 Jan 2019 17:09:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02H9ZPM004185; Wed, 2 Jan 2019 17:09:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021709.x02H9ZPM004185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 17:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342699 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342699 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E2383964A5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 17:09:36 -0000 Author: markj Date: Wed Jan 2 17:09:35 2019 New Revision: 342699 URL: https://svnweb.freebsd.org/changeset/base/342699 Log: Capsicumize savecore(8). - Use cap_fileargs(3) to open dump devices after entering capability mode, and use cap_syslog(3) to log messages. - Use a relative directory fd to open output files. - Use zdopen(3) to compress kernel dumps in capability mode. Reviewed by: cem, oshogbo MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18458 Modified: head/sbin/savecore/Makefile head/sbin/savecore/savecore.c Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Wed Jan 2 16:42:07 2019 (r342698) +++ head/sbin/savecore/Makefile Wed Jan 2 17:09:35 2019 (r342699) @@ -6,7 +6,14 @@ VAR_CRASH= /var/crash VAR_CRASH_MODE= 0750 CONFSDIR= VAR_CRASH PROG= savecore -LIBADD= z xo +LIBADD= xo z MAN= savecore.8 + +.include + +.if ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_fileargs cap_syslog +.endif .include Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Jan 2 16:42:07 2019 (r342698) +++ head/sbin/savecore/savecore.c Wed Jan 2 17:09:35 2019 (r342699) @@ -70,6 +70,8 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include #include #include #include @@ -84,6 +86,11 @@ __FBSDID("$FreeBSD$"); #include #include #include + +#include +#include +#include + #include /* The size of the buffer used for I/O. */ @@ -93,16 +100,58 @@ __FBSDID("$FreeBSD$"); #define STATUS_GOOD 1 #define STATUS_UNKNOWN 2 +static cap_channel_t *capsyslog; +static fileargs_t *capfa; static int checkfor, compress, clear, force, keep, verbose; /* flags */ static int nfound, nsaved, nerr; /* statistics */ static int maxdumps; -extern FILE *zopen(const char *, const char *); +extern FILE *zdopen(int, const char *); static sig_atomic_t got_siginfo; static void infohandler(int); static void +logmsg(int pri, const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + if (capsyslog != NULL) + cap_vsyslog(capsyslog, pri, fmt, ap); + else + vsyslog(pri, fmt, ap); + va_end(ap); +} + +static FILE * +xfopenat(int dirfd, const char *path, int flags, const char *modestr, ...) +{ + va_list ap; + FILE *fp; + mode_t mode; + int error, fd; + + if ((flags & O_CREAT) == O_CREAT) { + va_start(ap, modestr); + mode = (mode_t)va_arg(ap, int); + va_end(ap); + } else + mode = 0; + + fd = openat(dirfd, path, flags, mode); + if (fd < 0) + return (NULL); + fp = fdopen(fd, modestr); + if (fp == NULL) { + error = errno; + (void)close(fd); + errno = error; + } + return (fp); +} + +static void printheader(xo_handle_t *xo, const struct kerneldumpheader *h, const char *device, int bounds, const int status) { @@ -166,7 +215,7 @@ printheader(xo_handle_t *xo, const struct kerneldumphe } static int -getbounds(void) +getbounds(int savedirfd) { FILE *fp; char buf[6]; @@ -181,17 +230,16 @@ getbounds(void) ret = 0; - if ((fp = fopen("bounds", "r")) == NULL) { + if ((fp = xfopenat(savedirfd, "bounds", O_RDONLY, "r")) == NULL) { if (verbose) printf("unable to open bounds file, using 0\n"); return (ret); } - - if (fgets(buf, sizeof buf, fp) == NULL) { + if (fgets(buf, sizeof(buf), fp) == NULL) { if (feof(fp)) - syslog(LOG_WARNING, "bounds file is empty, using 0"); + logmsg(LOG_WARNING, "bounds file is empty, using 0"); else - syslog(LOG_WARNING, "bounds file: %s", strerror(errno)); + logmsg(LOG_WARNING, "bounds file: %s", strerror(errno)); fclose(fp); return (ret); } @@ -199,18 +247,19 @@ getbounds(void) errno = 0; ret = (int)strtol(buf, NULL, 10); if (ret == 0 && (errno == EINVAL || errno == ERANGE)) - syslog(LOG_WARNING, "invalid value found in bounds, using 0"); + logmsg(LOG_WARNING, "invalid value found in bounds, using 0"); fclose(fp); return (ret); } static void -writebounds(int bounds) +writebounds(int savedirfd, int bounds) { FILE *fp; - if ((fp = fopen("bounds", "w")) == NULL) { - syslog(LOG_WARNING, "unable to write to bounds file: %m"); + if ((fp = xfopenat(savedirfd, "bounds", O_WRONLY | O_CREAT | O_TRUNC, + "w", 0644)) < 0) { + logmsg(LOG_WARNING, "unable to write to bounds file: %m"); return; } @@ -222,19 +271,20 @@ writebounds(int bounds) } static bool -writekey(const char *keyname, uint8_t *dumpkey, uint32_t dumpkeysize) +writekey(int savedirfd, const char *keyname, uint8_t *dumpkey, + uint32_t dumpkeysize) { int fd; - fd = open(keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = openat(savedirfd, keyname, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd == -1) { - syslog(LOG_ERR, "Unable to open %s to write the key: %m.", + logmsg(LOG_ERR, "Unable to open %s to write the key: %m.", keyname); return (false); } if (write(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { - syslog(LOG_ERR, "Unable to write the key to %s: %m.", keyname); + logmsg(LOG_ERR, "Unable to write the key to %s: %m.", keyname); close(fd); return (false); } @@ -244,18 +294,18 @@ writekey(const char *keyname, uint8_t *dumpkey, uint32 } static off_t -file_size(const char *path) +file_size(int savedirfd, const char *path) { struct stat sb; - /* Ignore all errors, those file may not exists. */ - if (stat(path, &sb) == -1) + /* Ignore all errors, this file may not exist. */ + if (fstatat(savedirfd, path, &sb, 0) == -1) return (0); return (sb.st_size); } static off_t -saved_dump_size(int bounds) +saved_dump_size(int savedirfd, int bounds) { static char path[PATH_MAX]; off_t dumpsize; @@ -263,53 +313,53 @@ saved_dump_size(int bounds) dumpsize = 0; (void)snprintf(path, sizeof(path), "info.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); - dumpsize += file_size(path); + dumpsize += file_size(savedirfd, path); return (dumpsize); } static void -saved_dump_remove(int bounds) +saved_dump_remove(int savedirfd, int bounds) { static char path[PATH_MAX]; (void)snprintf(path, sizeof(path), "info.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d.gz", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "vmcore.%d.zst", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "textdump.tar.%d", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); (void)snprintf(path, sizeof(path), "textdump.tar.%d.gz", bounds); - (void)unlink(path); + (void)unlinkat(savedirfd, path, 0); } static void -symlinks_remove(void) +symlinks_remove(int savedirfd) { - (void)unlink("info.last"); - (void)unlink("key.last"); - (void)unlink("vmcore.last"); - (void)unlink("vmcore.last.gz"); - (void)unlink("vmcore.last.zst"); - (void)unlink("vmcore_encrypted.last"); - (void)unlink("vmcore_encrypted.last.gz"); - (void)unlink("textdump.tar.last"); - (void)unlink("textdump.tar.last.gz"); + (void)unlinkat(savedirfd, "info.last", 0); + (void)unlinkat(savedirfd, "key.last", 0); + (void)unlinkat(savedirfd, "vmcore.last", 0); + (void)unlinkat(savedirfd, "vmcore.last.gz", 0); + (void)unlinkat(savedirfd, "vmcore.last.zst", 0); + (void)unlinkat(savedirfd, "vmcore_encrypted.last", 0); + (void)unlinkat(savedirfd, "vmcore_encrypted.last.gz", 0); + (void)unlinkat(savedirfd, "textdump.tar.last", 0); + (void)unlinkat(savedirfd, "textdump.tar.last.gz", 0); } /* @@ -317,21 +367,21 @@ symlinks_remove(void) * save directory. */ static int -check_space(const char *savedir, off_t dumpsize, int bounds) +check_space(const char *savedir, int savedirfd, off_t dumpsize, int bounds) { + char buf[100]; + struct statfs fsbuf; FILE *fp; off_t available, minfree, spacefree, totfree, needed; - struct statfs fsbuf; - char buf[100]; - if (statfs(".", &fsbuf) < 0) { - syslog(LOG_ERR, "%s: %m", savedir); + if (fstatfs(savedirfd, &fsbuf) < 0) { + logmsg(LOG_ERR, "%s: %m", savedir); exit(1); } spacefree = ((off_t) fsbuf.f_bavail * fsbuf.f_bsize) / 1024; totfree = ((off_t) fsbuf.f_bfree * fsbuf.f_bsize) / 1024; - if ((fp = fopen("minfree", "r")) == NULL) + if ((fp = xfopenat(savedirfd, "minfree", O_RDONLY, "r")) == NULL) minfree = 0; else { if (fgets(buf, sizeof(buf), fp) == NULL) @@ -350,7 +400,7 @@ check_space(const char *savedir, off_t dumpsize, int b minfree = -1; } if (minfree < 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "`minfree` didn't contain a valid size " "(`%s`). Defaulting to 0", buf); } @@ -359,9 +409,9 @@ check_space(const char *savedir, off_t dumpsize, int b available = minfree > 0 ? spacefree - minfree : totfree; needed = dumpsize / 1024 + 2; /* 2 for info file */ - needed -= saved_dump_size(bounds); + needed -= saved_dump_size(savedirfd, bounds); if (available < needed) { - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "no dump: not enough free space on device (need at least " "%jdkB for dump; %jdkB available; %jdkB reserved)", (intmax_t)needed, @@ -370,7 +420,7 @@ check_space(const char *savedir, off_t dumpsize, int b return (0); } if (spacefree - needed < 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "dump performed, but free space threshold crossed"); return (1); } @@ -402,10 +452,10 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize nr = read(fd, buf, roundup(wl, sectorsize)); if (nr != (int)roundup(wl, sectorsize)) { if (nr == 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: EOF on dump device"); else - syslog(LOG_ERR, "read error on %s: %m", device); + logmsg(LOG_ERR, "read error on %s: %m", device); nerr++; return (-1); } @@ -451,9 +501,9 @@ DoRegularFile(int fd, off_t dumpsize, u_int sectorsize } } if (nw != wl) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "write error on %s file: %m", filename); - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: vmcore may be incomplete"); nerr++; return (-1); @@ -490,7 +540,7 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c dmpcnt = 0; wl = 512; if ((dumpsize % wl) != 0) { - syslog(LOG_ERR, "textdump uneven multiple of 512 on %s", + logmsg(LOG_ERR, "textdump uneven multiple of 512 on %s", device); nerr++; return (-1); @@ -499,18 +549,18 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c nr = pread(fd, buf, wl, lasthd - (totsize - dumpsize) - wl); if (nr != wl) { if (nr == 0) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: EOF on dump device"); else - syslog(LOG_ERR, "read error on %s: %m", device); + logmsg(LOG_ERR, "read error on %s: %m", device); nerr++; return (-1); } nw = fwrite(buf, 1, wl, fp); if (nw != wl) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "write error on %s file: %m", filename); - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "WARNING: textdump may be incomplete"); nerr++; return (-1); @@ -526,7 +576,7 @@ DoTextdumpFile(int fd, off_t dumpsize, off_t lasthd, c } static void -DoFile(const char *savedir, const char *device) +DoFile(const char *savedir, int savedirfd, const char *device) { xo_handle_t *xostdout, *xoinfo; static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX]; @@ -536,22 +586,21 @@ DoFile(const char *savedir, const char *device) struct kerneldumpheader kdhf, kdhl; uint8_t *dumpkey; off_t mediasize, dumpextent, dumplength, firsthd, lasthd; - FILE *info, *fp; - mode_t oumask; - int fd, fdinfo, error; + FILE *core, *info; + int fdcore, fddev, error; int bounds, status; u_int sectorsize, xostyle; uint32_t dumpkeysize; bool iscompressed, isencrypted, istextdump, ret; - bounds = getbounds(); + bounds = getbounds(savedirfd); dumpkey = NULL; mediasize = 0; status = STATUS_UNKNOWN; xostdout = xo_create_to_file(stdout, XO_STYLE_TEXT, 0); if (xostdout == NULL) { - syslog(LOG_ERR, "%s: %m", infoname); + logmsg(LOG_ERR, "%s: %m", infoname); return; } @@ -561,7 +610,7 @@ DoFile(const char *savedir, const char *device) if (buf == NULL) { buf = malloc(BUFFERSIZE); if (buf == NULL) { - syslog(LOG_ERR, "%m"); + logmsg(LOG_ERR, "%m"); return; } } @@ -569,17 +618,17 @@ DoFile(const char *savedir, const char *device) if (verbose) printf("checking for kernel dump on device %s\n", device); - fd = open(device, (checkfor || keep) ? O_RDONLY : O_RDWR); - if (fd < 0) { - syslog(LOG_ERR, "%s: %m", device); + fddev = fileargs_open(capfa, device); + if (fddev < 0) { + logmsg(LOG_ERR, "%s: %m", device); return; } - error = ioctl(fd, DIOCGMEDIASIZE, &mediasize); + error = ioctl(fddev, DIOCGMEDIASIZE, &mediasize); if (!error) - error = ioctl(fd, DIOCGSECTORSIZE, §orsize); + error = ioctl(fddev, DIOCGSECTORSIZE, §orsize); if (error) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "couldn't find media and/or sector size of %s: %m", device); goto closefd; } @@ -590,7 +639,7 @@ DoFile(const char *savedir, const char *device) } if (sectorsize < sizeof(kdhl)) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "Sector size is less the kernel dump header %zu", sizeof(kdhl)); goto closefd; @@ -599,12 +648,12 @@ DoFile(const char *savedir, const char *device) lasthd = mediasize - sectorsize; temp = malloc(sectorsize); if (temp == NULL) { - syslog(LOG_ERR, "%m"); + logmsg(LOG_ERR, "%m"); goto closefd; } - if (lseek(fd, lasthd, SEEK_SET) != lasthd || - read(fd, temp, sectorsize) != (ssize_t)sectorsize) { - syslog(LOG_ERR, + if (lseek(fddev, lasthd, SEEK_SET) != lasthd || + read(fddev, temp, sectorsize) != (ssize_t)sectorsize) { + logmsg(LOG_ERR, "error reading last dump header at offset %lld in %s: %m", (long long)lasthd, device); goto closefd; @@ -617,7 +666,7 @@ DoFile(const char *savedir, const char *device) device); istextdump = true; if (dtoh32(kdhl.version) != KERNELDUMP_TEXT_VERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -627,7 +676,7 @@ DoFile(const char *savedir, const char *device) } } else if (compare_magic(&kdhl, KERNELDUMPMAGIC)) { if (dtoh32(kdhl.version) != KERNELDUMPVERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -646,7 +695,7 @@ DoFile(const char *savedir, const char *device) iscompressed = true; break; default: - syslog(LOG_ERR, "unknown compression type %d on %s", + logmsg(LOG_ERR, "unknown compression type %d on %s", kdhl.compression, device); break; } @@ -664,11 +713,11 @@ DoFile(const char *savedir, const char *device) printf("forcing magic on %s\n", device); memcpy(kdhl.magic, KERNELDUMPMAGIC, sizeof(kdhl.magic)); } else { - syslog(LOG_ERR, "unable to force dump - bad magic"); + logmsg(LOG_ERR, "unable to force dump - bad magic"); goto closefd; } if (dtoh32(kdhl.version) != KERNELDUMPVERSION) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "unknown version (%d) in last dump header on %s", dtoh32(kdhl.version), device); @@ -683,7 +732,7 @@ DoFile(const char *savedir, const char *device) goto nuke; if (kerneldump_parity(&kdhl)) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "parity error on last dump header on %s", device); nerr++; status = STATUS_BAD; @@ -694,9 +743,9 @@ DoFile(const char *savedir, const char *device) dumplength = dtoh64(kdhl.dumplength); dumpkeysize = dtoh32(kdhl.dumpkeysize); firsthd = lasthd - dumpextent - sectorsize - dumpkeysize; - if (lseek(fd, firsthd, SEEK_SET) != firsthd || - read(fd, temp, sectorsize) != (ssize_t)sectorsize) { - syslog(LOG_ERR, + if (lseek(fddev, firsthd, SEEK_SET) != firsthd || + read(fddev, temp, sectorsize) != (ssize_t)sectorsize) { + logmsg(LOG_ERR, "error reading first dump header at offset %lld in %s: %m", (long long)firsthd, device); nerr++; @@ -714,7 +763,7 @@ DoFile(const char *savedir, const char *device) } if (memcmp(&kdhl, &kdhf, sizeof(kdhl))) { - syslog(LOG_ERR, + logmsg(LOG_ERR, "first and last dump headers disagree on %s", device); nerr++; status = STATUS_BAD; @@ -726,77 +775,79 @@ DoFile(const char *savedir, const char *device) if (checkfor) { printf("A dump exists on %s\n", device); - close(fd); + close(fddev); exit(0); } if (kdhl.panicstring[0] != '\0') - syslog(LOG_ALERT, "reboot after panic: %.*s", + logmsg(LOG_ALERT, "reboot after panic: %.*s", (int)sizeof(kdhl.panicstring), kdhl.panicstring); else - syslog(LOG_ALERT, "reboot"); + logmsg(LOG_ALERT, "reboot"); if (verbose) printf("Checking for available free space\n"); - if (!check_space(savedir, dumplength, bounds)) { + if (!check_space(savedir, savedirfd, dumplength, bounds)) { nerr++; goto closefd; } - writebounds(bounds + 1); + writebounds(savedirfd, bounds + 1); - saved_dump_remove(bounds); + saved_dump_remove(savedirfd, bounds); snprintf(infoname, sizeof(infoname), "info.%d", bounds); /* * Create or overwrite any existing dump header files. */ - fdinfo = open(infoname, O_WRONLY | O_CREAT | O_TRUNC, 0600); - if (fdinfo < 0) { - syslog(LOG_ERR, "%s: %m", infoname); + if ((info = xfopenat(savedirfd, infoname, + O_WRONLY | O_CREAT | O_TRUNC, "w", 0600)) == NULL) { + logmsg(LOG_ERR, "open(%s): %m", infoname); nerr++; goto closefd; } - oumask = umask(S_IRWXG|S_IRWXO); /* Restrict access to the core file. */ isencrypted = (dumpkeysize > 0); - if (compress) { + if (compress) snprintf(corename, sizeof(corename), "%s.%d.gz", istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); - fp = zopen(corename, "w"); - } else if (iscompressed && !isencrypted) { + else if (iscompressed && !isencrypted) snprintf(corename, sizeof(corename), "vmcore.%d.%s", bounds, (kdhl.compression == KERNELDUMP_COMP_GZIP) ? "gz" : "zst"); - fp = fopen(corename, "w"); - } else { + else snprintf(corename, sizeof(corename), "%s.%d", istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore"), bounds); - fp = fopen(corename, "w"); - } - if (fp == NULL) { - syslog(LOG_ERR, "%s: %m", corename); - close(fdinfo); + fdcore = openat(savedirfd, corename, O_WRONLY | O_CREAT | O_TRUNC, + 0600); + if (fdcore < 0) { + logmsg(LOG_ERR, "open(%s): %m", corename); + fclose(info); nerr++; goto closefd; } - (void)umask(oumask); - info = fdopen(fdinfo, "w"); - - if (info == NULL) { - syslog(LOG_ERR, "fdopen failed: %m"); + if (compress) + core = zdopen(fdcore, "w"); + else + core = fdopen(fdcore, "w"); + if (core == NULL) { + logmsg(LOG_ERR, "%s: %m", corename); + (void)close(fdcore); + (void)fclose(info); nerr++; - goto closeall; + goto closefd; } + fdcore = -1; xostyle = xo_get_style(NULL); xoinfo = xo_create_to_file(info, xostyle, 0); if (xoinfo == NULL) { - syslog(LOG_ERR, "%s: %m", infoname); + logmsg(LOG_ERR, "%s: %m", infoname); + fclose(info); nerr++; goto closeall; } @@ -814,19 +865,19 @@ DoFile(const char *savedir, const char *device) if (isencrypted) { dumpkey = calloc(1, dumpkeysize); if (dumpkey == NULL) { - syslog(LOG_ERR, "Unable to allocate kernel dump key."); + logmsg(LOG_ERR, "Unable to allocate kernel dump key."); nerr++; goto closeall; } - if (read(fd, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { - syslog(LOG_ERR, "Unable to read kernel dump key: %m."); + if (read(fddev, dumpkey, dumpkeysize) != (ssize_t)dumpkeysize) { + logmsg(LOG_ERR, "Unable to read kernel dump key: %m."); nerr++; goto closeall; } snprintf(keyname, sizeof(keyname), "key.%d", bounds); - ret = writekey(keyname, dumpkey, dumpkeysize); + ret = writekey(savedirfd, keyname, dumpkey, dumpkeysize); explicit_bzero(dumpkey, dumpkeysize); if (!ret) { nerr++; @@ -834,38 +885,38 @@ DoFile(const char *savedir, const char *device) } } - syslog(LOG_NOTICE, "writing %s%score to %s/%s", + logmsg(LOG_NOTICE, "writing %s%score to %s/%s", isencrypted ? "encrypted " : "", compress ? "compressed " : "", savedir, corename); if (istextdump) { - if (DoTextdumpFile(fd, dumplength, lasthd, buf, device, - corename, fp) < 0) + if (DoTextdumpFile(fddev, dumplength, lasthd, buf, device, + corename, core) < 0) goto closeall; } else { - if (DoRegularFile(fd, dumplength, sectorsize, + if (DoRegularFile(fddev, dumplength, sectorsize, !(compress || iscompressed || isencrypted), buf, device, - corename, fp) < 0) { + corename, core) < 0) { goto closeall; } } if (verbose) printf("\n"); - if (fclose(fp) < 0) { - syslog(LOG_ERR, "error on %s: %m", corename); + if (fclose(core) < 0) { + logmsg(LOG_ERR, "error on %s: %m", corename); nerr++; goto closefd; } - symlinks_remove(); - if (symlink(infoname, "info.last") == -1) { - syslog(LOG_WARNING, "unable to create symlink %s/%s: %m", + symlinks_remove(savedirfd); + if (symlinkat(infoname, savedirfd, "info.last") == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, "info.last"); } if (isencrypted) { - if (symlink(keyname, "key.last") == -1) { - syslog(LOG_WARNING, + if (symlinkat(keyname, savedirfd, "key.last") == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, "key.last"); } @@ -880,8 +931,8 @@ DoFile(const char *savedir, const char *device) istextdump ? "textdump.tar" : (isencrypted ? "vmcore_encrypted" : "vmcore")); } - if (symlink(corename, linkname) == -1) { - syslog(LOG_WARNING, "unable to create symlink %s/%s: %m", + if (symlinkat(corename, savedirfd, linkname) == -1) { + logmsg(LOG_WARNING, "unable to create symlink %s/%s: %m", savedir, linkname); } @@ -896,28 +947,109 @@ nuke: printf("clearing dump header\n"); memcpy(kdhl.magic, KERNELDUMPMAGIC_CLEARED, sizeof(kdhl.magic)); memcpy(temp, &kdhl, sizeof(kdhl)); - if (lseek(fd, lasthd, SEEK_SET) != lasthd || - write(fd, temp, sectorsize) != (ssize_t)sectorsize) - syslog(LOG_ERR, + if (lseek(fddev, lasthd, SEEK_SET) != lasthd || + write(fddev, temp, sectorsize) != (ssize_t)sectorsize) + logmsg(LOG_ERR, "error while clearing the dump header: %m"); } xo_close_container_h(xostdout, "crashdump"); xo_finish_h(xostdout); free(dumpkey); free(temp); - close(fd); + close(fddev); return; closeall: - fclose(fp); + fclose(core); closefd: free(dumpkey); free(temp); - close(fd); + close(fddev); } +static char ** +enum_dumpdevs(int *argcp) +{ + struct fstab *fsp; + char **argv; + int argc, n; + + /* + * We cannot use getfsent(3) in capability mode, so we must + * scan /etc/fstab and build up a list of candidate devices + * before proceeding. + */ + argc = 0; + n = 8; + argv = malloc(n * sizeof(*argv)); + if (argv == NULL) { + logmsg(LOG_ERR, "malloc(): %m"); + exit(1); + } + for (;;) { + fsp = getfsent(); + if (fsp == NULL) + break; + if (strcmp(fsp->fs_vfstype, "swap") != 0 && + strcmp(fsp->fs_vfstype, "dump") != 0) + continue; + if (argc >= n) { + n *= 2; + argv = realloc(argv, n * sizeof(*argv)); + if (argv == NULL) { + logmsg(LOG_ERR, "realloc(): %m"); + exit(1); + } + } + argv[argc] = strdup(fsp->fs_spec); + if (argv[argc] == NULL) { + logmsg(LOG_ERR, "strdup(): %m"); + exit(1); + } + argc++; + } + *argcp = argc; + return (argv); +} + static void +init_caps(int argc, char **argv) +{ + cap_rights_t rights; + cap_channel_t *capcas; + + capcas = cap_init(); + if (capcas == NULL) { + logmsg(LOG_ERR, "cap_init(): %m"); + exit(1); + } + /* + * The fileargs capability does not currently provide a way to limit + * ioctls. + */ + (void)cap_rights_init(&rights, CAP_PREAD, CAP_WRITE, CAP_IOCTL); + capfa = fileargs_init(argc, argv, checkfor || keep ? O_RDONLY : O_RDWR, + 0, &rights); + if (capfa == NULL) { + logmsg(LOG_ERR, "fileargs_init(): %m"); + exit(1); + } + caph_cache_catpages(); + caph_cache_tzdata(); + if (caph_enter_casper() != 0) { + logmsg(LOG_ERR, "caph_enter_casper(): %m"); + exit(1); + } + capsyslog = cap_service_open(capcas, "system.syslog"); + if (capsyslog == NULL) { + logmsg(LOG_ERR, "cap_service_open(system.syslog): %m"); + exit(1); + } + cap_close(capcas); +} + +static void usage(void) { xo_error("%s\n%s\n%s\n", @@ -930,12 +1062,13 @@ usage(void) int main(int argc, char **argv) { - const char *savedir = "."; - struct fstab *fsp; - int i, ch, error; + cap_rights_t rights; + const char *savedir; + int i, ch, error, savedirfd; checkfor = compress = clear = force = keep = verbose = 0; nfound = nsaved = nerr = 0; + savedir = "."; openlog("savecore", LOG_PERROR, LOG_DAEMON); signal(SIGINFO, infohandler); @@ -961,7 +1094,7 @@ main(int argc, char **argv) case 'm': maxdumps = atoi(optarg); if (maxdumps <= 0) { - syslog(LOG_ERR, "Invalid maxdump value"); + logmsg(LOG_ERR, "Invalid maxdump value"); exit(1); } break; @@ -986,29 +1119,35 @@ main(int argc, char **argv) if (argc >= 1 && !checkfor && !clear) { error = chdir(argv[0]); if (error) { - syslog(LOG_ERR, "chdir(%s): %m", argv[0]); + logmsg(LOG_ERR, "chdir(%s): %m", argv[0]); exit(1); } savedir = argv[0]; argc--; argv++; } - if (argc == 0) { - for (;;) { - fsp = getfsent(); - if (fsp == NULL) - break; - if (strcmp(fsp->fs_vfstype, "swap") && - strcmp(fsp->fs_vfstype, "dump")) - continue; - DoFile(savedir, fsp->fs_spec); - } - endfsent(); - } else { - for (i = 0; i < argc; i++) - DoFile(savedir, argv[i]); + if (argc == 0) + argv = enum_dumpdevs(&argc); + + savedirfd = open(savedir, O_RDONLY | O_DIRECTORY); + if (savedirfd < 0) { + logmsg(LOG_ERR, "open(%s): %m", savedir); + exit(1); } + (void)cap_rights_init(&rights, CAP_CREATE, CAP_FCNTL, CAP_FSTATAT, + CAP_FSTATFS, CAP_PREAD, CAP_SYMLINKAT, CAP_FTRUNCATE, CAP_UNLINKAT, + CAP_WRITE); + if (caph_rights_limit(savedirfd, &rights) < 0) { + logmsg(LOG_ERR, "cap_rights_limit(): %m"); + exit(1); + } + /* Enter capability mode. */ + init_caps(argc, argv); + + for (i = 0; i < argc; i++) + DoFile(savedir, savedirfd, argv[i]); + /* Emit minimal output. */ if (nfound == 0) { if (checkfor) { @@ -1017,15 +1156,15 @@ main(int argc, char **argv) exit(1); } if (verbose) - syslog(LOG_WARNING, "no dumps found"); + logmsg(LOG_WARNING, "no dumps found"); } else if (nsaved == 0) { if (nerr != 0) { if (verbose) - syslog(LOG_WARNING, + logmsg(LOG_WARNING, "unsaved dumps found but not saved"); exit(1); } else if (verbose) - syslog(LOG_WARNING, "no unsaved dumps found"); + logmsg(LOG_WARNING, "no unsaved dumps found"); } return (0); From owner-svn-src-head@freebsd.org Wed Jan 2 17:13:57 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1702C1429DD9; Wed, 2 Jan 2019 17:13:57 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A692F969F5; Wed, 2 Jan 2019 17:13:56 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D9FE5CC43; Wed, 2 Jan 2019 17:13:55 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02HDt1l008919; Wed, 2 Jan 2019 17:13:55 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02HDtV5008918; Wed, 2 Jan 2019 17:13:55 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021713.x02HDtV5008918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 17:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342700 - head/sys/dev/rtwn/pci X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/sys/dev/rtwn/pci X-SVN-Commit-Revision: 342700 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A692F969F5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 17:13:57 -0000 Author: avos Date: Wed Jan 2 17:13:55 2019 New Revision: 342700 URL: https://svnweb.freebsd.org/changeset/base/342700 Log: rtwn_pci(4): fix panic with INVARIANTS (due to inverted assertion logic) MFC after: 4 days Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c Modified: head/sys/dev/rtwn/pci/rtwn_pci_rx.c ============================================================================== --- head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 17:09:35 2019 (r342699) +++ head/sys/dev/rtwn/pci/rtwn_pci_rx.c Wed Jan 2 17:13:55 2019 (r342700) @@ -193,7 +193,7 @@ rtwn_pci_rx_buf_copy(struct rtwn_pci_softc *pc) * descriptor - same as for PCIe, but without rxbufaddr* fields. */ desc_size = sizeof(struct rtwn_rx_stat_common); - KASSERT(sizeof(pc->pc_rx_buf) < desc_size, + KASSERT(sizeof(pc->pc_rx_buf) >= desc_size, ("adjust size for PCIe Rx buffer!")); memcpy(pc->pc_rx_buf, rx_desc, desc_size); From owner-svn-src-head@freebsd.org Wed Jan 2 17:34:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A4FC142A58C; Wed, 2 Jan 2019 17:34:26 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B567C97403; Wed, 2 Jan 2019 17:34:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A83C2CFB7; Wed, 2 Jan 2019 17:34:25 +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 x02HYP7s019563; Wed, 2 Jan 2019 17:34:25 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02HYPHI019562; Wed, 2 Jan 2019 17:34:25 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901021734.x02HYPHI019562@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 2 Jan 2019 17:34:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342701 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342701 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B567C97403 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 17:34:26 -0000 Author: markj Date: Wed Jan 2 17:34:25 2019 New Revision: 342701 URL: https://svnweb.freebsd.org/changeset/base/342701 Log: Fix an error check after r342699. Reported by: gcc MFC with: r342699 Sponsored by: The FreeBSD Foundation Modified: head/sbin/savecore/savecore.c Modified: head/sbin/savecore/savecore.c ============================================================================== --- head/sbin/savecore/savecore.c Wed Jan 2 17:13:55 2019 (r342700) +++ head/sbin/savecore/savecore.c Wed Jan 2 17:34:25 2019 (r342701) @@ -258,7 +258,7 @@ writebounds(int savedirfd, int bounds) FILE *fp; if ((fp = xfopenat(savedirfd, "bounds", O_WRONLY | O_CREAT | O_TRUNC, - "w", 0644)) < 0) { + "w", 0644)) == NULL) { logmsg(LOG_WARNING, "unable to write to bounds file: %m"); return; } From owner-svn-src-head@freebsd.org Wed Jan 2 18:30:24 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03193142BF79; Wed, 2 Jan 2019 18:30:24 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C7F56A744; Wed, 2 Jan 2019 18:30:23 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F466D89C; Wed, 2 Jan 2019 18:30:23 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02IUNcL045275; Wed, 2 Jan 2019 18:30:23 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02IUMhb045272; Wed, 2 Jan 2019 18:30:22 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021830.x02IUMhb045272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 18:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342702 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342702 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6C7F56A744 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.959,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 18:30:24 -0000 Author: avos Date: Wed Jan 2 18:30:22 2019 New Revision: 342702 URL: https://svnweb.freebsd.org/changeset/base/342702 Log: rtwn(4): refresh manpages. - Add 'device rtwn' to rtwn_pci(4) and rtwn_usb(4) config sample; kernel will not compile otherwise. - Refresh devices list in rtwn_usb(4); add 'chipset' column. - Bump Dd after this commit and r342682. MFC after: 4 days Modified: head/share/man/man4/rtwn.4 head/share/man/man4/rtwn_pci.4 head/share/man/man4/rtwn_usb.4 Modified: head/share/man/man4/rtwn.4 ============================================================================== --- head/share/man/man4/rtwn.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 31, 2017 +.Dd January 2, 2019 .Dt RTWN 4 .Os .Sh NAME Modified: head/share/man/man4/rtwn_pci.4 ============================================================================== --- head/share/man/man4/rtwn_pci.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn_pci.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd November 12, 2016 +.Dd January 2, 2019 .Dt RTWN_PCI 4 .Os .Sh NAME @@ -40,6 +40,7 @@ To compile this driver into the kernel, place the following lines in your kernel configuration file: .Bd -ragged -offset indent +.Cd "device rtwn" .Cd "device rtwn_pci" .Cd "device pci" .Cd "device wlan" Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Wed Jan 2 17:34:25 2019 (r342701) +++ head/share/man/man4/rtwn_usb.4 Wed Jan 2 18:30:22 2019 (r342702) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd October 9, 2017 +.Dd January 2, 2019 .Dt RTWN_USB 4 .Os .Sh NAME @@ -45,6 +45,7 @@ kernel configuration file: .Cd "device uhci" .Cd "device ohci" .Cd "device usb" +.Cd "device rtwn" .Cd "device rtwn_usb" .Cd "device wlan" .Ed @@ -56,52 +57,56 @@ driver. .Sh HARDWARE The .Nm -driver supports Realtek RTL8188CU/RTL8188RU/RTL8188EU/RTL8192CU/RTL8192EU/RTL8812AU/RTL8821AU +driver supports Realtek RTL8188CUS/RTL8188RU/RTL8188EU/RTL8192CU/RTL8192EU/RTL8812AU/RTL8821AU based USB wireless network adapters, including: .Pp -.Bl -column -compact "Belkin F7D1102 Surf Wireless Micro" "Bus" -.It Em Card Ta Em Bus -.It "Alfa AWUS036NHR v2" Ta USB 2.0 -.It "ASUS USB-AC56" Ta USB 3.0 -.It "ASUS USB-N10 NANO" Ta USB 2.0 -.It "Asus USB-N13, rev. B1" Ta USB 2.0 -.It "Belkin F7D1102 Surf Wireless Micro" Ta USB 2.0 -.It "Buffalo WI-U2-433DM" Ta USB 2.0 -.It "Buffalo WI-U3-866D" Ta USB 3.0 -.It "D-Link DWA-123 rev D1" Ta USB 2.0 -.It "D-Link DWA-125 rev D1" Ta USB 2.0 -.It "D-Link DWA-131" Ta USB 2.0 -.It "D-Link DWA-131 rev E1" Ta USB 2.0 -.It "D-Link DWA-171 rev A1" Ta USB 2.0 -.It "D-Link DWA-172 rev A1" Ta USB 2.0 -.It "D-Link DWA-180 rev A1" Ta USB 2.0 -.It "D-Link DWA-182 rev C1" Ta USB 3.0 -.It "Edimax EW-7811Un" Ta USB 2.0 -.It "Edimax EW-7811UTC" Ta USB 2.0 -.It "Edimax EW-7822UAC" Ta USB 3.0 -.It "Elecom WDC-150SU2M" Ta USB 2.0 -.It "EnGenius EUB1200AC" Ta USB 3.0 -.It "Hawking HD65U" Ta USB 2.0 -.It "Hercules Wireless N USB Pico" Ta USB 2.0 -.It "I-O Data WN-AC867U" Ta USB 3.0 -.It "Linksys WUSB6300" Ta USB 3.0 -.It "NEC AtermWL900U PA-WL900U" Ta USB 3.0 -.It "Netgear A6100" Ta USB 2.0 -.It "Netgear WNA1000M" Ta USB 2.0 -.It "Planex GW-900D" Ta USB 3.0 -.It "Realtek RTL8192CU" Ta USB 2.0 -.It "Realtek RTL8188CUS" Ta USB 2.0 -.It "Sitecom WLA-7100" Ta USB 3.0 -.It "TP-Link Archer T4U" Ta USB 3.0 -.It "TP-LINK TL-WN723N v3" Ta USB 2.0 -.It "TP-LINK TL-WN725N v2" Ta USB 2.0 -.It "TP-LINK TL-WN821N v4" Ta USB 2.0 -.It "TP-LINK TL-WN821N v5" Ta USB 2.0 -.It "TP-LINK TL-WN822N v4" Ta USB 2.0 -.It "TP-LINK TL-WN823N v1" Ta USB 2.0 -.It "TP-LINK TL-WN823N v2" Ta USB 2.0 -.It "TRENDnet TEW-805UB" Ta USB 3.0 -.It "ZyXEL NWD6605" Ta USB 3.0 +.Bl -column -compact "Belkin F7D1102 Surf Wireless Micro" "RTL8188CUS" "Bus" +.It Em Card Ta Em Chip Ta Em Bus +.It "Alfa AWUS036NHR v2" Ta RTL8188RU Ta USB 2.0 +.It "ASUS USB-AC56" Ta RTL8812AU Ta USB 3.0 +.It "ASUS USB-N10 NANO" Ta RTL8188CUS Ta USB 2.0 +.It "Asus USB-N13, rev. B1" Ta RTL8192CU Ta USB 2.0 +.It "Belkin F7D1102 Surf Wireless Micro" Ta RTL8188CUS Ta USB 2.0 +.It "Buffalo WI-U2-433DM" Ta RTL8821AU Ta USB 2.0 +.It "Buffalo WI-U3-866D" Ta RTL8812AU Ta USB 3.0 +.It "D-Link DWA-123 rev D1" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-125 rev D1" Ta RTL8188EU Ta USB 2.0 +.It "D-Link DWA-131" Ta RTL8192CU Ta USB 2.0 +.It "D-Link DWA-131 rev E1" Ta RTL8192EU Ta USB 2.0 +.It "D-Link DWA-171 rev A1" Ta RTL8821AU Ta USB 2.0 +.It "D-Link DWA-172 rev A1" Ta RTL8821AU Ta USB 2.0 +.It "D-Link DWA-180 rev A1" Ta RTL8812AU Ta USB 2.0 +.It "D-Link DWA-182 rev C1" Ta RTL8812AU Ta USB 3.0 +.It "Edimax EW-7811Un" Ta RTL8188CUS Ta USB 2.0 +.It "Edimax EW-7811UTC" Ta RTL8821AU Ta USB 2.0 +.It "Edimax EW-7822UAC" Ta RTL8812AU Ta USB 3.0 +.It "Elecom WDC-150SU2M" Ta RTL8188EU Ta USB 2.0 +.It "EnGenius EUB1200AC" Ta RTL8812AU Ta USB 3.0 +.It "Hawking HD65U" Ta RTL8821AU Ta USB 2.0 +.It "Hercules Wireless N USB Pico" Ta RTL8188CUS Ta USB 2.0 +.It "I-O Data WN-AC867U" Ta RTL8812AU Ta USB 3.0 +.It "Linksys WUSB6300" Ta RTL8812AU Ta USB 3.0 +.It "NEC AtermWL900U PA-WL900U" Ta RTL8812AU Ta USB 3.0 +.It "Netgear A6100" Ta RTL8821AU Ta USB 2.0 +.It "Netgear WNA1000M" Ta RTL8188CUS Ta USB 2.0 +.It "Planex GW-900D" Ta RTL8812AU Ta USB 3.0 +.It "Realtek RTL8192CU" Ta RTL8192CU Ta USB 2.0 +.It "Realtek RTL8188CUS" Ta RTL8188CUS Ta USB 2.0 +.It "Sitecom WLA-7100" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4U" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4U v2" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4UH v1" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link Archer T4UH v2" Ta RTL8812AU Ta USB 3.0 +.It "TP-Link TL-WN722N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN723N v3" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN725N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN821N v4" Ta RTL8192CU Ta USB 2.0 +.It "TP-LINK TL-WN821N v5" Ta RTL8192EU Ta USB 2.0 +.It "TP-LINK TL-WN822N v4" Ta RTL8192EU Ta USB 2.0 +.It "TP-LINK TL-WN823N v1" Ta RTL8192CU Ta USB 2.0 +.It "TP-LINK TL-WN823N v2" Ta RTL8192EU Ta USB 2.0 +.It "TRENDnet TEW-805UB" Ta RTL8812AU Ta USB 3.0 +.It "ZyXEL NWD6605" Ta RTL8812AU Ta USB 3.0 .El .Sh SEE ALSO .Xr rtwn 4 , From owner-svn-src-head@freebsd.org Wed Jan 2 18:35:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 665C2142C328; Wed, 2 Jan 2019 18:35:41 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6716AC8B; Wed, 2 Jan 2019 18:35:41 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F3496DA3E; Wed, 2 Jan 2019 18:35:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02IZeIT050506; Wed, 2 Jan 2019 18:35:40 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02IZe8n050504; Wed, 2 Jan 2019 18:35:40 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901021835.x02IZe8n050504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 2 Jan 2019 18:35:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342703 - in head/sys/dev: rtwn/usb usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 342703 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B6716AC8B X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 18:35:41 -0000 Author: avos Date: Wed Jan 2 18:35:40 2019 New Revision: 342703 URL: https://svnweb.freebsd.org/changeset/base/342703 Log: rtwn_usb(4): add USB id for TP-LINK TL-WN821N v5. It is already mentioned in manpage, but was missing from the driver. MFC after: 4 days Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 2 18:30:22 2019 (r342702) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Jan 2 18:35:40 2019 (r342703) @@ -107,6 +107,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, RTWN_CHIP_RTL8192EU) } RTWN_RTL8192EU_DEV(DLINK, DWA131E1), RTWN_RTL8192EU_DEV(REALTEK, RTL8192EU), + RTWN_RTL8192EU_DEV(TPLINK, WN821NV5), RTWN_RTL8192EU_DEV(TPLINK, WN822NV4), RTWN_RTL8192EU_DEV(TPLINK, WN823NV2), #undef RTWN_RTL8192EU_DEV Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Wed Jan 2 18:30:22 2019 (r342702) +++ head/sys/dev/usb/usbdevs Wed Jan 2 18:35:40 2019 (r342703) @@ -4614,6 +4614,7 @@ product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive /* TP-Link products */ product TPLINK T4U 0x0101 Archer T4U +product TPLINK WN821NV5 0x0107 TL-WN821N v5 product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK WN722NV2 0x010c TL-WN722N v2 From owner-svn-src-head@freebsd.org Wed Jan 2 20:31:16 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96683142F82C; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F62B6EECE; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 329B2EE88; Wed, 2 Jan 2019 20:31:16 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x02KVGxw009469; Wed, 2 Jan 2019 20:31:16 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x02KVGO6009468; Wed, 2 Jan 2019 20:31:16 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901022031.x02KVGO6009468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Wed, 2 Jan 2019 20:31:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342707 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342707 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F62B6EECE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.95)[-0.953,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 02 Jan 2019 20:31:16 -0000 Author: tsoome Date: Wed Jan 2 20:31:15 2019 New Revision: 342707 URL: https://svnweb.freebsd.org/changeset/base/342707 Log: i386_parsedev() needs to support fd devices MFC after: 2 weeks Modified: head/stand/i386/libi386/devicename.c Modified: head/stand/i386/libi386/devicename.c ============================================================================== --- head/stand/i386/libi386/devicename.c Wed Jan 2 19:48:17 2019 (r342706) +++ head/stand/i386/libi386/devicename.c Wed Jan 2 20:31:15 2019 (r342707) @@ -103,23 +103,42 @@ i386_parsedev(struct i386_devdesc **dev, const char *d } if (dv == NULL) return(ENOENT); - idev = malloc(sizeof(struct i386_devdesc)); - err = 0; + np = (devspec + strlen(dv->dv_name)); + idev = NULL; + err = 0; switch(dv->dv_type) { - case DEVT_NONE: /* XXX what to do here? Do we care? */ + case DEVT_NONE: break; case DEVT_DISK: + idev = malloc(sizeof(struct i386_devdesc)); + if (idev == NULL) + return (ENOMEM); + err = disk_parsedev((struct disk_devdesc *)idev, np, path); if (err != 0) goto fail; break; - case DEVT_CD: - case DEVT_NET: + case DEVT_ZFS: + idev = malloc(sizeof (struct zfs_devdesc)); + if (idev == NULL) + return (ENOMEM); + + err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); + if (err != 0) + goto fail; + break; + + default: + idev = malloc(sizeof (struct devdesc)); + if (idev == NULL) + return (ENOMEM); + unit = 0; + cp = (char *)np; if (*np && (*np != ':')) { unit = strtol(np, &cp, 0); /* get unit number if present */ @@ -127,9 +146,8 @@ i386_parsedev(struct i386_devdesc **dev, const char *d err = EUNIT; goto fail; } - } else { - cp = (char *)np; } + if (*cp && (*cp != ':')) { err = EINVAL; goto fail; @@ -139,21 +157,13 @@ i386_parsedev(struct i386_devdesc **dev, const char *d if (path != NULL) *path = (*cp == 0) ? cp : cp + 1; break; - case DEVT_ZFS: - err = zfs_parsedev((struct zfs_devdesc *)idev, np, path); - if (err != 0) - goto fail; - break; - default: - err = EINVAL; - goto fail; } idev->dd.d_dev = dv; - if (dev == NULL) { - free(idev); - } else { + if (dev != NULL) *dev = idev; - } + else + free(idev); + return(0); fail: From owner-svn-src-head@freebsd.org Thu Jan 3 01:01:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81C6114373FA; Thu, 3 Jan 2019 01:01:04 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 270FA81269; Thu, 3 Jan 2019 01:01:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AD9919BC8; Thu, 3 Jan 2019 01:01:04 +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 x03113TK054143; Thu, 3 Jan 2019 01:01:03 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03113ev054142; Thu, 3 Jan 2019 01:01:03 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901030101.x03113ev054142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Jan 2019 01:01:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342711 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 342711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 270FA81269 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 01:01:04 -0000 Author: kib Date: Thu Jan 3 01:01:03 2019 New Revision: 342711 URL: https://svnweb.freebsd.org/changeset/base/342711 Log: Fix typo, use boolean operator instead of bit-wise. Reviewed by: marius, shurd MFC after: 3 days Sponsored by: The FreeBSD Foundation Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Thu Jan 3 00:36:33 2019 (r342710) +++ head/sys/net/iflib.c Thu Jan 3 01:01:03 2019 (r342711) @@ -1617,7 +1617,7 @@ iflib_txsd_alloc(iflib_txq_t txq) (uintmax_t)sctx->isc_tx_maxsize, nsegments, (uintmax_t)sctx->isc_tx_maxsegsize); goto fail; } - if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) & + if ((if_getcapabilities(ctx->ifc_ifp) & IFCAP_TSO) && (err = bus_dma_tag_create(bus_get_dma_tag(dev), 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR, /* lowaddr */ From owner-svn-src-head@freebsd.org Thu Jan 3 03:27:38 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6C990143C501; Thu, 3 Jan 2019 03:27:38 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1171C869DD; Thu, 3 Jan 2019 03:27:38 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EEB1F1B5B7; Thu, 3 Jan 2019 03:27:37 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x033RbxC029604; Thu, 3 Jan 2019 03:27:37 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x033Rbdk029603; Thu, 3 Jan 2019 03:27:37 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901030327.x033Rbdk029603@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 3 Jan 2019 03:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342714 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 342714 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1171C869DD X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.969,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 03:27:38 -0000 Author: avos Date: Thu Jan 3 03:27:37 2019 New Revision: 342714 URL: https://svnweb.freebsd.org/changeset/base/342714 Log: rtwnfw(4): refresh this manpage too (add rtwn-rtl8188eefw module). MFC after: 3 days Modified: head/share/man/man4/rtwnfw.4 Modified: head/share/man/man4/rtwnfw.4 ============================================================================== --- head/share/man/man4/rtwnfw.4 Thu Jan 3 02:59:12 2019 (r342713) +++ head/share/man/man4/rtwnfw.4 Thu Jan 3 03:27:37 2019 (r342714) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 24, 2017 +.Dd January 3, 2019 .Dt RTWNFW 4 .Os .Sh NAME @@ -41,6 +41,7 @@ This will include all firmware images inside the kerne If you want to pick only the firmware image for your network adapter choose one of the following: .Bd -ragged -offset indent +.Cd "device rtwn-rtl8188eefw" .Cd "device rtwn-rtl8188eufw" .Cd "device rtwn-rtl8192cfwE_B" .Cd "device rtwn-rtl8192cfwE" @@ -55,6 +56,7 @@ Alternatively, to load all firmware images as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent +rtwn-rtl8188eefw_load="YES" rtwn-rtl8188eufw_load="YES" rtwn-rtl8192cfwE_B_load="YES" rtwn-rtl8192cfwE_load="YES" @@ -67,6 +69,8 @@ rtwn-rtl8821aufw_load="YES" .Sh DESCRIPTION rtwn-rtl8192cfwE and rtl8192cfwE_B modules provide access to firmware sets for the Realtek RTL8188CE chip based PCIe adapters. +rtwn-rtl8188ee module provides access to firmware sets for the +Realtek RTL8188EE chip based PCIe adapters. Other modules provide access to firmware sets for the Realtek RTL8188CUS, RTL8188CE-VAU, RTL8188EUS, RTL8188RU, RTL8192CU, RTL8192EU, RTL8812AU and RTL8821AU chip based USB WiFi adapters. From owner-svn-src-head@freebsd.org Thu Jan 3 09:04:00 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 184DD142120B; Thu, 3 Jan 2019 09:04:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AFF956AA33; Thu, 3 Jan 2019 09:03:59 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9674B1F093; Thu, 3 Jan 2019 09:03:59 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x0393xNt007849; Thu, 3 Jan 2019 09:03:59 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x0393whW007845; Thu, 3 Jan 2019 09:03:58 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901030903.x0393whW007845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 3 Jan 2019 09:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342721 - in head/stand/efi: include libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include libefi loader X-SVN-Commit-Revision: 342721 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AFF956AA33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 09:04:00 -0000 Author: tsoome Date: Thu Jan 3 09:03:58 2019 New Revision: 342721 URL: https://svnweb.freebsd.org/changeset/base/342721 Log: loader.efi: update memmap command to recognize new attributes Also move memory type to string translation to libefi for later use. MFC after: 2 weeks Modified: head/stand/efi/include/efidef.h head/stand/efi/include/efilib.h head/stand/efi/libefi/env.c head/stand/efi/loader/main.c Modified: head/stand/efi/include/efidef.h ============================================================================== --- head/stand/efi/include/efidef.h Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/include/efidef.h Thu Jan 3 09:03:58 2019 (r342721) @@ -157,23 +157,27 @@ typedef enum { EfiMemoryMappedIO, EfiMemoryMappedIOPortSpace, EfiPalCode, + EfiPersistentMemory, EfiMaxMemoryType } EFI_MEMORY_TYPE; // possible caching types for the memory range -#define EFI_MEMORY_UC 0x0000000000000001 -#define EFI_MEMORY_WC 0x0000000000000002 -#define EFI_MEMORY_WT 0x0000000000000004 -#define EFI_MEMORY_WB 0x0000000000000008 -#define EFI_MEMORY_UCE 0x0000000000000010 +#define EFI_MEMORY_UC 0x0000000000000001 +#define EFI_MEMORY_WC 0x0000000000000002 +#define EFI_MEMORY_WT 0x0000000000000004 +#define EFI_MEMORY_WB 0x0000000000000008 +#define EFI_MEMORY_UCE 0x0000000000000010 // physical memory protection on range -#define EFI_MEMORY_WP 0x0000000000001000 -#define EFI_MEMORY_RP 0x0000000000002000 -#define EFI_MEMORY_XP 0x0000000000004000 +#define EFI_MEMORY_WP 0x0000000000001000 +#define EFI_MEMORY_RP 0x0000000000002000 +#define EFI_MEMORY_XP 0x0000000000004000 +#define EFI_MEMORY_NV 0x0000000000008000 +#define EFI_MEMORY_MORE_RELIABLE 0x0000000000010000 +#define EFI_MEMORY_RO 0x0000000000020000 // range requires a runtime mapping -#define EFI_MEMORY_RUNTIME 0x8000000000000000 +#define EFI_MEMORY_RUNTIME 0x8000000000000000 #define EFI_MEMORY_DESCRIPTOR_VERSION 1 typedef struct { Modified: head/stand/efi/include/efilib.h ============================================================================== --- head/stand/efi/include/efilib.h Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/include/efilib.h Thu Jan 3 09:03:58 2019 (r342721) @@ -108,6 +108,9 @@ void delay(int usecs); /* EFI environment initialization. */ void efi_init_environment(void); +/* EFI Memory type strings. */ +const char *efi_memory_type(EFI_MEMORY_TYPE); + /* CHAR16 utility functions. */ int wcscmp(CHAR16 *, CHAR16 *); void cpy8to16(const char *, CHAR16 *, size_t); Modified: head/stand/efi/libefi/env.c ============================================================================== --- head/stand/efi/libefi/env.c Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/libefi/env.c Thu Jan 3 09:03:58 2019 (r342721) @@ -47,6 +47,49 @@ efi_init_environment(void) COMMAND_SET(efishow, "efi-show", "print some or all EFI variables", command_efi_show); +const char * +efi_memory_type(EFI_MEMORY_TYPE type) +{ + const char *types[] = { + "Reserved", + "LoaderCode", + "LoaderData", + "BootServicesCode", + "BootServicesData", + "RuntimeServicesCode", + "RuntimeServicesData", + "ConventionalMemory", + "UnusableMemory", + "ACPIReclaimMemory", + "ACPIMemoryNVS", + "MemoryMappedIO", + "MemoryMappedIOPortSpace", + "PalCode", + "PersistentMemory" + }; + + switch (type) { + case EfiReservedMemoryType: + case EfiLoaderCode: + case EfiLoaderData: + case EfiBootServicesCode: + case EfiBootServicesData: + case EfiRuntimeServicesCode: + case EfiRuntimeServicesData: + case EfiConventionalMemory: + case EfiUnusableMemory: + case EfiACPIReclaimMemory: + case EfiACPIMemoryNVS: + case EfiMemoryMappedIO: + case EfiMemoryMappedIOPortSpace: + case EfiPalCode: + case EfiPersistentMemory: + return (types[type]); + default: + return ("Unknown"); + } +} + static int efi_print_var(CHAR16 *varnamearg, EFI_GUID *matchguid, int lflag) { Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Thu Jan 3 08:04:14 2019 (r342720) +++ head/stand/efi/loader/main.c Thu Jan 3 09:03:58 2019 (r342721) @@ -1041,7 +1041,7 @@ command_quit(int argc, char *argv[]) COMMAND_SET(memmap, "memmap", "print memory map", command_memmap); static int -command_memmap(int argc, char *argv[]) +command_memmap(int argc __unused, char *argv[] __unused) { UINTN sz; EFI_MEMORY_DESCRIPTOR *map, *p; @@ -1050,22 +1050,6 @@ command_memmap(int argc, char *argv[]) EFI_STATUS status; int i, ndesc; char line[80]; - static char *types[] = { - "Reserved", - "LoaderCode", - "LoaderData", - "BootServicesCode", - "BootServicesData", - "RuntimeServicesCode", - "RuntimeServicesData", - "ConventionalMemory", - "UnusableMemory", - "ACPIReclaimMemory", - "ACPIMemoryNVS", - "MemoryMappedIO", - "MemoryMappedIOPortSpace", - "PalCode" - }; sz = 0; status = BS->GetMemoryMap(&sz, 0, &key, &dsz, &dver); @@ -1091,9 +1075,12 @@ command_memmap(int argc, char *argv[]) for (i = 0, p = map; i < ndesc; i++, p = NextMemoryDescriptor(p, dsz)) { - printf("%23s %012jx %012jx %08jx ", types[p->Type], - (uintmax_t)p->PhysicalStart, (uintmax_t)p->VirtualStart, - (uintmax_t)p->NumberOfPages); + snprintf(line, sizeof(line), "%23s %012jx %012jx %08jx ", + efi_memory_type(p->Type), (uintmax_t)p->PhysicalStart, + (uintmax_t)p->VirtualStart, (uintmax_t)p->NumberOfPages); + if (pager_output(line)) + break; + if (p->Attribute & EFI_MEMORY_UC) printf("UC "); if (p->Attribute & EFI_MEMORY_WC) @@ -1110,6 +1097,12 @@ command_memmap(int argc, char *argv[]) printf("RP "); if (p->Attribute & EFI_MEMORY_XP) printf("XP "); + if (p->Attribute & EFI_MEMORY_NV) + printf("NV "); + if (p->Attribute & EFI_MEMORY_MORE_RELIABLE) + printf("MR "); + if (p->Attribute & EFI_MEMORY_RO) + printf("RO "); if (pager_output("\n")) break; } From owner-svn-src-head@freebsd.org Thu Jan 3 14:27:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5A9D142C6F9; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CC1D77661; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 71296226C9; Thu, 3 Jan 2019 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03ERpMg079678; Thu, 3 Jan 2019 14:27:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03ERp2S079677; Thu, 3 Jan 2019 14:27:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901031427.x03ERp2S079677@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 3 Jan 2019 14:27:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342730 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 342730 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7CC1D77661 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 14:27:52 -0000 Author: hselasky Date: Thu Jan 3 14:27:51 2019 New Revision: 342730 URL: https://svnweb.freebsd.org/changeset/base/342730 Log: Improve USB generic debug messages. Print process ID and name when opening and closing usb/ugenX.Y character device nodes. MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_generic.c Modified: head/sys/dev/usb/usb_generic.c ============================================================================== --- head/sys/dev/usb/usb_generic.c Thu Jan 3 09:30:10 2019 (r342729) +++ head/sys/dev/usb/usb_generic.c Thu Jan 3 14:27:51 2019 (r342730) @@ -183,7 +183,8 @@ ugen_open(struct usb_fifo *f, int fflags) struct usb_endpoint_descriptor *ed = ep->edesc; uint8_t type; - DPRINTFN(6, "flag=0x%x\n", fflags); + DPRINTFN(1, "flag=0x%x pid=%d name=%s\n", fflags, + curthread->td_proc->p_pid, curthread->td_proc->p_comm); mtx_lock(f->priv_mtx); switch (usbd_get_speed(f->udev)) { @@ -213,7 +214,9 @@ ugen_open(struct usb_fifo *f, int fflags) static void ugen_close(struct usb_fifo *f, int fflags) { - DPRINTFN(6, "flag=0x%x\n", fflags); + + DPRINTFN(1, "flag=0x%x pid=%d name=%s\n", fflags, + curthread->td_proc->p_pid, curthread->td_proc->p_comm); /* cleanup */ From owner-svn-src-head@freebsd.org Thu Jan 3 16:11:22 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DDA8142EA2C; Thu, 3 Jan 2019 16:11:22 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7E3482E50; Thu, 3 Jan 2019 16:11:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD5FA237D9; Thu, 3 Jan 2019 16:11:21 +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 x03GBLeQ034328; Thu, 3 Jan 2019 16:11:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GBLeD034327; Thu, 3 Jan 2019 16:11:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031611.x03GBLeD034327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:11:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342731 - head/sys/riscv/conf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/conf X-SVN-Commit-Revision: 342731 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C7E3482E50 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:11:22 -0000 Author: markj Date: Thu Jan 3 16:11:21 2019 New Revision: 342731 URL: https://svnweb.freebsd.org/changeset/base/342731 Log: Configure hz=100 in the QEMU target. We currently don't have a good way to dynamically detect whether the kernel is running as a guest. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18715 Modified: head/sys/riscv/conf/QEMU Modified: head/sys/riscv/conf/QEMU ============================================================================== --- head/sys/riscv/conf/QEMU Thu Jan 3 14:27:51 2019 (r342730) +++ head/sys/riscv/conf/QEMU Thu Jan 3 16:11:21 2019 (r342731) @@ -6,4 +6,5 @@ include "GENERIC" ident QEMU +options HZ=100 options ROOTDEVNAME=\"ufs:/dev/vtbd0\" From owner-svn-src-head@freebsd.org Thu Jan 3 16:15:29 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 798FE142EAE4; Thu, 3 Jan 2019 16:15:29 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EAF383206; Thu, 3 Jan 2019 16:15:29 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0331A23940; Thu, 3 Jan 2019 16:15:29 +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 x03GFSkf037923; Thu, 3 Jan 2019 16:15:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GFSBT037922; Thu, 3 Jan 2019 16:15:28 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031615.x03GFSBT037922@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:15:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342732 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342732 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1EAF383206 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:15:29 -0000 Author: markj Date: Thu Jan 3 16:15:28 2019 New Revision: 342732 URL: https://svnweb.freebsd.org/changeset/base/342732 Log: Use regular stores to update PTEs in the riscv pmap layer. There's no need to use atomics when the previous value isn't needed. No functional change intended. Reviewed by: kib Discussed with: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18717 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:11:21 2019 (r342731) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:15:28 2019 (r342732) @@ -257,15 +257,13 @@ static void _pmap_unwire_l3(pmap_t pmap, vm_offset_t v struct spglist *free); static int pmap_unuse_l3(pmap_t, vm_offset_t, pd_entry_t, struct spglist *); -/* - * These load the old table data and store the new value. - * They need to be atomic as the System MMU may write to the table at - * the same time as the CPU. - */ -#define pmap_load_store(table, entry) atomic_swap_64(table, entry) -#define pmap_set(table, mask) atomic_set_64(table, mask) -#define pmap_load_clear(table) atomic_swap_64(table, 0) -#define pmap_load(table) (*table) +#define pmap_clear(pte) pmap_store(pte, 0) +#define pmap_clear_bits(pte, bits) atomic_clear_64(pte, bits) +#define pmap_load_store(pte, entry) atomic_swap_64(pte, entry) +#define pmap_load_clear(pte) pmap_load_store(pte, 0) +#define pmap_load(pte) atomic_load_64(pte) +#define pmap_store(pte, entry) atomic_store_64(pte, entry) +#define pmap_store_bits(pte, bits) atomic_set_64(pte, bits) /********************/ /* Inline functions */ @@ -384,10 +382,7 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; - if (entry) - pmap_load_store(l1, entry); - else - pmap_load_clear(l1); + pmap_store(l1, entry); } } @@ -455,7 +450,7 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l1[l1_slot], entry); + pmap_store(&l1[l1_slot], entry); } /* Set the upper limit of the DMAP region */ @@ -489,7 +484,7 @@ pmap_bootstrap_l3(vm_offset_t l1pt, vm_offset_t va, vm pn = (pa / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(&l2[l2_slot], entry); + pmap_store(&l2[l2_slot], entry); l3pt += PAGE_SIZE; } @@ -875,7 +870,7 @@ pmap_kenter_device(vm_offset_t sva, vm_size_t size, vm pn = (pa / PAGE_SIZE); entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += PAGE_SIZE; pa += PAGE_SIZE; @@ -896,8 +891,7 @@ pmap_kremove(vm_offset_t va) l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - pmap_load_clear(l3); - + pmap_clear(l3); sfence_vma(); } @@ -916,7 +910,7 @@ pmap_kremove_device(vm_offset_t sva, vm_size_t size) while (size != 0) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("Invalid page table, va: 0x%lx", va)); - pmap_load_clear(l3); + pmap_clear(l3); va += PAGE_SIZE; size -= PAGE_SIZE; @@ -973,7 +967,7 @@ pmap_qenter(vm_offset_t sva, vm_page_t *ma, int count) entry = PTE_KERN; entry |= (pn << PTE_PPN0_S); - pmap_load_store(l3, entry); + pmap_store(l3, entry); va += L3_SIZE; } @@ -993,14 +987,10 @@ pmap_qremove(vm_offset_t sva, int count) KASSERT(sva >= VM_MIN_KERNEL_ADDRESS, ("usermode va %lx", sva)); - va = sva; - while (count-- > 0) { + for (va = sva; count-- > 0; va += PAGE_SIZE) { l3 = pmap_l3(kernel_pmap, va); KASSERT(l3 != NULL, ("pmap_kremove: Invalid address")); - - pmap_load_clear(l3); - - va += PAGE_SIZE; + pmap_clear(l3); } pmap_invalidate_range(kernel_pmap, sva, va); } @@ -1057,13 +1047,13 @@ _pmap_unwire_l3(pmap_t pmap, vm_offset_t va, vm_page_t /* PD page */ pd_entry_t *l1; l1 = pmap_l1(pmap, va); - pmap_load_clear(l1); + pmap_clear(l1); pmap_distribute_l1(pmap, pmap_l1_index(va), 0); } else { /* PTE page */ pd_entry_t *l2; l2 = pmap_l2(pmap, va); - pmap_load_clear(l2); + pmap_clear(l2); } pmap_resident_count_dec(pmap, 1); if (m->pindex < NUPDE) { @@ -1207,7 +1197,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, l1index, entry); } else { vm_pindex_t l1index; @@ -1236,7 +1226,7 @@ _pmap_alloc_l3(pmap_t pmap, vm_pindex_t ptepindex, str pn = (VM_PAGE_TO_PHYS(m) / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); } pmap_resident_count_inc(pmap, 1); @@ -1367,7 +1357,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(kernel_pmap, pmap_l1_index(kernel_vm_end), entry); continue; /* try again */ @@ -1396,7 +1386,7 @@ pmap_growkernel(vm_offset_t addr) pn = (paddr / PAGE_SIZE); entry = (PTE_V); entry |= (pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); pmap_invalidate_page(kernel_pmap, kernel_vm_end); @@ -1908,7 +1898,7 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t if ((l3 & PTE_V) != 0) { entry = pmap_load(l3p); entry &= ~PTE_W; - pmap_load_store(l3p, entry); + pmap_store(l3p, entry); /* XXX: Use pmap_invalidate_range */ pmap_invalidate_page(pmap, sva); } @@ -1945,7 +1935,7 @@ pmap_fault_fixup(pmap_t pmap, vm_offset_t va, vm_prot_ new_l3 |= PTE_D; if (orig_l3 != new_l3) { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); pmap_invalidate_page(pmap, va); rv = 1; goto done; @@ -2062,7 +2052,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l1 = pmap_l1(pmap, va); entry = (PTE_V); entry |= (l2_pn << PTE_PPN0_S); - pmap_load_store(l1, entry); + pmap_store(l1, entry); pmap_distribute_l1(pmap, pmap_l1_index(va), entry); l2 = pmap_l1_to_l2(l1, va); } @@ -2081,7 +2071,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v l3_pn = (l3_pa / PAGE_SIZE); entry = (PTE_V); entry |= (l3_pn << PTE_PPN0_S); - pmap_load_store(l2, entry); + pmap_store(l2, entry); l3 = pmap_l2_to_l3(l2, va); } pmap_invalidate_page(pmap, va); @@ -2209,7 +2199,7 @@ validate: (PTE_D | PTE_SW_MANAGED)) vm_page_dirty(m); } else { - pmap_load_store(l3, new_l3); + pmap_store(l3, new_l3); } if (lock != NULL) @@ -2290,10 +2280,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v struct spglist free; vm_paddr_t phys; pd_entry_t *l2; - pt_entry_t *l3; - vm_paddr_t pa; - pt_entry_t entry; - pn_t pn; + pt_entry_t *l3, newl3; KASSERT(va < kmi.clean_sva || va >= kmi.clean_eva || (m->oflags & VPO_UNMANAGED) != 0, @@ -2399,7 +2386,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_load_store(l3, entry); + pmap_store(l3, entry); pmap_invalidate_page(pmap, va); return (mpte); @@ -2742,7 +2729,7 @@ pmap_remove_pages(pmap_t pmap) ("pmap_remove_pages: bad l3 %#jx", (uintmax_t)tl3)); - pmap_load_clear(l3); + pmap_clear(l3); /* * Update the vm_page_t clean/reference bits. From owner-svn-src-head@freebsd.org Thu Jan 3 16:19:33 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD74B142F0B4; Thu, 3 Jan 2019 16:19:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE90835FC; Thu, 3 Jan 2019 16:19:33 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6CB1823949; Thu, 3 Jan 2019 16:19:33 +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 x03GJXRf038152; Thu, 3 Jan 2019 16:19:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GJXB4038151; Thu, 3 Jan 2019 16:19:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031619.x03GJXB4038151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:19:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342733 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342733 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7EE90835FC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:19:34 -0000 Author: markj Date: Thu Jan 3 16:19:32 2019 New Revision: 342733 URL: https://svnweb.freebsd.org/changeset/base/342733 Log: Set PTE_U on PTEs created by pmap_enter_quick(). Otherwise prefaulted entries are not accessible from user mode and end up triggering a fault upon access, so prefaulting has no effect. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18718 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:15:28 2019 (r342732) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:19:32 2019 (r342733) @@ -2365,19 +2365,14 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v */ pmap_resident_count_inc(pmap, 1); - pa = VM_PAGE_TO_PHYS(m); - pn = (pa / PAGE_SIZE); - - entry = PTE_V | PTE_R; - if (prot & VM_PROT_EXECUTE) - entry |= PTE_X; - entry |= (pn << PTE_PPN0_S); - - /* - * Now validate mapping with RO protection - */ + newl3 = ((VM_PAGE_TO_PHYS(m) / PAGE_SIZE) << PTE_PPN0_S) | + PTE_V | PTE_R; + if ((prot & VM_PROT_EXECUTE) != 0) + newl3 |= PTE_X; if ((m->oflags & VPO_UNMANAGED) == 0) - entry |= PTE_SW_MANAGED; + newl3 |= PTE_SW_MANAGED; + if (va < VM_MAX_USER_ADDRESS) + newl3 |= PTE_U; /* * Sync the i-cache on all harts before updating the PTE @@ -2386,7 +2381,7 @@ pmap_enter_quick_locked(pmap_t pmap, vm_offset_t va, v if (prot & VM_PROT_EXECUTE) pmap_sync_icache(pmap, va, PAGE_SIZE); - pmap_store(l3, entry); + pmap_store(l3, newl3); pmap_invalidate_page(pmap, va); return (mpte); From owner-svn-src-head@freebsd.org Thu Jan 3 16:21:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2C92142F2DF; Thu, 3 Jan 2019 16:21:45 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 468D4839AC; Thu, 3 Jan 2019 16:21:45 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2321D23ACA; Thu, 3 Jan 2019 16:21:45 +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 x03GLjbo042238; Thu, 3 Jan 2019 16:21:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GLjE4042237; Thu, 3 Jan 2019 16:21:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031621.x03GLjE4042237@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:21:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342734 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342734 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 468D4839AC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.941,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:21:45 -0000 Author: markj Date: Thu Jan 3 16:21:44 2019 New Revision: 342734 URL: https://svnweb.freebsd.org/changeset/base/342734 Log: Fix some issues with the riscv pmap_protect() implementation. - Handle VM_PROT_EXECUTE. - Clear PTE_D and mark the page dirty when removing write access from a mapping. - Atomically clear PTE_W to avoid clobbering a hardware PTE update. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18719 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:19:32 2019 (r342733) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:21:44 2019 (r342734) @@ -1853,22 +1853,28 @@ pmap_remove_all(vm_page_t m) void pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, vm_prot_t prot) { - vm_offset_t va_next; pd_entry_t *l1, *l2; - pt_entry_t *l3p, l3; - pt_entry_t entry; + pt_entry_t *l3, l3e, mask; + vm_page_t m; + vm_offset_t va_next; if ((prot & VM_PROT_READ) == VM_PROT_NONE) { pmap_remove(pmap, sva, eva); return; } - if ((prot & VM_PROT_WRITE) == VM_PROT_WRITE) + if ((prot & (VM_PROT_WRITE | VM_PROT_EXECUTE)) == + (VM_PROT_WRITE | VM_PROT_EXECUTE)) return; + mask = 0; + if ((prot & VM_PROT_WRITE) == 0) + mask |= PTE_W | PTE_D; + if ((prot & VM_PROT_EXECUTE) == 0) + mask |= PTE_X; + PMAP_LOCK(pmap); for (; sva < eva; sva = va_next) { - l1 = pmap_l1(pmap, sva); if (pmap_load(l1) == 0) { va_next = (sva + L1_SIZE) & ~L1_OFFSET; @@ -1882,26 +1888,30 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t va_next = eva; l2 = pmap_l1_to_l2(l1, sva); - if (l2 == NULL) + if (l2 == NULL || pmap_load(l2) == 0) continue; - if (pmap_load(l2) == 0) - continue; if ((pmap_load(l2) & PTE_RX) != 0) continue; if (va_next > eva) va_next = eva; - for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, + for (l3 = pmap_l2_to_l3(l2, sva); sva != va_next; l3++, sva += L3_SIZE) { - l3 = pmap_load(l3p); - if ((l3 & PTE_V) != 0) { - entry = pmap_load(l3p); - entry &= ~PTE_W; - pmap_store(l3p, entry); - /* XXX: Use pmap_invalidate_range */ - pmap_invalidate_page(pmap, sva); + l3e = pmap_load(l3); +retry: + if ((l3e & PTE_V) == 0) + continue; + if ((prot & VM_PROT_WRITE) == 0 && + (l3e & (PTE_SW_MANAGED | PTE_D)) == + (PTE_SW_MANAGED | PTE_D)) { + m = PHYS_TO_VM_PAGE(PTE_TO_PHYS(l3e)); + vm_page_dirty(m); } + if (!atomic_fcmpset_long(l3, &l3e, l3e & ~mask)) + goto retry; + /* XXX: Use pmap_invalidate_range */ + pmap_invalidate_page(pmap, sva); } } PMAP_UNLOCK(pmap); From owner-svn-src-head@freebsd.org Thu Jan 3 16:24:04 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5EAA142F454; Thu, 3 Jan 2019 16:24:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BE5B83C91; Thu, 3 Jan 2019 16:24:04 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 513C123B10; Thu, 3 Jan 2019 16:24:04 +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 x03GO4pp043230; Thu, 3 Jan 2019 16:24:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GO4wj043229; Thu, 3 Jan 2019 16:24:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031624.x03GO4wj043229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:24:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342735 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342735 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BE5B83C91 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:24:04 -0000 Author: markj Date: Thu Jan 3 16:24:03 2019 New Revision: 342735 URL: https://svnweb.freebsd.org/changeset/base/342735 Log: Synchronize access to the allpmaps list. The list will be removed with some future work. Reviewed by: jhb MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18721 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:21:44 2019 (r342734) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:24:03 2019 (r342735) @@ -228,6 +228,7 @@ CTASSERT((DMAP_MIN_ADDRESS & ~L1_OFFSET) == DMAP_MIN_ CTASSERT((DMAP_MAX_ADDRESS & ~L1_OFFSET) == DMAP_MAX_ADDRESS); static struct rwlock_padalign pvh_global_lock; +static struct mtx_padalign allpmaps_lock; /* * Data for the pv entry allocation mechanism @@ -380,10 +381,12 @@ pmap_distribute_l1(struct pmap *pmap, vm_pindex_t l1in if (pmap != kernel_pmap) return; + mtx_lock(&allpmaps_lock); LIST_FOREACH(user_pmap, &allpmaps, pm_list) { l1 = &user_pmap->pm_l1[l1index]; pmap_store(l1, entry); } + mtx_unlock(&allpmaps_lock); } static pt_entry_t * @@ -636,9 +639,10 @@ pmap_init(void) int i; /* - * Initialize the pv chunk list mutex. + * Initialize the pv chunk and pmap list mutexes. */ mtx_init(&pv_chunks_mutex, "pmap pv chunk list", NULL, MTX_DEF); + mtx_init(&allpmaps_lock, "allpmaps", NULL, MTX_DEF); /* * Initialize the pool of pv list locks. @@ -1132,7 +1136,9 @@ pmap_pinit(pmap_t pmap) memcpy(pmap->pm_l1, kernel_pmap->pm_l1, PAGE_SIZE); /* Add to the list of all user pmaps */ + mtx_lock(&allpmaps_lock); LIST_INSERT_HEAD(&allpmaps, pmap, pm_list); + mtx_unlock(&allpmaps_lock); return (1); } @@ -1296,7 +1302,9 @@ pmap_release(pmap_t pmap) vm_page_free_zero(m); /* Remove pmap from the allpmaps list */ + mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); + mtx_unlock(&allpmaps_lock); /* Remove kernel pagetables */ bzero(pmap->pm_l1, PAGE_SIZE); From owner-svn-src-head@freebsd.org Thu Jan 3 16:26:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8570F142F5C7; Thu, 3 Jan 2019 16:26:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A34583EF8; Thu, 3 Jan 2019 16:26:53 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 181C923B2E; Thu, 3 Jan 2019 16:26:53 +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 x03GQqGD043416; Thu, 3 Jan 2019 16:26:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03GQqiw043415; Thu, 3 Jan 2019 16:26:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901031626.x03GQqiw043415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 3 Jan 2019 16:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342736 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342736 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2A34583EF8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.995,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.939,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:26:53 -0000 Author: markj Date: Thu Jan 3 16:26:52 2019 New Revision: 342736 URL: https://svnweb.freebsd.org/changeset/base/342736 Log: Fix a use-after-free in the riscv pmap_release() implementation. Don't bother zeroing the top-level page before freeing it. Previously, the page was freed before being zeroed. Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18720 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Thu Jan 3 16:24:03 2019 (r342735) +++ head/sys/riscv/riscv/pmap.c Thu Jan 3 16:26:52 2019 (r342736) @@ -1297,17 +1297,13 @@ pmap_release(pmap_t pmap) ("pmap_release: pmap resident count %ld != 0", pmap->pm_stats.resident_count)); - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); - vm_page_unwire_noq(m); - vm_page_free_zero(m); - - /* Remove pmap from the allpmaps list */ mtx_lock(&allpmaps_lock); LIST_REMOVE(pmap, pm_list); mtx_unlock(&allpmaps_lock); - /* Remove kernel pagetables */ - bzero(pmap->pm_l1, PAGE_SIZE); + m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pmap->pm_l1)); + vm_page_unwire_noq(m); + vm_page_free(m); } #if 0 From owner-svn-src-head@freebsd.org Thu Jan 3 16:47:06 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C384142FE52; Thu, 3 Jan 2019 16:47:06 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DDA984AF4; Thu, 3 Jan 2019 16:47:06 +0000 (UTC) (envelope-from vmaffione@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1219B23E99; Thu, 3 Jan 2019 16:47:06 +0000 (UTC) (envelope-from vmaffione@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03Gl5St053520; Thu, 3 Jan 2019 16:47:05 GMT (envelope-from vmaffione@FreeBSD.org) Received: (from vmaffione@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03Gl5Ja053519; Thu, 3 Jan 2019 16:47:05 GMT (envelope-from vmaffione@FreeBSD.org) Message-Id: <201901031647.x03Gl5Ja053519@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vmaffione set sender to vmaffione@FreeBSD.org using -f From: Vincenzo Maffione Date: Thu, 3 Jan 2019 16:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342737 - head/tests/sys/netmap X-SVN-Group: head X-SVN-Commit-Author: vmaffione X-SVN-Commit-Paths: head/tests/sys/netmap X-SVN-Commit-Revision: 342737 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1DDA984AF4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.972,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 16:47:06 -0000 Author: vmaffione Date: Thu Jan 3 16:47:05 2019 New Revision: 342737 URL: https://svnweb.freebsd.org/changeset/base/342737 Log: netmap: unit tests: fix issues found by coverity scan Reported by: asomers MFC after: 1 week Sponsored by: Sunny Valley Networks Modified: head/tests/sys/netmap/ctrl-api-test.c Modified: head/tests/sys/netmap/ctrl-api-test.c ============================================================================== --- head/tests/sys/netmap/ctrl-api-test.c Thu Jan 3 16:26:52 2019 (r342736) +++ head/tests/sys/netmap/ctrl-api-test.c Thu Jan 3 16:47:05 2019 (r342737) @@ -83,16 +83,19 @@ exec_command(int argc, const char *const argv[]) child_pid = fork(); if (child_pid == 0) { char **av; + int fds[3]; /* Child process. Redirect stdin, stdout * and stderr. */ - close(0); - close(1); - close(2); - if (open("/dev/null", O_RDONLY) < 0 || - open("/dev/null", O_RDONLY) < 0 || - open("/dev/null", O_RDONLY) < 0) { - return -1; + for (i = 0; i < 3; i++) { + close(i); + fds[i] = open("/dev/null", O_RDONLY); + if (fds[i] < 0) { + for (i--; i >= 0; i--) { + close(fds[i]); + } + return -1; + } } /* Make a copy of the arguments, passing them to execvp. */ @@ -128,7 +131,8 @@ exec_command(int argc, const char *const argv[]) #define THRET_FAILURE ((void *)0) struct TestContext { - char ifname[128]; + char ifname[64]; + char ifname_ext[128]; char bdgname[64]; uint32_t nr_tx_slots; /* slots in tx rings */ uint32_t nr_rx_slots; /* slots in rx rings */ @@ -171,9 +175,9 @@ port_info_get(struct TestContext *ctx) int success; int ret; - printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_INFO_GET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_INFO_GET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -218,9 +222,9 @@ port_register(struct TestContext *ctx) printf("Testing NETMAP_REQ_REGISTER(mode=%d,ringid=%d," "flags=0x%llx) on '%s'\n", ctx->nr_mode, ctx->nr_ringid, (unsigned long long)ctx->nr_flags, - ctx->ifname); + ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_REGISTER; hdr.nr_body = (uintptr_t)&req; hdr.nr_options = (uintptr_t)ctx->nr_opt; @@ -284,10 +288,10 @@ niocregif(struct TestContext *ctx, int netmap_api) int success; int ret; - printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname); + printf("Testing legacy NIOCREGIF on '%s'\n", ctx->ifname_ext); memset(&req, 0, sizeof(req)); - memcpy(req.nr_name, ctx->ifname, sizeof(req.nr_name)); + memcpy(req.nr_name, ctx->ifname_ext, sizeof(req.nr_name)); req.nr_name[sizeof(req.nr_name) - 1] = '\0'; req.nr_version = netmap_api; req.nr_ringid = ctx->nr_ringid; @@ -399,7 +403,7 @@ legacy_regif_extra_bufs(struct TestContext *ctx) static int legacy_regif_extra_bufs_pipe(struct TestContext *ctx) { - strncat(ctx->ifname, "{pipeexbuf", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{pipeexbuf", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; ctx->nr_extra_bufs = 58; /* arbitrary number of extra bufs */ @@ -409,7 +413,7 @@ legacy_regif_extra_bufs_pipe(struct TestContext *ctx) static int legacy_regif_extra_bufs_pipe_vale(struct TestContext *ctx) { - strncpy(ctx->ifname, "valeX1:Y4", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "valeX1:Y4", sizeof(ctx->ifname_ext)); return legacy_regif_extra_bufs_pipe(ctx); } @@ -478,10 +482,10 @@ vale_attach(struct TestContext *ctx) { struct nmreq_vale_attach req; struct nmreq_header hdr; - char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname)]; + char vpname[sizeof(ctx->bdgname) + 1 + sizeof(ctx->ifname_ext)]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_ATTACH on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -516,7 +520,7 @@ vale_detach(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_DETACH on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -560,9 +564,9 @@ port_hdr_set_and_get(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_HDR_SET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_SET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -577,7 +581,7 @@ port_hdr_set_and_get(struct TestContext *ctx) return -1; } - printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_PORT_HDR_GET on '%s'\n", ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_PORT_HDR_GET; req.nr_hdr_len = 0; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); @@ -603,7 +607,7 @@ vale_ephemeral_port_hdr_manipulation(struct TestContex { int ret; - strncpy(ctx->ifname, "vale:eph0", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "vale:eph0", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; if ((ret = port_register(ctx))) { return ret; @@ -632,11 +636,11 @@ vale_persistent_port(struct TestContext *ctx) int result; int ret; - strncpy(ctx->ifname, "per4", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "per4", sizeof(ctx->ifname_ext)); - printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_VALE_NEWIF on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_VALE_NEWIF; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -654,7 +658,7 @@ vale_persistent_port(struct TestContext *ctx) /* Attach the persistent VALE port to a switch and then detach. */ result = vale_attach_detach(ctx); - printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_VALE_DELIF on '%s'\n", ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_VALE_DELIF; hdr.nr_body = (uintptr_t)NULL; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); @@ -676,9 +680,9 @@ pools_info_get(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_POOLS_INFO_GET on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_POOLS_INFO_GET; hdr.nr_body = (uintptr_t)&req; memset(&req, 0, sizeof(req)); @@ -739,14 +743,14 @@ pools_info_get_and_register(struct TestContext *ctx) static int pools_info_get_empty_ifname(struct TestContext *ctx) { - strncpy(ctx->ifname, "", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "", sizeof(ctx->ifname_ext)); return pools_info_get(ctx) != 0 ? 0 : -1; } static int pipe_master(struct TestContext *ctx) { - strncat(ctx->ifname, "{pipeid1", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{pipeid1", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_NIC_SW; if (port_register(ctx) == 0) { @@ -761,7 +765,7 @@ pipe_master(struct TestContext *ctx) static int pipe_slave(struct TestContext *ctx) { - strncat(ctx->ifname, "}pipeid2", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "}pipeid2", sizeof(ctx->ifname_ext)); ctx->nr_mode = NR_REG_ALL_NIC; return port_register(ctx); @@ -772,7 +776,7 @@ pipe_slave(struct TestContext *ctx) static int pipe_port_info_get(struct TestContext *ctx) { - strncat(ctx->ifname, "}pipeid3", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "}pipeid3", sizeof(ctx->ifname_ext)); return port_info_get(ctx); } @@ -780,7 +784,7 @@ pipe_port_info_get(struct TestContext *ctx) static int pipe_pools_info_get(struct TestContext *ctx) { - strncat(ctx->ifname, "{xid", sizeof(ctx->ifname)); + strncat(ctx->ifname_ext, "{xid", sizeof(ctx->ifname_ext)); return pools_info_get(ctx); } @@ -794,7 +798,7 @@ vale_polling_enable(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_POLLING_ENABLE on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -826,7 +830,7 @@ vale_polling_disable(struct TestContext *ctx) char vpname[256]; int ret; - snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname); + snprintf(vpname, sizeof(vpname), "%s:%s", ctx->bdgname, ctx->ifname_ext); printf("Testing NETMAP_REQ_VALE_POLLING_DISABLE on '%s'\n", vpname); nmreq_hdr_init(&hdr, vpname); @@ -861,8 +865,9 @@ vale_polling_enable_disable(struct TestContext *ctx) * because it is currently broken. We are happy to see that * it fails. */ return 0; -#endif +#else return ret; +#endif } if ((ret = vale_polling_disable(ctx))) { @@ -913,7 +918,7 @@ unsupported_option(struct TestContext *ctx) { struct nmreq_option opt, save; - printf("Testing unsupported option on %s\n", ctx->ifname); + printf("Testing unsupported option on %s\n", ctx->ifname_ext); memset(&opt, 0, sizeof(opt)); opt.nro_reqtype = 1234; @@ -933,7 +938,7 @@ infinite_options(struct TestContext *ctx) { struct nmreq_option opt; - printf("Testing infinite list of options on %s\n", ctx->ifname); + printf("Testing infinite list of options on %s\n", ctx->ifname_ext); opt.nro_reqtype = 1234; push_option(&opt, ctx); @@ -1045,7 +1050,7 @@ _extmem_option(struct TestContext *ctx, save = e; - strncpy(ctx->ifname, "vale0:0", sizeof(ctx->ifname)); + strncpy(ctx->ifname_ext, "vale0:0", sizeof(ctx->ifname_ext)); ctx->nr_tx_slots = 16; ctx->nr_rx_slots = 16; @@ -1235,9 +1240,9 @@ sync_kloop_stop(struct TestContext *ctx) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_SYNC_KLOOP_STOP on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_SYNC_KLOOP_STOP on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_SYNC_KLOOP_STOP; ret = ioctl(ctx->fd, NIOCCTRL, &hdr); if (ret != 0) { @@ -1255,9 +1260,9 @@ sync_kloop_worker(void *opaque) struct nmreq_header hdr; int ret; - printf("Testing NETMAP_REQ_SYNC_KLOOP_START on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_SYNC_KLOOP_START on '%s'\n", ctx->ifname_ext); - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_SYNC_KLOOP_START; hdr.nr_body = (uintptr_t)&req; hdr.nr_options = (uintptr_t)ctx->nr_opt; @@ -1423,12 +1428,12 @@ csb_enable(struct TestContext *ctx) saveopt = opt.nro_opt; saveopt.nro_status = 0; - nmreq_hdr_init(&hdr, ctx->ifname); + nmreq_hdr_init(&hdr, ctx->ifname_ext); hdr.nr_reqtype = NETMAP_REQ_CSB_ENABLE; hdr.nr_options = (uintptr_t)ctx->nr_opt; hdr.nr_body = (uintptr_t)NULL; - printf("Testing NETMAP_REQ_CSB_ENABLE on '%s'\n", ctx->ifname); + printf("Testing NETMAP_REQ_CSB_ENABLE on '%s'\n", ctx->ifname_ext); ret = ioctl(ctx->fd, NIOCCTRL, &hdr); if (ret != 0) { @@ -1894,6 +1899,8 @@ main(int argc, char **argv) } memcpy(&ctxcopy, &ctx_, sizeof(ctxcopy)); ctxcopy.fd = fd; + memcpy(ctxcopy.ifname_ext, ctxcopy.ifname, + sizeof(ctxcopy.ifname)); ret = tests[i].test(&ctxcopy); if (ret != 0) { printf("Test #%d [%s] failed\n", i + 1, tests[i].name); From owner-svn-src-head@freebsd.org Thu Jan 3 19:35:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5634E14347E2; Thu, 3 Jan 2019 19:35:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D7B588B6B6; Thu, 3 Jan 2019 19:35:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A67D725CB9; Thu, 3 Jan 2019 19:35:07 +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 x03JZ7I9045846; Thu, 3 Jan 2019 19:35:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03JZ7L6045845; Thu, 3 Jan 2019 19:35:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901031935.x03JZ7L6045845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 3 Jan 2019 19:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342739 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 342739 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D7B588B6B6 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.95)[-0.946,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 19:35:08 -0000 Author: kib Date: Thu Jan 3 19:35:07 2019 New Revision: 342739 URL: https://svnweb.freebsd.org/changeset/base/342739 Log: Fix typo in r342710. Noted by: lidl MFC after: 3 days Modified: head/sys/i386/i386/pmap.c Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Thu Jan 3 18:30:36 2019 (r342738) +++ head/sys/i386/i386/pmap.c Thu Jan 3 19:35:07 2019 (r342739) @@ -569,7 +569,7 @@ pmap_cold(void) /* * Bootstrap the system enough to run with virtual memory. * - * On the i386 this is called after pmap_cold() created intial + * On the i386 this is called after pmap_cold() created initial * kernel page table and enabled paging, and just syncs the pmap * module with what has already been done. */ From owner-svn-src-head@freebsd.org Thu Jan 3 20:22:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B0714360CB; Thu, 3 Jan 2019 20:22:37 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DD1C8E032; Thu, 3 Jan 2019 20:22:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84FED26579; Thu, 3 Jan 2019 20:22:36 +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 x03KMag8073799; Thu, 3 Jan 2019 20:22:36 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KMaTq073798; Thu, 3 Jan 2019 20:22:36 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901032022.x03KMaTq073798@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 3 Jan 2019 20:22:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342740 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 342740 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9DD1C8E032 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 20:22:37 -0000 Author: jilles Date: Thu Jan 3 20:22:35 2019 New Revision: 342740 URL: https://svnweb.freebsd.org/changeset/base/342740 Log: sh: Do not place exported but unset variables into the environment PR: 233545 Submitted by: Jan Beich Obtained from: NetBSD Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Thu Jan 3 19:35:07 2019 (r342739) +++ head/bin/sh/var.c Thu Jan 3 20:22:35 2019 (r342740) @@ -558,13 +558,13 @@ environment(void) nenv = 0; for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { for (vp = *vpp ; vp ; vp = vp->next) - if (vp->flags & VEXPORT) + if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT) nenv++; } ep = env = stalloc((nenv + 1) * sizeof *env); for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { for (vp = *vpp ; vp ; vp = vp->next) - if (vp->flags & VEXPORT) + if ((vp->flags & (VEXPORT|VUNSET)) == VEXPORT) *ep++ = vp->text; } *ep = NULL; From owner-svn-src-head@freebsd.org Thu Jan 3 20:23:14 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED005143611A; Thu, 3 Jan 2019 20:23:13 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DCE78E163; Thu, 3 Jan 2019 20:23:13 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 720E02657B; Thu, 3 Jan 2019 20:23:13 +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 x03KNDhi073913; Thu, 3 Jan 2019 20:23:13 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KNDN7073911; Thu, 3 Jan 2019 20:23:13 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201901032023.x03KNDN7073911@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 3 Jan 2019 20:23:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342741 - head/bin/sh/tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/execution X-SVN-Commit-Revision: 342741 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7DCE78E163 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 20:23:14 -0000 Author: jilles Date: Thu Jan 3 20:23:12 2019 New Revision: 342741 URL: https://svnweb.freebsd.org/changeset/base/342741 Log: sh: Add test for exported but unset variables PR: 233545 Added: head/bin/sh/tests/execution/env1.0 (contents, props changed) Modified: head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Thu Jan 3 20:22:35 2019 (r342740) +++ head/bin/sh/tests/execution/Makefile Thu Jan 3 20:23:12 2019 (r342741) @@ -17,6 +17,7 @@ ${PACKAGE}FILES+= bg7.0 ${PACKAGE}FILES+= bg8.0 ${PACKAGE}FILES+= bg9.0 ${PACKAGE}FILES+= bg10.0 bg10.0.stdout +${PACKAGE}FILES+= env1.0 ${PACKAGE}FILES+= fork1.0 ${PACKAGE}FILES+= fork2.0 ${PACKAGE}FILES+= fork3.0 Added: head/bin/sh/tests/execution/env1.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/env1.0 Thu Jan 3 20:23:12 2019 (r342741) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +unset somestrangevar +export somestrangevar +[ "`$SH -c 'echo ${somestrangevar-unset}'`" = unset ] From owner-svn-src-head@freebsd.org Thu Jan 3 20:27:53 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9309614364B4; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 396908E771; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2874A26586; Thu, 3 Jan 2019 20:27:53 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03KRrPa074543; Thu, 3 Jan 2019 20:27:53 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03KRoh2074528; Thu, 3 Jan 2019 20:27:50 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901032027.x03KRoh2074528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 3 Jan 2019 20:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342742 - in head/stand/efi: include include/Guid include/Protocol libefi loader X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: in head/stand/efi: include include/Guid include/Protocol libefi loader X-SVN-Commit-Revision: 342742 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 396908E771 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 20:27:54 -0000 Author: tsoome Date: Thu Jan 3 20:27:50 2019 New Revision: 342742 URL: https://svnweb.freebsd.org/changeset/base/342742 Log: loader.efi: efi variable rework and lsefi command added This update does add diag and debug capabilities to interpret the efi variables, configuration and protocols (lsefi). The side effect is that we add/update bunch of related headers. Added: head/stand/efi/include/Guid/ head/stand/efi/include/Guid/MemoryTypeInformation.h (contents, props changed) head/stand/efi/include/Guid/MtcVendor.h (contents, props changed) head/stand/efi/include/Guid/ZeroGuid.h (contents, props changed) head/stand/efi/include/Protocol/ head/stand/efi/include/Protocol/EdidActive.h (contents, props changed) head/stand/efi/include/Protocol/EdidDiscovered.h (contents, props changed) head/stand/efi/include/Protocol/EdidOverride.h (contents, props changed) head/stand/efi/include/efigpt.h (contents, props changed) head/stand/efi/include/efiip.h (contents, props changed) head/stand/efi/include/efipoint.h (contents, props changed) head/stand/efi/include/efitcp.h (contents, props changed) head/stand/efi/include/efiudp.h (contents, props changed) Modified: head/stand/efi/include/efi.h head/stand/efi/include/efiapi.h head/stand/efi/include/eficon.h head/stand/efi/include/efidef.h head/stand/efi/include/efilib.h head/stand/efi/include/efipciio.h head/stand/efi/libefi/env.c head/stand/efi/loader/main.c Added: head/stand/efi/include/Guid/MemoryTypeInformation.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/MemoryTypeInformation.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,37 @@ +/* $FreeBSD$ */ +/** @file + This file defines: + * Memory Type Information GUID for HOB and Variable. + * Memory Type Information Variable Name. + * Memory Type Information GUID HOB data structure. + + The memory type information HOB and variable can + be used to store the information for each memory type in Variable or HOB. + +Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __MEMORY_TYPE_INFORMATION_GUID_H__ +#define __MEMORY_TYPE_INFORMATION_GUID_H__ + +#define EFI_MEMORY_TYPE_INFORMATION_GUID \ + { 0x4c19049f,0x4137,0x4dd3, { 0x9c,0x10,0x8b,0x97,0xa8,0x3f,0xfd,0xfa } } + +#define EFI_MEMORY_TYPE_INFORMATION_VARIABLE_NAME "MemoryTypeInformation" + +extern EFI_GUID gEfiMemoryTypeInformationGuid; + +typedef struct { + UINT32 Type; ///< EFI memory type defined in UEFI specification. + UINT32 NumberOfPages; ///< The pages of this type memory. +} EFI_MEMORY_TYPE_INFORMATION; + +#endif Added: head/stand/efi/include/Guid/MtcVendor.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/MtcVendor.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,32 @@ +/* $FreeBSD$ */ +/** @file + GUID is for MTC variable. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __MTC_VENDOR_GUID_H__ +#define __MTC_VENDOR_GUID_H__ + +// +// Vendor GUID of the variable for the high part of monotonic counter (UINT32). +// +#define MTC_VENDOR_GUID \ + { 0xeb704011, 0x1402, 0x11d3, { 0x8e, 0x77, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b } } + +// +// Name of the variable for the high part of monotonic counter +// +#define MTC_VARIABLE_NAME "MTC" + +extern EFI_GUID gMtcVendorGuid; + +#endif Added: head/stand/efi/include/Guid/ZeroGuid.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Guid/ZeroGuid.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,26 @@ +/* $FreeBSD$ */ +/** @file + GUID has all zero values. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __ZERO_GUID_H__ +#define __ZERO_GUID_H__ + +#define ZERO_GUID \ + { \ + 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0} \ + } + +extern EFI_GUID gZeroGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidActive.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidActive.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,53 @@ +/* $FreeBSD$ */ +/** @file + EDID Active Protocol from the UEFI 2.0 specification. + + Placed on the video output device child handle that is actively displaying output. + + Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_ACTIVE_H__ +#define __EDID_ACTIVE_H__ + +#define EFI_EDID_ACTIVE_PROTOCOL_GUID \ + { \ + 0xbd8c1056, 0x9f36, 0x44ec, {0x92, 0xa8, 0xa6, 0x33, 0x7f, 0x81, 0x79, 0x86 } \ + } + +/// +/// This protocol contains the EDID information for an active video output device. This is either the +/// EDID information retrieved from the EFI_EDID_OVERRIDE_PROTOCOL if an override is +/// available, or an identical copy of the EDID information from the +/// EFI_EDID_DISCOVERED_PROTOCOL if no overrides are available. +/// +typedef struct { + /// + /// The size, in bytes, of the Edid buffer. 0 if no EDID information + /// is available from the video output device. Otherwise, it must be a + /// minimum of 128 bytes. + /// + UINT32 SizeOfEdid; + + /// + /// A pointer to a read-only array of bytes that contains the EDID + /// information for an active video output device. This pointer is + /// NULL if no EDID information is available for the video output + /// device. The minimum size of a valid Edid buffer is 128 bytes. + /// EDID information is defined in the E-EDID EEPROM + /// specification published by VESA (www.vesa.org). + /// + UINT8 *Edid; +} EFI_EDID_ACTIVE_PROTOCOL; + +extern EFI_GUID gEfiEdidActiveProtocolGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidDiscovered.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidDiscovered.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,51 @@ +/* $FreeBSD$ */ +/** @file + EDID Discovered Protocol from the UEFI 2.0 specification. + + This protocol is placed on the video output device child handle. It represents + the EDID information being used for the output device represented by the child handle. + + Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_DISCOVERED_H__ +#define __EDID_DISCOVERED_H__ + +#define EFI_EDID_DISCOVERED_PROTOCOL_GUID \ + { \ + 0x1c0c34f6, 0xd380, 0x41fa, {0xa0, 0x49, 0x8a, 0xd0, 0x6c, 0x1a, 0x66, 0xaa } \ + } + +/// +/// This protocol contains the EDID information retrieved from a video output device. +/// +typedef struct { + /// + /// The size, in bytes, of the Edid buffer. 0 if no EDID information + /// is available from the video output device. Otherwise, it must be a + /// minimum of 128 bytes. + /// + UINT32 SizeOfEdid; + + /// + /// A pointer to a read-only array of bytes that contains the EDID + /// information for an active video output device. This pointer is + /// NULL if no EDID information is available for the video output + /// device. The minimum size of a valid Edid buffer is 128 bytes. + /// EDID information is defined in the E-EDID EEPROM + /// specification published by VESA (www.vesa.org). + /// + UINT8 *Edid; +} EFI_EDID_DISCOVERED_PROTOCOL; + +extern EFI_GUID gEfiEdidDiscoveredProtocolGuid; + +#endif Added: head/stand/efi/include/Protocol/EdidOverride.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/Protocol/EdidOverride.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,68 @@ +/* $FreeBSD$ */ +/** @file + EDID Override Protocol from the UEFI 2.0 specification. + + Allow platform to provide EDID information to the producer of the Graphics Output + protocol. + + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ This program and the accompanying materials + are licensed and made available under the terms and conditions of the BSD License + which accompanies this distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef __EDID_OVERRIDE_H__ +#define __EDID_OVERRIDE_H__ + +#define EFI_EDID_OVERRIDE_PROTOCOL_GUID \ + { \ + 0x48ecb431, 0xfb72, 0x45c0, {0xa9, 0x22, 0xf4, 0x58, 0xfe, 0x4, 0xb, 0xd5 } \ + } + +typedef struct _EFI_EDID_OVERRIDE_PROTOCOL EFI_EDID_OVERRIDE_PROTOCOL; + +#define EFI_EDID_OVERRIDE_DONT_OVERRIDE 0x01 +#define EFI_EDID_OVERRIDE_ENABLE_HOT_PLUG 0x02 + +/** + Returns policy information and potentially a replacement EDID for the specified video output device. + + @param This The EFI_EDID_OVERRIDE_PROTOCOL instance. + @param ChildHandle A child handle produced by the Graphics Output EFI + driver that represents a video output device. + @param Attributes The attributes associated with ChildHandle video output device. + @param EdidSize A pointer to the size, in bytes, of the Edid buffer. + @param Edid A pointer to callee allocated buffer that contains the EDID that + should be used for ChildHandle. A value of NULL + represents no EDID override for ChildHandle. + + @retval EFI_SUCCESS Valid overrides returned for ChildHandle. + @retval EFI_UNSUPPORTED ChildHandle has no overrides. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID)( + IN EFI_EDID_OVERRIDE_PROTOCOL *This, + IN EFI_HANDLE *ChildHandle, + OUT UINT32 *Attributes, + IN OUT UINTN *EdidSize, + IN OUT UINT8 **Edid + ); + +/// +/// This protocol is produced by the platform to allow the platform to provide +/// EDID information to the producer of the Graphics Output protocol. +/// +struct _EFI_EDID_OVERRIDE_PROTOCOL { + EFI_EDID_OVERRIDE_PROTOCOL_GET_EDID GetEdid; +}; + +extern EFI_GUID gEfiEdidOverrideProtocolGuid; + +#endif Modified: head/stand/efi/include/efi.h ============================================================================== --- head/stand/efi/include/efi.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efi.h Thu Jan 3 20:27:50 2019 (r342742) @@ -43,8 +43,10 @@ Revision History #include "efibind.h" #include "efidef.h" #include "efidevp.h" +#include "efipciio.h" #include "efiprot.h" #include "eficon.h" +#include "eficonsctl.h" #include "efiser.h" #include "efi_nii.h" #include "efipxebc.h" @@ -53,6 +55,11 @@ Revision History #include "efifs.h" #include "efierr.h" #include "efigop.h" +#include "efiip.h" +#include "efiudp.h" +#include "efitcp.h" +#include "efipoint.h" +#include "efiuga.h" /* * FreeBSD UUID Modified: head/stand/efi/include/efiapi.h ============================================================================== --- head/stand/efi/include/efiapi.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efiapi.h Thu Jan 3 20:27:50 2019 (r342742) @@ -218,9 +218,13 @@ VOID { 0x8BE4DF61, 0x93CA, 0x11d2, {0xAA, 0x0D, 0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C} } // Variable attributes -#define EFI_VARIABLE_NON_VOLATILE 0x00000001 -#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 -#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_NON_VOLATILE 0x00000001 +#define EFI_VARIABLE_BOOTSERVICE_ACCESS 0x00000002 +#define EFI_VARIABLE_RUNTIME_ACCESS 0x00000004 +#define EFI_VARIABLE_HARDWARE_ERROR_RECORD 0x00000008 +#define EFI_VARIABLE_AUTHENTICATED_WRITE_ACCESS 0x00000010 +#define EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS 0x00000020 +#define EFI_VARIABLE_APPEND_WRITE 0x00000040 // Variable size limitation #define EFI_MAXIMUM_VARIABLE_SIZE 1024 @@ -911,4 +915,282 @@ typedef struct _EFI_SYSTEM_TABLE { } EFI_SYSTEM_TABLE; +/* + * unlisted GUID's.. + */ +#define EFI_EBC_INTERPRETER_PROTOCOL_GUID \ +{ 0x13AC6DD1, 0x73D0, 0x11D4, {0xB0, 0x6B, 0x00, 0xAA, 0x00, 0xBD, 0x6D, 0xE7} } + +#define EFI_DRIVER_CONFIGURATION2_PROTOCOL_GUID \ +{ 0xbfd7dc1d, 0x24f1, 0x40d9, {0x82, 0xe7, 0x2e, 0x09, 0xbb, 0x6b, 0x4e, 0xbe} } + +#define EFI_DRIVER_CONFIGURATION_PROTOCOL_GUID \ +{ 0x107a772b, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_DRIVER_BINDING_PROTOCOL_GUID \ + { 0x18A031AB, 0xB443, 0x4D1A, \ + { 0xA5, 0xC0, 0x0C, 0x09, 0x26, 0x1E, 0x9F, 0x71 } \ + } + +#define EFI_TAPE_IO_PROTOCOL_GUID \ + { 0x1e93e633, 0xd65a, 0x459e, \ + { 0xab, 0x84, 0x93, 0xd9, 0xec, 0x26, 0x6d, 0x18 } \ + } + +#define EFI_SCSI_IO_PROTOCOL_GUID \ + { 0x932f47e6, 0x2362, 0x4002, \ + { 0x80, 0x3e, 0x3c, 0xd5, 0x4b, 0x13, 0x8f, 0x85 } \ + } + +#define EFI_USB2_HC_PROTOCOL_GUID \ + { 0x3e745226, 0x9818, 0x45b6, \ + { 0xa2, 0xac, 0xd7, 0xcd, 0x0e, 0x8b, 0xa2, 0xbc } \ + } + +#define EFI_DEBUG_SUPPORT_PROTOCOL_GUID \ + { 0x2755590C, 0x6F3C, 0x42FA, \ + { 0x9E, 0xA4, 0xA3, 0xBA, 0x54, 0x3C, 0xDA, 0x25 } \ + } + +#define EFI_DEBUGPORT_PROTOCOL_GUID \ + { 0xEBA4E8D2, 0x3858, 0x41EC, \ + { 0xA2, 0x81, 0x26, 0x47, 0xBA, 0x96, 0x60, 0xD0 } \ + } + +#define EFI_DECOMPRESS_PROTOCOL_GUID \ + { 0xd8117cfe, 0x94a6, 0x11d4, \ + { 0x9a, 0x3a, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } + +#define EFI_ACPI_TABLE_PROTOCOL_GUID \ + { 0xffe06bdd, 0x6107, 0x46a6, \ + { 0x7b, 0xb2, 0x5a, 0x9c, 0x7e, 0xc5, 0x27, 0x5c} \ + } + +#define EFI_HII_CONFIG_ROUTING_PROTOCOL_GUID \ + { 0x587e72d7, 0xcc50, 0x4f79, \ + { 0x82, 0x09, 0xca, 0x29, 0x1f, 0xc1, 0xa1, 0x0f } \ + } + +#define EFI_HII_DATABASE_PROTOCOL_GUID \ + { 0xef9fc172, 0xa1b2, 0x4693, \ + { 0xb3, 0x27, 0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42 } \ + } + +#define EFI_HII_STRING_PROTOCOL_GUID \ + { 0xfd96974, 0x23aa, 0x4cdc, \ + { 0xb9, 0xcb, 0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a } \ + } + +#define EFI_HII_IMAGE_PROTOCOL_GUID \ + { 0x31a6406a, 0x6bdf, 0x4e46, \ + { 0xb2, 0xa2, 0xeb, 0xaa, 0x89, 0xc4, 0x9, 0x20 } \ + } + +#define EFI_HII_FONT_PROTOCOL_GUID \ + { 0xe9ca4775, 0x8657, 0x47fc, \ + { 0x97, 0xe7, 0x7e, 0xd6, 0x5a, 0x8, 0x43, 0x24 } \ + } +#define EFI_HII_CONFIGURATION_ACCESS_PROTOCOL_GUID \ + { 0x330d4706, 0xf2a0, 0x4e4f, \ + { 0xa3, 0x69, 0xb6, 0x6f, 0xa8, 0xd5, 0x43, 0x85 } \ + } + +#define EFI_COMPONENT_NAME_PROTOCOL_GUID \ +{ 0x107a772c, 0xd5e1, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_COMPONENT_NAME2_PROTOCOL_GUID \ + { 0x6a7a5cff, 0xe8d9, 0x4f70, \ + { 0xba, 0xda, 0x75, 0xab, 0x30, 0x25, 0xce, 0x14} \ + } + +#define EFI_USB_IO_PROTOCOL_GUID \ + { 0x2B2F68D6, 0x0CD2, 0x44cf, \ + { 0x8E, 0x8B, 0xBB, 0xA2, 0x0B, 0x1B, 0x5B, 0x75 } \ + } +#define EFI_HCDP_TABLE_GUID \ + { 0xf951938d, 0x620b, 0x42ef, \ + { 0x82, 0x79, 0xa8, 0x4b, 0x79, 0x61, 0x78, 0x98 } \ + } + +#define EFI_DEVICE_TREE_GUID \ + { 0xb1b621d5, 0xf19c, 0x41a5, \ + { 0x83, 0x0b, 0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0 } \ + } + +#define EFI_VENDOR_APPLE_GUID \ + { 0x2B0585EB, 0xD8B8, 0x49A9, \ + { 0x8B, 0x8C, 0xE2, 0x1B, 0x01, 0xAE, 0xF2, 0xB7 } \ + } + +#define EFI_CONSOLE_IN_DEVICE_GUID \ +{ 0xd3b36f2b, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_CONSOLE_OUT_DEVICE_GUID \ +{ 0xd3b36f2c, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_STANDARD_ERROR_DEVICE_GUID \ +{ 0xd3b36f2d, 0xd551, 0x11d4, {0x9a, 0x46, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_UNICODE_COLLATION2_PROTOCOL_GUID \ +{ 0xa4c751fc, 0x23ae, 0x4c3e, {0x92, 0xe9, 0x49, 0x64, 0xcf, 0x63, 0xf3, 0x49} } + +#define EFI_FORM_BROWSER2_PROTOCOL_GUID \ +{ 0xb9d4c360, 0xbcfb, 0x4f9b, {0x92, 0x98, 0x53, 0xc1, 0x36, 0x98, 0x22, 0x58} } + +#define EFI_ARP_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xf44c00ee, 0x1f2c, 0x4a00, {0xaa, 0x9, 0x1c, 0x9f, 0x3e, 0x8, 0x0, 0xa3} } + +#define EFI_ARP_PROTOCOL_GUID \ +{ 0xf4b427bb, 0xba21, 0x4f16, {0xbc, 0x4e, 0x43, 0xe4, 0x16, 0xab, 0x61, 0x9c} } + +#define EFI_IP4_CONFIG_PROTOCOL_GUID \ +{ 0x3b95aa31, 0x3793, 0x434b, {0x86, 0x67, 0xc8, 0x07, 0x08, 0x92, 0xe0, 0x5e} } + +#define EFI_IP6_CONFIG_PROTOCOL_GUID \ +{ 0x937fe521, 0x95ae, 0x4d1a, {0x89, 0x29, 0x48, 0xbc, 0xd9, 0x0a, 0xd3, 0x1a} } + +#define EFI_MANAGED_NETWORK_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xf36ff770, 0xa7e1, 0x42cf, {0x9e, 0xd2, 0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c} } + +#define EFI_MANAGED_NETWORK_PROTOCOL_GUID \ +{ 0x7ab33a91, 0xace5, 0x4326, {0xb5, 0x72, 0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16} } + +#define EFI_MTFTP4_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x2FE800BE, 0x8F01, 0x4aa6, {0x94, 0x6B, 0xD7, 0x13, 0x88, 0xE1, 0x83, 0x3F} } + +#define EFI_MTFTP4_PROTOCOL_GUID \ +{ 0x78247c57, 0x63db, 0x4708, {0x99, 0xc2, 0xa8, 0xb4, 0xa9, 0xa6, 0x1f, 0x6b} } + +#define EFI_MTFTP6_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0xd9760ff3, 0x3cca, 0x4267, {0x80, 0xf9, 0x75, 0x27, 0xfa, 0xfa, 0x42, 0x23} } + +#define EFI_MTFTP6_PROTOCOL_GUID \ +{ 0xbf0a78ba, 0xec29, 0x49cf, {0xa1, 0xc9, 0x7a, 0xe5, 0x4e, 0xab, 0x6a, 0x51} } + +#define EFI_DHCP4_PROTOCOL_GUID \ +{ 0x8a219718, 0x4ef5, 0x4761, {0x91, 0xc8, 0xc0, 0xf0, 0x4b, 0xda, 0x9e, 0x56} } + +#define EFI_DHCP4_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x9d9a39d8, 0xbd42, 0x4a73, {0xa4, 0xd5, 0x8e, 0xe9, 0x4b, 0xe1, 0x13, 0x80} } + +#define EFI_DHCP6_SERVICE_BINDING_PROTOCOL_GUID \ +{ 0x9fb9a8a1, 0x2f4a, 0x43a6, {0x88, 0x9c, 0xd0, 0xf7, 0xb6, 0xc4, 0x7a, 0xd5} } + +#define EFI_DHCP6_PROTOCOL_GUID \ +{ 0x87c8bad7, 0x595, 0x4053, {0x82, 0x97, 0xde, 0xde, 0x39, 0x5f, 0x5d, 0x5b} } + +#define EFI_SCSI_PASS_THRU_PROTOCOL_GUID \ +{ 0xa59e8fcf, 0xbda0, 0x43bb, {0x90, 0xb1, 0xd3, 0x73, 0x2e, 0xca, 0xa8, 0x77} } + +#define EFI_EXT_SCSI_PASS_THRU_PROTOCOL_GUID \ +{ 0x143b7632, 0xb81b, 0x4cb7, {0xab, 0xd3, 0xb6, 0x25, 0xa5, 0xb9, 0xbf, 0xfe} } + +#define EFI_DISK_INFO_PROTOCOL_GUID \ +{ 0xd432a67f, 0x14dc, 0x484b, {0xb3, 0xbb, 0x3f, 0x2, 0x91, 0x84, 0x93, 0x27} } + +#define EFI_ISA_IO_PROTOCOL_GUID \ +{ 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_VLAN_CONFIG_PROTOCOL_GUID \ +{ 0x9e23d768, 0xd2f3, 0x4366, {0x9f, 0xc3, 0x3a, 0x7a, 0xba, 0x86, 0x43, 0x74} } + +#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \ +{ 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9} } + +#define EFI_ISA_ACPI_PROTOCOL_GUID \ +{ 0x64a892dc, 0x5561, 0x4536, {0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55} } + +#define EFI_PCI_ENUMERATION_COMPLETE_GUID \ +{ 0x30cfe3e7, 0x3de1, 0x4586, {0xbe, 0x20, 0xde, 0xab, 0xa1, 0xb3, 0xb7, 0x93} } + +#define EFI_DRIVER_DIAGNOSTICS_PROTOCOL_GUID \ +{ 0x0784924f, 0xe296, 0x11d4, {0x9a, 0x49, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } } + +#define EFI_DRIVER_DIAGNOSTICS2_PROTOCOL_GUID \ +{ 0x4d330321, 0x025f, 0x4aac, {0x90, 0xd8, 0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63} } + +#define EFI_CAPSULE_ARCH_PROTOCOL_GUID \ +{ 0x5053697e, 0x2cbc, 0x4819, {0x90, 0xd9, 0x05, 0x80, 0xde, 0xee, 0x57, 0x54} } + +#define EFI_MONOTONIC_COUNTER_ARCH_PROTOCOL_GUID \ +{0x1da97072, 0xbddc, 0x4b30, {0x99, 0xf1, 0x72, 0xa0, 0xb5, 0x6f, 0xff, 0x2a} } + +#define EFI_REALTIME_CLOCK_ARCH_PROTOCOL_GUID \ +{0x27cfac87, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_MP_SERVICES_PROTOCOL_GUID \ +{ 0x3fdda605, 0xa76e, 0x4f46, {0xad, 0x29, 0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08} } + +#define EFI_VARIABLE_ARCH_PROTOCOL_GUID \ +{ 0x1e5668e2, 0x8481, 0x11d4, {0xbc, 0xf1, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_VARIABLE_WRITE_ARCH_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_WATCHDOG_TIMER_ARCH_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_ACPI_SUPPORT_PROTOCOL_GUID \ +{ 0x6441f818, 0x6362, 0x4e44, {0xb5, 0x70, 0x7d, 0xba, 0x31, 0xdd, 0x24, 0x53} } + +#define EFI_BDS_ARCH_PROTOCOL_GUID \ +{ 0x665e3ff6, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_METRONOME_ARCH_PROTOCOL_GUID \ +{ 0x26baccb2, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_TIMER_ARCH_PROTOCOL_GUID \ +{ 0x26baccb3, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_DPC_PROTOCOL_GUID \ +{ 0x480f8ae9, 0xc46, 0x4aa9, { 0xbc, 0x89, 0xdb, 0x9f, 0xba, 0x61, 0x98, 0x6} } + +#define EFI_PRINT2_PROTOCOL_GUID \ +{ 0xf05976ef, 0x83f1, 0x4f3d, {0x86, 0x19, 0xf7, 0x59, 0x5d, 0x41, 0xe5, 0x38} } + +#define EFI_RESET_ARCH_PROTOCOL_GUID \ +{ 0x27cfac88, 0x46cc, 0x11d4, {0x9a, 0x38, 0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d} } + +#define EFI_CPU_ARCH_PROTOCOL_GUID \ +{ 0x26baccb1, 0x6f42, 0x11d4, {0xbc, 0xe7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } } + +#define EFI_CPU_IO2_PROTOCOL_GUID \ +{ 0xad61f191, 0xae5f, 0x4c0e, {0xb9, 0xfa, 0xe8, 0x69, 0xd2, 0x88, 0xc6, 0x4f} } + +#define EFI_LEGACY_8259_PROTOCOL_GUID \ +{ 0x38321dba, 0x4fe0, 0x4e17, {0x8a, 0xec, 0x41, 0x30, 0x55, 0xea, 0xed, 0xc1} } + +#define EFI_SECURITY_ARCH_PROTOCOL_GUID \ +{ 0xa46423e3, 0x4617, 0x49f1, {0xb9, 0xff, 0xd1, 0xbf, 0xa9, 0x11, 0x58, 0x39} } + +#define EFI_SECURITY2_ARCH_PROTOCOL_GUID \ +{ 0x94ab2f58, 0x1438, 0x4ef1, {0x91, 0x52, 0x18, 0x94, 0x1a, 0x3a, 0x0e, 0x68} } + +#define EFI_RUNTIME_ARCH_PROTOCOL_GUID \ +{ 0xb7dfb4e1, 0x52f, 0x449f, {0x87, 0xbe, 0x98, 0x18, 0xfc, 0x91, 0xb7, 0x33} } + +#define EFI_STATUS_CODE_RUNTIME_PROTOCOL_GUID \ +{ 0xd2b2b828, 0x826, 0x48a7, {0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24, 0xf0} } + +#define EFI_DATA_HUB_PROTOCOL_GUID \ +{ 0xae80d021, 0x618e, 0x11d4, {0xbc, 0xd7, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} } + +#define PCD_PROTOCOL_GUID \ +{ 0x11b34006, 0xd85b, 0x4d0a, { 0xa2, 0x90, 0xd5, 0xa5, 0x71, 0x31, 0xe, 0xf7} } + +#define EFI_PCD_PROTOCOL_GUID \ +{ 0x13a3f0f6, 0x264a, 0x3ef0, {0xf2, 0xe0, 0xde, 0xc5, 0x12, 0x34, 0x2f, 0x34} } + +#define EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL_GUID \ +{ 0x8f644fa9, 0xe850, 0x4db1, {0x9c, 0xe2, 0xb, 0x44, 0x69, 0x8e, 0x8d, 0xa4 } } + +#define EFI_FIRMWARE_VOLUME2_PROTOCOL_GUID \ +{ 0x220e73b6, 0x6bdb, 0x4413, { 0x84, 0x5, 0xb9, 0x74, 0xb1, 0x8, 0x61, 0x9a } } + +#define EFI_FIRMWARE_VOLUME_DISPATCH_PROTOCOL_GUID \ +{ 0x7aa35a69, 0x506c, 0x444f, {0xa7, 0xaf, 0x69, 0x4b, 0xf5, 0x6f, 0x71, 0xc8} } + +#define LZMA_COMPRESS_GUID \ +{ 0xee4e5898, 0x3914, 0x4259, {0x9d, 0x6e, 0xdc, 0x7b, 0xd7, 0x94, 0x03, 0xcf} } #endif Modified: head/stand/efi/include/eficon.h ============================================================================== --- head/stand/efi/include/eficon.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/eficon.h Thu Jan 3 20:27:50 2019 (r342742) @@ -263,29 +263,57 @@ typedef struct { // Scan codes for base line keys // -#define SCAN_NULL 0x0000 -#define SCAN_UP 0x0001 -#define SCAN_DOWN 0x0002 -#define SCAN_RIGHT 0x0003 -#define SCAN_LEFT 0x0004 -#define SCAN_HOME 0x0005 -#define SCAN_END 0x0006 -#define SCAN_INSERT 0x0007 -#define SCAN_DELETE 0x0008 -#define SCAN_PAGE_UP 0x0009 -#define SCAN_PAGE_DOWN 0x000A -#define SCAN_F1 0x000B -#define SCAN_F2 0x000C -#define SCAN_F3 0x000D -#define SCAN_F4 0x000E -#define SCAN_F5 0x000F -#define SCAN_F6 0x0010 -#define SCAN_F7 0x0011 -#define SCAN_F8 0x0012 -#define SCAN_F9 0x0013 -#define SCAN_F10 0x0014 -#define SCAN_ESC 0x0017 +#define SCAN_NULL 0x0000 +#define SCAN_UP 0x0001 +#define SCAN_DOWN 0x0002 +#define SCAN_RIGHT 0x0003 +#define SCAN_LEFT 0x0004 +#define SCAN_HOME 0x0005 +#define SCAN_END 0x0006 +#define SCAN_INSERT 0x0007 +#define SCAN_DELETE 0x0008 +#define SCAN_PAGE_UP 0x0009 +#define SCAN_PAGE_DOWN 0x000A +#define SCAN_F1 0x000B +#define SCAN_F2 0x000C +#define SCAN_F3 0x000D +#define SCAN_F4 0x000E +#define SCAN_F5 0x000F +#define SCAN_F6 0x0010 +#define SCAN_F7 0x0011 +#define SCAN_F8 0x0012 +#define SCAN_F9 0x0013 +#define SCAN_F10 0x0014 +#define SCAN_ESC 0x0017 +// +// EFI Scan code Ex +// +#define SCAN_F11 0x0015 +#define SCAN_F12 0x0016 +#define SCAN_F13 0x0068 +#define SCAN_F14 0x0069 +#define SCAN_F15 0x006A +#define SCAN_F16 0x006B +#define SCAN_F17 0x006C +#define SCAN_F18 0x006D +#define SCAN_F19 0x006E +#define SCAN_F20 0x006F +#define SCAN_F21 0x0070 +#define SCAN_F22 0x0071 +#define SCAN_F23 0x0072 +#define SCAN_F24 0x0073 +#define SCAN_MUTE 0x007F +#define SCAN_VOLUME_UP 0x0080 +#define SCAN_VOLUME_DOWN 0x0081 +#define SCAN_BRIGHTNESS_UP 0x0100 +#define SCAN_BRIGHTNESS_DOWN 0x0101 +#define SCAN_SUSPEND 0x0102 +#define SCAN_HIBERNATE 0x0103 +#define SCAN_TOGGLE_DISPLAY 0x0104 +#define SCAN_RECOVERY 0x0105 +#define SCAN_EJECT 0x0106 + typedef EFI_STATUS (EFIAPI *EFI_INPUT_RESET) ( @@ -305,5 +333,195 @@ typedef struct _SIMPLE_INPUT_INTERFACE { EFI_INPUT_READ_KEY ReadKeyStroke; EFI_EVENT WaitForKey; } SIMPLE_INPUT_INTERFACE; + +#define EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL_GUID \ + {0xdd9e7534, 0x7762, 0x4698, {0x8c, 0x14, 0xf5, 0x85, \ + 0x17, 0xa6, 0x25, 0xaa} } + +INTERFACE_DECL(_EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL); + +typedef UINT8 EFI_KEY_TOGGLE_STATE; +// +// Any Shift or Toggle State that is valid should have +// high order bit set. +// +typedef struct EFI_KEY_STATE { + UINT32 KeyShiftState; + EFI_KEY_TOGGLE_STATE KeyToggleState; +} EFI_KEY_STATE; + +typedef struct { + EFI_INPUT_KEY Key; + EFI_KEY_STATE KeyState; +} EFI_KEY_DATA; + +// +// Shift state +// +#define EFI_SHIFT_STATE_VALID 0x80000000 +#define EFI_RIGHT_SHIFT_PRESSED 0x00000001 +#define EFI_LEFT_SHIFT_PRESSED 0x00000002 +#define EFI_RIGHT_CONTROL_PRESSED 0x00000004 +#define EFI_LEFT_CONTROL_PRESSED 0x00000008 +#define EFI_RIGHT_ALT_PRESSED 0x00000010 +#define EFI_LEFT_ALT_PRESSED 0x00000020 +#define EFI_RIGHT_LOGO_PRESSED 0x00000040 +#define EFI_LEFT_LOGO_PRESSED 0x00000080 +#define EFI_MENU_KEY_PRESSED 0x00000100 +#define EFI_SYS_REQ_PRESSED 0x00000200 + +// +// Toggle state +// +#define EFI_TOGGLE_STATE_VALID 0x80 +#define EFI_KEY_STATE_EXPOSED 0x40 +#define EFI_SCROLL_LOCK_ACTIVE 0x01 +#define EFI_NUM_LOCK_ACTIVE 0x02 +#define EFI_CAPS_LOCK_ACTIVE 0x04 + +// +// EFI Key Notfication Function +// +typedef +EFI_STATUS +(EFIAPI *EFI_KEY_NOTIFY_FUNCTION) ( + IN EFI_KEY_DATA *KeyData + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_RESET_EX) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN BOOLEAN ExtendedVerification + ) +/*++ + + Routine Description: + Reset the input device and optionaly run diagnostics + + Arguments: + This - Protocol instance pointer. + ExtendedVerification - Driver may perform diagnostics on reset. + + Returns: + EFI_SUCCESS - The device was reset. + EFI_DEVICE_ERROR - The device is not functioning properly and could + not be reset. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_INPUT_READ_KEY_EX) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + OUT EFI_KEY_DATA *KeyData + ) +/*++ + + Routine Description: + Reads the next keystroke from the input device. The WaitForKey Event can + be used to test for existance of a keystroke via WaitForEvent () call. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + state data for the key that was pressed. + + Returns: + EFI_SUCCESS - The keystroke information was returned. + EFI_NOT_READY - There was no keystroke data availiable. + EFI_DEVICE_ERROR - The keystroke information was not returned due to + hardware errors. + EFI_INVALID_PARAMETER - KeyData is NULL. +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_STATE) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_TOGGLE_STATE *KeyToggleState + ) +/*++ + + Routine Description: + Set certain state for the input device. + + Arguments: + This - Protocol instance pointer. + KeyToggleState - A pointer to the EFI_KEY_TOGGLE_STATE to set the + state for the input device. + + Returns: + EFI_SUCCESS - The device state was set successfully. + EFI_DEVICE_ERROR - The device is not functioning correctly and could + not have the setting adjusted. + EFI_UNSUPPORTED - The device does not have the ability to set its state. + EFI_INVALID_PARAMETER - KeyToggleState is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_REGISTER_KEYSTROKE_NOTIFY) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_KEY_DATA *KeyData, + IN EFI_KEY_NOTIFY_FUNCTION KeyNotificationFunction, + OUT EFI_HANDLE *NotifyHandle + ) +/*++ + + Routine Description: + Register a notification function for a particular keystroke for the input device. + + Arguments: + This - Protocol instance pointer. + KeyData - A pointer to a buffer that is filled in with the keystroke + information data for the key that was pressed. + KeyNotificationFunction - Points to the function to be called when the key + sequence is typed specified by KeyData. + NotifyHandle - Points to the unique handle assigned to the registered notification. + + Returns: + EFI_SUCCESS - The notification function was registered successfully. + EFI_OUT_OF_RESOURCES - Unable to allocate resources for necesssary data structures. + EFI_INVALID_PARAMETER - KeyData or NotifyHandle is NULL. + +--*/ +; + +typedef +EFI_STATUS +(EFIAPI *EFI_UNREGISTER_KEYSTROKE_NOTIFY) ( + IN struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL *This, + IN EFI_HANDLE NotificationHandle + ) +/*++ + + Routine Description: + Remove a registered notification function from a particular keystroke. + + Arguments: + This - Protocol instance pointer. + NotificationHandle - The handle of the notification function being unregistered. + + Returns: + EFI_SUCCESS - The notification function was unregistered successfully. + EFI_INVALID_PARAMETER - The NotificationHandle is invalid. + EFI_NOT_FOUND - Can not find the matching entry in database. + +--*/ +; + +typedef struct _EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL { + EFI_INPUT_RESET_EX Reset; + EFI_INPUT_READ_KEY_EX ReadKeyStrokeEx; + EFI_EVENT WaitForKeyEx; + EFI_SET_STATE SetState; + EFI_REGISTER_KEYSTROKE_NOTIFY RegisterKeyNotify; + EFI_UNREGISTER_KEYSTROKE_NOTIFY UnregisterKeyNotify; +} EFI_SIMPLE_TEXT_INPUT_EX_PROTOCOL; #endif Modified: head/stand/efi/include/efidef.h ============================================================================== --- head/stand/efi/include/efidef.h Thu Jan 3 20:23:12 2019 (r342741) +++ head/stand/efi/include/efidef.h Thu Jan 3 20:27:50 2019 (r342742) @@ -121,6 +121,19 @@ typedef struct { UINT8 Addr[32]; } EFI_MAC_ADDRESS; +typedef struct { + UINT32 ReceivedQueueTimeoutValue; + UINT32 TransmitQueueTimeoutValue; + UINT16 ProtocolTypeFilter; + BOOLEAN EnableUnicastReceive; + BOOLEAN EnableMulticastReceive; + BOOLEAN EnableBroadcastReceive; + BOOLEAN EnablePromiscuousReceive; + BOOLEAN FlushQueuesOnReset; + BOOLEAN EnableReceiveTimestamps; + BOOLEAN DisableBackgroundPolling; +} EFI_MANAGED_NETWORK_CONFIG_DATA; + // // Memory // Added: head/stand/efi/include/efigpt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/efigpt.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,69 @@ +/* $FreeBSD$ */ +#ifndef _EFI_GPT_H +#define _EFI_GPT_H +/*++ + +Copyright (c) 1998 Intel Corporation + +Module Name: + + EfiGpt.h + +Abstract: + Include file for EFI partitioning scheme + + + +Revision History + +--*/ + +#define PRIMARY_PART_HEADER_LBA 1 + +typedef struct { + EFI_TABLE_HEADER Header; + EFI_LBA MyLBA; + EFI_LBA AlternateLBA; + EFI_LBA FirstUsableLBA; + EFI_LBA LastUsableLBA; + EFI_GUID DiskGUID; + EFI_LBA PartitionEntryLBA; + UINT32 NumberOfPartitionEntries; + UINT32 SizeOfPartitionEntry; + UINT32 PartitionEntryArrayCRC32; +} EFI_PARTITION_TABLE_HEADER; + +#define EFI_PTAB_HEADER_ID "EFI PART" + +typedef struct { + EFI_GUID PartitionTypeGUID; + EFI_GUID UniquePartitionGUID; + EFI_LBA StartingLBA; + EFI_LBA EndingLBA; + UINT64 Attributes; + CHAR16 PartitionName[36]; +} EFI_PARTITION_ENTRY; + +// +// EFI Partition Attributes +// +#define EFI_PART_USED_BY_EFI 0x0000000000000001 +#define EFI_PART_REQUIRED_TO_FUNCTION 0x0000000000000002 +#define EFI_PART_USED_BY_OS 0x0000000000000004 +#define EFI_PART_REQUIRED_BY_OS 0x0000000000000008 +#define EFI_PART_BACKUP_REQUIRED 0x0000000000000010 +#define EFI_PART_USER_DATA 0x0000000000000020 +#define EFI_PART_CRITICAL_USER_DATA 0x0000000000000040 +#define EFI_PART_REDUNDANT_PARTITION 0x0000000000000080 + +#define EFI_PART_TYPE_UNUSED_GUID \ + { 0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00} } + +#define EFI_PART_TYPE_EFI_SYSTEM_PART_GUID \ + { 0xc12a7328, 0xf81f, 0x11d2, {0xba, 0x4b, 0x00, 0xa0, 0xc9, 0x3e, 0xc9, 0x3b} } + +#define EFI_PART_TYPE_LEGACY_MBR_GUID \ + { 0x024dee41, 0x33e7, 0x11d3, {0x9d, 0x69, 0x00, 0x08, 0xc7, 0x81, 0xf3, 0x9f} } + +#endif + Added: head/stand/efi/include/efiip.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/stand/efi/include/efiip.h Thu Jan 3 20:27:50 2019 (r342742) @@ -0,0 +1,460 @@ +/* $FreeBSD$ */ +#ifndef _EFI_IP_H +#define _EFI_IP_H + +/*++ +Copyright (c) 2013 Intel Corporation + +--*/ + +#define EFI_IP4_SERVICE_BINDING_PROTOCOL \ + {0xc51711e7,0xb4bf,0x404a,{0xbf,0xb8,0x0a,0x04, 0x8e,0xf1,0xff,0xe4}} + +#define EFI_IP4_PROTOCOL \ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Jan 3 21:31:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8131A14381DB; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2183C6A4EB; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 15B1C27120; Thu, 3 Jan 2019 21:31:18 +0000 (UTC) (envelope-from romain@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03LVHg6010374; Thu, 3 Jan 2019 21:31:17 GMT (envelope-from romain@FreeBSD.org) Received: (from romain@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03LVHvj010372; Thu, 3 Jan 2019 21:31:17 GMT (envelope-from romain@FreeBSD.org) Message-Id: <201901032131.x03LVHvj010372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: romain set sender to romain@FreeBSD.org using -f From: =?UTF-8?Q?Romain_Tarti=c3=a8re?= Date: Thu, 3 Jan 2019 21:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342743 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: romain X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 342743 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2183C6A4EB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 21:31:18 -0000 Author: romain (ports committer) Date: Thu Jan 3 21:31:17 2019 New Revision: 342743 URL: https://svnweb.freebsd.org/changeset/base/342743 Log: Add man page for dlvsym(3) Add a short description of the function to the appropriate man page and add reference to it where it makes sense. Reviewed by: bcr, markj, 0mp Approved by: markj Differential Revision: https://reviews.freebsd.org/D18725 Modified: head/lib/libc/gen/Makefile.inc head/lib/libc/gen/dlopen.3 Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu Jan 3 20:27:50 2019 (r342742) +++ head/lib/libc/gen/Makefile.inc Thu Jan 3 21:31:17 2019 (r342743) @@ -339,7 +339,8 @@ MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 + dlopen.3 dlsym.3 \ + dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Thu Jan 3 20:27:50 2019 (r342742) +++ head/lib/libc/gen/dlopen.3 Thu Jan 3 21:31:17 2019 (r342743) @@ -32,13 +32,14 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , +.Nm dlvsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose @@ -53,6 +54,8 @@ .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" +.Ft void * +.Fn dlvsym "void * restrict handle" "const char * restrict symbol" "const char * restrict version" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * @@ -74,7 +77,8 @@ provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to -.Fn dlsym +.Fn dlsym , +.Fn dlvsym and .Fn dlclose . If @@ -300,6 +304,16 @@ condition which may be queried with .Fn dlerror . .Pp The +.Fn dlvsym +function behaves like +.Fn dlsym , +but takes an extra argument +.Fa version : +a null-terminated character string which is used to request a specific version +of +.Fa symbol . +.Pp +The .Fn dlfunc function implements all of the behavior of @@ -328,6 +342,7 @@ occurred during a call to .Fn dladdr , .Fn dlinfo , .Fn dlsym , +.Fn dlvsym , .Fn dlfunc , or .Fn dlclose . @@ -375,7 +390,10 @@ using the option to .Xr ld 1 for symbols defined in the executable to become visible to -.Fn dlsym . +.Fn dlsym , +.Fn dlvsym +or +.Fn dlfunc .Pp Other ELF platforms require linking with .Lb libdl @@ -397,6 +415,7 @@ The .Fn dlopen , .Fn fdlopen , .Fn dlsym , +.Fn dlvsym , and .Fn dlfunc functions From owner-svn-src-head@freebsd.org Thu Jan 3 22:49:12 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF6B6143A166; Thu, 3 Jan 2019 22:49:12 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 705C46D17C; Thu, 3 Jan 2019 22:49:12 +0000 (UTC) (envelope-from mmacy@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5B4C27D89; Thu, 3 Jan 2019 22:49:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03MnBa8050421; Thu, 3 Jan 2019 22:49:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03MnBtG050420; Thu, 3 Jan 2019 22:49:11 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901032249.x03MnBtG050420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 3 Jan 2019 22:49:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342747 - head/sys/cddl/boot/zfs X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/cddl/boot/zfs X-SVN-Commit-Revision: 342747 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 705C46D17C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 22:49:13 -0000 Author: mmacy Date: Thu Jan 3 22:49:11 2019 New Revision: 342747 URL: https://svnweb.freebsd.org/changeset/base/342747 Log: zfsboot: support newer ZFS versions declare v3 objset size/layout to fix userboot and possibly other loader issues - fix for userboot assertion failure in zfs_dev_close in free due to out of bounds write - fix for zfs_alloc / zfs_free mismatch assertion failure when booting GPT on BIOS Modified: head/sys/cddl/boot/zfs/zfsimpl.h Modified: head/sys/cddl/boot/zfs/zfsimpl.h ============================================================================== --- head/sys/cddl/boot/zfs/zfsimpl.h Thu Jan 3 22:48:59 2019 (r342746) +++ head/sys/cddl/boot/zfs/zfsimpl.h Thu Jan 3 22:49:11 2019 (r342747) @@ -1121,6 +1121,8 @@ typedef struct sa_hdr_phys { #define SA_PARENT_OFFSET 40 #define SA_SYMLINK_OFFSET 160 +#define ZIO_OBJSET_MAC_LEN 32 + /* * Intent log header - this on disk structure holds fields to manage * the log. All fields are 64 bit to easily handle cross architectures. @@ -1133,17 +1135,24 @@ typedef struct zil_header { uint64_t zh_pad[5]; } zil_header_t; -#define OBJSET_PHYS_SIZE 2048 +#define OBJSET_PHYS_SIZE_V2 2048 +#define OBJSET_PHYS_SIZE_V3 4096 typedef struct objset_phys { dnode_phys_t os_meta_dnode; zil_header_t os_zil_header; uint64_t os_type; uint64_t os_flags; - char os_pad[OBJSET_PHYS_SIZE - sizeof (dnode_phys_t)*3 - - sizeof (zil_header_t) - sizeof (uint64_t)*2]; + uint8_t os_portable_mac[ZIO_OBJSET_MAC_LEN]; + uint8_t os_local_mac[ZIO_OBJSET_MAC_LEN]; + char os_pad0[OBJSET_PHYS_SIZE_V2 - sizeof (dnode_phys_t)*3 - + sizeof (zil_header_t) - sizeof (uint64_t)*2 - + 2*ZIO_OBJSET_MAC_LEN]; dnode_phys_t os_userused_dnode; dnode_phys_t os_groupused_dnode; + dnode_phys_t os_projectused_dnode; + char os_pad1[OBJSET_PHYS_SIZE_V3 - OBJSET_PHYS_SIZE_V2 - + sizeof (dnode_phys_t)]; } objset_phys_t; typedef struct dsl_dir_phys { From owner-svn-src-head@freebsd.org Thu Jan 3 23:06:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E663A143AA62; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 510446DE96; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AEEF280E1; Thu, 3 Jan 2019 23:06:06 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x03N65MQ060674; Thu, 3 Jan 2019 23:06:05 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x03N65bN060673; Thu, 3 Jan 2019 23:06:05 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901032306.x03N65bN060673@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 3 Jan 2019 23:06:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342749 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 342749 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 510446DE96 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.979,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 03 Jan 2019 23:06:07 -0000 Author: mmacy Date: Thu Jan 3 23:06:05 2019 New Revision: 342749 URL: https://svnweb.freebsd.org/changeset/base/342749 Log: mp_ring: avoid items offset difference between iflib and mp_ring on architectures without 64-bit atomics Reported by: Augustin Cavalier Modified: head/sys/net/mp_ring.c head/sys/net/mp_ring.h Modified: head/sys/net/mp_ring.c ============================================================================== --- head/sys/net/mp_ring.c Thu Jan 3 22:51:14 2019 (r342748) +++ head/sys/net/mp_ring.c Thu Jan 3 23:06:05 2019 (r342749) @@ -37,10 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#if defined(__powerpc__) || defined(__mips__) || defined(__i386__) -#define NO_64BIT_ATOMICS -#endif - #if defined(__i386__) #define atomic_cmpset_acq_64 atomic_cmpset_64 #define atomic_cmpset_rel_64 atomic_cmpset_64 @@ -101,7 +97,7 @@ state_to_flags(union ring_state s, int abdicate) return (BUSY); } -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS static void drain_ring_locked(struct ifmp_ring *r, union ring_state os, uint16_t prev, int budget) { @@ -291,7 +287,7 @@ ifmp_ring_alloc(struct ifmp_ring **pr, int size, void } *pr = r; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS mtx_init(&r->lock, "mp_ring lock", NULL, MTX_DEF); #endif return (0); @@ -325,7 +321,7 @@ ifmp_ring_free(struct ifmp_ring *r) * * Returns an errno. */ -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS int ifmp_ring_enqueue(struct ifmp_ring *r, void **items, int n, int budget, int abdicate) { @@ -503,7 +499,7 @@ ifmp_ring_check_drainage(struct ifmp_ring *r, int budg ns.flags = BUSY; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS mtx_lock(&r->lock); if (r->state != os.state) { mtx_unlock(&r->lock); Modified: head/sys/net/mp_ring.h ============================================================================== --- head/sys/net/mp_ring.h Thu Jan 3 22:51:14 2019 (r342748) +++ head/sys/net/mp_ring.h Thu Jan 3 23:06:05 2019 (r342749) @@ -40,6 +40,10 @@ typedef u_int (*mp_ring_drain_t)(struct ifmp_ring *, u typedef u_int (*mp_ring_can_drain_t)(struct ifmp_ring *); typedef void (*mp_ring_serial_t)(struct ifmp_ring *); +#if defined(__powerpc__) || defined(__mips__) || defined(__i386__) +#define MP_RING_NO_64BIT_ATOMICS +#endif + struct ifmp_ring { volatile uint64_t state __aligned(CACHE_LINE_SIZE); @@ -54,7 +58,7 @@ struct ifmp_ring { counter_u64_t stalls; counter_u64_t restarts; /* recovered after stalling */ counter_u64_t abdications; -#ifdef NO_64BIT_ATOMICS +#ifdef MP_RING_NO_64BIT_ATOMICS struct mtx lock; #endif void * volatile items[] __aligned(CACHE_LINE_SIZE); From owner-svn-src-head@freebsd.org Fri Jan 4 02:48:44 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4CAAD143FDC0; Fri, 4 Jan 2019 02:48:44 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF67474EFF; Fri, 4 Jan 2019 02:48:43 +0000 (UTC) (envelope-from allanjude@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA7862A5A6; Fri, 4 Jan 2019 02:48:43 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x042mhql078285; Fri, 4 Jan 2019 02:48:43 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x042mhOV078284; Fri, 4 Jan 2019 02:48:43 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201901040248.x042mhOV078284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Fri, 4 Jan 2019 02:48:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342754 - head/usr.bin/lam X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/usr.bin/lam X-SVN-Commit-Revision: 342754 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BF67474EFF X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 02:48:44 -0000 Author: allanjude Date: Fri Jan 4 02:48:43 2019 New Revision: 342754 URL: https://svnweb.freebsd.org/changeset/base/342754 Log: The lam(1) man page is unclear about the uppercase versions of the flags PR: 229571 Submitted by: Tim Chase Modified: head/usr.bin/lam/lam.1 Modified: head/usr.bin/lam/lam.1 ============================================================================== --- head/usr.bin/lam/lam.1 Fri Jan 4 02:21:00 2019 (r342753) +++ head/usr.bin/lam/lam.1 Fri Jan 4 02:48:43 2019 (r342754) @@ -58,14 +58,8 @@ are considered fragments of the single long output line into which they are assembled. The name `\fB\-\fP' means the standard input, and may be repeated. .Pp -Normally, each option affects only the -.Ar file -after it. -If the option letter is capitalized it affects all subsequent files -until it appears again uncapitalized. -The options are described below: .Bl -tag -width indent -.It Fl f Ar min . Ns Ar max +.It Fl f Ar min . Ns Ar max , Fl F Ar min . Ns Ar max Print line fragments according to the format string .Ar min . Ns Ar max , where @@ -78,21 +72,41 @@ If begins with a zero, zeros will be added to make up the field width, and if it begins with a `\-', the fragment will be left-adjusted within the field. -.It Fl p Ar min . Ns Ar max +Using +.Fl f +applies only to the next file while +.Fl F +applies to all subsequent files until it appears again uncapitalized. +.It Fl p Ar min . Ns Ar max , Fl P Ar min . Ns Ar max Like .Fl f , but pad this file's field when end-of-file is reached and other files are still active. -.It Fl s Ar sepstring +Using +.Fl p +applies only to the next file while +.Fl P +applies to all subsequent files until it appears again uncapitalized. +.It Fl s Ar sepstring , Fl S Ar sepstring Print .Ar sepstring before printing line fragments from the next file. This option may appear after the last file. -.It Fl t Ar c +Using +.Fl s +applies only to the next file while +.Fl S +applies to all subsequent files until it appears again uncapitalized. +.It Fl t Ar c , Fl T Ar c The input line terminator is .Ar c instead of a newline. The newline normally appended to each output line is omitted. +Using +.Fl t +applies only to the next file while +.Fl T +applies to all subsequent files until it appears again uncapitalized. .El .Pp To print files simultaneously for easy viewing use From owner-svn-src-head@freebsd.org Fri Jan 4 03:13:25 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B564114409C2; Fri, 4 Jan 2019 03:13:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 59959763CE; Fri, 4 Jan 2019 03:13:25 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4646A2AB50; Fri, 4 Jan 2019 03:13:25 +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 x043DPUj094939; Fri, 4 Jan 2019 03:13:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x043DPFm094938; Fri, 4 Jan 2019 03:13:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901040313.x043DPFm094938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Fri, 4 Jan 2019 03:13:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342757 - head/lib/libc/stdlib X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/stdlib X-SVN-Commit-Revision: 342757 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 59959763CE X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 03:13:25 -0000 Author: kevans Date: Fri Jan 4 03:13:24 2019 New Revision: 342757 URL: https://svnweb.freebsd.org/changeset/base/342757 Log: getopt_long(3): fix case of malformed long opt When presented with an arg string like '-l-', getopt_long will successfully parse out the 'l' short option, then proceed to match '--' against the first longopts entry as it later does a strncmp with len=0. This latter bit is arguably another bug in itself, but presumably not a practical issue as all callers of parse_long_options are already doing the right thing (except this one pointed out). An opt string like '-l-' should be considered malformed and throw a bad argument rather than behaving as if '--' were passed. It cannot possibly do what the invoker expects, and it's probably the result of a typo (ls -l- a) rather than any intent. Reported by: Tony Overfield Reviewed by: imp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D18616 Modified: head/lib/libc/stdlib/getopt_long.c Modified: head/lib/libc/stdlib/getopt_long.c ============================================================================== --- head/lib/libc/stdlib/getopt_long.c Fri Jan 4 02:50:55 2019 (r342756) +++ head/lib/libc/stdlib/getopt_long.c Fri Jan 4 03:13:24 2019 (r342757) @@ -481,6 +481,8 @@ start: #endif if (*place == '-') { place++; /* --foo long option */ + if (*place == '\0') + return (BADARG); /* malformed option */ #ifdef GNU_COMPATIBLE dash_prefix = DD_PREFIX; #endif From owner-svn-src-head@freebsd.org Fri Jan 4 04:15:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 55C051441A22; Fri, 4 Jan 2019 04:15:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE3D477C94; Fri, 4 Jan 2019 04:15:17 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DADA62B57E; Fri, 4 Jan 2019 04:15:17 +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 x044FHXc027084; Fri, 4 Jan 2019 04:15:17 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x044FHED027083; Fri, 4 Jan 2019 04:15:17 GMT (envelope-from np@FreeBSD.org) Message-Id: <201901040415.x044FHED027083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 4 Jan 2019 04:15:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342758 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 342758 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE3D477C94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.981,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 04:15:18 -0000 Author: np Date: Fri Jan 4 04:15:17 2019 New Revision: 342758 URL: https://svnweb.freebsd.org/changeset/base/342758 Log: cxgbe(4): Clear FW_OK if the firmware reports an error. Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Fri Jan 4 03:13:24 2019 (r342757) +++ head/sys/dev/cxgbe/common/t4_hw.c Fri Jan 4 04:15:17 2019 (r342758) @@ -211,9 +211,11 @@ static void t4_report_fw_error(struct adapter *adap) u32 pcie_fw; pcie_fw = t4_read_reg(adap, A_PCIE_FW); - if (pcie_fw & F_PCIE_FW_ERR) + if (pcie_fw & F_PCIE_FW_ERR) { CH_ERR(adap, "Firmware reports adapter error: %s\n", reason[G_PCIE_FW_EVAL(pcie_fw)]); + adap->flags &= ~FW_OK; + } } /* From owner-svn-src-head@freebsd.org Fri Jan 4 04:26:40 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AD571441CC9; Fri, 4 Jan 2019 04:26:40 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F1228014C; Fri, 4 Jan 2019 04:26:40 +0000 (UTC) (envelope-from avos@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA2AA2B729; Fri, 4 Jan 2019 04:26:39 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x044QdYw032428; Fri, 4 Jan 2019 04:26:39 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x044QdF8032426; Fri, 4 Jan 2019 04:26:39 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201901040426.x044QdF8032426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Fri, 4 Jan 2019 04:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342759 - in head/sys/dev/rtwn: rtl8188e rtl8188e/pci rtl8192c X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8188e rtl8188e/pci rtl8192c X-SVN-Commit-Revision: 342759 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0F1228014C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.982,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 04:26:40 -0000 Author: avos Date: Fri Jan 4 04:26:39 2019 New Revision: 342759 URL: https://svnweb.freebsd.org/changeset/base/342759 Log: rtwn_pci(4): sync r88ee_power_on() with OpenBSD Tested with RTL8188EE, STA mode Submitted by: Farhan Khan MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D18727 Modified: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c head/sys/dev/rtwn/rtl8188e/r88e_reg.h head/sys/dev/rtwn/rtl8192c/r92c_reg.h Modified: head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8188e/pci/r88ee_init.c Fri Jan 4 04:26:39 2019 (r342759) @@ -84,8 +84,15 @@ r88ee_power_on(struct rtwn_softc *sc) { int ntries; - /* Wait for power ready bit. */ - for (ntries = 0; ntries < 5000; ntries++) { + /* Disable XTAL output for power saving. */ + rtwn_setbits_1(sc, R88E_XCK_OUT_CTRL, R88E_XCK_OUT_CTRL_EN, 0); + + /* Unlock ISO/CLK/Power control register. */ + rtwn_setbits_2(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_APDM_HPDN, 0); + rtwn_write_1(sc, R92C_RSV_CTRL, 0); + + /* Wait for power ready bit */ + for(ntries = 0; ntries < 5000; ntries++) { if (rtwn_read_4(sc, R92C_APS_FSMCO) & R92C_APS_FSMCO_SUS_HOST) break; rtwn_delay(sc, 10); @@ -96,9 +103,6 @@ r88ee_power_on(struct rtwn_softc *sc) return (ETIMEDOUT); } - /* Unlock ISO/CLK/Power control register. */ - rtwn_write_1(sc, R92C_RSV_CTRL, 0); - /* Reset BB. */ rtwn_setbits_1(sc, R92C_SYS_FUNC_EN, R92C_SYS_FUNC_EN_BBRSTB | R92C_SYS_FUNC_EN_BB_GLB_RST, 0); @@ -114,6 +118,7 @@ r88ee_power_on(struct rtwn_softc *sc) rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, R92C_APS_FSMCO_AFSM_HSUS | R92C_APS_FSMCO_AFSM_PCIE, 0, 1); + /* Auto-enable WLAN */ rtwn_setbits_1_shift(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_APFM_ONMAC, 1); for (ntries = 0; ntries < 5000; ntries++) { @@ -129,6 +134,12 @@ r88ee_power_on(struct rtwn_softc *sc) /* Enable LDO normal mode. */ rtwn_setbits_1(sc, R92C_LPLDO_CTRL, R92C_LPLDO_CTRL_SLEEP, 0); + + rtwn_setbits_1(sc, R92C_APS_FSMCO, 0, R92C_APS_FSMCO_PDN_EN); + rtwn_setbits_1(sc, R92C_PCIE_CTRL_REG + 2, 0, 0x04); + rtwn_setbits_1(sc, R92C_AFE_XTAL_CTRL_EXT + 1, 0, 0x02); + rtwn_setbits_1(sc, R92C_SYS_CLKR, 0, 0x08); + rtwn_setbits_2(sc, R92C_GPIO_MUXCFG, R92C_GPIO_MUXCFG_ENSIC, 0); /* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ rtwn_write_2(sc, R92C_CR, 0); Modified: head/sys/dev/rtwn/rtl8188e/r88e_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8188e/r88e_reg.h Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8188e/r88e_reg.h Fri Jan 4 04:26:39 2019 (r342759) @@ -32,6 +32,7 @@ #define R88E_HISR 0x0b4 #define R88E_HIMRE 0x0b8 #define R88E_HISRE 0x0bc +#define R88E_XCK_OUT_CTRL 0x07c /* MAC General Configuration. */ #define R88E_32K_CTRL 0x194 #define R88E_HMEBOX_EXT(idx) (0x1f0 + (idx) * 4) @@ -121,5 +122,8 @@ #define R88E_RF_T_METER_VAL_M 0x0fc00 #define R88E_RF_T_METER_VAL_S 10 #define R88E_RF_T_METER_START 0x30000 + +/* Bits for R88E_XCK_OUT_CTRL. */ +#define R88E_XCK_OUT_CTRL_EN 1 #endif /* R88E_REG_H */ Modified: head/sys/dev/rtwn/rtl8192c/r92c_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8192c/r92c_reg.h Fri Jan 4 04:15:17 2019 (r342758) +++ head/sys/dev/rtwn/rtl8192c/r92c_reg.h Fri Jan 4 04:26:39 2019 (r342759) @@ -66,6 +66,7 @@ #define R92C_HSIMR 0x058 #define R92C_HSISR 0x05c #define R92C_MULTI_FUNC_CTRL 0x068 +#define R92C_AFE_XTAL_CTRL_EXT 0x078 #define R92C_LDO_SWR_CTRL 0x07c #define R92C_MCUFWDL 0x080 #define R92C_HMEBOX_EXT(idx) (0x088 + (idx) * 2) @@ -347,6 +348,7 @@ /* Bits for R92C_GPIO_MUXCFG. */ #define R92C_GPIO_MUXCFG_ENBT 0x0020 +#define R92C_GPIO_MUXCFG_ENSIC 0x1000 /* Bits for R92C_LEDCFG0. */ #define R92C_LEDCFG0_DIS 0x08 From owner-svn-src-head@freebsd.org Fri Jan 4 14:42:37 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E90142DF07; Fri, 4 Jan 2019 14:42:37 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48AAF6C0B2; Fri, 4 Jan 2019 14:42:37 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 391522074; Fri, 4 Jan 2019 14:42:37 +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 x04EgbOw053442; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04EgbJr053441; Fri, 4 Jan 2019 14:42:37 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041442.x04EgbJr053441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 14:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342760 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342760 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48AAF6C0B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 14:42:37 -0000 Author: emaste Date: Fri Jan 4 14:42:36 2019 New Revision: 342760 URL: https://svnweb.freebsd.org/changeset/base/342760 Log: newvers: avoid clearing svn revision information with nested VCS dirs Consider the case where FreeBSD is checked out via Subversion with a (perhaps unrelated) .git or .hg directory at a higher level - for example, .../.git .../src/freebsd Previously newvers obtained the SVN revision information via svnversion, and then tried to obtain the SVN revision corresponding to the git or hg commit, overwriting the existing information. As a short term fix use a different variable for hg-svn or git-svn information, setting $svn from hg or git info only if not empty. Reported by: Matthias Apitz Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 04:26:39 2019 (r342759) +++ head/sys/conf/newvers.sh Fri Jan 4 14:42:36 2019 (r342760) @@ -244,21 +244,21 @@ fi if [ -n "$git_cmd" ] ; then git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` - svn=`$git_cmd svn find-rev $git 2>/dev/null` - if [ -n "$svn" ] ; then - svn=" r${svn}" + gitsvn=`$git_cmd svn find-rev $git 2>/dev/null` + if [ -n "$gitsvn" ] ; then + svn=" r${gitsvn}" git="=${git}" else - svn=`$git_cmd log --grep '^git-svn-id:' | \ + gitsvn=`$git_cmd log --grep '^git-svn-id:' | \ grep '^ git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` - if [ -z "$svn" ] ; then - svn=`$git_cmd log --format='format:%N' | \ + if [ -z "$gitsvn" ] ; then + gitsvn=`$git_cmd log --format='format:%N' | \ grep '^svn ' | head -1 | \ sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` fi - if [ -n "$svn" ] ; then - svn=" r${svn}" + if [ -n "$gitsvn" ] ; then + svn=" r${gitsvn}" git="+${git}" else git=" ${git}" @@ -295,10 +295,10 @@ fi if [ -n "$hg_cmd" ] ; then hg=`$hg_cmd id 2>/dev/null` - svn=`$hg_cmd svn info 2>/dev/null | \ + hgsvn=`$hg_cmd svn info 2>/dev/null | \ awk -F': ' '/Revision/ { print $2 }'` - if [ -n "$svn" ] ; then - svn=" r${svn}" + if [ -n "$hgsvn" ] ; then + svn=" r${hgsvn}" fi if [ -n "$hg" ] ; then hg=" ${hg}" From owner-svn-src-head@freebsd.org Fri Jan 4 15:03:32 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EAE01142E956; Fri, 4 Jan 2019 15:03:31 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 605456CDDA; Fri, 4 Jan 2019 15:03:31 +0000 (UTC) (envelope-from chuck@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 525ED23D5; Fri, 4 Jan 2019 15:03:31 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04F3VEe063767; Fri, 4 Jan 2019 15:03:31 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04F3VGe063766; Fri, 4 Jan 2019 15:03:31 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201901041503.x04F3VGe063766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 4 Jan 2019 15:03:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342761 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 342761 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 605456CDDA X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 15:03:32 -0000 Author: chuck Date: Fri Jan 4 15:03:30 2019 New Revision: 342761 URL: https://svnweb.freebsd.org/changeset/base/342761 Log: Fix bhyve's NVMe queue bookkeeping Many size / length parameters in NVMe are "0's based", meaning, a value of 0x0 represents 1, 0x1 represents 2, etc.. While this leads to an efficient encoding, it can lead to subtle bugs. With respect to queues, these parameters include: - Maximum number of queue entries - Maximum number of queues - Number of Completion Queues - Number of Submission Queues To be consistent, convert all 0's based values from the host to 1's based value internally. Likewise, covert internal 1's based values to 0's based values when returned to the host. This fixes an off-by-one bug when creating IO queues and simplifies some of the code. Note that this bug is masked by another bug. While in the neighborhood, - fix an erroneous queue ID check (checking CQ count when deleting SQ) - check for queue ID of 0x0 in a few places where this is illegal - clean up the Set Features, Number of Queues command and check for illegal values Reviewed by: imp, araujo Approved by: imp (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18702 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 14:42:36 2019 (r342760) +++ head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:30 2019 (r342761) @@ -93,6 +93,16 @@ static int nvme_debug = 0; /* helpers */ +/* Convert a zero-based value into a one-based value */ +#define ONE_BASED(zero) ((zero) + 1) +/* Convert a one-based value into a zero-based value */ +#define ZERO_BASED(one) ((one) - 1) + +/* Encode number of SQ's and CQ's for Set/Get Features */ +#define NVME_FEATURE_NUM_QUEUES(sc) \ + (ZERO_BASED((sc)->num_squeues) & 0xffff) | \ + (ZERO_BASED((sc)->num_cqueues) & 0xffff) << 16; + #define NVME_DOORBELL_OFFSET offsetof(struct nvme_registers, doorbell) enum nvme_controller_register_offsets { @@ -192,8 +202,8 @@ struct pci_nvme_softc { struct pci_nvme_blockstore nvstore; - uint16_t max_qentries; /* max entries per queue */ - uint32_t max_queues; + uint16_t max_qentries; /* max entries per queue */ + uint32_t max_queues; /* max number of IO SQ's or CQ's */ uint32_t num_cqueues; uint32_t num_squeues; @@ -203,7 +213,10 @@ struct pci_nvme_softc { uint32_t ioslots; sem_t iosemlock; - /* status and guest memory mapped queues */ + /* + * Memory mapped Submission and Completion queues + * Each array includes both Admin and IO queues + */ struct nvme_completion_queue *compl_queues; struct nvme_submission_queue *submit_queues; @@ -357,7 +370,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) { DPRINTF(("%s\r\n", __func__)); - sc->regs.cap_lo = (sc->max_qentries & NVME_CAP_LO_REG_MQES_MASK) | + sc->regs.cap_lo = (ZERO_BASED(sc->max_qentries) & NVME_CAP_LO_REG_MQES_MASK) | (1 << NVME_CAP_LO_REG_CQR_SHIFT) | (60 << NVME_CAP_LO_REG_TO_SHIFT); @@ -370,7 +383,7 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->num_cqueues = sc->num_squeues = sc->max_queues; if (sc->submit_queues != NULL) { - for (int i = 0; i <= sc->max_queues; i++) { + for (int i = 0; i < sc->num_squeues + 1; i++) { /* * The Admin Submission Queue is at index 0. * It must not be changed at reset otherwise the @@ -380,26 +393,31 @@ pci_nvme_reset_locked(struct pci_nvme_softc *sc) sc->submit_queues[i].qbase = NULL; sc->submit_queues[i].size = 0; sc->submit_queues[i].cqid = 0; - - sc->compl_queues[i].qbase = NULL; - sc->compl_queues[i].size = 0; } sc->submit_queues[i].tail = 0; sc->submit_queues[i].head = 0; sc->submit_queues[i].busy = 0; - - sc->compl_queues[i].tail = 0; - sc->compl_queues[i].head = 0; } } else - sc->submit_queues = calloc(sc->max_queues + 1, + sc->submit_queues = calloc(sc->num_squeues + 1, sizeof(struct nvme_submission_queue)); - if (sc->compl_queues == NULL) { - sc->compl_queues = calloc(sc->max_queues + 1, + if (sc->compl_queues != NULL) { + for (int i = 0; i < sc->num_cqueues + 1; i++) { + /* See Admin Submission Queue note above */ + if (i != 0) { + sc->compl_queues[i].qbase = NULL; + sc->compl_queues[i].size = 0; + } + + sc->compl_queues[i].tail = 0; + sc->compl_queues[i].head = 0; + } + } else { + sc->compl_queues = calloc(sc->num_cqueues + 1, sizeof(struct nvme_completion_queue)); - for (int i = 0; i <= sc->num_cqueues; i++) + for (int i = 0; i < sc->num_cqueues + 1; i++) pthread_mutex_init(&sc->compl_queues[i].mtx, NULL); } } @@ -443,7 +461,7 @@ nvme_opc_delete_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; DPRINTF(("%s DELETE_IO_SQ %u\r\n", __func__, qid)); - if (qid == 0 || qid > sc->num_cqueues) { + if (qid == 0 || qid > sc->num_squeues) { WPRINTF(("%s NOT PERMITTED queue id %u / num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, NVME_SCT_COMMAND_SPECIFIC, @@ -464,7 +482,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_submission_queue *nsq; - if (qid > sc->num_squeues) { + if ((qid == 0) || (qid > sc->num_squeues)) { WPRINTF(("%s queue index %u > num_squeues %u\r\n", __func__, qid, sc->num_squeues)); pci_nvme_status_tc(&compl->status, @@ -474,7 +492,7 @@ nvme_opc_create_io_sq(struct pci_nvme_softc* sc, struc } nsq = &sc->submit_queues[qid]; - nsq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + nsq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); nsq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, sizeof(struct nvme_command) * (size_t)nsq->size); @@ -529,7 +547,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc uint16_t qid = command->cdw10 & 0xffff; struct nvme_completion_queue *ncq; - if (qid > sc->num_cqueues) { + if ((qid == 0) || (qid > sc->num_cqueues)) { WPRINTF(("%s queue index %u > num_cqueues %u\r\n", __func__, qid, sc->num_cqueues)); pci_nvme_status_tc(&compl->status, @@ -541,7 +559,7 @@ nvme_opc_create_io_cq(struct pci_nvme_softc* sc, struc ncq = &sc->compl_queues[qid]; ncq->intr_en = (command->cdw11 & NVME_CMD_CDW11_IEN) >> 1; ncq->intr_vec = (command->cdw11 >> 16) & 0xffff; - ncq->size = ((command->cdw10 >> 16) & 0xffff) + 1; + ncq->size = ONE_BASED((command->cdw10 >> 16) & 0xffff); ncq->qbase = vm_map_gpa(sc->nsc_pi->pi_vmctx, command->prp1, @@ -649,6 +667,45 @@ nvme_opc_identify(struct pci_nvme_softc* sc, struct nv } static int +nvme_set_feature_queues(struct pci_nvme_softc* sc, struct nvme_command* command, + struct nvme_completion* compl) +{ + uint16_t nqr; /* Number of Queues Requested */ + + nqr = command->cdw11 & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NSQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_squeues = ONE_BASED(nqr); + if (sc->num_squeues > sc->max_queues) { + DPRINTF(("NSQR=%u is greater than max %u\n", sc->num_squeues, + sc->max_queues)); + sc->num_squeues = sc->max_queues; + } + + nqr = (command->cdw11 >> 16) & 0xFFFF; + if (nqr == 0xffff) { + WPRINTF(("%s: Illegal NCQR value %#x\n", __func__, nqr)); + pci_nvme_status_genc(&compl->status, NVME_SC_INVALID_FIELD); + return (-1); + } + + sc->num_cqueues = ONE_BASED(nqr); + if (sc->num_cqueues > sc->max_queues) { + DPRINTF(("NCQR=%u is greater than max %u\n", sc->num_cqueues, + sc->max_queues)); + sc->num_cqueues = sc->max_queues; + } + + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); + + return (0); +} + +static int nvme_opc_set_features(struct pci_nvme_softc* sc, struct nvme_command* command, struct nvme_completion* compl) { @@ -678,19 +735,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache 0x%x\r\n", command->cdw11)); break; case NVME_FEAT_NUMBER_OF_QUEUES: - sc->num_squeues = command->cdw11 & 0xFFFF; - sc->num_cqueues = (command->cdw11 >> 16) & 0xFFFF; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", - sc->num_squeues, sc->num_cqueues)); - - if (sc->num_squeues == 0 || sc->num_squeues > sc->max_queues) - sc->num_squeues = sc->max_queues; - if (sc->num_cqueues == 0 || sc->num_cqueues > sc->max_queues) - sc->num_cqueues = sc->max_queues; - - compl->cdw0 = (sc->num_squeues & 0xFFFF) | - ((sc->num_cqueues & 0xFFFF) << 16); - + nvme_set_feature_queues(sc, command, compl); break; case NVME_FEAT_INTERRUPT_COALESCING: DPRINTF((" interrupt coalescing 0x%x\r\n", command->cdw11)); @@ -706,7 +751,7 @@ nvme_opc_set_features(struct pci_nvme_softc* sc, struc DPRINTF((" interrupt vector configuration 0x%x\r\n", command->cdw11)); - for (uint32_t i = 0; i <= sc->num_cqueues; i++) { + for (uint32_t i = 0; i < sc->num_cqueues + 1; i++) { if (sc->compl_queues[i].intr_vec == iv) { if (command->cdw11 & (1 << 16)) sc->compl_queues[i].intr_en |= @@ -788,17 +833,8 @@ nvme_opc_get_features(struct pci_nvme_softc* sc, struc DPRINTF((" volatile write cache\r\n")); break; case NVME_FEAT_NUMBER_OF_QUEUES: - compl->cdw0 = 0; - if (sc->num_squeues == 0) - compl->cdw0 |= sc->max_queues & 0xFFFF; - else - compl->cdw0 |= sc->num_squeues & 0xFFFF; + compl->cdw0 = NVME_FEATURE_NUM_QUEUES(sc); - if (sc->num_cqueues == 0) - compl->cdw0 |= (sc->max_queues & 0xFFFF) << 16; - else - compl->cdw0 |= (sc->num_cqueues & 0xFFFF) << 16; - DPRINTF((" number of queues (submit %u, completion %u)\r\n", compl->cdw0 & 0xFFFF, (compl->cdw0 >> 16) & 0xFFFF)); @@ -1812,7 +1848,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p /* allocate size of nvme registers + doorbell space for all queues */ pci_membar_sz = sizeof(struct nvme_registers) + - 2*sizeof(uint32_t)*(sc->max_queues); + 2*sizeof(uint32_t)*(sc->max_queues + 1); DPRINTF(("nvme membar size: %u\r\n", pci_membar_sz)); @@ -1822,7 +1858,7 @@ pci_nvme_init(struct vmctx *ctx, struct pci_devinst *p goto done; } - error = pci_emul_add_msixcap(pi, sc->max_queues, NVME_MSIX_BAR); + error = pci_emul_add_msixcap(pi, sc->max_queues + 1, NVME_MSIX_BAR); if (error) { WPRINTF(("%s pci add msixcap failed\r\n", __func__)); goto done; From owner-svn-src-head@freebsd.org Fri Jan 4 15:03:43 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C445142E97F; Fri, 4 Jan 2019 15:03:43 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A87B56CE1C; Fri, 4 Jan 2019 15:03:36 +0000 (UTC) (envelope-from chuck@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9D27323D6; Fri, 4 Jan 2019 15:03:35 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04F3ZQP063813; Fri, 4 Jan 2019 15:03:35 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04F3Zk5063812; Fri, 4 Jan 2019 15:03:35 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201901041503.x04F3Zk5063812@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 4 Jan 2019 15:03:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342762 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 342762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A87B56CE1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.961,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 15:03:43 -0000 Author: chuck Date: Fri Jan 4 15:03:35 2019 New Revision: 342762 URL: https://svnweb.freebsd.org/changeset/base/342762 Log: Fix bhyve's NVMe Completion Queue entry values The function which processes Admin commands was not returning the Command Specific value in Completion Queue Entry, Dword 0 (CDW0). This effects commands such as Set Features, Number of Queues which returns the number of queues supported by the device in CDW0. In this case, the host will only create 1 queue pair (Number of Queues is zero based). This also masked a bug in the queue counting logic. Reviewed by: imp, araujo Approved by: imp (mentor) MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D18703 Modified: head/usr.sbin/bhyve/pci_nvme.c Modified: head/usr.sbin/bhyve/pci_nvme.c ============================================================================== --- head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:30 2019 (r342761) +++ head/usr.sbin/bhyve/pci_nvme.c Fri Jan 4 15:03:35 2019 (r342762) @@ -983,6 +983,7 @@ pci_nvme_handle_admin_cmd(struct pci_nvme_softc* sc, u cq = &sc->compl_queues[0]; cp = &(cq->qbase)[cq->tail]; + cp->cdw0 = compl.cdw0; cp->sqid = 0; cp->sqhd = sqhead; cp->cid = cmd->cid; From owner-svn-src-head@freebsd.org Fri Jan 4 16:47:36 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3B591431288; Fri, 4 Jan 2019 16:47:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 699B970180; Fri, 4 Jan 2019 16:47:36 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A79A36E3; Fri, 4 Jan 2019 16:47:36 +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 x04GlaRt017052; Fri, 4 Jan 2019 16:47:36 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04GlatK017051; Fri, 4 Jan 2019 16:47:36 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041647.x04GlatK017051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 16:47:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342763 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342763 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 699B970180 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 16:47:37 -0000 Author: emaste Date: Fri Jan 4 16:47:35 2019 New Revision: 342763 URL: https://svnweb.freebsd.org/changeset/base/342763 Log: newvers: retire p4 version support Perforce no longer offers a FreeBSD client and it not a viable VCS for FreeBSD development. Remove p4 version logic to simplify newvers.sh in advance of other changes. Sponsored by: The FreeBSD Foundation Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 15:03:35 2019 (r342762) +++ head/sys/conf/newvers.sh Fri Jan 4 16:47:35 2019 (r342763) @@ -202,12 +202,6 @@ if [ -z "${svnversion}" ] && [ -x /usr/bin/svnlitevers fi fi -for dir in /usr/bin /usr/local/bin; do - if [ -x "${dir}/p4" ] && [ -z ${p4_cmd} ] ; then - p4_cmd=${dir}/p4 - fi -done - if findvcs .git; then for dir in /usr/bin /usr/local/bin; do if [ -x "${dir}/git" ] ; then @@ -274,25 +268,6 @@ if [ -n "$git_cmd" ] ; then fi fi -if [ -n "$p4_cmd" ] ; then - p4version=`cd ${SYSDIR} && $p4_cmd changes -m1 "./...#have" 2>&1 | \ - awk '{ print $2 }'` - case "$p4version" in - [0-9]*) - p4version=" ${p4version}" - p4opened=`cd ${SYSDIR} && $p4_cmd opened ./... 2>&1` - case "$p4opened" in - File*) ;; - //*) - p4version="${p4version}+edit" - modified=true - ;; - esac - ;; - *) unset p4version ;; - esac -fi - if [ -n "$hg_cmd" ] ; then hg=`$hg_cmd id 2>/dev/null` hgsvn=`$hg_cmd svn info 2>/dev/null | \ @@ -320,10 +295,10 @@ done shift $((OPTIND - 1)) if [ -z "${include_metadata}" ]; then - VERINFO="${VERSION}${svn}${git}${hg}${p4version} ${i}" + VERINFO="${VERSION}${svn}${git}${hg} ${i}" VERSTR="${VERINFO}\\n" else - VERINFO="${VERSION} #${v}${svn}${git}${hg}${p4version}: ${t}" + VERINFO="${VERSION} #${v}${svn}${git}${hg}: ${t}" VERSTR="${VERINFO}\\n ${u}@${h}:${d}\\n" fi From owner-svn-src-head@freebsd.org Fri Jan 4 17:08:46 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8FC4E1432529; Fri, 4 Jan 2019 17:08:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32A55719D1; Fri, 4 Jan 2019 17:08:46 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 24B153AFF; Fri, 4 Jan 2019 17:08:46 +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 x04H8k1e027549; Fri, 4 Jan 2019 17:08:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04H8kTJ027548; Fri, 4 Jan 2019 17:08:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041708.x04H8kTJ027548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:08:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342764 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342764 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 32A55719D1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:08:46 -0000 Author: markj Date: Fri Jan 4 17:08:45 2019 New Revision: 342764 URL: https://svnweb.freebsd.org/changeset/base/342764 Log: Clear PGA_WRITEABLE in pmap_remove_pages(). Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18731 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Jan 4 16:47:35 2019 (r342763) +++ head/sys/riscv/riscv/pmap.c Fri Jan 4 17:08:45 2019 (r342764) @@ -2754,6 +2754,9 @@ pmap_remove_pages(pmap_t pmap) pmap_resident_count_dec(pmap, 1); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; + if (TAILQ_EMPTY(&m->md.pv_list) && + (m->aflags & PGA_WRITEABLE) != 0) + vm_page_aflag_clear(m, PGA_WRITEABLE); pmap_unuse_l3(pmap, pv->pv_va, ptepde, &free); freed++; From owner-svn-src-head@freebsd.org Fri Jan 4 17:10:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46AD61432660; Fri, 4 Jan 2019 17:10:17 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E15D971B9C; Fri, 4 Jan 2019 17:10:16 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7C1E3B0C; Fri, 4 Jan 2019 17:10:16 +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 x04HAGIF027683; Fri, 4 Jan 2019 17:10:16 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HAGiV027682; Fri, 4 Jan 2019 17:10:16 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041710.x04HAGiV027682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:10:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342765 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342765 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E15D971B9C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:10:17 -0000 Author: markj Date: Fri Jan 4 17:10:16 2019 New Revision: 342765 URL: https://svnweb.freebsd.org/changeset/base/342765 Log: Fix dirty bit handling in pmap_remove_write(). Reviewed by: jhb, kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18732 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Fri Jan 4 17:08:45 2019 (r342764) +++ head/sys/riscv/riscv/pmap.c Fri Jan 4 17:10:16 2019 (r342765) @@ -2947,15 +2947,13 @@ retry_pv_loop: } } l3 = pmap_l3(pmap, pv->pv_va); -retry: oldl3 = pmap_load(l3); - +retry: if ((oldl3 & PTE_W) != 0) { - newl3 = oldl3 & ~PTE_W; - if (!atomic_cmpset_long(l3, oldl3, newl3)) + newl3 = oldl3 & ~(PTE_D | PTE_W); + if (!atomic_fcmpset_long(l3, &oldl3, newl3)) goto retry; - /* TODO: check for PTE_D? */ - if ((oldl3 & PTE_A) != 0) + if ((oldl3 & PTE_D) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); } From owner-svn-src-head@freebsd.org Fri Jan 4 17:14:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 67ECB1432965; Fri, 4 Jan 2019 17:14:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B5BA72025; Fri, 4 Jan 2019 17:14:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2D0A3CE0; Fri, 4 Jan 2019 17:14:50 +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 x04HEoxT032650; Fri, 4 Jan 2019 17:14:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HEoNL032649; Fri, 4 Jan 2019 17:14:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041714.x04HEoNL032649@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342766 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 342766 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0B5BA72025 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.94 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:14:51 -0000 Author: markj Date: Fri Jan 4 17:14:50 2019 New Revision: 342766 URL: https://svnweb.freebsd.org/changeset/base/342766 Log: Don't enable interrupts in init_secondary(). The MI kernel assumes that interrupts will not be enabled on APs until after the first context switch. In particular, the problem was causing occasional deadlocks during boot. Remove an unneeded intr_disable() added in r335005. Reviewed by: jhb (previous version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18738 Modified: head/sys/riscv/riscv/mp_machdep.c Modified: head/sys/riscv/riscv/mp_machdep.c ============================================================================== --- head/sys/riscv/riscv/mp_machdep.c Fri Jan 4 17:10:16 2019 (r342765) +++ head/sys/riscv/riscv/mp_machdep.c Fri Jan 4 17:14:50 2019 (r342766) @@ -227,7 +227,6 @@ init_secondary(uint64_t cpu) __asm __volatile("mv gp, %0" :: "r"(pcpup)); /* Workaround: make sure wfi doesn't halt the hart */ - intr_disable(); csr_set(sie, SIE_SSIE); csr_set(sip, SIE_SSIE); @@ -252,9 +251,6 @@ init_secondary(uint64_t cpu) /* Start per-CPU event timers. */ cpu_initclocks_ap(); - - /* Enable interrupts */ - intr_enable(); /* Enable external (PLIC) interrupts */ csr_set(sie, SIE_SEIE); From owner-svn-src-head@freebsd.org Fri Jan 4 17:25:49 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 112F51432E56; Fri, 4 Jan 2019 17:25:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ADB17727B8; Fri, 4 Jan 2019 17:25:48 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B5513E97; Fri, 4 Jan 2019 17:25:48 +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 x04HPm0i037653; Fri, 4 Jan 2019 17:25:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HPmIt037652; Fri, 4 Jan 2019 17:25:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041725.x04HPmIt037652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 17:25:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342767 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: amd64/amd64 i386/i386 X-SVN-Commit-Revision: 342767 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADB17727B8 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:25:49 -0000 Author: kib Date: Fri Jan 4 17:25:47 2019 New Revision: 342767 URL: https://svnweb.freebsd.org/changeset/base/342767 Log: x86: Report per-cpu IPI TLB shootdown generation in ddb 'show pcpu' output. It is useful for inspecting tlb shootdown hangs. The smp_tlb_generation value is available using regular ddb data inspection commands. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/db_interface.c head/sys/i386/i386/db_interface.c Modified: head/sys/amd64/amd64/db_interface.c ============================================================================== --- head/sys/amd64/amd64/db_interface.c Fri Jan 4 17:14:50 2019 (r342766) +++ head/sys/amd64/amd64/db_interface.c Fri Jan 4 17:25:47 2019 (r342767) @@ -104,4 +104,5 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("gs32p = %p\n", pc->pc_gs32p); db_printf("ldt = %p\n", pc->pc_ldt); db_printf("tss = %p\n", pc->pc_tss); + db_printf("tlb gen = %u\n", pc->pc_smp_tlb_done); } Modified: head/sys/i386/i386/db_interface.c ============================================================================== --- head/sys/i386/i386/db_interface.c Fri Jan 4 17:14:50 2019 (r342766) +++ head/sys/i386/i386/db_interface.c Fri Jan 4 17:25:47 2019 (r342767) @@ -118,4 +118,5 @@ db_show_mdpcpu(struct pcpu *pc) db_printf("trampstk = 0x%x\n", pc->pc_trampstk); db_printf("kesp0 = 0x%x\n", pc->pc_kesp0); db_printf("common_tssp = 0x%x\n", (u_int)pc->pc_common_tssp); + db_printf("tlb gen = %u\n", pc->pc_smp_tlb_done); } From owner-svn-src-head@freebsd.org Fri Jan 4 17:31:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B29A81433063; Fri, 4 Jan 2019 17:31:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58F1F72C8F; Fri, 4 Jan 2019 17:31:51 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4B0824059; Fri, 4 Jan 2019 17:31:51 +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 x04HVp4l038867; Fri, 4 Jan 2019 17:31:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HVosS038863; Fri, 4 Jan 2019 17:31:50 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041731.x04HVosS038863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 17:31:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342768 - in head: lib/libc/sys sys/kern sys/netinet sys/ofed/drivers/infiniband/ulp/sdp X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: lib/libc/sys sys/kern sys/netinet sys/ofed/drivers/infiniband/ulp/sdp X-SVN-Commit-Revision: 342768 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 58F1F72C8F X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:31:51 -0000 Author: markj Date: Fri Jan 4 17:31:50 2019 New Revision: 342768 URL: https://svnweb.freebsd.org/changeset/base/342768 Log: Support MSG_DONTWAIT in send*(2). As it does for recv*(2), MSG_DONTWAIT indicates that the call should not block, returning EAGAIN instead. Linux and OpenBSD both implement this, so the change makes porting easier, especially since we do not return EINVAL or so when unrecognized flags are specified. Submitted by: Greg V Reviewed by: tuexen MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18728 Modified: head/lib/libc/sys/send.2 head/sys/kern/uipc_socket.c head/sys/netinet/sctp_output.c head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Modified: head/lib/libc/sys/send.2 ============================================================================== --- head/lib/libc/sys/send.2 Fri Jan 4 17:25:47 2019 (r342767) +++ head/lib/libc/sys/send.2 Fri Jan 4 17:31:50 2019 (r342768) @@ -28,7 +28,7 @@ .\" From: @(#)send.2 8.2 (Berkeley) 2/21/94 .\" $FreeBSD$ .\" -.Dd August 19, 2018 +.Dd January 4, 2019 .Dt SEND 2 .Os .Sh NAME @@ -121,7 +121,8 @@ argument may include one or more of the following: .Bd -literal #define MSG_OOB 0x00001 /* process out-of-band data */ #define MSG_DONTROUTE 0x00004 /* bypass routing, use direct interface */ -#define MSG_EOR 0x00008 /* data completes record */ +#define MSG_EOR 0x00008 /* data completes record */ +#define MSG_DONTWAIT 0x00080 /* do not block */ #define MSG_EOF 0x00100 /* data completes transaction */ #define MSG_NOSIGNAL 0x20000 /* do not generate SIGPIPE on EOF */ .Ed @@ -138,6 +139,9 @@ data. .Dv MSG_EOR is used to indicate a record mark for protocols which support the concept. +The +.Dv MSG_DONTWAIT +flag request the call to return when it would block otherwise. .Dv MSG_EOF requests that the sender side of a socket be shut down, and that an appropriate indication be sent at the end of the specified data; @@ -201,8 +205,9 @@ An invalid user space address was specified for an arg The socket requires that message be sent atomically, and the size of the message to be sent made this impossible. .It Bq Er EAGAIN -The socket is marked non-blocking and the requested operation -would block. +The socket is marked non-blocking, or +.Dv MSG_DONTWAIT +is specified, and the requested operation would block. .It Bq Er ENOBUFS The system was unable to allocate an internal buffer. The operation may succeed when buffers become available. Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/kern/uipc_socket.c Fri Jan 4 17:31:50 2019 (r342768) @@ -1522,7 +1522,8 @@ restart: } if (space < resid + clen && (atomic || space < so->so_snd.sb_lowat || space < clen)) { - if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) { + if ((so->so_state & SS_NBIO) || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; goto release; Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/netinet/sctp_output.c Fri Jan 4 17:31:50 2019 (r342768) @@ -12836,7 +12836,7 @@ sctp_lower_sosend(struct socket *so, } } if (SCTP_SO_IS_NBIO(so) - || (flags & MSG_NBIO) + || (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0 ) { non_blocking = 1; } Modified: head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 4 17:25:47 2019 (r342767) +++ head/sys/ofed/drivers/infiniband/ulp/sdp/sdp_main.c Fri Jan 4 17:31:50 2019 (r342768) @@ -1124,7 +1124,8 @@ restart: } if (space < resid && (atomic || space < so->so_snd.sb_lowat)) { - if ((so->so_state & SS_NBIO) || (flags & MSG_NBIO)) { + if ((so->so_state & SS_NBIO) || + (flags & (MSG_NBIO | MSG_DONTWAIT)) != 0) { SOCKBUF_UNLOCK(&so->so_snd); error = EWOULDBLOCK; goto release; From owner-svn-src-head@freebsd.org Fri Jan 4 17:33:08 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A5E1433252; Fri, 4 Jan 2019 17:33:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF66872EC4; Fri, 4 Jan 2019 17:33:07 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D181040A7; Fri, 4 Jan 2019 17:33:07 +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 x04HX7uD042892; Fri, 4 Jan 2019 17:33:07 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04HX7nD042891; Fri, 4 Jan 2019 17:33:07 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041733.x04HX7nD042891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 17:33:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342769 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342769 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DF66872EC4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.97)[-0.966,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 17:33:08 -0000 Author: kib Date: Fri Jan 4 17:33:07 2019 New Revision: 342769 URL: https://svnweb.freebsd.org/changeset/base/342769 Log: i386: Use atomic 64bit load to read PDE value from PAE pagetables in pmap_kextract(). pmap_kextract() can race with promotion/demotion on the kernel page table, in which case current non-atomic 64bit read would see torn value, breaking pmap_kextract(). pmap_kextract() would correctly handle either promoted or demoted PDE, but not a mix where one word is from a different state. It requires PAE and > 4G memory to reproduce. We observed this in real loads, both for intensive use of malloc(9)/free(9) where vtoslab() returned invalid pointer to the slab, and with the use of busdma_bounce, where incorrect page was bounced. In collaboration with: pho Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D18714 Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jan 4 17:31:50 2019 (r342768) +++ head/sys/i386/include/pmap.h Fri Jan 4 17:33:07 2019 (r342769) @@ -234,6 +234,32 @@ extern pd_entry_t *IdlePTD; /* physical address of "Id */ extern pt_entry_t *KPTmap; +#if (defined(PAE) || defined(PAE_TABLES)) + +#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) +#define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) +#define pte_load(ptep) atomic_load_acq_64_i586(ptep) + +extern pt_entry_t pg_nx; + +#else /* !(PAE || PAE_TABLES) */ + +#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) +#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_int(ptep, 0) +#define pte_store(ptep, pte) do { \ + *(u_int *)(ptep) = (u_int)(pte); \ +} while (0) +#define pte_load(ptep) atomic_load_acq_int(ptep) + +#endif /* !(PAE || PAE_TABLES) */ + +#define pte_clear(ptep) pte_store(ptep, 0) + +#define pde_store(pdep, pde) pte_store(pdep, pde) + /* * Extract from the kernel page table the physical address that is mapped by * the given virtual address "va". @@ -245,7 +271,7 @@ pmap_kextract(vm_offset_t va) { vm_paddr_t pa; - if ((pa = PTD[va >> PDRSHIFT]) & PG_PS) { + if ((pa = pte_load(&PTD[va >> PDRSHIFT])) & PG_PS) { pa = (pa & PG_PS_FRAME) | (va & PDRMASK); } else { /* @@ -260,30 +286,6 @@ pmap_kextract(vm_offset_t va) } return (pa); } - -#if (defined(PAE) || defined(PAE_TABLES)) - -#define pde_cmpset(pdep, old, new) atomic_cmpset_64_i586(pdep, old, new) -#define pte_load_store(ptep, pte) atomic_swap_64_i586(ptep, pte) -#define pte_load_clear(ptep) atomic_swap_64_i586(ptep, 0) -#define pte_store(ptep, pte) atomic_store_rel_64_i586(ptep, pte) - -extern pt_entry_t pg_nx; - -#else /* !(PAE || PAE_TABLES) */ - -#define pde_cmpset(pdep, old, new) atomic_cmpset_int(pdep, old, new) -#define pte_load_store(ptep, pte) atomic_swap_int(ptep, pte) -#define pte_load_clear(ptep) atomic_swap_int(ptep, 0) -#define pte_store(ptep, pte) do { \ - *(u_int *)(ptep) = (u_int)(pte); \ -} while (0) - -#endif /* !(PAE || PAE_TABLES) */ - -#define pte_clear(ptep) pte_store(ptep, 0) - -#define pde_store(pdep, pde) pte_store(pdep, pde) #endif /* _KERNEL */ From owner-svn-src-head@freebsd.org Fri Jan 4 18:21:50 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2935D143478F; Fri, 4 Jan 2019 18:21:50 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C37F474EA5; Fri, 4 Jan 2019 18:21:49 +0000 (UTC) (envelope-from dab@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D34484A; Fri, 4 Jan 2019 18:21:49 +0000 (UTC) (envelope-from dab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04ILnEF065697; Fri, 4 Jan 2019 18:21:49 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04ILn07065695; Fri, 4 Jan 2019 18:21:49 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201901041821.x04ILn07065695@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Fri, 4 Jan 2019 18:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342770 - head/sys/dev/asmc X-SVN-Group: head X-SVN-Commit-Author: dab X-SVN-Commit-Paths: head/sys/dev/asmc X-SVN-Commit-Revision: 342770 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C37F474EA5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 18:21:50 -0000 Author: dab Date: Fri Jan 4 18:21:49 2019 New Revision: 342770 URL: https://svnweb.freebsd.org/changeset/base/342770 Log: asmc: Patch to add MacBook Pro 9,2 support PR: 211513 Submitted by: William Theesfeld Jr Reported by: William Theesfeld Jr MFC after: 1 week Modified: head/sys/dev/asmc/asmc.c head/sys/dev/asmc/asmcvar.h Modified: head/sys/dev/asmc/asmc.c ============================================================================== --- head/sys/dev/asmc/asmc.c Fri Jan 4 17:33:07 2019 (r342769) +++ head/sys/dev/asmc/asmc.c Fri Jan 4 18:21:49 2019 (r342770) @@ -231,6 +231,12 @@ struct asmc_model asmc_models[] = { }, { + "MacBookPro9,2", "Apple SMC MacBook Pro (mid 2012)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, + ASMC_MBP9_TEMPS, ASMC_MBP9_TEMPNAMES, ASMC_MBP9_TEMPDESCS + }, + + { "MacBookPro11,2", "Apple SMC MacBook Pro Retina Core i7 (2013/2014)", ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, ASMC_MBP112_TEMPS, ASMC_MBP112_TEMPNAMES, ASMC_MBP112_TEMPDESCS Modified: head/sys/dev/asmc/asmcvar.h ============================================================================== --- head/sys/dev/asmc/asmcvar.h Fri Jan 4 17:33:07 2019 (r342769) +++ head/sys/dev/asmc/asmcvar.h Fri Jan 4 18:21:49 2019 (r342770) @@ -257,6 +257,27 @@ struct asmc_softc { "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ "Th2H", "Tm0P", "Ts0P", "Ts0S" } +#define ASMC_MBP9_TEMPS { "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \ + "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \ + "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \ + "TPCD", NULL } + +#define ASMC_MBP9_TEMPNAMES { "Ts0P", "Ts0S", "TA0P", "TB1T", "TB2T", \ + "TB0T", "TC1C", "TC2C", "TC0E", "TC0F", \ + "TC0J", "TC0P", "TCFC", "TCGC", "TCSA", \ + "TCTD", "TCXC", "TG1D", "TM0P", "TM0S", \ + "TPCD" } + +#define ASMC_MBP9_TEMPDESCS { "Palm Rest", "Memory Proximity", "Airflow 1", \ + "Battery 1", "Battery 2", "Battery TS_MAX", \ + "CPU Core 1", "CPU Core 2", "CPU1", "CPU1", \ + "TC0J", "CPU 1 Proximity", "TCFC", \ + "PECI GPU", "PECI SA", "TCTD", "PECI CPU", \ + "GPU Die", "Memory Bank A1", "Memory Module A1", \ + "PCH Die" } + + #define ASMC_MBP112_TEMPS { "TB0T", "TB1T", "TB2T", "TBXT", "TC0E", \ "TC0F", "TC0P", "TC1C", "TC2C", "TC3C", \ "TC4C", "TCFC", "TCGC", "TCSA", "TCTD", \ From owner-svn-src-head@freebsd.org Fri Jan 4 18:31:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0178C1434BFD; Fri, 4 Jan 2019 18:31:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BBDA75466; Fri, 4 Jan 2019 18:31:19 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 85B8149CC; Fri, 4 Jan 2019 18:31:19 +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 x04IVJ9k071000; Fri, 4 Jan 2019 18:31:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IVHa5070991; Fri, 4 Jan 2019 18:31:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901041831.x04IVHa5070991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Jan 2019 18:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342771 - in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 X-SVN-Commit-Revision: 342771 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9BBDA75466 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 18:31:20 -0000 Author: cem Date: Fri Jan 4 18:31:17 2019 New Revision: 342771 URL: https://svnweb.freebsd.org/changeset/base/342771 Log: Expose threads-per-core and physical core count information With new sysctls (to the best of our ability do detect them). Restructured smp.4 slightly for clarity (keep relevant stuff closer to the top) while documenting. Reviewed by: markj, jhibbits (ppc parts) MFC after: 3 days Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D18322 Modified: head/share/man/man4/smp.4 head/sys/kern/subr_smp.c head/sys/powerpc/powernv/platform_powernv.c head/sys/powerpc/powerpc/mp_machdep.c head/sys/powerpc/ps3/platform_ps3.c head/sys/powerpc/pseries/platform_chrp.c head/sys/sys/smp.h head/sys/x86/x86/mp_x86.c Modified: head/share/man/man4/smp.4 ============================================================================== --- head/share/man/man4/smp.4 Fri Jan 4 18:21:49 2019 (r342770) +++ head/share/man/man4/smp.4 Fri Jan 4 18:31:17 2019 (r342771) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 6, 2018 +.Dd January 4, 2019 .Dt SMP 4 .Os .Sh NAME @@ -35,27 +35,6 @@ The .Nm kernel implements symmetric multi-processor support. -.Sh COMPATIBILITY -Support for multi-processor systems is present for all Tier-1 -architectures on -.Fx . -Currently, this includes amd64, i386 and sparc64. -Support is enabled using -.Cd options SMP . -It is permissible to use the SMP kernel configuration on non-SMP equipped -motherboards. -.Sh I386 NOTES -For i386 systems, the -.Nm -kernel supports motherboards that follow the Intel MP specification, -version 1.4. -In addition to -.Cd options SMP , -i386 also requires -.Cd device apic . -The -.Xr mptable 1 -command may be used to view the status of multi-processor support. .Pp .Nm support can be disabled by setting the loader tunable @@ -66,6 +45,13 @@ The number of CPUs detected by the system is available the read-only sysctl variable .Va hw.ncpu . .Pp +The number of online threads per CPU core is available in the read-only sysctl +variable +.Va kern.smp.threads_per_core . +The number of physical CPU cores detected by the system is available in the +read-only sysctl variable +.Va kern.smp.cores . +.Pp .Fx allows specific CPUs on a multi-processor system to be disabled. This can be done using the @@ -74,6 +60,12 @@ tunable, where X is the APIC ID of a CPU. Setting this tunable to 1 will result in the corresponding CPU being disabled. .Pp +.Fx +supports simultaneous multithreading on x86 and powerpc platforms. +On x86, the logical CPUs can be disabled by setting the +.Va machdep.hyperthreading_allowed +tunable to zero. +.Pp The .Xr sched_ule 4 scheduler implements CPU topology detection and adjusts the scheduling @@ -122,13 +114,26 @@ two quad-core processors is: .Pp This information is used internally by the kernel to schedule related tasks on CPUs that are closely grouped together. -.Pp -.Fx -supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. -Because using logical CPUs can cause performance penalties under certain loads, -the logical CPUs can be disabled by setting the -.Va machdep.hyperthreading_allowed -tunable to zero. +.Sh COMPATIBILITY +Support for multi-processor systems is present for all Tier-1 and Tier-2 +architectures on +.Fx . +Currently, this includes x86, powerpc, arm, and sparc64. +Support is enabled using +.Cd options SMP . +It is permissible to use the SMP kernel configuration on non-SMP hardware. +.Sh I386 NOTES +For i386 systems, the +.Nm +kernel supports motherboards that follow the Intel MP specification, +version 1.4. +In addition to +.Cd options SMP , +i386 also requires +.Cd device apic . +The +.Xr mptable 1 +command may be used to view the status of multi-processor support. .Sh SEE ALSO .Xr cpuset 1 , .Xr mptable 1 , @@ -166,3 +171,20 @@ in also introduced support for SMP on the sparc64 architecture. .Sh AUTHORS .An Steve Passe Aq Mt fsmp@FreeBSD.org +.Sh CAVEATS +The +.Va kern.smp.threads_per_core +and +.Va kern.smp.cores +sysctl variables are provided as a best-effort guess. +If an architecture or platform adds SMT and +.Fx +has not yet implemented detection, the reported values may be inaccurate. +In this case, +.Va kern.smp.threads_per_core +will report +.Dv 1 +and +.Va kern.smp.cores +will report the same value as +.Va hw.ncpu . Modified: head/sys/kern/subr_smp.c ============================================================================== --- head/sys/kern/subr_smp.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/kern/subr_smp.c Fri Jan 4 18:31:17 2019 (r342771) @@ -98,6 +98,14 @@ int smp_cpus = 1; /* how many cpu's running */ SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, "Number of CPUs online"); +int smp_threads_per_core = 1; /* how many SMT threads are running per core */ +SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLFLAG_RD|CTLFLAG_CAPRD, + &smp_threads_per_core, 0, "Number of SMT threads online per core"); + +int mp_ncores = -1; /* how many physical cores running */ +SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, + "Number of CPUs online"); + int smp_topology = 0; /* Which topology we're using. */ SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, "Topology override setting; 0 is default provided by hardware."); @@ -154,6 +162,7 @@ mp_start(void *dummy) /* Probe for MP hardware. */ if (smp_disabled != 0 || cpu_mp_probe() == 0) { + mp_ncores = 1; mp_ncpus = 1; CPU_SETOF(PCPU_GET(cpuid), &all_cpus); return; @@ -162,6 +171,11 @@ mp_start(void *dummy) cpu_mp_start(); printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n", mp_ncpus); + + /* Provide a default for most architectures that don't have SMT/HTT. */ + if (mp_ncores < 0) + mp_ncores = mp_ncpus; + cpu_mp_announce(); } SYSINIT(cpu_mp, SI_SUB_CPU, SI_ORDER_THIRD, mp_start, NULL); @@ -823,6 +837,7 @@ static void mp_setvariables_for_up(void *dummy) { mp_ncpus = 1; + mp_ncores = 1; mp_maxid = PCPU_GET(cpuid); CPU_SETOF(mp_maxid, &all_cpus); KASSERT(PCPU_GET(cpuid) == 0, ("UP must have a CPU ID of zero")); Modified: head/sys/powerpc/powernv/platform_powernv.c ============================================================================== --- head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:31:17 2019 (r342771) @@ -435,12 +435,16 @@ powernv_smp_topo(platform_t plat) break; } + smp_threads_per_core = nthreads; + if (mp_ncpus % nthreads != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d threads, %d on first core)\n", mp_ncpus, nthreads); return (smp_topo_none()); } + + mp_ncores = mp_ncpus / nthreads; /* Don't do anything fancier for non-threaded SMP */ if (nthreads == 1) Modified: head/sys/powerpc/powerpc/mp_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:31:17 2019 (r342771) @@ -186,6 +186,11 @@ cpu_mp_start(void) next: error = platform_smp_next_cpu(&cpu); } + +#ifdef SMP + /* Probe mp_ncores and smp_threads_per_core as a side effect. */ + (void)cpu_topo(); +#endif } void Modified: head/sys/powerpc/ps3/platform_ps3.c ============================================================================== --- head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:31:17 2019 (r342771) @@ -246,6 +246,8 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) static struct cpu_group * ps3_smp_topo(platform_t plat) { + mp_ncores = 1; + smp_threads_per_core = 2; return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); } #endif Modified: head/sys/powerpc/pseries/platform_chrp.c ============================================================================== --- head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:31:17 2019 (r342771) @@ -517,6 +517,8 @@ chrp_smp_topo(platform_t plat) ncpus++; } + mp_ncores = ncores; + if (ncpus % ncores != 0) { printf("WARNING: Irregular SMP topology. Performance may be " "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); @@ -527,6 +529,7 @@ chrp_smp_topo(platform_t plat) if (ncpus == ncores) return (smp_topo_none()); + smp_threads_per_core = ncpus / ncores; return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); } #endif Modified: head/sys/sys/smp.h ============================================================================== --- head/sys/sys/smp.h Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/sys/smp.h Fri Jan 4 18:31:17 2019 (r342771) @@ -167,8 +167,10 @@ extern cpuset_t logical_cpus_mask; extern u_int mp_maxid; extern int mp_maxcpus; +extern int mp_ncores; extern int mp_ncpus; extern volatile int smp_started; +extern int smp_threads_per_core; extern cpuset_t all_cpus; extern cpuset_t cpuset_domain[MAXMEMDOM]; /* CPUs in each NUMA domain. */ Modified: head/sys/x86/x86/mp_x86.c ============================================================================== --- head/sys/x86/x86/mp_x86.c Fri Jan 4 18:21:49 2019 (r342770) +++ head/sys/x86/x86/mp_x86.c Fri Jan 4 18:31:17 2019 (r342771) @@ -607,6 +607,7 @@ assign_cpu_ids(void) { struct topo_node *node; u_int smt_mask; + int nhyper; smt_mask = (1u << core_id_shift) - 1; @@ -615,6 +616,7 @@ assign_cpu_ids(void) * beyond MAXCPU. CPU 0 is always assigned to the BSP. */ mp_ncpus = 0; + nhyper = 0; TOPO_FOREACH(node, &topo_root) { if (node->type != TOPO_TYPE_PU) continue; @@ -642,6 +644,9 @@ assign_cpu_ids(void) continue; } + if (cpu_info[node->hwid].cpu_hyperthread) + nhyper++; + cpu_apic_ids[mp_ncpus] = node->hwid; apic_cpuids[node->hwid] = mp_ncpus; topo_set_pu_id(node, mp_ncpus); @@ -651,6 +656,9 @@ assign_cpu_ids(void) KASSERT(mp_maxid >= mp_ncpus - 1, ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid, mp_ncpus)); + + mp_ncores = mp_ncpus - nhyper; + smp_threads_per_core = mp_ncpus / mp_ncores; } /* From owner-svn-src-head@freebsd.org Fri Jan 4 18:34:45 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BE0F1434E61; Fri, 4 Jan 2019 18:34:45 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B2ACA75898; Fri, 4 Jan 2019 18:34:44 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F8FE4B40; Fri, 4 Jan 2019 18:34:44 +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 x04IYidu074154; Fri, 4 Jan 2019 18:34:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IYicA074153; Fri, 4 Jan 2019 18:34:44 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201901041834.x04IYicA074153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 4 Jan 2019 18:34:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342772 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342772 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B2ACA75898 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 18:34:45 -0000 Author: cem Date: Fri Jan 4 18:34:44 2019 New Revision: 342772 URL: https://svnweb.freebsd.org/changeset/base/342772 Log: Bump __FreeBSD_version for r342771 Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Fri Jan 4 18:31:17 2019 (r342771) +++ head/sys/sys/param.h Fri Jan 4 18:34:44 2019 (r342772) @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@freebsd.org Fri Jan 4 18:35:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A4A81434EE7; Fri, 4 Jan 2019 18:35:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 410FA75A1C; Fri, 4 Jan 2019 18:35:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30B8F4B42; Fri, 4 Jan 2019 18:35:26 +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 x04IZQgH074241; Fri, 4 Jan 2019 18:35:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IZQsb074240; Fri, 4 Jan 2019 18:35:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201901041835.x04IZQsb074240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 4 Jan 2019 18:35:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342773 - head/lib/csu/tests X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/csu/tests X-SVN-Commit-Revision: 342773 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 410FA75A1C X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.96)[-0.965,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 18:35:26 -0000 Author: emaste Date: Fri Jan 4 18:35:25 2019 New Revision: 342773 URL: https://svnweb.freebsd.org/changeset/base/342773 Log: Add explicit csu test dependency lib/csu/tests/dynamiclib requires libh_csu.so be built first. I'm not sure this is the most correct/best way to address this but it solves the issue in my testing. PR: 233734 Sponsored by: The FreeBSD Foundation Modified: head/lib/csu/tests/Makefile Modified: head/lib/csu/tests/Makefile ============================================================================== --- head/lib/csu/tests/Makefile Fri Jan 4 18:34:44 2019 (r342772) +++ head/lib/csu/tests/Makefile Fri Jan 4 18:35:25 2019 (r342773) @@ -5,4 +5,6 @@ TESTS_SUBDIRS= dynamic TESTS_SUBDIRS+= dynamiclib TESTS_SUBDIRS+= static +SUBDIR_DEPEND_dynamiclib=dso + .include From owner-svn-src-head@freebsd.org Fri Jan 4 18:38:28 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A066F143513E; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4589B75DB0; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 336D14B44; Fri, 4 Jan 2019 18:38:28 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04IcSni074419; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04IcSXf074418; Fri, 4 Jan 2019 18:38:28 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <201901041838.x04IcSXf074418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Fri, 4 Jan 2019 18:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342774 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 342774 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4589B75DB0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 18:38:29 -0000 Author: gallatin Date: Fri Jan 4 18:38:27 2019 New Revision: 342774 URL: https://svnweb.freebsd.org/changeset/base/342774 Log: Limit git history searches in newvers.sh newvers.sh takes upwards of 4-5 seconds to complete on trees checked out from github, due to searching the entire history for non-existent git-svn metadata. Similarly, if one does not check out notes, we again search the entire history for notes. That makes newvers.sh very slow for many github users. To fix this in a fair way, limit the history search to the last 10K commits: if you're more than 10K commits out of sync, then you've forked the project, and our SVN rev is no longer very important to you. Due to how git implements --grep in conjunction with -n, --grep has been removed for performance reasons (git does not seem to limit its search to the -n limit in this case, and takes just as long as it did with no limit). Reviewed by: emaste, imp Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D18745 Modified: head/sys/conf/newvers.sh Modified: head/sys/conf/newvers.sh ============================================================================== --- head/sys/conf/newvers.sh Fri Jan 4 18:35:25 2019 (r342773) +++ head/sys/conf/newvers.sh Fri Jan 4 18:38:27 2019 (r342774) @@ -243,11 +243,15 @@ if [ -n "$git_cmd" ] ; then svn=" r${gitsvn}" git="=${git}" else - gitsvn=`$git_cmd log --grep '^git-svn-id:' | \ +# Log searches are limited to 10k commits to speed up failures. +# We assume that if a tree is more than 10k commits out-of-sync +# with FreeBSD, it has forked the the OS and the SVN rev no +# longer matters. + gitsvn=`$git_cmd log -n 10000 | grep '^ git-svn-id:' | head -1 | \ sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` if [ -z "$gitsvn" ] ; then - gitsvn=`$git_cmd log --format='format:%N' | \ + gitsvn=`$git_cmd log -n 10000 --format='format:%N' | \ grep '^svn ' | head -1 | \ sed -n 's/^.*revision=\([0-9][0-9]*\).*$/\1/p'` fi From owner-svn-src-head@freebsd.org Fri Jan 4 19:07:31 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B1181435DA4; Fri, 4 Jan 2019 19:07:31 +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 B519576F78; Fri, 4 Jan 2019 19:07:30 +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 x04J7R7K084675; Fri, 4 Jan 2019 11:07: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 x04J7Rse084674; Fri, 4 Jan 2019 11:07:27 -0800 (PST) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201901041907.x04J7Rse084674@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r342771 - in head: share/man/man4 sys/kern sys/powerpc/powernv sys/powerpc/powerpc sys/powerpc/ps3 sys/powerpc/pseries sys/sys sys/x86/x86 In-Reply-To: <201901041831.x04IVHa5070991@repo.freebsd.org> To: Conrad Meyer Date: Fri, 4 Jan 2019 11:07: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-Rspamd-Queue-Id: B519576F78 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.97 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 19:07:31 -0000 > Author: cem > Date: Fri Jan 4 18:31:17 2019 > New Revision: 342771 > URL: https://svnweb.freebsd.org/changeset/base/342771 > > Log: > Expose threads-per-core and physical core count information > > With new sysctls (to the best of our ability do detect them). Restructured > smp.4 slightly for clarity (keep relevant stuff closer to the top) while > documenting. > > Reviewed by: markj, jhibbits (ppc parts) > MFC after: 3 days > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D18322 > > Modified: > head/share/man/man4/smp.4 > head/sys/kern/subr_smp.c > head/sys/powerpc/powernv/platform_powernv.c > head/sys/powerpc/powerpc/mp_machdep.c > head/sys/powerpc/ps3/platform_ps3.c > head/sys/powerpc/pseries/platform_chrp.c > head/sys/sys/smp.h > head/sys/x86/x86/mp_x86.c Can you please alter this to match how topology is expressed by most tools, Sockets, Cores per socket, Threads per core. ncpu = S * C * T This matches how bhyve, qemu, kvm and others express this information. Thanks, Rod > Modified: head/share/man/man4/smp.4 > ============================================================================== > --- head/share/man/man4/smp.4 Fri Jan 4 18:21:49 2019 (r342770) > +++ head/share/man/man4/smp.4 Fri Jan 4 18:31:17 2019 (r342771) > @@ -23,7 +23,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January 6, 2018 > +.Dd January 4, 2019 > .Dt SMP 4 > .Os > .Sh NAME > @@ -35,27 +35,6 @@ > The > .Nm > kernel implements symmetric multi-processor support. > -.Sh COMPATIBILITY > -Support for multi-processor systems is present for all Tier-1 > -architectures on > -.Fx . > -Currently, this includes amd64, i386 and sparc64. > -Support is enabled using > -.Cd options SMP . > -It is permissible to use the SMP kernel configuration on non-SMP equipped > -motherboards. > -.Sh I386 NOTES > -For i386 systems, the > -.Nm > -kernel supports motherboards that follow the Intel MP specification, > -version 1.4. > -In addition to > -.Cd options SMP , > -i386 also requires > -.Cd device apic . > -The > -.Xr mptable 1 > -command may be used to view the status of multi-processor support. > .Pp > .Nm > support can be disabled by setting the loader tunable > @@ -66,6 +45,13 @@ The number of CPUs detected by the system is available > the read-only sysctl variable > .Va hw.ncpu . > .Pp > +The number of online threads per CPU core is available in the read-only sysctl > +variable > +.Va kern.smp.threads_per_core . > +The number of physical CPU cores detected by the system is available in the > +read-only sysctl variable > +.Va kern.smp.cores . > +.Pp > .Fx > allows specific CPUs on a multi-processor system to be disabled. > This can be done using the > @@ -74,6 +60,12 @@ tunable, where X is the APIC ID of a CPU. > Setting this tunable to 1 will result in the corresponding CPU being > disabled. > .Pp > +.Fx > +supports simultaneous multithreading on x86 and powerpc platforms. > +On x86, the logical CPUs can be disabled by setting the > +.Va machdep.hyperthreading_allowed > +tunable to zero. > +.Pp > The > .Xr sched_ule 4 > scheduler implements CPU topology detection and adjusts the scheduling > @@ -122,13 +114,26 @@ two quad-core processors is: > .Pp > This information is used internally by the kernel to schedule related > tasks on CPUs that are closely grouped together. > -.Pp > -.Fx > -supports hyperthreading on Intel CPU's on the i386 and AMD64 platforms. > -Because using logical CPUs can cause performance penalties under certain loads, > -the logical CPUs can be disabled by setting the > -.Va machdep.hyperthreading_allowed > -tunable to zero. > +.Sh COMPATIBILITY > +Support for multi-processor systems is present for all Tier-1 and Tier-2 > +architectures on > +.Fx . > +Currently, this includes x86, powerpc, arm, and sparc64. > +Support is enabled using > +.Cd options SMP . > +It is permissible to use the SMP kernel configuration on non-SMP hardware. > +.Sh I386 NOTES > +For i386 systems, the > +.Nm > +kernel supports motherboards that follow the Intel MP specification, > +version 1.4. > +In addition to > +.Cd options SMP , > +i386 also requires > +.Cd device apic . > +The > +.Xr mptable 1 > +command may be used to view the status of multi-processor support. > .Sh SEE ALSO > .Xr cpuset 1 , > .Xr mptable 1 , > @@ -166,3 +171,20 @@ in > also introduced support for SMP on the sparc64 architecture. > .Sh AUTHORS > .An Steve Passe Aq Mt fsmp@FreeBSD.org > +.Sh CAVEATS > +The > +.Va kern.smp.threads_per_core > +and > +.Va kern.smp.cores > +sysctl variables are provided as a best-effort guess. > +If an architecture or platform adds SMT and > +.Fx > +has not yet implemented detection, the reported values may be inaccurate. > +In this case, > +.Va kern.smp.threads_per_core > +will report > +.Dv 1 > +and > +.Va kern.smp.cores > +will report the same value as > +.Va hw.ncpu . > > Modified: head/sys/kern/subr_smp.c > ============================================================================== > --- head/sys/kern/subr_smp.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/kern/subr_smp.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -98,6 +98,14 @@ int smp_cpus = 1; /* how many cpu's running */ > SYSCTL_INT(_kern_smp, OID_AUTO, cpus, CTLFLAG_RD|CTLFLAG_CAPRD, &smp_cpus, 0, > "Number of CPUs online"); > > +int smp_threads_per_core = 1; /* how many SMT threads are running per core */ > +SYSCTL_INT(_kern_smp, OID_AUTO, threads_per_core, CTLFLAG_RD|CTLFLAG_CAPRD, > + &smp_threads_per_core, 0, "Number of SMT threads online per core"); > + > +int mp_ncores = -1; /* how many physical cores running */ > +SYSCTL_INT(_kern_smp, OID_AUTO, cores, CTLFLAG_RD|CTLFLAG_CAPRD, &mp_ncores, 0, > + "Number of CPUs online"); > + > int smp_topology = 0; /* Which topology we're using. */ > SYSCTL_INT(_kern_smp, OID_AUTO, topology, CTLFLAG_RDTUN, &smp_topology, 0, > "Topology override setting; 0 is default provided by hardware."); > @@ -154,6 +162,7 @@ mp_start(void *dummy) > > /* Probe for MP hardware. */ > if (smp_disabled != 0 || cpu_mp_probe() == 0) { > + mp_ncores = 1; > mp_ncpus = 1; > CPU_SETOF(PCPU_GET(cpuid), &all_cpus); > return; > @@ -162,6 +171,11 @@ mp_start(void *dummy) > cpu_mp_start(); > printf("FreeBSD/SMP: Multiprocessor System Detected: %d CPUs\n", > mp_ncpus); > + > + /* Provide a default for most architectures that don't have SMT/HTT. */ > + if (mp_ncores < 0) > + mp_ncores = mp_ncpus; > + > cpu_mp_announce(); > } > SYSINIT(cpu_mp, SI_SUB_CPU, SI_ORDER_THIRD, mp_start, NULL); > @@ -823,6 +837,7 @@ static void > mp_setvariables_for_up(void *dummy) > { > mp_ncpus = 1; > + mp_ncores = 1; > mp_maxid = PCPU_GET(cpuid); > CPU_SETOF(mp_maxid, &all_cpus); > KASSERT(PCPU_GET(cpuid) == 0, ("UP must have a CPU ID of zero")); > > Modified: head/sys/powerpc/powernv/platform_powernv.c > ============================================================================== > --- head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/powernv/platform_powernv.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -435,12 +435,16 @@ powernv_smp_topo(platform_t plat) > break; > } > > + smp_threads_per_core = nthreads; > + > if (mp_ncpus % nthreads != 0) { > printf("WARNING: Irregular SMP topology. Performance may be " > "suboptimal (%d threads, %d on first core)\n", > mp_ncpus, nthreads); > return (smp_topo_none()); > } > + > + mp_ncores = mp_ncpus / nthreads; > > /* Don't do anything fancier for non-threaded SMP */ > if (nthreads == 1) > > Modified: head/sys/powerpc/powerpc/mp_machdep.c > ============================================================================== > --- head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/powerpc/mp_machdep.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -186,6 +186,11 @@ cpu_mp_start(void) > next: > error = platform_smp_next_cpu(&cpu); > } > + > +#ifdef SMP > + /* Probe mp_ncores and smp_threads_per_core as a side effect. */ > + (void)cpu_topo(); > +#endif > } > > void > > Modified: head/sys/powerpc/ps3/platform_ps3.c > ============================================================================== > --- head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/ps3/platform_ps3.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -246,6 +246,8 @@ ps3_smp_start_cpu(platform_t plat, struct pcpu *pc) > static struct cpu_group * > ps3_smp_topo(platform_t plat) > { > + mp_ncores = 1; > + smp_threads_per_core = 2; > return (smp_topo_1level(CG_SHARE_L1, 2, CG_FLAG_SMT)); > } > #endif > > Modified: head/sys/powerpc/pseries/platform_chrp.c > ============================================================================== > --- head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/powerpc/pseries/platform_chrp.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -517,6 +517,8 @@ chrp_smp_topo(platform_t plat) > ncpus++; > } > > + mp_ncores = ncores; > + > if (ncpus % ncores != 0) { > printf("WARNING: Irregular SMP topology. Performance may be " > "suboptimal (%d CPUS, %d cores)\n", ncpus, ncores); > @@ -527,6 +529,7 @@ chrp_smp_topo(platform_t plat) > if (ncpus == ncores) > return (smp_topo_none()); > > + smp_threads_per_core = ncpus / ncores; > return (smp_topo_1level(CG_SHARE_L1, ncpus / ncores, CG_FLAG_SMT)); > } > #endif > > Modified: head/sys/sys/smp.h > ============================================================================== > --- head/sys/sys/smp.h Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/sys/smp.h Fri Jan 4 18:31:17 2019 (r342771) > @@ -167,8 +167,10 @@ extern cpuset_t logical_cpus_mask; > > extern u_int mp_maxid; > extern int mp_maxcpus; > +extern int mp_ncores; > extern int mp_ncpus; > extern volatile int smp_started; > +extern int smp_threads_per_core; > > extern cpuset_t all_cpus; > extern cpuset_t cpuset_domain[MAXMEMDOM]; /* CPUs in each NUMA domain. */ > > Modified: head/sys/x86/x86/mp_x86.c > ============================================================================== > --- head/sys/x86/x86/mp_x86.c Fri Jan 4 18:21:49 2019 (r342770) > +++ head/sys/x86/x86/mp_x86.c Fri Jan 4 18:31:17 2019 (r342771) > @@ -607,6 +607,7 @@ assign_cpu_ids(void) > { > struct topo_node *node; > u_int smt_mask; > + int nhyper; > > smt_mask = (1u << core_id_shift) - 1; > > @@ -615,6 +616,7 @@ assign_cpu_ids(void) > * beyond MAXCPU. CPU 0 is always assigned to the BSP. > */ > mp_ncpus = 0; > + nhyper = 0; > TOPO_FOREACH(node, &topo_root) { > if (node->type != TOPO_TYPE_PU) > continue; > @@ -642,6 +644,9 @@ assign_cpu_ids(void) > continue; > } > > + if (cpu_info[node->hwid].cpu_hyperthread) > + nhyper++; > + > cpu_apic_ids[mp_ncpus] = node->hwid; > apic_cpuids[node->hwid] = mp_ncpus; > topo_set_pu_id(node, mp_ncpus); > @@ -651,6 +656,9 @@ assign_cpu_ids(void) > KASSERT(mp_maxid >= mp_ncpus - 1, > ("%s: counters out of sync: max %d, count %d", __func__, mp_maxid, > mp_ncpus)); > + > + mp_ncores = mp_ncpus - nhyper; > + smp_threads_per_core = mp_ncpus / mp_ncores; > } > > /* > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-head@freebsd.org Fri Jan 4 19:10:47 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E8AC1435FE2; Fri, 4 Jan 2019 19:10:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45A1A77351; Fri, 4 Jan 2019 19:10:47 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 36981508B; Fri, 4 Jan 2019 19:10:47 +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 x04JAlrX090624; Fri, 4 Jan 2019 19:10:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04JAlmu090623; Fri, 4 Jan 2019 19:10:47 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201901041910.x04JAlmu090623@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 4 Jan 2019 19:10:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342775 - head/sys/i386/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/i386/include X-SVN-Commit-Revision: 342775 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45A1A77351 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.98)[-0.978,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 19:10:47 -0000 Author: kib Date: Fri Jan 4 19:10:46 2019 New Revision: 342775 URL: https://svnweb.freebsd.org/changeset/base/342775 Log: Fix i386 LINT build after r342769. It seems that libkern/mcount.c is the only consumer of vm/pmap.h that does not include machine/atomic.h. Make it work by bringing machine/atomic.h when pmap.h is used for kernel non-asm .c file. Sponsored by: The FreeBSD Foundation MFC after: 1 week Modified: head/sys/i386/include/pmap.h Modified: head/sys/i386/include/pmap.h ============================================================================== --- head/sys/i386/include/pmap.h Fri Jan 4 18:38:27 2019 (r342774) +++ head/sys/i386/include/pmap.h Fri Jan 4 19:10:46 2019 (r342775) @@ -194,6 +194,8 @@ typedef uint32_t pt_entry_t; * Address of current address space page table maps and directories. */ #ifdef _KERNEL +#include + extern pt_entry_t PTmap[]; extern pd_entry_t PTD[]; extern pd_entry_t PTDpde[]; From owner-svn-src-head@freebsd.org Fri Jan 4 19:20:20 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98990143646C; Fri, 4 Jan 2019 19:20:20 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F79677A03; Fri, 4 Jan 2019 19:20:20 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 30B59521E; Fri, 4 Jan 2019 19:20:20 +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 x04JKKmo095598; Fri, 4 Jan 2019 19:20:20 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04JKKpN095597; Fri, 4 Jan 2019 19:20:20 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901041920.x04JKKpN095597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 4 Jan 2019 19:20:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342776 - head/sbin/savecore X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sbin/savecore X-SVN-Commit-Revision: 342776 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3F79677A03 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.95 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 19:20:20 -0000 Author: markj Date: Fri Jan 4 19:20:19 2019 New Revision: 342776 URL: https://svnweb.freebsd.org/changeset/base/342776 Log: Disable savecore(8)'s libcasper support when WITHOUT_DYNAMICROOT=yes. This follows the example of other Capsicumized programs in /sbin. Reported by: Manfred Antar MFC with: r342699 Sponsored by: The FreeBSD Foundation Modified: head/sbin/savecore/Makefile Modified: head/sbin/savecore/Makefile ============================================================================== --- head/sbin/savecore/Makefile Fri Jan 4 19:10:46 2019 (r342775) +++ head/sbin/savecore/Makefile Fri Jan 4 19:20:19 2019 (r342776) @@ -11,7 +11,9 @@ MAN= savecore.8 .include -.if ${MK_CASPER} != "no" && !defined(RESCUE) +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) CFLAGS+= -DWITH_CASPER LIBADD+= casper cap_fileargs cap_syslog .endif From owner-svn-src-head@freebsd.org Fri Jan 4 21:09:39 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ADD8B1439EF4; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 54BA2849E4; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3B91D6481; Fri, 4 Jan 2019 21:09:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04L9d1Y054985; Fri, 4 Jan 2019 21:09:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04L9ced054983; Fri, 4 Jan 2019 21:09:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201901042109.x04L9ced054983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 4 Jan 2019 21:09:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342778 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 342778 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 54BA2849E4 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_SHORT(-0.97)[-0.970,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 21:09:39 -0000 Author: hselasky Date: Fri Jan 4 21:09:38 2019 New Revision: 342778 URL: https://svnweb.freebsd.org/changeset/base/342778 Log: Reduce timeout for reading the USB HUB port status to 1000ms and try to filter out dead USB HUB devices by implementing an error counter, so that the USB enumeration thread does not spend all its time reading from non-responding devices, blocking user-space access in the end. Tested by: Matthias Apitz MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_hub.c head/sys/dev/usb/usb_request.c Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Fri Jan 4 21:05:40 2019 (r342777) +++ head/sys/dev/usb/usb_hub.c Fri Jan 4 21:09:38 2019 (r342778) @@ -129,6 +129,8 @@ struct uhub_softc { int sc_disable_enumeration; int sc_disable_port_power; #endif + uint8_t sc_usb_port_errors; /* error counter */ +#define UHUB_USB_PORT_ERRORS_MAX 4 uint8_t sc_flags; #define UHUB_FLAG_DID_EXPLORE 0x01 }; @@ -587,13 +589,25 @@ uhub_read_port_status(struct uhub_softc *sc, uint8_t p struct usb_port_status ps; usb_error_t err; + if (sc->sc_usb_port_errors >= UHUB_USB_PORT_ERRORS_MAX) { + DPRINTFN(4, "port %d, HUB looks dead, too many errors\n", portno); + sc->sc_st.port_status = 0; + sc->sc_st.port_change = 0; + return (USB_ERR_TIMEOUT); + } + err = usbd_req_get_port_status( sc->sc_udev, NULL, &ps, portno); - /* update status regardless of error */ - - sc->sc_st.port_status = UGETW(ps.wPortStatus); - sc->sc_st.port_change = UGETW(ps.wPortChange); + if (err == 0) { + sc->sc_st.port_status = UGETW(ps.wPortStatus); + sc->sc_st.port_change = UGETW(ps.wPortChange); + sc->sc_usb_port_errors = 0; + } else { + sc->sc_st.port_status = 0; + sc->sc_st.port_change = 0; + sc->sc_usb_port_errors++; + } /* debugging print */ Modified: head/sys/dev/usb/usb_request.c ============================================================================== --- head/sys/dev/usb/usb_request.c Fri Jan 4 21:05:40 2019 (r342777) +++ head/sys/dev/usb/usb_request.c Fri Jan 4 21:09:38 2019 (r342778) @@ -1601,8 +1601,9 @@ usbd_req_get_port_status(struct usb_device *udev, stru USETW(req.wValue, 0); req.wIndex[0] = port; req.wIndex[1] = 0; - USETW(req.wLength, sizeof *ps); - return (usbd_do_request(udev, mtx, &req, ps)); + USETW(req.wLength, sizeof(*ps)); + + return (usbd_do_request_flags(udev, mtx, &req, ps, 0, NULL, 1000)); } /*------------------------------------------------------------------------* From owner-svn-src-head@freebsd.org Fri Jan 4 21:12:18 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA0DE143A1A0; Fri, 4 Jan 2019 21:12:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A72784E90; Fri, 4 Jan 2019 21:12:18 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C8A5661E; Fri, 4 Jan 2019 21:12:18 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x04LCIDP056629; Fri, 4 Jan 2019 21:12:18 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x04LCItG056628; Fri, 4 Jan 2019 21:12:18 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901042112.x04LCItG056628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 4 Jan 2019 21:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342779 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 342779 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A72784E90 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.968,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 04 Jan 2019 21:12:19 -0000 Author: kp Date: Fri Jan 4 21:12:17 2019 New Revision: 342779 URL: https://svnweb.freebsd.org/changeset/base/342779 Log: Remove unneeded NULL check for td_ucred td_ucred is always set, so we don't need the ternary expression to check for it. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Fri Jan 4 21:09:38 2019 (r342778) +++ head/sys/kern/kern_sig.c Fri Jan 4 21:12:17 2019 (r342779) @@ -3100,7 +3100,7 @@ killproc(struct proc *p, char *why) p->p_comm); log(LOG_ERR, "pid %d (%s), jid %d, uid %d, was killed: %s\n", p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, - p->p_ucred ? p->p_ucred->cr_uid : -1, why); + p->p_ucred->cr_uid, why); proc_wkilled(p); kern_psignal(p, SIGKILL); } @@ -3146,7 +3146,7 @@ sigexit(struct thread *td, int sig) "pid %d (%s), jid %d, uid %d: exited on " "signal %d%s\n", p->p_pid, p->p_comm, p->p_ucred->cr_prison->pr_id, - td->td_ucred ? td->td_ucred->cr_uid : -1, + td->td_ucred->cr_uid, sig &~ WCOREFLAG, sig & WCOREFLAG ? " (core dumped)" : ""); } else From owner-svn-src-head@freebsd.org Sat Jan 5 05:50:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45944148C774; Sat, 5 Jan 2019 05:50:17 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E22B06AAC5; Sat, 5 Jan 2019 05:50:16 +0000 (UTC) (envelope-from kp@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D0059C353; Sat, 5 Jan 2019 05:50:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x055oG7g028214; Sat, 5 Jan 2019 05:50:16 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x055oGW7028213; Sat, 5 Jan 2019 05:50:16 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201901050550.x055oGW7028213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sat, 5 Jan 2019 05:50:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342784 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 342784 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E22B06AAC5 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.93 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.934,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 05:50:17 -0000 Author: kp Date: Sat Jan 5 05:50:16 2019 New Revision: 342784 URL: https://svnweb.freebsd.org/changeset/base/342784 Log: pf: Remove references to pflow from the pf.conf man page pflow no longer exists. It was removed as part of a pf update back in 2012 (r240233). PR: 223957 MFC after: 1 week Modified: head/share/man/man5/pf.conf.5 Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Sat Jan 5 05:20:36 2019 (r342783) +++ head/share/man/man5/pf.conf.5 Sat Jan 5 05:50:16 2019 (r342784) @@ -28,7 +28,7 @@ .\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd October 27, 2018 +.Dd January 5, 2019 .Dt PF.CONF 5 .Os .Sh NAME @@ -547,7 +547,7 @@ without an explicit .Ar keep state . For example: .Bd -literal -offset indent -set state-defaults pflow, no-sync +set state-defaults no-sync .Ed .It Ar set hostid The 32-bit @@ -2136,10 +2136,6 @@ easier. This is intended to be used in situations where one does not see all packets of a connection, e.g. in asymmetric routing situations. Cannot be used with modulate or synproxy state. -.It Ar pflow -States created by this rule are exported on the -.Xr pflow 4 -interface. .El .Pp Multiple options can be specified, separated by commas: @@ -3009,7 +3005,7 @@ tos = ( "lowdelay" | "throughput" | "reliab [ "0x" ] number ) state-opts = state-opt [ [ "," ] state-opts ] -state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "pflow" | +state-opt = ( "max" number | "no-sync" | timeout | "sloppy" | "source-track" [ ( "rule" | "global" ) ] | "max-src-nodes" number | "max-src-states" number | "max-src-conn" number | @@ -3072,7 +3068,6 @@ Service name database. .Xr ip 4 , .Xr ip6 4 , .Xr pf 4 , -.Xr pflow 4 , .Xr pfsync 4 , .Xr tcp 4 , .Xr udp 4 , From owner-svn-src-head@freebsd.org Sat Jan 5 07:20:01 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E729B14905F7; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8D8206E013; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E99ED2E6; Sat, 5 Jan 2019 07:20:00 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x057K0W8074398; Sat, 5 Jan 2019 07:20:00 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x057K0As074397; Sat, 5 Jan 2019 07:20:00 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201901050720.x057K0As074397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Sat, 5 Jan 2019 07:20:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342785 - head/stand/i386/libi386 X-SVN-Group: head X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: head/stand/i386/libi386 X-SVN-Commit-Revision: 342785 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8D8206E013 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.96 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.96)[-0.958,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 07:20:01 -0000 Author: tsoome Date: Sat Jan 5 07:20:00 2019 New Revision: 342785 URL: https://svnweb.freebsd.org/changeset/base/342785 Log: With buggy int13 ah=15, we can mis-identify the floppy devices. We have no option than trust INT13 ah=08 return code during the init phase. PR: 234460 Reported by: Oleh Hushchenkov MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18723 Modified: head/stand/i386/libi386/biosdisk.c Modified: head/stand/i386/libi386/biosdisk.c ============================================================================== --- head/stand/i386/libi386/biosdisk.c Sat Jan 5 05:50:16 2019 (r342784) +++ head/stand/i386/libi386/biosdisk.c Sat Jan 5 07:20:00 2019 (r342785) @@ -136,6 +136,8 @@ static int bd_ioctl(struct open_file *f, u_long cmd, v static int bd_print(int verbose); static int cd_print(int verbose); static int fd_print(int verbose); +static void bd_reset_disk(int); +static int bd_get_diskinfo_std(struct bdinfo *); struct devsw biosfd = { .dv_name = "fd", @@ -252,20 +254,52 @@ bd_unit2bios(struct i386_devdesc *dev) } /* + * Use INT13 AH=15 - Read Drive Type. + */ +static int +fd_count(void) +{ + int drive; + + for (drive = 0; drive < MAXBDDEV; drive++) { + bd_reset_disk(drive); + + v86.ctl = V86_FLAGS; + v86.addr = 0x13; + v86.eax = 0x1500; + v86.edx = drive; + v86int(); + + if (V86_CY(v86.efl)) + break; + + if ((v86.eax & 0x300) == 0) + break; + } + + return (drive); +} + +/* * Quiz the BIOS for disk devices, save a little info about them. */ static int fd_init(void) { - int unit; + int unit, numfd; bdinfo_t *bd; - for (unit = 0; unit < MAXBDDEV; unit++) { + numfd = fd_count(); + for (unit = 0; unit < numfd; unit++) { if ((bd = calloc(1, sizeof(*bd))) == NULL) break; + + bd->bd_sectorsize = BIOSDISK_SECSIZE; bd->bd_flags = BD_FLOPPY; bd->bd_unit = unit; - if (!bd_int13probe(bd)) { + + /* Use std diskinfo for floppy drive */ + if (bd_get_diskinfo_std(bd) != 0) { free(bd); break; } @@ -382,6 +416,10 @@ bc_add(int biosdev) static int bd_check_extensions(int unit) { + /* do not use ext calls for floppy devices */ + if (unit < 0x80) + return (0); + /* Determine if we can use EDD with this device. */ v86.ctl = V86_FLAGS; v86.addr = 0x13; From owner-svn-src-head@freebsd.org Sat Jan 5 15:28:21 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1970149E7AF; Sat, 5 Jan 2019 15:28:21 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 45E3786FC0; Sat, 5 Jan 2019 15:28:21 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38CD11A737; Sat, 5 Jan 2019 15:28:21 +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 x05FSLr2032770; Sat, 5 Jan 2019 15:28:21 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05FSLRx032769; Sat, 5 Jan 2019 15:28:21 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901051528.x05FSLRx032769@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Jan 2019 15:28:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342787 - head/sys/dev/tws X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/dev/tws X-SVN-Commit-Revision: 342787 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 45E3786FC0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.970,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 15:28:21 -0000 Author: markj Date: Sat Jan 5 15:28:20 2019 New Revision: 342787 URL: https://svnweb.freebsd.org/changeset/base/342787 Log: Add a bounds check to the tws(4) passthrough ioctl handler. tws_passthru() was doing a copyin of a user-specified request without validating its length, so a malicious request could overrun the buffer. By default, the tws(4) device file is only accessible as root. admbug: 825 Reported by: Anonymous of the Shellphish Grill Team Reviewed by: delphij MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D18536 Modified: head/sys/dev/tws/tws_user.c Modified: head/sys/dev/tws/tws_user.c ============================================================================== --- head/sys/dev/tws/tws_user.c Sat Jan 5 15:09:50 2019 (r342786) +++ head/sys/dev/tws/tws_user.c Sat Jan 5 15:28:20 2019 (r342787) @@ -92,9 +92,13 @@ tws_passthru(struct tws_softc *sc, void *buf) struct tws_request *req; struct tws_ioctl_no_data_buf *ubuf = (struct tws_ioctl_no_data_buf *)buf; int error; + u_int32_t buffer_length; u_int16_t lun4; - + buffer_length = roundup2(ubuf->driver_pkt.buffer_length, 512); + if ( buffer_length > TWS_MAX_IO_SIZE ) { + return(EINVAL); + } if ( tws_get_state(sc) != TWS_ONLINE) { return(EBUSY); } @@ -118,7 +122,7 @@ tws_passthru(struct tws_softc *sc, void *buf) } } while(1); - req->length = (ubuf->driver_pkt.buffer_length + 511) & ~511; + req->length = buffer_length; TWS_TRACE_DEBUG(sc, "datal,rid", req->length, req->request_id); if ( req->length ) { req->data = sc->ioctl_data_mem; From owner-svn-src-head@freebsd.org Sat Jan 5 16:05:41 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CB98149FA80; Sat, 5 Jan 2019 16:05:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A94B889E7; Sat, 5 Jan 2019 16:05: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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EDD9F1ADEA; Sat, 5 Jan 2019 16:05:40 +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 x05G5eCU054485; Sat, 5 Jan 2019 16:05:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05G5dj8054476; Sat, 5 Jan 2019 16:05:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201901051605.x05G5dj8054476@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 5 Jan 2019 16:05:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342788 - in head: sbin/rtsol usr.sbin/rtsold X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: sbin/rtsol usr.sbin/rtsold X-SVN-Commit-Revision: 342788 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A94B889E7 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.975,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 16:05:41 -0000 Author: markj Date: Sat Jan 5 16:05:39 2019 New Revision: 342788 URL: https://svnweb.freebsd.org/changeset/base/342788 Log: Capsicumize rtsol(8) and rtsold(8). These programs parse ND6 Router Advertisement messages; rtsold(8) has required an SA, SA-14:20.rtsold, for a bug in this code. Thus, they are good candidates for sandboxing. The approach taken is to run the main executable in capability mode and use Casper services to provide functionality that cannot be implemented within the sandbox. In particular, several custom services were required. - A Casper service is used to send Router Solicitation messages on a raw ICMP6 socket. Initially I took the approach of creating a socket for each interface upon startup, and connect(2)ing it to the all-routers multicast group for the interface. This permits the use of sendmsg(2) in capability mode, but only works if the interface's link is up when rtsol(d) starts. So, instead, the rtsold.sendmsg service is used to transmit RS messages on behalf of the main process. One could alternately define a service which simply creates and connects a socket for each destination address, and returns the socket to the sandboxed process. However, to implement rtsold's -m option we also need to read the ND6 default router list, and this cannot be done in capability mode. - rtsold may execute resolvconf(8) in response to RDNSS and DNSSL options in received RA messages. A Casper service is used to fork and exec resolvconf(8), and to reap the child process. - A service is used to determine whether a given interface's link-local address is useable (i.e., not duplicated or undergoing DAD). This information is supplied by getifaddrs(3), which reads a sysctl not available in capability mode. The SIOCGIFCONF socket ioctl provides equivalent information and can be used in capability mode, but I decided against it for now because of some limitations of that interface. In addition to these new services, cap_syslog(3) is used to send messages to syslogd. Reviewed by: oshogbo Tested by: bz (previous versions) MFC after: 2 months Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D17572 Added: head/usr.sbin/rtsold/cap_llflags.c (contents, props changed) head/usr.sbin/rtsold/cap_script.c (contents, props changed) head/usr.sbin/rtsold/cap_sendmsg.c (contents, props changed) Deleted: head/usr.sbin/rtsold/probe.c Modified: head/sbin/rtsol/Makefile head/usr.sbin/rtsold/Makefile head/usr.sbin/rtsold/dump.c head/usr.sbin/rtsold/if.c head/usr.sbin/rtsold/rtsock.c head/usr.sbin/rtsold/rtsol.c head/usr.sbin/rtsold/rtsold.c head/usr.sbin/rtsold/rtsold.h Modified: head/sbin/rtsol/Makefile ============================================================================== --- head/sbin/rtsol/Makefile Sat Jan 5 15:28:20 2019 (r342787) +++ head/sbin/rtsol/Makefile Sat Jan 5 16:05:39 2019 (r342788) @@ -18,10 +18,24 @@ PACKAGE=runtime PROG= rtsol -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsol.c \ + rtsold.c \ + rtsock.c MAN= +LIBADD= util -WARNS?= 3 -CFLAGS+= -DSMALL +.include + +.if ${MK_DYNAMICROOT} == "no" +.warning ${PROG} built without libcasper support +.elif ${MK_CASPER} != "no" && !defined(RESCUE) +CFLAGS+= -DWITH_CASPER +LIBADD+= cap_syslog casper nv +.endif .include Modified: head/usr.sbin/rtsold/Makefile ============================================================================== --- head/usr.sbin/rtsold/Makefile Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/Makefile Sat Jan 5 16:05:39 2019 (r342788) @@ -17,8 +17,22 @@ PROG= rtsold MAN= rtsold.8 MLINKS= rtsold.8 rtsol.8 -SRCS= rtsold.c rtsol.c if.c probe.c dump.c rtsock.c +SRCS= cap_llflags.c \ + cap_script.c \ + cap_sendmsg.c \ + dump.c \ + if.c \ + rtsock.c \ + rtsol.c \ + rtsold.c -WARNS?= 3 +LIBADD= util + +.include + +.if ${MK_CASPER} != "no" +CFLAGS+= -DWITH_CASPER +LIBADD+= casper cap_syslog nv +.endif .include Added: head/usr.sbin/rtsold/cap_llflags.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_llflags.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,157 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * A service to fetch the flags for the link-local IPv6 address on the specified + * interface. This cannot easily be done in capability mode because we need to + * use the routing socket sysctl API to find the link-local address of a + * particular interface. The SIOCGIFCONF ioctl is one other option, but as + * currently implemented it is less flexible (it cannot report the required + * buffer length), and hard-codes a buffer length limit. + */ + +static int +llflags_get(const char *ifname, int *flagsp) +{ + struct in6_ifreq ifr6; + struct ifaddrs *ifap, *ifa; + struct sockaddr_in6 *sin6; + int error, s; + + s = socket(PF_INET6, SOCK_DGRAM, 0); + if (s < 0) + return (-1); + + if (getifaddrs(&ifap) != 0) + return (-1); + error = -1; + for (ifa = ifap; ifa != NULL; ifa = ifa->ifa_next) { + if (strcmp(ifa->ifa_name, ifname) != 0) + continue; + if (ifa->ifa_addr->sa_family != AF_INET6) + continue; + + sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; + if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) + continue; + + memset(&ifr6, 0, sizeof(ifr6)); + if (strlcpy(ifr6.ifr_name, ifname, sizeof(ifr6.ifr_name)) >= + sizeof(ifr6.ifr_name)) { + freeifaddrs(ifap); + errno = EINVAL; + return (-1); + } + memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); + if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { + error = errno; + freeifaddrs(ifap); + errno = error; + return (-1); + } + + *flagsp = ifr6.ifr_ifru.ifru_flags6; + error = 0; + break; + } + (void)close(s); + freeifaddrs(ifap); + if (error == -1) + errno = ENOENT; + return (error); +} + +int +cap_llflags_get(cap_channel_t *cap, const char *ifname, int *flagsp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "get"); + nvlist_add_string(nvl, "ifname", ifname); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *flagsp = (int)nvlist_get_number(nvl, "flags"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (llflags_get(ifname, flagsp)); +#endif +} + +#ifdef WITH_CASPER +static int +llflags_command(const char *cmd, const nvlist_t *limits __unused, + nvlist_t *nvlin, nvlist_t *nvlout) +{ + const char *ifname; + int flags; + + if (strcmp(cmd, "get") != 0) + return (EINVAL); + ifname = nvlist_get_string(nvlin, "ifname"); + if (llflags_get(ifname, &flags) != 0) + return (errno); + nvlist_add_number(nvlout, "flags", flags); + return (0); +} + +CREATE_SERVICE("rtsold.llflags", NULL, llflags_command, 0); +#endif /* WITH_CASPER */ Added: head/usr.sbin/rtsold/cap_script.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_script.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,236 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2018 The FreeBSD Foundation + * + * This software was developed by Mark Johnston 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +/* + * Run the script and return the write end of a pipe to the main process. + * Return -1 and set errno on error. + */ +static int +script_run(char **argv) +{ + pid_t pid; + int fd[2], null; + + if (pipe(fd) != 0) + return (-1); + if ((pid = fork()) < 0) + return (-1); + if (pid == 0) { + (void)close(fd[1]); + null = open("/dev/null", O_RDWR); + if (null < 0) + _exit(1); + if (dup2(fd[0], STDIN_FILENO) != STDIN_FILENO) + _exit(1); + + closefrom(3); + (void)execve(argv[0], argv, NULL); + _exit(1); + } else + (void)close(fd[0]); + + return (fd[1]); +} + +int +cap_script_run(cap_channel_t *cap, const char *const *argv) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + size_t argc; + int error, wfd; + + for (argc = 0; argv[argc] != NULL; argc++) + ; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_run"); + nvlist_add_string_array(nvl, "argv", argv, argc); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + wfd = nvlist_take_descriptor(nvl, "fd"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? wfd : -1); +#else + (void)cap; + return (script_run(__DECONST(char **, argv))); +#endif +} + +/* + * Wait for a child process to exit, and return its status. + * Return -1 and set errno upon error. + */ +static int +script_wait(int *statusp) +{ + int error; + + error = wait(statusp); + return (error >= 0 ? 0 : -1); +} + +int +cap_script_wait(cap_channel_t *cap, int *statusp) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "script_wait"); + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (-1); + + error = (int)dnvlist_get_number(nvl, "error", 0); + if (error == 0) + *statusp = (int)nvlist_get_number(nvl, "status"); + nvlist_destroy(nvl); + if (error != 0) + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (script_wait(statusp)); +#endif +} + +#ifdef WITH_CASPER +static int +script_command(const char *cmd, const nvlist_t *limits, nvlist_t *nvlin, + nvlist_t *nvlout) +{ + cap_rights_t rights; + const char *const *iargv, *const *scripts; + char **argv; + size_t argc, i, nscripts; + int fd, status; + + if (strcmp(cmd, "script_wait") == 0) { + /* Wait for the result of a previous "script_run" command. */ + if (script_wait(&status) == -1) + return (errno); + nvlist_add_number(nvlout, "status", status); + return (0); + } + if (strcmp(cmd, "script_run") != 0) + return (EINVAL); + + /* + * Validate the argv against the limits specified at initialization + * time. + */ + iargv = nvlist_get_string_array(nvlin, "argv", &argc); + if (argc == 0) + return (EINVAL); + scripts = nvlist_get_string_array(limits, "scripts", &nscripts); + for (i = 0; i < nscripts; i++) + if (strcmp(iargv[0], scripts[i]) == 0) + break; + if (i == nscripts) + return (EINVAL); + + /* + * The nvlist API does not permit NULL pointers in an array, so we have + * to add the nul terminator ourselves. Yuck. + */ + argv = calloc(argc + 1, sizeof(*argv)); + if (argv == NULL) + return (errno); + memcpy(argv, iargv, sizeof(*argv) * argc); + + fd = script_run(argv); + if (fd < 0) + return (errno); + + (void)caph_rights_limit(fd, cap_rights_init(&rights, CAP_WRITE)); + nvlist_move_descriptor(nvlout, "fd", fd); + return (0); +} + +static int +script_limit(const nvlist_t *oldlimits, const nvlist_t *newlimits __unused) +{ + const char *name; + void *cookie; + int nvtype; + bool hasscripts; + + /* Limits may only be set once. */ + if (oldlimits != NULL) + return (ENOTCAPABLE); + + cookie = NULL; + hasscripts = false; + while ((name = nvlist_next(newlimits, &nvtype, &cookie)) != NULL) { + if (nvtype == NV_TYPE_STRING_ARRAY && + strcmp(name, "scripts") == 0) + hasscripts = true; + else + return (EINVAL); + } + if (!hasscripts) + return (EINVAL); + return (0); +} + +CREATE_SERVICE("rtsold.script", script_limit, script_command, 0); +#endif /* WITH_CASPER */ Added: head/usr.sbin/rtsold/cap_sendmsg.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/rtsold/cap_sendmsg.c Sat Jan 5 16:05:39 2019 (r342788) @@ -0,0 +1,282 @@ +/* $KAME: probe.c,v 1.17 2003/10/05 00:09:36 itojun Exp $ */ + +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (C) 1998 WIDE Project. + * 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. + * 3. Neither the name of the project nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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$ + */ + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "rtsold.h" + +static int +getsocket(int *sockp, int proto) +{ + cap_rights_t rights; + int sock; + + if (*sockp >= 0) + return (0); + + if ((sock = socket(AF_INET6, SOCK_RAW, proto)) < 0) + return (-1); + cap_rights_init(&rights, CAP_CONNECT, CAP_SEND); + if (caph_rights_limit(sock, &rights) != 0) + return (-1); + *sockp = sock; + + return (0); +} + +static ssize_t +sendpacket(int sock, struct sockaddr_in6 *dst, uint32_t ifindex, int hoplimit, + const void *data, size_t len) +{ + uint8_t cmsg[CMSG_SPACE(sizeof(struct in6_pktinfo)) + + CMSG_SPACE(sizeof(int))]; + struct msghdr hdr; + struct iovec iov; + struct in6_pktinfo *pi; + struct cmsghdr *cm; + + memset(&hdr, 0, sizeof(hdr)); + hdr.msg_name = dst; + hdr.msg_namelen = sizeof(*dst); + hdr.msg_iov = &iov; + hdr.msg_iovlen = 1; + hdr.msg_control = cmsg; + hdr.msg_controllen = sizeof(cmsg); + + iov.iov_base = __DECONST(void *, data); + iov.iov_len = len; + + /* Specify the outbound interface. */ + cm = CMSG_FIRSTHDR(&hdr); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_PKTINFO; + cm->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); + pi = (struct in6_pktinfo *)(void *)CMSG_DATA(cm); + memset(&pi->ipi6_addr, 0, sizeof(pi->ipi6_addr)); /*XXX*/ + pi->ipi6_ifindex = ifindex; + + /* Specify the hop limit of the packet for safety. */ + cm = CMSG_NXTHDR(&hdr, cm); + cm->cmsg_level = IPPROTO_IPV6; + cm->cmsg_type = IPV6_HOPLIMIT; + cm->cmsg_len = CMSG_LEN(sizeof(int)); + memcpy(CMSG_DATA(cm), &hoplimit, sizeof(int)); + + return (sendmsg(sock, &hdr, 0)); +} + +static int +probe_defrouters(uint32_t ifindex, uint32_t linkid) +{ + static int probesock = -1; + struct sockaddr_in6 dst; + struct in6_defrouter *p, *ep; + char *buf; + size_t len; + int mib[4]; + + if (ifindex == 0) + return (0); + if (getsocket(&probesock, IPPROTO_NONE) != 0) + return (-1); + + mib[0] = CTL_NET; + mib[1] = PF_INET6; + mib[2] = IPPROTO_ICMPV6; + mib[3] = ICMPV6CTL_ND6_DRLIST; + if (sysctl(mib, nitems(mib), NULL, &len, NULL, 0) < 0) + return (-1); + if (len == 0) + return (0); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + + buf = malloc(len); + if (buf == NULL) + return (-1); + if (sysctl(mib, nitems(mib), buf, &len, NULL, 0) < 0) + return (-1); + ep = (struct in6_defrouter *)(void *)(buf + len); + for (p = (struct in6_defrouter *)(void *)buf; p < ep; p++) { + if (ifindex != p->if_index) + continue; + if (!IN6_IS_ADDR_LINKLOCAL(&p->rtaddr.sin6_addr)) + continue; + dst.sin6_addr = p->rtaddr.sin6_addr; + dst.sin6_scope_id = linkid; + (void)sendpacket(probesock, &dst, ifindex, 1, NULL, 0); + } + free(buf); + + return (0); +} + +static int +rssend(uint32_t ifindex, uint32_t linkid, const void *data, size_t len) +{ + static int rssock = -1; + struct sockaddr_in6 dst; + ssize_t n; + + if (getsocket(&rssock, IPPROTO_ICMPV6) != 0) + return (-1); + + memset(&dst, 0, sizeof(dst)); + dst.sin6_family = AF_INET6; + dst.sin6_len = sizeof(dst); + dst.sin6_addr = (struct in6_addr)IN6ADDR_LINKLOCAL_ALLROUTERS_INIT; + dst.sin6_scope_id = linkid; + + n = sendpacket(rssock, &dst, ifindex, 255, data, len); + if (n < 0 || (size_t)n != len) + return (-1); + return (0); +} + +int +cap_probe_defrouters(cap_channel_t *cap, struct ifinfo *ifinfo) +{ +#ifdef WITH_CASPER + nvlist_t *nvl; + int error; + + nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "probe_defrouters"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; + return (error == 0 ? 0 : -1); +#else + (void)cap; + return (probe_defrouters(ifinfo->sdl->sdl_index, ifinfo->linkid)); +#endif +} + +int +cap_rssend(cap_channel_t *cap, struct ifinfo *ifinfo) +{ + int error; + +#ifdef WITH_CASPER + nvlist_t *nvl = nvlist_create(0); + nvlist_add_string(nvl, "cmd", "rssend"); + nvlist_add_number(nvl, "ifindex", ifinfo->sdl->sdl_index); + nvlist_add_number(nvl, "linkid", ifinfo->linkid); + nvlist_add_binary(nvl, "data", ifinfo->rs_data, ifinfo->rs_datalen); + + nvl = cap_xfer_nvlist(cap, nvl); + if (nvl == NULL) + return (errno); + error = (int)dnvlist_get_number(nvl, "error", 0); + nvlist_destroy(nvl); + errno = error; +#else + (void)cap; + error = rssend(ifinfo->sdl->sdl_index, ifinfo->linkid, ifinfo->rs_data, + ifinfo->rs_datalen); +#endif + + ifinfo->probes++; + if (error != 0 && (errno != ENETDOWN || dflag > 0)) { + error = errno; + warnmsg(LOG_ERR, __func__, "sendmsg on %s: %s", + ifinfo->ifname, strerror(errno)); + errno = error; + } + return (error == 0 ? 0 : -1); +} + +#ifdef WITH_CASPER +static int +sendmsg_command(const char *cmd, const nvlist_t *limits __unused, nvlist_t *nvlin, + nvlist_t *nvlout __unused) +{ + const void *data; + size_t len; + uint32_t ifindex, linkid; + int error; + + if (strcmp(cmd, "probe_defrouters") != 0 && + strcmp(cmd, "rssend") != 0) + return (EINVAL); + + ifindex = (uint32_t)nvlist_get_number(nvlin, "ifindex"); + linkid = (uint32_t)nvlist_get_number(nvlin, "linkid"); + if (strcmp(cmd, "probe_defrouters") == 0) { + error = probe_defrouters(ifindex, linkid); + } else { + data = nvlist_get_binary(nvlin, "data", &len); + error = rssend(ifindex, linkid, data, len); + } + if (error != 0) + return (errno); + return (0); +} + +CREATE_SERVICE("rtsold.sendmsg", NULL, sendmsg_command, 0); +#endif /* WITH_CASPER */ Modified: head/usr.sbin/rtsold/dump.c ============================================================================== --- head/usr.sbin/rtsold/dump.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/dump.c Sat Jan 5 16:05:39 2019 (r342788) @@ -34,6 +34,7 @@ */ #include +#include #include #include @@ -42,21 +43,20 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include +#include #include "rtsold.h" -static FILE *fp; +static const char * const ifstatstr[] = + { "IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE" }; -static void dump_interface_status(void); -static const char * const ifstatstr[] = {"IDLE", "DELAY", "PROBE", "DOWN", "TENTATIVE"}; - -static void -dump_interface_status(void) +void +rtsold_dump(FILE *fp) { struct ifinfo *ifi; struct rainfo *rai; @@ -64,8 +64,14 @@ dump_interface_status(void) struct timespec now; char ntopbuf[INET6_ADDRSTRLEN]; - clock_gettime(CLOCK_MONOTONIC_FAST, &now); + if (fseek(fp, 0, SEEK_SET) != 0) { + warnmsg(LOG_ERR, __func__, "fseek(): %s", strerror(errno)); + return; + } + (void)ftruncate(fileno(fp), 0); + (void)clock_gettime(CLOCK_MONOTONIC_FAST, &now); + TAILQ_FOREACH(ifi, &ifinfo_head, ifi_next) { fprintf(fp, "Interface %s\n", ifi->ifname); fprintf(fp, " probe interval: "); @@ -121,18 +127,28 @@ dump_interface_status(void) fprintf(fp, "\n"); } } + fflush(fp); } -void -rtsold_dump_file(const char *dumpfile) +FILE * +rtsold_init_dumpfile(const char *dumpfile) { + cap_rights_t rights; + FILE *fp; + if ((fp = fopen(dumpfile, "w")) == NULL) { - warnmsg(LOG_WARNING, __func__, "open a dump file(%s): %s", + warnmsg(LOG_WARNING, __func__, "opening a dump file(%s): %s", dumpfile, strerror(errno)); - return; + return (NULL); } - dump_interface_status(); - fclose(fp); + + cap_rights_init(&rights, CAP_FSTAT, CAP_FTRUNCATE, CAP_SEEK, CAP_WRITE); + if (caph_rights_limit(fileno(fp), &rights) != 0) { + warnmsg(LOG_WARNING, __func__, "caph_rights_limit(%s): %s", + dumpfile, strerror(errno)); + return (NULL); + } + return (fp); } const char * Modified: head/usr.sbin/rtsold/if.c ============================================================================== --- head/usr.sbin/rtsold/if.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/if.c Sat Jan 5 16:05:39 2019 (r342788) @@ -34,10 +34,11 @@ */ #include -#include -#include +#include #include #include +#include +#include #include #include @@ -51,6 +52,7 @@ #include #include +#include #include #include #include @@ -63,16 +65,28 @@ #include "rtsold.h" static int ifsock; - -static int get_llflag(const char *); static void get_rtaddrs(int, struct sockaddr *, struct sockaddr **); int ifinit(void) { - ifsock = rssock; + cap_rights_t rights; + int sock; - return(0); + sock = socket(AF_INET6, SOCK_RAW, IPPROTO_ICMPV6); + if (sock < 0) { + warnmsg(LOG_ERR, __func__, "socket(): %s", + strerror(errno)); + return (-1); + } + if (caph_rights_limit(sock, cap_rights_init(&rights, CAP_IOCTL)) < 0) { + warnmsg(LOG_ERR, __func__, "caph_rights_limit(): %s", + strerror(errno)); + (void)close(sock); + return (-1); + } + ifsock = sock; + return (0); } int @@ -150,10 +164,9 @@ interface_up(char *name) } close(s); - llflag = get_llflag(name); - if (llflag < 0) { + if (cap_llflags_get(capllflags, name, &llflag) != 0) { warnmsg(LOG_WARNING, __func__, - "get_llflag() failed, anyway I'll try"); + "cap_llflags_get() failed, anyway I'll try"); return (0); } @@ -273,8 +286,6 @@ lladdropt_fill(struct sockaddr_dl *sdl, struct nd_opt_ "unsupported link type(%d)", sdl->sdl_type); exit(1); } - - return; } struct sockaddr_dl * @@ -331,58 +342,6 @@ if_nametosdl(char *name) free(buf); return (ret_sdl); } - -/*------------------------------------------------------------*/ - -/* get ia6_flags for link-local addr on if. returns -1 on error. */ -static int -get_llflag(const char *name) -{ - struct ifaddrs *ifap, *ifa; - struct in6_ifreq ifr6; - struct sockaddr_in6 *sin6; - int s; - - if ((s = socket(PF_INET6, SOCK_DGRAM, 0)) < 0) { - warnmsg(LOG_ERR, __func__, "socket(SOCK_DGRAM): %s", - strerror(errno)); - exit(1); - } - if (getifaddrs(&ifap) != 0) { - warnmsg(LOG_ERR, __func__, "getifaddrs: %s", - strerror(errno)); - exit(1); - } - - for (ifa = ifap; ifa; ifa = ifa->ifa_next) { - if (strlen(ifa->ifa_name) != strlen(name) || - strncmp(ifa->ifa_name, name, strlen(name)) != 0) - continue; - if (ifa->ifa_addr->sa_family != AF_INET6) - continue; - sin6 = (struct sockaddr_in6 *)(void *)ifa->ifa_addr; - if (!IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) - continue; - - memset(&ifr6, 0, sizeof(ifr6)); - strlcpy(ifr6.ifr_name, name, sizeof(ifr6.ifr_name)); - memcpy(&ifr6.ifr_ifru.ifru_addr, sin6, sin6->sin6_len); - if (ioctl(s, SIOCGIFAFLAG_IN6, &ifr6) < 0) { - warnmsg(LOG_ERR, __func__, - "ioctl(SIOCGIFAFLAG_IN6): %s", strerror(errno)); - exit(1); - } - - freeifaddrs(ifap); - close(s); - return (ifr6.ifr_ifru.ifru_flags6); - } - - freeifaddrs(ifap); - close(s); - return (-1); -} - static void get_rtaddrs(int addrs, struct sockaddr *sa, struct sockaddr **rti_info) Modified: head/usr.sbin/rtsold/rtsock.c ============================================================================== --- head/usr.sbin/rtsold/rtsock.c Sat Jan 5 15:28:20 2019 (r342787) +++ head/usr.sbin/rtsold/rtsock.c Sat Jan 5 16:05:39 2019 (r342788) @@ -33,10 +33,11 @@ */ #include +#include +#include #include -#include #include -#include +#include #include #include @@ -46,6 +47,7 @@ #include #include +#include #include #include #include @@ -72,8 +74,20 @@ static struct { int rtsock_open(void) { + cap_rights_t rights; + int error, s; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Sat Jan 5 19:49:59 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D44B8141F389; Sat, 5 Jan 2019 19:49:58 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D882569E0A; Sat, 5 Jan 2019 19:49:57 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pg1-x531.google.com with SMTP id m1so18925041pgq.8; Sat, 05 Jan 2019 11:49:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/j9h36X3hhe1v5pssCw0z0xQxWnQ/wIi1vaXi+hysUE=; b=HJVAV2JiS6So1xuBXfv03hOGPhbY62Aab8sFKfVBu7NHsA3h7SsEZW5TUQoVRC1JSU 0VxuW4VW/RQsij55GduYAx93fumgQ85TjEq7VhqEqVEladxksgaFw52835/8YsIvtlJe J7XzyOAQC5ybx6NdnZkhQPXTmhACMDDPxKYxRxapqszbpCr11yiHlIZbU1c7Suf14cIb Q89ovtAurqD0ZOfBbHXU/dHVabKwOytCc1YofZsq+fM3PU7LTj31i+GmulDoWeQOBoAO MHoYQor0lzEFxzoFHLlD0DWxVlKjC+U3989qne7BXm1qMAB7MmNfpRuR2UcGkFs9dRS+ SzXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=/j9h36X3hhe1v5pssCw0z0xQxWnQ/wIi1vaXi+hysUE=; b=ghs9c+57xph8oYO6WlaZS7W10mYXoRnfrc8+AObL9QF5yVInUHwa9nXNunZ3oByG1g 1n16pjZu/QVYOrrXfgQoYm8ZvOlTuGbVug84ieTYnoHjkLWKlr3VOa1RqurbfDo+Tc5X 3+Cyq13KsBEr3AzNobcXbYTLe4ay8vuCsuWtfjSXmjH92iIGwuRPSXQ+YSfQ2oQ7LK42 CHyr0ygzCnOstCxdEVFH+VokT3ab06Ql3E1Gr7DBA7TUkGyctX7FUS9txjEx+D5JwdKp mXvZ1m+ytMhLbQAe2CxmXfVRq7PidQJ6OijEukTIiWA28A91by17IMIRMEnz9ib4wCvx T5hQ== X-Gm-Message-State: AA+aEWa0HVrs2tcQU3o2rkler9ZEgnbPVmv9xPWahXKxzOfs2Vn7XK2Z TpyeJ8tcDfjj3otRBlBYzLElsHOz X-Google-Smtp-Source: AFSGD/XLc029IkTAral6aiQLaI+FlUFljJBJqR1k0S7PG2ZNBePjkl44Zc+G+4cnWw+81SSq9WYVQg== X-Received: by 2002:a62:5dd1:: with SMTP id n78mr56388679pfj.58.1546717796480; Sat, 05 Jan 2019 11:49:56 -0800 (PST) Received: from ?IPv6:2607:fb90:82a9:a99e:b851:5f32:3f1d:bd9? ([2607:fb90:82a9:a99e:b851:5f32:3f1d:bd9]) by smtp.gmail.com with ESMTPSA id a195sm116413911pfa.7.2019.01.05.11.49.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 05 Jan 2019 11:49:55 -0800 (PST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r342774 - head/sys/conf From: Enji Cooper X-Mailer: iPhone Mail (16C104) In-Reply-To: <201901041838.x04IcSXf074418@repo.freebsd.org> Date: Sat, 5 Jan 2019 11:49:55 -0800 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <5E026C13-9D49-4F34-A0FC-8120CF214B4E@gmail.com> References: <201901041838.x04IcSXf074418@repo.freebsd.org> To: Andrew Gallatin X-Rspamd-Queue-Id: D882569E0A X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=HJVAV2Ji; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaneurabeya@gmail.com designates 2607:f8b0:4864:20::531 as permitted sender) smtp.mailfrom=yaneurabeya@gmail.com X-Spamd-Result: default: False [-6.06 / 15.00]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MV_CASE(0.50)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.88)[-0.879,0]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; IP_SCORE(-2.68)[ip: (-9.43), ipnet: 2607:f8b0::/32(-2.20), asn: 15169(-1.67), country: US(-0.08)]; RCVD_IN_DNSWL_NONE(0.00)[1.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 19:49:59 -0000 > On Jan 4, 2019, at 10:38, Andrew Gallatin wrote: >=20 > Author: gallatin > Date: Fri Jan 4 18:38:27 2019 > New Revision: 342774 > URL: https://svnweb.freebsd.org/changeset/base/342774 >=20 > Log: > Limit git history searches in newvers.sh >=20 > newvers.sh takes upwards of 4-5 seconds to complete on trees checked > out from github, due to searching the entire history for non-existent > git-svn metadata. Similarly, if one does not check out notes, we > again search the entire history for notes. That makes newvers.sh very > slow for many github users. >=20 > To fix this in a fair way, limit the history search to the last 10K > commits: if you're more than 10K commits out of sync, then you've > forked the project, and our SVN rev is no longer very important to you. >=20 > Due to how git implements --grep in conjunction with -n, --grep has been > removed for performance reasons (git does not seem to limit its search > to the -n limit in this case, and takes just as long as it did with no > limit). Wonderful =E2=80=94 thank you Andrew :)!! -Enji= From owner-svn-src-head@freebsd.org Sat Jan 5 21:07:51 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A9E414230D8; Sat, 5 Jan 2019 21:07:51 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE6CF6D349; Sat, 5 Jan 2019 21:07:50 +0000 (UTC) (envelope-from joerg@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6917E1E0E2; Sat, 5 Jan 2019 21:07:50 +0000 (UTC) (envelope-from joerg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05L7o4S014561; Sat, 5 Jan 2019 21:07:50 GMT (envelope-from joerg@FreeBSD.org) Received: (from joerg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05L7oOO014560; Sat, 5 Jan 2019 21:07:50 GMT (envelope-from joerg@FreeBSD.org) Message-Id: <201901052107.x05L7oOO014560@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: joerg set sender to joerg@FreeBSD.org using -f From: Joerg Wunsch Date: Sat, 5 Jan 2019 21:07:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342791 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: joerg X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 342791 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE6CF6D349 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 21:07:51 -0000 Author: joerg Date: Sat Jan 5 21:07:49 2019 New Revision: 342791 URL: https://svnweb.freebsd.org/changeset/base/342791 Log: Fix an old typo in the element status display bits: INEAB -> INENAB (import is eNabled) Note that this kernel definition is exported into chio(1), and used for element display there. MFC after: 1 week Modified: head/sys/sys/chio.h Modified: head/sys/sys/chio.h ============================================================================== --- head/sys/sys/chio.h Sat Jan 5 19:35:10 2019 (r342790) +++ head/sys/sys/chio.h Sat Jan 5 21:07:49 2019 (r342791) @@ -266,7 +266,7 @@ struct changer_set_voltag_request { #define CESTATUS_BITS \ - "\20\6INEAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" + "\20\6INENAB\5EXENAB\4ACCESS\3EXCEPT\2IMPEXP\1FULL" #define CHIOMOVE _IOW('c', 0x01, struct changer_move) #define CHIOEXCHANGE _IOW('c', 0x02, struct changer_exchange) From owner-svn-src-head@freebsd.org Sat Jan 5 21:23:26 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D68814236D0; Sat, 5 Jan 2019 21:23:26 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11E086DB33; Sat, 5 Jan 2019 21:23:26 +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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 06F961E448; Sat, 5 Jan 2019 21:23:26 +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 x05LNPLF024711; Sat, 5 Jan 2019 21:23:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05LNPY0024709; Sat, 5 Jan 2019 21:23:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201901052123.x05LNPY0024709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 5 Jan 2019 21:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342792 - in head: libexec/rc share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head: libexec/rc share/man/man8 X-SVN-Commit-Revision: 342792 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 11E086DB33 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 21:23:26 -0000 Author: kevans Date: Sat Jan 5 21:23:25 2019 New Revision: 342792 URL: https://svnweb.freebsd.org/changeset/base/342792 Log: rc.subr: Provide rc_service variable for service scripts Some rc scripts in ports (e.g. uwsgi, apache, openvpn) allow for 'application profiles' that usually require the rc script to be invoked again for each active profile. Because there's no consistent way to determine the path because it differs between manual/service(8) invocations and /etc/rc invocations, this leads to patterns like these: - www/uwsgi hardcodes the script path - security/openvpn guesses either $_file or $0 based on $0 = /etc/rc Instead of forcing rc scripts to guess, provide an rc_service variable to the scripts that gets set appropriately both for direct execution or when a script is being executed via run_rc_script (e.g. /etc/rc). This is our analog of an OpenRC variable with the same name, different case (RC_SERVICE). PR: 234614 Reported by: koobs Reviewed by: dteske, jilles MFC after: 3 days Modified: head/libexec/rc/rc.subr head/share/man/man8/rc.subr.8 Modified: head/libexec/rc/rc.subr ============================================================================== --- head/libexec/rc/rc.subr Sat Jan 5 21:07:49 2019 (r342791) +++ head/libexec/rc/rc.subr Sat Jan 5 21:23:25 2019 (r342792) @@ -52,6 +52,14 @@ ID="/usr/bin/id" IDCMD="if [ -x $ID ]; then $ID -un; fi" PS="/bin/ps -ww" JID=0 +# rc_service provides the path to the service script that we are executing. +# This is not being set here in an execution context, necessarily, so it's +# really just a reasonable guess, and it will get overwritten later if +# we are executing from some other means than direct execution by service(8) +# or manual invocation of the service script. The prime example of this is +# during system startup, all rc scripts will be invoked via /etc/rc, so +# run_rc_script will overwrite rc_service with the file being sourced. +rc_service="$0" # # functions @@ -879,6 +887,9 @@ check_startmsgs() # by $flags from the environment. # This variable may be changed by the precmd method. # +# rc_service Path to the service being executed, in case it needs to +# re-invoked. +# # rc_pid PID of command (if appropriate) # # rc_fast Not empty if "fast" was provided (q.v.) @@ -1382,6 +1393,7 @@ run_rc_script() required_vars eval unset ${_arg}_cmd ${_arg}_precmd ${_arg}_postcmd + rc_service="$_file" case "$_file" in /etc/rc.d/*.sh) # no longer allowed in the base warn "Ignoring old-style startup script $_file" Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Sat Jan 5 21:07:49 2019 (r342791) +++ head/share/man/man8/rc.subr.8 Sat Jan 5 21:23:25 2019 (r342792) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 7, 2018 +.Dd January 5, 2019 .Dt RC.SUBR 8 .Os .Sh NAME @@ -771,7 +771,7 @@ The following variables are available to the methods as well as after .Ic run_rc_command has completed: -.Bl -tag -width ".Va rc_flags" -offset indent +.Bl -tag -width ".Va rc_service" -offset indent .It Va rc_arg Argument provided to .Ic run_rc_command , @@ -785,6 +785,8 @@ unless overridden by the environment variable This variable may be changed by the .Ar argument Ns Va _precmd method. +.It Va rc_service +Path to the service script being executed, in case it needs to re-invoke itself. .It Va rc_pid PID of .Va command From owner-svn-src-head@freebsd.org Sat Jan 5 22:45:23 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B4F01425A92; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1063C70636; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 026531F203; Sat, 5 Jan 2019 22:45:23 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x05MjMJE067202; Sat, 5 Jan 2019 22:45:22 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x05MjKGo067160; Sat, 5 Jan 2019 22:45:20 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201901052245.x05MjKGo067160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 5 Jan 2019 22:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r342793 - in head: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot tools... X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head: . share/mk stand/efi/boot1 stand/efi/libefi stand/efi/loader stand/i386 stand/i386/loader stand/libsa stand/sparc64 stand/sparc64/loader stand/userboot/userboot tools/build/options X-SVN-Commit-Revision: 342793 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1063C70636 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.98)[-0.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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, 05 Jan 2019 22:45:23 -0000 Author: mmacy Date: Sat Jan 5 22:45:20 2019 New Revision: 342793 URL: https://svnweb.freebsd.org/changeset/base/342793 Log: MK_ZFS -> {MK_ZFS|MK_LOADER_ZFS}, this is so we can diable userland / kernel ZFS but keep the boot-loaders when using ZoL port. MFC after: 1 week Reviewed by: rgrimes Differential Revision: https://reviews.freebsd.org/D18739 Added: head/tools/build/options/WITHOUT_LOADER_ZFS (contents, props changed) Modified: head/.gitattributes head/share/mk/src.opts.mk head/stand/efi/boot1/Makefile head/stand/efi/libefi/Makefile head/stand/efi/loader/Makefile head/stand/i386/Makefile head/stand/i386/loader/Makefile head/stand/libsa/Makefile head/stand/sparc64/Makefile head/stand/sparc64/loader/Makefile head/stand/userboot/userboot/Makefile head/tools/build/options/WITHOUT_ZFS Modified: head/.gitattributes ============================================================================== --- head/.gitattributes Sat Jan 5 21:23:25 2019 (r342792) +++ head/.gitattributes Sat Jan 5 22:45:20 2019 (r342793) @@ -3,3 +3,4 @@ *.cpp diff=cpp *.hpp diff=cpp *.py diff=python +. svn-properties=svn:keywords=tools/build/options/WITHOUT_LOADER_ZFS Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Sat Jan 5 21:23:25 2019 (r342792) +++ head/share/mk/src.opts.mk Sat Jan 5 22:45:20 2019 (r342793) @@ -191,6 +191,7 @@ __DEFAULT_YES_OPTIONS = \ WIRELESS \ WPA_SUPPLICANT_EAPOL \ ZFS \ + LOADER_ZFS \ ZONEINFO __DEFAULT_NO_OPTIONS = \ @@ -451,6 +452,7 @@ MK_SOURCELESS_UCODE:= no .if ${MK_CDDL} == "no" MK_ZFS:= no +MK_LOADER_ZFS:= no MK_CTF:= no .endif Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/boot1/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -25,7 +25,7 @@ CWARNFLAGS.zfs_module.c += -Wno-unused-function # architecture-specific loader code SRCS= boot1.c self_reloc.c start.S ufs_module.c -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" SRCS+= zfs_module.c CFLAGS.zfs_module.c+= -I${ZFSSRC} CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/boot/zfs Modified: head/stand/efi/libefi/Makefile ============================================================================== --- head/stand/efi/libefi/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/libefi/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -44,7 +44,7 @@ CFLAGS+= -fPIC -mno-red-zone .endif CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT .endif Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/efi/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -26,7 +26,7 @@ SRCS= autoload.c \ vers.c CFLAGS+= -I${.CURDIR}/../loader -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -I${ZFSSRC} CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes Modified: head/stand/i386/Makefile ============================================================================== --- head/stand/i386/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/i386/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -20,6 +20,6 @@ SUBDIR.yes+= pxeldr SUBDIR.yes+= kgzldr .endif -SUBDIR.${MK_ZFS}+= zfsboot gptzfsboot +SUBDIR.${MK_LOADER_ZFS}+= zfsboot gptzfsboot .include Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/i386/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_NET_SUPPORT?= yes LOADER_NFS_SUPPORT?= yes @@ -64,7 +64,7 @@ ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note -o ${.TARGET} ${.ALLSRC} -.if ${MK_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} +.if ${MK_LOADER_ZFS} == "yes" && ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} LINKS+= ${BINDIR}/${LOADER} ${BINDIR}/zfsloader .endif .if ${LOADER_INTERP} == ${LOADER_DEFAULT_INTERP} Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/libsa/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -165,7 +165,7 @@ SRCS+= explicit_bzero.c crc32_libkern.c .endif # Maybe ZFS -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" .include "${SASRC}/zfs/Makefile.inc" .endif Modified: head/stand/sparc64/Makefile ============================================================================== --- head/stand/sparc64/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/sparc64/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -5,6 +5,6 @@ NO_OBJ=t .include SUBDIR.yes= boot1 loader -SUBDIR.${MK_ZFS}+=zfsboot +SUBDIR.${MK_LOADER_ZFS}+=zfsboot .include Modified: head/stand/sparc64/loader/Makefile ============================================================================== --- head/stand/sparc64/loader/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/sparc64/loader/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -1,6 +1,6 @@ # $FreeBSD$ -HAVE_ZFS= ${MK_ZFS} +HAVE_ZFS= ${MK_LOADER_ZFS} LOADER_DISK_SUPPORT?= yes LOADER_UFS_SUPPORT?= yes @@ -21,7 +21,7 @@ NEWVERSWHAT?= "bootstrap loader" sparc64 VERSION_FILE= ${.CURDIR}/../loader/version INSTALLFLAGS= -b -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" HAVE_ZFS= yes .endif @@ -42,7 +42,7 @@ HELP_FILES= ${.CURDIR}/help.sparc64 LDFLAGS+= -static -.if ${MK_ZFS} == "yes" +.if ${MK_LOADER_ZFS} == "yes" LINKS= ${BINDIR}/loader ${BINDIR}/zfsloader .endif Modified: head/stand/userboot/userboot/Makefile ============================================================================== --- head/stand/userboot/userboot/Makefile Sat Jan 5 21:23:25 2019 (r342792) +++ head/stand/userboot/userboot/Makefile Sat Jan 5 22:45:20 2019 (r342793) @@ -45,7 +45,7 @@ VERSION_FILE= ${.CURDIR}/../userboot/version LINKS+= ${BINDIR}/${SHLIB_NAME} ${BINDIR}/userboot.so .endif -.if ${MK_ZFS} != "no" +.if ${MK_LOADER_ZFS} != "no" CFLAGS+= -DUSERBOOT_ZFS_SUPPORT HAVE_ZFS=yes .endif Added: head/tools/build/options/WITHOUT_LOADER_ZFS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LOADER_ZFS Sat Jan 5 22:45:20 2019 (r342793) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build ZFS file system boot loader support. Modified: head/tools/build/options/WITHOUT_ZFS ============================================================================== --- head/tools/build/options/WITHOUT_ZFS Sat Jan 5 21:23:25 2019 (r342792) +++ head/tools/build/options/WITHOUT_ZFS Sat Jan 5 22:45:20 2019 (r342793) @@ -1,2 +1,2 @@ .\" $FreeBSD$ -Set to not build ZFS file system. +Set to not build ZFS file system kernel module, libraries, and user commands.