From owner-svn-src-stable@freebsd.org Sun Dec 16 01:19:11 2018 Return-Path: Delivered-To: svn-src-stable@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 0604E1335FC8; Sun, 16 Dec 2018 01:19:11 +0000 (UTC) (envelope-from eugen@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 9F065681B2; Sun, 16 Dec 2018 01:19:10 +0000 (UTC) (envelope-from eugen@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 8BCB51FE08; Sun, 16 Dec 2018 01:19:10 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBG1JA0s090758; Sun, 16 Dec 2018 01:19:10 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG1JAcw090757; Sun, 16 Dec 2018 01:19:10 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812160119.wBG1JAcw090757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 16 Dec 2018 01:19:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342143 - stable/11/sbin/ping X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/sbin/ping X-SVN-Commit-Revision: 342143 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F065681B2 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; NEURAL_HAM_SHORT(-0.91)[-0.908,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.889,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 01:19:11 -0000 Author: eugen Date: Sun Dec 16 01:19:10 2018 New Revision: 342143 URL: https://svnweb.freebsd.org/changeset/base/342143 Log: MFC r341768,r341795: ping(8): remove needless comparision with LONG_MAX after unsigned long ultmp changed to long ltmp in r340245. Modified: stable/11/sbin/ping/ping.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ping/ping.c ============================================================================== --- stable/11/sbin/ping/ping.c Sun Dec 16 01:17:27 2018 (r342142) +++ stable/11/sbin/ping/ping.c Sun Dec 16 01:19:10 2018 (r342143) @@ -317,7 +317,7 @@ main(int argc, char *const *argv) break; case 'c': ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > LONG_MAX || ltmp <=0) + if (*ep || ep == optarg || ltmp <= 0) errx(EX_USAGE, "invalid count of packets to transmit: `%s'", optarg); From owner-svn-src-stable@freebsd.org Sun Dec 16 01:17:28 2018 Return-Path: Delivered-To: svn-src-stable@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 801221335D84; Sun, 16 Dec 2018 01:17:28 +0000 (UTC) (envelope-from eugen@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 287DC8FF28; Sun, 16 Dec 2018 01:17:28 +0000 (UTC) (envelope-from eugen@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 0F2F61FDCC; Sun, 16 Dec 2018 01:17:28 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBG1HRPw090635; Sun, 16 Dec 2018 01:17:27 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG1HR3C090634; Sun, 16 Dec 2018 01:17:27 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812160117.wBG1HR3C090634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sun, 16 Dec 2018 01:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342142 - stable/12/sbin/ping X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/sbin/ping X-SVN-Commit-Revision: 342142 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 287DC8FF28 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.78 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-0.99)[-0.988,0]; NEURAL_HAM_SHORT(-0.91)[-0.908,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.889,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 01:17:28 -0000 Author: eugen Date: Sun Dec 16 01:17:27 2018 New Revision: 342142 URL: https://svnweb.freebsd.org/changeset/base/342142 Log: MFC r341768,r341795: ping(8): remove needless comparision with LONG_MAX after unsigned long ultmp changed to long ltmp in r340245. Modified: stable/12/sbin/ping/ping.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping/ping.c ============================================================================== --- stable/12/sbin/ping/ping.c Sat Dec 15 23:20:08 2018 (r342141) +++ stable/12/sbin/ping/ping.c Sun Dec 16 01:17:27 2018 (r342142) @@ -313,7 +313,7 @@ main(int argc, char *const *argv) break; case 'c': ltmp = strtol(optarg, &ep, 0); - if (*ep || ep == optarg || ltmp > LONG_MAX || ltmp <=0) + if (*ep || ep == optarg || ltmp <= 0) errx(EX_USAGE, "invalid count of packets to transmit: `%s'", optarg); From owner-svn-src-stable@freebsd.org Sun Dec 16 02:30:56 2018 Return-Path: Delivered-To: svn-src-stable@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 77BF21338DC6; Sun, 16 Dec 2018 02:30:56 +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 1A6E76BDE0; Sun, 16 Dec 2018 02:30:56 +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 0C65620DE5; Sun, 16 Dec 2018 02:30:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBG2UtBe027157; Sun, 16 Dec 2018 02:30:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG2UtbQ027156; Sun, 16 Dec 2018 02:30:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160230.wBG2UtbQ027156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 02:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342145 - stable/12/sys/i386/i386 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/i386/i386 X-SVN-Commit-Revision: 342145 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A6E76BDE0 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.889,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 02:30:56 -0000 Author: kib Date: Sun Dec 16 02:30:55 2018 New Revision: 342145 URL: https://svnweb.freebsd.org/changeset/base/342145 Log: MFC r341746: Fix PAE boot. Modified: stable/12/sys/i386/i386/mpboot.s Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/i386/i386/mpboot.s ============================================================================== --- stable/12/sys/i386/i386/mpboot.s Sun Dec 16 01:51:38 2018 (r342144) +++ stable/12/sys/i386/i386/mpboot.s Sun Dec 16 02:30:55 2018 (r342145) @@ -99,6 +99,20 @@ NON_GPROF_ENTRY(MPentry) movl %cr4, %eax orl $CR4_PAE, %eax movl %eax, %cr4 + movl $0x80000000, %eax + cpuid + movl $0x80000001, %ebx + cmpl %ebx, %eax + jb 1f + movl %ebx, %eax + cpuid + testl $AMDID_NX, %edx + je 1f + movl $MSR_EFER, %ecx + rdmsr + orl $EFER_NXE,%eax + wrmsr +1: #else movl IdlePTD, %eax movl %eax,%cr3 From owner-svn-src-stable@freebsd.org Sun Dec 16 02:42:34 2018 Return-Path: Delivered-To: svn-src-stable@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 A132713398E5; Sun, 16 Dec 2018 02:42:34 +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 23A566C92E; Sun, 16 Dec 2018 02:42:34 +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 092F721133; Sun, 16 Dec 2018 02:42:34 +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 wBG2gXFx036907; Sun, 16 Dec 2018 02:42:33 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG2gWqt036900; Sun, 16 Dec 2018 02:42:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160242.wBG2gWqt036900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 02:42:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342146 - in stable/12/sys: dev/xen/gntdev sys vm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: dev/xen/gntdev sys vm X-SVN-Commit-Revision: 342146 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 23A566C92E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.888,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 02:42:34 -0000 Author: kib Date: Sun Dec 16 02:42:32 2018 New Revision: 342146 URL: https://svnweb.freebsd.org/changeset/base/342146 Log: MFC r341398: Change the vm_ooffset_t type to unsigned. MFC note: For KPI stability, UOFF_TO_IDX() macro is still provided, redefined to OFF_TO_IDX(). Modified: stable/12/sys/dev/xen/gntdev/gntdev.c stable/12/sys/sys/types.h stable/12/sys/vm/device_pager.c stable/12/sys/vm/sg_pager.c stable/12/sys/vm/vm_map.c stable/12/sys/vm/vm_object.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/xen/gntdev/gntdev.c ============================================================================== --- stable/12/sys/dev/xen/gntdev/gntdev.c Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/dev/xen/gntdev/gntdev.c Sun Dec 16 02:42:32 2018 (r342146) @@ -814,8 +814,8 @@ gntdev_gmap_pg_fault(vm_object_t object, vm_ooffset_t relative_offset = offset - gmap->file_index; - pidx = UOFF_TO_IDX(offset); - ridx = UOFF_TO_IDX(relative_offset); + pidx = OFF_TO_IDX(offset); + ridx = OFF_TO_IDX(relative_offset); if (ridx >= gmap->count || gmap->grant_map_ops[ridx].status != GNTST_okay) return (VM_PAGER_FAIL); @@ -1085,7 +1085,7 @@ mmap_gref(struct per_user_data *priv_user, struct gntd break; vm_page_insert(gref->page, mem_obj, - UOFF_TO_IDX(gref->file_index)); + OFF_TO_IDX(gref->file_index)); count--; } @@ -1225,7 +1225,7 @@ gntdev_mmap_single(struct cdev *cdev, vm_ooffset_t *of if (error != 0) return (EINVAL); - count = UOFF_TO_IDX(size); + count = OFF_TO_IDX(size); gref_start = gntdev_find_grefs(priv_user, *offset, count); if (gref_start) { Modified: stable/12/sys/sys/types.h ============================================================================== --- stable/12/sys/sys/types.h Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/sys/types.h Sun Dec 16 02:42:32 2018 (r342146) @@ -261,7 +261,7 @@ typedef __uint64_t kvaddr_t; typedef __uint64_t ksize_t; typedef __vm_offset_t vm_offset_t; -typedef __int64_t vm_ooffset_t; +typedef __uint64_t vm_ooffset_t; typedef __vm_paddr_t vm_paddr_t; typedef __uint64_t vm_pindex_t; typedef __vm_size_t vm_size_t; Modified: stable/12/sys/vm/device_pager.c ============================================================================== --- stable/12/sys/vm/device_pager.c Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/vm/device_pager.c Sun Dec 16 02:42:32 2018 (r342146) @@ -150,9 +150,9 @@ cdev_pager_allocate(void *handle, enum obj_type tp, st * of the page size. Do a check to avoid wrap. */ size = round_page(size); - pindex = UOFF_TO_IDX(foff) + UOFF_TO_IDX(size); - if (pindex > OBJ_MAX_SIZE || pindex < UOFF_TO_IDX(foff) || - pindex < UOFF_TO_IDX(size)) + pindex = OFF_TO_IDX(foff) + OFF_TO_IDX(size); + if (pindex > OBJ_MAX_SIZE || pindex < OFF_TO_IDX(foff) || + pindex < OFF_TO_IDX(size)) return (NULL); if (ops->cdev_pg_ctor(handle, size, prot, foff, cred, &color) != 0) Modified: stable/12/sys/vm/sg_pager.c ============================================================================== --- stable/12/sys/vm/sg_pager.c Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/vm/sg_pager.c Sun Dec 16 02:42:32 2018 (r342146) @@ -100,9 +100,9 @@ sg_pager_alloc(void *handle, vm_ooffset_t size, vm_pro * to map beyond that. */ size = round_page(size); - pindex = UOFF_TO_IDX(foff) + UOFF_TO_IDX(size); - if (pindex > npages || pindex < UOFF_TO_IDX(foff) || - pindex < UOFF_TO_IDX(size)) + pindex = OFF_TO_IDX(foff) + OFF_TO_IDX(size); + if (pindex > npages || pindex < OFF_TO_IDX(foff) || + pindex < OFF_TO_IDX(size)) return (NULL); /* Modified: stable/12/sys/vm/vm_map.c ============================================================================== --- stable/12/sys/vm/vm_map.c Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/vm/vm_map.c Sun Dec 16 02:42:32 2018 (r342146) @@ -4213,7 +4213,7 @@ RetryLookupLocked: * Return the object/offset from this entry. If the entry was * copy-on-write or empty, it has been fixed up. */ - *pindex = UOFF_TO_IDX((vaddr - entry->start) + entry->offset); + *pindex = OFF_TO_IDX((vaddr - entry->start) + entry->offset); *object = entry->object.vm_object; *out_prot = prot; @@ -4294,7 +4294,7 @@ vm_map_lookup_locked(vm_map_t *var_map, /* IN/OUT */ * Return the object/offset from this entry. If the entry was * copy-on-write or empty, it has been fixed up. */ - *pindex = UOFF_TO_IDX((vaddr - entry->start) + entry->offset); + *pindex = OFF_TO_IDX((vaddr - entry->start) + entry->offset); *object = entry->object.vm_object; *out_prot = prot; Modified: stable/12/sys/vm/vm_object.h ============================================================================== --- stable/12/sys/vm/vm_object.h Sun Dec 16 02:30:55 2018 (r342145) +++ stable/12/sys/vm/vm_object.h Sun Dec 16 02:42:32 2018 (r342146) @@ -196,20 +196,14 @@ struct vm_object { /* * Helpers to perform conversion between vm_object page indexes and offsets. * IDX_TO_OFF() converts an index into an offset. - * OFF_TO_IDX() converts an offset into an index. Since offsets are signed - * by default, the sign propagation in OFF_TO_IDX(), when applied to - * negative offsets, is intentional and returns a vm_object page index - * that cannot be created by a userspace mapping. - * UOFF_TO_IDX() treats the offset as an unsigned value and converts it - * into an index accordingly. Use it only when the full range of offset - * values are allowed. Currently, this only applies to device mappings. + * OFF_TO_IDX() converts an offset into an index. * OBJ_MAX_SIZE specifies the maximum page index corresponding to the * maximum unsigned offset. */ #define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) #define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) -#define UOFF_TO_IDX(off) (((vm_pindex_t)(off)) >> PAGE_SHIFT) -#define OBJ_MAX_SIZE (UOFF_TO_IDX(UINT64_MAX) + 1) +#define UOFF_TO_IDX(off) OFF_TO_IDX(off) +#define OBJ_MAX_SIZE (OFF_TO_IDX(UINT64_MAX) + 1) #ifdef _KERNEL From owner-svn-src-stable@freebsd.org Sun Dec 16 02:46:10 2018 Return-Path: Delivered-To: svn-src-stable@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 A6BE51339977; Sun, 16 Dec 2018 02:46:10 +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 4E5676CC29; Sun, 16 Dec 2018 02:46:10 +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 409CF21141; Sun, 16 Dec 2018 02:46:10 +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 wBG2kAme037193; Sun, 16 Dec 2018 02:46:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG2kApC037192; Sun, 16 Dec 2018 02:46:10 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160246.wBG2kApC037192@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 02:46:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342148 - stable/12/sys/dev/sound/pcm X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/sound/pcm X-SVN-Commit-Revision: 342148 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4E5676CC29 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; NEURAL_HAM_LONG(-0.89)[-0.889,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 02:46:10 -0000 Author: kib Date: Sun Dec 16 02:46:09 2018 New Revision: 342148 URL: https://svnweb.freebsd.org/changeset/base/342148 Log: MFC r341400: Add a comment noting that the additional range checks are not needed. Modified: stable/12/sys/dev/sound/pcm/dsp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/12/sys/dev/sound/pcm/dsp.c Sun Dec 16 02:44:57 2018 (r342147) +++ stable/12/sys/dev/sound/pcm/dsp.c Sun Dec 16 02:46:09 2018 (r342148) @@ -2205,7 +2205,10 @@ dsp_mmap(struct cdev *i_dev, vm_ooffset_t offset, vm_p int nprot, vm_memattr_t *memattr) { - /* XXX memattr is not honored */ + /* + * offset is in range due to checks in dsp_mmap_single(). + * XXX memattr is not honored. + */ *paddr = vtophys(offset); return (0); } From owner-svn-src-stable@freebsd.org Sun Dec 16 02:44:58 2018 Return-Path: Delivered-To: svn-src-stable@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 4A2601339948; Sun, 16 Dec 2018 02:44:58 +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 E3A4B6CA47; Sun, 16 Dec 2018 02:44:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D568E2113D; Sun, 16 Dec 2018 02:44:57 +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 wBG2ivO6037075; Sun, 16 Dec 2018 02:44:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG2ivXW037074; Sun, 16 Dec 2018 02:44:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160244.wBG2ivXW037074@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 02:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342147 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 342147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E3A4B6CA47 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.938,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.889,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 02:44:58 -0000 Author: kib Date: Sun Dec 16 02:44:57 2018 New Revision: 342147 URL: https://svnweb.freebsd.org/changeset/base/342147 Log: MFC r341399: Fix off by one in hpet_mmap() csw method. Modified: stable/12/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/12/sys/dev/acpica/acpi_hpet.c Sun Dec 16 02:42:32 2018 (r342146) +++ stable/12/sys/dev/acpica/acpi_hpet.c Sun Dec 16 02:44:57 2018 (r342147) @@ -396,7 +396,7 @@ hpet_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_p struct hpet_softc *sc; sc = cdev->si_drv1; - if (offset > rman_get_size(sc->mem_res)) + if (offset >= rman_get_size(sc->mem_res)) return (EINVAL); if (!sc->mmap_allow_write && (nprot & PROT_WRITE)) return (EPERM); From owner-svn-src-stable@freebsd.org Sun Dec 16 02:46:53 2018 Return-Path: Delivered-To: svn-src-stable@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 2908B133999A; Sun, 16 Dec 2018 02:46:53 +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 BEA176CDC1; Sun, 16 Dec 2018 02:46:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9348521142; Sun, 16 Dec 2018 02:46:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBG2kqsV037276; Sun, 16 Dec 2018 02:46:52 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBG2kp99037272; Sun, 16 Dec 2018 02:46:51 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812160246.wBG2kp99037272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 16 Dec 2018 02:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342149 - in stable/12/sys: arm/ti dev/altera/avgen dev/terasic/mtl X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: arm/ti dev/altera/avgen dev/terasic/mtl X-SVN-Commit-Revision: 342149 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BEA176CDC1 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.82 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.94)[-0.940,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-0.89)[-0.888,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Dec 2018 02:46:53 -0000 Author: kib Date: Sun Dec 16 02:46:51 2018 New Revision: 342149 URL: https://svnweb.freebsd.org/changeset/base/342149 Log: MFC r341402: Fix off-by-one (page) errors in checks in d_mmap methods of several drivers. Modified: stable/12/sys/arm/ti/ti_pruss.c stable/12/sys/dev/altera/avgen/altera_avgen.c stable/12/sys/dev/terasic/mtl/terasic_mtl_reg.c stable/12/sys/dev/terasic/mtl/terasic_mtl_text.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/ti/ti_pruss.c ============================================================================== --- stable/12/sys/arm/ti/ti_pruss.c Sun Dec 16 02:46:09 2018 (r342148) +++ stable/12/sys/arm/ti/ti_pruss.c Sun Dec 16 02:46:51 2018 (r342149) @@ -704,7 +704,7 @@ ti_pruss_mmap(struct cdev *cdev, vm_ooffset_t offset, device_t dev = cdev->si_drv1; struct ti_pruss_softc *sc = device_get_softc(dev); - if (offset > rman_get_size(sc->sc_mem_res)) + if (offset >= rman_get_size(sc->sc_mem_res)) return (ENOSPC); *paddr = rman_get_start(sc->sc_mem_res) + offset; *memattr = VM_MEMATTR_UNCACHEABLE; Modified: stable/12/sys/dev/altera/avgen/altera_avgen.c ============================================================================== --- stable/12/sys/dev/altera/avgen/altera_avgen.c Sun Dec 16 02:46:09 2018 (r342148) +++ stable/12/sys/dev/altera/avgen/altera_avgen.c Sun Dec 16 02:46:51 2018 (r342149) @@ -229,6 +229,7 @@ altera_avgen_mmap(struct cdev *dev, vm_ooffset_t offse return (EACCES); } if (trunc_page(offset) == offset && + offset + PAGE_SIZE > offset && rman_get_size(sc->avg_res) >= offset + PAGE_SIZE) { *paddr = rman_get_start(sc->avg_res) + offset; *memattr = VM_MEMATTR_UNCACHEABLE; Modified: stable/12/sys/dev/terasic/mtl/terasic_mtl_reg.c ============================================================================== --- stable/12/sys/dev/terasic/mtl/terasic_mtl_reg.c Sun Dec 16 02:46:09 2018 (r342148) +++ stable/12/sys/dev/terasic/mtl/terasic_mtl_reg.c Sun Dec 16 02:46:51 2018 (r342149) @@ -132,6 +132,7 @@ terasic_mtl_reg_mmap(struct cdev *dev, vm_ooffset_t of sc = dev->si_drv1; error = 0; if (trunc_page(offset) == offset && + offset + PAGE_SIZE > offset && rman_get_size(sc->mtl_reg_res) >= offset + PAGE_SIZE) { *paddr = rman_get_start(sc->mtl_reg_res) + offset; *memattr = VM_MEMATTR_UNCACHEABLE; Modified: stable/12/sys/dev/terasic/mtl/terasic_mtl_text.c ============================================================================== --- stable/12/sys/dev/terasic/mtl/terasic_mtl_text.c Sun Dec 16 02:46:09 2018 (r342148) +++ stable/12/sys/dev/terasic/mtl/terasic_mtl_text.c Sun Dec 16 02:46:51 2018 (r342149) @@ -131,6 +131,7 @@ terasic_mtl_text_mmap(struct cdev *dev, vm_ooffset_t o sc = dev->si_drv1; error = 0; if (trunc_page(offset) == offset && + offset + PAGE_SIZE > offset && rman_get_size(sc->mtl_text_res) >= offset + PAGE_SIZE) { *paddr = rman_get_start(sc->mtl_text_res) + offset; *memattr = VM_MEMATTR_UNCACHEABLE; From owner-svn-src-stable@freebsd.org Mon Dec 17 06:58:12 2018 Return-Path: Delivered-To: svn-src-stable@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 BED33133124E; Mon, 17 Dec 2018 06:58:12 +0000 (UTC) (envelope-from eugen@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 5DC498611F; Mon, 17 Dec 2018 06:58:12 +0000 (UTC) (envelope-from eugen@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 4CDEBB51D; Mon, 17 Dec 2018 06:58:12 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH6wCfH037417; Mon, 17 Dec 2018 06:58:12 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH6wCJ3037416; Mon, 17 Dec 2018 06:58:12 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812170658.wBH6wCJ3037416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 17 Dec 2018 06:58:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342157 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 342157 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5DC498611F 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.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 06:58:12 -0000 Author: eugen Date: Mon Dec 17 06:58:11 2018 New Revision: 342157 URL: https://svnweb.freebsd.org/changeset/base/342157 Log: MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode PR: 102719 Modified: stable/12/share/man/man4/ng_bpf.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/ng_bpf.4 ============================================================================== --- stable/12/share/man/man4/ng_bpf.4 Mon Dec 17 05:07:57 2018 (r342156) +++ stable/12/share/man/man4/ng_bpf.4 Mon Dec 17 06:58:11 2018 (r342157) @@ -156,7 +156,7 @@ INHOOK="hook1" MATCHHOOK="hook2" NOTMATCHHOOK="hook3" -BPFPROG=$( tcpdump -s 8192 -ddd ${PATTERN} | \\ +BPFPROG=$( tcpdump -s 8192 -p -ddd ${PATTERN} | \\ ( read len ; \\ echo -n "bpf_prog_len=$len" ; \\ echo -n "bpf_prog=[" ; \\ From owner-svn-src-stable@freebsd.org Mon Dec 17 07:02:51 2018 Return-Path: Delivered-To: svn-src-stable@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 37C3B1331592; Mon, 17 Dec 2018 07:02:51 +0000 (UTC) (envelope-from eugen@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 D0CCB86612; Mon, 17 Dec 2018 07:02:50 +0000 (UTC) (envelope-from eugen@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 BDD9EB6D6; Mon, 17 Dec 2018 07:02:50 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH72osr042734; Mon, 17 Dec 2018 07:02:50 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH72o5H042733; Mon, 17 Dec 2018 07:02:50 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812170702.wBH72o5H042733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 17 Dec 2018 07:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342158 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 342158 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D0CCB86612 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_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.95)[-0.955,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 07:02:51 -0000 Author: eugen Date: Mon Dec 17 07:02:50 2018 New Revision: 342158 URL: https://svnweb.freebsd.org/changeset/base/342158 Log: MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode PR: 102719 Modified: stable/11/share/man/man4/ng_bpf.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/ng_bpf.4 ============================================================================== --- stable/11/share/man/man4/ng_bpf.4 Mon Dec 17 06:58:11 2018 (r342157) +++ stable/11/share/man/man4/ng_bpf.4 Mon Dec 17 07:02:50 2018 (r342158) @@ -156,7 +156,7 @@ INHOOK="hook1" MATCHHOOK="hook2" NOTMATCHHOOK="hook3" -BPFPROG=$( tcpdump -s 8192 -ddd ${PATTERN} | \\ +BPFPROG=$( tcpdump -s 8192 -p -ddd ${PATTERN} | \\ ( read len ; \\ echo -n "bpf_prog_len=$len" ; \\ echo -n "bpf_prog=[" ; \\ From owner-svn-src-stable@freebsd.org Mon Dec 17 07:03:37 2018 Return-Path: Delivered-To: svn-src-stable@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 89F581331600; Mon, 17 Dec 2018 07:03:37 +0000 (UTC) (envelope-from eugen@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 1A06F8674C; Mon, 17 Dec 2018 07:03:37 +0000 (UTC) (envelope-from eugen@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 0D43CB6D9; Mon, 17 Dec 2018 07:03:37 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBH73au2042834; Mon, 17 Dec 2018 07:03:36 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBH73ajc042833; Mon, 17 Dec 2018 07:03:36 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812170703.wBH73ajc042833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Mon, 17 Dec 2018 07:03:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342159 - stable/10/share/man/man4 X-SVN-Group: stable-10 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/10/share/man/man4 X-SVN-Commit-Revision: 342159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1A06F8674C 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.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 07:03:37 -0000 Author: eugen Date: Mon Dec 17 07:03:36 2018 New Revision: 342159 URL: https://svnweb.freebsd.org/changeset/base/342159 Log: MFC r342071: ng_bpf.4: fix EXAMPLES: do not activate promiscuous mode PR: 102719 Modified: stable/10/share/man/man4/ng_bpf.4 Directory Properties: stable/10/ (props changed) Modified: stable/10/share/man/man4/ng_bpf.4 ============================================================================== --- stable/10/share/man/man4/ng_bpf.4 Mon Dec 17 07:02:50 2018 (r342158) +++ stable/10/share/man/man4/ng_bpf.4 Mon Dec 17 07:03:36 2018 (r342159) @@ -156,7 +156,7 @@ INHOOK="hook1" MATCHHOOK="hook2" NOTMATCHHOOK="hook3" -BPFPROG=$( tcpdump -s 8192 -ddd ${PATTERN} | \\ +BPFPROG=$( tcpdump -s 8192 -p -ddd ${PATTERN} | \\ ( read len ; \\ echo -n "bpf_prog_len=$len" ; \\ echo -n "bpf_prog=[" ; \\ From owner-svn-src-stable@freebsd.org Mon Dec 17 10:42:21 2018 Return-Path: Delivered-To: svn-src-stable@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 90F291339A2F; Mon, 17 Dec 2018 10:42:21 +0000 (UTC) (envelope-from ae@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 31FAC8E8ED; Mon, 17 Dec 2018 10:42:21 +0000 (UTC) (envelope-from ae@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 290F2DDA5; Mon, 17 Dec 2018 10:42:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHAgLJ5070931; Mon, 17 Dec 2018 10:42:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHAgLqS070930; Mon, 17 Dec 2018 10:42:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201812171042.wBHAgLqS070930@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 17 Dec 2018 10:42:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342163 - stable/12/sbin/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sbin/ipfw X-SVN-Commit-Revision: 342163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 31FAC8E8ED 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.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 10:42:21 -0000 Author: ae Date: Mon Dec 17 10:42:20 2018 New Revision: 342163 URL: https://svnweb.freebsd.org/changeset/base/342163 Log: MFC r341798: Use correct size for IPv4 address in gethostbyaddr(). When u_long is 8 bytes, it returns EINVAL and 'ipfw -N show' doesn't work. Reported by: Claudio Eichenberger MFC r341799: Rework how protocol number is tracked in rule. Save it when O_PROTO opcode will be printed. This should solve the problem, when protocol name is not printed in `ipfw -N show`. Reported by: Claudio Eichenberger Modified: stable/12/sbin/ipfw/ipfw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ipfw/ipfw2.c ============================================================================== --- stable/12/sbin/ipfw/ipfw2.c Mon Dec 17 10:17:56 2018 (r342162) +++ stable/12/sbin/ipfw/ipfw2.c Mon Dec 17 10:42:20 2018 (r342163) @@ -1256,7 +1256,8 @@ print_ip(struct buf_pr *bp, const struct format_opts * (cmd->o.opcode == O_IP_SRC || cmd->o.opcode == O_IP_DST) ? 32 : contigmask((uint8_t *)&(a[1]), 32); if (mb == 32 && co.do_resolv) - he = gethostbyaddr((char *)&(a[0]), sizeof(u_long), AF_INET); + he = gethostbyaddr((char *)&(a[0]), sizeof(in_addr_t), + AF_INET); if (he != NULL) /* resolved to name */ bprintf(bp, "%s", he->h_name); else if (mb == 0) /* any */ @@ -1510,6 +1511,7 @@ print_instruction(struct buf_pr *bp, const struct form bprintf(bp, " %s", pe->p_name); else bprintf(bp, " %u", cmd->arg1); + state->proto = cmd->arg1; break; case O_MACADDR2: print_mac(bp, insntod(cmd, mac)); @@ -1991,10 +1993,10 @@ print_proto(struct buf_pr *bp, struct format_opts *fo, struct show_state *state) { ipfw_insn *cmd; - int l, proto, ip4, ip6, tmp; + int l, proto, ip4, ip6; /* Count all O_PROTO, O_IP4, O_IP6 instructions. */ - proto = tmp = ip4 = ip6 = 0; + proto = ip4 = ip6 = 0; for (l = state->rule->act_ofs, cmd = state->rule->cmd; l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { switch (cmd->opcode) { @@ -2030,18 +2032,13 @@ print_proto(struct buf_pr *bp, struct format_opts *fo, if (cmd == NULL || (cmd->len & F_OR)) for (l = proto; l > 0; l--) { cmd = print_opcode(bp, fo, state, O_PROTO); - if (cmd != NULL && (cmd->len & F_OR) == 0) + if (cmd == NULL || (cmd->len & F_OR) == 0) break; - tmp = cmd->arg1; } /* Initialize proto, it is used by print_newports() */ - if (tmp != 0) - state->proto = tmp; - else if (ip6 != 0) - state->proto = IPPROTO_IPV6; - else - state->proto = IPPROTO_IP; state->flags |= HAVE_PROTO; + if (state->proto == 0 && ip6 != 0) + state->proto = IPPROTO_IPV6; } static int From owner-svn-src-stable@freebsd.org Mon Dec 17 10:43:24 2018 Return-Path: Delivered-To: svn-src-stable@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 2B5E81339AF6; Mon, 17 Dec 2018 10:43:24 +0000 (UTC) (envelope-from ae@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 C61038EA95; Mon, 17 Dec 2018 10:43:23 +0000 (UTC) (envelope-from ae@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 B3D2DDDB9; Mon, 17 Dec 2018 10:43:23 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHAhNwx071138; Mon, 17 Dec 2018 10:43:23 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHAhN5Y071137; Mon, 17 Dec 2018 10:43:23 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201812171043.wBHAhN5Y071137@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 17 Dec 2018 10:43:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342164 - stable/11/sbin/ipfw X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sbin/ipfw X-SVN-Commit-Revision: 342164 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C61038EA95 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_LONG(-1.00)[-0.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.962,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 10:43:24 -0000 Author: ae Date: Mon Dec 17 10:43:23 2018 New Revision: 342164 URL: https://svnweb.freebsd.org/changeset/base/342164 Log: MFC r341798: Use correct size for IPv4 address in gethostbyaddr(). When u_long is 8 bytes, it returns EINVAL and 'ipfw -N show' doesn't work. Reported by: Claudio Eichenberger MFC r341799: Rework how protocol number is tracked in rule. Save it when O_PROTO opcode will be printed. This should solve the problem, when protocol name is not printed in `ipfw -N show`. Reported by: Claudio Eichenberger Modified: stable/11/sbin/ipfw/ipfw2.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/ipfw/ipfw2.c ============================================================================== --- stable/11/sbin/ipfw/ipfw2.c Mon Dec 17 10:42:20 2018 (r342163) +++ stable/11/sbin/ipfw/ipfw2.c Mon Dec 17 10:43:23 2018 (r342164) @@ -1256,7 +1256,8 @@ print_ip(struct buf_pr *bp, const struct format_opts * (cmd->o.opcode == O_IP_SRC || cmd->o.opcode == O_IP_DST) ? 32 : contigmask((uint8_t *)&(a[1]), 32); if (mb == 32 && co.do_resolv) - he = gethostbyaddr((char *)&(a[0]), sizeof(u_long), AF_INET); + he = gethostbyaddr((char *)&(a[0]), sizeof(in_addr_t), + AF_INET); if (he != NULL) /* resolved to name */ bprintf(bp, "%s", he->h_name); else if (mb == 0) /* any */ @@ -1510,6 +1511,7 @@ print_instruction(struct buf_pr *bp, const struct form bprintf(bp, " %s", pe->p_name); else bprintf(bp, " %u", cmd->arg1); + state->proto = cmd->arg1; break; case O_MACADDR2: print_mac(bp, insntod(cmd, mac)); @@ -1991,10 +1993,10 @@ print_proto(struct buf_pr *bp, struct format_opts *fo, struct show_state *state) { ipfw_insn *cmd; - int l, proto, ip4, ip6, tmp; + int l, proto, ip4, ip6; /* Count all O_PROTO, O_IP4, O_IP6 instructions. */ - proto = tmp = ip4 = ip6 = 0; + proto = ip4 = ip6 = 0; for (l = state->rule->act_ofs, cmd = state->rule->cmd; l > 0; l -= F_LEN(cmd), cmd += F_LEN(cmd)) { switch (cmd->opcode) { @@ -2030,18 +2032,13 @@ print_proto(struct buf_pr *bp, struct format_opts *fo, if (cmd == NULL || (cmd->len & F_OR)) for (l = proto; l > 0; l--) { cmd = print_opcode(bp, fo, state, O_PROTO); - if (cmd != NULL && (cmd->len & F_OR) == 0) + if (cmd == NULL || (cmd->len & F_OR) == 0) break; - tmp = cmd->arg1; } /* Initialize proto, it is used by print_newports() */ - if (tmp != 0) - state->proto = tmp; - else if (ip6 != 0) - state->proto = IPPROTO_IPV6; - else - state->proto = IPPROTO_IP; state->flags |= HAVE_PROTO; + if (state->proto == 0 && ip6 != 0) + state->proto = IPPROTO_IPV6; } static int From owner-svn-src-stable@freebsd.org Mon Dec 17 15:14:00 2018 Return-Path: Delivered-To: svn-src-stable@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 A06231342A17; Mon, 17 Dec 2018 15:14:00 +0000 (UTC) (envelope-from sobomax@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 3E354720D0; Mon, 17 Dec 2018 15:14:00 +0000 (UTC) (envelope-from sobomax@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 23EEE18B8A; Mon, 17 Dec 2018 15:14:00 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHFE0G4022891; Mon, 17 Dec 2018 15:14:00 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHFDwkq022882; Mon, 17 Dec 2018 15:13:58 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201812171513.wBHFDwkq022882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 17 Dec 2018 15:13:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342165 - in stable/12/stand: common i386/libi386 libsa uboot/lib X-SVN-Group: stable-12 X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: in stable/12/stand: common i386/libi386 libsa uboot/lib X-SVN-Commit-Revision: 342165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3E354720D0 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.996,0]; NEURAL_HAM_LONG(-1.00)[-0.996,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 15:14:00 -0000 Author: sobomax Date: Mon Dec 17 15:13:58 2018 New Revision: 342165 URL: https://svnweb.freebsd.org/changeset/base/342165 Log: MFC r341253: panic() should not apply \n. Modified: stable/12/stand/common/interp_forth.c stable/12/stand/i386/libi386/biosdisk.c stable/12/stand/libsa/arp.c stable/12/stand/libsa/assert.c stable/12/stand/libsa/bzipfs.c stable/12/stand/libsa/netif.c stable/12/stand/libsa/sbrk.c stable/12/stand/uboot/lib/copy.c stable/12/stand/uboot/lib/net.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/common/interp_forth.c ============================================================================== --- stable/12/stand/common/interp_forth.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/common/interp_forth.c Mon Dec 17 15:13:58 2018 (r342165) @@ -144,7 +144,7 @@ bf_command(FICL_VM *vm) printf("%s\n", command_errmsg); break; case CMD_FATAL: - panic("%s\n", command_errmsg); + panic("%s", command_errmsg); } free(line); Modified: stable/12/stand/i386/libi386/biosdisk.c ============================================================================== --- stable/12/stand/i386/libi386/biosdisk.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/i386/libi386/biosdisk.c Mon Dec 17 15:13:58 2018 (r342165) @@ -646,7 +646,7 @@ bd_realstrategy(void *devdata, int rw, daddr_t dblk, s } if (V86_IO_BUFFER_SIZE / BD(dev).bd_sectorsize == 0) - panic("BUG: Real mode buffer is too small\n"); + panic("BUG: Real mode buffer is too small"); bbuf = PTOV(V86_IO_BUFFER); rest = size; Modified: stable/12/stand/libsa/arp.c ============================================================================== --- stable/12/stand/libsa/arp.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/libsa/arp.c Mon Dec 17 15:13:58 2018 (r342165) @@ -120,7 +120,7 @@ arpwhohas(struct iodesc *d, struct in_addr addr) arpsend, &wbuf.data, sizeof(wbuf.data), arprecv, &pkt, (void **)&ah, NULL); if (i == -1) { - panic("arp: no response for %s\n", + panic("arp: no response for %s", inet_ntoa(addr)); } Modified: stable/12/stand/libsa/assert.c ============================================================================== --- stable/12/stand/libsa/assert.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/libsa/assert.c Mon Dec 17 15:13:58 2018 (r342165) @@ -35,10 +35,10 @@ void __assert(const char *func, const char *file, int line, const char *expression) { if (func == NULL) - panic("Assertion failed: (%s), file %s, line %d.\n", + panic("Assertion failed: (%s), file %s, line %d.", expression, file, line); else panic( - "Assertion failed: (%s), function %s, file %s, line %d.\n", + "Assertion failed: (%s), function %s, file %s, line %d.", expression, func, file, line); } Modified: stable/12/stand/libsa/bzipfs.c ============================================================================== --- stable/12/stand/libsa/bzipfs.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/libsa/bzipfs.c Mon Dec 17 15:13:58 2018 (r342165) @@ -360,7 +360,7 @@ bzf_stat(struct open_file *f, struct stat *sb) void bz_internal_error(int errorcode) { - panic("bzipfs: critical error %d in bzip2 library occured\n", errorcode); + panic("bzipfs: critical error %d in bzip2 library occured", errorcode); } #ifdef REGRESSION Modified: stable/12/stand/libsa/netif.c ============================================================================== --- stable/12/stand/libsa/netif.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/libsa/netif.c Mon Dec 17 15:13:58 2018 (r342165) @@ -182,7 +182,7 @@ netif_attach(struct netif *nif, struct iodesc *desc, v desc->io_netif = nif; #ifdef PARANOID if (drv->netif_init == NULL) - panic("%s%d: no netif_init support\n", drv->netif_bname, + panic("%s%d: no netif_init support", drv->netif_bname, nif->nif_unit); #endif drv->netif_init(desc, machdep_hint); @@ -201,7 +201,7 @@ netif_detach(struct netif *nif) #endif #ifdef PARANOID if (drv->netif_end == NULL) - panic("%s%d: no netif_end support\n", drv->netif_bname, + panic("%s%d: no netif_end support", drv->netif_bname, nif->nif_unit); #endif drv->netif_end(nif); @@ -222,7 +222,7 @@ netif_get(struct iodesc *desc, void **pkt, time_t timo #endif #ifdef PARANOID if (drv->netif_get == NULL) - panic("%s%d: no netif_get support\n", drv->netif_bname, + panic("%s%d: no netif_get support", drv->netif_bname, nif->nif_unit); #endif rv = drv->netif_get(desc, pkt, timo); @@ -249,7 +249,7 @@ netif_put(struct iodesc *desc, void *pkt, size_t len) #endif #ifdef PARANOID if (drv->netif_put == NULL) - panic("%s%d: no netif_put support\n", drv->netif_bname, + panic("%s%d: no netif_put support", drv->netif_bname, nif->nif_unit); #endif rv = drv->netif_put(desc, pkt, len); Modified: stable/12/stand/libsa/sbrk.c ============================================================================== --- stable/12/stand/libsa/sbrk.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/libsa/sbrk.c Mon Dec 17 15:13:58 2018 (r342165) @@ -53,7 +53,7 @@ sbrk(int incr) char *ret; if (heapbase == 0) - panic("No heap setup\n"); + panic("No heap setup"); if ((heapsize + incr) <= maxheap) { ret = (char *)heapbase + heapsize; Modified: stable/12/stand/uboot/lib/copy.c ============================================================================== --- stable/12/stand/uboot/lib/copy.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/uboot/lib/copy.c Mon Dec 17 15:13:58 2018 (r342165) @@ -133,7 +133,7 @@ uboot_loadaddr(u_int type, void *data, uint64_t addr) } } if (biggest_size == 0) - panic("Not enough DRAM to load kernel\n"); + panic("Not enough DRAM to load kernel"); #if 0 printf("Loading kernel into region 0x%08jx-0x%08jx (%ju MiB)\n", (uintmax_t)biggest_block, Modified: stable/12/stand/uboot/lib/net.c ============================================================================== --- stable/12/stand/uboot/lib/net.c Mon Dec 17 10:43:23 2018 (r342164) +++ stable/12/stand/uboot/lib/net.c Mon Dec 17 15:13:58 2018 (r342165) @@ -324,7 +324,7 @@ net_init(struct iodesc *desc, void *machdep_hint) sc = nif->nif_devdata = &uboot_softc; if ((err = ub_dev_open(sc->sc_handle)) != 0) - panic("%s%d: initialisation failed with error %d\n", + panic("%s%d: initialisation failed with error %d", nif->nif_driver->netif_bname, nif->nif_unit, err); /* Get MAC address */ @@ -359,6 +359,6 @@ net_end(struct netif *nif) int err; if ((err = ub_dev_close(sc->sc_handle)) != 0) - panic("%s%d: net_end failed with error %d\n", + panic("%s%d: net_end failed with error %d", nif->nif_driver->netif_bname, nif->nif_unit, err); } From owner-svn-src-stable@freebsd.org Mon Dec 17 15:17:10 2018 Return-Path: Delivered-To: svn-src-stable@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 C98601342AF8; Mon, 17 Dec 2018 15:17:10 +0000 (UTC) (envelope-from sobomax@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 6B7C372337; Mon, 17 Dec 2018 15:17:10 +0000 (UTC) (envelope-from sobomax@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 5709D18B8D; Mon, 17 Dec 2018 15:17:10 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHFHAow023300; Mon, 17 Dec 2018 15:17:10 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHFH95X023298; Mon, 17 Dec 2018 15:17:09 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201812171517.wBHFH95X023298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 17 Dec 2018 15:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342166 - stable/12/bin/dd X-SVN-Group: stable-12 X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: stable/12/bin/dd X-SVN-Commit-Revision: 342166 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6B7C372337 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.996,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 15:17:11 -0000 Author: sobomax Date: Mon Dec 17 15:17:09 2018 New Revision: 342166 URL: https://svnweb.freebsd.org/changeset/base/342166 Log: MFC r341257: improve speed of empty block detection. Modified: stable/12/bin/dd/dd.c stable/12/bin/dd/dd.h Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/dd/dd.c ============================================================================== --- stable/12/bin/dd/dd.c Mon Dec 17 15:13:58 2018 (r342165) +++ stable/12/bin/dd/dd.c Mon Dec 17 15:17:09 2018 (r342166) @@ -512,7 +512,7 @@ void dd_out(int force) { u_char *outp; - size_t cnt, i, n; + size_t cnt, n; ssize_t nw; static int warned; int sparse; @@ -545,12 +545,8 @@ dd_out(int force) do { sparse = 0; if (ddflags & C_SPARSE) { - sparse = 1; /* Is buffer sparse? */ - for (i = 0; i < cnt; i++) - if (outp[i] != 0) { - sparse = 0; - break; - } + /* Is buffer sparse? */ + sparse = BISZERO(outp, cnt); } if (sparse && !force) { pending += cnt; Modified: stable/12/bin/dd/dd.h ============================================================================== --- stable/12/bin/dd/dd.h Mon Dec 17 15:13:58 2018 (r342165) +++ stable/12/bin/dd/dd.h Mon Dec 17 15:17:09 2018 (r342166) @@ -103,3 +103,7 @@ typedef struct { #define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) + +#define BISZERO(p, s) ((s) > 0 && *((const char *)p) == 0 && !memcmp( \ + (const void *)(p), (const void *) \ + ((const char *)p + 1), (s) - 1)) From owner-svn-src-stable@freebsd.org Mon Dec 17 15:19:49 2018 Return-Path: Delivered-To: svn-src-stable@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 A8CB91342BEC; Mon, 17 Dec 2018 15:19:49 +0000 (UTC) (envelope-from sobomax@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 5013F724F7; Mon, 17 Dec 2018 15:19:49 +0000 (UTC) (envelope-from sobomax@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 3DEF118B91; Mon, 17 Dec 2018 15:19:49 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHFJnWj023464; Mon, 17 Dec 2018 15:19:49 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHFJmBF023463; Mon, 17 Dec 2018 15:19:48 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201812171519.wBHFJmBF023463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Mon, 17 Dec 2018 15:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342167 - stable/11/bin/dd X-SVN-Group: stable-11 X-SVN-Commit-Author: sobomax X-SVN-Commit-Paths: stable/11/bin/dd X-SVN-Commit-Revision: 342167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5013F724F7 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.97)[-0.969,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 15:19:49 -0000 Author: sobomax Date: Mon Dec 17 15:19:48 2018 New Revision: 342167 URL: https://svnweb.freebsd.org/changeset/base/342167 Log: MFC r341257: improve speed of empty block detection. Modified: stable/11/bin/dd/dd.c stable/11/bin/dd/dd.h Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/dd/dd.c ============================================================================== --- stable/11/bin/dd/dd.c Mon Dec 17 15:17:09 2018 (r342166) +++ stable/11/bin/dd/dd.c Mon Dec 17 15:19:48 2018 (r342167) @@ -474,7 +474,7 @@ void dd_out(int force) { u_char *outp; - size_t cnt, i, n; + size_t cnt, n; ssize_t nw; static int warned; int sparse; @@ -507,12 +507,8 @@ dd_out(int force) do { sparse = 0; if (ddflags & C_SPARSE) { - sparse = 1; /* Is buffer sparse? */ - for (i = 0; i < cnt; i++) - if (outp[i] != 0) { - sparse = 0; - break; - } + /* Is buffer sparse? */ + sparse = BISZERO(outp, cnt); } if (sparse && !force) { pending += cnt; Modified: stable/11/bin/dd/dd.h ============================================================================== --- stable/11/bin/dd/dd.h Mon Dec 17 15:17:09 2018 (r342166) +++ stable/11/bin/dd/dd.h Mon Dec 17 15:19:48 2018 (r342167) @@ -102,3 +102,7 @@ typedef struct { #define C_PROGRESS 0x40000000 #define C_PARITY (C_PAREVEN | C_PARODD | C_PARNONE | C_PARSET) + +#define BISZERO(p, s) ((s) > 0 && *((const char *)p) == 0 && !memcmp( \ + (const void *)(p), (const void *) \ + ((const char *)p + 1), (s) - 1)) From owner-svn-src-stable@freebsd.org Mon Dec 17 21:46:43 2018 Return-Path: Delivered-To: svn-src-stable@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 53D42134D5B6; Mon, 17 Dec 2018 21:46:43 +0000 (UTC) (envelope-from hiren@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 EDF518C31E; Mon, 17 Dec 2018 21:46:42 +0000 (UTC) (envelope-from hiren@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 E2A3F1CFAA; Mon, 17 Dec 2018 21:46:42 +0000 (UTC) (envelope-from hiren@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBHLkg2u027760; Mon, 17 Dec 2018 21:46:42 GMT (envelope-from hiren@FreeBSD.org) Received: (from hiren@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBHLkgve027757; Mon, 17 Dec 2018 21:46:42 GMT (envelope-from hiren@FreeBSD.org) Message-Id: <201812172146.wBHLkgve027757@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hiren set sender to hiren@FreeBSD.org using -f From: Hiren Panchasara Date: Mon, 17 Dec 2018 21:46:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342181 - stable/12/sys/netinet/cc X-SVN-Group: stable-12 X-SVN-Commit-Author: hiren X-SVN-Commit-Paths: stable/12/sys/netinet/cc X-SVN-Commit-Revision: 342181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EDF518C31E 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_LONG(-1.00)[-0.996,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Dec 2018 21:46:43 -0000 Author: hiren Date: Mon Dec 17 21:46:42 2018 New Revision: 342181 URL: https://svnweb.freebsd.org/changeset/base/342181 Log: MFC r342127 Revert r331567 CC Cubic: fix underflow for cubic_cwnd() This change is causing TCP connections using cubic to hang. Need to dig more to find exact cause and fix it. Modified: stable/12/sys/netinet/cc/cc.h stable/12/sys/netinet/cc/cc_cubic.c stable/12/sys/netinet/cc/cc_cubic.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc.h ============================================================================== --- stable/12/sys/netinet/cc/cc.h Mon Dec 17 21:34:09 2018 (r342180) +++ stable/12/sys/netinet/cc/cc.h Mon Dec 17 21:46:42 2018 (r342181) @@ -102,8 +102,6 @@ struct cc_var { #define CCF_ACKNOW 0x0008 /* Will this ack be sent now? */ #define CCF_IPHDR_CE 0x0010 /* Does this packet set CE bit? */ #define CCF_TCPHDR_CWR 0x0020 /* Does this packet set CWR bit? */ -#define CCF_MAX_CWND 0x0040 /* Have we reached maximum cwnd? */ -#define CCF_CHG_MAX_CWND 0x0080 /* Cubic max_cwnd changed, for K */ /* ACK types passed to the ack_received() hook. */ #define CC_ACK 0x0001 /* Regular in sequence ACK. */ Modified: stable/12/sys/netinet/cc/cc_cubic.c ============================================================================== --- stable/12/sys/netinet/cc/cc_cubic.c Mon Dec 17 21:34:09 2018 (r342180) +++ stable/12/sys/netinet/cc/cc_cubic.c Mon Dec 17 21:46:42 2018 (r342181) @@ -88,8 +88,6 @@ struct cubic { unsigned long max_cwnd; /* cwnd at the previous congestion event. */ unsigned long prev_max_cwnd; - /* Cached value for t_maxseg when K was computed */ - uint32_t k_maxseg; /* Number of congestion events. */ uint32_t num_cong_events; /* Minimum observed rtt in ticks. */ @@ -126,9 +124,6 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data = ccv->cc_data; cubic_record_rtt(ccv); - if (ccv->flags & CCF_MAX_CWND) - return; - /* * Regular ACK and we're not in cong/fast recovery and we're cwnd * limited and we're either not doing ABC or are slow starting or are @@ -156,12 +151,6 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, CCV(ccv, t_maxseg)); - if (ccv->flags & CCF_CHG_MAX_CWND || cubic_data->k_maxseg != CCV(ccv, t_maxseg)) { - cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); - cubic_data->k_maxseg = CCV(ccv, t_maxseg); - ccv->flags &= ~(CCF_MAX_CWND|CCF_CHG_MAX_CWND); - } - w_cubic_next = cubic_cwnd(ticks_since_cong + cubic_data->mean_rtt_ticks, cubic_data->max_cwnd, CCV(ccv, t_maxseg), cubic_data->K); @@ -173,18 +162,13 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * TCP-friendly region, follow tf * cwnd growth. */ - CCV(ccv, snd_cwnd) = ulmin(w_tf, TCP_MAXWIN << CCV(ccv, snd_scale)); + CCV(ccv, snd_cwnd) = w_tf; else if (CCV(ccv, snd_cwnd) < w_cubic_next) { /* * Concave or convex region, follow CUBIC * cwnd growth. */ - if (w_cubic_next >= TCP_MAXWIN << CCV(ccv, snd_scale)) { - w_cubic_next = TCP_MAXWIN << CCV(ccv, snd_scale); - ccv->flags |= CCF_MAX_CWND; - } - w_cubic_next = ulmin(w_cubic_next, TCP_MAXWIN << CCV(ccv, snd_scale)); if (V_tcp_do_rfc3465) CCV(ccv, snd_cwnd) = w_cubic_next; else @@ -202,10 +186,8 @@ cubic_ack_received(struct cc_var *ccv, uint16_t type) * max_cwnd. */ if (cubic_data->num_cong_events == 0 && - cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) { + cubic_data->max_cwnd < CCV(ccv, snd_cwnd)) cubic_data->max_cwnd = CCV(ccv, snd_cwnd); - ccv->flags |= CCF_CHG_MAX_CWND; - } } } } @@ -254,7 +236,6 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_data->num_cong_events++; cubic_data->prev_max_cwnd = cubic_data->max_cwnd; cubic_data->max_cwnd = CCV(ccv, snd_cwnd); - ccv->flags |= CCF_CHG_MAX_CWND; } ENTER_RECOVERY(CCV(ccv, t_flags)); } @@ -267,8 +248,6 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) cubic_data->prev_max_cwnd = cubic_data->max_cwnd; cubic_data->max_cwnd = CCV(ccv, snd_cwnd); cubic_data->t_last_cong = ticks; - ccv->flags |= CCF_CHG_MAX_CWND; - ccv->flags &= ~CCF_MAX_CWND; CCV(ccv, snd_cwnd) = CCV(ccv, snd_ssthresh); ENTER_CONGRECOVERY(CCV(ccv, t_flags)); } @@ -285,7 +264,6 @@ cubic_cong_signal(struct cc_var *ccv, uint32_t type) if (CCV(ccv, t_rxtshift) >= 2) { cubic_data->num_cong_events++; cubic_data->t_last_cong = ticks; - ccv->flags &= ~CCF_MAX_CWND; } break; } @@ -304,7 +282,6 @@ cubic_conn_init(struct cc_var *ccv) * get used. */ cubic_data->max_cwnd = CCV(ccv, snd_cwnd); - ccv->flags |= CCF_CHG_MAX_CWND; } static int @@ -329,11 +306,9 @@ cubic_post_recovery(struct cc_var *ccv) pipe = 0; /* Fast convergence heuristic. */ - if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) { + if (cubic_data->max_cwnd < cubic_data->prev_max_cwnd) cubic_data->max_cwnd = (cubic_data->max_cwnd * CUBIC_FC_FACTOR) >> CUBIC_SHIFT; - ccv->flags |= CCF_CHG_MAX_CWND; - } if (IN_FASTRECOVERY(CCV(ccv, t_flags))) { /* @@ -356,7 +331,6 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->max_cwnd) >> CUBIC_SHIFT)); } cubic_data->t_last_cong = ticks; - ccv->flags &= ~CCF_MAX_CWND; /* Calculate the average RTT between congestion epochs. */ if (cubic_data->epoch_ack_count > 0 && @@ -367,6 +341,7 @@ cubic_post_recovery(struct cc_var *ccv) cubic_data->epoch_ack_count = 0; cubic_data->sum_rtt_ticks = 0; + cubic_data->K = cubic_k(cubic_data->max_cwnd / CCV(ccv, t_maxseg)); } /* Modified: stable/12/sys/netinet/cc/cc_cubic.h ============================================================================== --- stable/12/sys/netinet/cc/cc_cubic.h Mon Dec 17 21:34:09 2018 (r342180) +++ stable/12/sys/netinet/cc/cc_cubic.h Mon Dec 17 21:46:42 2018 (r342181) @@ -41,8 +41,6 @@ #ifndef _NETINET_CC_CUBIC_H_ #define _NETINET_CC_CUBIC_H_ -#include - /* Number of bits of precision for fixed point math calcs. */ #define CUBIC_SHIFT 8 @@ -163,6 +161,8 @@ cubic_k(unsigned long wmax_pkts) /* * Compute the new cwnd value using an implementation of eqn 1 from the I-D. * Thanks to Kip Macy for help debugging this function. + * + * XXXLAS: Characterise bounds for overflow. */ static __inline unsigned long cubic_cwnd(int ticks_since_cong, unsigned long wmax, uint32_t smss, int64_t K) @@ -174,15 +174,6 @@ cubic_cwnd(int ticks_since_cong, unsigned long wmax, u /* t - K, with CUBIC_SHIFT worth of precision. */ cwnd = ((int64_t)(ticks_since_cong << CUBIC_SHIFT) - (K * hz)) / hz; - /* moved this calculation up because it cannot overflow or underflow */ - cwnd *= CUBIC_C_FACTOR * smss; - - if (cwnd > 2097151) /* 2^21 cubed is long max */ - return INT_MAX; - - if (cwnd < -2097152) /* -2^21 cubed is long min */ - return smss; - /* (t - K)^3, with CUBIC_SHIFT^3 worth of precision. */ cwnd *= (cwnd * cwnd); @@ -191,17 +182,8 @@ cubic_cwnd(int ticks_since_cong, unsigned long wmax, u * The down shift by CUBIC_SHIFT_4 is because cwnd has 4 lots of * CUBIC_SHIFT included in the value. 3 from the cubing of cwnd above, * and an extra from multiplying through by CUBIC_C_FACTOR. - * - * The original formula was this: - * cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; - * - * CUBIC_C_FACTOR and smss factors were moved up to an earlier - * calculation to simplify overflow and underflow detection. */ - cwnd = (cwnd >> CUBIC_SHIFT_4) + wmax; - - if (cwnd < 0) - return 1; + cwnd = ((cwnd * CUBIC_C_FACTOR * smss) >> CUBIC_SHIFT_4) + wmax; return ((unsigned long)cwnd); } From owner-svn-src-stable@freebsd.org Tue Dec 18 03:00:13 2018 Return-Path: Delivered-To: svn-src-stable@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 7B4E0133C0AC; Tue, 18 Dec 2018 03:00:13 +0000 (UTC) (envelope-from araujo@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 2311272FBF; Tue, 18 Dec 2018 03:00:13 +0000 (UTC) (envelope-from araujo@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 F1DB72099A; Tue, 18 Dec 2018 03:00:12 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBI30C1H089229; Tue, 18 Dec 2018 03:00:12 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI30CxV089227; Tue, 18 Dec 2018 03:00:12 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201812180300.wBI30CxV089227@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Tue, 18 Dec 2018 03:00:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342184 - stable/12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: araujo X-SVN-Commit-Paths: stable/12/usr.sbin/bhyve X-SVN-Commit-Revision: 342184 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2311272FBF 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_LONG(-1.00)[-0.996,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 03:00:13 -0000 Author: araujo Date: Tue Dec 18 03:00:12 2018 New Revision: 342184 URL: https://svnweb.freebsd.org/changeset/base/342184 Log: MFC r340707: Define AHCI_PORT_IDENT and increase by 1 the VTBLK_BLK_ID_BYTES to avoid buffer accessed out of bounds, also switch to snprintf(3). PR: 200859 Submitted by: Caglar Obtained from: https://github.com/mist64/xhyve/pull/24 Modified: stable/12/usr.sbin/bhyve/pci_ahci.c stable/12/usr.sbin/bhyve/pci_virtio_block.c Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_ahci.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_ahci.c Tue Dec 18 01:12:30 2018 (r342183) +++ stable/12/usr.sbin/bhyve/pci_ahci.c Tue Dec 18 03:00:12 2018 (r342184) @@ -105,7 +105,7 @@ enum sata_fis_type { * ATA commands */ #define ATA_SF_ENAB_SATA_SF 0x10 -#define ATA_SATA_SF_AN 0x05 +#define ATA_SATA_SF_AN 0x05 #define ATA_SF_DIS_SATA_SF 0x90 /* @@ -119,6 +119,8 @@ static FILE *dbg; #endif #define WPRINTF(format, arg...) printf(format, ##arg) +#define AHCI_PORT_IDENT 20 + 1 + struct ahci_ioreq { struct blockif_req io_req; struct ahci_port *io_pr; @@ -136,7 +138,7 @@ struct ahci_port { struct pci_ahci_softc *pr_sc; uint8_t *cmd_lst; uint8_t *rfis; - char ident[20 + 1]; + char ident[AHCI_PORT_IDENT]; int port; int atapi; int reset; @@ -2374,7 +2376,8 @@ pci_ahci_init(struct vmctx *ctx, struct pci_devinst *p MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->port[p].ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->port[p].ident, AHCI_PORT_IDENT, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); Modified: stable/12/usr.sbin/bhyve/pci_virtio_block.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_virtio_block.c Tue Dec 18 01:12:30 2018 (r342183) +++ stable/12/usr.sbin/bhyve/pci_virtio_block.c Tue Dec 18 03:00:12 2018 (r342184) @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); #define VTBLK_S_IOERR 1 #define VTBLK_S_UNSUPP 2 -#define VTBLK_BLK_ID_BYTES 20 +#define VTBLK_BLK_ID_BYTES 20 + 1 /* Capability bits */ #define VTBLK_F_SEG_MAX (1 << 2) /* Maximum request segments */ @@ -344,7 +344,8 @@ pci_vtblk_init(struct vmctx *ctx, struct pci_devinst * MD5Init(&mdctx); MD5Update(&mdctx, opts, strlen(opts)); MD5Final(digest, &mdctx); - sprintf(sc->vbsc_ident, "BHYVE-%02X%02X-%02X%02X-%02X%02X", + snprintf(sc->vbsc_ident, VTBLK_BLK_ID_BYTES, + "BHYVE-%02X%02X-%02X%02X-%02X%02X", digest[0], digest[1], digest[2], digest[3], digest[4], digest[5]); /* setup virtio block config space */ From owner-svn-src-stable@freebsd.org Tue Dec 18 07:11:13 2018 Return-Path: Delivered-To: svn-src-stable@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 2111F134359B; Tue, 18 Dec 2018 07:11:13 +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 B7303836EC; Tue, 18 Dec 2018 07:11:12 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABBF523610; Tue, 18 Dec 2018 07:11:12 +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 wBI7BCJJ023887; Tue, 18 Dec 2018 07:11:12 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI7BCar023885; Tue, 18 Dec 2018 07:11:12 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812180711.wBI7BCar023885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 18 Dec 2018 07:11:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342187 - in stable/12/sys: kern x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/12/sys: kern x86/x86 X-SVN-Commit-Revision: 342187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B7303836EC X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.91 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_SHORT(-0.91)[-0.914,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 07:11:13 -0000 Author: kib Date: Tue Dec 18 07:11:12 2018 New Revision: 342187 URL: https://svnweb.freebsd.org/changeset/base/342187 Log: MFC r341810: Free bootstacks after AP startup. Modified: stable/12/sys/kern/kern_thread.c stable/12/sys/x86/x86/mp_x86.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_thread.c ============================================================================== --- stable/12/sys/kern/kern_thread.c Tue Dec 18 06:09:12 2018 (r342186) +++ stable/12/sys/kern/kern_thread.c Tue Dec 18 07:11:12 2018 (r342187) @@ -196,7 +196,7 @@ thread_ctor(void *mem, int size, void *arg, int flags) td = (struct thread *)mem; td->td_state = TDS_INACTIVE; - td->td_oncpu = NOCPU; + td->td_lastcpu = td->td_oncpu = NOCPU; td->td_tid = tid_alloc(); Modified: stable/12/sys/x86/x86/mp_x86.c ============================================================================== --- stable/12/sys/x86/x86/mp_x86.c Tue Dec 18 06:09:12 2018 (r342186) +++ stable/12/sys/x86/x86/mp_x86.c Tue Dec 18 07:11:12 2018 (r342187) @@ -1071,9 +1071,23 @@ init_secondary_tail(void) /* NOTREACHED */ } -/******************************************************************* - * local functions and data - */ +static void +smp_after_idle_runnable(void *arg __unused) +{ + struct thread *idle_td; + int cpu; + + for (cpu = 1; cpu < mp_ncpus; cpu++) { + idle_td = pcpu_find(cpu)->pc_idlethread; + while (idle_td->td_lastcpu == NOCPU && + idle_td->td_oncpu == NOCPU) + cpu_spinwait(); + kmem_free((vm_offset_t)bootstacks[cpu], kstack_pages * + PAGE_SIZE); + } +} +SYSINIT(smp_after_idle_runnable, SI_SUB_SMP, SI_ORDER_ANY, + smp_after_idle_runnable, NULL); /* * We tell the I/O APIC code about all the CPUs we want to receive From owner-svn-src-stable@freebsd.org Tue Dec 18 09:13:52 2018 Return-Path: Delivered-To: svn-src-stable@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 4A21D1348537; Tue, 18 Dec 2018 09:13:52 +0000 (UTC) (envelope-from brooks@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 E238788B79; Tue, 18 Dec 2018 09:13:51 +0000 (UTC) (envelope-from brooks@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 D521A24B5D; Tue, 18 Dec 2018 09:13:51 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBI9Dp2c088987; Tue, 18 Dec 2018 09:13:51 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI9Domc088981; Tue, 18 Dec 2018 09:13:50 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201812180913.wBI9Domc088981@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 18 Dec 2018 09:13:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342188 - in stable/12/sys/netinet: . cc X-SVN-Group: stable-12 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/12/sys/netinet: . cc X-SVN-Commit-Revision: 342188 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E238788B79 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.97)[-0.973,0]; NEURAL_HAM_LONG(-1.00)[-0.996,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 09:13:52 -0000 Author: brooks Date: Tue Dec 18 09:13:50 2018 New Revision: 342188 URL: https://svnweb.freebsd.org/changeset/base/342188 Log: MFC r342125: Fix bugs in plugable CC algorithm and siftr sysctls. Use the sysctl_handle_int() handler to write out the old value and read the new value into a temporary variable. Use the temporary variable for any checks of values rather than using the CAST_PTR_INT() macro on req->newptr. The prior usage read directly from userspace memory if the sysctl() was called correctly. This is unsafe and doesn't work at all on some architectures (at least i386.) In some cases, the code could also be tricked into reading from kernel memory and leaking limited information about the contents or crashing the system. This was true for CDG, newreno, and siftr on all platforms and true for i386 in all cases. The impact of this bug is largest in VIMAGE jails which have been configured to allow writing to these sysctls. Per discussion with the security officer, we will not be issuing an advisory for this issue as root access and a non-default config are required to be impacted. Reviewed by: markj, bz Discussed with: gordon (security officer) Security: kernel information leak, local DoS (both require root) Differential Revision: https://reviews.freebsd.org/D18443 Modified: stable/12/sys/netinet/cc/cc_cdg.c stable/12/sys/netinet/cc/cc_chd.c stable/12/sys/netinet/cc/cc_dctcp.c stable/12/sys/netinet/cc/cc_hd.c stable/12/sys/netinet/cc/cc_newreno.c stable/12/sys/netinet/cc/cc_vegas.c stable/12/sys/netinet/siftr.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/12/sys/netinet/cc/cc_cdg.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_cdg.c Tue Dec 18 09:13:50 2018 (r342188) @@ -80,8 +80,6 @@ __FBSDID("$FreeBSD$"); #define CDG_VERSION "0.1" -#define CAST_PTR_INT(X) (*((int*)(X))) - /* Private delay-gradient induced congestion control signal. */ #define CC_CDG_DELAY 0x01000000 @@ -358,22 +356,37 @@ cdg_cb_destroy(struct cc_var *ccv) static int cdg_beta_handler(SYSCTL_HANDLER_ARGS) { + int error; + uint32_t new; - if (req->newptr != NULL && - (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) - return (EINVAL); + new = *(uint32_t *)arg1; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr != NULL) { + if (new == 0 || new > 100) + error = EINVAL; + else + *(uint32_t *)arg1 = new; + } - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } static int cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) { + int error; + uint32_t new; - if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) - return (EINVAL); + new = *(uint32_t *)arg1; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr != NULL) { + if (new < 1) + error = EINVAL; + else + *(uint32_t *)arg1 = new; + } - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } static inline uint32_t Modified: stable/12/sys/netinet/cc/cc_chd.c ============================================================================== --- stable/12/sys/netinet/cc/cc_chd.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_chd.c Tue Dec 18 09:13:50 2018 (r342188) @@ -78,8 +78,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* * Private signal type for rate based congestion signal. * See for appropriate bit-range to use for private signals. @@ -421,7 +419,7 @@ chd_loss_fair_handler(SYSCTL_HANDLER_ARGS) new = V_chd_loss_fair; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_chd_loss_fair = new; @@ -439,8 +437,7 @@ chd_pmax_handler(SYSCTL_HANDLER_ARGS) new = V_chd_pmax; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) == 0 || - CAST_PTR_INT(req->newptr) > 100) + if (new == 0 || new > 100) error = EINVAL; else V_chd_pmax = new; @@ -458,7 +455,7 @@ chd_qthresh_handler(SYSCTL_HANDLER_ARGS) new = V_chd_qthresh; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) <= V_chd_qmin) + if (new <= V_chd_qmin) error = EINVAL; else V_chd_qthresh = new; Modified: stable/12/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/12/sys/netinet/cc/cc_dctcp.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_dctcp.c Tue Dec 18 09:13:50 2018 (r342188) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define CAST_PTR_INT(X) (*((int*)(X))) - #define MAX_ALPHA_VALUE 1024 VNET_DEFINE_STATIC(uint32_t, dctcp_alpha) = 0; #define V_dctcp_alpha VNET(dctcp_alpha) @@ -400,7 +398,7 @@ dctcp_alpha_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_alpha; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else { if (new > MAX_ALPHA_VALUE) @@ -422,7 +420,7 @@ dctcp_shift_g_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_shift_g; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_dctcp_shift_g = new; @@ -440,7 +438,7 @@ dctcp_slowstart_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_slowstart; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_dctcp_slowstart = new; Modified: stable/12/sys/netinet/cc/cc_hd.c ============================================================================== --- stable/12/sys/netinet/cc/cc_hd.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_hd.c Tue Dec 18 09:13:50 2018 (r342188) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* Largest possible number returned by random(). */ #define RANDOM_MAX INT_MAX @@ -188,8 +186,7 @@ hd_pmax_handler(SYSCTL_HANDLER_ARGS) new = V_hd_pmax; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) == 0 || - CAST_PTR_INT(req->newptr) > 100) + if (new == 0 || new > 100) error = EINVAL; else V_hd_pmax = new; @@ -207,7 +204,7 @@ hd_qmin_handler(SYSCTL_HANDLER_ARGS) new = V_hd_qmin; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > V_hd_qthresh) + if (new > V_hd_qthresh) error = EINVAL; else V_hd_qmin = new; @@ -225,8 +222,7 @@ hd_qthresh_handler(SYSCTL_HANDLER_ARGS) new = V_hd_qthresh; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) < V_hd_qmin) + if (new == 0 || new < V_hd_qmin) error = EINVAL; else V_hd_qthresh = new; Modified: stable/12/sys/netinet/cc/cc_newreno.c ============================================================================== --- stable/12/sys/netinet/cc/cc_newreno.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_newreno.c Tue Dec 18 09:13:50 2018 (r342188) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_NEWRENO, "newreno data", "newreno beta values"); -#define CAST_PTR_INT(X) (*((int*)(X))) - static void newreno_cb_destroy(struct cc_var *ccv); static void newreno_ack_received(struct cc_var *ccv, uint16_t type); static void newreno_after_idle(struct cc_var *ccv); @@ -364,15 +362,21 @@ newreno_ctl_output(struct cc_var *ccv, struct sockopt static int newreno_beta_handler(SYSCTL_HANDLER_ARGS) { + int error; + uint32_t new; - if (req->newptr != NULL ) { + new = *(uint32_t *)arg1; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr != NULL ) { if (arg1 == &VNET_NAME(newreno_beta_ecn) && !V_cc_do_abe) - return (EACCES); - if (CAST_PTR_INT(req->newptr) <= 0 || CAST_PTR_INT(req->newptr) > 100) - return (EINVAL); + error = EACCES; + else if (new == 0 || new > 100) + error = EINVAL; + else + *(uint32_t *)arg1 = new; } - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } SYSCTL_DECL(_net_inet_tcp_cc_newreno); Modified: stable/12/sys/netinet/cc/cc_vegas.c ============================================================================== --- stable/12/sys/netinet/cc/cc_vegas.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/cc/cc_vegas.c Tue Dec 18 09:13:50 2018 (r342188) @@ -79,8 +79,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* * Private signal type for rate based congestion signal. * See for appropriate bit-range to use for private signals. @@ -260,8 +258,7 @@ vegas_alpha_handler(SYSCTL_HANDLER_ARGS) new = V_vegas_alpha; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) > V_vegas_beta) + if (new == 0 || new > V_vegas_beta) error = EINVAL; else V_vegas_alpha = new; @@ -279,8 +276,7 @@ vegas_beta_handler(SYSCTL_HANDLER_ARGS) new = V_vegas_beta; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) < V_vegas_alpha) + if (new == 0 || new < V_vegas_alpha) error = EINVAL; else V_vegas_beta = new; Modified: stable/12/sys/netinet/siftr.c ============================================================================== --- stable/12/sys/netinet/siftr.c Tue Dec 18 07:11:12 2018 (r342187) +++ stable/12/sys/netinet/siftr.c Tue Dec 18 09:13:50 2018 (r342188) @@ -152,8 +152,6 @@ __FBSDID("$FreeBSD$"); #endif /* useful macros */ -#define CAST_PTR_INT(X) (*((int*)(X))) - #define UPPER_SHORT(X) (((X) & 0xFFFF0000) >> 16) #define LOWER_SHORT(X) ((X) & 0x0000FFFF) @@ -1442,22 +1440,22 @@ siftr_manage_ops(uint8_t action) static int siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) { - if (req->newptr == NULL) - goto skip; + int error; + uint32_t new; - /* If the value passed in isn't 0 or 1, return an error. */ - if (CAST_PTR_INT(req->newptr) != 0 && CAST_PTR_INT(req->newptr) != 1) - return (1); - - /* If we are changing state (0 to 1 or 1 to 0). */ - if (CAST_PTR_INT(req->newptr) != siftr_enabled ) - if (siftr_manage_ops(CAST_PTR_INT(req->newptr))) { - siftr_manage_ops(SIFTR_DISABLE); - return (1); + new = siftr_enabled; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error != 0 && req->newptr != NULL) { + if (new > 1) + return (EINVAL); + else if (new != siftr_enabled) { + error = siftr_manage_ops(new); + if (error != 0) + siftr_manage_ops(SIFTR_DISABLE); } + } -skip: - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } From owner-svn-src-stable@freebsd.org Tue Dec 18 09:16:06 2018 Return-Path: Delivered-To: svn-src-stable@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 93C9413488A8; Tue, 18 Dec 2018 09:16:06 +0000 (UTC) (envelope-from brooks@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 3705988F0E; Tue, 18 Dec 2018 09:16:06 +0000 (UTC) (envelope-from brooks@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 2682424B6A; Tue, 18 Dec 2018 09:16:06 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBI9G553089147; Tue, 18 Dec 2018 09:16:05 GMT (envelope-from brooks@FreeBSD.org) Received: (from brooks@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBI9G4Hk089142; Tue, 18 Dec 2018 09:16:04 GMT (envelope-from brooks@FreeBSD.org) Message-Id: <201812180916.wBI9G4Hk089142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: brooks set sender to brooks@FreeBSD.org using -f From: Brooks Davis Date: Tue, 18 Dec 2018 09:16:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342189 - in stable/11/sys/netinet: . cc X-SVN-Group: stable-11 X-SVN-Commit-Author: brooks X-SVN-Commit-Paths: in stable/11/sys/netinet: . cc X-SVN-Commit-Revision: 342189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3705988F0E 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.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.996,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 09:16:06 -0000 Author: brooks Date: Tue Dec 18 09:16:04 2018 New Revision: 342189 URL: https://svnweb.freebsd.org/changeset/base/342189 Log: Partial MFC of r342125: Fix bugs in plugable CC algorithm and siftr sysctls. Use the sysctl_handle_int() handler to write out the old value and read the new value into a temporary variable. Use the temporary variable for any checks of values rather than using the CAST_PTR_INT() macro on req->newptr. The prior usage read directly from userspace memory if the sysctl() was called correctly. This is unsafe and doesn't work at all on some architectures (at least i386.) In some cases, the code could also be tricked into reading from kernel memory and leaking limited information about the contents or crashing the system. This was true for CDG, newreno, and siftr on all platforms and true for i386 in all cases. The impact of this bug is largest in VIMAGE jails which have been configured to allow writing to these sysctls. Per discussion with the security officer, we will not be issuing an advisory for this issue as root access and a non-default config are required to be impacted. Changes to sys/netinet/cc/cc_newreno.c are not merged as the sysctl's had not previously been merged. Reviewed by: markj, bz Discussed with: gordon (security officer) Security: kernel information leak, local DoS (both require root) Differential Revision: https://reviews.freebsd.org/D18443 Modified: stable/11/sys/netinet/cc/cc_cdg.c stable/11/sys/netinet/cc/cc_chd.c stable/11/sys/netinet/cc/cc_dctcp.c stable/11/sys/netinet/cc/cc_hd.c stable/11/sys/netinet/cc/cc_vegas.c stable/11/sys/netinet/siftr.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/cc/cc_cdg.c ============================================================================== --- stable/11/sys/netinet/cc/cc_cdg.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/cc/cc_cdg.c Tue Dec 18 09:16:04 2018 (r342189) @@ -78,8 +78,6 @@ __FBSDID("$FreeBSD$"); #define CDG_VERSION "0.1" -#define CAST_PTR_INT(X) (*((int*)(X))) - /* Private delay-gradient induced congestion control signal. */ #define CC_CDG_DELAY 0x01000000 @@ -356,22 +354,37 @@ cdg_cb_destroy(struct cc_var *ccv) static int cdg_beta_handler(SYSCTL_HANDLER_ARGS) { + int error; + uint32_t new; - if (req->newptr != NULL && - (CAST_PTR_INT(req->newptr) == 0 || CAST_PTR_INT(req->newptr) > 100)) - return (EINVAL); + new = *(uint32_t *)arg1; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr != NULL) { + if (new == 0 || new > 100) + error = EINVAL; + else + *(uint32_t *)arg1 = new; + } - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } static int cdg_exp_backoff_scale_handler(SYSCTL_HANDLER_ARGS) { + int error; + uint32_t new; - if (req->newptr != NULL && CAST_PTR_INT(req->newptr) < 1) - return (EINVAL); + new = *(uint32_t *)arg1; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error == 0 && req->newptr != NULL) { + if (new < 1) + error = EINVAL; + else + *(uint32_t *)arg1 = new; + } - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } static inline unsigned long Modified: stable/11/sys/netinet/cc/cc_chd.c ============================================================================== --- stable/11/sys/netinet/cc/cc_chd.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/cc/cc_chd.c Tue Dec 18 09:16:04 2018 (r342189) @@ -76,8 +76,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* * Private signal type for rate based congestion signal. * See for appropriate bit-range to use for private signals. @@ -420,7 +418,7 @@ chd_loss_fair_handler(SYSCTL_HANDLER_ARGS) new = V_chd_loss_fair; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_chd_loss_fair = new; @@ -438,8 +436,7 @@ chd_pmax_handler(SYSCTL_HANDLER_ARGS) new = V_chd_pmax; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) == 0 || - CAST_PTR_INT(req->newptr) > 100) + if (new == 0 || new > 100) error = EINVAL; else V_chd_pmax = new; @@ -457,7 +454,7 @@ chd_qthresh_handler(SYSCTL_HANDLER_ARGS) new = V_chd_qthresh; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) <= V_chd_qmin) + if (new <= V_chd_qmin) error = EINVAL; else V_chd_qthresh = new; Modified: stable/11/sys/netinet/cc/cc_dctcp.c ============================================================================== --- stable/11/sys/netinet/cc/cc_dctcp.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/cc/cc_dctcp.c Tue Dec 18 09:16:04 2018 (r342189) @@ -56,8 +56,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define CAST_PTR_INT(X) (*((int*)(X))) - #define MAX_ALPHA_VALUE 1024 static VNET_DEFINE(uint32_t, dctcp_alpha) = 0; #define V_dctcp_alpha VNET(dctcp_alpha) @@ -401,7 +399,7 @@ dctcp_alpha_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_alpha; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else { if (new > MAX_ALPHA_VALUE) @@ -423,7 +421,7 @@ dctcp_shift_g_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_shift_g; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_dctcp_shift_g = new; @@ -441,7 +439,7 @@ dctcp_slowstart_handler(SYSCTL_HANDLER_ARGS) new = V_dctcp_slowstart; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > 1) + if (new > 1) error = EINVAL; else V_dctcp_slowstart = new; Modified: stable/11/sys/netinet/cc/cc_hd.c ============================================================================== --- stable/11/sys/netinet/cc/cc_hd.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/cc/cc_hd.c Tue Dec 18 09:16:04 2018 (r342189) @@ -77,8 +77,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* Largest possible number returned by random(). */ #define RANDOM_MAX INT_MAX @@ -186,8 +184,7 @@ hd_pmax_handler(SYSCTL_HANDLER_ARGS) new = V_hd_pmax; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) == 0 || - CAST_PTR_INT(req->newptr) > 100) + if (new == 0 || new > 100) error = EINVAL; else V_hd_pmax = new; @@ -205,7 +202,7 @@ hd_qmin_handler(SYSCTL_HANDLER_ARGS) new = V_hd_qmin; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) > V_hd_qthresh) + if (new > V_hd_qthresh) error = EINVAL; else V_hd_qmin = new; @@ -223,8 +220,7 @@ hd_qthresh_handler(SYSCTL_HANDLER_ARGS) new = V_hd_qthresh; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) < V_hd_qmin) + if (new == 0 || new < V_hd_qmin) error = EINVAL; else V_hd_qthresh = new; Modified: stable/11/sys/netinet/cc/cc_vegas.c ============================================================================== --- stable/11/sys/netinet/cc/cc_vegas.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/cc/cc_vegas.c Tue Dec 18 09:16:04 2018 (r342189) @@ -77,8 +77,6 @@ __FBSDID("$FreeBSD$"); #include -#define CAST_PTR_INT(X) (*((int*)(X))) - /* * Private signal type for rate based congestion signal. * See for appropriate bit-range to use for private signals. @@ -260,8 +258,7 @@ vegas_alpha_handler(SYSCTL_HANDLER_ARGS) new = V_vegas_alpha; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) > V_vegas_beta) + if (new == 0 || new > V_vegas_beta) error = EINVAL; else V_vegas_alpha = new; @@ -279,8 +276,7 @@ vegas_beta_handler(SYSCTL_HANDLER_ARGS) new = V_vegas_beta; error = sysctl_handle_int(oidp, &new, 0, req); if (error == 0 && req->newptr != NULL) { - if (CAST_PTR_INT(req->newptr) < 1 || - CAST_PTR_INT(req->newptr) < V_vegas_alpha) + if (new == 0 || new < V_vegas_alpha) error = EINVAL; else V_vegas_beta = new; Modified: stable/11/sys/netinet/siftr.c ============================================================================== --- stable/11/sys/netinet/siftr.c Tue Dec 18 09:13:50 2018 (r342188) +++ stable/11/sys/netinet/siftr.c Tue Dec 18 09:16:04 2018 (r342189) @@ -150,8 +150,6 @@ __FBSDID("$FreeBSD$"); #endif /* useful macros */ -#define CAST_PTR_INT(X) (*((int*)(X))) - #define UPPER_SHORT(X) (((X) & 0xFFFF0000) >> 16) #define LOWER_SHORT(X) ((X) & 0x0000FFFF) @@ -1440,22 +1438,22 @@ siftr_manage_ops(uint8_t action) static int siftr_sysctl_enabled_handler(SYSCTL_HANDLER_ARGS) { - if (req->newptr == NULL) - goto skip; + int error; + uint32_t new; - /* If the value passed in isn't 0 or 1, return an error. */ - if (CAST_PTR_INT(req->newptr) != 0 && CAST_PTR_INT(req->newptr) != 1) - return (1); - - /* If we are changing state (0 to 1 or 1 to 0). */ - if (CAST_PTR_INT(req->newptr) != siftr_enabled ) - if (siftr_manage_ops(CAST_PTR_INT(req->newptr))) { - siftr_manage_ops(SIFTR_DISABLE); - return (1); + new = siftr_enabled; + error = sysctl_handle_int(oidp, &new, 0, req); + if (error != 0 && req->newptr != NULL) { + if (new > 1) + return (EINVAL); + else if (new != siftr_enabled) { + error = siftr_manage_ops(new); + if (error != 0) + siftr_manage_ops(SIFTR_DISABLE); } + } -skip: - return (sysctl_handle_int(oidp, arg1, arg2, req)); + return (error); } From owner-svn-src-stable@freebsd.org Tue Dec 18 17:31:32 2018 Return-Path: Delivered-To: svn-src-stable@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 57D7C1338478; Tue, 18 Dec 2018 17:31:32 +0000 (UTC) (envelope-from shurd@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 0009177015; Tue, 18 Dec 2018 17:31:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7CA6215A; Tue, 18 Dec 2018 17:31:31 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBIHVVqJ047247; Tue, 18 Dec 2018 17:31:31 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIHVVmw047246; Tue, 18 Dec 2018 17:31:31 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201812181731.wBIHVVmw047246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Tue, 18 Dec 2018 17:31:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342194 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 342194 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0009177015 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]; NEURAL_HAM_LONG(-1.00)[-0.998,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 17:31:32 -0000 Author: shurd Date: Tue Dec 18 17:31:31 2018 New Revision: 342194 URL: https://svnweb.freebsd.org/changeset/base/342194 Log: MFC r341824: Fix !tx_abdicate error from r336560 r336560 was supposed to restore pre-r323954 behaviour when tx_abdicate is not set (the default case). However, it appears that rather than the drainage check being made conditional on tx_abdicate being set, it was duplicated so it occured twice if tx_abdicate was set and once if it was not. Now when !tx_abdicate, drainage is only checked if the doorbell isn't pending. Reported by: lev Sponsored by: Limelight Networks Modified: stable/12/sys/net/iflib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Tue Dec 18 17:17:53 2018 (r342193) +++ stable/12/sys/net/iflib.c Tue Dec 18 17:31:31 2018 (r342194) @@ -3798,7 +3798,6 @@ _task_fn_tx(void *context) */ if (abdicate) ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); - ifmp_ring_check_drainage(txq->ift_br, TX_BATCH_SIZE); if (ctx->ifc_flags & IFC_LEGACY) IFDI_INTR_ENABLE(ctx); else { From owner-svn-src-stable@freebsd.org Tue Dec 18 19:38:34 2018 Return-Path: Delivered-To: svn-src-stable@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 4D73E133CA02; Tue, 18 Dec 2018 19:38:34 +0000 (UTC) (envelope-from jkim@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 EC96B84520; Tue, 18 Dec 2018 19:38:33 +0000 (UTC) (envelope-from jkim@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 DE9D33817; Tue, 18 Dec 2018 19:38:33 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBIJcXfX014290; Tue, 18 Dec 2018 19:38:33 GMT (envelope-from jkim@FreeBSD.org) Received: (from jkim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIJcSDd014266; Tue, 18 Dec 2018 19:38:28 GMT (envelope-from jkim@FreeBSD.org) Message-Id: <201812181938.wBIJcSDd014266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jkim set sender to jkim@FreeBSD.org using -f From: Jung-uk Kim Date: Tue, 18 Dec 2018 19:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342198 - in stable/12/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/tables c... X-SVN-Group: stable-12 X-SVN-Commit-Author: jkim X-SVN-Commit-Paths: in stable/12/sys/contrib/dev/acpica: . common compiler components/debugger components/dispatcher components/executer components/namespace components/parser components/tables components/utilities inclu... X-SVN-Commit-Revision: 342198 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EC96B84520 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.975,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 19:38:34 -0000 Author: jkim Date: Tue Dec 18 19:38:28 2018 New Revision: 342198 URL: https://svnweb.freebsd.org/changeset/base/342198 Log: MFC: r340090, r342056 Merge ACPICA 20181031 and 20181213. Modified: stable/12/sys/contrib/dev/acpica/changes.txt stable/12/sys/contrib/dev/acpica/common/ahpredef.c stable/12/sys/contrib/dev/acpica/common/dmswitch.c stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h stable/12/sys/contrib/dev/acpica/compiler/aslerror.c stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c stable/12/sys/contrib/dev/acpica/compiler/asllength.c stable/12/sys/contrib/dev/acpica/compiler/aslload.c stable/12/sys/contrib/dev/acpica/compiler/aslmain.c stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c stable/12/sys/contrib/dev/acpica/compiler/asloptions.c stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c stable/12/sys/contrib/dev/acpica/compiler/asltransform.c stable/12/sys/contrib/dev/acpica/compiler/aslxref.c stable/12/sys/contrib/dev/acpica/compiler/dtio.c stable/12/sys/contrib/dev/acpica/compiler/dttable2.c stable/12/sys/contrib/dev/acpica/compiler/prscan.c stable/12/sys/contrib/dev/acpica/components/debugger/dbxface.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dsobject.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dsopcode.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dspkginit.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dsutils.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dswload.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dswload2.c stable/12/sys/contrib/dev/acpica/components/dispatcher/dswstate.c stable/12/sys/contrib/dev/acpica/components/executer/exconvrt.c stable/12/sys/contrib/dev/acpica/components/executer/excreate.c stable/12/sys/contrib/dev/acpica/components/executer/exoparg2.c stable/12/sys/contrib/dev/acpica/components/executer/exserial.c stable/12/sys/contrib/dev/acpica/components/executer/exutils.c stable/12/sys/contrib/dev/acpica/components/namespace/nsaccess.c stable/12/sys/contrib/dev/acpica/components/namespace/nseval.c stable/12/sys/contrib/dev/acpica/components/namespace/nsload.c stable/12/sys/contrib/dev/acpica/components/namespace/nsparse.c stable/12/sys/contrib/dev/acpica/components/parser/psloop.c stable/12/sys/contrib/dev/acpica/components/parser/psobject.c stable/12/sys/contrib/dev/acpica/components/parser/psparse.c stable/12/sys/contrib/dev/acpica/components/parser/psxface.c stable/12/sys/contrib/dev/acpica/components/tables/tbxfload.c stable/12/sys/contrib/dev/acpica/components/utilities/utglobal.c stable/12/sys/contrib/dev/acpica/components/utilities/utmisc.c stable/12/sys/contrib/dev/acpica/components/utilities/utosi.c stable/12/sys/contrib/dev/acpica/include/acdisasm.h stable/12/sys/contrib/dev/acpica/include/acglobal.h stable/12/sys/contrib/dev/acpica/include/acnamesp.h stable/12/sys/contrib/dev/acpica/include/acoutput.h stable/12/sys/contrib/dev/acpica/include/acpixf.h stable/12/sys/contrib/dev/acpica/include/acstruct.h stable/12/sys/contrib/dev/acpica/include/actbinfo.h stable/12/sys/contrib/dev/acpica/include/actbl.h stable/12/sys/contrib/dev/acpica/include/actbl3.h stable/12/sys/contrib/dev/acpica/include/actypes.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/contrib/dev/acpica/changes.txt ============================================================================== --- stable/12/sys/contrib/dev/acpica/changes.txt Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/changes.txt Tue Dec 18 19:38:28 2018 (r342198) @@ -1,4 +1,115 @@ ---------------------------------------- +13 December 2018. Summary of changes for version 20181213: + + +1) ACPICA Kernel-resident Subsystem: + +Fixed some buffer length issues with the GenericSerialBus, related to two +of the bidirectional protocols: AttribRawProcessBytes and AttribRawBytes, +which are rarely seen in the field. For these, the LEN field of the ASL +buffer is now ignored. Hans de Goede + +Implemented a new object evaluation trace mechanism for control methods +and data objects. This includes nested control methods. It is +particularly useful for examining the ACPI execution during system +initialization since the output is relatively terse. The flag below +enables the output of the trace via the ACPI_DEBUG_PRINT_RAW interface: + #define ACPI_LV_EVALUATION 0x00080000 + +Examples: + Enter evaluation : _SB.PCI0._INI (Method) + Exit evaluation : _SB.PCI0._INI + Enter evaluation : _OSI (Method) + Exit evaluation : _OSI + Enter evaluation : _SB.PCI0.TEST (Method) + Nested method call : _SB.PCI0.NST1 + Exit nested method : _SB.PCI0.NST1 + Exit evaluation : _SB.PCI0.TEST + +Added two recently-defined _OSI strings. See +https://docs.microsoft.com/en-us/windows-hardware/drivers/acpi/winacpi- +osi. + "Windows 2018" + "Windows 2018.2" + +Update for buffer-to-string conversions via the ToHexString ASL operator. +A "0x" is now prepended to each of the hex values in the output string. +This provides compatibility with other ACPI implementations. The ACPI +specification is somewhat vague on this issue. + Example output string after conversion: +"0x01,0x02,0x03,0x04,0x05,0x06" + +Return a run-time error for TermArg expressions within individual package +elements. Although this is technically supported by the ASL grammar, +other ACPI implementations do not support this either. Also, this fixes a +fault if this type of construct is ever encountered (it never has been). + + +2) iASL Compiler/Disassembler and Tools: + +iASL: Implemented a new compile option (-ww) that will promote individual +warnings and remarks to errors. This is intended to enhance the firmware +build process. + +AcpiExec: Implemented a new command-line option (-eo) to support the new +object evaluation trace mechanism described above. + +Disassembler: Added support to disassemble OEMx tables as AML/ASL tables +instead of a "unknown table" message. + +AcpiHelp: Improved support for the "special" predefined names such as +_Lxx, _Exx, _EJx, _T_x, etc. For these, any legal hex value can now be +used for "xx" and "x". + +---------------------------------------- +31 October 2018. Summary of changes for version 20181031: + + +An Operation Region regression was fixed by properly adding address +ranges to a global list during initialization. This allows OS to +accurately check for overlapping regions between native devices (such as +PCI) and Operation regions as well as checking for region conflicts +between two Operation Regions. + +Added support for the 2-byte extended opcodes in the code/feature that +attempts to continue parsing during the table load phase. Skip parsing +Device declarations (and other extended opcodes) when an error occurs +during parsing. Previously, only single-byte opcodes were supported. + +Cleanup: Simplified the module-level code support by eliminating a +useless global variable (AcpiGbl_GroupModuleLeveCode). + + +2) iASL Compiler/Disassembler and Tools: + +iASL/Preprocessor: Fixed a regression where an incorrect use of ACPI_FREE +could cause a fault in the preprocessor. This was an inadvertent side- +effect from moving more allocations/frees to the local cache/memory +mechanism. + +iASL: Enhanced error detection by validating that all NameSeg elements +within a NamePatch actually exist. The previous behavior was spotty at +best, and such errors could be improperly ignored at compiler time (never +at runtime, however. There are two new error messages, as shown in the +examples below: + +dsdt.asl 33: CreateByteField (TTTT.BXXX, 1, CBF1) +Error 6161 - ^ One or more objects within +the Pathname do not exist (TTTT.BXXX) + +dsdt.asl 34: CreateByteField (BUF1, UUUU.INT1, BBBB.CBF1) +Error 6160 - One or more prefix Scopes do not exist ^ +(BBBB.CBF1) + +iASL: Disassembler/table-compiler: Added support for the static data +table TPM2 revision 3 (an older version of TPM2). The support has been +added for the compiler and the disassembler. + +Fixed compilation of DOS format data table file on Unix/Linux systems. +iASL now properly detects line continuations (\) for DOS format data +table definition language files on when executing on Unix/Linux. + +---------------------------------------- 03 October 2018. Summary of changes for version 20181003: Modified: stable/12/sys/contrib/dev/acpica/common/ahpredef.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/common/ahpredef.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/common/ahpredef.c Tue Dec 18 19:38:28 2018 (r342198) @@ -171,7 +171,7 @@ */ const AH_PREDEFINED_NAME AslPredefinedInfo[] = { - AH_PREDEF ("_ACx", "Active Cooling", "Returns the active cooling policy threshold values"), + AH_PREDEF ("_ACx", "Active Cooling, x=0-9", "Returns the active cooling policy threshold values"), AH_PREDEF ("_ADR", "Address", "Returns address of a device on parent bus, and resource field"), AH_PREDEF ("_AEI", "ACPI Event Interrupts", "Returns a list of GPIO events to be used as ACPI events"), AH_PREDEF ("_ALC", "Ambient Light Chromaticity", "Returns the ambient light color chromaticity"), @@ -180,7 +180,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_ALP", "Ambient Light Polling", "Returns the ambient light sensor polling frequency"), AH_PREDEF ("_ALR", "Ambient Light Response", "Returns the ambient light brightness to display brightness mappings"), AH_PREDEF ("_ALT", "Ambient Light Temperature", "Returns the ambient light color temperature"), - AH_PREDEF ("_ALx", "Active List", "Returns a list of active cooling device objects"), + AH_PREDEF ("_ALx", "Active List, x=0-9", "Returns a list of active cooling device objects"), AH_PREDEF ("_ART", "Active Cooling Relationship Table", "Returns thermal relationship information between platform devices and fan devices"), AH_PREDEF ("_ASI", "Address Space Id", "Resource Descriptor field"), AH_PREDEF ("_ASZ", "Access Size", "Resource Descriptor field"), @@ -237,11 +237,11 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_DSS", "Device Set State", "Sets the display device state"), AH_PREDEF ("_DSW", "Device Sleep Wake", "Sets the sleep and wake transition states for a device"), AH_PREDEF ("_DTI", "Device Temperature Indication", "Conveys native device temperature to the platform"), - AH_PREDEF ("_Exx", "Edge-Triggered GPE", "Method executed as a result of a general-purpose event"), + AH_PREDEF ("_Exx", "Edge-Triggered GPE, xx=0x00-0xFF", "Method executed as a result of a general-purpose event"), AH_PREDEF ("_EC_", "Embedded Controller", "returns EC offset and query information"), AH_PREDEF ("_EDL", "Eject Device List", "Returns a list of devices that are dependent on a device (docking)"), AH_PREDEF ("_EJD", "Ejection Dependent Device", "Returns the name of dependent (parent) device (docking)"), - AH_PREDEF ("_EJx", "Eject Device", "Begin or cancel a device ejection request (docking)"), + AH_PREDEF ("_EJx", "Eject Device, x=0-9", "Begin or cancel a device ejection request (docking)"), AH_PREDEF ("_END", "Endianness", "Endian orientation, Resource Descriptor field"), AH_PREDEF ("_EVT", "Event", "Event method for GPIO events"), AH_PREDEF ("_FDE", "Floppy Disk Enumerate", "Returns floppy disk configuration information"), @@ -281,7 +281,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_INT", "Interrupts", "Interrupt mask bits, Resource Descriptor field"), AH_PREDEF ("_IOR", "I/O Restriction", "Restriction type, Resource Descriptor field"), AH_PREDEF ("_IRC", "Inrush Current", "Presence indicates that a device has a significant inrush current draw"), - AH_PREDEF ("_Lxx", "Level-Triggered GPE", "Control method executed as a result of a general-purpose event"), + AH_PREDEF ("_Lxx", "Level-Triggered GPE, xx=0x00-0xFF", "Control method executed as a result of a general-purpose event"), AH_PREDEF ("_LCK", "Lock Device", "Locks or unlocks a device (docking)"), AH_PREDEF ("_LEN", "Length", "Range length, Resource Descriptor field"), AH_PREDEF ("_LID", "Lid Status", "Returns the open/closed status of the lid on a mobile system"), @@ -358,7 +358,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_PTS", "Prepare To Sleep", "Inform the platform of an impending sleep transition"), AH_PREDEF ("_PUR", "Processor Utilization Request", "Returns the number of processors that the platform would like to idle"), AH_PREDEF ("_PXM", "Device Proximity", "Returns a device's proximity domain identifier"), - AH_PREDEF ("_Qxx", "EC Query", "Embedded Controller query and SMBus Alarm control method"), + AH_PREDEF ("_Qxx", "EC Query, xx=0x00-0xFF", "Embedded Controller query and SMBus Alarm control method"), AH_PREDEF ("_RBO", "Register Bit Offset", "Resource Descriptor field"), AH_PREDEF ("_RBW", "Register Bit Width", "Resource Descriptor field"), AH_PREDEF ("_RDI", "Resource Dependencies for Idle", "Returns a list of dependencies for idle states"), @@ -413,7 +413,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_SUB", "Subsystem ID", "Returns the subsystem ID for a device"), AH_PREDEF ("_SUN", "Slot User Number", "Returns the slot unique ID number"), AH_PREDEF ("_SWS", "System Wake Source", "Returns the source event that caused the system to wake"), - AH_PREDEF ("_T_x", "Emitted by ASL Compiler", "Reserved for use by ASL compilers"), + AH_PREDEF ("_T_x", "Emitted by ASL Compiler, x=0-9, A-Z", "Reserved for use by ASL compilers"), AH_PREDEF ("_TC1", "Thermal Constant 1", "Returns TC1 for the passive cooling formula"), AH_PREDEF ("_TC2", "Thermal Constant 2", "Returns TC2 for the passive cooling formula"), AH_PREDEF ("_TDL", "T-State Depth Limit", "Returns the _TSS entry number of the lowest power throttling state"), @@ -447,7 +447,7 @@ const AH_PREDEFINED_NAME AslPredefinedInfo[] = AH_PREDEF ("_VAL", "Pin Configuration Value", "Resource Descriptor field"), AH_PREDEF ("_VEN", "Vendor Data", "Resource Descriptor field"), AH_PREDEF ("_VPO", "Video Post Options", "Returns the implemented video post options"), - AH_PREDEF ("_Wxx", "Wake Event", "Method executed as a result of a wake event"), + AH_PREDEF ("_Wxx", "Wake Event, xx=0x00-0xFF", "Method executed as a result of a wake event"), AH_PREDEF ("_WAK", "Wake", "Inform AML that the system has just awakened"), AH_PREDEF ("_WPC", "Wireless Power Calibration", "Calibrate power and notify wireless device"), AH_PREDEF ("_WPP", "Wireless Power Polling", "Get recommended polling interval"), Modified: stable/12/sys/contrib/dev/acpica/common/dmswitch.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/common/dmswitch.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/common/dmswitch.c Tue Dec 18 19:38:28 2018 (r342198) @@ -325,6 +325,8 @@ AcpiDmClearTempList ( * FUNCTION: AcpiDmIsSwitchBlock * * PARAMETERS: Op - While Object + * Temp - Where the compiler temp name is returned + * (_T_x) * * RETURN: TRUE if While block can be converted to a Switch/Case block * @@ -550,6 +552,10 @@ AcpiDmIsSwitchBlock ( if (CurrentOp->Common.AmlOpcode == AML_ELSE_OP) { CurrentOp = CurrentOp->Common.Next; + if (!CurrentOp) + { + return (FALSE); + } } /* Ignore the Break Op */ Modified: stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/common/dmtbdump3.c Tue Dec 18 19:38:28 2018 (r342198) @@ -497,7 +497,52 @@ AcpiDmDumpTcpa ( * DESCRIPTION: Format the contents of a TPM2. * ******************************************************************************/ +static void +AcpiDmDumpTpm2Rev3 ( + ACPI_TABLE_HEADER *Table) +{ + UINT32 Offset = sizeof (ACPI_TABLE_TPM23); + ACPI_TABLE_TPM23 *CommonHeader = ACPI_CAST_PTR (ACPI_TABLE_TPM23, Table); + ACPI_TPM23_TRAILER *Subtable = ACPI_ADD_PTR (ACPI_TPM23_TRAILER, Table, Offset); + ACPI_STATUS Status; + + /* Main table */ + + Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm23); + if (ACPI_FAILURE (Status)) + { + return; + } + + /* Optional subtable if start method is ACPI start method */ + + switch (CommonHeader->StartMethod) + { + case ACPI_TPM23_ACPI_START_METHOD: + + Status = AcpiDmDumpTable (Table->Length, Offset, Subtable, + Table->Length - Offset, AcpiDmTableInfoTpm23a); + break; + + default: + break; + } +} + + +/******************************************************************************* + * + * FUNCTION: AcpiDmDumpTpm2 + * + * PARAMETERS: Table - A TPM2 table + * + * RETURN: None + * + * DESCRIPTION: Format the contents of a TPM2. + * + ******************************************************************************/ + void AcpiDmDumpTpm2 ( ACPI_TABLE_HEADER *Table) @@ -509,9 +554,16 @@ AcpiDmDumpTpm2 ( ACPI_STATUS Status; + if (Table->Revision == 3) + { + AcpiDmDumpTpm2Rev3(Table); + return; + } + /* Main table */ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoTpm2); + if (ACPI_FAILURE (Status)) { return; Modified: stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/common/dmtbinfo3.c Tue Dec 18 19:38:28 2018 (r342198) @@ -446,6 +446,26 @@ ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[ * ******************************************************************************/ +/* TPM2 revision 3 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (Reserved), "Reserved", 0}, + {ACPI_DMT_UINT64, ACPI_TPM23_OFFSET (ControlAddress), "Control Address", 0}, + {ACPI_DMT_UINT32, ACPI_TPM23_OFFSET (StartMethod), "Start Method", 0}, + ACPI_DMT_TERMINATOR +}; + +/* Trailer in the case that StartMethod == 2 */ + +ACPI_DMTABLE_INFO AcpiDmTableInfoTpm23a[] = +{ + {ACPI_DMT_UINT32, ACPI_TPM23A_OFFSET (Reserved), "Reserved", DT_OPTIONAL}, + ACPI_DMT_TERMINATOR +}; + +/* TPM2 revision 4 */ + ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[] = { {ACPI_DMT_UINT16, ACPI_TPM2_OFFSET (PlatformClass), "Platform Class", 0}, Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslcodegen.c Tue Dec 18 19:38:28 2018 (r342198) @@ -773,12 +773,6 @@ CgWriteNode ( return; } - if ((Op->Asl.ParseOpcode == PARSEOP_EXTERNAL) && - AslGbl_DoExternals == FALSE) - { - return; - } - Op->Asl.FinalAmlLength = 0; switch (Op->Asl.AmlOpcode) Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslcompile.c Tue Dec 18 19:38:28 2018 (r342198) @@ -388,23 +388,20 @@ CmDoCompile ( /* Resolve External Declarations */ - if (AslGbl_DoExternals) - { - Event = UtBeginEvent ("Resolve all Externals"); - DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); + Event = UtBeginEvent ("Resolve all Externals"); + DbgPrint (ASL_DEBUG_OUTPUT, "\nResolve Externals\n\n"); - if (AslGbl_DoExternalsInPlace) - { - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, - ExAmlExternalWalkBegin, NULL, NULL); - } - else - { - TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, - ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); - } - UtEndEvent (Event); + if (AslGbl_DoExternalsInPlace) + { + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_DOWNWARD, + ExAmlExternalWalkBegin, NULL, NULL); } + else + { + TrWalkParseTree (AslGbl_ParseTreeRoot, ASL_WALK_VISIT_TWICE, + ExAmlExternalWalkBegin, ExAmlExternalWalkEnd, NULL); + } + UtEndEvent (Event); /* * Semantic analysis. This can happen only after the @@ -858,7 +855,7 @@ CmCleanupAndExit ( if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { - printf ("\nMaximum error count (%u) exceeded\n", + printf ("\nMaximum error count (%d) exceeded\n", ASL_MAX_ERROR_COUNT); } Modified: stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslcompiler.h Tue Dec 18 19:38:28 2018 (r342198) @@ -475,6 +475,10 @@ AslExpectException ( char *MessageIdString); ACPI_STATUS +AslElevateException ( + char *MessageIdString); + +ACPI_STATUS AslDisableException ( char *MessageIdString); Modified: stable/12/sys/contrib/dev/acpica/compiler/aslerror.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslerror.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslerror.c Tue Dec 18 19:38:28 2018 (r342198) @@ -201,7 +201,12 @@ AePrintSubError ( FILE *OutputFile, ASL_ERROR_MSG *Enode); +static UINT8 +GetModifiedLevel ( + UINT8 Level, + UINT16 MessageId); + /******************************************************************************* * * FUNCTION: AslAbort @@ -968,11 +973,12 @@ AslLogNewError ( ASL_ERROR_MSG *SubError) { ASL_ERROR_MSG *Enode = NULL; + UINT8 ModifiedLevel = GetModifiedLevel (Level, MessageId); - AslInitEnode (&Enode, Level, MessageId, LineNumber, LogicalLineNumber, - LogicalByteOffset, Column, Filename, Message, SourceLine, - SubError); + AslInitEnode (&Enode, ModifiedLevel, MessageId, LineNumber, + LogicalLineNumber, LogicalByteOffset, Column, Filename, Message, + SourceLine, SubError); /* Add the new node to the error node list */ @@ -985,7 +991,7 @@ AslLogNewError ( AePrintException (ASL_FILE_STDERR, Enode, NULL); } - AslGbl_ExceptionCount[Level]++; + AslGbl_ExceptionCount[ModifiedLevel]++; if (AslGbl_ExceptionCount[ASL_ERROR] > ASL_MAX_ERROR_COUNT) { printf ("\nMaximum error count (%u) exceeded\n", ASL_MAX_ERROR_COUNT); @@ -999,8 +1005,46 @@ AslLogNewError ( return; } + /******************************************************************************* * + * FUNCTION: GetModifiedLevel + * + * PARAMETERS: Level - Seriousness (Warning/error, etc.) + * MessageId - Index into global message buffer + * + * RETURN: UINT8 - modified level + * + * DESCRIPTION: Get the modified level of exception codes that are reported as + * errors from the -ww option. + * + ******************************************************************************/ + +static UINT8 +GetModifiedLevel ( + UINT8 Level, + UINT16 MessageId) +{ + UINT16 i; + UINT16 ExceptionCode; + + + ExceptionCode = AeBuildFullExceptionCode (Level, MessageId); + + for (i = 0; i < AslGbl_ElevatedMessagesIndex; i++) + { + if (ExceptionCode == AslGbl_ElevatedMessages[i]) + { + return (ASL_ERROR); + } + } + + return (Level); +} + + +/******************************************************************************* + * * FUNCTION: AslIsExceptionIgnored * * PARAMETERS: Level - Seriousness (Warning/error, etc.) @@ -1097,7 +1141,7 @@ AslExpectException ( if (AslGbl_ExpectedMessagesIndex >= ASL_MAX_EXPECTED_MESSAGES) { - printf ("Too many messages have been registered as expected (max %u)\n", + printf ("Too many messages have been registered as expected (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } @@ -1144,7 +1188,7 @@ AslDisableException ( if (AslGbl_DisabledMessagesIndex >= ASL_MAX_DISABLED_MESSAGES) { - printf ("Too many messages have been disabled (max %u)\n", + printf ("Too many messages have been disabled (max %d)\n", ASL_MAX_DISABLED_MESSAGES); return (AE_LIMIT); } @@ -1154,6 +1198,51 @@ AslDisableException ( return (AE_OK); } + +/******************************************************************************* + * + * FUNCTION: AslElevateException + * + * PARAMETERS: MessageIdString - ID of excepted exception during compile + * + * RETURN: Status + * + * DESCRIPTION: Enter a message ID into the global elevated exceptions table. + * These messages will be considered as compilation errors. + * + ******************************************************************************/ + +ACPI_STATUS +AslElevateException ( + char *MessageIdString) +{ + UINT32 MessageId; + + + /* Convert argument to an integer and validate it */ + + MessageId = (UINT32) strtoul (MessageIdString, NULL, 0); + + if (MessageId > 6999) + { + printf ("\"%s\" is not a valid warning/remark/erro ID\n", + MessageIdString); + return (AE_BAD_PARAMETER); + } + + /* Insert value into the global expected message array */ + + if (AslGbl_ElevatedMessagesIndex >= ASL_MAX_ELEVATED_MESSAGES) + { + printf ("Too many messages have been registered as elevated (max %d)\n", + ASL_MAX_DISABLED_MESSAGES); + return (AE_LIMIT); + } + + AslGbl_ElevatedMessages[AslGbl_ExpectedMessagesIndex] = MessageId; + AslGbl_ElevatedMessagesIndex++; + return (AE_OK); +} /******************************************************************************* * Modified: stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslglobal.h Tue Dec 18 19:38:28 2018 (r342198) @@ -255,6 +255,7 @@ extern int AslCompilerdebug; #define ASL_STRING_BUFFER_SIZE (1024 * 32) /* 32k */ #define ASL_MAX_DISABLED_MESSAGES 32 #define ASL_MAX_EXPECTED_MESSAGES 32 +#define ASL_MAX_ELEVATED_MESSAGES 32 #define HEX_TABLE_LINE_SIZE 8 #define HEX_LISTING_LINE_SIZE 8 @@ -319,7 +320,6 @@ ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (A ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_PruneParseTree, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoTypechecking, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_EnableReferenceTypechecking, FALSE); -ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternals, TRUE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoExternalsInPlace, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_DoAslConversion, FALSE); ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (AslGbl_OptimizeTrivialParseNodes, TRUE); @@ -394,6 +394,7 @@ ASL_EXTERN UINT32 ASL_INIT_GLOBAL (A ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_CurrentLine, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_DisabledMessagesIndex, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ExpectedMessagesIndex, 0); +ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ElevatedMessagesIndex, 0); ASL_EXTERN UINT8 ASL_INIT_GLOBAL (AslGbl_HexBytesWereWritten, FALSE); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_NumNamespaceObjects, 0); ASL_EXTERN UINT32 ASL_INIT_GLOBAL (AslGbl_ReservedMethods, 0); @@ -435,6 +436,7 @@ ASL_EXTERN char AslGbl_StringBuffe ASL_EXTERN char AslGbl_StringBuffer2[ASL_STRING_BUFFER_SIZE]; ASL_EXTERN UINT32 AslGbl_DisabledMessages[ASL_MAX_DISABLED_MESSAGES]; ASL_EXTERN ASL_EXPECTED_MESSAGE AslGbl_ExpectedMessages[ASL_MAX_EXPECTED_MESSAGES]; +ASL_EXTERN UINT32 AslGbl_ElevatedMessages[ASL_MAX_ELEVATED_MESSAGES]; #endif /* __ASLGLOBAL_H */ Modified: stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslhelp.c Tue Dec 18 19:38:28 2018 (r342198) @@ -208,6 +208,7 @@ Usage ( ACPI_OPTION ("-vx ", "Expect a specific warning, remark, or error"); ACPI_OPTION ("-w <1|2|3>", "Set warning reporting level"); ACPI_OPTION ("-we", "Report warnings as errors"); + ACPI_OPTION ("-ww ", "Report specific warning or remark as error"); printf ("\nAML Bytecode Generation (*.aml):\n"); ACPI_OPTION ("-oa", "Disable all optimizations (compatibility mode)"); Modified: stable/12/sys/contrib/dev/acpica/compiler/asllength.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/asllength.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/asllength.c Tue Dec 18 19:38:28 2018 (r342198) @@ -519,10 +519,7 @@ CgGenerateAmlLengths ( case PARSEOP_EXTERNAL: - if (AslGbl_DoExternals == TRUE) - { - CgGenerateAmlOpcodeLength (Op); - } + CgGenerateAmlOpcodeLength (Op); break; default: Modified: stable/12/sys/contrib/dev/acpica/compiler/aslload.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslload.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslload.c Tue Dec 18 19:38:28 2018 (r342198) @@ -417,10 +417,8 @@ LdLoadResourceElements ( { Status = AcpiNsLookup (WalkState->ScopeInfo, InitializerOp->Asl.ExternalName, - ACPI_TYPE_LOCAL_RESOURCE_FIELD, - ACPI_IMODE_LOAD_PASS1, - ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, - NULL, &Node); + ACPI_TYPE_LOCAL_RESOURCE_FIELD, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH | ACPI_NS_DONT_OPEN_SCOPE, NULL, &Node); if (ACPI_FAILURE (Status)) { return (Status); @@ -687,8 +685,7 @@ LdNamespace1Begin ( * handle this case. Perhaps someday this case can go away. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_ANY, - ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, - WalkState, &(Node)); + ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT, WalkState, &Node); if (ACPI_FAILURE (Status)) { if (Status == AE_NOT_FOUND) @@ -696,23 +693,26 @@ LdNamespace1Begin ( /* The name was not found, go ahead and create it */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_LOCAL_SCOPE, - ACPI_IMODE_LOAD_PASS1, Flags, - WalkState, &(Node)); + ACPI_TYPE_LOCAL_SCOPE, ACPI_IMODE_LOAD_PASS1, + Flags, WalkState, &Node); if (ACPI_FAILURE (Status)) { return_ACPI_STATUS (Status); } - /* - * However, this is an error -- primarily because the MS - * interpreter can't handle a forward reference from the - * Scope() operator. - */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); - AslError (ASL_ERROR, ASL_MSG_SCOPE_FWD_REF, Op, - Op->Asl.ExternalName); + /* However, this is an error -- operand to Scope must exist */ + + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + goto FinishNode; } @@ -824,7 +824,6 @@ LdNamespace1Begin ( break; } - ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Loading name: %s, (%s)\n", Op->Asl.ExternalName, AcpiUtGetTypeName (ObjectType))); @@ -833,6 +832,18 @@ LdNamespace1Begin ( Flags |= ACPI_NS_ERROR_IF_FOUND; /* + * For opcodes that enter new names into the namespace, + * all prefix NameSegs must exist. + */ + WalkState->OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); + if (((WalkState->OpInfo->Flags & AML_NAMED) || + (WalkState->OpInfo->Flags & AML_CREATE)) && + (Op->Asl.AmlOpcode != AML_EXTERNAL_OP)) + { + Flags |= ACPI_NS_PREFIX_MUST_EXIST; + } + + /* * Enter the named type into the internal namespace. We enter the name * as we go downward in the parse tree. Any necessary subobjects that * involve arguments to the opcode must be created as we go back up the @@ -915,8 +926,20 @@ LdNamespace1Begin ( return_ACPI_STATUS (AE_OK); } } + else if (AE_NOT_FOUND) + { + /* + * One or more prefix NameSegs of the NamePath do not exist + * (all of them must exist). Attempt to continue compilation + * by setting the current scope to the root. + */ + Node = AcpiGbl_RootNode; + Status = AE_OK; + } else { + /* Flag all other errors as coming from the ACPICA core */ + AslCoreSubsystemError (Op, Status, "Failure from namespace lookup", FALSE); return_ACPI_STATUS (Status); @@ -1043,10 +1066,10 @@ LdNamespace2Begin ( if (Op->Asl.ParseOpcode == PARSEOP_ALIAS) { - /* Complete the alias node by getting and saving the target node */ - - /* First child is the alias target */ - + /* + * Complete the alias node by getting and saving the target node. + * First child is the alias target + */ Arg = Op->Asl.Child; /* Get the target pathname */ @@ -1070,18 +1093,34 @@ LdNamespace2Begin ( { if (Status == AE_NOT_FOUND) { - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + /* Standalone NameSeg vs. NamePath */ + if (strlen (Arg->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Arg->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Arg->Asl.ExternalName); + } + +#if 0 +/* + * NOTE: Removed 10/2018 to enhance compiler error reporting. No + * regressions seen. + */ /* * The name was not found, go ahead and create it. * This prevents more errors later. */ Status = AcpiNsLookup (WalkState->ScopeInfo, Path, - ACPI_TYPE_ANY, - ACPI_IMODE_LOAD_PASS1, ACPI_NS_NO_UPSEARCH, - WalkState, &(Node)); - return (AE_OK); + ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS1, + ACPI_NS_NO_UPSEARCH, WalkState, &Node); +#endif + return (Status); +/* Removed: return (AE_OK)*/ } AslCoreSubsystemError (Op, Status, Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmain.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslmain.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslmain.c Tue Dec 18 19:38:28 2018 (r342198) @@ -329,7 +329,7 @@ AslSignalHandler ( default: - printf (ASL_PREFIX "Unknown interrupt signal (%u)\n", Sig); + printf (ASL_PREFIX "Unknown interrupt signal (%d)\n", Sig); break; } Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslmessages.c Tue Dec 18 19:38:28 2018 (r342198) @@ -285,7 +285,7 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_NON_ASCII */ "Invalid characters found in file", /* ASL_MSG_NON_ZERO */ "Operand evaluates to zero", /* ASL_MSG_NOT_EXIST */ "Object does not exist", -/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from scope", +/* ASL_MSG_NOT_FOUND */ "Object not found or not accessible from current scope", /* ASL_MSG_NOT_METHOD */ "Not a control method, cannot invoke", /* ASL_MSG_NOT_PARAMETER */ "Not a parameter, used as local only", /* ASL_MSG_NOT_REACHABLE */ "Object is not accessible from this scope", @@ -359,7 +359,9 @@ const char *AslCompilerMsgs [] = /* ASL_MSG_OEM_ID */ "Invalid OEM ID", /* ASL_MSG_UNLOAD */ "Unload is not supported by all operating systems", /* ASL_MSG_OFFSET */ "Unnecessary/redundant use of Offset operator", -/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second" +/* ASL_MSG_LONG_SLEEP */ "Very long Sleep, greater than 1 second", +/* ASL_MSG_PREFIX_NOT_EXIST */ "One or more prefix Scopes do not exist", +/* ASL_MSG_NAMEPATH_NOT_EXIST */ "One or more objects within the Pathname do not exist" }; /* Table compiler */ Modified: stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslmessages.h Tue Dec 18 19:38:28 2018 (r342198) @@ -362,6 +362,8 @@ typedef enum ASL_MSG_UNLOAD, ASL_MSG_OFFSET, ASL_MSG_LONG_SLEEP, + ASL_MSG_PREFIX_NOT_EXIST, + ASL_MSG_NAMEPATH_NOT_EXIST, /* These messages are used by the Data Table compiler only */ Modified: stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslopcodes.c Tue Dec 18 19:38:28 2018 (r342198) @@ -927,15 +927,6 @@ OpcGenerateAmlOpcode ( AslGbl_HasIncludeFiles = TRUE; break; - case PARSEOP_EXTERNAL: - - if (AslGbl_DoExternals == FALSE) - { - Op->Asl.Child->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - Op->Asl.Child->Asl.Next->Asl.ParseOpcode = PARSEOP_DEFAULT_ARG; - } - break; - case PARSEOP_TIMER: if (AcpiGbl_IntegerBitWidth == 32) Modified: stable/12/sys/contrib/dev/acpica/compiler/asloptions.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/asloptions.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/asloptions.c Tue Dec 18 19:38:28 2018 (r342198) @@ -976,6 +976,23 @@ AslDoOptions ( AslGbl_WarningsAsErrors = TRUE; break; + case 'w': + + /* Get the required argument */ + + if (AcpiGetoptArgument (argc, argv)) + { + return (-1); + } + + Status = AslElevateException (AcpiGbl_Optarg); + if (ACPI_FAILURE (Status)) + { + return (-1); + } + break; + + default: printf ("Unknown option: -w%s\n", AcpiGbl_Optarg); Modified: stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslpredef.c Tue Dec 18 19:38:28 2018 (r342198) @@ -222,7 +222,7 @@ ApCheckForPredefinedMethod ( if (MethodInfo->NumArguments != 0) { - sprintf (AslGbl_MsgBuffer, "%s requires %u", Op->Asl.ExternalName, 0); + sprintf (AslGbl_MsgBuffer, "%s requires %d", Op->Asl.ExternalName, 0); AslError (ASL_WARNING, ASL_MSG_RESERVED_ARG_COUNT_HI, Op, AslGbl_MsgBuffer); Modified: stable/12/sys/contrib/dev/acpica/compiler/asltransform.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/asltransform.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/asltransform.c Tue Dec 18 19:38:28 2018 (r342198) @@ -460,11 +460,7 @@ TrTransformSubtree ( case PARSEOP_EXTERNAL: - if (AslGbl_DoExternals == TRUE) - { - ExDoExternal (Op); - } - + ExDoExternal (Op); break; case PARSEOP___METHOD__: Modified: stable/12/sys/contrib/dev/acpica/compiler/aslxref.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/aslxref.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/aslxref.c Tue Dec 18 19:38:28 2018 (r342198) @@ -718,23 +718,55 @@ XfNamespaceLocateBegin ( } else { - /* Check for a fully qualified path */ + /* The NamePath contains multiple NameSegs */ - if (Path[0] == AML_ROOT_PREFIX) + if ((OpInfo->Flags & AML_CREATE) || + (OpInfo->ObjectType == ACPI_TYPE_LOCAL_ALIAS)) { - /* Gave full path, the object does not exist */ + /* + * The new name is the last parameter. For the + * CreateXXXXField and Alias operators + */ + NextOp = Op->Asl.Child; + while (!(NextOp->Asl.CompileFlags & OP_IS_NAME_DECLARATION)) + { + NextOp = NextOp->Asl.Next; + } + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, NextOp, + NextOp->Asl.ExternalName); + } + else if (OpInfo->Flags & AML_NAMED) + { + /* The new name is the first parameter */ + + AslError (ASL_ERROR, ASL_MSG_PREFIX_NOT_EXIST, Op, + Op->Asl.ExternalName); + } + else if (Path[0] == AML_ROOT_PREFIX) + { + /* Full namepath from root, the object does not exist */ + AslError (ASL_ERROR, ASL_MSG_NOT_EXIST, Op, Op->Asl.ExternalName); } else { /* - * We can't tell whether it doesn't exist or just - * can't be reached. + * Generic "not found" error. Cannot determine whether it + * doesn't exist or just can't be reached. However, we + * can differentiate between a NameSeg vs. NamePath. */ - AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, - Op->Asl.ExternalName); + if (strlen (Op->Asl.ExternalName) == ACPI_NAME_SIZE) + { + AslError (ASL_ERROR, ASL_MSG_NOT_FOUND, Op, + Op->Asl.ExternalName); + } + else + { + AslError (ASL_ERROR, ASL_MSG_NAMEPATH_NOT_EXIST, Op, + Op->Asl.ExternalName); + } } } Modified: stable/12/sys/contrib/dev/acpica/compiler/dtio.c ============================================================================== --- stable/12/sys/contrib/dev/acpica/compiler/dtio.c Tue Dec 18 19:38:13 2018 (r342197) +++ stable/12/sys/contrib/dev/acpica/compiler/dtio.c Tue Dec 18 19:38:28 2018 (r342198) @@ -236,7 +236,7 @@ DtTrim ( /* Skip lines that start with a space */ - if (!strcmp (String, " ")) + if (*String == 0 || !strcmp (String, " ")) { ReturnString = UtLocalCacheCalloc (1); return (ReturnString); @@ -258,7 +258,7 @@ DtTrim ( while (End >= Start) { - if (*End == '\r' || *End == '\n') + if (*End == '\n') { End--; continue; @@ -522,6 +522,7 @@ DtGetNextLine ( UINT32 CurrentLineOffset; UINT32 i; int c; + int c1; memset (AslGbl_CurrentLineBuffer, 0, AslGbl_LineBufferSize); @@ -568,6 +569,29 @@ DtGetNextLine ( */ c = '\n'; State = DT_NORMAL_TEXT; + } + else if (c == '\r') + { + c1 = getc (Handle); + if (c1 == '\n') + { + /* + * Skip the carriage return as if it didn't exist. This is + * onlt meant for input files in DOS format in unix. fopen in + * unix may not support "text mode" and leaves CRLF intact. + */ + c = '\n'; + } + else + { + /* This was not a CRLF. Only a CR */ + + ungetc(c1, Handle); + + DtFatal (ASL_MSG_COMPILER_INTERNAL, NULL, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Dec 18 20:12:45 2018 Return-Path: Delivered-To: svn-src-stable@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 BB958133DC68; Tue, 18 Dec 2018 20:12: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 1E43A85DEC; Tue, 18 Dec 2018 20:12: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 EEC813FBE; Tue, 18 Dec 2018 20:12:43 +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 wBIKChan034820; Tue, 18 Dec 2018 20:12:43 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIKChlc034819; Tue, 18 Dec 2018 20:12:43 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812182012.wBIKChlc034819@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 20:12:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342199 - stable/12/sys/x86/x86 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/x86/x86 X-SVN-Commit-Revision: 342199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1E43A85DEC 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.97)[-0.973,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 20:12:45 -0000 Author: markj Date: Tue Dec 18 20:12:43 2018 New Revision: 342199 URL: https://svnweb.freebsd.org/changeset/base/342199 Log: MFC r341821: Fix the PAE kernel gcc build. Modified: stable/12/sys/x86/x86/ucode.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/x86/x86/ucode.c ============================================================================== --- stable/12/sys/x86/x86/ucode.c Tue Dec 18 19:38:28 2018 (r342198) +++ stable/12/sys/x86/x86/ucode.c Tue Dec 18 20:12:43 2018 (r342199) @@ -278,12 +278,13 @@ ucode_load_ap(int cpu) } static void * -map_ucode(vm_paddr_t free, size_t len) +map_ucode(uintptr_t free, size_t len) { - #ifdef __i386__ - for (vm_paddr_t pa = free; pa < free + len; pa += PAGE_SIZE) - pmap_kenter(pa, pa); + uintptr_t va; + + for (va = free; va < free + len; va += PAGE_SIZE) + pmap_kenter(va, (vm_paddr_t)va); #else (void)len; #endif @@ -291,12 +292,13 @@ map_ucode(vm_paddr_t free, size_t len) } static void -unmap_ucode(vm_paddr_t free, size_t len) +unmap_ucode(uintptr_t free, size_t len) { - #ifdef __i386__ - for (vm_paddr_t pa = free; pa < free + len; pa += PAGE_SIZE) - pmap_kremove((vm_offset_t)pa); + uintptr_t va; + + for (va = free; va < free + len; va += PAGE_SIZE) + pmap_kremove(va); #else (void)free; (void)len; From owner-svn-src-stable@freebsd.org Tue Dec 18 20:13:46 2018 Return-Path: Delivered-To: svn-src-stable@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 2D38F133DD6B; Tue, 18 Dec 2018 20:13: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 C725F85FA0; Tue, 18 Dec 2018 20:13: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 9ED3D3FDD; Tue, 18 Dec 2018 20:13: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 wBIKDjkH034913; Tue, 18 Dec 2018 20:13:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIKDjL6034912; Tue, 18 Dec 2018 20:13:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812182013.wBIKDjL6034912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 20:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342200 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C725F85FA0 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.97)[-0.974,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 20:13:46 -0000 Author: markj Date: Tue Dec 18 20:13:45 2018 New Revision: 342200 URL: https://svnweb.freebsd.org/changeset/base/342200 Log: MFC r341807: Use inline tests for individual PTE bits in the RISC-V pmap. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Dec 18 20:12:43 2018 (r342199) +++ stable/12/sys/riscv/riscv/pmap.c Tue Dec 18 20:13:45 2018 (r342200) @@ -356,36 +356,6 @@ pmap_l3(pmap_t pmap, vm_offset_t va) return (pmap_l2_to_l3(l2, va)); } - -static __inline int -pmap_is_write(pt_entry_t entry) -{ - - return (entry & PTE_W); -} - -static __inline int -pmap_l3_valid(pt_entry_t l3) -{ - - return (l3 & PTE_V); -} - -static inline int -pmap_page_accessed(pt_entry_t pte) -{ - - return (pte & PTE_A); -} - -/* Checks if the page is dirty. */ -static inline int -pmap_page_dirty(pt_entry_t pte) -{ - - return (pte & PTE_D); -} - static __inline void pmap_resident_count_inc(pmap_t pmap, int count) { @@ -898,7 +868,7 @@ pmap_extract_and_hold(pmap_t pmap, vm_offset_t va, vm_ retry: l3p = pmap_l3(pmap, va); if (l3p != NULL && (l3 = pmap_load(l3p)) != 0) { - if ((pmap_is_write(l3)) || ((prot & VM_PROT_WRITE) == 0)) { + if ((l3 & PTE_W) != 0 || (prot & VM_PROT_WRITE) == 0) { phys = PTE_TO_PHYS(l3); if (vm_page_pa_tryrelock(pmap, phys, &pa)) goto retry; @@ -1777,7 +1747,7 @@ pmap_remove_l3(pmap_t pmap, pt_entry_t *l3, vm_offset_ if (old_l3 & PTE_SW_MANAGED) { phys = PTE_TO_PHYS(old_l3); m = PHYS_TO_VM_PAGE(phys); - if (pmap_page_dirty(old_l3)) + if ((old_l3 & PTE_D) != 0) vm_page_dirty(m); if (old_l3 & PTE_A) vm_page_aflag_set(m, PGA_REFERENCED); @@ -1935,7 +1905,7 @@ pmap_remove_all(vm_page_t m) /* * Update the vm_page_t clean and reference bits. */ - if (pmap_page_dirty(tl3)) + if ((tl3 & PTE_D) != 0) vm_page_dirty(m); pmap_unuse_l3(pmap, pv->pv_va, pmap_load(l2), &free); TAILQ_REMOVE(&m->md.pv_list, pv, pv_next); @@ -1997,9 +1967,9 @@ pmap_protect(pmap_t pmap, vm_offset_t sva, vm_offset_t for (l3p = pmap_l2_to_l3(l2, sva); sva != va_next; l3p++, sva += L3_SIZE) { l3 = pmap_load(l3p); - if (pmap_l3_valid(l3)) { + if ((l3 & PTE_V) != 0) { entry = pmap_load(l3p); - entry &= ~(PTE_W); + entry &= ~PTE_W; pmap_load_store(l3p, entry); /* XXX: Use pmap_invalidate_range */ pmap_invalidate_page(pmap, sva); @@ -2163,7 +2133,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v /* * Is the specified virtual address already mapped? */ - if (pmap_l3_valid(orig_l3)) { + if ((orig_l3 & PTE_V) != 0) { /* * Wiring change, just update stats. We don't worry about * wiring PT pages as they remain resident as long as there @@ -2194,10 +2164,9 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v /* * No, might be a protection or wiring change. */ - if ((orig_l3 & PTE_SW_MANAGED) != 0) { - if (pmap_is_write(new_l3)) - vm_page_aflag_set(m, PGA_WRITEABLE); - } + if ((orig_l3 & PTE_SW_MANAGED) != 0 && + (new_l3 & PTE_W) != 0) + vm_page_aflag_set(m, PGA_WRITEABLE); goto validate; } @@ -2222,7 +2191,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v * concurrent calls to pmap_page_test_mappings() and * pmap_ts_referenced(). */ - if (pmap_page_dirty(orig_l3)) + if ((orig_l3 & PTE_D) != 0) vm_page_dirty(om); if ((orig_l3 & PTE_A) != 0) vm_page_aflag_set(om, PGA_REFERENCED); @@ -2255,7 +2224,7 @@ pmap_enter(pmap_t pmap, vm_offset_t va, vm_page_t m, v CHANGE_PV_LIST_LOCK_TO_PHYS(&lock, pa); TAILQ_INSERT_TAIL(&m->md.pv_list, pv, pv_next); m->md.pv_gen++; - if (pmap_is_write(new_l3)) + if ((new_l3 & PTE_W) != 0) vm_page_aflag_set(m, PGA_WRITEABLE); } @@ -2275,8 +2244,8 @@ validate: pmap_invalidate_page(pmap, va); KASSERT(PTE_TO_PHYS(orig_l3) == pa, ("pmap_enter: invalid update")); - if (pmap_page_dirty(orig_l3) && - (orig_l3 & PTE_SW_MANAGED) != 0) + if ((orig_l3 & (PTE_D | PTE_SW_MANAGED)) == + (PTE_D | PTE_SW_MANAGED)) vm_page_dirty(m); } else { pmap_load_store(l3, new_l3); @@ -2815,7 +2784,7 @@ pmap_remove_pages(pmap_t pmap) /* * Update the vm_page_t clean/reference bits. */ - if (pmap_page_dirty(tl3)) + if ((tl3 & PTE_D) != 0) vm_page_dirty(m); CHANGE_PV_LIST_LOCK_TO_VM_PAGE(&lock, m); @@ -3019,11 +2988,11 @@ retry_pv_loop: retry: oldl3 = pmap_load(l3); - if (pmap_is_write(oldl3)) { - newl3 = oldl3 & ~(PTE_W); + if ((oldl3 & PTE_W) != 0) { + newl3 = oldl3 & ~PTE_W; if (!atomic_cmpset_long(l3, oldl3, newl3)) goto retry; - /* TODO: use pmap_page_dirty(oldl3) ? */ + /* TODO: check for PTE_D? */ if ((oldl3 & PTE_A) != 0) vm_page_dirty(m); pmap_invalidate_page(pmap, pv->pv_va); @@ -3104,7 +3073,7 @@ retry: l3 = pmap_l2_to_l3(l2, pv->pv_va); old_l3 = pmap_load(l3); - if (pmap_page_dirty(old_l3)) + if ((old_l3 & PTE_D) != 0) vm_page_dirty(m); if ((old_l3 & PTE_A) != 0) { if (safe_to_clear_referenced(pmap, old_l3)) { @@ -3246,9 +3215,9 @@ retry: val = MINCORE_INCORE; } - if (pmap_page_dirty(tpte)) + if ((tpte & PTE_D) != 0) val |= MINCORE_MODIFIED | MINCORE_MODIFIED_OTHER; - if (pmap_page_accessed(tpte)) + if ((tpte & PTE_A) != 0) val |= MINCORE_REFERENCED | MINCORE_REFERENCED_OTHER; managed = (tpte & PTE_SW_MANAGED) == PTE_SW_MANAGED; } From owner-svn-src-stable@freebsd.org Tue Dec 18 20:14:33 2018 Return-Path: Delivered-To: svn-src-stable@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 DB4B2133DE1F; Tue, 18 Dec 2018 20:14: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 7D56F86100; Tue, 18 Dec 2018 20:14: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 693653FE7; Tue, 18 Dec 2018 20:14: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 wBIKEX8S035005; Tue, 18 Dec 2018 20:14:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIKEXDw035004; Tue, 18 Dec 2018 20:14:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812182014.wBIKEXDw035004@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 20:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342201 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 342201 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7D56F86100 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 20:14:34 -0000 Author: markj Date: Tue Dec 18 20:14:33 2018 New Revision: 342201 URL: https://svnweb.freebsd.org/changeset/base/342201 Log: MFC r341808: Remove an unused malloc(9) type. Modified: stable/12/sys/riscv/riscv/pmap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/pmap.c ============================================================================== --- stable/12/sys/riscv/riscv/pmap.c Tue Dec 18 20:13:45 2018 (r342200) +++ stable/12/sys/riscv/riscv/pmap.c Tue Dec 18 20:14:33 2018 (r342201) @@ -213,8 +213,6 @@ __FBSDID("$FreeBSD$"); LIST_HEAD(pmaplist, pmap); static struct pmaplist allpmaps; -static MALLOC_DEFINE(M_VMPMAP, "pmap", "PMAP L1"); - struct pmap kernel_pmap_store; vm_offset_t virtual_avail; /* VA of first avail page (after kernel bss) */ From owner-svn-src-stable@freebsd.org Tue Dec 18 20:16:47 2018 Return-Path: Delivered-To: svn-src-stable@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 16C9B133DF28; Tue, 18 Dec 2018 20:16:47 +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 A4DBF862CA; Tue, 18 Dec 2018 20:16: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 97B853FEC; Tue, 18 Dec 2018 20:16: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 wBIKGkq5035176; Tue, 18 Dec 2018 20:16:46 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIKGk7h035175; Tue, 18 Dec 2018 20:16:46 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812182016.wBIKGk7h035175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 20:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342202 - stable/12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/share/man/man4 X-SVN-Commit-Revision: 342202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4DBF862CA 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_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.973,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 20:16:47 -0000 Author: markj Date: Tue Dec 18 20:16:46 2018 New Revision: 342202 URL: https://svnweb.freebsd.org/changeset/base/342202 Log: MFC r341594, r341601: mlx4en(4) and ixl(4) have netdump support. Modified: stable/12/share/man/man4/netdump.4 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man4/netdump.4 ============================================================================== --- stable/12/share/man/man4/netdump.4 Tue Dec 18 20:14:33 2018 (r342201) +++ stable/12/share/man/man4/netdump.4 Tue Dec 18 20:16:46 2018 (r342202) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 29, 2018 +.Dd December 5, 2018 .Dt NETDUMP 4 .Os .Sh NAME @@ -105,6 +105,8 @@ The following network drivers support netdump: .Xr em 4 , .Xr igb 4 , .Xr ix 4 , +.Xr ixl 4 , +.Xr mlx4en 4 , .Xr re 4 , .Xr vtnet 4 . .Sh SYSCTL VARIABLES From owner-svn-src-stable@freebsd.org Tue Dec 18 21:01:50 2018 Return-Path: Delivered-To: svn-src-stable@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 DD797133F39A; Tue, 18 Dec 2018 21:01:49 +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 8DEBB87F4D; Tue, 18 Dec 2018 21:01:49 +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 68784483E; Tue, 18 Dec 2018 21:01:49 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBIL1n9B056803; Tue, 18 Dec 2018 21:01:49 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIL1nLh056801; Tue, 18 Dec 2018 21:01:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812182101.wBIL1nLh056801@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 18 Dec 2018 21:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342203 - in stable/12/sys: kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: kern sys X-SVN-Commit-Revision: 342203 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8DEBB87F4D 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.97)[-0.973,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 21:01:50 -0000 Author: markj Date: Tue Dec 18 21:01:48 2018 New Revision: 342203 URL: https://svnweb.freebsd.org/changeset/base/342203 Log: MFC r340402, r340914 (by alc), r341602 (by alc), r341766 (by alc): Allow allocations across meta boundaries. Modified: stable/12/sys/kern/subr_blist.c stable/12/sys/sys/blist.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/subr_blist.c ============================================================================== --- stable/12/sys/kern/subr_blist.c Tue Dec 18 20:16:46 2018 (r342202) +++ stable/12/sys/kern/subr_blist.c Tue Dec 18 21:01:48 2018 (r342203) @@ -46,11 +46,11 @@ * upper bound on a potential allocation, but not necessarily a tight upper * bound. * - * The radix tree also implements two collapsed states for meta nodes: - * the ALL-ALLOCATED state and the ALL-FREE state. If a meta node is - * in either of these two states, all information contained underneath - * the node is considered stale. These states are used to optimize - * allocation and freeing operations. + * The bitmap field in each node directs the search for available blocks. + * For a leaf node, a bit is set if the corresponding block is free. For a + * meta node, a bit is set if the corresponding subtree contains a free + * block somewhere within it. The search at a meta node considers only + * children of that node that represent a range that includes a free block. * * The hinting greatly increases code efficiency for allocations while * the general radix structure optimizes both allocations and frees. The @@ -59,19 +59,19 @@ * * The blist code wires all necessary memory at creation time. Neither * allocations nor frees require interaction with the memory subsystem. - * The non-blocking features of the blist code are used in the swap code - * (vm/swap_pager.c). + * The non-blocking nature of allocations and frees is required by swap + * code (vm/swap_pager.c). * - * LAYOUT: The radix tree is laid out recursively using a - * linear array. Each meta node is immediately followed (laid out - * sequentially in memory) by BLIST_META_RADIX lower level nodes. This - * is a recursive structure but one that can be easily scanned through - * a very simple 'skip' calculation. In order to support large radixes, - * portions of the tree may reside outside our memory allocation. We - * handle this with an early-termination optimization (when bighint is - * set to -1) on the scan. The memory allocation is only large enough - * to cover the number of blocks requested at creation time even if it - * must be encompassed in larger root-node radix. + * LAYOUT: The radix tree is laid out recursively using a linear array. + * Each meta node is immediately followed (laid out sequentially in + * memory) by BLIST_META_RADIX lower level nodes. This is a recursive + * structure but one that can be easily scanned through a very simple + * 'skip' calculation. The memory allocation is only large enough to + * cover the number of blocks requested at creation time. Nodes that + * represent blocks beyond that limit, nodes that would never be read + * or written, are not allocated, so that the last of the + * BLIST_META_RADIX lower level nodes of a some nodes may not be + * allocated. * * NOTE: the allocator cannot currently allocate more than * BLIST_BMAP_RADIX blocks per call. It will panic with 'allocation too @@ -105,6 +105,7 @@ __FBSDID("$FreeBSD$"); #define BLIST_DEBUG #endif +#include #include #include #include @@ -118,7 +119,7 @@ __FBSDID("$FreeBSD$"); #define bitcount64(x) __bitcount64((uint64_t)(x)) #define malloc(a,b,c) calloc(a, 1) #define free(a,b) free(a) -static __inline int imax(int a, int b) { return (a > b ? a : b); } +#define ummin(a,b) ((a) < (b) ? (a) : (b)) #include @@ -179,6 +180,18 @@ radix_to_skip(daddr_t radix) } /* + * Provide a mask with count bits set, starting as position n. + */ +static inline u_daddr_t +bitrange(int n, int count) +{ + + return (((u_daddr_t)-1 << n) & + ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - (n + count)))); +} + + +/* * Use binary search, or a faster method, to find the 1 bit in a u_daddr_t. * Assumes that the argument has only one bit set. */ @@ -220,9 +233,7 @@ blist_t blist_create(daddr_t blocks, int flags) { blist_t bl; - daddr_t i, last_block; - u_daddr_t nodes, radix, skip; - int digit; + u_daddr_t nodes, radix; if (blocks == 0) panic("invalid block count"); @@ -230,30 +241,13 @@ blist_create(daddr_t blocks, int flags) /* * Calculate the radix and node count used for scanning. */ - last_block = blocks - 1; + nodes = 1; radix = BLIST_BMAP_RADIX; - while (radix < blocks) { - if (((last_block / radix + 1) & BLIST_META_MASK) != 0) - /* - * We must widen the blist to avoid partially - * filled nodes. - */ - last_block |= radix - 1; + while (radix <= blocks) { + nodes += 1 + (blocks - 1) / radix; radix *= BLIST_META_RADIX; } - /* - * Count the meta-nodes in the expanded tree, including the final - * terminator, from the bottom level up to the root. - */ - nodes = 1; - if (radix - blocks >= BLIST_BMAP_RADIX) - nodes++; - last_block /= BLIST_BMAP_RADIX; - while (last_block > 0) { - nodes += last_block + 1; - last_block /= BLIST_META_RADIX; - } bl = malloc(offsetof(struct blist, bl_root[nodes]), M_SWAP, flags | M_ZERO); if (bl == NULL) @@ -261,34 +255,7 @@ blist_create(daddr_t blocks, int flags) bl->bl_blocks = blocks; bl->bl_radix = radix; - bl->bl_cursor = 0; - /* - * Initialize the empty tree by filling in root values, then initialize - * just the terminators in the rest of the tree. - */ - bl->bl_root[0].bm_bighint = 0; - if (radix == BLIST_BMAP_RADIX) - bl->bl_root[0].u.bmu_bitmap = 0; - else - bl->bl_root[0].u.bmu_avail = 0; - last_block = blocks - 1; - i = 0; - while (radix > BLIST_BMAP_RADIX) { - radix /= BLIST_META_RADIX; - skip = radix_to_skip(radix); - digit = last_block / radix; - i += 1 + digit * skip; - if (digit != BLIST_META_MASK) { - /* - * Add a terminator. - */ - bl->bl_root[i + skip].bm_bighint = (daddr_t)-1; - bl->bl_root[i + skip].u.bmu_bitmap = 0; - } - last_block %= radix; - } - #if defined(BLIST_DEBUG) printf( "BLIST representing %lld blocks (%lld MB of swap)" @@ -321,24 +288,28 @@ blist_alloc(blist_t bl, daddr_t count) { daddr_t blk; + if (count > BLIST_MAX_ALLOC) + panic("allocation too large"); + /* * This loop iterates at most twice. An allocation failure in the * first iteration leads to a second iteration only if the cursor was * non-zero. When the cursor is zero, an allocation failure will - * reduce the hint, stopping further iterations. + * stop further iterations. */ - while (count <= bl->bl_root->bm_bighint) { + for (;;) { blk = blst_meta_alloc(bl->bl_root, bl->bl_cursor, count, bl->bl_radix); if (blk != SWAPBLK_NONE) { + bl->bl_avail -= count; bl->bl_cursor = blk + count; if (bl->bl_cursor == bl->bl_blocks) bl->bl_cursor = 0; return (blk); - } else if (bl->bl_cursor != 0) - bl->bl_cursor = 0; + } else if (bl->bl_cursor == 0) + return (SWAPBLK_NONE); + bl->bl_cursor = 0; } - return (SWAPBLK_NONE); } /* @@ -348,10 +319,7 @@ daddr_t blist_avail(blist_t bl) { - if (bl->bl_radix == BLIST_BMAP_RADIX) - return (bitcount64(bl->bl_root->u.bmu_bitmap)); - else - return (bl->bl_root->u.bmu_avail); + return (bl->bl_avail); } /* @@ -363,7 +331,10 @@ void blist_free(blist_t bl, daddr_t blkno, daddr_t count) { + if (blkno < 0 || blkno + count > bl->bl_blocks) + panic("freeing invalid range"); blst_meta_free(bl->bl_root, blkno, count, bl->bl_radix); + bl->bl_avail += count; } /* @@ -375,8 +346,13 @@ blist_free(blist_t bl, daddr_t blkno, daddr_t count) daddr_t blist_fill(blist_t bl, daddr_t blkno, daddr_t count) { + daddr_t filled; - return (blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix)); + if (blkno < 0 || blkno + count > bl->bl_blocks) + panic("filling invalid range"); + filled = blst_meta_fill(bl->bl_root, blkno, count, bl->bl_radix); + bl->bl_avail -= filled; + return (filled); } /* @@ -414,8 +390,11 @@ blist_resize(blist_t *pbl, daddr_t count, int freenew, void blist_print(blist_t bl) { - printf("BLIST cursor = %08jx {\n", (uintmax_t)bl->bl_cursor); - blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); + printf("BLIST avail = %jd, cursor = %08jx {\n", + (uintmax_t)bl->bl_avail, (uintmax_t)bl->bl_cursor); + + if (bl->bl_root->bm_bitmap != 0) + blst_radix_print(bl->bl_root, 0, bl->bl_radix, 4); printf("}\n"); } @@ -569,16 +548,11 @@ blist_stats(blist_t bl, struct sbuf *s) * Check for skippable subtrees starting at i. */ while (radix > BLIST_BMAP_RADIX) { - if (bl->bl_root[nodes].u.bmu_avail == 0) { + if (bl->bl_root[nodes].bm_bitmap == 0) { if (gap_stats_counting(stats)) update_gap_stats(stats, i); break; } - if (bl->bl_root[nodes].u.bmu_avail == radix) { - if (!gap_stats_counting(stats)) - update_gap_stats(stats, i); - break; - } /* * Skip subtree root. @@ -590,7 +564,7 @@ blist_stats(blist_t bl, struct sbuf *s) /* * Scan leaf. */ - mask = bl->bl_root[nodes].u.bmu_bitmap; + mask = bl->bl_root[nodes].bm_bitmap; diff = mask ^ (mask << 1); if (gap_stats_counting(stats)) diff ^= 1; @@ -618,33 +592,83 @@ blist_stats(blist_t bl, struct sbuf *s) */ /* - * blist_leaf_alloc() - allocate at a leaf in the radix tree (a bitmap). + * BLST_NEXT_LEAF_ALLOC() - allocate the first few blocks in the next leaf. * - * This is the core of the allocator and is optimized for the - * BLIST_BMAP_RADIX block allocation case. Otherwise, execution - * time is proportional to log2(count) + bitpos time. + * 'scan' is a leaf node, associated with a block containing 'blk'. + * The next leaf node could be adjacent, or several nodes away if the + * least common ancestor of 'scan' and its neighbor is several levels + * up. Use 'blk' to determine how many meta-nodes lie between the + * leaves. If the next leaf has enough initial bits set, clear them + * and clear the bits in the meta nodes on the path up to the least + * common ancestor to mark any subtrees made completely empty. */ +static int +blst_next_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) +{ + blmeta_t *next; + daddr_t skip; + u_daddr_t radix; + int digit; + + next = scan + 1; + blk += BLIST_BMAP_RADIX; + radix = BLIST_BMAP_RADIX; + while ((digit = ((blk / radix) & BLIST_META_MASK)) == 0 && + (next->bm_bitmap & 1) == 1) { + next++; + radix *= BLIST_META_RADIX; + } + if (((next->bm_bitmap + 1) & ~((u_daddr_t)-1 << count)) != 0) { + /* + * The next leaf doesn't have enough free blocks at the + * beginning to complete the spanning allocation. + */ + return (ENOMEM); + } + /* Clear the first 'count' bits in the next leaf to allocate. */ + next->bm_bitmap &= (u_daddr_t)-1 << count; + + /* + * Update bitmaps of next-ancestors, up to least common ancestor. + */ + skip = radix_to_skip(radix); + while (radix != BLIST_BMAP_RADIX && next->bm_bitmap == 0) { + (--next)->bm_bitmap ^= 1; + radix /= BLIST_META_RADIX; + } + if (next->bm_bitmap == 0) + scan[-digit * skip].bm_bitmap ^= (u_daddr_t)1 << digit; + return (0); +} + +/* + * BLST_LEAF_ALLOC() - allocate at a leaf in the radix tree (a bitmap). + * + * This function is the core of the allocator. Its execution time is + * proportional to log(count), plus height of the tree if the allocation + * crosses a leaf boundary. + */ static daddr_t blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count) { - u_daddr_t mask; + u_daddr_t cursor_mask, mask; int count1, hi, lo, num_shifts, range1, range_ext; range1 = 0; count1 = count - 1; num_shifts = fls(count1); - mask = scan->u.bmu_bitmap; + mask = scan->bm_bitmap; while ((-mask & ~mask) != 0 && num_shifts > 0) { /* * If bit i is set in mask, then bits in [i, i+range1] are set - * in scan->u.bmu_bitmap. The value of range1 is equal to - * count1 >> num_shifts. Grow range and reduce num_shifts to 0, - * while preserving these invariants. The updates to mask leave - * fewer bits set, but each bit that remains set represents a - * longer string of consecutive bits set in scan->u.bmu_bitmap. - * If more updates to mask cannot clear more bits, because mask - * is partitioned with all 0 bits preceding all 1 bits, the loop - * terminates immediately. + * in scan->bm_bitmap. The value of range1 is equal to count1 + * >> num_shifts. Grow range1 and reduce num_shifts to 0, + * while preserving these invariants. The updates to mask + * leave fewer bits set, but each bit that remains set + * represents a longer string of consecutive bits set in + * scan->bm_bitmap. If more updates to mask cannot clear more + * bits, because mask is partitioned with all 0 bits preceding + * all 1 bits, the loop terminates immediately. */ num_shifts--; range_ext = range1 + ((count1 >> num_shifts) & 1); @@ -667,10 +691,23 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count } /* Discard any candidates that appear before blk. */ - mask &= (u_daddr_t)-1 << (blk & BLIST_BMAP_MASK); - if (mask == 0) - return (SWAPBLK_NONE); + if ((blk & BLIST_BMAP_MASK) != 0) { + cursor_mask = mask & bitrange(0, blk & BLIST_BMAP_MASK); + if (cursor_mask != 0) { + mask ^= cursor_mask; + if (mask == 0) + return (SWAPBLK_NONE); + /* + * Bighint change for last block allocation cannot + * assume that any other blocks are allocated, so the + * bighint cannot be reduced much. + */ + range1 = BLIST_MAX_ALLOC - 1; + } + blk &= ~BLIST_BMAP_MASK; + } + /* * The least significant set bit in mask marks the start of the first * available range of sufficient size. Clear all the bits but that one, @@ -685,31 +722,14 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count * An allocation within this leaf is impossible, so a successful * allocation depends on the next leaf providing some of the blocks. */ - if (((blk / BLIST_BMAP_RADIX + 1) & BLIST_META_MASK) == 0) { + if (blst_next_leaf_alloc(scan, blk, hi - BLIST_BMAP_RADIX) != 0) /* - * The next leaf has a different meta-node parent, so it - * is not necessarily initialized. Update bighint, - * comparing the range found at the end of mask to the - * largest earlier range that could have been made to - * vanish in the initial processing of mask. + * The hint cannot be updated, because the same + * allocation request could be satisfied later, by this + * leaf, if the state of the next leaf changes, and + * without any changes to this leaf. */ - scan->bm_bighint = imax(BLIST_BMAP_RADIX - lo, range1); return (SWAPBLK_NONE); - } - hi -= BLIST_BMAP_RADIX; - if (((scan[1].u.bmu_bitmap + 1) & ~((u_daddr_t)-1 << hi)) != 0) { - /* - * The next leaf doesn't have enough free blocks at the - * beginning to complete the spanning allocation. The - * hint cannot be updated, because the same allocation - * request could be satisfied later, by this leaf, if - * the state of the next leaf changes, and without any - * changes to this leaf. - */ - return (SWAPBLK_NONE); - } - /* Clear the first 'hi' bits in the next leaf, allocating them. */ - scan[1].u.bmu_bitmap &= (u_daddr_t)-1 << hi; hi = BLIST_BMAP_RADIX; } @@ -724,13 +744,10 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count } else { /* Clear the bits of mask at position 'hi' and higher. */ mask &= (u_daddr_t)-1 >> (BLIST_BMAP_RADIX - hi); - /* If this allocation uses all the bits, clear the hint. */ - if (mask == scan->u.bmu_bitmap) - scan->bm_bighint = 0; } /* Clear the allocated bits from this leaf. */ - scan->u.bmu_bitmap &= ~mask; - return ((blk & ~BLIST_BMAP_MASK) + lo); + scan->bm_bitmap &= ~mask; + return (blk + lo); } /* @@ -744,81 +761,63 @@ blst_leaf_alloc(blmeta_t *scan, daddr_t blk, int count static daddr_t blst_meta_alloc(blmeta_t *scan, daddr_t cursor, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, next_skip, r, skip; - int child; + daddr_t blk, i, r, skip; + u_daddr_t bit, mask; bool scan_from_start; + int digit; if (radix == BLIST_BMAP_RADIX) return (blst_leaf_alloc(scan, cursor, count)); - if (scan->u.bmu_avail < count) { - /* - * The meta node's hint must be too large if the allocation - * exceeds the number of free blocks. Reduce the hint, and - * return failure. - */ - scan->bm_bighint = scan->u.bmu_avail; - return (SWAPBLK_NONE); - } blk = cursor & -radix; + scan_from_start = (cursor == blk); + radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; + mask = scan->bm_bitmap; + /* Discard any candidates that appear before cursor. */ + digit = (cursor / radix) & BLIST_META_MASK; + mask &= (u_daddr_t)-1 << digit; + if (mask == 0) + return (SWAPBLK_NONE); + /* - * An ALL-FREE meta node requires special handling before allocating - * any of its blocks. + * If the first try is for a block that includes the cursor, pre-undo + * the digit * radix offset in the first call; otherwise, ignore the + * cursor entirely. */ - if (scan->u.bmu_avail == radix) { - radix /= BLIST_META_RADIX; + if (((mask >> digit) & 1) == 1) + cursor -= digit * radix; + else + cursor = blk; - /* - * Reinitialize each of the meta node's children. An ALL-FREE - * meta node cannot have a terminator in any subtree. - */ - for (i = 1; i < skip; i += next_skip) { - if (next_skip == 1) - scan[i].u.bmu_bitmap = (u_daddr_t)-1; - else - scan[i].u.bmu_avail = radix; - scan[i].bm_bighint = radix; - } - } else { - radix /= BLIST_META_RADIX; - } - - if (count > radix) { - /* - * The allocation exceeds the number of blocks that are - * managed by a subtree of this meta node. - */ - panic("allocation too large"); - } - scan_from_start = cursor == blk; - child = (cursor - blk) / radix; - blk += child * radix; - for (i = 1 + child * next_skip; i < skip; i += next_skip) { + /* + * Examine the nonempty subtree associated with each bit set in mask. + */ + do { + bit = mask & -mask; + digit = bitpos(bit); + i = 1 + digit * skip; if (count <= scan[i].bm_bighint) { /* * The allocation might fit beginning in the i'th subtree. */ - r = blst_meta_alloc(&scan[i], - cursor > blk ? cursor : blk, count, radix); + r = blst_meta_alloc(&scan[i], cursor + digit * radix, + count, radix); if (r != SWAPBLK_NONE) { - scan->u.bmu_avail -= count; + if (scan[i].bm_bitmap == 0) + scan->bm_bitmap ^= bit; return (r); } - } else if (scan[i].bm_bighint == (daddr_t)-1) { - /* - * Terminator - */ - break; } - blk += radix; - } + cursor = blk; + } while ((mask ^= bit) != 0); /* - * We couldn't allocate count in this subtree, update bighint. + * We couldn't allocate count in this subtree. If the whole tree was + * scanned, and the last tree node is allocated, update bighint. */ - if (scan_from_start && scan->bm_bighint >= count) + if (scan_from_start && !(digit == BLIST_META_RADIX - 1 && + scan[i].bm_bighint == BLIST_MAX_ALLOC)) scan->bm_bighint = count - 1; return (SWAPBLK_NONE); @@ -832,7 +831,6 @@ static void blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) { u_daddr_t mask; - int n; /* * free some data in this bitmap @@ -840,20 +838,10 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) * \_________/\__/ * count n */ - n = blk & BLIST_BMAP_MASK; - mask = ((u_daddr_t)-1 << n) & - ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); - if (scan->u.bmu_bitmap & mask) + mask = bitrange(blk & BLIST_BMAP_MASK, count); + if (scan->bm_bitmap & mask) panic("freeing free block"); - scan->u.bmu_bitmap |= mask; - - /* - * We could probably do a better job here. We are required to make - * bighint at least as large as the biggest contiguous block of - * data. If we just shoehorn it, a little extra overhead will - * be incured on the next allocation (but only that one typically). - */ - scan->bm_bighint = BLIST_BMAP_RADIX; + scan->bm_bitmap |= mask; } /* @@ -869,79 +857,37 @@ blst_leaf_free(blmeta_t *scan, daddr_t blk, int count) static void blst_meta_free(blmeta_t *scan, daddr_t freeBlk, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, next_skip, skip, v; - int child; + daddr_t blk, endBlk, i, skip; + int digit, endDigit; - if (scan->bm_bighint == (daddr_t)-1) - panic("freeing invalid range"); - if (radix == BLIST_BMAP_RADIX) - return (blst_leaf_free(scan, freeBlk, count)); - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; - - if (scan->u.bmu_avail == 0) { - /* - * ALL-ALLOCATED special case, with possible - * shortcut to ALL-FREE special case. - */ - scan->u.bmu_avail = count; - scan->bm_bighint = count; - - if (count != radix) { - for (i = 1; i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; - scan[i].bm_bighint = 0; - if (next_skip == 1) { - scan[i].u.bmu_bitmap = 0; - } else { - scan[i].u.bmu_avail = 0; - } - } - /* fall through */ - } - } else { - scan->u.bmu_avail += count; - /* scan->bm_bighint = radix; */ - } - /* - * ALL-FREE special case. + * We could probably do a better job here. We are required to make + * bighint at least as large as the biggest allocable block of data. + * If we just shoehorn it, a little extra overhead will be incurred + * on the next allocation (but only that one typically). */ + scan->bm_bighint = BLIST_MAX_ALLOC; - if (scan->u.bmu_avail == radix) - return; - if (scan->u.bmu_avail > radix) - panic("blst_meta_free: freeing already free blocks (%lld) %lld/%lld", - (long long)count, (long long)scan->u.bmu_avail, - (long long)radix); + if (radix == BLIST_BMAP_RADIX) + return (blst_leaf_free(scan, freeBlk, count)); - /* - * Break the free down into its components - */ - - blk = freeBlk & -radix; + endBlk = ummin(freeBlk + count, (freeBlk + radix) & -radix); radix /= BLIST_META_RADIX; - - child = (freeBlk - blk) / radix; - blk += child * radix; - i = 1 + child * next_skip; - while (i < skip && blk < freeBlk + count) { - v = blk + radix - freeBlk; - if (v > count) - v = count; - blst_meta_free(&scan[i], freeBlk, v, radix); - if (scan->bm_bighint < scan[i].bm_bighint) - scan->bm_bighint = scan[i].bm_bighint; - count -= v; - freeBlk += v; + skip = radix_to_skip(radix); + blk = freeBlk & -radix; + digit = (blk / radix) & BLIST_META_MASK; + endDigit = 1 + (((endBlk - 1) / radix) & BLIST_META_MASK); + scan->bm_bitmap |= bitrange(digit, endDigit - digit); + for (i = 1 + digit * skip; blk < endBlk; i += skip) { blk += radix; - i += next_skip; + count = ummin(blk, endBlk) - freeBlk; + blst_meta_free(&scan[i], freeBlk, count, radix); + freeBlk = blk; } } /* - * BLIST_RADIX_COPY() - copy one radix tree to another + * BLST_COPY() - copy one radix tree to another * * Locates free space in the source tree and frees it in the destination * tree. The space may not already be free in the destination. @@ -950,21 +896,21 @@ static void blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, blist_t dest, daddr_t count) { - daddr_t i, next_skip, skip; + daddr_t endBlk, i, skip; /* * Leaf node */ if (radix == BLIST_BMAP_RADIX) { - u_daddr_t v = scan->u.bmu_bitmap; + u_daddr_t v = scan->bm_bitmap; if (v == (u_daddr_t)-1) { blist_free(dest, blk, count); } else if (v != 0) { int i; - for (i = 0; i < BLIST_BMAP_RADIX && i < count; ++i) { + for (i = 0; i < count; ++i) { if (v & ((u_daddr_t)1 << i)) blist_free(dest, blk + i, 1); } @@ -976,42 +922,22 @@ blst_copy(blmeta_t *scan, daddr_t blk, daddr_t radix, * Meta node */ - if (scan->u.bmu_avail == 0) { + if (scan->bm_bitmap == 0) { /* * Source all allocated, leave dest allocated */ return; } - if (scan->u.bmu_avail == radix) { - /* - * Source all free, free entire dest - */ - if (count < radix) - blist_free(dest, blk, count); - else - blist_free(dest, blk, radix); - return; - } - - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; + endBlk = blk + count; radix /= BLIST_META_RADIX; - - for (i = 1; count && i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) - break; - - if (count >= radix) { - blst_copy(&scan[i], blk, radix, dest, radix); - count -= radix; - } else { - if (count) { - blst_copy(&scan[i], blk, radix, dest, count); - } - count = 0; - } + skip = radix_to_skip(radix); + for (i = 1; blk < endBlk; i += skip) { blk += radix; + count = radix; + if (blk >= endBlk) + count -= blk - endBlk; + blst_copy(&scan[i], blk - radix, radix, dest, count); } } @@ -1027,16 +953,13 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) { daddr_t nblks; u_daddr_t mask; - int n; - n = blk & BLIST_BMAP_MASK; - mask = ((u_daddr_t)-1 << n) & - ((u_daddr_t)-1 >> (BLIST_BMAP_RADIX - count - n)); + mask = bitrange(blk & BLIST_BMAP_MASK, count); /* Count the number of blocks that we are allocating. */ - nblks = bitcount64(scan->u.bmu_bitmap & mask); + nblks = bitcount64(scan->bm_bitmap & mask); - scan->u.bmu_bitmap &= ~mask; + scan->bm_bitmap &= ~mask; return (nblks); } @@ -1051,70 +974,27 @@ blst_leaf_fill(blmeta_t *scan, daddr_t blk, int count) static daddr_t blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr_t count, u_daddr_t radix) { - daddr_t blk, i, nblks, next_skip, skip, v; - int child; + daddr_t blk, endBlk, i, nblks, skip; + int digit; - if (scan->bm_bighint == (daddr_t)-1) - panic("filling invalid range"); - if (count > radix) { - /* - * The allocation exceeds the number of blocks that are - * managed by this node. - */ - panic("fill too large"); - } if (radix == BLIST_BMAP_RADIX) return (blst_leaf_fill(scan, allocBlk, count)); - if (count == radix || scan->u.bmu_avail == 0) { - /* - * ALL-ALLOCATED special case - */ - nblks = scan->u.bmu_avail; - scan->u.bmu_avail = 0; - scan->bm_bighint = 0; - return (nblks); - } + + endBlk = ummin(allocBlk + count, (allocBlk + radix) & -radix); + radix /= BLIST_META_RADIX; skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; blk = allocBlk & -radix; - - /* - * An ALL-FREE meta node requires special handling before allocating - * any of its blocks. - */ - if (scan->u.bmu_avail == radix) { - radix /= BLIST_META_RADIX; - - /* - * Reinitialize each of the meta node's children. An ALL-FREE - * meta node cannot have a terminator in any subtree. - */ - for (i = 1; i < skip; i += next_skip) { - if (next_skip == 1) - scan[i].u.bmu_bitmap = (u_daddr_t)-1; - else - scan[i].u.bmu_avail = radix; - scan[i].bm_bighint = radix; - } - } else { - radix /= BLIST_META_RADIX; - } - nblks = 0; - child = (allocBlk - blk) / radix; - blk += child * radix; - i = 1 + child * next_skip; - while (i < skip && blk < allocBlk + count) { - v = blk + radix - allocBlk; - if (v > count) - v = count; - nblks += blst_meta_fill(&scan[i], allocBlk, v, radix); - count -= v; - allocBlk += v; + while (blk < endBlk) { + digit = (blk / radix) & BLIST_META_MASK; + i = 1 + digit * skip; blk += radix; - i += next_skip; + count = ummin(blk, endBlk) - allocBlk; + nblks += blst_meta_fill(&scan[i], allocBlk, count, radix); + if (scan[i].bm_bitmap == 0) + scan->bm_bitmap &= ~((u_daddr_t)1 << digit); + allocBlk = blk; } - scan->u.bmu_avail -= nblks; return (nblks); } @@ -1123,64 +1003,44 @@ blst_meta_fill(blmeta_t *scan, daddr_t allocBlk, daddr static void blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t radix, int tab) { - daddr_t i, next_skip, skip; + daddr_t skip; + u_daddr_t bit, mask; + int digit; if (radix == BLIST_BMAP_RADIX) { printf( - "%*.*s(%08llx,%lld): bitmap %016llx big=%lld\n", + "%*.*s(%08llx,%lld): bitmap %0*llx big=%lld\n", tab, tab, "", (long long)blk, (long long)radix, - (long long)scan->u.bmu_bitmap, + 1 + (BLIST_BMAP_RADIX - 1) / 4, + (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); return; } - if (scan->u.bmu_avail == 0) { - printf( - "%*.*s(%08llx,%lld) ALL ALLOCATED\n", - tab, tab, "", - (long long)blk, - (long long)radix - ); - return; - } - if (scan->u.bmu_avail == radix) { - printf( - "%*.*s(%08llx,%lld) ALL FREE\n", - tab, tab, "", - (long long)blk, - (long long)radix - ); - return; - } - printf( - "%*.*s(%08llx,%lld): subtree (%lld/%lld) big=%lld {\n", + "%*.*s(%08llx): subtree (%lld/%lld) bitmap %0*llx big=%lld {\n", tab, tab, "", (long long)blk, (long long)radix, - (long long)scan->u.bmu_avail, (long long)radix, + 1 + (BLIST_META_RADIX - 1) / 4, + (long long)scan->bm_bitmap, (long long)scan->bm_bighint ); - skip = radix_to_skip(radix); - next_skip = skip / BLIST_META_RADIX; radix /= BLIST_META_RADIX; + skip = radix_to_skip(radix); tab += 4; - for (i = 1; i < skip; i += next_skip) { - if (scan[i].bm_bighint == (daddr_t)-1) { - printf( - "%*.*s(%08llx,%lld): Terminator\n", - tab, tab, "", - (long long)blk, (long long)radix - ); - break; - } - blst_radix_print(&scan[i], blk, radix, tab); - blk += radix; - } + mask = scan->bm_bitmap; + /* Examine the nonempty subtree associated with each bit set in mask */ + do { + bit = mask & -mask; + digit = bitpos(bit); + blst_radix_print(&scan[1 + digit * skip], blk + digit * radix, + radix, tab); + } while ((mask ^= bit) != 0); tab -= 4; printf( @@ -1196,7 +1056,7 @@ blst_radix_print(blmeta_t *scan, daddr_t blk, daddr_t int main(int ac, char **av) { - int size = 1024; + int size = BLIST_META_RADIX * BLIST_BMAP_RADIX; int i; blist_t bl; struct sbuf *s; Modified: stable/12/sys/sys/blist.h ============================================================================== --- stable/12/sys/sys/blist.h Tue Dec 18 20:16:46 2018 (r342202) +++ stable/12/sys/sys/blist.h Tue Dec 18 21:01:48 2018 (r342203) @@ -73,22 +73,20 @@ typedef uint64_t u_daddr_t; /* unsigned disk address * */ typedef struct blmeta { - union { - daddr_t bmu_avail; /* space available under us */ - u_daddr_t bmu_bitmap; /* bitmap if we are a leaf */ - } u; + u_daddr_t bm_bitmap; /* bitmap if we are a leaf */ daddr_t bm_bighint; /* biggest contiguous block hint*/ } blmeta_t; typedef struct blist { daddr_t bl_blocks; /* area of coverage */ + daddr_t bl_avail; /* # available blocks */ u_daddr_t bl_radix; /* coverage radix */ daddr_t bl_cursor; /* next-fit search starts at */ blmeta_t bl_root[1]; /* root of radix tree */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Tue Dec 18 22:56:25 2018 Return-Path: Delivered-To: svn-src-stable@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 AF4B61341E47; Tue, 18 Dec 2018 22:56:25 +0000 (UTC) (envelope-from mav@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 7191D8B88E; Tue, 18 Dec 2018 22:56:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E95F5AFD; Tue, 18 Dec 2018 22:56:25 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBIMuP2H018816; Tue, 18 Dec 2018 22:56:25 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBIMuPhR018815; Tue, 18 Dec 2018 22:56:25 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812182256.wBIMuPhR018815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 18 Dec 2018 22:56:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342205 - stable/12/sys/net X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/net X-SVN-Commit-Revision: 342205 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7191D8B88E 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.983,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 22:56:26 -0000 Author: mav Date: Tue Dec 18 22:56:24 2018 New Revision: 342205 URL: https://svnweb.freebsd.org/changeset/base/342205 Log: MFC r339909: Allow changing lagg(4) MTU. Previously, changing the MTU would require destroying the lagg and creating a new one. Now it is allowed to change the MTU of the lagg interface and the MTU of the ports will be set to match. If any port cannot set the new MTU, all ports are reverted to the original MTU of the lagg. Additionally, when adding ports, the MTU of a port will be automatically set to the MTU of the lagg. As always, the MTU of the lagg is initially determined by the MTU of the first port added. If adding an interface as a port for some reason fails, that interface is reverted to its original MTU. Submitted by: Ryan Moeller Relnotes: Yes Sponsored by: iXsystems Inc. Modified: stable/12/sys/net/if_lagg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/net/if_lagg.c ============================================================================== --- stable/12/sys/net/if_lagg.c Tue Dec 18 21:43:33 2018 (r342204) +++ stable/12/sys/net/if_lagg.c Tue Dec 18 22:56:24 2018 (r342205) @@ -633,11 +633,18 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * { struct lagg_softc *sc_ptr; struct lagg_port *lp, *tlp; - int error, i; + struct ifreq ifr; + int error, i, oldmtu; uint64_t *pval; LAGG_XLOCK_ASSERT(sc); + if (sc->sc_ifp == ifp) { + if_printf(sc->sc_ifp, + "cannot add a lagg to itself as a port\n"); + return (EINVAL); + } + /* Limit the maximal number of lagg ports */ if (sc->sc_count >= LAGG_MAX_PORTS) return (ENOSPC); @@ -656,12 +663,25 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * return (EPROTONOSUPPORT); /* Allow the first Ethernet member to define the MTU */ - if (CK_SLIST_EMPTY(&sc->sc_ports)) + oldmtu = -1; + if (CK_SLIST_EMPTY(&sc->sc_ports)) { sc->sc_ifp->if_mtu = ifp->if_mtu; - else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { - if_printf(sc->sc_ifp, "invalid MTU for %s\n", - ifp->if_xname); - return (EINVAL); + } else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { + if (ifp->if_ioctl == NULL) { + if_printf(sc->sc_ifp, "cannot change MTU for %s\n", + ifp->if_xname); + return (EINVAL); + } + oldmtu = ifp->if_mtu; + strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = sc->sc_ifp->if_mtu; + error = (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); + if (error != 0) { + if_printf(sc->sc_ifp, "invalid MTU for %s\n", + ifp->if_xname); + return (error); + } + ifr.ifr_mtu = oldmtu; } lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); @@ -673,6 +693,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (EINVAL); /* XXX disable stacking for the moment, its untested */ #ifdef LAGG_PORT_STACKING @@ -681,6 +704,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (E2BIG); } #endif @@ -746,6 +772,8 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if ((error = lagg_proto_addport(sc, lp)) != 0) { /* Remove the port, without calling pr_delport. */ lagg_port_destroy(lp, 0); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); return (error); } @@ -1464,8 +1492,31 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCSIFMTU: - /* Do not allow the MTU to be directly changed */ - error = EINVAL; + LAGG_XLOCK(sc); + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + error = (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + else + error = EINVAL; + if (error != 0) { + if_printf(ifp, + "failed to change MTU to %d on port %s, " + "reverting all ports to original MTU (%d)\n", + ifr->ifr_mtu, lp->lp_ifp->if_xname, ifp->if_mtu); + break; + } + } + if (error == 0) { + ifp->if_mtu = ifr->ifr_mtu; + } else { + /* set every port back to the original MTU */ + ifr->ifr_mtu = ifp->if_mtu; + CK_SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + } + } + LAGG_XUNLOCK(sc); break; default: From owner-svn-src-stable@freebsd.org Tue Dec 18 23:22:38 2018 Return-Path: Delivered-To: svn-src-stable@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 884C01342630; Tue, 18 Dec 2018 23:22:38 +0000 (UTC) (envelope-from mav@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 2DE3F8C539; Tue, 18 Dec 2018 23:22:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 20295600C; Tue, 18 Dec 2018 23:22:38 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBINMcZ0033920; Tue, 18 Dec 2018 23:22:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBINMbPn033919; Tue, 18 Dec 2018 23:22:37 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201812182322.wBINMbPn033919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 18 Dec 2018 23:22:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342206 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 342206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2DE3F8C539 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.983,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Dec 2018 23:22:38 -0000 Author: mav Date: Tue Dec 18 23:22:37 2018 New Revision: 342206 URL: https://svnweb.freebsd.org/changeset/base/342206 Log: MFC r339909: Allow changing lagg(4) MTU. Previously, changing the MTU would require destroying the lagg and creating a new one. Now it is allowed to change the MTU of the lagg interface and the MTU of the ports will be set to match. If any port cannot set the new MTU, all ports are reverted to the original MTU of the lagg. Additionally, when adding ports, the MTU of a port will be automatically set to the MTU of the lagg. As always, the MTU of the lagg is initially determined by the MTU of the first port added. If adding an interface as a port for some reason fails, that interface is reverted to its original MTU. Submitted by: Ryan Moeller Relnotes: Yes Sponsored by: iXsystems Inc. Modified: stable/11/sys/net/if_lagg.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/if_lagg.c ============================================================================== --- stable/11/sys/net/if_lagg.c Tue Dec 18 22:56:24 2018 (r342205) +++ stable/11/sys/net/if_lagg.c Tue Dec 18 23:22:37 2018 (r342206) @@ -617,11 +617,18 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * { struct lagg_softc *sc_ptr; struct lagg_port *lp, *tlp; - int error, i; + struct ifreq ifr; + int error, i, oldmtu; uint64_t *pval; LAGG_XLOCK_ASSERT(sc); + if (sc->sc_ifp == ifp) { + if_printf(sc->sc_ifp, + "cannot add a lagg to itself as a port\n"); + return (EINVAL); + } + /* Limit the maximal number of lagg ports */ if (sc->sc_count >= LAGG_MAX_PORTS) return (ENOSPC); @@ -640,12 +647,25 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * return (EPROTONOSUPPORT); /* Allow the first Ethernet member to define the MTU */ - if (SLIST_EMPTY(&sc->sc_ports)) + oldmtu = -1; + if (SLIST_EMPTY(&sc->sc_ports)) { sc->sc_ifp->if_mtu = ifp->if_mtu; - else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { - if_printf(sc->sc_ifp, "invalid MTU for %s\n", - ifp->if_xname); - return (EINVAL); + } else if (sc->sc_ifp->if_mtu != ifp->if_mtu) { + if (ifp->if_ioctl == NULL) { + if_printf(sc->sc_ifp, "cannot change MTU for %s\n", + ifp->if_xname); + return (EINVAL); + } + oldmtu = ifp->if_mtu; + strlcpy(ifr.ifr_name, ifp->if_xname, sizeof(ifr.ifr_name)); + ifr.ifr_mtu = sc->sc_ifp->if_mtu; + error = (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); + if (error != 0) { + if_printf(sc->sc_ifp, "invalid MTU for %s\n", + ifp->if_xname); + return (error); + } + ifr.ifr_mtu = oldmtu; } lp = malloc(sizeof(struct lagg_port), M_DEVBUF, M_WAITOK|M_ZERO); @@ -657,6 +677,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if (ifp == sc_ptr->sc_ifp) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (EINVAL); /* XXX disable stacking for the moment, its untested */ #ifdef LAGG_PORT_STACKING @@ -665,6 +688,9 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * LAGG_MAX_STACKING) { LAGG_LIST_UNLOCK(); free(lp, M_DEVBUF); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, + (caddr_t)&ifr); return (E2BIG); } #endif @@ -730,6 +756,8 @@ lagg_port_create(struct lagg_softc *sc, struct ifnet * if ((error = lagg_proto_addport(sc, lp)) != 0) { /* Remove the port, without calling pr_delport. */ lagg_port_destroy(lp, 0); + if (oldmtu != -1) + (*ifp->if_ioctl)(ifp, SIOCSIFMTU, (caddr_t)&ifr); LAGG_UNLOCK_ASSERT(sc); return (error); } @@ -1444,8 +1472,31 @@ lagg_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data break; case SIOCSIFMTU: - /* Do not allow the MTU to be directly changed */ - error = EINVAL; + LAGG_XLOCK(sc); + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + error = (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + else + error = EINVAL; + if (error != 0) { + if_printf(ifp, + "failed to change MTU to %d on port %s, " + "reverting all ports to original MTU (%d)\n", + ifr->ifr_mtu, lp->lp_ifp->if_xname, ifp->if_mtu); + break; + } + } + if (error == 0) { + ifp->if_mtu = ifr->ifr_mtu; + } else { + /* set every port back to the original MTU */ + ifr->ifr_mtu = ifp->if_mtu; + SLIST_FOREACH(lp, &sc->sc_ports, lp_entries) { + if (lp->lp_ioctl != NULL) + (*lp->lp_ioctl)(lp->lp_ifp, cmd, data); + } + } + LAGG_XUNLOCK(sc); break; default: From owner-svn-src-stable@freebsd.org Wed Dec 19 02:23:52 2018 Return-Path: Delivered-To: svn-src-stable@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 C77C21347C53; Wed, 19 Dec 2018 02:23:52 +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 665E29358B; Wed, 19 Dec 2018 02:23:52 +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 57CA67DBB; Wed, 19 Dec 2018 02:23:52 +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 wBJ2Nq2u026691; Wed, 19 Dec 2018 02:23:52 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ2Np5D026689; Wed, 19 Dec 2018 02:23:51 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812190223.wBJ2Np5D026689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Wed, 19 Dec 2018 02:23:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342209 - in stable/12/sys/dev: rtwn/usb usb X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/12/sys/dev: rtwn/usb usb X-SVN-Commit-Revision: 342209 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 665E29358B 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.97)[-0.974,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 02:23:53 -0000 Author: avos Date: Wed Dec 19 02:23:51 2018 New Revision: 342209 URL: https://svnweb.freebsd.org/changeset/base/342209 Log: MFC r342124: Add new USB id in rtwn_usb(4) (RTL8812AU) PR: 234029 Submitted by: Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/usb/usbdevs Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Dec 19 01:37:00 2018 (r342208) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Wed Dec 19 02:23:51 2018 (r342209) @@ -139,6 +139,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8812AU_DEV(SITECOMEU, WLA7100), RTWN_RTL8812AU_DEV(TPLINK, T4U), RTWN_RTL8812AU_DEV(TPLINK, T4UV2), + RTWN_RTL8812AU_DEV(TPLINK, T4UHV1), RTWN_RTL8812AU_DEV(TPLINK, T4UHV2), RTWN_RTL8812AU_DEV(TRENDNET, TEW805UB), RTWN_RTL8812AU_DEV(ZYXEL, NWD6605), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Wed Dec 19 01:37:00 2018 (r342208) +++ stable/12/sys/dev/usb/usbdevs Wed Dec 19 02:23:51 2018 (r342209) @@ -4610,6 +4610,7 @@ product TPLINK T4U 0x0101 Archer T4U product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK T4UV2 0x010d Archer T4U ver 2 +product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 product TPLINK RTL8153 0x0601 RTL8153 USB 10/100/1000 LAN From owner-svn-src-stable@freebsd.org Wed Dec 19 02:34:32 2018 Return-Path: Delivered-To: svn-src-stable@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 42E8F1348495; Wed, 19 Dec 2018 02:34:32 +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 DC2CF93CC0; Wed, 19 Dec 2018 02:34:31 +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 CF1877F67; Wed, 19 Dec 2018 02:34:31 +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 wBJ2YVdG031918; Wed, 19 Dec 2018 02:34:31 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ2YV0U031917; Wed, 19 Dec 2018 02:34:31 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812190234.wBJ2YV0U031917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 19 Dec 2018 02:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342210 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 342210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC2CF93CC0 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.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 02:34:32 -0000 Author: cy Date: Wed Dec 19 02:34:31 2018 New Revision: 342210 URL: https://svnweb.freebsd.org/changeset/base/342210 Log: MFC r342150: Add a missing leading / in a filename. Modified: stable/11/share/man/man4/ses.4 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/man/man4/ses.4 Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man4/ses.4 ============================================================================== --- stable/11/share/man/man4/ses.4 Wed Dec 19 02:23:51 2018 (r342209) +++ stable/11/share/man/man4/ses.4 Wed Dec 19 02:34:31 2018 (r342210) @@ -107,7 +107,7 @@ Initialize the enclosure. .El .Sh EXAMPLE USAGE The files contained in -.In usr/share/examples/ses +.In /usr/share/examples/ses show simple mechanisms for how to use these interfaces, as well as a very stupid simple monitoring daemon. .Sh FILES From owner-svn-src-stable@freebsd.org Wed Dec 19 02:34:32 2018 Return-Path: Delivered-To: svn-src-stable@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 7D0311348499; Wed, 19 Dec 2018 02:34:32 +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 1D83193CC1; Wed, 19 Dec 2018 02:34:32 +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 108317F68; Wed, 19 Dec 2018 02:34:32 +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 wBJ2YVRU031924; Wed, 19 Dec 2018 02:34:31 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ2YVrI031923; Wed, 19 Dec 2018 02:34:31 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812190234.wBJ2YVrI031923@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 19 Dec 2018 02:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342210 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 342210 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1D83193CC1 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_LONG(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.974,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 02:34:32 -0000 Author: cy Date: Wed Dec 19 02:34:31 2018 New Revision: 342210 URL: https://svnweb.freebsd.org/changeset/base/342210 Log: MFC r342150: Add a missing leading / in a filename. Modified: stable/12/share/man/man4/ses.4 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/ses.4 Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man4/ses.4 ============================================================================== --- stable/12/share/man/man4/ses.4 Wed Dec 19 02:23:51 2018 (r342209) +++ stable/12/share/man/man4/ses.4 Wed Dec 19 02:34:31 2018 (r342210) @@ -107,7 +107,7 @@ Initialize the enclosure. .El .Sh EXAMPLE USAGE The files contained in -.In usr/share/examples/ses +.In /usr/share/examples/ses show simple mechanisms for how to use these interfaces, as well as a very stupid simple monitoring daemon. .Sh FILES From owner-svn-src-stable@freebsd.org Wed Dec 19 03:21:50 2018 Return-Path: Delivered-To: svn-src-stable@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 74D3F134982A; Wed, 19 Dec 2018 03:21:50 +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 EE56A95ABB; Wed, 19 Dec 2018 03:21: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 DFDEE8807; Wed, 19 Dec 2018 03:21: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 wBJ3LnFi057532; Wed, 19 Dec 2018 03:21:49 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ3LndQ057531; Wed, 19 Dec 2018 03:21:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812190321.wBJ3LndQ057531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Dec 2018 03:21:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342212 - stable/12/share/man/man9 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/share/man/man9 X-SVN-Commit-Revision: 342212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EE56A95ABB 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 03:21:50 -0000 Author: kib Date: Wed Dec 19 03:21:49 2018 New Revision: 342212 URL: https://svnweb.freebsd.org/changeset/base/342212 Log: MFC r342144: Document new required MI behaviour of pmap_enter(9) for CoW. Modified: stable/12/share/man/man9/pmap_enter.9 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man9/pmap_enter.9 ============================================================================== --- stable/12/share/man/man9/pmap_enter.9 Wed Dec 19 03:08:10 2018 (r342211) +++ stable/12/share/man/man9/pmap_enter.9 Wed Dec 19 03:21:49 2018 (r342212) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2018 +.Dd December 16, 2018 .Dt PMAP_ENTER 9 .Os .Sh NAME @@ -119,6 +119,14 @@ It is advised to clear for destroyed mappings if the implementation can ensure that no other writeable managed mappings for the previously mapped pages exist. +.Pp +If the request modifies an existing mapping to use a different physical +page, an implementation of +.Nm +must invalidate the previous mapping before installing the new one. +This ensures that all threads sharing the pmap keep a consistent +view of the mapping, which is necessary for the correct handling +of CoW (copy on write) faults. .Pp If the page .Fa m From owner-svn-src-stable@freebsd.org Wed Dec 19 03:23:24 2018 Return-Path: Delivered-To: svn-src-stable@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 704E213498D1; Wed, 19 Dec 2018 03:23:24 +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 1517A95C89; Wed, 19 Dec 2018 03:23:24 +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 0739F8838; Wed, 19 Dec 2018 03:23:24 +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 wBJ3NNnH058621; Wed, 19 Dec 2018 03:23:23 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ3NNRA058620; Wed, 19 Dec 2018 03:23:23 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201812190323.wBJ3NNRA058620@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 19 Dec 2018 03:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342213 - stable/11/share/man/man9 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/share/man/man9 X-SVN-Commit-Revision: 342213 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1517A95C89 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.958,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 03:23:24 -0000 Author: kib Date: Wed Dec 19 03:23:23 2018 New Revision: 342213 URL: https://svnweb.freebsd.org/changeset/base/342213 Log: MFC r342144: Document new required MI behaviour of pmap_enter(9) for CoW. Modified: stable/11/share/man/man9/pmap_enter.9 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man9/pmap_enter.9 ============================================================================== --- stable/11/share/man/man9/pmap_enter.9 Wed Dec 19 03:21:49 2018 (r342212) +++ stable/11/share/man/man9/pmap_enter.9 Wed Dec 19 03:23:23 2018 (r342213) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 16, 2018 +.Dd December 16, 2018 .Dt PMAP_ENTER 9 .Os .Sh NAME @@ -119,6 +119,14 @@ It is advised to clear for destroyed mappings if the implementation can ensure that no other writeable managed mappings for the previously mapped pages exist. +.Pp +If the request modifies an existing mapping to use a different physical +page, an implementation of +.Nm +must invalidate the previous mapping before installing the new one. +This ensures that all threads sharing the pmap keep a consistent +view of the mapping, which is necessary for the correct handling +of CoW (copy on write) faults. .Pp If the page .Fa m From owner-svn-src-stable@freebsd.org Wed Dec 19 08:49:08 2018 Return-Path: Delivered-To: svn-src-stable@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 0B66313507E4; Wed, 19 Dec 2018 08:49:08 +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 A64CE702E6; Wed, 19 Dec 2018 08:49:07 +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 9A04ABFBD; Wed, 19 Dec 2018 08:49:07 +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 wBJ8n7wj024533; Wed, 19 Dec 2018 08:49:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ8n73F024532; Wed, 19 Dec 2018 08:49:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201812190849.wBJ8n73F024532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Dec 2018 08:49:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342215 - stable/12/contrib/tcpdump X-SVN-Group: stable-12 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/12/contrib/tcpdump X-SVN-Commit-Revision: 342215 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A64CE702E6 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.99)[-0.986,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 08:49:08 -0000 Author: hselasky Date: Wed Dec 19 08:49:07 2018 New Revision: 342215 URL: https://svnweb.freebsd.org/changeset/base/342215 Log: MFC r341844: Don't register IOCTLs with capsicum when there is no valid file descriptor. This fixes tcpdump when using mlx5_X devices. Differential Revision: https://reviews.freebsd.org/D18499 Reviewed by: kib@, slavash@, oshogbo@ Sponsored by: Mellanox Technologies Modified: stable/12/contrib/tcpdump/tcpdump.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/12/contrib/tcpdump/tcpdump.c Wed Dec 19 04:54:32 2018 (r342214) +++ stable/12/contrib/tcpdump/tcpdump.c Wed Dec 19 08:49:07 2018 (r342215) @@ -1915,7 +1915,7 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); #ifdef HAVE_CAPSICUM - if (RFileName == NULL && VFileName == NULL) { + if (RFileName == NULL && VFileName == NULL && pcap_fileno(pd) != -1) { static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; /* From owner-svn-src-stable@freebsd.org Wed Dec 19 08:50:11 2018 Return-Path: Delivered-To: svn-src-stable@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 7CC4E1350865; Wed, 19 Dec 2018 08:50:11 +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 20F667045D; Wed, 19 Dec 2018 08:50:11 +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 13CA7BFC1; Wed, 19 Dec 2018 08:50:11 +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 wBJ8oA72024662; Wed, 19 Dec 2018 08:50:10 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJ8oA5B024661; Wed, 19 Dec 2018 08:50:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201812190850.wBJ8oA5B024661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 19 Dec 2018 08:50:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342216 - stable/11/contrib/tcpdump X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/contrib/tcpdump X-SVN-Commit-Revision: 342216 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20F667045D 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.99)[-0.986,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 08:50:11 -0000 Author: hselasky Date: Wed Dec 19 08:50:10 2018 New Revision: 342216 URL: https://svnweb.freebsd.org/changeset/base/342216 Log: MFC r341844: Don't register IOCTLs with capsicum when there is no valid file descriptor. This fixes tcpdump when using mlx5_X devices. Differential Revision: https://reviews.freebsd.org/D18499 Reviewed by: kib@, slavash@, oshogbo@ Sponsored by: Mellanox Technologies Modified: stable/11/contrib/tcpdump/tcpdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/tcpdump/tcpdump.c ============================================================================== --- stable/11/contrib/tcpdump/tcpdump.c Wed Dec 19 08:49:07 2018 (r342215) +++ stable/11/contrib/tcpdump/tcpdump.c Wed Dec 19 08:50:10 2018 (r342216) @@ -1915,7 +1915,7 @@ main(int argc, char **argv) if (pcap_setfilter(pd, &fcode) < 0) error("%s", pcap_geterr(pd)); #ifdef HAVE_CAPSICUM - if (RFileName == NULL && VFileName == NULL) { + if (RFileName == NULL && VFileName == NULL && pcap_fileno(pd) != -1) { static const unsigned long cmds[] = { BIOCGSTATS, BIOCROTZBUF }; /* From owner-svn-src-stable@freebsd.org Wed Dec 19 17:40:46 2018 Return-Path: Delivered-To: svn-src-stable@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 26F72133DCE4; Wed, 19 Dec 2018 17:40: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 C1AB98B225; Wed, 19 Dec 2018 17:40: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 B2D6B192B9; Wed, 19 Dec 2018 17:40: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 wBJHejZv083938; Wed, 19 Dec 2018 17:40:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHejgG083937; Wed, 19 Dec 2018 17:40:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191740.wBJHejgG083937@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:40:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342219 - stable/12/sbin/ping X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/ping X-SVN-Commit-Revision: 342219 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C1AB98B225 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 17:40:46 -0000 Author: markj Date: Wed Dec 19 17:40:45 2018 New Revision: 342219 URL: https://svnweb.freebsd.org/changeset/base/342219 Log: MFC r341837, r342192: Use Capsicum helpers in ping(8). Modified: stable/12/sbin/ping/ping.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping/ping.c ============================================================================== --- stable/12/sbin/ping/ping.c Wed Dec 19 16:45:37 2018 (r342218) +++ stable/12/sbin/ping/ping.c Wed Dec 19 17:40:45 2018 (r342219) @@ -85,6 +85,7 @@ __FBSDID("$FreeBSD$"); #include #endif /*IPSEC*/ +#include #include #include #include @@ -258,7 +259,6 @@ main(int argc, char *const *argv) policy_in = policy_out = NULL; #endif cap_rights_t rights; - bool cansandbox; /* * Do the stuff that we need root priv's for *first*, and @@ -709,27 +709,20 @@ main(int argc, char *const *argv) ip->ip_dst = to->sin_addr; } - if (options & F_NUMERIC) - cansandbox = true; - else if (capdns != NULL) - cansandbox = CASPER_SUPPORT; - else - cansandbox = false; - /* * Here we enter capability mode. Further down access to global * namespaces (e.g filesystem) is restricted (see capsicum(4)). * We must connect(2) our socket before this point. */ - if (cansandbox && cap_enter() < 0 && errno != ENOSYS) + caph_cache_catpages(); + if (caph_enter_casper() < 0) err(1, "cap_enter"); cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); - if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(srecv, &rights) < 0) err(1, "cap_rights_limit srecv"); - cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT); - if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(ssend, &rights) < 0) err(1, "cap_rights_limit ssend"); /* record route option */ @@ -814,14 +807,14 @@ main(int argc, char *const *argv) sizeof(hold)); /* CAP_SETSOCKOPT removed */ cap_rights_init(&rights, CAP_RECV, CAP_EVENT); - if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(srecv, &rights) < 0) err(1, "cap_rights_limit srecv setsockopt"); if (uid == 0) (void)setsockopt(ssend, SOL_SOCKET, SO_SNDBUF, (char *)&hold, sizeof(hold)); /* CAP_SETSOCKOPT removed */ cap_rights_init(&rights, CAP_SEND); - if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) + if (caph_rights_limit(ssend, &rights) < 0) err(1, "cap_rights_limit ssend setsockopt"); if (to->sin_family == AF_INET) { From owner-svn-src-stable@freebsd.org Wed Dec 19 17:42:40 2018 Return-Path: Delivered-To: svn-src-stable@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 79220133DF12; Wed, 19 Dec 2018 17:42:40 +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 1F4B38B61E; Wed, 19 Dec 2018 17:42:40 +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 0FFBD1944A; Wed, 19 Dec 2018 17:42: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 wBJHgdL8088806; Wed, 19 Dec 2018 17:42:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHgdTk088803; Wed, 19 Dec 2018 17:42:39 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191742.wBJHgdTk088803@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:42:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342220 - in stable/12/sys: netinet netinet6 X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: netinet netinet6 X-SVN-Commit-Revision: 342220 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1F4B38B61E X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 17:42:40 -0000 Author: markj Date: Wed Dec 19 17:42:39 2018 New Revision: 342220 URL: https://svnweb.freebsd.org/changeset/base/342220 Log: MFC r341595: Clamp the INPCB port hash tables to IPPORT_MAX + 1 chains. Modified: stable/12/sys/netinet/in_pcb.c stable/12/sys/netinet/in_pcb.h stable/12/sys/netinet6/in6_pcb.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/in_pcb.c ============================================================================== --- stable/12/sys/netinet/in_pcb.c Wed Dec 19 17:40:45 2018 (r342219) +++ stable/12/sys/netinet/in_pcb.c Wed Dec 19 17:42:39 2018 (r342220) @@ -339,8 +339,7 @@ in_pcbinslbgrouphash(struct inpcb *inp) } #endif - idx = INP_PCBLBGROUP_PORTHASH(inp->inp_lport, - pcbinfo->ipi_lbgrouphashmask); + idx = INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask); hdr = &pcbinfo->ipi_lbgrouphashbase[idx]; CK_LIST_FOREACH(grp, hdr, il_list) { if (grp->il_vflag == inp->inp_vflag && @@ -397,9 +396,7 @@ in_pcbremlbgrouphash(struct inpcb *inp) INP_HASH_WLOCK_ASSERT(pcbinfo); hdr = &pcbinfo->ipi_lbgrouphashbase[ - INP_PCBLBGROUP_PORTHASH(inp->inp_lport, - pcbinfo->ipi_lbgrouphashmask)]; - + INP_PCBPORTHASH(inp->inp_lport, pcbinfo->ipi_lbgrouphashmask)]; CK_LIST_FOREACH(grp, hdr, il_list) { for (i = 0; i < grp->il_inpcnt; ++i) { if (grp->il_inp[i] != inp) @@ -439,6 +436,8 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char char *inpcbzone_name, uma_init inpcbzone_init, u_int hashfields) { + porthash_nelements = imin(porthash_nelements, IPPORT_MAX + 1); + INP_INFO_LOCK_INIT(pcbinfo, name); INP_HASH_LOCK_INIT(pcbinfo, "pcbinfohash"); /* XXXRW: argument? */ INP_LIST_LOCK_INIT(pcbinfo, "pcbinfolist"); @@ -452,7 +451,7 @@ in_pcbinfo_init(struct inpcbinfo *pcbinfo, const char &pcbinfo->ipi_hashmask); pcbinfo->ipi_porthashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_porthashmask); - pcbinfo->ipi_lbgrouphashbase = hashinit(hash_nelements, M_PCB, + pcbinfo->ipi_lbgrouphashbase = hashinit(porthash_nelements, M_PCB, &pcbinfo->ipi_lbgrouphashmask); #ifdef PCBGROUP in_pcbgroup_init(pcbinfo, hashfields, hash_nelements); @@ -1950,8 +1949,8 @@ in_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, INP_HASH_LOCK_ASSERT(pcbinfo); - hdr = &pcbinfo->ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH(lport, - pcbinfo->ipi_lbgrouphashmask)]; + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBPORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; /* * Order of socket selection: Modified: stable/12/sys/netinet/in_pcb.h ============================================================================== --- stable/12/sys/netinet/in_pcb.h Wed Dec 19 17:40:45 2018 (r342219) +++ stable/12/sys/netinet/in_pcb.h Wed Dec 19 17:42:39 2018 (r342220) @@ -688,8 +688,6 @@ int inp_so_options(const struct inpcb *inp); (((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) & (mask)) #define INP_PCBPORTHASH(lport, mask) \ (ntohs((lport)) & (mask)) -#define INP_PCBLBGROUP_PORTHASH(lport, mask) \ - (ntohs((lport)) & (mask)) #define INP_PCBLBGROUP_PKTHASH(faddr, lport, fport) \ ((faddr) ^ ((faddr) >> 16) ^ ntohs((lport) ^ (fport))) #define INP6_PCBHASHKEY(faddr) ((faddr)->s6_addr32[3]) Modified: stable/12/sys/netinet6/in6_pcb.c ============================================================================== --- stable/12/sys/netinet6/in6_pcb.c Wed Dec 19 17:40:45 2018 (r342219) +++ stable/12/sys/netinet6/in6_pcb.c Wed Dec 19 17:42:39 2018 (r342220) @@ -880,8 +880,8 @@ in6_pcblookup_lbgroup(const struct inpcbinfo *pcbinfo, INP_HASH_LOCK_ASSERT(pcbinfo); - hdr = &pcbinfo->ipi_lbgrouphashbase[INP_PCBLBGROUP_PORTHASH( - lport, pcbinfo->ipi_lbgrouphashmask)]; + hdr = &pcbinfo->ipi_lbgrouphashbase[ + INP_PCBPORTHASH(lport, pcbinfo->ipi_lbgrouphashmask)]; /* * Order of socket selection: From owner-svn-src-stable@freebsd.org Wed Dec 19 17:48:39 2018 Return-Path: Delivered-To: svn-src-stable@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 EF372133E118; Wed, 19 Dec 2018 17:48:38 +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 9558D8B976; Wed, 19 Dec 2018 17:48:38 +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 63FD01945B; Wed, 19 Dec 2018 17:48:38 +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 wBJHmcab089172; Wed, 19 Dec 2018 17:48:38 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJHmclf089171; Wed, 19 Dec 2018 17:48:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812191748.wBJHmclf089171@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 19 Dec 2018 17:48:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342222 - stable/12/sbin/ping X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/ping X-SVN-Commit-Revision: 342222 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9558D8B976 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.92 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_SHORT(-0.93)[-0.925,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 17:48:39 -0000 Author: markj Date: Wed Dec 19 17:48:37 2018 New Revision: 342222 URL: https://svnweb.freebsd.org/changeset/base/342222 Log: Revert r342219. It depends on a Capsicum helper not present in stable/12. Modified: stable/12/sbin/ping/ping.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/ping/ping.c ============================================================================== --- stable/12/sbin/ping/ping.c Wed Dec 19 17:45:16 2018 (r342221) +++ stable/12/sbin/ping/ping.c Wed Dec 19 17:48:37 2018 (r342222) @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #endif /*IPSEC*/ -#include #include #include #include @@ -259,6 +258,7 @@ main(int argc, char *const *argv) policy_in = policy_out = NULL; #endif cap_rights_t rights; + bool cansandbox; /* * Do the stuff that we need root priv's for *first*, and @@ -709,20 +709,27 @@ main(int argc, char *const *argv) ip->ip_dst = to->sin_addr; } + if (options & F_NUMERIC) + cansandbox = true; + else if (capdns != NULL) + cansandbox = CASPER_SUPPORT; + else + cansandbox = false; + /* * Here we enter capability mode. Further down access to global * namespaces (e.g filesystem) is restricted (see capsicum(4)). * We must connect(2) our socket before this point. */ - caph_cache_catpages(); - if (caph_enter_casper() < 0) + if (cansandbox && cap_enter() < 0 && errno != ENOSYS) err(1, "cap_enter"); cap_rights_init(&rights, CAP_RECV, CAP_EVENT, CAP_SETSOCKOPT); - if (caph_rights_limit(srecv, &rights) < 0) + if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit srecv"); + cap_rights_init(&rights, CAP_SEND, CAP_SETSOCKOPT); - if (caph_rights_limit(ssend, &rights) < 0) + if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit ssend"); /* record route option */ @@ -807,14 +814,14 @@ main(int argc, char *const *argv) sizeof(hold)); /* CAP_SETSOCKOPT removed */ cap_rights_init(&rights, CAP_RECV, CAP_EVENT); - if (caph_rights_limit(srecv, &rights) < 0) + if (cap_rights_limit(srecv, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit srecv setsockopt"); if (uid == 0) (void)setsockopt(ssend, SOL_SOCKET, SO_SNDBUF, (char *)&hold, sizeof(hold)); /* CAP_SETSOCKOPT removed */ cap_rights_init(&rights, CAP_SEND); - if (caph_rights_limit(ssend, &rights) < 0) + if (cap_rights_limit(ssend, &rights) < 0 && errno != ENOSYS) err(1, "cap_rights_limit ssend setsockopt"); if (to->sin_family == AF_INET) { From owner-svn-src-stable@freebsd.org Wed Dec 19 18:18:00 2018 Return-Path: Delivered-To: svn-src-stable@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 04583133F428; Wed, 19 Dec 2018 18:18:00 +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 9F8148D340; Wed, 19 Dec 2018 18:17:59 +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 8F8061998A; Wed, 19 Dec 2018 18:17:59 +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 wBJIHxnO005280; Wed, 19 Dec 2018 18:17:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJIHxYE005279; Wed, 19 Dec 2018 18:17:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812191817.wBJIHxYE005279@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Dec 2018 18:17:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342228 - stable/12/libexec/bootpd X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/libexec/bootpd X-SVN-Commit-Revision: 342228 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9F8148D340 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.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 18:18:00 -0000 Author: emaste Date: Wed Dec 19 18:17:59 2018 New Revision: 342228 URL: https://svnweb.freebsd.org/changeset/base/342228 Log: MFC r342227: bootpd: validate hardware type Due to insufficient validation of network-provided data it may have been possible for a malicious actor to craft a bootp packet which could cause a stack buffer overflow. admbugs: 850 Reported by: Reno Robert Reviewed by: markj Approved by: so Security: FreeBSD-SA-18:15.bootpd Sponsored by: The FreeBSD Foundation Modified: stable/12/libexec/bootpd/bootpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/libexec/bootpd/bootpd.c ============================================================================== --- stable/12/libexec/bootpd/bootpd.c Wed Dec 19 18:16:29 2018 (r342227) +++ stable/12/libexec/bootpd/bootpd.c Wed Dec 19 18:17:59 2018 (r342228) @@ -636,6 +636,10 @@ handle_request() char *homedir, *bootfile; int n; + if (bp->bp_htype >= hwinfocnt) { + report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype); + return; + } bp->bp_file[sizeof(bp->bp_file)-1] = '\0'; /* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */ From owner-svn-src-stable@freebsd.org Wed Dec 19 18:19:16 2018 Return-Path: Delivered-To: svn-src-stable@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 6C430133F4D1; Wed, 19 Dec 2018 18:19:16 +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 101CC8D49B; Wed, 19 Dec 2018 18:19:16 +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 008D91998D; Wed, 19 Dec 2018 18:19:16 +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 wBJIJFlH005401; Wed, 19 Dec 2018 18:19:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJIJFWv005400; Wed, 19 Dec 2018 18:19:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201812191819.wBJIJFWv005400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 19 Dec 2018 18:19:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342229 - stable/11/libexec/bootpd X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/libexec/bootpd X-SVN-Commit-Revision: 342229 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 101CC8D49B 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.95)[-0.955,0]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 18:19:16 -0000 Author: emaste Date: Wed Dec 19 18:19:15 2018 New Revision: 342229 URL: https://svnweb.freebsd.org/changeset/base/342229 Log: MFC r342227: bootpd: validate hardware type Due to insufficient validation of network-provided data it may have been possible for a malicious actor to craft a bootp packet which could cause a stack buffer overflow. admbugs: 850 Reported by: Reno Robert Reviewed by: markj Approved by: so Security: FreeBSD-SA-18:15.bootpd Sponsored by: The FreeBSD Foundation Modified: stable/11/libexec/bootpd/bootpd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/bootpd/bootpd.c ============================================================================== --- stable/11/libexec/bootpd/bootpd.c Wed Dec 19 18:17:59 2018 (r342228) +++ stable/11/libexec/bootpd/bootpd.c Wed Dec 19 18:19:15 2018 (r342229) @@ -636,6 +636,10 @@ handle_request() char *homedir, *bootfile; int n; + if (bp->bp_htype >= hwinfocnt) { + report(LOG_NOTICE, "bad hw addr type %u", bp->bp_htype); + return; + } bp->bp_file[sizeof(bp->bp_file)-1] = '\0'; /* XXX - SLIP init: Set bp_ciaddr = recv_addr here? */ From owner-svn-src-stable@freebsd.org Wed Dec 19 21:03:19 2018 Return-Path: Delivered-To: svn-src-stable@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 1D40B13461DC; Wed, 19 Dec 2018 21:03:19 +0000 (UTC) (envelope-from mjg@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 AF6DC6E1DC; Wed, 19 Dec 2018 21:03:18 +0000 (UTC) (envelope-from mjg@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 92AC11B65C; Wed, 19 Dec 2018 21:03:18 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJL3Idj095607; Wed, 19 Dec 2018 21:03:18 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJL3IQt095604; Wed, 19 Dec 2018 21:03:18 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192103.wBJL3IQt095604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 21:03:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342238 - in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 342238 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AF6DC6E1DC 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 21:03:19 -0000 Author: mjg Date: Wed Dec 19 21:03:17 2018 New Revision: 342238 URL: https://svnweb.freebsd.org/changeset/base/342238 Log: MFC r341364 amd64: align target memmove buffer to 16 bytes before using rep movs Modified: stable/12/lib/libc/amd64/string/memmove.S stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/amd64/string/memmove.S ============================================================================== --- stable/12/lib/libc/amd64/string/memmove.S Wed Dec 19 20:29:52 2018 (r342237) +++ stable/12/lib/libc/amd64/string/memmove.S Wed Dec 19 21:03:17 2018 (r342238) @@ -130,6 +130,8 @@ __FBSDID("$FreeBSD$"); ALIGN_TEXT 1256: + testb $15,%dil + jnz 100f .if \erms == 1 rep movsb @@ -140,6 +142,34 @@ __FBSDID("$FreeBSD$"); movq %rdx,%rcx andb $7,%cl /* any bytes left? */ jne 1004b +.endif + \end + ret +100: + movq (%rsi),%r8 + movq 8(%rsi),%r9 + movq %rdi,%r10 + movq %rdi,%rcx + andq $15,%rcx + leaq -16(%rdx,%rcx),%rdx + neg %rcx + leaq 16(%rdi,%rcx),%rdi + leaq 16(%rsi,%rcx),%rsi + movq %rdx,%rcx +.if \erms == 1 + rep + movsb + movq %r8,(%r10) + movq %r9,8(%r10) +.else + shrq $3,%rcx /* copy by 64-bit words */ + rep + movsq + movq %r8,(%r10) + movq %r9,8(%r10) + movq %rdx,%rcx + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Wed Dec 19 20:29:52 2018 (r342237) +++ stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:03:17 2018 (r342238) @@ -293,6 +293,8 @@ END(memcmp) ALIGN_TEXT 1256: + testb $15,%dil + jnz 100f .if \erms == 1 rep movsb @@ -303,6 +305,34 @@ END(memcmp) movq %rdx,%rcx andb $7,%cl /* any bytes left? */ jne 1004b +.endif + \end + ret +100: + movq (%rsi),%r8 + movq 8(%rsi),%r9 + movq %rdi,%r10 + movq %rdi,%rcx + andq $15,%rcx + leaq -16(%rdx,%rcx),%rdx + neg %rcx + leaq 16(%rdi,%rcx),%rdi + leaq 16(%rsi,%rcx),%rsi + movq %rdx,%rcx +.if \erms == 1 + rep + movsb + movq %r8,(%r10) + movq %r9,8(%r10) +.else + shrq $3,%rcx /* copy by 64-bit words */ + rep + movsq + movq %r8,(%r10) + movq %r9,8(%r10) + movq %rdx,%rcx + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret From owner-svn-src-stable@freebsd.org Wed Dec 19 21:04:07 2018 Return-Path: Delivered-To: svn-src-stable@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 A57B113464F6; Wed, 19 Dec 2018 21:04:07 +0000 (UTC) (envelope-from mjg@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 4AB856E3D4; Wed, 19 Dec 2018 21:04:07 +0000 (UTC) (envelope-from mjg@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 30D881B65F; Wed, 19 Dec 2018 21:04:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJL47oj095702; Wed, 19 Dec 2018 21:04:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJL476J095701; Wed, 19 Dec 2018 21:04:07 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192104.wBJL476J095701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 21:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342239 - stable/12/sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/amd64/amd64 X-SVN-Commit-Revision: 342239 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AB856E3D4 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 21:04:07 -0000 Author: mjg Date: Wed Dec 19 21:04:06 2018 New Revision: 342239 URL: https://svnweb.freebsd.org/changeset/base/342239 Log: MFC r341719 amd64: stop re-reading curpc on subyte/suword Modified: stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:03:17 2018 (r342238) +++ stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:04:06 2018 (r342239) @@ -1148,7 +1148,6 @@ ENTRY(suword16_nosmap) movw %si,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1167,7 +1166,6 @@ ENTRY(suword16_smap) movw %si,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1185,7 +1183,6 @@ ENTRY(subyte_nosmap) movl %esi,%eax movb %al,(%rdi) xorl %eax,%eax - movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret @@ -1205,7 +1202,6 @@ ENTRY(subyte_smap) movb %al,(%rdi) clac xorl %eax,%eax - movq PCPU(CURPCB),%rcx /* restore trashed register */ movq %rax,PCB_ONFAULT(%rcx) POP_FRAME_POINTER ret From owner-svn-src-stable@freebsd.org Wed Dec 19 21:25:44 2018 Return-Path: Delivered-To: svn-src-stable@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 8B0DE1348D94; Wed, 19 Dec 2018 21:25:44 +0000 (UTC) (envelope-from mjg@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 2BF1B7004E; Wed, 19 Dec 2018 21:25:44 +0000 (UTC) (envelope-from mjg@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 1B6161B9C5; Wed, 19 Dec 2018 21:25:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJLPhAN006746; Wed, 19 Dec 2018 21:25:43 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJLPhYA006744; Wed, 19 Dec 2018 21:25:43 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192125.wBJLPhYA006744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 21:25:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342240 - in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12: lib/libc/amd64/string sys/amd64/amd64 X-SVN-Commit-Revision: 342240 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2BF1B7004E 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.95)[-0.953,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 21:25:44 -0000 Author: mjg Date: Wed Dec 19 21:25:43 2018 New Revision: 342240 URL: https://svnweb.freebsd.org/changeset/base/342240 Log: MFC r341272,r341273,r341351 amd64: tidy up copying backwards in memmove amd64: remove stale attribution for memmove work amd64: handle small memmove buffers with overlapping stores Modified: stable/12/lib/libc/amd64/string/memmove.S stable/12/sys/amd64/amd64/support.S Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/amd64/string/memmove.S ============================================================================== --- stable/12/lib/libc/amd64/string/memmove.S Wed Dec 19 21:04:06 2018 (r342239) +++ stable/12/lib/libc/amd64/string/memmove.S Wed Dec 19 21:25:43 2018 (r342240) @@ -34,8 +34,6 @@ __FBSDID("$FreeBSD$"); /* * memmove(dst, src, cnt) * rdi, rsi, rdx - * Contains parts of bcopy written by: - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ /* @@ -44,11 +42,19 @@ __FBSDID("$FreeBSD$"); * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8. - * It does not clobber rax, r10 nor r11. + * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end \begin + + /* + * For sizes 0..32 all data is read before it is written, so there + * is no correctness issue with direction of copying. + */ + cmpq $32,%rcx + jbe 101632f + .if \overlap == 1 movq %rdi,%r8 subq %rsi,%r8 @@ -56,13 +62,10 @@ __FBSDID("$FreeBSD$"); jb 2f .endif - cmpq $32,%rcx - jb 1016f - cmpq $256,%rcx ja 1256f -1032: +103200: movq (%rsi),%rdx movq %rdx,(%rdi) movq 8(%rsi),%rdx @@ -75,56 +78,62 @@ __FBSDID("$FreeBSD$"); leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b + jae 103200b cmpb $0,%cl - jne 1016f + jne 101632f \end ret ALIGN_TEXT -1016: +101632: cmpb $16,%cl - jl 1008f + jl 100816f movq (%rsi),%rdx + movq 8(%rsi),%r8 + movq -16(%rsi,%rcx),%r9 + movq -8(%rsi,%rcx),%r10 movq %rdx,(%rdi) - movq 8(%rsi),%rdx - movq %rdx,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rsi),%rsi - leaq 16(%rdi),%rdi -1008: + movq %r8,8(%rdi) + movq %r9,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq (%rsi),%rdx + movq -8(%rsi,%rcx),%r8 movq %rdx,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rsi),%rsi - leaq 8(%rdi),%rdi -1004: + movq %r8,-8(%rdi,%rcx,) + \end + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl (%rsi),%edx + movl -4(%rsi,%rcx),%r8d movl %edx,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rsi),%rsi - leaq 4(%rdi),%rdi -1002: + movl %r8d,-4(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw (%rsi),%dx + jl 100001f + movzwl (%rsi),%edx + movzwl -2(%rsi,%rcx),%r8d movw %dx,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rsi),%rsi - leaq 2(%rdi),%rdi -1001: + movw %r8w,-2(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100001: cmpb $1,%cl - jl 1000f + jl 100000f movb (%rsi),%dl movb %dl,(%rdi) -1000: +100000: \end ret @@ -140,8 +149,8 @@ __FBSDID("$FreeBSD$"); rep movsq movq %rdx,%rcx - andb $7,%cl /* any bytes left? */ - jne 1004b + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret @@ -180,24 +189,24 @@ __FBSDID("$FreeBSD$"); */ ALIGN_TEXT 2: - addq %rcx,%rdi - addq %rcx,%rsi + cmpq $256,%rcx + ja 2256f + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi + cmpq $32,%rcx jb 2016f - cmpq $256,%rcx - ja 2256f - 2032: + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) movq -16(%rsi),%rdx movq %rdx,-16(%rdi) movq -24(%rsi),%rdx movq %rdx,-24(%rdi) - movq -32(%rsi),%rdx - movq %rdx,-32(%rdi) leaq -32(%rsi),%rsi leaq -32(%rdi),%rdi subq $32,%rcx @@ -211,10 +220,10 @@ __FBSDID("$FreeBSD$"); 2016: cmpb $16,%cl jl 2008f + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) - movq -16(%rsi),%rdx - movq %rdx,-16(%rdi) subb $16,%cl jz 2000f leaq -16(%rsi),%rsi @@ -222,8 +231,8 @@ __FBSDID("$FreeBSD$"); 2008: cmpb $8,%cl jl 2004f - movq -8(%rsi),%rdx - movq %rdx,-8(%rdi) + movq (%rsi),%rdx + movq %rdx,(%rdi) subb $8,%cl jz 2000f leaq -8(%rsi),%rsi @@ -231,8 +240,8 @@ __FBSDID("$FreeBSD$"); 2004: cmpb $4,%cl jl 2002f - movl -4(%rsi),%edx - movl %edx,-4(%rdi) + movl 4(%rsi),%edx + movl %edx,4(%rdi) subb $4,%cl jz 2000f leaq -4(%rsi),%rsi @@ -240,8 +249,8 @@ __FBSDID("$FreeBSD$"); 2002: cmpb $2,%cl jl 2001f - movw -2(%rsi),%dx - movw %dx,-2(%rdi) + movw 6(%rsi),%dx + movw %dx,6(%rdi) subb $2,%cl jz 2000f leaq -2(%rsi),%rsi @@ -249,37 +258,36 @@ __FBSDID("$FreeBSD$"); 2001: cmpb $1,%cl jl 2000f - movb -1(%rsi),%dl - movb %dl,-1(%rdi) + movb 7(%rsi),%dl + movb %dl,7(%rdi) 2000: \end ret ALIGN_TEXT 2256: - decq %rdi - decq %rsi std .if \erms == 1 + leaq -1(%rdi,%rcx),%rdi + leaq -1(%rsi,%rcx),%rsi rep movsb + cld .else - andq $7,%rcx /* any fractional bytes? */ - je 3f - rep - movsb -3: - movq %rdx,%rcx /* copy remainder by 32-bit words */ + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi rep movsq -.endif cld + movq %rdx,%rcx + andb $7,%cl + jne 2004b +.endif \end ret .endif .endm + .macro MEMMOVE_BEGIN movq %rdi,%rax Modified: stable/12/sys/amd64/amd64/support.S ============================================================================== --- stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:04:06 2018 (r342239) +++ stable/12/sys/amd64/amd64/support.S Wed Dec 19 21:25:43 2018 (r342240) @@ -197,8 +197,6 @@ END(memcmp) /* * memmove(dst, src, cnt) * rdi, rsi, rdx - * Adapted from bcopy written by: - * ws@tools.de (Wolfgang Solfrank, TooLs GmbH) +49-228-985800 */ /* @@ -207,11 +205,19 @@ END(memcmp) * rsi - source * rdx - count * - * The macro possibly clobbers the above and: rcx, r8. - * It does not clobber rax, r10 nor r11. + * The macro possibly clobbers the above and: rcx, r8, r9, 10 + * It does not clobber rax nor r11. */ .macro MEMMOVE erms overlap begin end \begin + + /* + * For sizes 0..32 all data is read before it is written, so there + * is no correctness issue with direction of copying. + */ + cmpq $32,%rcx + jbe 101632f + .if \overlap == 1 movq %rdi,%r8 subq %rsi,%r8 @@ -219,13 +225,10 @@ END(memcmp) jb 2f .endif - cmpq $32,%rcx - jb 1016f - cmpq $256,%rcx ja 1256f -1032: +103200: movq (%rsi),%rdx movq %rdx,(%rdi) movq 8(%rsi),%rdx @@ -238,56 +241,62 @@ END(memcmp) leaq 32(%rdi),%rdi subq $32,%rcx cmpq $32,%rcx - jae 1032b + jae 103200b cmpb $0,%cl - jne 1016f + jne 101632f \end ret ALIGN_TEXT -1016: +101632: cmpb $16,%cl - jl 1008f + jl 100816f movq (%rsi),%rdx + movq 8(%rsi),%r8 + movq -16(%rsi,%rcx),%r9 + movq -8(%rsi,%rcx),%r10 movq %rdx,(%rdi) - movq 8(%rsi),%rdx - movq %rdx,8(%rdi) - subb $16,%cl - jz 1000f - leaq 16(%rsi),%rsi - leaq 16(%rdi),%rdi -1008: + movq %r8,8(%rdi) + movq %r9,-16(%rdi,%rcx) + movq %r10,-8(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100816: cmpb $8,%cl - jl 1004f + jl 100408f movq (%rsi),%rdx + movq -8(%rsi,%rcx),%r8 movq %rdx,(%rdi) - subb $8,%cl - jz 1000f - leaq 8(%rsi),%rsi - leaq 8(%rdi),%rdi -1004: + movq %r8,-8(%rdi,%rcx,) + \end + ret + ALIGN_TEXT +100408: cmpb $4,%cl - jl 1002f + jl 100204f movl (%rsi),%edx + movl -4(%rsi,%rcx),%r8d movl %edx,(%rdi) - subb $4,%cl - jz 1000f - leaq 4(%rsi),%rsi - leaq 4(%rdi),%rdi -1002: + movl %r8d,-4(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100204: cmpb $2,%cl - jl 1001f - movw (%rsi),%dx + jl 100001f + movzwl (%rsi),%edx + movzwl -2(%rsi,%rcx),%r8d movw %dx,(%rdi) - subb $2,%cl - jz 1000f - leaq 2(%rsi),%rsi - leaq 2(%rdi),%rdi -1001: + movw %r8w,-2(%rdi,%rcx) + \end + ret + ALIGN_TEXT +100001: cmpb $1,%cl - jl 1000f + jl 100000f movb (%rsi),%dl movb %dl,(%rdi) -1000: +100000: \end ret @@ -303,8 +312,8 @@ END(memcmp) rep movsq movq %rdx,%rcx - andb $7,%cl /* any bytes left? */ - jne 1004b + andl $7,%ecx /* any bytes left? */ + jne 100408b .endif \end ret @@ -343,24 +352,24 @@ END(memcmp) */ ALIGN_TEXT 2: - addq %rcx,%rdi - addq %rcx,%rsi + cmpq $256,%rcx + ja 2256f + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi + cmpq $32,%rcx jb 2016f - cmpq $256,%rcx - ja 2256f - 2032: + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) movq -16(%rsi),%rdx movq %rdx,-16(%rdi) movq -24(%rsi),%rdx movq %rdx,-24(%rdi) - movq -32(%rsi),%rdx - movq %rdx,-32(%rdi) leaq -32(%rsi),%rsi leaq -32(%rdi),%rdi subq $32,%rcx @@ -374,10 +383,10 @@ END(memcmp) 2016: cmpb $16,%cl jl 2008f + movq (%rsi),%rdx + movq %rdx,(%rdi) movq -8(%rsi),%rdx movq %rdx,-8(%rdi) - movq -16(%rsi),%rdx - movq %rdx,-16(%rdi) subb $16,%cl jz 2000f leaq -16(%rsi),%rsi @@ -385,8 +394,8 @@ END(memcmp) 2008: cmpb $8,%cl jl 2004f - movq -8(%rsi),%rdx - movq %rdx,-8(%rdi) + movq (%rsi),%rdx + movq %rdx,(%rdi) subb $8,%cl jz 2000f leaq -8(%rsi),%rsi @@ -394,8 +403,8 @@ END(memcmp) 2004: cmpb $4,%cl jl 2002f - movl -4(%rsi),%edx - movl %edx,-4(%rdi) + movl 4(%rsi),%edx + movl %edx,4(%rdi) subb $4,%cl jz 2000f leaq -4(%rsi),%rsi @@ -403,8 +412,8 @@ END(memcmp) 2002: cmpb $2,%cl jl 2001f - movw -2(%rsi),%dx - movw %dx,-2(%rdi) + movw 6(%rsi),%dx + movw %dx,6(%rdi) subb $2,%cl jz 2000f leaq -2(%rsi),%rsi @@ -412,33 +421,31 @@ END(memcmp) 2001: cmpb $1,%cl jl 2000f - movb -1(%rsi),%dl - movb %dl,-1(%rdi) + movb 7(%rsi),%dl + movb %dl,7(%rdi) 2000: \end ret ALIGN_TEXT 2256: - decq %rdi - decq %rsi std .if \erms == 1 + leaq -1(%rdi,%rcx),%rdi + leaq -1(%rsi,%rcx),%rsi rep movsb + cld .else - andq $7,%rcx /* any fractional bytes? */ - je 3f - rep - movsb -3: - movq %rdx,%rcx /* copy remainder by 32-bit words */ + leaq -8(%rdi,%rcx),%rdi + leaq -8(%rsi,%rcx),%rsi shrq $3,%rcx - subq $7,%rsi - subq $7,%rdi rep movsq -.endif cld + movq %rdx,%rcx + andb $7,%cl + jne 2004b +.endif \end ret .endif From owner-svn-src-stable@freebsd.org Wed Dec 19 21:28:13 2018 Return-Path: Delivered-To: svn-src-stable@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 245651348F62; Wed, 19 Dec 2018 21:28:13 +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 B190670265; Wed, 19 Dec 2018 21:28:12 +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 A459E1B9C9; Wed, 19 Dec 2018 21:28:12 +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 wBJLSCPZ006935; Wed, 19 Dec 2018 21:28:12 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJLSCc2006934; Wed, 19 Dec 2018 21:28:12 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812192128.wBJLSCc2006934@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 19 Dec 2018 21:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342241 - stable/12/sys/dev/asmc X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/asmc X-SVN-Commit-Revision: 342241 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B190670265 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.95)[-0.951,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 21:28:13 -0000 Author: dab Date: Wed Dec 19 21:28:11 2018 New Revision: 342241 URL: https://svnweb.freebsd.org/changeset/base/342241 Log: MFC r341820: asmc: Add Support for MacBookAir 7,1 and 7,2 PR: 226172 Submitted by: James Wright Reported by: James Wright Modified: stable/12/sys/dev/asmc/asmc.c stable/12/sys/dev/asmc/asmcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/asmc/asmc.c ============================================================================== --- stable/12/sys/dev/asmc/asmc.c Wed Dec 19 21:25:43 2018 (r342240) +++ stable/12/sys/dev/asmc/asmc.c Wed Dec 19 21:28:11 2018 (r342241) @@ -300,6 +300,21 @@ struct asmc_model asmc_models[] = { ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS }, + { + "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS + }, + + { + "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS + }, { NULL, NULL } }; Modified: stable/12/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/12/sys/dev/asmc/asmcvar.h Wed Dec 19 21:25:43 2018 (r342240) +++ stable/12/sys/dev/asmc/asmcvar.h Wed Dec 19 21:28:11 2018 (r342241) @@ -428,3 +428,27 @@ struct asmc_softc { "TCXC", "THSP", "Memory Bank A", "PCH Die", \ "Ta0P", "Heatpipe", "Mainboard Proximity 1", "Mainboard Proximity 2", \ "Palm Rest", "Memory Proximity" } + +#define ASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0E", "TC0F", "TC0P", \ + "TC1C", "TC2C", \ + "TCGC", "TCSA", "TCXC", \ + "THSP", "TM0P", "TPCD", \ + "TW0P" "Ta0P", "Th1H", \ + "Tm0P", "Ts0P", "Ts0S", NULL } + +#define ASMC_MBA7_TEMPNAMES { "enclosure1", "enclosure2", "enclosure3", \ + "cputemp1", "cputemp2", "cpuproximity", \ + "cpucore1", "cpucore2", \ + "pecigpu", "pecisa", "pecicpu", \ + "thunderboltproximity", "memorybank", "pchdie", \ + "wirelessproximity", "airflowproximity", "heatpipe", \ + "mainboardproximity", "palmrest", "memoryproximity" } + +#define ASMC_MBA7_TEMPDESCS { "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", \ + "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "PECI GPU", "PECI SA", "PECI CPU", \ + "Thunderbolt Proximity", "Memory Bank A", "PCH Die", \ + "Wireless Proximity", "Airflow Proxmity", "Heatpipe", \ + "Mainboard Proximity", "Palm Rest", "Memory Proximity" } From owner-svn-src-stable@freebsd.org Wed Dec 19 22:17:26 2018 Return-Path: Delivered-To: svn-src-stable@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 05AB2134AD00; Wed, 19 Dec 2018 22:17:26 +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 9FBFE72635; Wed, 19 Dec 2018 22:17:25 +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 923361C228; Wed, 19 Dec 2018 22:17:25 +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 wBJMHP7u033539; Wed, 19 Dec 2018 22:17:25 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMHPfZ033538; Wed, 19 Dec 2018 22:17:25 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812192217.wBJMHPfZ033538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 19 Dec 2018 22:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342246 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342246 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9FBFE72635 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.98)[-0.976,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:17:26 -0000 Author: dab Date: Wed Dec 19 22:17:24 2018 New Revision: 342246 URL: https://svnweb.freebsd.org/changeset/base/342246 Log: MFC r341820: asmc: Add Support for MacBookAir 7,1 and 7,2 PR: 226172 Submitted by: James Wright Reported by: James Wright Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Wed Dec 19 22:08:51 2018 (r342245) +++ stable/11/sys/dev/asmc/asmc.c Wed Dec 19 22:17:24 2018 (r342246) @@ -303,6 +303,21 @@ struct asmc_model asmc_models[] = { ASMC_MBA5_TEMPS, ASMC_MBA5_TEMPNAMES, ASMC_MBA5_TEMPDESCS }, + { + "MacBookAir7,1", "Apple SMC MacBook Air 11-inch (Early 2015)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS + }, + + { + "MacBookAir7,2", "Apple SMC MacBook Air 13-inch (Early 2015)", + ASMC_SMS_FUNCS_DISABLED, + ASMC_FAN_FUNCS2, + ASMC_LIGHT_FUNCS, + ASMC_MBA7_TEMPS, ASMC_MBA7_TEMPNAMES, ASMC_MBA7_TEMPDESCS + }, { NULL, NULL } }; Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Wed Dec 19 22:08:51 2018 (r342245) +++ stable/11/sys/dev/asmc/asmcvar.h Wed Dec 19 22:17:24 2018 (r342246) @@ -426,3 +426,27 @@ struct asmc_softc { "TCXC", "THSP", "Memory Bank A", "PCH Die", \ "Ta0P", "Heatpipe", "Mainboard Proximity 1", "Mainboard Proximity 2", \ "Palm Rest", "Memory Proximity" } + +#define ASMC_MBA7_TEMPS { "TB0T", "TB1T", "TB2T", \ + "TC0E", "TC0F", "TC0P", \ + "TC1C", "TC2C", \ + "TCGC", "TCSA", "TCXC", \ + "THSP", "TM0P", "TPCD", \ + "TW0P" "Ta0P", "Th1H", \ + "Tm0P", "Ts0P", "Ts0S", NULL } + +#define ASMC_MBA7_TEMPNAMES { "enclosure1", "enclosure2", "enclosure3", \ + "cputemp1", "cputemp2", "cpuproximity", \ + "cpucore1", "cpucore2", \ + "pecigpu", "pecisa", "pecicpu", \ + "thunderboltproximity", "memorybank", "pchdie", \ + "wirelessproximity", "airflowproximity", "heatpipe", \ + "mainboardproximity", "palmrest", "memoryproximity" } + +#define ASMC_MBA7_TEMPDESCS { "Enclosure Bottom 1", "Enclosure Bottom 2", "Enclosure Bottom 3", \ + "CPU Temp 1", "CPU Temp 2", "CPU Proximity", \ + "CPU Core 1", "CPU Core 2", \ + "PECI GPU", "PECI SA", "PECI CPU", \ + "Thunderbolt Proximity", "Memory Bank A", "PCH Die", \ + "Wireless Proximity", "Airflow Proxmity", "Heatpipe", \ + "Mainboard Proximity", "Palm Rest", "Memory Proximity" } From owner-svn-src-stable@freebsd.org Wed Dec 19 22:31:21 2018 Return-Path: Delivered-To: svn-src-stable@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 99B10134B2B3; Wed, 19 Dec 2018 22:31:21 +0000 (UTC) (envelope-from mjg@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 3B896730A3; Wed, 19 Dec 2018 22:31:21 +0000 (UTC) (envelope-from mjg@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 31E7A1C530; Wed, 19 Dec 2018 22:31:21 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMVLVt041394; Wed, 19 Dec 2018 22:31:21 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMVK3G041391; Wed, 19 Dec 2018 22:31:20 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192231.wBJMVK3G041391@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342248 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 342248 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3B896730A3 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:31:21 -0000 Author: mjg Date: Wed Dec 19 22:31:20 2018 New Revision: 342248 URL: https://svnweb.freebsd.org/changeset/base/342248 Log: MFC r340410 locks: plug warnings about unitialized variables Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/kern/kern_mutex.c stable/12/sys/kern/kern_rwlock.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mutex.c ============================================================================== --- stable/12/sys/kern/kern_mutex.c Wed Dec 19 22:30:26 2018 (r342247) +++ stable/12/sys/kern/kern_mutex.c Wed Dec 19 22:31:20 2018 (r342248) @@ -486,7 +486,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v) int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - int doing_lockprof; + int doing_lockprof = 0; #endif td = curthread; @@ -690,7 +690,7 @@ _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t int64_t spin_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - int doing_lockprof; + int doing_lockprof = 0; #endif tid = (uintptr_t)curthread; Modified: stable/12/sys/kern/kern_rwlock.c ============================================================================== --- stable/12/sys/kern/kern_rwlock.c Wed Dec 19 22:30:26 2018 (r342247) +++ stable/12/sys/kern/kern_rwlock.c Wed Dec 19 22:31:20 2018 (r342248) @@ -445,7 +445,7 @@ __rw_rlock_hard(struct rwlock *rw, struct thread *td, int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; int doing_lockprof = 0; #endif @@ -913,7 +913,7 @@ __rw_wlock_hard(volatile uintptr_t *c, uintptr_t v LOC int64_t all_time = 0; #endif #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING) - uintptr_t state; + uintptr_t state = 0; int doing_lockprof = 0; #endif int extra_work = 0; From owner-svn-src-stable@freebsd.org Wed Dec 19 22:38:08 2018 Return-Path: Delivered-To: svn-src-stable@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 B8BB9134B4FD; Wed, 19 Dec 2018 22:38:08 +0000 (UTC) (envelope-from mjg@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 5EBFF73468; Wed, 19 Dec 2018 22:38:08 +0000 (UTC) (envelope-from mjg@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 52A061C594; Wed, 19 Dec 2018 22:38:08 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMc84Q044299; Wed, 19 Dec 2018 22:38:08 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMc6fS044288; Wed, 19 Dec 2018 22:38:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192238.wBJMc6fS044288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:38:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342249 - in stable/12/sys: compat/linux kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12/sys: compat/linux kern sys X-SVN-Commit-Revision: 342249 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5EBFF73468 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:38:09 -0000 Author: mjg Date: Wed Dec 19 22:38:06 2018 New Revision: 342249 URL: https://svnweb.freebsd.org/changeset/base/342249 Log: MFC r340482,r341724 proc: always store parent pid in p_oppid Remove proctree acquire from note_procstat_proc Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/compat/linux/linux_fork.c stable/12/sys/kern/imgact_elf.c stable/12/sys/kern/kern_exit.c stable/12/sys/kern/kern_fork.c stable/12/sys/kern/kern_kthread.c stable/12/sys/kern/kern_proc.c stable/12/sys/kern/kern_prot.c stable/12/sys/kern/sys_procdesc.c stable/12/sys/kern/sys_process.c stable/12/sys/sys/proc.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linux/linux_fork.c ============================================================================== --- stable/12/sys/compat/linux/linux_fork.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/compat/linux/linux_fork.c Wed Dec 19 22:38:06 2018 (r342249) @@ -235,7 +235,7 @@ linux_clone_proc(struct thread *td, struct linux_clone if (args->flags & LINUX_CLONE_PARENT) { sx_xlock(&proctree_lock); PROC_LOCK(p2); - proc_reparent(p2, td->td_proc->p_pptr); + proc_reparent(p2, td->td_proc->p_pptr, true); PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); } Modified: stable/12/sys/kern/imgact_elf.c ============================================================================== --- stable/12/sys/kern/imgact_elf.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/imgact_elf.c Wed Dec 19 22:38:06 2018 (r342249) @@ -2117,10 +2117,8 @@ __elfN(note_procstat_proc)(void *arg, struct sbuf *sb, KASSERT(*sizep == size, ("invalid size")); structsize = sizeof(elf_kinfo_proc_t); sbuf_bcat(sb, &structsize, sizeof(structsize)); - sx_slock(&proctree_lock); PROC_LOCK(p); kern_proc_out(p, sb, ELF_KERN_PROC_MASK); - sx_sunlock(&proctree_lock); } *sizep = size; } Modified: stable/12/sys/kern/kern_exit.c ============================================================================== --- stable/12/sys/kern/kern_exit.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/kern_exit.c Wed Dec 19 22:38:06 2018 (r342249) @@ -107,14 +107,9 @@ proc_realparent(struct proc *child) struct proc *p, *parent; sx_assert(&proctree_lock, SX_LOCKED); - if ((child->p_treeflag & P_TREE_ORPHANED) == 0) { - if (child->p_oppid == 0 || - child->p_pptr->p_pid == child->p_oppid) - parent = child->p_pptr; - else - parent = initproc; - return (parent); - } + if ((child->p_treeflag & P_TREE_ORPHANED) == 0) + return (child->p_pptr->p_pid == child->p_oppid ? + child->p_pptr : initproc); for (p = child; (p->p_treeflag & P_TREE_FIRST_ORPHAN) == 0;) { /* Cannot use LIST_PREV(), since the list head is not known. */ p = __containerof(p->p_orphan.le_prev, struct proc, @@ -144,7 +139,7 @@ reaper_abandon_children(struct proc *p, bool exiting) LIST_INSERT_HEAD(&p1->p_reaplist, p2, p_reapsibling); if (exiting && p2->p_pptr == p) { PROC_LOCK(p2); - proc_reparent(p2, p1); + proc_reparent(p2, p1, true); PROC_UNLOCK(p2); } } @@ -458,7 +453,7 @@ exit1(struct thread *td, int rval, int signo) q->p_sigparent = SIGCHLD; if (!(q->p_flag & P_TRACED)) { - proc_reparent(q, q->p_reaper); + proc_reparent(q, q->p_reaper, true); if (q->p_state == PRS_ZOMBIE) { /* * Inform reaper about the reparented @@ -494,10 +489,10 @@ exit1(struct thread *td, int rval, int signo) */ t = proc_realparent(q); if (t == p) { - proc_reparent(q, q->p_reaper); + proc_reparent(q, q->p_reaper, true); } else { PROC_LOCK(t); - proc_reparent(q, t); + proc_reparent(q, t, true); PROC_UNLOCK(t); } /* @@ -589,7 +584,7 @@ exit1(struct thread *td, int rval, int signo) mtx_unlock(&p->p_pptr->p_sigacts->ps_mtx); pp = p->p_pptr; PROC_UNLOCK(pp); - proc_reparent(p, p->p_reaper); + proc_reparent(p, p->p_reaper, true); p->p_sigparent = SIGCHLD; PROC_LOCK(p->p_pptr); @@ -855,7 +850,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat * If we got the child via a ptrace 'attach', we need to give it back * to the old parent. */ - if (p->p_oppid != 0 && p->p_oppid != p->p_pptr->p_pid) { + if (p->p_oppid != p->p_pptr->p_pid) { PROC_UNLOCK(p); t = proc_realparent(p); PROC_LOCK(t); @@ -863,8 +858,7 @@ proc_reap(struct thread *td, struct proc *p, int *stat CTR2(KTR_PTRACE, "wait: traced child %d moved back to parent %d", p->p_pid, t->p_pid); - proc_reparent(p, t); - p->p_oppid = 0; + proc_reparent(p, t, false); PROC_UNLOCK(p); pksignal(t, SIGCHLD, p->p_ksi); wakeup(t); @@ -873,7 +867,6 @@ proc_reap(struct thread *td, struct proc *p, int *stat sx_xunlock(&proctree_lock); return; } - p->p_oppid = 0; PROC_UNLOCK(p); /* @@ -1333,7 +1326,7 @@ loop_locked: * Must be called with an exclusive hold of proctree lock. */ void -proc_reparent(struct proc *child, struct proc *parent) +proc_reparent(struct proc *child, struct proc *parent, bool set_oppid) { sx_assert(&proctree_lock, SX_XLOCKED); @@ -1361,4 +1354,6 @@ proc_reparent(struct proc *child, struct proc *parent) } child->p_pptr = parent; + if (set_oppid) + child->p_oppid = parent->p_pid; } Modified: stable/12/sys/kern/kern_fork.c ============================================================================== --- stable/12/sys/kern/kern_fork.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/kern_fork.c Wed Dec 19 22:38:06 2018 (r342249) @@ -644,6 +644,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct pptr = p1; } p2->p_pptr = pptr; + p2->p_oppid = pptr->p_pid; LIST_INSERT_HEAD(&pptr->p_children, p2, p_sibling); LIST_INIT(&p2->p_reaplist); LIST_INSERT_HEAD(&p2->p_reaper->p_reaplist, p2, p_reapsibling); @@ -775,7 +776,7 @@ do_fork(struct thread *td, struct fork_req *fr, struct CTR2(KTR_PTRACE, "do_fork: attaching to new child pid %d: oppid %d", p2->p_pid, p2->p_oppid); - proc_reparent(p2, p1->p_pptr); + proc_reparent(p2, p1->p_pptr, false); } PROC_UNLOCK(p2); sx_xunlock(&proctree_lock); Modified: stable/12/sys/kern/kern_kthread.c ============================================================================== --- stable/12/sys/kern/kern_kthread.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/kern_kthread.c Wed Dec 19 22:38:06 2018 (r342249) @@ -166,7 +166,7 @@ kproc_exit(int ecode) */ sx_xlock(&proctree_lock); PROC_LOCK(p); - proc_reparent(p, initproc); + proc_reparent(p, initproc, true); PROC_UNLOCK(p); sx_xunlock(&proctree_lock); Modified: stable/12/sys/kern/kern_proc.c ============================================================================== --- stable/12/sys/kern/kern_proc.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/kern_proc.c Wed Dec 19 22:38:06 2018 (r342249) @@ -909,8 +909,6 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc struct sigacts *ps; struct timeval boottime; - /* For proc_realparent. */ - sx_assert(&proctree_lock, SX_LOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); bzero(kp, sizeof(*kp)); @@ -1044,7 +1042,7 @@ fill_kinfo_proc_only(struct proc *p, struct kinfo_proc kp->ki_acflag = p->p_acflag; kp->ki_lock = p->p_lock; if (p->p_pptr) { - kp->ki_ppid = proc_realparent(p)->p_pid; + kp->ki_ppid = p->p_oppid; if (p->p_flag & P_TRACED) kp->ki_tracer = p->p_pptr->p_pid; } @@ -1465,11 +1463,9 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error) return (error); - sx_slock(&proctree_lock); error = pget((pid_t)name[0], PGET_CANSEE, &p); if (error == 0) error = sysctl_out_proc(p, req, flags); - sx_sunlock(&proctree_lock); return (error); } @@ -1497,12 +1493,6 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) error = sysctl_wire_old_buffer(req, 0); if (error != 0) return (error); - /* - * This lock is only needed to safely grab the parent of a - * traced process. Only grab it if we are producing any - * data to begin with. - */ - sx_slock(&proctree_lock); } sx_slock(&allproc_lock); for (doingzomb=0 ; doingzomb < 2 ; doingzomb++) { @@ -1610,8 +1600,6 @@ sysctl_kern_proc(SYSCTL_HANDLER_ARGS) } out: sx_sunlock(&allproc_lock); - if (req->oldptr != NULL) - sx_sunlock(&proctree_lock); return (error); } Modified: stable/12/sys/kern/kern_prot.c ============================================================================== --- stable/12/sys/kern/kern_prot.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/kern_prot.c Wed Dec 19 22:38:06 2018 (r342249) @@ -124,22 +124,8 @@ int kern_getppid(struct thread *td) { struct proc *p = td->td_proc; - struct proc *pp; - int ppid; - PROC_LOCK(p); - if (!(p->p_flag & P_TRACED)) { - ppid = p->p_pptr->p_pid; - PROC_UNLOCK(p); - } else { - PROC_UNLOCK(p); - sx_slock(&proctree_lock); - pp = proc_realparent(p); - ppid = pp->p_pid; - sx_sunlock(&proctree_lock); - } - - return (ppid); + return (p->p_oppid); } /* Modified: stable/12/sys/kern/sys_procdesc.c ============================================================================== --- stable/12/sys/kern/sys_procdesc.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/sys_procdesc.c Wed Dec 19 22:38:06 2018 (r342249) @@ -416,7 +416,7 @@ procdesc_close(struct file *fp, struct thread *td) * terminate with prejudice. */ p->p_sigparent = SIGCHLD; - proc_reparent(p, p->p_reaper); + proc_reparent(p, p->p_reaper, true); if ((pd->pd_flags & PDF_DAEMON) == 0) kern_psignal(p, SIGKILL); PROC_UNLOCK(p); Modified: stable/12/sys/kern/sys_process.c ============================================================================== --- stable/12/sys/kern/sys_process.c Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/kern/sys_process.c Wed Dec 19 22:38:06 2018 (r342249) @@ -706,7 +706,6 @@ proc_set_traced(struct proc *p, bool stop) if (stop) p->p_flag2 |= P2_PTRACE_FSTP; p->p_ptevents = PTRACE_DEFAULT; - p->p_oppid = p->p_pptr->p_pid; } int @@ -930,7 +929,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi */ proc_set_traced(p, true); if (p->p_pptr != td->td_proc) { - proc_reparent(p, td->td_proc); + proc_reparent(p, td->td_proc, false); } CTR2(KTR_PTRACE, "PT_ATTACH: pid %d, oppid %d", p->p_pid, p->p_oppid); @@ -1124,7 +1123,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi PROC_UNLOCK(p->p_pptr); pp = proc_realparent(p); - proc_reparent(p, pp); + proc_reparent(p, pp, false); if (pp == initproc) p->p_sigparent = SIGCHLD; CTR3(KTR_PTRACE, @@ -1133,7 +1132,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, voi } else CTR2(KTR_PTRACE, "PT_DETACH: pid %d, sig %d", p->p_pid, data); - p->p_oppid = 0; p->p_ptevents = 0; FOREACH_THREAD_IN_PROC(p, td3) { if ((td3->td_dbgflags & TDB_FSTP) != 0) { Modified: stable/12/sys/sys/proc.h ============================================================================== --- stable/12/sys/sys/proc.h Wed Dec 19 22:31:20 2018 (r342248) +++ stable/12/sys/sys/proc.h Wed Dec 19 22:38:06 2018 (r342249) @@ -592,10 +592,10 @@ struct proc { struct ksiginfo *p_ksi; /* Locked by parent proc lock */ sigqueue_t p_sigqueue; /* (c) Sigs not delivered to a td. */ #define p_siglist p_sigqueue.sq_signals + pid_t p_oppid; /* (c + e) Real parent pid. */ /* The following fields are all zeroed upon creation in fork. */ -#define p_startzero p_oppid - pid_t p_oppid; /* (c + e) Save ppid in ptrace. XXX */ +#define p_startzero p_vmspace struct vmspace *p_vmspace; /* (b) Address space. */ u_int p_swtick; /* (c) Tick when swapped in or out. */ u_int p_cowgen; /* (c) Generation of COW pointers. */ @@ -1049,7 +1049,7 @@ void proc_linkup0(struct proc *p, struct thread *td); void proc_linkup(struct proc *p, struct thread *td); struct proc *proc_realparent(struct proc *child); void proc_reap(struct thread *td, struct proc *p, int *status, int options); -void proc_reparent(struct proc *child, struct proc *newparent); +void proc_reparent(struct proc *child, struct proc *newparent, bool set_oppid); void proc_set_traced(struct proc *p, bool stop); void proc_wkilled(struct proc *p); struct pstats *pstats_alloc(void); From owner-svn-src-stable@freebsd.org Wed Dec 19 22:42:08 2018 Return-Path: Delivered-To: svn-src-stable@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 5A60F134B773; Wed, 19 Dec 2018 22:42:08 +0000 (UTC) (envelope-from mjg@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 ECD5B737BC; Wed, 19 Dec 2018 22:42:07 +0000 (UTC) (envelope-from mjg@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 E08A21C718; Wed, 19 Dec 2018 22:42:07 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJMg7ve048498; Wed, 19 Dec 2018 22:42:07 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMg6CE048490; Wed, 19 Dec 2018 22:42:06 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192242.wBJMg6CE048490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 22:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342250 - in stable/12/sys: fs/tmpfs kern sys X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: in stable/12/sys: fs/tmpfs kern sys X-SVN-Commit-Revision: 342250 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ECD5B737BC 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:42:08 -0000 Author: mjg Date: Wed Dec 19 22:42:06 2018 New Revision: 342250 URL: https://svnweb.freebsd.org/changeset/base/342250 Log: MFC r340676,r340677,r340679,r340747,r340749,r341682 Implement unr64 pipe: use unr64 tmpfs: use unr64 for inode numbers uipc_shm: use unr64 for inode numbers uipc_usrreq: fix inode number assignment unr64: use locked variant if not __LP64__ Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/fs/tmpfs/tmpfs.h stable/12/sys/fs/tmpfs/tmpfs_subr.c stable/12/sys/fs/tmpfs/tmpfs_vfsops.c stable/12/sys/kern/subr_unit.c stable/12/sys/kern/sys_pipe.c stable/12/sys/kern/uipc_shm.c stable/12/sys/kern/uipc_usrreq.c stable/12/sys/sys/systm.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/tmpfs/tmpfs.h ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs.h Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/fs/tmpfs/tmpfs.h Wed Dec 19 22:42:06 2018 (r342250) @@ -353,7 +353,7 @@ struct tmpfs_mount { ino_t tm_nodes_max; /* unrhdr used to allocate inode numbers */ - struct unrhdr * tm_ino_unr; + struct unrhdr64 tm_ino_unr; /* Number of nodes currently that are in use. */ ino_t tm_nodes_inuse; Modified: stable/12/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/fs/tmpfs/tmpfs_subr.c Wed Dec 19 22:42:06 2018 (r342250) @@ -230,7 +230,7 @@ tmpfs_alloc_node(struct mount *mp, struct tmpfs_mount nnode->tn_uid = uid; nnode->tn_gid = gid; nnode->tn_mode = mode; - nnode->tn_id = alloc_unr(tmp->tm_ino_unr); + nnode->tn_id = alloc_unr64(&tmp->tm_ino_unr); nnode->tn_refcount = 1; /* Type-specific initialization. */ @@ -368,13 +368,6 @@ tmpfs_free_node_locked(struct tmpfs_mount *tmp, struct panic("tmpfs_free_node: type %p %d", node, (int)node->tn_type); } - /* - * If we are unmounting there is no need for going through the overhead - * of freeing the inodes from the unr individually, so free them all in - * one go later. - */ - if (!detach) - free_unr(tmp->tm_ino_unr, node->tn_id); uma_zfree(tmp->tm_node_pool, node); TMPFS_LOCK(tmp); tmpfs_free_tmp(tmp); Modified: stable/12/sys/fs/tmpfs/tmpfs_vfsops.c ============================================================================== --- stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/fs/tmpfs/tmpfs_vfsops.c Wed Dec 19 22:42:06 2018 (r342250) @@ -231,7 +231,7 @@ tmpfs_mount(struct mount *mp) tmp->tm_pages_max = pages; tmp->tm_pages_used = 0; - tmp->tm_ino_unr = new_unrhdr(2, INT_MAX, &tmp->tm_allnode_lock); + new_unrhdr64(&tmp->tm_ino_unr, 2); tmp->tm_dirent_pool = uma_zcreate("TMPFS dirent", sizeof(struct tmpfs_dirent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -248,7 +248,6 @@ tmpfs_mount(struct mount *mp) if (error != 0 || root == NULL) { uma_zdestroy(tmp->tm_node_pool); uma_zdestroy(tmp->tm_dirent_pool); - delete_unrhdr(tmp->tm_ino_unr); free(tmp, M_TMPFSMNT); return (error); } @@ -343,8 +342,6 @@ tmpfs_free_tmp(struct tmpfs_mount *tmp) uma_zdestroy(tmp->tm_dirent_pool); uma_zdestroy(tmp->tm_node_pool); - clear_unrhdr(tmp->tm_ino_unr); - delete_unrhdr(tmp->tm_ino_unr); mtx_destroy(&tmp->tm_allnode_lock); MPASS(tmp->tm_pages_used == 0); Modified: stable/12/sys/kern/subr_unit.c ============================================================================== --- stable/12/sys/kern/subr_unit.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/kern/subr_unit.c Wed Dec 19 22:42:06 2018 (r342250) @@ -98,6 +98,19 @@ static struct mtx unitmtx; MTX_SYSINIT(unit, &unitmtx, "unit# allocation", MTX_DEF); +#ifdef UNR64_LOCKED +uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + uint64_t item; + + mtx_lock(&unitmtx); + item = unr64->counter++; + mtx_unlock(&unitmtx); + return (item); +} +#endif + #else /* ...USERLAND */ #include Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/kern/sys_pipe.c Wed Dec 19 22:42:06 2018 (r342250) @@ -244,7 +244,7 @@ static int pipe_zone_init(void *mem, int size, int fla static void pipe_zone_fini(void *mem, int size); static uma_zone_t pipe_zone; -static struct unrhdr *pipeino_unr; +static struct unrhdr64 pipeino_unr; static dev_t pipedev_ino; SYSINIT(vfs, SI_SUB_VFS, SI_ORDER_ANY, pipeinit, NULL); @@ -257,8 +257,7 @@ pipeinit(void *dummy __unused) pipe_zone_ctor, NULL, pipe_zone_init, pipe_zone_fini, UMA_ALIGN_PTR, 0); KASSERT(pipe_zone != NULL, ("pipe_zone not initialized")); - pipeino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(pipeino_unr != NULL, ("pipe fake inodes not initialized")); + new_unrhdr64(&pipeino_unr, 1); pipedev_ino = devfs_alloc_cdp_inode(); KASSERT(pipedev_ino > 0, ("pipe dev inode not initialized")); } @@ -390,8 +389,6 @@ pipe_dtor(struct pipe *dpipe) funsetown(&peer->pipe_sigio); pipeclose(peer); } - if (ino != 0 && ino != (ino_t)-1) - free_unr(pipeino_unr, ino); } /* @@ -639,7 +636,7 @@ pipe_create(struct pipe *pipe, int backing) (void)pipespace_new(pipe, PIPE_SIZE); } - pipe->pipe_ino = -1; + pipe->pipe_ino = alloc_unr64(&pipeino_unr); } /* ARGSUSED */ @@ -1461,7 +1458,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr struct thread *td) { struct pipe *pipe; - int new_unr; #ifdef MAC int error; #endif @@ -1482,23 +1478,6 @@ pipe_stat(struct file *fp, struct stat *ub, struct ucr return (vnops.fo_stat(fp, ub, active_cred, td)); } - /* - * Lazily allocate an inode number for the pipe. Most pipe - * users do not call fstat(2) on the pipe, which means that - * postponing the inode allocation until it is must be - * returned to userland is useful. If alloc_unr failed, - * assign st_ino zero instead of returning an error. - * Special pipe_ino values: - * -1 - not yet initialized; - * 0 - alloc_unr failed, return 0 as st_ino forever. - */ - if (pipe->pipe_ino == (ino_t)-1) { - new_unr = alloc_unr(pipeino_unr); - if (new_unr != -1) - pipe->pipe_ino = new_unr; - else - pipe->pipe_ino = 0; - } PIPE_UNLOCK(pipe); bzero(ub, sizeof(*ub)); Modified: stable/12/sys/kern/uipc_shm.c ============================================================================== --- stable/12/sys/kern/uipc_shm.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/kern/uipc_shm.c Wed Dec 19 22:42:06 2018 (r342250) @@ -113,7 +113,7 @@ static LIST_HEAD(, shm_mapping) *shm_dictionary; static struct sx shm_dict_lock; static struct mtx shm_timestamp_lock; static u_long shm_hash; -static struct unrhdr *shm_ino_unr; +static struct unrhdr64 shm_ino_unr; static dev_t shm_dev_ino; #define SHM_HASH(fnv) (&shm_dictionary[(fnv) & shm_hash]) @@ -531,7 +531,6 @@ struct shmfd * shm_alloc(struct ucred *ucred, mode_t mode) { struct shmfd *shmfd; - int ino; shmfd = malloc(sizeof(*shmfd), M_SHMFD, M_WAITOK | M_ZERO); shmfd->shm_size = 0; @@ -549,11 +548,7 @@ shm_alloc(struct ucred *ucred, mode_t mode) vfs_timestamp(&shmfd->shm_birthtime); shmfd->shm_atime = shmfd->shm_mtime = shmfd->shm_ctime = shmfd->shm_birthtime; - ino = alloc_unr(shm_ino_unr); - if (ino == -1) - shmfd->shm_ino = 0; - else - shmfd->shm_ino = ino; + shmfd->shm_ino = alloc_unr64(&shm_ino_unr); refcount_init(&shmfd->shm_refs, 1); mtx_init(&shmfd->shm_mtx, "shmrl", NULL, MTX_DEF); rangelock_init(&shmfd->shm_rl); @@ -584,8 +579,6 @@ shm_drop(struct shmfd *shmfd) rangelock_destroy(&shmfd->shm_rl); mtx_destroy(&shmfd->shm_mtx); vm_object_deallocate(shmfd->shm_object); - if (shmfd->shm_ino != 0) - free_unr(shm_ino_unr, shmfd->shm_ino); free(shmfd, M_SHMFD); } } @@ -624,8 +617,7 @@ shm_init(void *arg) mtx_init(&shm_timestamp_lock, "shm timestamps", NULL, MTX_DEF); sx_init(&shm_dict_lock, "shm dictionary"); shm_dictionary = hashinit(1024, M_SHMFD, &shm_hash); - shm_ino_unr = new_unrhdr(1, INT32_MAX, NULL); - KASSERT(shm_ino_unr != NULL, ("shm fake inodes not initialized")); + new_unrhdr64(&shm_ino_unr, 1); shm_dev_ino = devfs_alloc_cdp_inode(); KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized")); } Modified: stable/12/sys/kern/uipc_usrreq.c ============================================================================== --- stable/12/sys/kern/uipc_usrreq.c Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/kern/uipc_usrreq.c Wed Dec 19 22:42:06 2018 (r342250) @@ -530,6 +530,7 @@ uipc_attach(struct socket *so, int proto, struct threa UNP_LINK_WLOCK(); unp->unp_gencnt = ++unp_gencnt; + unp->unp_ino = ++unp_ino; unp_count++; switch (so->so_type) { case SOCK_STREAM: @@ -1302,12 +1303,8 @@ uipc_sense(struct socket *so, struct stat *sb) KASSERT(unp != NULL, ("uipc_sense: unp == NULL")); sb->st_blksize = so->so_snd.sb_hiwat; - UNP_PCB_LOCK(unp); sb->st_dev = NODEV; - if (unp->unp_ino == 0) - unp->unp_ino = (++unp_ino == 0) ? ++unp_ino : unp_ino; sb->st_ino = unp->unp_ino; - UNP_PCB_UNLOCK(unp); return (0); } Modified: stable/12/sys/sys/systm.h ============================================================================== --- stable/12/sys/sys/systm.h Wed Dec 19 22:38:06 2018 (r342249) +++ stable/12/sys/sys/systm.h Wed Dec 19 22:42:06 2018 (r342250) @@ -524,6 +524,32 @@ int alloc_unr_specific(struct unrhdr *uh, u_int item); int alloc_unrl(struct unrhdr *uh); void free_unr(struct unrhdr *uh, u_int item); +#ifndef __LP64__ +#define UNR64_LOCKED +#endif + +struct unrhdr64 { + uint64_t counter; +}; + +static __inline void +new_unrhdr64(struct unrhdr64 *unr64, uint64_t low) +{ + + unr64->counter = low; +} + +#ifdef UNR64_LOCKED +uint64_t alloc_unr64(struct unrhdr64 *); +#else +static __inline uint64_t +alloc_unr64(struct unrhdr64 *unr64) +{ + + return (atomic_fetchadd_64(&unr64->counter, 1)); +} +#endif + void intr_prof_stack_use(struct thread *td, struct trapframe *frame); void counted_warning(unsigned *counter, const char *msg); From owner-svn-src-stable@freebsd.org Wed Dec 19 22:46:05 2018 Return-Path: Delivered-To: svn-src-stable@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 14155134B95A; Wed, 19 Dec 2018 22:46:05 +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 AAE2C73CDC; Wed, 19 Dec 2018 22:46:04 +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 9303D1C73A; Wed, 19 Dec 2018 22:46:04 +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 wBJMk4wD049553; Wed, 19 Dec 2018 22:46:04 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMk4xA049550; Wed, 19 Dec 2018 22:46:04 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812192246.wBJMk4xA049550@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 19 Dec 2018 22:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342252 - stable/12/share/vt/keymaps X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/share/vt/keymaps X-SVN-Commit-Revision: 342252 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AAE2C73CDC 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:46:05 -0000 Author: dab Date: Wed Dec 19 22:46:03 2018 New Revision: 342252 URL: https://svnweb.freebsd.org/changeset/base/342252 Log: MFC r341806: Add uk.macbook.kbd keymap (vt) PR: 215185 Submitted by: James Wright Reported by: James Wright Added: stable/12/share/vt/keymaps/uk.macbook.kbd - copied unchanged from r341806, head/share/vt/keymaps/uk.macbook.kbd Modified: stable/12/share/vt/keymaps/INDEX.keymaps stable/12/share/vt/keymaps/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/share/vt/keymaps/INDEX.keymaps ============================================================================== --- stable/12/share/vt/keymaps/INDEX.keymaps Wed Dec 19 22:43:10 2018 (r342251) +++ stable/12/share/vt/keymaps/INDEX.keymaps Wed Dec 19 22:46:03 2018 (r342252) @@ -520,6 +520,12 @@ uk.dvorak.kbd:fr:Royaume Uni Dvorak uk.dvorak.kbd:pt:Reino Unido Dvorak uk.dvorak.kbd:es:Británico Dvorak +uk.macbook.kbd:en:United Kingdom Macbook +uk.macbook.kbd:de:Vereinigtes Königreich Macbook +uk.macbook.kbd:fr:Royaume Uni Macbook +uk.macbook.kbd:pt:Reino Unido Macbook +uk.macbook.kbd:es:Británico Macbook + us.kbd:en:United States of America us.kbd:de:US-amerikanisch us.kbd:fr:États Unis d'Amérique Modified: stable/12/share/vt/keymaps/Makefile ============================================================================== --- stable/12/share/vt/keymaps/Makefile Wed Dec 19 22:43:10 2018 (r342251) +++ stable/12/share/vt/keymaps/Makefile Wed Dec 19 22:46:03 2018 (r342252) @@ -74,6 +74,7 @@ FILES= INDEX.keymaps \ uk.capsctrl.kbd \ uk.dvorak.kbd \ uk.kbd \ + uk.macbook.kbd \ us.acc.kbd \ us.ctrl.kbd \ us.dvorak.kbd \ Copied: stable/12/share/vt/keymaps/uk.macbook.kbd (from r341806, head/share/vt/keymaps/uk.macbook.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/share/vt/keymaps/uk.macbook.kbd Wed Dec 19 22:46:03 2018 (r342252, copy of r341806, head/share/vt/keymaps/uk.macbook.kbd) @@ -0,0 +1,115 @@ +# $FreeBSD$ +# by James Wright +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul 0x20ac '@' nul nul O + 004 '3' 0xa3 nop nop '#' 0xa3 nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 0xa7 0xb1 nop nop 0xa7 0xb1 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '`' '~' nop nop '`' '~' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O From owner-svn-src-stable@freebsd.org Wed Dec 19 22:48:29 2018 Return-Path: Delivered-To: svn-src-stable@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 E8AD9134BB06; Wed, 19 Dec 2018 22:48:28 +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 8A72E74572; Wed, 19 Dec 2018 22:48:28 +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 7D01E1C744; Wed, 19 Dec 2018 22:48:28 +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 wBJMmSNo049817; Wed, 19 Dec 2018 22:48:28 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJMmRF2049814; Wed, 19 Dec 2018 22:48:27 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812192248.wBJMmRF2049814@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Wed, 19 Dec 2018 22:48:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342254 - stable/11/share/vt/keymaps X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/share/vt/keymaps X-SVN-Commit-Revision: 342254 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8A72E74572 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 22:48:29 -0000 Author: dab Date: Wed Dec 19 22:48:27 2018 New Revision: 342254 URL: https://svnweb.freebsd.org/changeset/base/342254 Log: MFC r341806: Add uk.macbook.kbd keymap (vt) PR: 215185 Submitted by: James Wright Reported by: James Wright Added: stable/11/share/vt/keymaps/uk.macbook.kbd - copied unchanged from r341806, head/share/vt/keymaps/uk.macbook.kbd Modified: stable/11/share/vt/keymaps/INDEX.keymaps stable/11/share/vt/keymaps/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/vt/keymaps/INDEX.keymaps ============================================================================== --- stable/11/share/vt/keymaps/INDEX.keymaps Wed Dec 19 22:47:37 2018 (r342253) +++ stable/11/share/vt/keymaps/INDEX.keymaps Wed Dec 19 22:48:27 2018 (r342254) @@ -534,6 +534,12 @@ uk.dvorak.kbd:fr:Royaume Uni Dvorak uk.dvorak.kbd:pt:Reino Unido Dvorak uk.dvorak.kbd:es:Británico Dvorak +uk.macbook.kbd:en:United Kingdom Macbook +uk.macbook.kbd:de:Vereinigtes Königreich Macbook +uk.macbook.kbd:fr:Royaume Uni Macbook +uk.macbook.kbd:pt:Reino Unido Macbook +uk.macbook.kbd:es:Británico Macbook + us.kbd:en:United States of America us.kbd:de:US-amerikanisch us.kbd:fr:États Unis d'Amérique Modified: stable/11/share/vt/keymaps/Makefile ============================================================================== --- stable/11/share/vt/keymaps/Makefile Wed Dec 19 22:47:37 2018 (r342253) +++ stable/11/share/vt/keymaps/Makefile Wed Dec 19 22:48:27 2018 (r342254) @@ -76,6 +76,7 @@ FILES= INDEX.keymaps \ uk.capsctrl.kbd \ uk.dvorak.kbd \ uk.kbd \ + uk.macbook.kbd \ us.acc.kbd \ us.ctrl.kbd \ us.dvorak.kbd \ Copied: stable/11/share/vt/keymaps/uk.macbook.kbd (from r341806, head/share/vt/keymaps/uk.macbook.kbd) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/vt/keymaps/uk.macbook.kbd Wed Dec 19 22:48:27 2018 (r342254, copy of r341806, head/share/vt/keymaps/uk.macbook.kbd) @@ -0,0 +1,115 @@ +# $FreeBSD$ +# by James Wright +# alt +# scan cntrl alt alt cntrl lock +# code base shift cntrl shift alt shift cntrl shift state +# ------------------------------------------------------------------ + 000 nop nop nop nop nop nop nop nop O + 001 esc esc esc esc esc esc debug esc O + 002 '1' '!' nop nop '1' '!' nop nop O + 003 '2' '@' nul nul 0x20ac '@' nul nul O + 004 '3' 0xa3 nop nop '#' 0xa3 nop nop O + 005 '4' '$' nop nop '4' '$' nop nop O + 006 '5' '%' nop nop '5' '%' nop nop O + 007 '6' '^' rs rs '6' '^' rs rs O + 008 '7' '&' nop nop '7' '&' nop nop O + 009 '8' '*' nop nop '8' '*' nop nop O + 010 '9' '(' nop nop '9' '(' nop nop O + 011 '0' ')' nop nop '0' ')' nop nop O + 012 '-' '_' us us '-' '_' us us O + 013 '=' '+' nop nop '=' '+' nop nop O + 014 bs bs del del bs bs del del O + 015 ht btab nop nop ht btab nop nop O + 016 'q' 'Q' dc1 dc1 'q' 'Q' dc1 dc1 C + 017 'w' 'W' etb etb 'w' 'W' etb etb C + 018 'e' 'E' enq enq 'e' 'E' enq enq C + 019 'r' 'R' dc2 dc2 'r' 'R' dc2 dc2 C + 020 't' 'T' dc4 dc4 't' 'T' dc4 dc4 C + 021 'y' 'Y' em em 'y' 'Y' em em C + 022 'u' 'U' nak nak 'u' 'U' nak nak C + 023 'i' 'I' ht ht 'i' 'I' ht ht C + 024 'o' 'O' si si 'o' 'O' si si C + 025 'p' 'P' dle dle 'p' 'P' dle dle C + 026 '[' '{' esc esc '[' '{' esc esc O + 027 ']' '}' gs gs ']' '}' gs gs O + 028 cr cr nl nl cr cr nl nl O + 029 lctrl lctrl lctrl lctrl lctrl lctrl lctrl lctrl O + 030 'a' 'A' soh soh 'a' 'A' soh soh C + 031 's' 'S' dc3 dc3 's' 'S' dc3 dc3 C + 032 'd' 'D' eot eot 'd' 'D' eot eot C + 033 'f' 'F' ack ack 'f' 'F' ack ack C + 034 'g' 'G' bel bel 'g' 'G' bel bel C + 035 'h' 'H' bs bs 'h' 'H' bs bs C + 036 'j' 'J' nl nl 'j' 'J' nl nl C + 037 'k' 'K' vt vt 'k' 'K' vt vt C + 038 'l' 'L' ff ff 'l' 'L' ff ff C + 039 ';' ':' nop nop ';' ':' nop nop O + 040 ''' '"' nop nop ''' '"' nop nop O + 041 0xa7 0xb1 nop nop 0xa7 0xb1 nop nop O + 042 lshift lshift lshift lshift lshift lshift lshift lshift O + 043 '\' '|' fs fs '\' '|' fs fs O + 044 'z' 'Z' sub sub 'z' 'Z' sub sub C + 045 'x' 'X' can can 'x' 'X' can can C + 046 'c' 'C' etx etx 'c' 'C' etx etx C + 047 'v' 'V' syn syn 'v' 'V' syn syn C + 048 'b' 'B' stx stx 'b' 'B' stx stx C + 049 'n' 'N' so so 'n' 'N' so so C + 050 'm' 'M' cr cr 'm' 'M' cr cr C + 051 ',' '<' nop nop ',' '<' nop nop O + 052 '.' '>' nop nop '.' '>' nop nop O + 053 '/' '?' nop nop '/' '?' nop nop O + 054 rshift rshift rshift rshift rshift rshift rshift rshift O + 055 '*' '*' '*' '*' '*' '*' '*' '*' O + 056 lalt lalt lalt lalt lalt lalt lalt lalt O + 057 ' ' ' ' nul ' ' ' ' ' ' susp ' ' O + 058 clock clock clock clock clock clock clock clock O + 059 fkey01 fkey13 fkey25 fkey37 scr01 scr11 scr01 scr11 O + 060 fkey02 fkey14 fkey26 fkey38 scr02 scr12 scr02 scr12 O + 061 fkey03 fkey15 fkey27 fkey39 scr03 scr13 scr03 scr13 O + 062 fkey04 fkey16 fkey28 fkey40 scr04 scr14 scr04 scr14 O + 063 fkey05 fkey17 fkey29 fkey41 scr05 scr15 scr05 scr15 O + 064 fkey06 fkey18 fkey30 fkey42 scr06 scr16 scr06 scr16 O + 065 fkey07 fkey19 fkey31 fkey43 scr07 scr07 scr07 scr07 O + 066 fkey08 fkey20 fkey32 fkey44 scr08 scr08 scr08 scr08 O + 067 fkey09 fkey21 fkey33 fkey45 scr09 scr09 scr09 scr09 O + 068 fkey10 fkey22 fkey34 fkey46 scr10 scr10 scr10 scr10 O + 069 nlock nlock nlock nlock nlock nlock nlock nlock O + 070 slock slock slock slock slock slock slock slock O + 071 fkey49 '7' '7' '7' '7' '7' '7' '7' N + 072 fkey50 '8' '8' '8' '8' '8' '8' '8' N + 073 fkey51 '9' '9' '9' '9' '9' '9' '9' N + 074 fkey52 '-' '-' '-' '-' '-' '-' '-' N + 075 fkey53 '4' '4' '4' '4' '4' '4' '4' N + 076 fkey54 '5' '5' '5' '5' '5' '5' '5' N + 077 fkey55 '6' '6' '6' '6' '6' '6' '6' N + 078 fkey56 '+' '+' '+' '+' '+' '+' '+' N + 079 fkey57 '1' '1' '1' '1' '1' '1' '1' N + 080 fkey58 '2' '2' '2' '2' '2' '2' '2' N + 081 fkey59 '3' '3' '3' '3' '3' '3' '3' N + 082 fkey60 '0' '0' '0' '0' '0' '0' '0' N + 083 del '.' '.' '.' '.' '.' boot boot N + 084 nop nop nop nop nop nop nop nop O + 085 nop nop nop nop nop nop nop nop O + 086 '`' '~' nop nop '`' '~' nop nop O + 087 fkey11 fkey23 fkey35 fkey47 scr11 scr11 scr11 scr11 O + 088 fkey12 fkey24 fkey36 fkey48 scr12 scr12 scr12 scr12 O + 089 cr cr nl nl cr cr nl nl O + 090 rctrl rctrl rctrl rctrl rctrl rctrl rctrl rctrl O + 091 '/' '/' '/' '/' '/' '/' '/' '/' N + 092 nscr pscr debug debug nop nop nop nop O + 093 ralt ralt ralt ralt ralt ralt ralt ralt O + 094 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 fkey49 O + 095 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 fkey50 O + 096 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 fkey51 O + 097 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 fkey53 O + 098 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 fkey55 O + 099 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 fkey57 O + 100 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 fkey58 O + 101 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 fkey59 O + 102 fkey60 paste fkey60 fkey60 fkey60 fkey60 fkey60 fkey60 O + 103 fkey61 fkey61 fkey61 fkey61 fkey61 fkey61 boot fkey61 O + 104 slock saver slock saver susp nop susp nop O + 105 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 fkey62 O + 106 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 fkey63 O + 107 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 fkey64 O + 108 nop nop nop nop nop nop nop nop O From owner-svn-src-stable@freebsd.org Wed Dec 19 23:29:45 2018 Return-Path: Delivered-To: svn-src-stable@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 7C404134D7E9; Wed, 19 Dec 2018 23:29:45 +0000 (UTC) (envelope-from mjg@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 E67327746F; Wed, 19 Dec 2018 23:29:44 +0000 (UTC) (envelope-from mjg@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 DAF411CE1F; Wed, 19 Dec 2018 23:29:44 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBJNTiJi071550; Wed, 19 Dec 2018 23:29:44 GMT (envelope-from mjg@FreeBSD.org) Received: (from mjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBJNTigD071548; Wed, 19 Dec 2018 23:29:44 GMT (envelope-from mjg@FreeBSD.org) Message-Id: <201812192329.wBJNTigD071548@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mjg set sender to mjg@FreeBSD.org using -f From: Mateusz Guzik Date: Wed, 19 Dec 2018 23:29:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342267 - stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Group: stable-12 X-SVN-Commit-Author: mjg X-SVN-Commit-Paths: stable/12/sys/cddl/dev/dtrace/amd64 X-SVN-Commit-Revision: 342267 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E67327746F 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_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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2018 23:29:45 -0000 Author: mjg Date: Wed Dec 19 23:29:44 2018 New Revision: 342267 URL: https://svnweb.freebsd.org/changeset/base/342267 Log: MFC r342053 dtrace: fix userspace access on boxes with SMAP Sponsored by: The FreeBSD Foundation Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Wed Dec 19 23:29:01 2018 (r342266) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_asm.S Wed Dec 19 23:29:44 2018 (r342267) @@ -208,7 +208,7 @@ dtrace_caller(int aframes) void dtrace_copy(uintptr_t src, uintptr_t dest, size_t size) */ - ENTRY(dtrace_copy) + ENTRY(dtrace_copy_nosmap) pushq %rbp movq %rsp, %rbp @@ -218,14 +218,28 @@ dtrace_copy(uintptr_t src, uintptr_t dest, size_t size smovb /* move from %ds:rsi to %ed:rdi */ leave ret - END(dtrace_copy) + END(dtrace_copy_nosmap) + ENTRY(dtrace_copy_smap) + pushq %rbp + movq %rsp, %rbp + + xchgq %rdi, %rsi /* make %rsi source, %rdi dest */ + movq %rdx, %rcx /* load count */ + stac + repz /* repeat for count ... */ + smovb /* move from %ds:rsi to %ed:rdi */ + clac + leave + ret + END(dtrace_copy_smap) + /* void dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_t size, volatile uint16_t *flags) */ - ENTRY(dtrace_copystr) + ENTRY(dtrace_copystr_nosmap) pushq %rbp movq %rsp, %rbp @@ -248,55 +262,120 @@ dtrace_copystr(uintptr_t uaddr, uintptr_t kaddr, size_ leave ret - END(dtrace_copystr) + END(dtrace_copystr_nosmap) + ENTRY(dtrace_copystr_smap) + pushq %rbp + movq %rsp, %rbp + + stac +0: + movb (%rdi), %al /* load from source */ + movb %al, (%rsi) /* store to destination */ + addq $1, %rdi /* increment source pointer */ + addq $1, %rsi /* increment destination pointer */ + subq $1, %rdx /* decrement remaining count */ + cmpb $0, %al + je 2f + testq $0xfff, %rdx /* test if count is 4k-aligned */ + jnz 1f /* if not, continue with copying */ + testq $CPU_DTRACE_BADADDR, (%rcx) /* load and test dtrace flags */ + jnz 2f +1: + cmpq $0, %rdx + jne 0b +2: + clac + leave + ret + + END(dtrace_copystr_smap) + /* uintptr_t dtrace_fulword(void *addr) */ - ENTRY(dtrace_fulword) + ENTRY(dtrace_fulword_nosmap) movq (%rdi), %rax ret - END(dtrace_fulword) + END(dtrace_fulword_nosmap) + ENTRY(dtrace_fulword_smap) + stac + movq (%rdi), %rax + clac + ret + END(dtrace_fulword_smap) + /* uint8_t dtrace_fuword8_nocheck(void *addr) */ - ENTRY(dtrace_fuword8_nocheck) + ENTRY(dtrace_fuword8_nocheck_nosmap) xorq %rax, %rax movb (%rdi), %al ret - END(dtrace_fuword8_nocheck) + END(dtrace_fuword8_nocheck_nosmap) + ENTRY(dtrace_fuword8_nocheck_smap) + stac + xorq %rax, %rax + movb (%rdi), %al + clac + ret + END(dtrace_fuword8_nocheck_smap) + /* uint16_t dtrace_fuword16_nocheck(void *addr) */ - ENTRY(dtrace_fuword16_nocheck) + ENTRY(dtrace_fuword16_nocheck_nosmap) xorq %rax, %rax movw (%rdi), %ax ret - END(dtrace_fuword16_nocheck) + END(dtrace_fuword16_nocheck_nosmap) + ENTRY(dtrace_fuword16_nocheck_smap) + stac + xorq %rax, %rax + movw (%rdi), %ax + clac + ret + END(dtrace_fuword16_nocheck_smap) + /* uint32_t dtrace_fuword32_nocheck(void *addr) */ - ENTRY(dtrace_fuword32_nocheck) + ENTRY(dtrace_fuword32_nocheck_nosmap) xorq %rax, %rax movl (%rdi), %eax ret - END(dtrace_fuword32_nocheck) + END(dtrace_fuword32_nocheck_nosmap) + ENTRY(dtrace_fuword32_nocheck_smap) + stac + xorq %rax, %rax + movl (%rdi), %eax + clac + ret + END(dtrace_fuword32_nocheck_smap) + /* uint64_t dtrace_fuword64_nocheck(void *addr) */ - ENTRY(dtrace_fuword64_nocheck) + ENTRY(dtrace_fuword64_nocheck_nosmap) movq (%rdi), %rax ret - END(dtrace_fuword64_nocheck) + END(dtrace_fuword64_nocheck_nosmap) + + ENTRY(dtrace_fuword64_nocheck_smap) + stac + movq (%rdi), %rax + clac + ret + END(dtrace_fuword64_nocheck_smap) /* void Modified: stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c ============================================================================== --- stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Wed Dec 19 23:29:01 2018 (r342266) +++ stable/12/sys/cddl/dev/dtrace/amd64/dtrace_isa.c Wed Dec 19 23:29:44 2018 (r342267) @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -663,4 +664,71 @@ dtrace_fuword64(void *uaddr) return (0); } return (dtrace_fuword64_nocheck(uaddr)); +} + +/* + * ifunc resolvers for SMAP support + */ +void dtrace_copy_nosmap(uintptr_t, uintptr_t, size_t); +void dtrace_copy_smap(uintptr_t, uintptr_t, size_t); +DEFINE_IFUNC(, void, dtrace_copy, (uintptr_t, uintptr_t, size_t), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_copy_smap : dtrace_copy_nosmap); +} + +void dtrace_copystr_nosmap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); +void dtrace_copystr_smap(uintptr_t, uintptr_t, size_t, volatile uint16_t *); +DEFINE_IFUNC(, void, dtrace_copystr, (uintptr_t, uintptr_t, size_t, + volatile uint16_t *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_copystr_smap : dtrace_copystr_nosmap); +} + +uintptr_t dtrace_fulword_nosmap(void *); +uintptr_t dtrace_fulword_smap(void *); +DEFINE_IFUNC(, uintptr_t, dtrace_fulword, (void *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_fulword_smap : dtrace_fulword_nosmap); +} + +uint8_t dtrace_fuword8_nocheck_nosmap(void *); +uint8_t dtrace_fuword8_nocheck_smap(void *); +DEFINE_IFUNC(, uint8_t, dtrace_fuword8_nocheck, (void *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_fuword8_nocheck_smap : dtrace_fuword8_nocheck_nosmap); +} + +uint16_t dtrace_fuword16_nocheck_nosmap(void *); +uint16_t dtrace_fuword16_nocheck_smap(void *); +DEFINE_IFUNC(, uint16_t, dtrace_fuword16_nocheck, (void *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_fuword16_nocheck_smap : dtrace_fuword16_nocheck_nosmap); +} + +uint32_t dtrace_fuword32_nocheck_nosmap(void *); +uint32_t dtrace_fuword32_nocheck_smap(void *); +DEFINE_IFUNC(, uint32_t, dtrace_fuword32_nocheck, (void *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_fuword32_nocheck_smap : dtrace_fuword32_nocheck_nosmap); +} + +uint64_t dtrace_fuword64_nocheck_nosmap(void *); +uint64_t dtrace_fuword64_nocheck_smap(void *); +DEFINE_IFUNC(, uint64_t, dtrace_fuword64_nocheck, (void *), static) +{ + + return ((cpu_stdext_feature & CPUID_STDEXT_SMAP) != 0 ? + dtrace_fuword64_nocheck_smap : dtrace_fuword64_nocheck_nosmap); } From owner-svn-src-stable@freebsd.org Thu Dec 20 00:57:24 2018 Return-Path: Delivered-To: svn-src-stable@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 AB68113500EC; Thu, 20 Dec 2018 00:57:24 +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 4FC748261E; Thu, 20 Dec 2018 00:57:24 +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 4310E1DD81; Thu, 20 Dec 2018 00:57:24 +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 wBK0vOkP019191; Thu, 20 Dec 2018 00:57:24 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK0vNJL019190; Thu, 20 Dec 2018 00:57:23 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812200057.wBK0vNJL019190@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 20 Dec 2018 00:57:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342268 - stable/12/sys/dev/asmc X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/asmc X-SVN-Commit-Revision: 342268 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4FC748261E 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.998,0]; NEURAL_HAM_SHORT(-0.97)[-0.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 00:57:24 -0000 Author: dab Date: Thu Dec 20 00:57:23 2018 New Revision: 342268 URL: https://svnweb.freebsd.org/changeset/base/342268 Log: MFC r341988 asmc: Add Support for Macbook Pro 8,1 PR: 217505 Submitted by: John O. Brickley , updated by Maciej Pasternacki Reported by: John O. Brickley Modified: stable/12/sys/dev/asmc/asmc.c stable/12/sys/dev/asmc/asmcvar.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/asmc/asmc.c ============================================================================== --- stable/12/sys/dev/asmc/asmc.c Wed Dec 19 23:29:44 2018 (r342267) +++ stable/12/sys/dev/asmc/asmc.c Thu Dec 20 00:57:23 2018 (r342268) @@ -219,9 +219,15 @@ struct asmc_model asmc_models[] = { }, { + "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, + ASMC_MBP81_TEMPS, ASMC_MBP81_TEMPNAMES, ASMC_MBP81_TEMPDESCS + }, + + { "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, - ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS + ASMC_MBP82_TEMPS, ASMC_MBP82_TEMPNAMES, ASMC_MBP82_TEMPDESCS }, { Modified: stable/12/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/12/sys/dev/asmc/asmcvar.h Wed Dec 19 23:29:44 2018 (r342267) +++ stable/12/sys/dev/asmc/asmcvar.h Thu Dec 20 00:57:23 2018 (r342268) @@ -218,21 +218,39 @@ struct asmc_softc { "Heatsink 2", "Memory Controller", \ "PCI Express Slot Pin", "PCI Express Slot (unk)" } -#define ASMC_MBP8_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP81_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \ + "Ts0S", NULL } + +#define ASMC_MBP81_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "wireless", "Th1H", "Ts0P", \ + "Ts0S" } + +#define ASMC_MBP81_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \ + "Ts0S" } + +#define ASMC_MBP82_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL } -#define ASMC_MBP8_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP82_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "graphics", "TG0P", "THSP", "TM0S", \ "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \ "Th2H", "memory", "Ts0P", "Ts0S" } -#define ASMC_MBP8_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP82_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ From owner-svn-src-stable@freebsd.org Thu Dec 20 00:58:17 2018 Return-Path: Delivered-To: svn-src-stable@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 424CF1350151; Thu, 20 Dec 2018 00:58:17 +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 DC20182760; Thu, 20 Dec 2018 00:58:16 +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 CDA961DD83; Thu, 20 Dec 2018 00:58:16 +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 wBK0wGdT019293; Thu, 20 Dec 2018 00:58:16 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK0wG6X019292; Thu, 20 Dec 2018 00:58:16 GMT (envelope-from dab@FreeBSD.org) Message-Id: <201812200058.wBK0wG6X019292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 20 Dec 2018 00:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342269 - stable/11/sys/dev/asmc X-SVN-Group: stable-11 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/11/sys/dev/asmc X-SVN-Commit-Revision: 342269 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DC20182760 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 00:58:17 -0000 Author: dab Date: Thu Dec 20 00:58:16 2018 New Revision: 342269 URL: https://svnweb.freebsd.org/changeset/base/342269 Log: MFC r341988 asmc: Add Support for Macbook Pro 8,1 PR: 217505 Submitted by: John O. Brickley , updated by Maciej Pasternacki Reported by: John O. Brickley Modified: stable/11/sys/dev/asmc/asmc.c stable/11/sys/dev/asmc/asmcvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/asmc/asmc.c ============================================================================== --- stable/11/sys/dev/asmc/asmc.c Thu Dec 20 00:57:23 2018 (r342268) +++ stable/11/sys/dev/asmc/asmc.c Thu Dec 20 00:58:16 2018 (r342269) @@ -222,9 +222,15 @@ struct asmc_model asmc_models[] = { }, { + "MacBookPro8,1", "Apple SMC MacBook Pro (early 2011, 13-inch)", + ASMC_SMS_FUNCS_DISABLED, ASMC_FAN_FUNCS2, ASMC_LIGHT_FUNCS, + ASMC_MBP81_TEMPS, ASMC_MBP81_TEMPNAMES, ASMC_MBP81_TEMPDESCS + }, + + { "MacBookPro8,2", "Apple SMC MacBook Pro (early 2011)", ASMC_SMS_FUNCS, ASMC_FAN_FUNCS, ASMC_LIGHT_FUNCS, - ASMC_MBP8_TEMPS, ASMC_MBP8_TEMPNAMES, ASMC_MBP8_TEMPDESCS + ASMC_MBP82_TEMPS, ASMC_MBP82_TEMPNAMES, ASMC_MBP82_TEMPDESCS }, { Modified: stable/11/sys/dev/asmc/asmcvar.h ============================================================================== --- stable/11/sys/dev/asmc/asmcvar.h Thu Dec 20 00:57:23 2018 (r342268) +++ stable/11/sys/dev/asmc/asmcvar.h Thu Dec 20 00:58:16 2018 (r342269) @@ -216,21 +216,39 @@ struct asmc_softc { "Heatsink 2", "Memory Controller", \ "PCI Express Slot Pin", "PCI Express Slot (unk)" } -#define ASMC_MBP8_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP81_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \ + "Ts0S", NULL } + +#define ASMC_MBP81_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "wireless", "Th1H", "Ts0P", \ + "Ts0S" } + +#define ASMC_MBP81_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ + "TCFC", "TCGC", "TCSA", "TM0S", "TMBS", \ + "TP0P", "TPCD", "TW0P", "Th1H", "Ts0P", \ + "Ts0S" } + +#define ASMC_MBP82_TEMPS { "TB0T", "TB1T", "TB2T", "TC0C", "TC0D", \ + "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ "TMBS", "TP0P", "TPCD", "TW0P", "Th1H", \ "Th2H", "Tm0P", "Ts0P", "Ts0S", NULL } -#define ASMC_MBP8_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP82_TEMPNAMES { "enclosure", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "graphics", "TG0P", "THSP", "TM0S", \ "TMBS", "TP0P", "TPCD", "wireless", "Th1H", \ "Th2H", "memory", "Ts0P", "Ts0S" } -#define ASMC_MBP8_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ +#define ASMC_MBP82_TEMPDESCS { "Enclosure Bottomside", "TB1T", "TB2T", "TC0C", "TC0D", \ "TC0E", "TC0F", "TC0P", "TC1C", "TC2C", \ "TC3C", "TC4C", "TCFC", "TCGC", "TCSA", \ "TCTD", "TG0D", "TG0P", "THSP", "TM0S", \ From owner-svn-src-stable@freebsd.org Thu Dec 20 02:50:26 2018 Return-Path: Delivered-To: svn-src-stable@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 1504B13542DC; Thu, 20 Dec 2018 02:50:26 +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 A847187D89; Thu, 20 Dec 2018 02:50:25 +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 82DF41F177; Thu, 20 Dec 2018 02:50:25 +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 wBK2oPXD079135; Thu, 20 Dec 2018 02:50:25 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK2oPch079132; Thu, 20 Dec 2018 02:50:25 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812200250.wBK2oPch079132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 20 Dec 2018 02:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342273 - in stable/12/sys/dev: rtwn/usb usb usb/wlan X-SVN-Group: stable-12 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/12/sys/dev: rtwn/usb usb usb/wlan X-SVN-Commit-Revision: 342273 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A847187D89 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 02:50:26 -0000 Author: avos Date: Thu Dec 20 02:50:24 2018 New Revision: 342273 URL: https://svnweb.freebsd.org/changeset/base/342273 Log: MFC r341786, r342156 rtwn, rsu: add more USB ids. PR: 233638 Submitted by: cezary.sliwa@gmail.com Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h stable/12/sys/dev/usb/usbdevs stable/12/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Thu Dec 20 01:35:45 2018 (r342272) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Thu Dec 20 02:50:24 2018 (r342273) @@ -118,6 +118,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(DLINK, DWA123D1), RTWN_RTL8188EU_DEV(DLINK, DWA125D1), RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M), + RTWN_RTL8188EU_DEV(TPLINK, WN722NV2), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), #undef RTWN_RTL8188EU_DEV Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Thu Dec 20 01:35:45 2018 (r342272) +++ stable/12/sys/dev/usb/usbdevs Thu Dec 20 02:50:24 2018 (r342273) @@ -4344,6 +4344,7 @@ product SITECOMEU RT3072_4 0x0048 RT3072 product SITECOMEU RT3072_5 0x004a RT3072 product SITECOMEU WL349V1 0x004b WL-349 v1 product SITECOMEU RT3072_6 0x004d RT3072 +product SITECOMEU WLA1000 0x005b WLA-1000 product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU product SITECOMEU RTL8188CU_2 0x005c RTL8188CU product SITECOMEU RTL8192CU 0x0061 RTL8192CU @@ -4609,6 +4610,7 @@ product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive product TPLINK T4U 0x0101 Archer T4U product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 +product TPLINK WN722NV2 0x010c TL-WN722N v2 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 Modified: stable/12/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/12/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 01:35:45 2018 (r342272) +++ stable/12/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 02:50:24 2018 (r342273) @@ -114,6 +114,7 @@ static const STRUCT_USB_HOST_ID rsu_devs[] = { RSU_HT_NOT_SUPPORTED) } RSU_DEV(ASUS, RTL8192SU), RSU_DEV(AZUREWAVE, RTL8192SU_4), + RSU_DEV(SITECOMEU, WLA1000), RSU_DEV_HT(ACCTON, RTL8192SU), RSU_DEV_HT(ASUS, USBN10), RSU_DEV_HT(AZUREWAVE, RTL8192SU_1), From owner-svn-src-stable@freebsd.org Thu Dec 20 03:10:25 2018 Return-Path: Delivered-To: svn-src-stable@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 EC6451354E1C; Thu, 20 Dec 2018 03:10: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 9052488D01; Thu, 20 Dec 2018 03:10:24 +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 80B2C1F6CF; Thu, 20 Dec 2018 03:10:24 +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 wBK3AOeT091005; Thu, 20 Dec 2018 03:10:24 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK3ANS8091003; Thu, 20 Dec 2018 03:10:23 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201812200310.wBK3ANS8091003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Thu, 20 Dec 2018 03:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342274 - in stable/11/sys/dev: urtwn usb usb/wlan X-SVN-Group: stable-11 X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in stable/11/sys/dev: urtwn usb usb/wlan X-SVN-Commit-Revision: 342274 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9052488D01 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 03:10:25 -0000 Author: avos Date: Thu Dec 20 03:10:23 2018 New Revision: 342274 URL: https://svnweb.freebsd.org/changeset/base/342274 Log: MFC r306173: Add TP-Link Archer T4U (and TPLINK vendor record in usbdevs). MFC r341786,r342156 urtwn, rsu: add more USB ids (rtwn -> urtwn merge was done manually). PR: 233638 Submitted by: cezary.sliwa@gmail.com Modified: stable/11/sys/dev/urtwn/if_urtwn.c stable/11/sys/dev/usb/usbdevs stable/11/sys/dev/usb/wlan/if_rsu.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/urtwn/if_urtwn.c ============================================================================== --- stable/11/sys/dev/urtwn/if_urtwn.c Thu Dec 20 02:50:24 2018 (r342273) +++ stable/11/sys/dev/urtwn/if_urtwn.c Thu Dec 20 03:10:23 2018 (r342274) @@ -186,6 +186,7 @@ static const STRUCT_USB_HOST_ID urtwn_devs[] = { URTWN_RTL8188E_DEV(DLINK, DWA123D1), URTWN_RTL8188E_DEV(DLINK, DWA125D1), URTWN_RTL8188E_DEV(ELECOM, WDC150SU2M), + URTWN_RTL8188E_DEV(TPLINK, WN722NV2), URTWN_RTL8188E_DEV(REALTEK, RTL8188ETV), URTWN_RTL8188E_DEV(REALTEK, RTL8188EU), #undef URTWN_RTL8188E_DEV Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Thu Dec 20 02:50:24 2018 (r342273) +++ stable/11/sys/dev/usb/usbdevs Thu Dec 20 03:10:23 2018 (r342274) @@ -742,6 +742,7 @@ vendor VIALABS 0x2109 VIA Labs vendor ERICSSON 0x2282 Ericsson vendor MOTOROLA2 0x22b8 Motorola vendor WETELECOM 0x22de WeTelecom +vendor TPLINK 0x2357 TP-Link vendor WESTMOUNTAIN 0x2405 West Mountain Radio vendor TRIPPLITE 0x2478 Tripp-Lite vendor HIROSE 0x2631 Hirose Electric @@ -4232,6 +4233,7 @@ product SITECOMEU RT3072_4 0x0048 RT3072 product SITECOMEU RT3072_5 0x004a RT3072 product SITECOMEU WL349V1 0x004b WL-349 v1 product SITECOMEU RT3072_6 0x004d RT3072 +product SITECOMEU WLA1000 0x005b WLA-1000 product SITECOMEU RTL8188CU_1 0x0052 RTL8188CU product SITECOMEU RTL8188CU_2 0x005c RTL8188CU product SITECOMEU RTL8192CU 0x0061 RTL8192CU @@ -4478,6 +4480,10 @@ product TOSHIBA RT3070 0x0a07 RT3070 product TOSHIBA G450 0x0d45 G450 modem product TOSHIBA HSDPA 0x1302 G450 modem product TOSHIBA TRANSMEMORY 0x6545 USB ThumbDrive + +/* TP-Link products */ +product TPLINK T4U 0x0101 Archer T4U +product TPLINK WN722NV2 0x010c TL-WN722N v2 /* Trek Technology products */ product TREK THUMBDRIVE 0x1111 ThumbDrive Modified: stable/11/sys/dev/usb/wlan/if_rsu.c ============================================================================== --- stable/11/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 02:50:24 2018 (r342273) +++ stable/11/sys/dev/usb/wlan/if_rsu.c Thu Dec 20 03:10:23 2018 (r342274) @@ -113,6 +113,7 @@ static const STRUCT_USB_HOST_ID rsu_devs[] = { RSU_HT_NOT_SUPPORTED) } RSU_DEV(ASUS, RTL8192SU), RSU_DEV(AZUREWAVE, RTL8192SU_4), + RSU_DEV(SITECOMEU, WLA1000), RSU_DEV_HT(ACCTON, RTL8192SU), RSU_DEV_HT(ASUS, USBN10), RSU_DEV_HT(AZUREWAVE, RTL8192SU_1), From owner-svn-src-stable@freebsd.org Thu Dec 20 08:28:52 2018 Return-Path: Delivered-To: svn-src-stable@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 BA0A6133BBC5; Thu, 20 Dec 2018 08:28:52 +0000 (UTC) (envelope-from ae@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 5F90E6C8FF; Thu, 20 Dec 2018 08:28:52 +0000 (UTC) (envelope-from ae@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 5223D22F83; Thu, 20 Dec 2018 08:28:52 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBK8SqQm059685; Thu, 20 Dec 2018 08:28:52 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK8SqUx059684; Thu, 20 Dec 2018 08:28:52 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201812200828.wBK8SqUx059684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 20 Dec 2018 08:28:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342276 - stable/12/sys/opencrypto X-SVN-Group: stable-12 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/12/sys/opencrypto X-SVN-Commit-Revision: 342276 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5F90E6C8FF 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.945,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 08:28:52 -0000 Author: ae Date: Thu Dec 20 08:28:51 2018 New Revision: 342276 URL: https://svnweb.freebsd.org/changeset/base/342276 Log: MFC r342030: Plug memory leak for AES_*_NIST_GMAC algorithms. swcr_newsession() allocates sw_ictx for these algorithms, thus we need to free() it in swcr_freesession(). PR: 233907 Modified: stable/12/sys/opencrypto/cryptosoft.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/12/sys/opencrypto/cryptosoft.c Thu Dec 20 05:46:56 2018 (r342275) +++ stable/12/sys/opencrypto/cryptosoft.c Thu Dec 20 08:28:51 2018 (r342276) @@ -1091,6 +1091,9 @@ swcr_freesession(device_t dev, crypto_session_t cses) case CRYPTO_SHA2_256: case CRYPTO_SHA2_384: case CRYPTO_SHA2_512: + case CRYPTO_AES_128_NIST_GMAC: + case CRYPTO_AES_192_NIST_GMAC: + case CRYPTO_AES_256_NIST_GMAC: axf = swd->sw_axf; if (swd->sw_ictx) { From owner-svn-src-stable@freebsd.org Thu Dec 20 08:33:12 2018 Return-Path: Delivered-To: svn-src-stable@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 D2950133BF30; Thu, 20 Dec 2018 08:33:12 +0000 (UTC) (envelope-from ae@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 6F80D6CECF; Thu, 20 Dec 2018 08:33:12 +0000 (UTC) (envelope-from ae@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 5A12423141; Thu, 20 Dec 2018 08:33:12 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBK8XCmU064685; Thu, 20 Dec 2018 08:33:12 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK8XCJ3064684; Thu, 20 Dec 2018 08:33:12 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201812200833.wBK8XCJ3064684@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 20 Dec 2018 08:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342277 - stable/11/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/opencrypto X-SVN-Commit-Revision: 342277 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 6F80D6CECF 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.998,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.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 08:33:13 -0000 Author: ae Date: Thu Dec 20 08:33:11 2018 New Revision: 342277 URL: https://svnweb.freebsd.org/changeset/base/342277 Log: MFC r342030: Plug memory leak for AES_*_NIST_GMAC algorithms. swcr_newsession() allocates sw_ictx for these algorithms, thus we need to free() it in swcr_freesession(). PR: 233907 Modified: stable/11/sys/opencrypto/cryptosoft.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/opencrypto/cryptosoft.c ============================================================================== --- stable/11/sys/opencrypto/cryptosoft.c Thu Dec 20 08:28:51 2018 (r342276) +++ stable/11/sys/opencrypto/cryptosoft.c Thu Dec 20 08:33:11 2018 (r342277) @@ -1054,6 +1054,9 @@ swcr_freesession_locked(device_t dev, u_int64_t tid) case CRYPTO_MD5: case CRYPTO_SHA1: + case CRYPTO_AES_128_NIST_GMAC: + case CRYPTO_AES_192_NIST_GMAC: + case CRYPTO_AES_256_NIST_GMAC: axf = swd->sw_axf; if (swd->sw_ictx) From owner-svn-src-stable@freebsd.org Thu Dec 20 08:45:42 2018 Return-Path: Delivered-To: svn-src-stable@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 D4CE0133C6C9; Thu, 20 Dec 2018 08:45:41 +0000 (UTC) (envelope-from avg@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 7A6F66DA98; Thu, 20 Dec 2018 08:45:41 +0000 (UTC) (envelope-from avg@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 6E020232F9; Thu, 20 Dec 2018 08:45:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBK8jfik071225; Thu, 20 Dec 2018 08:45:41 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBK8jf6S071224; Thu, 20 Dec 2018 08:45:41 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201812200845.wBK8jf6S071224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 20 Dec 2018 08:45:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342278 - stable/12/sys/dev/acpica X-SVN-Group: stable-12 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/12/sys/dev/acpica X-SVN-Commit-Revision: 342278 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7A6F66DA98 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.998,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.998,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 08:45:42 -0000 Author: avg Date: Thu Dec 20 08:45:41 2018 New Revision: 342278 URL: https://svnweb.freebsd.org/changeset/base/342278 Log: MFC r341632: acpi_{Device,Battery}IsPresent: restore pre-r330957 behaviour Specifically, assume that the device is present if evaluation of _STA method fails. PR: 227191 Modified: stable/12/sys/dev/acpica/acpi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/acpica/acpi.c ============================================================================== --- stable/12/sys/dev/acpica/acpi.c Thu Dec 20 08:33:11 2018 (r342277) +++ stable/12/sys/dev/acpica/acpi.c Thu Dec 20 08:45:41 2018 (r342278) @@ -2219,8 +2219,6 @@ acpi_DeviceIsPresent(device_t dev) h = acpi_get_handle(dev); if (h == NULL) return (FALSE); - status = acpi_GetInteger(h, "_STA", &s); - /* * Onboard serial ports on certain AMD motherboards have an invalid _STA * method that always returns 0. Force them to always be treated as present. @@ -2230,9 +2228,14 @@ acpi_DeviceIsPresent(device_t dev) if (acpi_MatchHid(h, "AMDI0020") || acpi_MatchHid(h, "AMDI0010")) return (TRUE); - /* If no _STA method, must be present */ + status = acpi_GetInteger(h, "_STA", &s); + + /* + * If no _STA method or if it failed, then assume that + * the device is present. + */ if (ACPI_FAILURE(status)) - return (status == AE_NOT_FOUND ? TRUE : FALSE); + return (TRUE); return (ACPI_DEVICE_PRESENT(s) ? TRUE : FALSE); } @@ -2252,9 +2255,12 @@ acpi_BatteryIsPresent(device_t dev) return (FALSE); status = acpi_GetInteger(h, "_STA", &s); - /* If no _STA method, must be present */ + /* + * If no _STA method or if it failed, then assume that + * the device is present. + */ if (ACPI_FAILURE(status)) - return (status == AE_NOT_FOUND ? TRUE : FALSE); + return (TRUE); return (ACPI_BATTERY_PRESENT(s) ? TRUE : FALSE); } From owner-svn-src-stable@freebsd.org Thu Dec 20 18:28:55 2018 Return-Path: Delivered-To: svn-src-stable@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 2B740134FA16; Thu, 20 Dec 2018 18:28:55 +0000 (UTC) (envelope-from dim@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 CA2548CBF9; Thu, 20 Dec 2018 18:28:54 +0000 (UTC) (envelope-from dim@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 BCE831766; Thu, 20 Dec 2018 18:28:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKISsKS077439; Thu, 20 Dec 2018 18:28:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKISsnC077436; Thu, 20 Dec 2018 18:28:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201812201828.wBKISsnC077436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Dec 2018 18:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342281 - in stable: 11/contrib/llvm/tools/clang/include/clang/AST 11/contrib/llvm/tools/clang/lib/AST 12/contrib/llvm/tools/clang/include/clang/AST 12/contrib/llvm/tools/clang/lib/AST X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/tools/clang/include/clang/AST 11/contrib/llvm/tools/clang/lib/AST 12/contrib/llvm/tools/clang/include/clang/AST 12/contrib/llvm/tools/clang/lib/AST X-SVN-Commit-Revision: 342281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: CA2548CBF9 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.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 18:28:55 -0000 Author: dim Date: Thu Dec 20 18:28:53 2018 New Revision: 342281 URL: https://svnweb.freebsd.org/changeset/base/342281 Log: Pull in r329671 from upstream clang trunk (by Akira Hatanaka): [ExprConstant] Use an AST node and a version number as a key to create an APValue and retrieve it from map Temporaries. The version number is needed when a single AST node is visited multiple times and is used to create APValues that are required to be distinct from each other (for example, MaterializeTemporaryExprs in default arguments and VarDecls in loops). rdar://problem/36505742 Differential Revision: https://reviews.llvm.org/D42776 This should fix 'Assertion failed: (Result.isUninit() && "temporary created multiple times"), function createTemporary' errors (if assertions are enabled, otherwise the compiler internal state might go bad), when building the graphics/rawtherapee port. Direct commit to stable/11 and stable/12, since head already has clang 7.0.1, which includes this change. PR: 234144 Modified: stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Changes in other areas also in this revision: Modified: stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Modified: stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h ============================================================================== --- stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h Thu Dec 20 16:05:30 2018 (r342280) +++ stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h Thu Dec 20 18:28:53 2018 (r342281) @@ -53,7 +53,58 @@ class APValue { (public) MemberPointer, AddrLabelDiff }; - typedef llvm::PointerUnion LValueBase; + + class LValueBase { + public: + typedef llvm::PointerUnion PtrTy; + + LValueBase() : CallIndex(0), Version(0) {} + + template + LValueBase(T P, unsigned I = 0, unsigned V = 0) + : Ptr(P), CallIndex(I), Version(V) {} + + template + bool is() const { return Ptr.is(); } + + template + T get() const { return Ptr.get(); } + + template + T dyn_cast() const { return Ptr.dyn_cast(); } + + void *getOpaqueValue() const; + + bool isNull() const; + + explicit operator bool () const; + + PtrTy getPointer() const { + return Ptr; + } + + unsigned getCallIndex() const { + return CallIndex; + } + + void setCallIndex(unsigned Index) { + CallIndex = Index; + } + + unsigned getVersion() const { + return Version; + } + + bool operator==(const LValueBase &Other) const { + return Ptr == Other.Ptr && CallIndex == Other.CallIndex && + Version == Other.Version; + } + + private: + PtrTy Ptr; + unsigned CallIndex, Version; + }; + typedef llvm::PointerIntPair BaseOrMemberType; union LValuePathEntry { /// BaseOrMember - The FieldDecl or CXXRecordDecl indicating the next item @@ -135,15 +186,15 @@ class APValue { (public) } APValue(const APValue &RHS); APValue(APValue &&RHS) : Kind(Uninitialized) { swap(RHS); } - APValue(LValueBase B, const CharUnits &O, NoLValuePath N, unsigned CallIndex, + APValue(LValueBase B, const CharUnits &O, NoLValuePath N, bool IsNullPtr = false) : Kind(Uninitialized) { - MakeLValue(); setLValue(B, O, N, CallIndex, IsNullPtr); + MakeLValue(); setLValue(B, O, N, IsNullPtr); } APValue(LValueBase B, const CharUnits &O, ArrayRef Path, - bool OnePastTheEnd, unsigned CallIndex, bool IsNullPtr = false) + bool OnePastTheEnd, bool IsNullPtr = false) : Kind(Uninitialized) { - MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, CallIndex, IsNullPtr); + MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, IsNullPtr); } APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(Uninitialized) { MakeArray(InitElts, Size); @@ -255,6 +306,7 @@ class APValue { (public) bool hasLValuePath() const; ArrayRef getLValuePath() const; unsigned getLValueCallIndex() const; + unsigned getLValueVersion() const; bool isNullPointer() const; APValue &getVectorElt(unsigned I) { @@ -376,10 +428,10 @@ class APValue { (public) ((ComplexAPFloat *)(char *)Data.buffer)->Imag = std::move(I); } void setLValue(LValueBase B, const CharUnits &O, NoLValuePath, - unsigned CallIndex, bool IsNullPtr); + bool IsNullPtr); void setLValue(LValueBase B, const CharUnits &O, ArrayRef Path, bool OnePastTheEnd, - unsigned CallIndex, bool IsNullPtr); + bool IsNullPtr); void setUnion(const FieldDecl *Field, const APValue &Value) { assert(isUnion() && "Invalid accessor"); ((UnionData*)(char*)Data.buffer)->Field = Field; @@ -450,5 +502,15 @@ class APValue { (public) }; } // end namespace clang. + +namespace llvm { +template<> struct DenseMapInfo { + static clang::APValue::LValueBase getEmptyKey(); + static clang::APValue::LValueBase getTombstoneKey(); + static unsigned getHashValue(const clang::APValue::LValueBase &Base); + static bool isEqual(const clang::APValue::LValueBase &LHS, + const clang::APValue::LValueBase &RHS); +}; +} #endif Modified: stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp ============================================================================== --- stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp Thu Dec 20 16:05:30 2018 (r342280) +++ stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp Thu Dec 20 18:28:53 2018 (r342281) @@ -23,14 +23,57 @@ using namespace clang; namespace { struct LVBase { - llvm::PointerIntPair BaseAndIsOnePastTheEnd; + APValue::LValueBase Base; CharUnits Offset; unsigned PathLength; - unsigned CallIndex; - bool IsNullPtr; + bool IsNullPtr : 1; + bool IsOnePastTheEnd : 1; }; } +void *APValue::LValueBase::getOpaqueValue() const { + return Ptr.getOpaqueValue(); +} + +bool APValue::LValueBase::isNull() const { + return Ptr.isNull(); +} + +APValue::LValueBase::operator bool () const { + return static_cast(Ptr); +} + +clang::APValue::LValueBase +llvm::DenseMapInfo::getEmptyKey() { + return clang::APValue::LValueBase( + DenseMapInfo::getEmptyKey(), + DenseMapInfo::getEmptyKey(), + DenseMapInfo::getEmptyKey()); +} + +clang::APValue::LValueBase +llvm::DenseMapInfo::getTombstoneKey() { + return clang::APValue::LValueBase( + DenseMapInfo::getTombstoneKey(), + DenseMapInfo::getTombstoneKey(), + DenseMapInfo::getTombstoneKey()); +} + +unsigned llvm::DenseMapInfo::getHashValue( + const clang::APValue::LValueBase &Base) { + llvm::FoldingSetNodeID ID; + ID.AddPointer(Base.getOpaqueValue()); + ID.AddInteger(Base.getCallIndex()); + ID.AddInteger(Base.getVersion()); + return ID.ComputeHash(); +} + +bool llvm::DenseMapInfo::isEqual( + const clang::APValue::LValueBase &LHS, + const clang::APValue::LValueBase &RHS) { + return LHS == RHS; +} + struct APValue::LV : LVBase { static const unsigned InlinePathSpace = (DataSize - sizeof(LVBase)) / sizeof(LValuePathEntry); @@ -150,11 +193,10 @@ APValue::APValue(const APValue &RHS) : Kind(Uninitiali MakeLValue(); if (RHS.hasLValuePath()) setLValue(RHS.getLValueBase(), RHS.getLValueOffset(), RHS.getLValuePath(), - RHS.isLValueOnePastTheEnd(), RHS.getLValueCallIndex(), - RHS.isNullPointer()); + RHS.isLValueOnePastTheEnd(), RHS.isNullPointer()); else setLValue(RHS.getLValueBase(), RHS.getLValueOffset(), NoLValuePath(), - RHS.getLValueCallIndex(), RHS.isNullPointer()); + RHS.isNullPointer()); break; case Array: MakeArray(RHS.getArrayInitializedElts(), RHS.getArraySize()); @@ -552,12 +594,12 @@ std::string APValue::getAsString(ASTContext &Ctx, Qual const APValue::LValueBase APValue::getLValueBase() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const void*)Data.buffer)->BaseAndIsOnePastTheEnd.getPointer(); + return ((const LV*)(const void*)Data.buffer)->Base; } bool APValue::isLValueOnePastTheEnd() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const void*)Data.buffer)->BaseAndIsOnePastTheEnd.getInt(); + return ((const LV*)(const void*)Data.buffer)->IsOnePastTheEnd; } CharUnits &APValue::getLValueOffset() { @@ -578,35 +620,38 @@ ArrayRef APValue::getLValueP unsigned APValue::getLValueCallIndex() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const char*)Data.buffer)->CallIndex; + return ((const LV*)(const char*)Data.buffer)->Base.getCallIndex(); } +unsigned APValue::getLValueVersion() const { + assert(isLValue() && "Invalid accessor"); + return ((const LV*)(const char*)Data.buffer)->Base.getVersion(); +} + bool APValue::isNullPointer() const { assert(isLValue() && "Invalid usage"); return ((const LV*)(const char*)Data.buffer)->IsNullPtr; } void APValue::setLValue(LValueBase B, const CharUnits &O, NoLValuePath, - unsigned CallIndex, bool IsNullPtr) { + bool IsNullPtr) { assert(isLValue() && "Invalid accessor"); LV &LVal = *((LV*)(char*)Data.buffer); - LVal.BaseAndIsOnePastTheEnd.setPointer(B); - LVal.BaseAndIsOnePastTheEnd.setInt(false); + LVal.Base = B; + LVal.IsOnePastTheEnd = false; LVal.Offset = O; - LVal.CallIndex = CallIndex; LVal.resizePath((unsigned)-1); LVal.IsNullPtr = IsNullPtr; } void APValue::setLValue(LValueBase B, const CharUnits &O, ArrayRef Path, bool IsOnePastTheEnd, - unsigned CallIndex, bool IsNullPtr) { + bool IsNullPtr) { assert(isLValue() && "Invalid accessor"); LV &LVal = *((LV*)(char*)Data.buffer); - LVal.BaseAndIsOnePastTheEnd.setPointer(B); - LVal.BaseAndIsOnePastTheEnd.setInt(IsOnePastTheEnd); + LVal.Base = B; + LVal.IsOnePastTheEnd = IsOnePastTheEnd; LVal.Offset = O; - LVal.CallIndex = CallIndex; LVal.resizePath(Path.size()); memcpy(LVal.getPath(), Path.data(), Path.size() * sizeof(LValuePathEntry)); LVal.IsNullPtr = IsNullPtr; Modified: stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp ============================================================================== --- stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Thu Dec 20 16:05:30 2018 (r342280) +++ stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Thu Dec 20 18:28:53 2018 (r342281) @@ -446,8 +446,8 @@ namespace { // Note that we intentionally use std::map here so that references to // values are stable. - typedef std::map MapTy; - typedef MapTy::const_iterator temp_iterator; + typedef std::pair MapKeyTy; + typedef std::map MapTy; /// Temporaries - Temporary lvalues materialized within this stack frame. MapTy Temporaries; @@ -457,6 +457,20 @@ namespace { /// Index - The call index of this call. unsigned Index; + /// The stack of integers for tracking version numbers for temporaries. + SmallVector TempVersionStack = {1}; + unsigned CurTempVersion = TempVersionStack.back(); + + unsigned getTempVersion() const { return TempVersionStack.back(); } + + void pushTempVersion() { + TempVersionStack.push_back(++CurTempVersion); + } + + void popTempVersion() { + TempVersionStack.pop_back(); + } + // FIXME: Adding this to every 'CallStackFrame' may have a nontrivial impact // on the overall stack usage of deeply-recursing constexpr evaluataions. // (We should cache this map rather than recomputing it repeatedly.) @@ -473,10 +487,36 @@ namespace { APValue *Arguments); ~CallStackFrame(); - APValue *getTemporary(const void *Key) { - MapTy::iterator I = Temporaries.find(Key); - return I == Temporaries.end() ? nullptr : &I->second; + // Return the temporary for Key whose version number is Version. + APValue *getTemporary(const void *Key, unsigned Version) { + MapKeyTy KV(Key, Version); + auto LB = Temporaries.lower_bound(KV); + if (LB != Temporaries.end() && LB->first == KV) + return &LB->second; + // Pair (Key,Version) wasn't found in the map. Check that no elements + // in the map have 'Key' as their key. + assert((LB == Temporaries.end() || LB->first.first != Key) && + (LB == Temporaries.begin() || std::prev(LB)->first.first != Key) && + "Element with key 'Key' found in map"); + return nullptr; } + + // Return the current temporary for Key in the map. + APValue *getCurrentTemporary(const void *Key) { + auto UB = Temporaries.upper_bound(MapKeyTy(Key, UINT_MAX)); + if (UB != Temporaries.begin() && std::prev(UB)->first.first == Key) + return &std::prev(UB)->second; + return nullptr; + } + + // Return the version number of the current temporary for Key. + unsigned getCurrentTemporaryVersion(const void *Key) const { + auto UB = Temporaries.upper_bound(MapKeyTy(Key, UINT_MAX)); + if (UB != Temporaries.begin() && std::prev(UB)->first.first == Key) + return std::prev(UB)->first.second; + return 0; + } + APValue &createTemporary(const void *Key, bool IsLifetimeExtended); }; @@ -606,7 +646,8 @@ namespace { /// EvaluatingObject - Pair of the AST node that an lvalue represents and /// the call index that that lvalue was allocated in. - typedef std::pair EvaluatingObject; + typedef std::pair> + EvaluatingObject; /// EvaluatingConstructors - Set of objects that are currently being /// constructed. @@ -625,8 +666,10 @@ namespace { } }; - bool isEvaluatingConstructor(APValue::LValueBase Decl, unsigned CallIndex) { - return EvaluatingConstructors.count(EvaluatingObject(Decl, CallIndex)); + bool isEvaluatingConstructor(APValue::LValueBase Decl, unsigned CallIndex, + unsigned Version) { + return EvaluatingConstructors.count( + EvaluatingObject(Decl, {CallIndex, Version})); } /// The current array initialization index, if we're performing array @@ -722,7 +765,7 @@ namespace { void setEvaluatingDecl(APValue::LValueBase Base, APValue &Value) { EvaluatingDecl = Base; EvaluatingDeclValue = &Value; - EvaluatingConstructors.insert({Base, 0}); + EvaluatingConstructors.insert({Base, {0, 0}}); } const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); } @@ -1086,11 +1129,16 @@ namespace { unsigned OldStackSize; public: ScopeRAII(EvalInfo &Info) - : Info(Info), OldStackSize(Info.CleanupStack.size()) {} + : Info(Info), OldStackSize(Info.CleanupStack.size()) { + // Push a new temporary version. This is needed to distinguish between + // temporaries created in different iterations of a loop. + Info.CurrentCall->pushTempVersion(); + } ~ScopeRAII() { // Body moved to a static method to encourage the compiler to inline away // instances of this class. cleanup(Info, OldStackSize); + Info.CurrentCall->popTempVersion(); } private: static void cleanup(EvalInfo &Info, unsigned OldStackSize) { @@ -1170,7 +1218,8 @@ CallStackFrame::~CallStackFrame() { APValue &CallStackFrame::createTemporary(const void *Key, bool IsLifetimeExtended) { - APValue &Result = Temporaries[Key]; + unsigned Version = Info.CurrentCall->getTempVersion(); + APValue &Result = Temporaries[MapKeyTy(Key, Version)]; assert(Result.isUninit() && "temporary created multiple times"); Info.CleanupStack.push_back(Cleanup(&Result, IsLifetimeExtended)); return Result; @@ -1262,27 +1311,27 @@ namespace { struct LValue { APValue::LValueBase Base; CharUnits Offset; - unsigned InvalidBase : 1; - unsigned CallIndex : 31; SubobjectDesignator Designator; - bool IsNullPtr; + bool IsNullPtr : 1; + bool InvalidBase : 1; const APValue::LValueBase getLValueBase() const { return Base; } CharUnits &getLValueOffset() { return Offset; } const CharUnits &getLValueOffset() const { return Offset; } - unsigned getLValueCallIndex() const { return CallIndex; } SubobjectDesignator &getLValueDesignator() { return Designator; } const SubobjectDesignator &getLValueDesignator() const { return Designator;} bool isNullPointer() const { return IsNullPtr;} + unsigned getLValueCallIndex() const { return Base.getCallIndex(); } + unsigned getLValueVersion() const { return Base.getVersion(); } + void moveInto(APValue &V) const { if (Designator.Invalid) - V = APValue(Base, Offset, APValue::NoLValuePath(), CallIndex, - IsNullPtr); + V = APValue(Base, Offset, APValue::NoLValuePath(), IsNullPtr); else { assert(!InvalidBase && "APValues can't handle invalid LValue bases"); V = APValue(Base, Offset, Designator.Entries, - Designator.IsOnePastTheEnd, CallIndex, IsNullPtr); + Designator.IsOnePastTheEnd, IsNullPtr); } } void setFrom(ASTContext &Ctx, const APValue &V) { @@ -1290,12 +1339,11 @@ namespace { Base = V.getLValueBase(); Offset = V.getLValueOffset(); InvalidBase = false; - CallIndex = V.getLValueCallIndex(); Designator = SubobjectDesignator(Ctx, V); IsNullPtr = V.isNullPointer(); } - void set(APValue::LValueBase B, unsigned I = 0, bool BInvalid = false) { + void set(APValue::LValueBase B, bool BInvalid = false) { #ifndef NDEBUG // We only allow a few types of invalid bases. Enforce that here. if (BInvalid) { @@ -1308,7 +1356,6 @@ namespace { Base = B; Offset = CharUnits::fromQuantity(0); InvalidBase = BInvalid; - CallIndex = I; Designator = SubobjectDesignator(getType(B)); IsNullPtr = false; } @@ -1317,13 +1364,12 @@ namespace { Base = (Expr *)nullptr; Offset = CharUnits::fromQuantity(TargetVal); InvalidBase = false; - CallIndex = 0; Designator = SubobjectDesignator(PointerTy->getPointeeType()); IsNullPtr = true; } void setInvalid(APValue::LValueBase B, unsigned I = 0) { - set(B, I, true); + set(B, true); } // Check that this LValue is not based on a null pointer. If it is, produce @@ -1525,6 +1571,15 @@ static bool EvaluateAsRValue(EvalInfo &Info, const Exp // Misc utilities //===----------------------------------------------------------------------===// +/// A helper function to create a temporary and set an LValue. +template +static APValue &createTemporary(const KeyTy *Key, bool IsLifetimeExtended, + LValue &LV, CallStackFrame &Frame) { + LV.set({Key, Frame.Info.CurrentCall->Index, + Frame.Info.CurrentCall->getTempVersion()}); + return Frame.createTemporary(Key, IsLifetimeExtended); +} + /// Negate an APSInt in place, converting it to a signed form if necessary, and /// preserving its value (by extending by up to one bit as needed). static void negateAsSigned(APSInt &Int) { @@ -1854,7 +1909,7 @@ static const ValueDecl *GetLValueBaseDecl(const LValue } static bool IsLiteralLValue(const LValue &Value) { - if (Value.CallIndex) + if (Value.getLValueCallIndex()) return false; const Expr *E = Value.Base.dyn_cast(); return E && !isa(E); @@ -2404,7 +2459,7 @@ static bool handleLValueToRValueConversion(EvalInfo &I /// \param Result Filled in with a pointer to the value of the variable. static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, - APValue *&Result) { + APValue *&Result, const LValue *LVal) { // If this is a parameter to an active constexpr function call, perform // argument substitution. @@ -2423,7 +2478,8 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const // If this is a local variable, dig out its value. if (Frame) { - Result = Frame->getTemporary(VD); + Result = LVal ? Frame->getTemporary(VD, LVal->getLValueVersion()) + : Frame->getCurrentTemporary(VD); if (!Result) { // Assume variables referenced within a lambda's call operator that were // not declared within the call operator are captures and during checking @@ -3000,8 +3056,8 @@ static CompleteObject findCompleteObject(EvalInfo &Inf } CallStackFrame *Frame = nullptr; - if (LVal.CallIndex) { - Frame = Info.getCallFrame(LVal.CallIndex); + if (LVal.getLValueCallIndex()) { + Frame = Info.getCallFrame(LVal.getLValueCallIndex()); if (!Frame) { Info.FFDiag(E, diag::note_constexpr_lifetime_ended, 1) << AK << LVal.Base.is(); @@ -3113,7 +3169,7 @@ static CompleteObject findCompleteObject(EvalInfo &Inf } } - if (!evaluateVarDeclInit(Info, E, VD, Frame, BaseVal)) + if (!evaluateVarDeclInit(Info, E, VD, Frame, BaseVal, &LVal)) return CompleteObject(); } else { const Expr *Base = LVal.Base.dyn_cast(); @@ -3155,7 +3211,7 @@ static CompleteObject findCompleteObject(EvalInfo &Inf return CompleteObject(); } } else { - BaseVal = Frame->getTemporary(Base); + BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); assert(BaseVal && "missing value for temporary"); } @@ -3175,7 +3231,9 @@ static CompleteObject findCompleteObject(EvalInfo &Inf // During the construction of an object, it is not yet 'const'. // FIXME: This doesn't do quite the right thing for const subobjects of the // object under construction. - if (Info.isEvaluatingConstructor(LVal.getLValueBase(), LVal.CallIndex)) { + if (Info.isEvaluatingConstructor(LVal.getLValueBase(), + LVal.getLValueCallIndex(), + LVal.getLValueVersion())) { BaseType = Info.Ctx.getCanonicalType(BaseType); BaseType.removeLocalConst(); } @@ -3212,7 +3270,7 @@ static bool handleLValueToRValueConversion(EvalInfo &I // Check for special cases where there is no existing APValue to look at. const Expr *Base = LVal.Base.dyn_cast(); - if (Base && !LVal.CallIndex && !Type.isVolatileQualified()) { + if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { if (const CompoundLiteralExpr *CLE = dyn_cast(Base)) { // In C99, a CompoundLiteralExpr is an lvalue, and we defer evaluating the // initializer until now for such expressions. Such an expression can't be @@ -3715,8 +3773,7 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarD return true; LValue Result; - Result.set(VD, Info.CurrentCall->Index); - APValue &Val = Info.CurrentCall->createTemporary(VD, true); + APValue &Val = createTemporary(VD, true, Result, *Info.CurrentCall); const Expr *InitE = VD->getInit(); if (!InitE) { @@ -3772,6 +3829,19 @@ struct StmtResult { /// The location containing the result, if any (used to support RVO). const LValue *Slot; }; + +struct TempVersionRAII { + CallStackFrame &Frame; + + TempVersionRAII(CallStackFrame &Frame) : Frame(Frame) { + Frame.pushTempVersion(); + } + + ~TempVersionRAII() { + Frame.popTempVersion(); + } +}; + } static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, @@ -4329,7 +4399,8 @@ static bool HandleConstructorCall(const Expr *E, const } EvalInfo::EvaluatingConstructorRAII EvalObj( - Info, {This.getLValueBase(), This.CallIndex}); + Info, {This.getLValueBase(), + {This.getLValueCallIndex(), This.getLValueVersion()}}); CallStackFrame Frame(Info, CallLoc, Definition, &This, ArgValues); // FIXME: Creating an APValue just to hold a nonexistent return value is @@ -4578,9 +4649,12 @@ class ExprEvaluatorBase (public) { return StmtVisitorTy::Visit(E->getResultExpr()); } bool VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E) { return StmtVisitorTy::Visit(E->getReplacement()); } - bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) - { return StmtVisitorTy::Visit(E->getExpr()); } + bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) { + TempVersionRAII RAII(*Info.CurrentCall); + return StmtVisitorTy::Visit(E->getExpr()); + } bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *E) { + TempVersionRAII RAII(*Info.CurrentCall); // The initializer may not have been parsed yet, or might be erroneous. if (!E->getExpr()) return Error(E); @@ -4658,7 +4732,7 @@ class ExprEvaluatorBase (public) } bool VisitOpaqueValueExpr(const OpaqueValueExpr *E) { - if (APValue *Value = Info.CurrentCall->getTemporary(E)) + if (APValue *Value = Info.CurrentCall->getCurrentTemporary(E)) return DerivedSuccess(*Value, E); const Expr *Source = E->getSourceExpr(); @@ -5216,14 +5290,15 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, if (!VD->getType()->isReferenceType()) { if (Frame) { - Result.set(VD, Frame->Index); + Result.set({VD, Frame->Index, + Info.CurrentCall->getCurrentTemporaryVersion(VD)}); return true; } return Success(VD); } APValue *V; - if (!evaluateVarDeclInit(Info, E, VD, Frame, V)) + if (!evaluateVarDeclInit(Info, E, VD, Frame, V, nullptr)) return false; if (V->isUninit()) { if (!Info.checkingPotentialConstantExpression()) @@ -5255,9 +5330,8 @@ bool LValueExprEvaluator::VisitMaterializeTemporaryExp *Value = APValue(); Result.set(E); } else { - Value = &Info.CurrentCall-> - createTemporary(E, E->getStorageDuration() == SD_Automatic); - Result.set(E, Info.CurrentCall->Index); + Value = &createTemporary(E, E->getStorageDuration() == SD_Automatic, Result, + *Info.CurrentCall); } QualType Type = Inner->getType(); @@ -5736,7 +5810,6 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExp Result.Base = (Expr*)nullptr; Result.InvalidBase = false; Result.Offset = CharUnits::fromQuantity(N); - Result.CallIndex = 0; Result.Designator.setInvalid(); Result.IsNullPtr = false; return true; @@ -5752,9 +5825,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExp if (!evaluateLValue(SubExpr, Result)) return false; } else { - Result.set(SubExpr, Info.CurrentCall->Index); - if (!EvaluateInPlace(Info.CurrentCall->createTemporary(SubExpr, false), - Info, Result, SubExpr)) + APValue &Value = createTemporary(SubExpr, false, Result, + *Info.CurrentCall); + if (!EvaluateInPlace(Value, Info, Result, SubExpr)) return false; } // The result is a pointer to the first element of the array. @@ -6520,9 +6593,8 @@ class TemporaryExprEvaluator (public) /// Visit an expression which constructs the value of this temporary. bool VisitConstructExpr(const Expr *E) { - Result.set(E, Info.CurrentCall->Index); - return EvaluateInPlace(Info.CurrentCall->createTemporary(E, false), - Info, Result, E); + APValue &Value = createTemporary(E, false, Result, *Info.CurrentCall); + return EvaluateInPlace(Value, Info, Result, E); } bool VisitCastExpr(const CastExpr *E) { @@ -8007,7 +8079,8 @@ static bool HasSameBase(const LValue &A, const LValue } return IsGlobalLValue(A.getLValueBase()) || - A.getLValueCallIndex() == B.getLValueCallIndex(); + (A.getLValueCallIndex() == B.getLValueCallIndex() && + A.getLValueVersion() == B.getLValueVersion()); } /// \brief Determine whether this is a pointer past the end of the complete @@ -9941,15 +10014,13 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, return true; } else if (T->isArrayType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateArray(E, LV, Value, Info)) return false; Result = Value; } else if (T->isRecordType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateRecord(E, LV, Value, Info)) return false; Result = Value; @@ -9963,8 +10034,7 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, QualType Unqual = T.getAtomicUnqualifiedType(); if (Unqual->isArrayType() || Unqual->isRecordType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateAtomic(E, &LV, Value, Info)) return false; } else { @@ -10786,7 +10856,7 @@ bool Expr::isPotentialConstantExpr(const FunctionDecl // is a temporary being used as the 'this' pointer. LValue This; ImplicitValueInitExpr VIE(RD ? Info.Ctx.getRecordType(RD) : Info.Ctx.IntTy); - This.set(&VIE, Info.CurrentCall->Index); + This.set({&VIE, Info.CurrentCall->Index}); ArrayRef Args; From owner-svn-src-stable@freebsd.org Thu Dec 20 18:28:56 2018 Return-Path: Delivered-To: svn-src-stable@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 D35C0134FA1B; Thu, 20 Dec 2018 18:28:55 +0000 (UTC) (envelope-from dim@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 812AB8CBFB; Thu, 20 Dec 2018 18:28:55 +0000 (UTC) (envelope-from dim@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 734571767; Thu, 20 Dec 2018 18:28:55 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBKIStTd077447; Thu, 20 Dec 2018 18:28:55 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBKISswx077444; Thu, 20 Dec 2018 18:28:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201812201828.wBKISswx077444@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 20 Dec 2018 18:28:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342281 - in stable: 11/contrib/llvm/tools/clang/include/clang/AST 11/contrib/llvm/tools/clang/lib/AST 12/contrib/llvm/tools/clang/include/clang/AST 12/contrib/llvm/tools/clang/lib/AST X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 11/contrib/llvm/tools/clang/include/clang/AST 11/contrib/llvm/tools/clang/lib/AST 12/contrib/llvm/tools/clang/include/clang/AST 12/contrib/llvm/tools/clang/lib/AST X-SVN-Commit-Revision: 342281 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 812AB8CBFB 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.976,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Dec 2018 18:28:56 -0000 Author: dim Date: Thu Dec 20 18:28:53 2018 New Revision: 342281 URL: https://svnweb.freebsd.org/changeset/base/342281 Log: Pull in r329671 from upstream clang trunk (by Akira Hatanaka): [ExprConstant] Use an AST node and a version number as a key to create an APValue and retrieve it from map Temporaries. The version number is needed when a single AST node is visited multiple times and is used to create APValues that are required to be distinct from each other (for example, MaterializeTemporaryExprs in default arguments and VarDecls in loops). rdar://problem/36505742 Differential Revision: https://reviews.llvm.org/D42776 This should fix 'Assertion failed: (Result.isUninit() && "temporary created multiple times"), function createTemporary' errors (if assertions are enabled, otherwise the compiler internal state might go bad), when building the graphics/rawtherapee port. Direct commit to stable/11 and stable/12, since head already has clang 7.0.1, which includes this change. PR: 234144 Modified: stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Changes in other areas also in this revision: Modified: stable/12/contrib/llvm/tools/clang/include/clang/AST/APValue.h stable/12/contrib/llvm/tools/clang/lib/AST/APValue.cpp stable/12/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Modified: stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h ============================================================================== --- stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h Thu Dec 20 16:05:30 2018 (r342280) +++ stable/11/contrib/llvm/tools/clang/include/clang/AST/APValue.h Thu Dec 20 18:28:53 2018 (r342281) @@ -53,7 +53,58 @@ class APValue { (public) MemberPointer, AddrLabelDiff }; - typedef llvm::PointerUnion LValueBase; + + class LValueBase { + public: + typedef llvm::PointerUnion PtrTy; + + LValueBase() : CallIndex(0), Version(0) {} + + template + LValueBase(T P, unsigned I = 0, unsigned V = 0) + : Ptr(P), CallIndex(I), Version(V) {} + + template + bool is() const { return Ptr.is(); } + + template + T get() const { return Ptr.get(); } + + template + T dyn_cast() const { return Ptr.dyn_cast(); } + + void *getOpaqueValue() const; + + bool isNull() const; + + explicit operator bool () const; + + PtrTy getPointer() const { + return Ptr; + } + + unsigned getCallIndex() const { + return CallIndex; + } + + void setCallIndex(unsigned Index) { + CallIndex = Index; + } + + unsigned getVersion() const { + return Version; + } + + bool operator==(const LValueBase &Other) const { + return Ptr == Other.Ptr && CallIndex == Other.CallIndex && + Version == Other.Version; + } + + private: + PtrTy Ptr; + unsigned CallIndex, Version; + }; + typedef llvm::PointerIntPair BaseOrMemberType; union LValuePathEntry { /// BaseOrMember - The FieldDecl or CXXRecordDecl indicating the next item @@ -135,15 +186,15 @@ class APValue { (public) } APValue(const APValue &RHS); APValue(APValue &&RHS) : Kind(Uninitialized) { swap(RHS); } - APValue(LValueBase B, const CharUnits &O, NoLValuePath N, unsigned CallIndex, + APValue(LValueBase B, const CharUnits &O, NoLValuePath N, bool IsNullPtr = false) : Kind(Uninitialized) { - MakeLValue(); setLValue(B, O, N, CallIndex, IsNullPtr); + MakeLValue(); setLValue(B, O, N, IsNullPtr); } APValue(LValueBase B, const CharUnits &O, ArrayRef Path, - bool OnePastTheEnd, unsigned CallIndex, bool IsNullPtr = false) + bool OnePastTheEnd, bool IsNullPtr = false) : Kind(Uninitialized) { - MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, CallIndex, IsNullPtr); + MakeLValue(); setLValue(B, O, Path, OnePastTheEnd, IsNullPtr); } APValue(UninitArray, unsigned InitElts, unsigned Size) : Kind(Uninitialized) { MakeArray(InitElts, Size); @@ -255,6 +306,7 @@ class APValue { (public) bool hasLValuePath() const; ArrayRef getLValuePath() const; unsigned getLValueCallIndex() const; + unsigned getLValueVersion() const; bool isNullPointer() const; APValue &getVectorElt(unsigned I) { @@ -376,10 +428,10 @@ class APValue { (public) ((ComplexAPFloat *)(char *)Data.buffer)->Imag = std::move(I); } void setLValue(LValueBase B, const CharUnits &O, NoLValuePath, - unsigned CallIndex, bool IsNullPtr); + bool IsNullPtr); void setLValue(LValueBase B, const CharUnits &O, ArrayRef Path, bool OnePastTheEnd, - unsigned CallIndex, bool IsNullPtr); + bool IsNullPtr); void setUnion(const FieldDecl *Field, const APValue &Value) { assert(isUnion() && "Invalid accessor"); ((UnionData*)(char*)Data.buffer)->Field = Field; @@ -450,5 +502,15 @@ class APValue { (public) }; } // end namespace clang. + +namespace llvm { +template<> struct DenseMapInfo { + static clang::APValue::LValueBase getEmptyKey(); + static clang::APValue::LValueBase getTombstoneKey(); + static unsigned getHashValue(const clang::APValue::LValueBase &Base); + static bool isEqual(const clang::APValue::LValueBase &LHS, + const clang::APValue::LValueBase &RHS); +}; +} #endif Modified: stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp Thu Dec 20 16:05:30 2018 (r342280) +++ stable/11/contrib/llvm/tools/clang/lib/AST/APValue.cpp Thu Dec 20 18:28:53 2018 (r342281) @@ -23,14 +23,57 @@ using namespace clang; namespace { struct LVBase { - llvm::PointerIntPair BaseAndIsOnePastTheEnd; + APValue::LValueBase Base; CharUnits Offset; unsigned PathLength; - unsigned CallIndex; - bool IsNullPtr; + bool IsNullPtr : 1; + bool IsOnePastTheEnd : 1; }; } +void *APValue::LValueBase::getOpaqueValue() const { + return Ptr.getOpaqueValue(); +} + +bool APValue::LValueBase::isNull() const { + return Ptr.isNull(); +} + +APValue::LValueBase::operator bool () const { + return static_cast(Ptr); +} + +clang::APValue::LValueBase +llvm::DenseMapInfo::getEmptyKey() { + return clang::APValue::LValueBase( + DenseMapInfo::getEmptyKey(), + DenseMapInfo::getEmptyKey(), + DenseMapInfo::getEmptyKey()); +} + +clang::APValue::LValueBase +llvm::DenseMapInfo::getTombstoneKey() { + return clang::APValue::LValueBase( + DenseMapInfo::getTombstoneKey(), + DenseMapInfo::getTombstoneKey(), + DenseMapInfo::getTombstoneKey()); +} + +unsigned llvm::DenseMapInfo::getHashValue( + const clang::APValue::LValueBase &Base) { + llvm::FoldingSetNodeID ID; + ID.AddPointer(Base.getOpaqueValue()); + ID.AddInteger(Base.getCallIndex()); + ID.AddInteger(Base.getVersion()); + return ID.ComputeHash(); +} + +bool llvm::DenseMapInfo::isEqual( + const clang::APValue::LValueBase &LHS, + const clang::APValue::LValueBase &RHS) { + return LHS == RHS; +} + struct APValue::LV : LVBase { static const unsigned InlinePathSpace = (DataSize - sizeof(LVBase)) / sizeof(LValuePathEntry); @@ -150,11 +193,10 @@ APValue::APValue(const APValue &RHS) : Kind(Uninitiali MakeLValue(); if (RHS.hasLValuePath()) setLValue(RHS.getLValueBase(), RHS.getLValueOffset(), RHS.getLValuePath(), - RHS.isLValueOnePastTheEnd(), RHS.getLValueCallIndex(), - RHS.isNullPointer()); + RHS.isLValueOnePastTheEnd(), RHS.isNullPointer()); else setLValue(RHS.getLValueBase(), RHS.getLValueOffset(), NoLValuePath(), - RHS.getLValueCallIndex(), RHS.isNullPointer()); + RHS.isNullPointer()); break; case Array: MakeArray(RHS.getArrayInitializedElts(), RHS.getArraySize()); @@ -552,12 +594,12 @@ std::string APValue::getAsString(ASTContext &Ctx, Qual const APValue::LValueBase APValue::getLValueBase() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const void*)Data.buffer)->BaseAndIsOnePastTheEnd.getPointer(); + return ((const LV*)(const void*)Data.buffer)->Base; } bool APValue::isLValueOnePastTheEnd() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const void*)Data.buffer)->BaseAndIsOnePastTheEnd.getInt(); + return ((const LV*)(const void*)Data.buffer)->IsOnePastTheEnd; } CharUnits &APValue::getLValueOffset() { @@ -578,35 +620,38 @@ ArrayRef APValue::getLValueP unsigned APValue::getLValueCallIndex() const { assert(isLValue() && "Invalid accessor"); - return ((const LV*)(const char*)Data.buffer)->CallIndex; + return ((const LV*)(const char*)Data.buffer)->Base.getCallIndex(); } +unsigned APValue::getLValueVersion() const { + assert(isLValue() && "Invalid accessor"); + return ((const LV*)(const char*)Data.buffer)->Base.getVersion(); +} + bool APValue::isNullPointer() const { assert(isLValue() && "Invalid usage"); return ((const LV*)(const char*)Data.buffer)->IsNullPtr; } void APValue::setLValue(LValueBase B, const CharUnits &O, NoLValuePath, - unsigned CallIndex, bool IsNullPtr) { + bool IsNullPtr) { assert(isLValue() && "Invalid accessor"); LV &LVal = *((LV*)(char*)Data.buffer); - LVal.BaseAndIsOnePastTheEnd.setPointer(B); - LVal.BaseAndIsOnePastTheEnd.setInt(false); + LVal.Base = B; + LVal.IsOnePastTheEnd = false; LVal.Offset = O; - LVal.CallIndex = CallIndex; LVal.resizePath((unsigned)-1); LVal.IsNullPtr = IsNullPtr; } void APValue::setLValue(LValueBase B, const CharUnits &O, ArrayRef Path, bool IsOnePastTheEnd, - unsigned CallIndex, bool IsNullPtr) { + bool IsNullPtr) { assert(isLValue() && "Invalid accessor"); LV &LVal = *((LV*)(char*)Data.buffer); - LVal.BaseAndIsOnePastTheEnd.setPointer(B); - LVal.BaseAndIsOnePastTheEnd.setInt(IsOnePastTheEnd); + LVal.Base = B; + LVal.IsOnePastTheEnd = IsOnePastTheEnd; LVal.Offset = O; - LVal.CallIndex = CallIndex; LVal.resizePath(Path.size()); memcpy(LVal.getPath(), Path.data(), Path.size() * sizeof(LValuePathEntry)); LVal.IsNullPtr = IsNullPtr; Modified: stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp ============================================================================== --- stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Thu Dec 20 16:05:30 2018 (r342280) +++ stable/11/contrib/llvm/tools/clang/lib/AST/ExprConstant.cpp Thu Dec 20 18:28:53 2018 (r342281) @@ -446,8 +446,8 @@ namespace { // Note that we intentionally use std::map here so that references to // values are stable. - typedef std::map MapTy; - typedef MapTy::const_iterator temp_iterator; + typedef std::pair MapKeyTy; + typedef std::map MapTy; /// Temporaries - Temporary lvalues materialized within this stack frame. MapTy Temporaries; @@ -457,6 +457,20 @@ namespace { /// Index - The call index of this call. unsigned Index; + /// The stack of integers for tracking version numbers for temporaries. + SmallVector TempVersionStack = {1}; + unsigned CurTempVersion = TempVersionStack.back(); + + unsigned getTempVersion() const { return TempVersionStack.back(); } + + void pushTempVersion() { + TempVersionStack.push_back(++CurTempVersion); + } + + void popTempVersion() { + TempVersionStack.pop_back(); + } + // FIXME: Adding this to every 'CallStackFrame' may have a nontrivial impact // on the overall stack usage of deeply-recursing constexpr evaluataions. // (We should cache this map rather than recomputing it repeatedly.) @@ -473,10 +487,36 @@ namespace { APValue *Arguments); ~CallStackFrame(); - APValue *getTemporary(const void *Key) { - MapTy::iterator I = Temporaries.find(Key); - return I == Temporaries.end() ? nullptr : &I->second; + // Return the temporary for Key whose version number is Version. + APValue *getTemporary(const void *Key, unsigned Version) { + MapKeyTy KV(Key, Version); + auto LB = Temporaries.lower_bound(KV); + if (LB != Temporaries.end() && LB->first == KV) + return &LB->second; + // Pair (Key,Version) wasn't found in the map. Check that no elements + // in the map have 'Key' as their key. + assert((LB == Temporaries.end() || LB->first.first != Key) && + (LB == Temporaries.begin() || std::prev(LB)->first.first != Key) && + "Element with key 'Key' found in map"); + return nullptr; } + + // Return the current temporary for Key in the map. + APValue *getCurrentTemporary(const void *Key) { + auto UB = Temporaries.upper_bound(MapKeyTy(Key, UINT_MAX)); + if (UB != Temporaries.begin() && std::prev(UB)->first.first == Key) + return &std::prev(UB)->second; + return nullptr; + } + + // Return the version number of the current temporary for Key. + unsigned getCurrentTemporaryVersion(const void *Key) const { + auto UB = Temporaries.upper_bound(MapKeyTy(Key, UINT_MAX)); + if (UB != Temporaries.begin() && std::prev(UB)->first.first == Key) + return std::prev(UB)->first.second; + return 0; + } + APValue &createTemporary(const void *Key, bool IsLifetimeExtended); }; @@ -606,7 +646,8 @@ namespace { /// EvaluatingObject - Pair of the AST node that an lvalue represents and /// the call index that that lvalue was allocated in. - typedef std::pair EvaluatingObject; + typedef std::pair> + EvaluatingObject; /// EvaluatingConstructors - Set of objects that are currently being /// constructed. @@ -625,8 +666,10 @@ namespace { } }; - bool isEvaluatingConstructor(APValue::LValueBase Decl, unsigned CallIndex) { - return EvaluatingConstructors.count(EvaluatingObject(Decl, CallIndex)); + bool isEvaluatingConstructor(APValue::LValueBase Decl, unsigned CallIndex, + unsigned Version) { + return EvaluatingConstructors.count( + EvaluatingObject(Decl, {CallIndex, Version})); } /// The current array initialization index, if we're performing array @@ -722,7 +765,7 @@ namespace { void setEvaluatingDecl(APValue::LValueBase Base, APValue &Value) { EvaluatingDecl = Base; EvaluatingDeclValue = &Value; - EvaluatingConstructors.insert({Base, 0}); + EvaluatingConstructors.insert({Base, {0, 0}}); } const LangOptions &getLangOpts() const { return Ctx.getLangOpts(); } @@ -1086,11 +1129,16 @@ namespace { unsigned OldStackSize; public: ScopeRAII(EvalInfo &Info) - : Info(Info), OldStackSize(Info.CleanupStack.size()) {} + : Info(Info), OldStackSize(Info.CleanupStack.size()) { + // Push a new temporary version. This is needed to distinguish between + // temporaries created in different iterations of a loop. + Info.CurrentCall->pushTempVersion(); + } ~ScopeRAII() { // Body moved to a static method to encourage the compiler to inline away // instances of this class. cleanup(Info, OldStackSize); + Info.CurrentCall->popTempVersion(); } private: static void cleanup(EvalInfo &Info, unsigned OldStackSize) { @@ -1170,7 +1218,8 @@ CallStackFrame::~CallStackFrame() { APValue &CallStackFrame::createTemporary(const void *Key, bool IsLifetimeExtended) { - APValue &Result = Temporaries[Key]; + unsigned Version = Info.CurrentCall->getTempVersion(); + APValue &Result = Temporaries[MapKeyTy(Key, Version)]; assert(Result.isUninit() && "temporary created multiple times"); Info.CleanupStack.push_back(Cleanup(&Result, IsLifetimeExtended)); return Result; @@ -1262,27 +1311,27 @@ namespace { struct LValue { APValue::LValueBase Base; CharUnits Offset; - unsigned InvalidBase : 1; - unsigned CallIndex : 31; SubobjectDesignator Designator; - bool IsNullPtr; + bool IsNullPtr : 1; + bool InvalidBase : 1; const APValue::LValueBase getLValueBase() const { return Base; } CharUnits &getLValueOffset() { return Offset; } const CharUnits &getLValueOffset() const { return Offset; } - unsigned getLValueCallIndex() const { return CallIndex; } SubobjectDesignator &getLValueDesignator() { return Designator; } const SubobjectDesignator &getLValueDesignator() const { return Designator;} bool isNullPointer() const { return IsNullPtr;} + unsigned getLValueCallIndex() const { return Base.getCallIndex(); } + unsigned getLValueVersion() const { return Base.getVersion(); } + void moveInto(APValue &V) const { if (Designator.Invalid) - V = APValue(Base, Offset, APValue::NoLValuePath(), CallIndex, - IsNullPtr); + V = APValue(Base, Offset, APValue::NoLValuePath(), IsNullPtr); else { assert(!InvalidBase && "APValues can't handle invalid LValue bases"); V = APValue(Base, Offset, Designator.Entries, - Designator.IsOnePastTheEnd, CallIndex, IsNullPtr); + Designator.IsOnePastTheEnd, IsNullPtr); } } void setFrom(ASTContext &Ctx, const APValue &V) { @@ -1290,12 +1339,11 @@ namespace { Base = V.getLValueBase(); Offset = V.getLValueOffset(); InvalidBase = false; - CallIndex = V.getLValueCallIndex(); Designator = SubobjectDesignator(Ctx, V); IsNullPtr = V.isNullPointer(); } - void set(APValue::LValueBase B, unsigned I = 0, bool BInvalid = false) { + void set(APValue::LValueBase B, bool BInvalid = false) { #ifndef NDEBUG // We only allow a few types of invalid bases. Enforce that here. if (BInvalid) { @@ -1308,7 +1356,6 @@ namespace { Base = B; Offset = CharUnits::fromQuantity(0); InvalidBase = BInvalid; - CallIndex = I; Designator = SubobjectDesignator(getType(B)); IsNullPtr = false; } @@ -1317,13 +1364,12 @@ namespace { Base = (Expr *)nullptr; Offset = CharUnits::fromQuantity(TargetVal); InvalidBase = false; - CallIndex = 0; Designator = SubobjectDesignator(PointerTy->getPointeeType()); IsNullPtr = true; } void setInvalid(APValue::LValueBase B, unsigned I = 0) { - set(B, I, true); + set(B, true); } // Check that this LValue is not based on a null pointer. If it is, produce @@ -1525,6 +1571,15 @@ static bool EvaluateAsRValue(EvalInfo &Info, const Exp // Misc utilities //===----------------------------------------------------------------------===// +/// A helper function to create a temporary and set an LValue. +template +static APValue &createTemporary(const KeyTy *Key, bool IsLifetimeExtended, + LValue &LV, CallStackFrame &Frame) { + LV.set({Key, Frame.Info.CurrentCall->Index, + Frame.Info.CurrentCall->getTempVersion()}); + return Frame.createTemporary(Key, IsLifetimeExtended); +} + /// Negate an APSInt in place, converting it to a signed form if necessary, and /// preserving its value (by extending by up to one bit as needed). static void negateAsSigned(APSInt &Int) { @@ -1854,7 +1909,7 @@ static const ValueDecl *GetLValueBaseDecl(const LValue } static bool IsLiteralLValue(const LValue &Value) { - if (Value.CallIndex) + if (Value.getLValueCallIndex()) return false; const Expr *E = Value.Base.dyn_cast(); return E && !isa(E); @@ -2404,7 +2459,7 @@ static bool handleLValueToRValueConversion(EvalInfo &I /// \param Result Filled in with a pointer to the value of the variable. static bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, - APValue *&Result) { + APValue *&Result, const LValue *LVal) { // If this is a parameter to an active constexpr function call, perform // argument substitution. @@ -2423,7 +2478,8 @@ static bool evaluateVarDeclInit(EvalInfo &Info, const // If this is a local variable, dig out its value. if (Frame) { - Result = Frame->getTemporary(VD); + Result = LVal ? Frame->getTemporary(VD, LVal->getLValueVersion()) + : Frame->getCurrentTemporary(VD); if (!Result) { // Assume variables referenced within a lambda's call operator that were // not declared within the call operator are captures and during checking @@ -3000,8 +3056,8 @@ static CompleteObject findCompleteObject(EvalInfo &Inf } CallStackFrame *Frame = nullptr; - if (LVal.CallIndex) { - Frame = Info.getCallFrame(LVal.CallIndex); + if (LVal.getLValueCallIndex()) { + Frame = Info.getCallFrame(LVal.getLValueCallIndex()); if (!Frame) { Info.FFDiag(E, diag::note_constexpr_lifetime_ended, 1) << AK << LVal.Base.is(); @@ -3113,7 +3169,7 @@ static CompleteObject findCompleteObject(EvalInfo &Inf } } - if (!evaluateVarDeclInit(Info, E, VD, Frame, BaseVal)) + if (!evaluateVarDeclInit(Info, E, VD, Frame, BaseVal, &LVal)) return CompleteObject(); } else { const Expr *Base = LVal.Base.dyn_cast(); @@ -3155,7 +3211,7 @@ static CompleteObject findCompleteObject(EvalInfo &Inf return CompleteObject(); } } else { - BaseVal = Frame->getTemporary(Base); + BaseVal = Frame->getTemporary(Base, LVal.Base.getVersion()); assert(BaseVal && "missing value for temporary"); } @@ -3175,7 +3231,9 @@ static CompleteObject findCompleteObject(EvalInfo &Inf // During the construction of an object, it is not yet 'const'. // FIXME: This doesn't do quite the right thing for const subobjects of the // object under construction. - if (Info.isEvaluatingConstructor(LVal.getLValueBase(), LVal.CallIndex)) { + if (Info.isEvaluatingConstructor(LVal.getLValueBase(), + LVal.getLValueCallIndex(), + LVal.getLValueVersion())) { BaseType = Info.Ctx.getCanonicalType(BaseType); BaseType.removeLocalConst(); } @@ -3212,7 +3270,7 @@ static bool handleLValueToRValueConversion(EvalInfo &I // Check for special cases where there is no existing APValue to look at. const Expr *Base = LVal.Base.dyn_cast(); - if (Base && !LVal.CallIndex && !Type.isVolatileQualified()) { + if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) { if (const CompoundLiteralExpr *CLE = dyn_cast(Base)) { // In C99, a CompoundLiteralExpr is an lvalue, and we defer evaluating the // initializer until now for such expressions. Such an expression can't be @@ -3715,8 +3773,7 @@ static bool EvaluateVarDecl(EvalInfo &Info, const VarD return true; LValue Result; - Result.set(VD, Info.CurrentCall->Index); - APValue &Val = Info.CurrentCall->createTemporary(VD, true); + APValue &Val = createTemporary(VD, true, Result, *Info.CurrentCall); const Expr *InitE = VD->getInit(); if (!InitE) { @@ -3772,6 +3829,19 @@ struct StmtResult { /// The location containing the result, if any (used to support RVO). const LValue *Slot; }; + +struct TempVersionRAII { + CallStackFrame &Frame; + + TempVersionRAII(CallStackFrame &Frame) : Frame(Frame) { + Frame.pushTempVersion(); + } + + ~TempVersionRAII() { + Frame.popTempVersion(); + } +}; + } static EvalStmtResult EvaluateStmt(StmtResult &Result, EvalInfo &Info, @@ -4329,7 +4399,8 @@ static bool HandleConstructorCall(const Expr *E, const } EvalInfo::EvaluatingConstructorRAII EvalObj( - Info, {This.getLValueBase(), This.CallIndex}); + Info, {This.getLValueBase(), + {This.getLValueCallIndex(), This.getLValueVersion()}}); CallStackFrame Frame(Info, CallLoc, Definition, &This, ArgValues); // FIXME: Creating an APValue just to hold a nonexistent return value is @@ -4578,9 +4649,12 @@ class ExprEvaluatorBase (public) { return StmtVisitorTy::Visit(E->getResultExpr()); } bool VisitSubstNonTypeTemplateParmExpr(const SubstNonTypeTemplateParmExpr *E) { return StmtVisitorTy::Visit(E->getReplacement()); } - bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) - { return StmtVisitorTy::Visit(E->getExpr()); } + bool VisitCXXDefaultArgExpr(const CXXDefaultArgExpr *E) { + TempVersionRAII RAII(*Info.CurrentCall); + return StmtVisitorTy::Visit(E->getExpr()); + } bool VisitCXXDefaultInitExpr(const CXXDefaultInitExpr *E) { + TempVersionRAII RAII(*Info.CurrentCall); // The initializer may not have been parsed yet, or might be erroneous. if (!E->getExpr()) return Error(E); @@ -4658,7 +4732,7 @@ class ExprEvaluatorBase (public) } bool VisitOpaqueValueExpr(const OpaqueValueExpr *E) { - if (APValue *Value = Info.CurrentCall->getTemporary(E)) + if (APValue *Value = Info.CurrentCall->getCurrentTemporary(E)) return DerivedSuccess(*Value, E); const Expr *Source = E->getSourceExpr(); @@ -5216,14 +5290,15 @@ bool LValueExprEvaluator::VisitVarDecl(const Expr *E, if (!VD->getType()->isReferenceType()) { if (Frame) { - Result.set(VD, Frame->Index); + Result.set({VD, Frame->Index, + Info.CurrentCall->getCurrentTemporaryVersion(VD)}); return true; } return Success(VD); } APValue *V; - if (!evaluateVarDeclInit(Info, E, VD, Frame, V)) + if (!evaluateVarDeclInit(Info, E, VD, Frame, V, nullptr)) return false; if (V->isUninit()) { if (!Info.checkingPotentialConstantExpression()) @@ -5255,9 +5330,8 @@ bool LValueExprEvaluator::VisitMaterializeTemporaryExp *Value = APValue(); Result.set(E); } else { - Value = &Info.CurrentCall-> - createTemporary(E, E->getStorageDuration() == SD_Automatic); - Result.set(E, Info.CurrentCall->Index); + Value = &createTemporary(E, E->getStorageDuration() == SD_Automatic, Result, + *Info.CurrentCall); } QualType Type = Inner->getType(); @@ -5736,7 +5810,6 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExp Result.Base = (Expr*)nullptr; Result.InvalidBase = false; Result.Offset = CharUnits::fromQuantity(N); - Result.CallIndex = 0; Result.Designator.setInvalid(); Result.IsNullPtr = false; return true; @@ -5752,9 +5825,9 @@ bool PointerExprEvaluator::VisitCastExpr(const CastExp if (!evaluateLValue(SubExpr, Result)) return false; } else { - Result.set(SubExpr, Info.CurrentCall->Index); - if (!EvaluateInPlace(Info.CurrentCall->createTemporary(SubExpr, false), - Info, Result, SubExpr)) + APValue &Value = createTemporary(SubExpr, false, Result, + *Info.CurrentCall); + if (!EvaluateInPlace(Value, Info, Result, SubExpr)) return false; } // The result is a pointer to the first element of the array. @@ -6520,9 +6593,8 @@ class TemporaryExprEvaluator (public) /// Visit an expression which constructs the value of this temporary. bool VisitConstructExpr(const Expr *E) { - Result.set(E, Info.CurrentCall->Index); - return EvaluateInPlace(Info.CurrentCall->createTemporary(E, false), - Info, Result, E); + APValue &Value = createTemporary(E, false, Result, *Info.CurrentCall); + return EvaluateInPlace(Value, Info, Result, E); } bool VisitCastExpr(const CastExpr *E) { @@ -8007,7 +8079,8 @@ static bool HasSameBase(const LValue &A, const LValue } return IsGlobalLValue(A.getLValueBase()) || - A.getLValueCallIndex() == B.getLValueCallIndex(); + (A.getLValueCallIndex() == B.getLValueCallIndex() && + A.getLValueVersion() == B.getLValueVersion()); } /// \brief Determine whether this is a pointer past the end of the complete @@ -9941,15 +10014,13 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, return true; } else if (T->isArrayType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateArray(E, LV, Value, Info)) return false; Result = Value; } else if (T->isRecordType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateRecord(E, LV, Value, Info)) return false; Result = Value; @@ -9963,8 +10034,7 @@ static bool Evaluate(APValue &Result, EvalInfo &Info, QualType Unqual = T.getAtomicUnqualifiedType(); if (Unqual->isArrayType() || Unqual->isRecordType()) { LValue LV; - LV.set(E, Info.CurrentCall->Index); - APValue &Value = Info.CurrentCall->createTemporary(E, false); + APValue &Value = createTemporary(E, false, LV, *Info.CurrentCall); if (!EvaluateAtomic(E, &LV, Value, Info)) return false; } else { @@ -10786,7 +10856,7 @@ bool Expr::isPotentialConstantExpr(const FunctionDecl // is a temporary being used as the 'this' pointer. LValue This; ImplicitValueInitExpr VIE(RD ? Info.Ctx.getRecordType(RD) : Info.Ctx.IntTy); - This.set(&VIE, Info.CurrentCall->Index); + This.set({&VIE, Info.CurrentCall->Index}); ArrayRef Args; From owner-svn-src-stable@freebsd.org Fri Dec 21 01:58:04 2018 Return-Path: Delivered-To: svn-src-stable@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 2F5501338AFD; Fri, 21 Dec 2018 01:58:04 +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 D1C9D80550; Fri, 21 Dec 2018 01:58:03 +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 BF6126844; Fri, 21 Dec 2018 01:58:03 +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 wBL1w3rR015642; Fri, 21 Dec 2018 01:58:03 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL1w2lW015634; Fri, 21 Dec 2018 01:58:02 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812210158.wBL1w2lW015634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 21 Dec 2018 01:58:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342291 - in stable/12/contrib/sqlite3: . tea X-SVN-Group: stable-12 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/12/contrib/sqlite3: . tea X-SVN-Commit-Revision: 342291 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D1C9D80550 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.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 01:58:04 -0000 Author: cy Date: Fri Dec 21 01:58:01 2018 New Revision: 342291 URL: https://svnweb.freebsd.org/changeset/base/342291 Log: MFC r342183: Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000) PR: 234113 Security: https://blade.tencent.com/magellan/index_en.html No known CVE was apparently registered. Added: stable/12/contrib/sqlite3/Makefile.fallback - copied unchanged from r342183, head/contrib/sqlite3/Makefile.fallback stable/12/contrib/sqlite3/tea/ - copied from r342183, head/contrib/sqlite3/tea/ Modified: stable/12/contrib/sqlite3/Makefile.am stable/12/contrib/sqlite3/Makefile.in stable/12/contrib/sqlite3/Makefile.msc stable/12/contrib/sqlite3/configure stable/12/contrib/sqlite3/configure.ac stable/12/contrib/sqlite3/shell.c stable/12/contrib/sqlite3/sqlite3.c stable/12/contrib/sqlite3/sqlite3.h stable/12/contrib/sqlite3/sqlite3ext.h Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/sqlite3/Makefile.am ============================================================================== --- stable/12/contrib/sqlite3/Makefile.am Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/Makefile.am Fri Dec 21 01:58:01 2018 (r342291) @@ -1,6 +1,5 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @ZLIB_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE - +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -14,7 +13,7 @@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_ include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Copied: stable/12/contrib/sqlite3/Makefile.fallback (from r342183, head/contrib/sqlite3/Makefile.fallback) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/sqlite3/Makefile.fallback Fri Dec 21 01:58:01 2018 (r342291, copy of r342183, head/contrib/sqlite3/Makefile.fallback) @@ -0,0 +1,19 @@ +#!/usr/bin/make +# +# If the configure script does not work, then this Makefile is available +# as a backup. Manually configure the variables below. +# +# Note: This makefile works out-of-the-box on MacOS 10.2 (Jaguar) +# +CC = gcc +CFLAGS = -O0 -I. +LIBS = -lz +COPTS += -D_BSD_SOURCE +COPTS += -DSQLITE_ENABLE_LOCKING_STYLE=0 +COPTS += -DSQLITE_THREADSAFE=0 +COPTS += -DSQLITE_OMIT_LOAD_EXTENSION +COPTS += -DSQLITE_WITHOUT_ZONEMALLOC +COPTS += -DSQLITE_ENABLE_RTREE + +sqlite3: shell.c sqlite3.c + $(CC) $(CFLAGS) $(COPTS) -o sqlite3 shell.c sqlite3.c $(LIBS) Modified: stable/12/contrib/sqlite3/Makefile.in ============================================================================== --- stable/12/contrib/sqlite3/Makefile.in Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/Makefile.in Fri Dec 21 01:58:01 2018 (r342291) @@ -260,7 +260,6 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ -DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -268,14 +267,12 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ FGREP = @FGREP@ -FTS5_FLAGS = @FTS5_FLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON1_FLAGS = @JSON1_FLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -305,14 +302,11 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ -SESSION_FLAGS = @SESSION_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SHELL_CFLAGS = @SHELL_CFLAGS@ STRIP = @STRIP@ -THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ -ZLIB_FLAGS = @ZLIB_FLAGS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ @@ -365,7 +359,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @ZLIB_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -375,7 +369,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 Modified: stable/12/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/12/contrib/sqlite3/Makefile.msc Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/Makefile.msc Fri Dec 21 01:58:01 2018 (r342291) @@ -277,6 +277,12 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb !IF $(MINIMAL_AMALGAMATION)==0 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 !ENDIF @@ -928,10 +934,9 @@ LIBRESOBJS = # when the shell is not being dynamically linked. # !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_DBSTAT_VTAB -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC -DSQLITE_INTROSPECTION_PRAGMAS -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_RTREE +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 !ENDIF @@ -966,7 +971,7 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) Modified: stable/12/contrib/sqlite3/configure ============================================================================== --- stable/12/contrib/sqlite3/configure Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/configure Fri Dec 21 01:58:01 2018 (r342291) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.23.1. +# Generated by GNU Autoconf 2.69 for sqlite 3.26.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.23.1' -PACKAGE_STRING='sqlite 3.23.1' +PACKAGE_VERSION='3.26.0' +PACKAGE_STRING='sqlite 3.26.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -637,13 +637,7 @@ am__EXEEXT_TRUE LTLIBOBJS LIBOBJS SHELL_CFLAGS -ZLIB_FLAGS EXTRA_SHELL_OBJ -SESSION_FLAGS -JSON1_FLAGS -FTS5_FLAGS -DYNAMIC_EXTENSION_FLAGS -THREADSAFE_FLAGS READLINE_LIBS BUILD_CFLAGS CPP @@ -777,9 +771,13 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_fts4 +enable_fts3 enable_fts5 enable_json1 +enable_rtree enable_session +enable_debug enable_static_shell ' ac_precious_vars='build_alias @@ -1332,7 +1330,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.23.1 to adapt to many kinds of systems. +\`configure' configures sqlite 3.26.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1402,7 +1400,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.23.1:";; + short | recursive ) echo "Configuration of sqlite 3.26.0:";; esac cat <<\_ACEOF @@ -1427,9 +1425,13 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] - --enable-fts5 include fts5 support [default=no] - --enable-json1 include json1 support [default=no] + --enable-fts4 include fts4 support [default=yes] + --enable-fts3 include fts3 support [default=no] + --enable-fts5 include fts5 support [default=yes] + --enable-json1 include json1 support [default=yes] + --enable-rtree include rtree support [default=yes] --enable-session enable the session extension [default=no] + --enable-debug build with debugging features enabled [default=no] --enable-static-shell statically link libsqlite3 into shell tool [default=yes] @@ -1523,7 +1525,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.23.1 +sqlite configure 3.26.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1938,7 +1940,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.23.1, which was +It was created by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2804,7 +2806,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.23.1' + VERSION='3.26.0' cat >>confdefs.h <<_ACEOF @@ -13040,6 +13042,7 @@ fi ac_config_files="$ac_config_files Makefile sqlite3.pc" +BUILD_CFLAGS= #------------------------------------------------------------------------- @@ -13304,9 +13307,8 @@ else enable_threadsafe=yes fi -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : @@ -13420,7 +13422,6 @@ if test "$ac_res" != no; then : fi fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13491,23 +13492,50 @@ if test "$ac_res" != no; then : fi else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to support dynamic extensions" >&5 $as_echo_n "checking for whether to support dynamic extensions... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dynamic_extensions" >&5 $as_echo "$enable_dynamic_extensions" >&6; } +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +# Check whether --enable-fts4 was given. +if test "${enable_fts4+set}" = set; then : + enableval=$enable_fts4; +else + enable_fts4=yes +fi +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +# Check whether --enable-fts3 was given. +if test "${enable_fts3+set}" = set; then : + enableval=$enable_fts3; +fi + +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # # Check whether --enable-fts5 was given. if test "${enable_fts5+set}" = set; then : enableval=$enable_fts5; else - enable_fts5=no + enable_fts5=yes fi if test x"$enable_fts5" = "xyes"; then @@ -13567,9 +13595,8 @@ if test "$ac_res" != no; then : fi - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13579,32 +13606,57 @@ fi if test "${enable_json1+set}" = set; then : enableval=$enable_json1; else - enable_json1=no + enable_json1=yes fi if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +# Check whether --enable-rtree was given. +if test "${enable_rtree+set}" = set; then : + enableval=$enable_rtree; +else + enable_rtree=yes +fi +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # # Check whether --enable-session was given. if test "${enable_session+set}" = set; then : enableval=$enable_session; -else - enable_session=no fi if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +fi +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # # Check whether --enable-static-shell was given. @@ -13694,7 +13746,7 @@ $as_echo "$ac_cv_search_deflate" >&6; } ac_res=$ac_cv_search_deflate if test "$ac_res" != no; then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" - ZLIB_FLAGS="-DSQLITE_HAVE_ZLIB" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB" fi @@ -13703,7 +13755,6 @@ fi done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing system" >&5 $as_echo_n "checking for library containing system... " >&6; } if ${ac_cv_search_system+:} false; then : @@ -14359,7 +14410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.23.1, which was +This file was extended by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14416,7 +14467,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.23.1 +sqlite config.status 3.26.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/12/contrib/sqlite3/configure.ac ============================================================================== --- stable/12/contrib/sqlite3/configure.ac Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/configure.ac Fri Dec 21 01:58:01 2018 (r342291) @@ -10,7 +10,7 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.23.1, http://www.sqlite.org) +AC_INIT(sqlite, 3.26.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) AC_CONFIG_AUX_DIR([.]) @@ -29,6 +29,7 @@ AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r AC_FUNC_STRERROR_R AC_CONFIG_FILES([Makefile sqlite3.pc]) +BUILD_CFLAGS= AC_SUBST(BUILD_CFLAGS) #------------------------------------------------------------------------- @@ -86,13 +87,11 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) fi -AC_SUBST(THREADSAFE_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -104,51 +103,92 @@ AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( if test x"$enable_dynamic_extensions" != "xno"; then AC_SEARCH_LIBS(dlopen, dl) else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) -AC_SUBST(DYNAMIC_EXTENSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +AC_ARG_ENABLE(fts4, [AS_HELP_STRING( + [--enable-fts4], [include fts4 support [default=yes]])], + [], [enable_fts4=yes]) +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +AC_ARG_ENABLE(fts3, [AS_HELP_STRING( + [--enable-fts3], [include fts3 support [default=no]])], + [], []) +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # AC_ARG_ENABLE(fts5, [AS_HELP_STRING( - [--enable-fts5], [include fts5 support [default=no]])], - [], [enable_fts5=no]) + [--enable-fts5], [include fts5 support [default=yes]])], + [], [enable_fts5=yes]) if test x"$enable_fts5" = "xyes"; then AC_SEARCH_LIBS(log, m) - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi -AC_SUBST(FTS5_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- # --enable-json1 # AC_ARG_ENABLE(json1, [AS_HELP_STRING( - [--enable-json1], [include json1 support [default=no]])], - [], [enable_json1=no]) + [--enable-json1], [include json1 support [default=yes]])], + [],[enable_json1=yes]) if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi -AC_SUBST(JSON1_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +AC_ARG_ENABLE(rtree, [AS_HELP_STRING( + [--enable-rtree], [include rtree support [default=yes]])], + [], [enable_rtree=yes]) +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], - [], [enable_session=no]) + [], []) if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi -AC_SUBST(SESSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +AC_ARG_ENABLE(debug, [AS_HELP_STRING( + [--enable-debug], [build with debugging features enabled [default=no]])], + [], []) +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( @@ -165,9 +205,8 @@ AC_SUBST(EXTRA_SHELL_OBJ) AC_CHECK_FUNCS(posix_fallocate) AC_CHECK_HEADERS(zlib.h,[ - AC_SEARCH_LIBS(deflate,z,[ZLIB_FLAGS="-DSQLITE_HAVE_ZLIB"]) + AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"]) ]) -AC_SUBST(ZLIB_FLAGS) AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"]) AC_SUBST(SHELL_CFLAGS) Modified: stable/12/contrib/sqlite3/shell.c ============================================================================== --- stable/12/contrib/sqlite3/shell.c Fri Dec 21 01:09:25 2018 (r342290) +++ stable/12/contrib/sqlite3/shell.c Fri Dec 21 01:58:01 2018 (r342291) @@ -97,12 +97,15 @@ typedef unsigned char u8; #if (!defined(_WIN32) && !defined(WIN32)) || defined(__MINGW32__) # include # include +# define GETPID getpid # if defined(__MINGW32__) # define DIRENT dirent # ifndef S_ISLNK # define S_ISLNK(mode) (0) # endif # endif +#else +# define GETPID (int)GetCurrentProcessId #endif #include #include @@ -454,6 +457,12 @@ void utf8_printf(FILE *out, const char *zFormat, ...){ # define raw_printf fprintf #endif +/* Indicate out-of-memory and exit. */ +static void shell_out_of_memory(void){ + raw_printf(stderr,"Error: out of memory\n"); + exit(1); +} + /* ** Write I/O traces to the following stream. */ @@ -577,7 +586,7 @@ static char *local_getline(char *zLine, FILE *in){ if( n+100>nLine ){ nLine = nLine*2 + 100; zLine = realloc(zLine, nLine); - if( zLine==0 ) return 0; + if( zLine==0 ) shell_out_of_memory(); } if( fgets(&zLine[n], nLine - n, in)==0 ){ if( n==0 ){ @@ -604,10 +613,7 @@ static char *local_getline(char *zLine, FILE *in){ int nTrans = strlen30(zTrans)+1; if( nTrans>nLine ){ zLine = realloc(zLine, nTrans); - if( zLine==0 ){ - sqlite3_free(zTrans); - return 0; - } + if( zLine==0 ) shell_out_of_memory(); } memcpy(zLine, zTrans, nTrans); sqlite3_free(zTrans); @@ -754,10 +760,7 @@ static void appendText(ShellText *p, char const *zAppe if( p->n+len>=p->nAlloc ){ p->nAlloc = p->nAlloc*2 + len + 20; p->z = realloc(p->z, p->nAlloc); - if( p->z==0 ){ - memset(p, 0, sizeof(*p)); - return; - } + if( p->z==0 ) shell_out_of_memory(); } if( quote ){ @@ -786,45 +789,12 @@ static void appendText(ShellText *p, char const *zAppe ** Return '"' if quoting is required. Return 0 if no quoting is required. */ static char quoteChar(const char *zName){ - /* All SQLite keywords, in alphabetical order */ - static const char *azKeywords[] = { - "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS", - "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", - "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT", - "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE", - "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH", - "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN", - "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF", - "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER", - "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", - "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL", - "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA", - "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", - "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT", - "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP", - "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE", - "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE", - "WITH", "WITHOUT", - }; - int i, lwr, upr, mid, c; + int i; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; } - lwr = 0; - upr = sizeof(azKeywords)/sizeof(azKeywords[0]) - 1; - while( lwr<=upr ){ - mid = (lwr+upr)/2; - c = sqlite3_stricmp(azKeywords[mid], zName); - if( c==0 ) return '"'; - if( c<0 ){ - lwr = mid+1; - }else{ - upr = mid-1; - } - } - return 0; + return sqlite3_keyword_check(zName, i) ? '"' : 0; } /* @@ -1347,7 +1317,7 @@ INT closedir( ** ****************************************************************************** ** -** This SQLite extension implements a functions that compute SHA1 hashes. +** This SQLite extension implements functions that compute SHA3 hashes. ** Two SQL functions are implemented: ** ** sha3(X,SIZE) @@ -2158,8 +2128,19 @@ SQLITE_EXTENSION_INIT1 #include +/* +** Structure of the fsdir() table-valued function +*/ + /* 0 1 2 3 4 5 */ #define FSDIR_SCHEMA "(name,mode,mtime,data,path HIDDEN,dir HIDDEN)" +#define FSDIR_COLUMN_NAME 0 /* Name of the file */ +#define FSDIR_COLUMN_MODE 1 /* Access mode */ +#define FSDIR_COLUMN_MTIME 2 /* Last modification time */ +#define FSDIR_COLUMN_DATA 3 /* File content */ +#define FSDIR_COLUMN_PATH 4 /* Path to top of search */ +#define FSDIR_COLUMN_DIR 5 /* Path is relative to this directory */ + /* ** Set the result stored by context ctx to a blob containing the ** contents of file zName. @@ -2256,7 +2237,7 @@ static void statTimesToUtc( extern LPWSTR sqlite3_win32_utf8_to_unicode(const char*); zUnicodeName = sqlite3_win32_utf8_to_unicode(zPath); if( zUnicodeName ){ - memset(&fd, 0, sizeof(WIN32_FIND_DATA)); + memset(&fd, 0, sizeof(WIN32_FIND_DATAW)); hFindFile = FindFirstFileW(zUnicodeName, &fd); if( hFindFile!=NULL ){ pStatBuf->st_ctime = (time_t)fileTimeToUnixTime(&fd.ftCreationTime); @@ -2747,20 +2728,20 @@ static int fsdirColumn( ){ fsdir_cursor *pCur = (fsdir_cursor*)cur; switch( i ){ - case 0: { /* name */ + case FSDIR_COLUMN_NAME: { sqlite3_result_text(ctx, &pCur->zPath[pCur->nBase], -1, SQLITE_TRANSIENT); break; } - case 1: /* mode */ + case FSDIR_COLUMN_MODE: sqlite3_result_int64(ctx, pCur->sStat.st_mode); break; - case 2: /* mtime */ + case FSDIR_COLUMN_MTIME: sqlite3_result_int64(ctx, pCur->sStat.st_mtime); break; - case 3: { /* data */ + case FSDIR_COLUMN_DATA: { mode_t m = pCur->sStat.st_mode; if( S_ISDIR(m) ){ sqlite3_result_null(ctx); @@ -2790,6 +2771,12 @@ static int fsdirColumn( readFileContents(ctx, pCur->zPath); } } + case FSDIR_COLUMN_PATH: + default: { + /* The FSDIR_COLUMN_PATH and FSDIR_COLUMN_DIR are input parameters. + ** always return their values as NULL */ + break; + } } return SQLITE_OK; } @@ -2816,6 +2803,9 @@ static int fsdirEof(sqlite3_vtab_cursor *cur){ /* ** xFilter callback. +** +** idxNum==1 PATH parameter only +** idxNum==2 Both PATH and DIR supplied */ static int fsdirFilter( sqlite3_vtab_cursor *cur, @@ -2868,40 +2858,63 @@ static int fsdirFilter( ** In this implementation idxNum is used to represent the ** query plan. idxStr is unused. ** -** The query plan is represented by bits in idxNum: +** The query plan is represented by values of idxNum: ** -** (1) start = $value -- constraint exists -** (2) stop = $value -- constraint exists -** (4) step = $value -- constraint exists -** (8) output in descending order +** (1) The path value is supplied by argv[0] +** (2) Path is in argv[0] and dir is in argv[1] */ static int fsdirBestIndex( sqlite3_vtab *tab, sqlite3_index_info *pIdxInfo ){ int i; /* Loop over constraints */ - int idx4 = -1; - int idx5 = -1; + int idxPath = -1; /* Index in pIdxInfo->aConstraint of PATH= */ + int idxDir = -1; /* Index in pIdxInfo->aConstraint of DIR= */ + int seenPath = 0; /* True if an unusable PATH= constraint is seen */ + int seenDir = 0; /* True if an unusable DIR= constraint is seen */ const struct sqlite3_index_constraint *pConstraint; (void)tab; pConstraint = pIdxInfo->aConstraint; for(i=0; inConstraint; i++, pConstraint++){ - if( pConstraint->usable==0 ) continue; if( pConstraint->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; - if( pConstraint->iColumn==4 ) idx4 = i; - if( pConstraint->iColumn==5 ) idx5 = i; + switch( pConstraint->iColumn ){ + case FSDIR_COLUMN_PATH: { + if( pConstraint->usable ){ + idxPath = i; + seenPath = 0; + }else if( idxPath<0 ){ + seenPath = 1; + } + break; + } + case FSDIR_COLUMN_DIR: { + if( pConstraint->usable ){ + idxDir = i; + seenDir = 0; + }else if( idxDir<0 ){ + seenDir = 1; + } + break; + } + } } + if( seenPath || seenDir ){ + /* If input parameters are unusable, disallow this plan */ + return SQLITE_CONSTRAINT; + } - if( idx4<0 ){ + if( idxPath<0 ){ pIdxInfo->idxNum = 0; - pIdxInfo->estimatedCost = (double)(((sqlite3_int64)1) << 50); + /* The pIdxInfo->estimatedCost should have been initialized to a huge + ** number. Leave it unchanged. */ + pIdxInfo->estimatedRows = 0x7fffffff; }else{ - pIdxInfo->aConstraintUsage[idx4].omit = 1; - pIdxInfo->aConstraintUsage[idx4].argvIndex = 1; - if( idx5>=0 ){ - pIdxInfo->aConstraintUsage[idx5].omit = 1; - pIdxInfo->aConstraintUsage[idx5].argvIndex = 2; + pIdxInfo->aConstraintUsage[idxPath].omit = 1; + pIdxInfo->aConstraintUsage[idxPath].argvIndex = 1; + if( idxDir>=0 ){ + pIdxInfo->aConstraintUsage[idxDir].omit = 1; + pIdxInfo->aConstraintUsage[idxDir].argvIndex = 2; pIdxInfo->idxNum = 2; pIdxInfo->estimatedCost = 10.0; }else{ @@ -2940,7 +2953,8 @@ static int fsdirRegister(sqlite3 *db){ 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ - 0 /* xRollbackTo */ + 0, /* xRollbackTo */ + 0, /* xShadowName */ }; int rc = sqlite3_create_module(db, "fsdir", &fsdirModule, 0); @@ -3042,6 +3056,7 @@ struct completion_cursor { char *zPrefix; /* The prefix for the word we want to complete */ char *zLine; /* The whole that we want to complete */ const char *zCurrentRow; /* Current output row */ + int szRow; /* Length of the zCurrentRow string */ sqlite3_stmt *pStmt; /* Current statement */ sqlite3_int64 iRowid; /* The rowid */ int ePhase; /* Current phase */ @@ -3155,32 +3170,6 @@ static int completionClose(sqlite3_vtab_cursor *cur){ } /* -** All SQL keywords understood by SQLite -*/ -static const char *completionKwrds[] = { - "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS", - "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", - "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT", - "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE", - "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH", - "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN", - "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF", - "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER", - "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", - "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL", - "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA", - "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", - "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT", - "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP", - "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE", - "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE", - "WITH", "WITHOUT", -}; -#define completionKwCount \ - (int)(sizeof(completionKwrds)/sizeof(completionKwrds[0])) - -/* ** Advance a completion_cursor to its next row of output. ** ** The ->ePhase, ->j, and ->pStmt fields of the completion_cursor object @@ -3202,11 +3191,11 @@ static int completionNext(sqlite3_vtab_cursor *cur){ while( pCur->ePhase!=COMPLETION_EOF ){ switch( pCur->ePhase ){ case COMPLETION_KEYWORDS: { - if( pCur->j >= completionKwCount ){ + if( pCur->j >= sqlite3_keyword_count() ){ pCur->zCurrentRow = 0; pCur->ePhase = COMPLETION_DATABASES; }else{ - pCur->zCurrentRow = completionKwrds[pCur->j++]; + sqlite3_keyword_name(pCur->j++, &pCur->zCurrentRow, &pCur->szRow); } iCol = -1; break; @@ -3278,6 +3267,7 @@ static int completionNext(sqlite3_vtab_cursor *cur){ if( sqlite3_step(pCur->pStmt)==SQLITE_ROW ){ /* Extract the next row of content */ pCur->zCurrentRow = (const char*)sqlite3_column_text(pCur->pStmt, iCol); + pCur->szRow = sqlite3_column_bytes(pCur->pStmt, iCol); }else{ /* When all rows are finished, advance to the next phase */ sqlite3_finalize(pCur->pStmt); @@ -3287,7 +3277,9 @@ static int completionNext(sqlite3_vtab_cursor *cur){ } } if( pCur->nPrefix==0 ) break; - if( sqlite3_strnicmp(pCur->zPrefix, pCur->zCurrentRow, pCur->nPrefix)==0 ){ + if( pCur->nPrefix<=pCur->szRow + && sqlite3_strnicmp(pCur->zPrefix, pCur->zCurrentRow, pCur->nPrefix)==0 + ){ break; } } @@ -3307,7 +3299,7 @@ static int completionColumn( completion_cursor *pCur = (completion_cursor*)cur; switch( i ){ case COMPLETION_COLUMN_CANDIDATE: { - sqlite3_result_text(ctx, pCur->zCurrentRow, -1, SQLITE_TRANSIENT); + sqlite3_result_text(ctx, pCur->zCurrentRow, pCur->szRow,SQLITE_TRANSIENT); break; } case COMPLETION_COLUMN_PREFIX: { @@ -3367,7 +3359,7 @@ static int completionFilter( pCur->zPrefix = sqlite3_mprintf("%s", sqlite3_value_text(argv[iArg])); if( pCur->zPrefix==0 ) return SQLITE_NOMEM; } - iArg++; + iArg = 1; } if( idxNum & 2 ){ pCur->nLine = sqlite3_value_bytes(argv[iArg]); @@ -3375,7 +3367,6 @@ static int completionFilter( pCur->zLine = sqlite3_mprintf("%s", sqlite3_value_text(argv[iArg])); if( pCur->zLine==0 ) return SQLITE_NOMEM; } - iArg++; } if( pCur->zLine!=0 && pCur->zPrefix==0 ){ int i = pCur->nLine; @@ -3471,7 +3462,8 @@ static sqlite3_module completionModule = { 0, /* xRename */ 0, /* xSavepoint */ 0, /* xRelease */ - 0 /* xRollbackTo */ + 0, /* xRollbackTo */ + 0 /* xShadowName */ }; #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -5368,25 +5360,26 @@ static int zipfileBestIndex( sqlite3_index_info *pIdxInfo ){ int i; + int idx = -1; + int unusable = 0; for(i=0; inConstraint; i++){ const struct sqlite3_index_constraint *pCons = &pIdxInfo->aConstraint[i]; - if( pCons->usable==0 ) continue; - if( pCons->op!=SQLITE_INDEX_CONSTRAINT_EQ ) continue; if( pCons->iColumn!=ZIPFILE_F_COLUMN_IDX ) continue; - break; + if( pCons->usable==0 ){ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Dec 21 02:04:18 2018 Return-Path: Delivered-To: svn-src-stable@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 5C8BB1338FE3; Fri, 21 Dec 2018 02:04:18 +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 0A87680B6C; Fri, 21 Dec 2018 02:04:18 +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 EECA569EF; Fri, 21 Dec 2018 02:04:17 +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 wBL24H1S021033; Fri, 21 Dec 2018 02:04:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL24Gh2021024; Fri, 21 Dec 2018 02:04:16 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201812210204.wBL24Gh2021024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Fri, 21 Dec 2018 02:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342292 - in stable/11/contrib/sqlite3: . tea X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11/contrib/sqlite3: . tea X-SVN-Commit-Revision: 342292 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0A87680B6C 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.959,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 02:04:18 -0000 Author: cy Date: Fri Dec 21 02:04:15 2018 New Revision: 342292 URL: https://svnweb.freebsd.org/changeset/base/342292 Log: MFC r333352 & r342183: r333352: Update private sqlite from sqlite3-3.20.0 to sqlite3-3.23.1 r342183: Update sqlite3-3.23.1 --> sqlite3-3.26.0 (3260000) PR: 234113 Security: https://blade.tencent.com/magellan/index_en.html No known CVE was apparently registered. Added: stable/11/contrib/sqlite3/Makefile.fallback - copied unchanged from r342183, head/contrib/sqlite3/Makefile.fallback Replaced: stable/11/contrib/sqlite3/tea/ - copied from r342183, head/contrib/sqlite3/tea/ Modified: stable/11/contrib/sqlite3/Makefile.am stable/11/contrib/sqlite3/Makefile.in stable/11/contrib/sqlite3/Makefile.msc stable/11/contrib/sqlite3/configure stable/11/contrib/sqlite3/configure.ac stable/11/contrib/sqlite3/shell.c stable/11/contrib/sqlite3/sqlite3.c stable/11/contrib/sqlite3/sqlite3.h stable/11/contrib/sqlite3/sqlite3ext.h Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/sqlite3/Makefile.am ============================================================================== --- stable/11/contrib/sqlite3/Makefile.am Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/Makefile.am Fri Dec 21 02:04:15 2018 (r342292) @@ -1,6 +1,5 @@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE - +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -10,11 +9,11 @@ sqlite3_SOURCES = shell.c sqlite3.h EXTRA_sqlite3_SOURCES = sqlite3.c sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc Copied: stable/11/contrib/sqlite3/Makefile.fallback (from r342183, head/contrib/sqlite3/Makefile.fallback) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/sqlite3/Makefile.fallback Fri Dec 21 02:04:15 2018 (r342292, copy of r342183, head/contrib/sqlite3/Makefile.fallback) @@ -0,0 +1,19 @@ +#!/usr/bin/make +# +# If the configure script does not work, then this Makefile is available +# as a backup. Manually configure the variables below. +# +# Note: This makefile works out-of-the-box on MacOS 10.2 (Jaguar) +# +CC = gcc +CFLAGS = -O0 -I. +LIBS = -lz +COPTS += -D_BSD_SOURCE +COPTS += -DSQLITE_ENABLE_LOCKING_STYLE=0 +COPTS += -DSQLITE_THREADSAFE=0 +COPTS += -DSQLITE_OMIT_LOAD_EXTENSION +COPTS += -DSQLITE_WITHOUT_ZONEMALLOC +COPTS += -DSQLITE_ENABLE_RTREE + +sqlite3: shell.c sqlite3.c + $(CC) $(CFLAGS) $(COPTS) -o sqlite3 shell.c sqlite3.c $(LIBS) Modified: stable/11/contrib/sqlite3/Makefile.in ============================================================================== --- stable/11/contrib/sqlite3/Makefile.in Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/Makefile.in Fri Dec 21 02:04:15 2018 (r342292) @@ -260,7 +260,6 @@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ -DYNAMIC_EXTENSION_FLAGS = @DYNAMIC_EXTENSION_FLAGS@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -268,14 +267,12 @@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ EXTRA_SHELL_OBJ = @EXTRA_SHELL_OBJ@ FGREP = @FGREP@ -FTS5_FLAGS = @FTS5_FLAGS@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -JSON1_FLAGS = @JSON1_FLAGS@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ @@ -305,11 +302,10 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ RANLIB = @RANLIB@ READLINE_LIBS = @READLINE_LIBS@ SED = @SED@ -SESSION_FLAGS = @SESSION_FLAGS@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SHELL_CFLAGS = @SHELL_CFLAGS@ STRIP = @STRIP@ -THREADSAFE_FLAGS = @THREADSAFE_FLAGS@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ @@ -363,7 +359,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @THREADSAFE_FLAGS@ @DYNAMIC_EXTENSION_FLAGS@ @FTS5_FLAGS@ @JSON1_FLAGS@ @SESSION_FLAGS@ -DSQLITE_ENABLE_FTS3 -DSQLITE_ENABLE_RTREE +AM_CFLAGS = @BUILD_CFLAGS@ lib_LTLIBRARIES = libsqlite3.la libsqlite3_la_SOURCES = sqlite3.c libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8 @@ -371,9 +367,9 @@ sqlite3_SOURCES = shell.c sqlite3.h EXTRA_sqlite3_SOURCES = sqlite3.c sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h -EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs +EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs Makefile.fallback pkgconfigdir = ${libdir}/pkgconfig pkgconfig_DATA = sqlite3.pc man_MANS = sqlite3.1 Modified: stable/11/contrib/sqlite3/Makefile.msc ============================================================================== --- stable/11/contrib/sqlite3/Makefile.msc Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/Makefile.msc Fri Dec 21 02:04:15 2018 (r342292) @@ -277,6 +277,12 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb !IF $(MINIMAL_AMALGAMATION)==0 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 +OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_INTROSPECTION_PRAGMAS=1 !ENDIF OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_COLUMN_METADATA=1 !ENDIF @@ -561,6 +567,7 @@ SHELL_CORE_DEP = !ENDIF !ENDIF + # This is the core library that the shell executable should link with. # !IFNDEF SHELL_CORE_LIB @@ -808,7 +815,7 @@ LTLINK = $(TCC) -Fe$@ # If requested, link to the RPCRT4 library. # !IF $(USE_RPCRT4_LIB)!=0 -LTLINK = $(LTLINK) rpcrt4.lib +LTLIBS = $(LTLIBS) rpcrt4.lib !ENDIF # If a platform was set, force the linker to target that. @@ -927,15 +934,25 @@ LIBRESOBJS = # when the shell is not being dynamically linked. # !IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0 -SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_FTS4=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS=1 +SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 !ENDIF # This is the default Makefile target. The objects listed here # are what get build when you type just "make" with no arguments. # -all: dll shell +core: dll shell +# Targets that require the Tcl library. +# +tcl: $(ALL_TCL_TARGETS) + +# This Makefile target builds all of the standard binaries. +# +all: core tcl + # Dynamic link library section. # dll: $(SQLITE3DLL) @@ -954,11 +971,11 @@ Replace.exe: sqlite3.def: Replace.exe $(LIBOBJ) echo EXPORTS > sqlite3.def dumpbin /all $(LIBOBJ) \ - | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ + | .\Replace.exe "^\s+/EXPORT:_?(sqlite3(?:session|changeset|changegroup|rebaser)?_[^@,]*)(?:@\d+|,DATA)?$$" $$1 true \ | sort >> sqlite3.def -$(SQLITE3EXE): $(TOP)\shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) - $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) $(TOP)\shell.c $(SHELL_CORE_SRC) \ +$(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLITE3H) + $(LTLINK) $(SHELL_COMPILE_OPTS) $(READLINE_FLAGS) shell.c $(SHELL_CORE_SRC) \ /link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS) @@ -973,7 +990,7 @@ sqlite3.lo: $(SQLITE3C) !IF $(USE_RC)!=0 _HASHCHAR=^# !IF ![echo !IFNDEF VERSION > rcver.vc] && \ - ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| find "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \ + ![for /F "delims=" %V in ('type "$(SQLITE3H)" ^| "%SystemRoot%\System32\find.exe" "$(_HASHCHAR)define SQLITE_VERSION "') do (echo VERSION = ^^%V >> rcver.vc)] && \ ![echo !ENDIF >> rcver.vc] !INCLUDE rcver.vc !ENDIF Modified: stable/11/contrib/sqlite3/configure ============================================================================== --- stable/11/contrib/sqlite3/configure Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/configure Fri Dec 21 02:04:15 2018 (r342292) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sqlite 3.20.0. +# Generated by GNU Autoconf 2.69 for sqlite 3.26.0. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.20.0' -PACKAGE_STRING='sqlite 3.20.0' +PACKAGE_VERSION='3.26.0' +PACKAGE_STRING='sqlite 3.26.0' PACKAGE_BUGREPORT='http://www.sqlite.org' PACKAGE_URL='' @@ -636,12 +636,8 @@ ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS +SHELL_CFLAGS EXTRA_SHELL_OBJ -SESSION_FLAGS -JSON1_FLAGS -FTS5_FLAGS -DYNAMIC_EXTENSION_FLAGS -THREADSAFE_FLAGS READLINE_LIBS BUILD_CFLAGS CPP @@ -775,9 +771,13 @@ enable_editline enable_readline enable_threadsafe enable_dynamic_extensions +enable_fts4 +enable_fts3 enable_fts5 enable_json1 +enable_rtree enable_session +enable_debug enable_static_shell ' ac_precious_vars='build_alias @@ -1330,7 +1330,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sqlite 3.20.0 to adapt to many kinds of systems. +\`configure' configures sqlite 3.26.0 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1400,7 +1400,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.20.0:";; + short | recursive ) echo "Configuration of sqlite 3.26.0:";; esac cat <<\_ACEOF @@ -1425,9 +1425,13 @@ Optional Features: --enable-threadsafe build a thread-safe library [default=yes] --enable-dynamic-extensions support loadable extensions [default=yes] - --enable-fts5 include fts5 support [default=no] - --enable-json1 include json1 support [default=no] + --enable-fts4 include fts4 support [default=yes] + --enable-fts3 include fts3 support [default=no] + --enable-fts5 include fts5 support [default=yes] + --enable-json1 include json1 support [default=yes] + --enable-rtree include rtree support [default=yes] --enable-session enable the session extension [default=no] + --enable-debug build with debugging features enabled [default=no] --enable-static-shell statically link libsqlite3 into shell tool [default=yes] @@ -1521,7 +1525,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.20.0 +sqlite configure 3.26.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1936,7 +1940,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sqlite $as_me 3.20.0, which was +It was created by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2285,12 +2289,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Use automake. -am__api_version='1.15' - ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do +for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" @@ -2306,7 +2306,7 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; fi done if test -z "$ac_aux_dir"; then - as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in . \"$srcdir\"/." "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2318,6 +2318,10 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Pleas ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + +# Use automake. +am__api_version='1.15' + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: @@ -2802,7 +2806,7 @@ fi # Define the identity of the package. PACKAGE='sqlite' - VERSION='3.20.0' + VERSION='3.26.0' cat >>confdefs.h <<_ACEOF @@ -13038,6 +13042,7 @@ fi ac_config_files="$ac_config_files Makefile sqlite3.pc" +BUILD_CFLAGS= #------------------------------------------------------------------------- @@ -13302,9 +13307,8 @@ else enable_threadsafe=yes fi -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pthread_create" >&5 $as_echo_n "checking for library containing pthread_create... " >&6; } if ${ac_cv_search_pthread_create+:} false; then : @@ -13418,7 +13422,6 @@ if test "$ac_res" != no; then : fi fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13489,23 +13492,50 @@ if test "$ac_res" != no; then : fi else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for whether to support dynamic extensions" >&5 $as_echo_n "checking for whether to support dynamic extensions... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_dynamic_extensions" >&5 $as_echo "$enable_dynamic_extensions" >&6; } +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +# Check whether --enable-fts4 was given. +if test "${enable_fts4+set}" = set; then : + enableval=$enable_fts4; +else + enable_fts4=yes +fi +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +# Check whether --enable-fts3 was given. +if test "${enable_fts3+set}" = set; then : + enableval=$enable_fts3; +fi + +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # # Check whether --enable-fts5 was given. if test "${enable_fts5+set}" = set; then : enableval=$enable_fts5; else - enable_fts5=no + enable_fts5=yes fi if test x"$enable_fts5" = "xyes"; then @@ -13565,9 +13595,8 @@ if test "$ac_res" != no; then : fi - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi - #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -13577,32 +13606,57 @@ fi if test "${enable_json1+set}" = set; then : enableval=$enable_json1; else - enable_json1=no + enable_json1=yes fi if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +# Check whether --enable-rtree was given. +if test "${enable_rtree+set}" = set; then : + enableval=$enable_rtree; +else + enable_rtree=yes +fi +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # # Check whether --enable-session was given. if test "${enable_session+set}" = set; then : enableval=$enable_session; -else - enable_session=no fi if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi +#----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then : + enableval=$enable_debug; +fi +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi #----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # # Check whether --enable-static-shell was given. @@ -13631,7 +13685,136 @@ _ACEOF fi done +for ac_header in zlib.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default" +if test "x$ac_cv_header_zlib_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ZLIB_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5 +$as_echo_n "checking for library containing deflate... " >&6; } +if ${ac_cv_search_deflate+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char deflate (); +int +main () +{ +return deflate (); + ; + return 0; +} +_ACEOF +for ac_lib in '' z; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_deflate=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_deflate+:} false; then : + break +fi +done +if ${ac_cv_search_deflate+:} false; then : + +else + ac_cv_search_deflate=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5 +$as_echo "$ac_cv_search_deflate" >&6; } +ac_res=$ac_cv_search_deflate +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB" +fi + + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing system" >&5 +$as_echo_n "checking for library containing system... " >&6; } +if ${ac_cv_search_system+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char system (); +int +main () +{ +return system (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_system=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_system+:} false; then : + break +fi +done +if ${ac_cv_search_system+:} false; then : + +else + ac_cv_search_system=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_system" >&5 +$as_echo "$ac_cv_search_system" >&6; } +ac_res=$ac_cv_search_system +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +else + SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM" +fi + + + #----------------------------------------------------------------------- # UPDATE: Maybe it's better if users just set CFLAGS before invoking # configure. This option doesn't really add much... @@ -14227,7 +14410,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sqlite $as_me 3.20.0, which was +This file was extended by sqlite $as_me 3.26.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14284,7 +14467,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sqlite config.status 3.20.0 +sqlite config.status 3.26.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/sqlite3/configure.ac ============================================================================== --- stable/11/contrib/sqlite3/configure.ac Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/configure.ac Fri Dec 21 02:04:15 2018 (r342292) @@ -10,8 +10,9 @@ # AC_PREREQ(2.61) -AC_INIT(sqlite, 3.20.0, http://www.sqlite.org) +AC_INIT(sqlite, 3.26.0, http://www.sqlite.org) AC_CONFIG_SRCDIR([sqlite3.c]) +AC_CONFIG_AUX_DIR([.]) # Use automake. AM_INIT_AUTOMAKE([foreign]) @@ -28,6 +29,7 @@ AC_CHECK_FUNCS([fdatasync usleep fullfsync localtime_r AC_FUNC_STRERROR_R AC_CONFIG_FILES([Makefile sqlite3.pc]) +BUILD_CFLAGS= AC_SUBST(BUILD_CFLAGS) #------------------------------------------------------------------------- @@ -85,13 +87,11 @@ AC_SUBST(READLINE_LIBS) AC_ARG_ENABLE(threadsafe, [AS_HELP_STRING( [--enable-threadsafe], [build a thread-safe library [default=yes]])], [], [enable_threadsafe=yes]) -THREADSAFE_FLAGS=-DSQLITE_THREADSAFE=0 if test x"$enable_threadsafe" != "xno"; then - THREADSAFE_FLAGS="-D_REENTRANT=1 -DSQLITE_THREADSAFE=1" + BUILD_CFLAGS="$BUILD_CFLAGS -D_REENTRANT=1 -DSQLITE_THREADSAFE=1" AC_SEARCH_LIBS(pthread_create, pthread) AC_SEARCH_LIBS(pthread_mutexattr_init, pthread) fi -AC_SUBST(THREADSAFE_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- @@ -103,51 +103,92 @@ AC_ARG_ENABLE(dynamic-extensions, [AS_HELP_STRING( if test x"$enable_dynamic_extensions" != "xno"; then AC_SEARCH_LIBS(dlopen, dl) else - DYNAMIC_EXTENSION_FLAGS=-DSQLITE_OMIT_LOAD_EXTENSION=1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_OMIT_LOAD_EXTENSION=1" fi AC_MSG_CHECKING([for whether to support dynamic extensions]) AC_MSG_RESULT($enable_dynamic_extensions) -AC_SUBST(DYNAMIC_EXTENSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-fts4 +# +AC_ARG_ENABLE(fts4, [AS_HELP_STRING( + [--enable-fts4], [include fts4 support [default=yes]])], + [], [enable_fts4=yes]) +if test x"$enable_fts4" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- +# --enable-fts3 +# +AC_ARG_ENABLE(fts3, [AS_HELP_STRING( + [--enable-fts3], [include fts3 support [default=no]])], + [], []) +if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-fts5 # AC_ARG_ENABLE(fts5, [AS_HELP_STRING( - [--enable-fts5], [include fts5 support [default=no]])], - [], [enable_fts5=no]) + [--enable-fts5], [include fts5 support [default=yes]])], + [], [enable_fts5=yes]) if test x"$enable_fts5" = "xyes"; then AC_SEARCH_LIBS(log, m) - FTS5_FLAGS=-DSQLITE_ENABLE_FTS5 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5" fi -AC_SUBST(FTS5_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- # --enable-json1 # AC_ARG_ENABLE(json1, [AS_HELP_STRING( - [--enable-json1], [include json1 support [default=no]])], - [], [enable_json1=no]) + [--enable-json1], [include json1 support [default=yes]])], + [],[enable_json1=yes]) if test x"$enable_json1" = "xyes"; then - JSON1_FLAGS=-DSQLITE_ENABLE_JSON1 + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" fi -AC_SUBST(JSON1_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-rtree +# +AC_ARG_ENABLE(rtree, [AS_HELP_STRING( + [--enable-rtree], [include rtree support [default=yes]])], + [], [enable_rtree=yes]) +if test x"$enable_rtree" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-session # AC_ARG_ENABLE(session, [AS_HELP_STRING( [--enable-session], [enable the session extension [default=no]])], - [], [enable_session=no]) + [], []) if test x"$enable_session" = "xyes"; then - SESSION_FLAGS="-DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK" fi -AC_SUBST(SESSION_FLAGS) #----------------------------------------------------------------------- #----------------------------------------------------------------------- +# --enable-debug +# +AC_ARG_ENABLE(debug, [AS_HELP_STRING( + [--enable-debug], [build with debugging features enabled [default=no]])], + [], []) +if test x"$enable_debug" = "xyes"; then + BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE" + CFLAGS="-g -O0" +fi +#----------------------------------------------------------------------- + +#----------------------------------------------------------------------- # --enable-static-shell # AC_ARG_ENABLE(static-shell, [AS_HELP_STRING( @@ -163,6 +204,12 @@ AC_SUBST(EXTRA_SHELL_OBJ) #----------------------------------------------------------------------- AC_CHECK_FUNCS(posix_fallocate) +AC_CHECK_HEADERS(zlib.h,[ + AC_SEARCH_LIBS(deflate,z,[BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_HAVE_ZLIB"]) +]) + +AC_SEARCH_LIBS(system,,,[SHELL_CFLAGS="-DSQLITE_NOHAVE_SYSTEM"]) +AC_SUBST(SHELL_CFLAGS) #----------------------------------------------------------------------- # UPDATE: Maybe it's better if users just set CFLAGS before invoking Modified: stable/11/contrib/sqlite3/shell.c ============================================================================== --- stable/11/contrib/sqlite3/shell.c Fri Dec 21 01:58:01 2018 (r342291) +++ stable/11/contrib/sqlite3/shell.c Fri Dec 21 02:04:15 2018 (r342292) @@ -79,6 +79,9 @@ #include #include #include "sqlite3.h" +typedef sqlite3_int64 i64; +typedef sqlite3_uint64 u64; +typedef unsigned char u8; #if SQLITE_USER_AUTHENTICATION # include "sqlite3userauth.h" #endif @@ -90,9 +93,22 @@ # if !defined(__RTP__) && !defined(_WRS_KERNEL) # include # endif +#endif +#if (!defined(_WIN32) && !defined(WIN32)) || defined(__MINGW32__) # include -# include +# include +# define GETPID getpid +# if defined(__MINGW32__) +# define DIRENT dirent +# ifndef S_ISLNK +# define S_ISLNK(mode) (0) +# endif +# endif +#else +# define GETPID (int)GetCurrentProcessId #endif +#include +#include #if HAVE_READLINE # include @@ -137,6 +153,9 @@ # ifndef access # define access(f,m) _access((f),(m)) # endif +# ifndef unlink +# define unlink _unlink +# endif # undef popen # define popen _popen # undef pclose @@ -358,6 +377,11 @@ static void endTimer(void){ #define UNUSED_PARAMETER(x) (void)(x) /* +** Number of elements in an array +*/ +#define ArraySize(X) (int)(sizeof(X)/sizeof(X[0])) + +/* ** If the following flag is set, then command execution stops ** at an error if we are not interactive. */ @@ -433,6 +457,12 @@ void utf8_printf(FILE *out, const char *zFormat, ...){ # define raw_printf fprintf #endif +/* Indicate out-of-memory and exit. */ +static void shell_out_of_memory(void){ + raw_printf(stderr,"Error: out of memory\n"); + exit(1); +} + /* ** Write I/O traces to the following stream. */ @@ -556,7 +586,7 @@ static char *local_getline(char *zLine, FILE *in){ if( n+100>nLine ){ nLine = nLine*2 + 100; zLine = realloc(zLine, nLine); - if( zLine==0 ) return 0; + if( zLine==0 ) shell_out_of_memory(); } if( fgets(&zLine[n], nLine - n, in)==0 ){ if( n==0 ){ @@ -583,10 +613,7 @@ static char *local_getline(char *zLine, FILE *in){ int nTrans = strlen30(zTrans)+1; if( nTrans>nLine ){ zLine = realloc(zLine, nTrans); - if( zLine==0 ){ - sqlite3_free(zTrans); - return 0; - } + if( zLine==0 ) shell_out_of_memory(); } memcpy(zLine, zTrans, nTrans); sqlite3_free(zTrans); @@ -629,7 +656,66 @@ static char *one_input_line(FILE *in, char *zPrior, in } return zResult; } + + /* +** Return the value of a hexadecimal digit. Return -1 if the input +** is not a hex digit. +*/ +static int hexDigitValue(char c){ + if( c>='0' && c<='9' ) return c - '0'; + if( c>='a' && c<='f' ) return c - 'a' + 10; + if( c>='A' && c<='F' ) return c - 'A' + 10; + return -1; +} + +/* +** Interpret zArg as an integer value, possibly with suffixes. +*/ +static sqlite3_int64 integerValue(const char *zArg){ + sqlite3_int64 v = 0; + static const struct { char *zSuffix; int iMult; } aMult[] = { + { "KiB", 1024 }, + { "MiB", 1024*1024 }, + { "GiB", 1024*1024*1024 }, + { "KB", 1000 }, + { "MB", 1000000 }, + { "GB", 1000000000 }, + { "K", 1000 }, + { "M", 1000000 }, + { "G", 1000000000 }, + }; + int i; + int isNeg = 0; + if( zArg[0]=='-' ){ + isNeg = 1; + zArg++; + }else if( zArg[0]=='+' ){ + zArg++; + } + if( zArg[0]=='0' && zArg[1]=='x' ){ + int x; + zArg += 2; + while( (x = hexDigitValue(zArg[0]))>=0 ){ + v = (v<<4) + x; + zArg++; + } + }else{ + while( IsDigit(zArg[0]) ){ + v = v*10 + zArg[0] - '0'; + zArg++; + } + } + for(i=0; in+len>=p->nAlloc ){ p->nAlloc = p->nAlloc*2 + len + 20; p->z = realloc(p->z, p->nAlloc); - if( p->z==0 ){ - memset(p, 0, sizeof(*p)); - return; - } + if( p->z==0 ) shell_out_of_memory(); } if( quote ){ @@ -706,48 +789,82 @@ static void appendText(ShellText *p, char const *zAppe ** Return '"' if quoting is required. Return 0 if no quoting is required. */ static char quoteChar(const char *zName){ - /* All SQLite keywords, in alphabetical order */ - static const char *azKeywords[] = { - "ABORT", "ACTION", "ADD", "AFTER", "ALL", "ALTER", "ANALYZE", "AND", "AS", - "ASC", "ATTACH", "AUTOINCREMENT", "BEFORE", "BEGIN", "BETWEEN", "BY", - "CASCADE", "CASE", "CAST", "CHECK", "COLLATE", "COLUMN", "COMMIT", - "CONFLICT", "CONSTRAINT", "CREATE", "CROSS", "CURRENT_DATE", - "CURRENT_TIME", "CURRENT_TIMESTAMP", "DATABASE", "DEFAULT", "DEFERRABLE", - "DEFERRED", "DELETE", "DESC", "DETACH", "DISTINCT", "DROP", "EACH", - "ELSE", "END", "ESCAPE", "EXCEPT", "EXCLUSIVE", "EXISTS", "EXPLAIN", - "FAIL", "FOR", "FOREIGN", "FROM", "FULL", "GLOB", "GROUP", "HAVING", "IF", - "IGNORE", "IMMEDIATE", "IN", "INDEX", "INDEXED", "INITIALLY", "INNER", - "INSERT", "INSTEAD", "INTERSECT", "INTO", "IS", "ISNULL", "JOIN", "KEY", - "LEFT", "LIKE", "LIMIT", "MATCH", "NATURAL", "NO", "NOT", "NOTNULL", - "NULL", "OF", "OFFSET", "ON", "OR", "ORDER", "OUTER", "PLAN", "PRAGMA", - "PRIMARY", "QUERY", "RAISE", "RECURSIVE", "REFERENCES", "REGEXP", - "REINDEX", "RELEASE", "RENAME", "REPLACE", "RESTRICT", "RIGHT", - "ROLLBACK", "ROW", "SAVEPOINT", "SELECT", "SET", "TABLE", "TEMP", - "TEMPORARY", "THEN", "TO", "TRANSACTION", "TRIGGER", "UNION", "UNIQUE", - "UPDATE", "USING", "VACUUM", "VALUES", "VIEW", "VIRTUAL", "WHEN", "WHERE", - "WITH", "WITHOUT", - }; - int i, lwr, upr, mid, c; + int i; if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; for(i=0; zName[i]; i++){ if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; } - lwr = 0; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Dec 21 02:22:12 2018 Return-Path: Delivered-To: svn-src-stable@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 1645A1339A7F; Fri, 21 Dec 2018 02:22:12 +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 B18B281704; Fri, 21 Dec 2018 02:22:11 +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 A6AD86D31; Fri, 21 Dec 2018 02:22:11 +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 wBL2MB6G030269; Fri, 21 Dec 2018 02:22:11 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL2MB4A030267; Fri, 21 Dec 2018 02:22:11 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812210222.wBL2MB4A030267@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 21 Dec 2018 02:22:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342293 - stable/12/sys/dev/nfe X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/nfe X-SVN-Commit-Revision: 342293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B18B281704 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 02:22:12 -0000 Author: markj Date: Fri Dec 21 02:22:11 2018 New Revision: 342293 URL: https://svnweb.freebsd.org/changeset/base/342293 Log: MFC r342086: Add support for the nForce MCP89 adapter. PR: 234015 Modified: stable/12/sys/dev/nfe/if_nfe.c stable/12/sys/dev/nfe/if_nfereg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/12/sys/dev/nfe/if_nfe.c Fri Dec 21 02:04:15 2018 (r342292) +++ stable/12/sys/dev/nfe/if_nfe.c Fri Dec 21 02:22:11 2018 (r342293) @@ -265,6 +265,8 @@ static struct nfe_type nfe_devs[] = { "NVIDIA nForce MCP79 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN4, "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP89_LAN, + "NVIDIA nForce MCP89 Networking Adapter"}, {0, 0, NULL} }; @@ -531,6 +533,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP79_LAN2: case PCI_PRODUCT_NVIDIA_MCP79_LAN3: case PCI_PRODUCT_NVIDIA_MCP79_LAN4: + case PCI_PRODUCT_NVIDIA_MCP89_LAN: /* XXX flow control */ sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; Modified: stable/12/sys/dev/nfe/if_nfereg.h ============================================================================== --- stable/12/sys/dev/nfe/if_nfereg.h Fri Dec 21 02:04:15 2018 (r342292) +++ stable/12/sys/dev/nfe/if_nfereg.h Fri Dec 21 02:22:11 2018 (r342293) @@ -338,6 +338,7 @@ struct nfe_desc64 { #define PCI_PRODUCT_NVIDIA_MCP79_LAN2 0x0ab1 #define PCI_PRODUCT_NVIDIA_MCP79_LAN3 0x0ab2 #define PCI_PRODUCT_NVIDIA_MCP79_LAN4 0x0ab3 +#define PCI_PRODUCT_NVIDIA_MCP89_LAN 0x0d7d #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 From owner-svn-src-stable@freebsd.org Fri Dec 21 02:26:09 2018 Return-Path: Delivered-To: svn-src-stable@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 A05021339B5F; Fri, 21 Dec 2018 02:26:09 +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 E74A3819E2; Fri, 21 Dec 2018 02:26:08 +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 D25566D4B; Fri, 21 Dec 2018 02:26:08 +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 wBL2Q84F032014; Fri, 21 Dec 2018 02:26:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBL2Q8gB032012; Fri, 21 Dec 2018 02:26:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812210226.wBL2Q8gB032012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Fri, 21 Dec 2018 02:26:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342294 - stable/11/sys/dev/nfe X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/dev/nfe X-SVN-Commit-Revision: 342294 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E74A3819E2 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.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 02:26:09 -0000 Author: markj Date: Fri Dec 21 02:26:08 2018 New Revision: 342294 URL: https://svnweb.freebsd.org/changeset/base/342294 Log: MFC r342086: Add support for the nForce MCP89 adapter. PR: 234015 Modified: stable/11/sys/dev/nfe/if_nfe.c stable/11/sys/dev/nfe/if_nfereg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/nfe/if_nfe.c ============================================================================== --- stable/11/sys/dev/nfe/if_nfe.c Fri Dec 21 02:22:11 2018 (r342293) +++ stable/11/sys/dev/nfe/if_nfe.c Fri Dec 21 02:26:08 2018 (r342294) @@ -265,6 +265,8 @@ static struct nfe_type nfe_devs[] = { "NVIDIA nForce MCP79 Networking Adapter"}, {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP79_LAN4, "NVIDIA nForce MCP79 Networking Adapter"}, + {PCI_VENDOR_NVIDIA, PCI_PRODUCT_NVIDIA_MCP89_LAN, + "NVIDIA nForce MCP89 Networking Adapter"}, {0, 0, NULL} }; @@ -531,6 +533,7 @@ nfe_attach(device_t dev) case PCI_PRODUCT_NVIDIA_MCP79_LAN2: case PCI_PRODUCT_NVIDIA_MCP79_LAN3: case PCI_PRODUCT_NVIDIA_MCP79_LAN4: + case PCI_PRODUCT_NVIDIA_MCP89_LAN: /* XXX flow control */ sc->nfe_flags |= NFE_JUMBO_SUP | NFE_40BIT_ADDR | NFE_HW_CSUM | NFE_PWR_MGMT | NFE_CORRECT_MACADDR | NFE_MIB_V3; Modified: stable/11/sys/dev/nfe/if_nfereg.h ============================================================================== --- stable/11/sys/dev/nfe/if_nfereg.h Fri Dec 21 02:22:11 2018 (r342293) +++ stable/11/sys/dev/nfe/if_nfereg.h Fri Dec 21 02:26:08 2018 (r342294) @@ -338,6 +338,7 @@ struct nfe_desc64 { #define PCI_PRODUCT_NVIDIA_MCP79_LAN2 0x0ab1 #define PCI_PRODUCT_NVIDIA_MCP79_LAN3 0x0ab2 #define PCI_PRODUCT_NVIDIA_MCP79_LAN4 0x0ab3 +#define PCI_PRODUCT_NVIDIA_MCP89_LAN 0x0d7d #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN2 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN1 #define PCI_PRODUCT_NVIDIA_NFORCE3_LAN3 PCI_PRODUCT_NVIDIA_NFORCE2_400_LAN2 From owner-svn-src-stable@freebsd.org Fri Dec 21 14:50:20 2018 Return-Path: Delivered-To: svn-src-stable@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 8A40B134BAF5; Fri, 21 Dec 2018 14:50:20 +0000 (UTC) (envelope-from arybchik@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 2E3656AFD9; Fri, 21 Dec 2018 14:50:20 +0000 (UTC) (envelope-from arybchik@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 21120ED3C; Fri, 21 Dec 2018 14:50:20 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLEoKWr026025; Fri, 21 Dec 2018 14:50:20 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLEoI0n026019; Fri, 21 Dec 2018 14:50:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211450.wBLEoI0n026019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 14:50:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342303 - in stable/12/sys/dev/sfxge: . common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: in stable/12/sys/dev/sfxge: . common X-SVN-Commit-Revision: 342303 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E3656AFD9 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_LONG(-1.00)[-0.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 14:50:20 -0000 Author: arybchik Date: Fri Dec 21 14:50:18 2018 New Revision: 342303 URL: https://svnweb.freebsd.org/changeset/base/342303 Log: MFC r340767 sfxge(4): limit max TXQ size on Medford to 2048 Queues with 4096 descriptors are not supported as the top bit is used for vfifo stuffing. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D8948 Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c (contents, props changed) stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_tx.c stable/12/sys/dev/sfxge/common/hunt_nic.c stable/12/sys/dev/sfxge/common/medford_nic.c stable/12/sys/dev/sfxge/common/siena_nic.c stable/12/sys/dev/sfxge/sfxge.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 14:50:18 2018 (r342303) @@ -67,7 +67,7 @@ efx_mcdi_init_txq( efx_rc_t rc; EFSYS_ASSERT(EFX_TXQ_MAX_BUFS >= - EFX_TXQ_NBUFS(EFX_TXQ_MAXNDESCS(&enp->en_nic_cfg))); + EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:50:18 2018 (r342303) @@ -1107,6 +1107,7 @@ typedef struct efx_nic_cfg_s { uint32_t enc_evq_limit; uint32_t enc_txq_limit; uint32_t enc_rxq_limit; + uint32_t enc_txq_max_ndescs; uint32_t enc_buftbl_limit; uint32_t enc_piobuf_limit; uint32_t enc_piobuf_size; @@ -1976,12 +1977,6 @@ efx_tx_init( extern void efx_tx_fini( __in efx_nic_t *enp); - -#define EFX_BUG35388_WORKAROUND(_encp) \ - (((_encp) == NULL) ? 1 : ((_encp)->enc_bug35388_workaround != 0)) - -#define EFX_TXQ_MAXNDESCS(_encp) \ - ((EFX_BUG35388_WORKAROUND(_encp)) ? 2048 : 4096) #define EFX_TXQ_MINNDESCS 512 Modified: stable/12/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 14:50:18 2018 (r342303) @@ -913,7 +913,7 @@ siena_tx_qcreate( (1 << FRF_AZ_TX_DESCQ_LABEL_WIDTH)); EFSYS_ASSERT3U(label, <, EFX_EV_TX_NLABELS); - EFSYS_ASSERT(ISP2(EFX_TXQ_MAXNDESCS(encp))); + EFSYS_ASSERT(ISP2(encp->enc_txq_max_ndescs)); EFX_STATIC_ASSERT(ISP2(EFX_TXQ_MINNDESCS)); if (!ISP2(n) || (n < EFX_TXQ_MINNDESCS) || (n > EFX_EVQ_MAXNEVS)) { @@ -925,7 +925,7 @@ siena_tx_qcreate( goto fail2; } for (size = 0; - (1 << size) <= (EFX_TXQ_MAXNDESCS(encp) / EFX_TXQ_MINNDESCS); + (1 << size) <= (int)(encp->enc_txq_max_ndescs / EFX_TXQ_MINNDESCS); size++) if ((1 << size) == (int)(n / EFX_TXQ_MINNDESCS)) break; Modified: stable/12/sys/dev/sfxge/common/hunt_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/hunt_nic.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/hunt_nic.c Fri Dec 21 14:50:18 2018 (r342303) @@ -318,6 +318,12 @@ hunt_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The workaround for bug35388 uses the top bit of transmit queue + * descriptor writes, preventing the use of 4096 descriptor TXQs. + */ + encp->enc_txq_max_ndescs = encp->enc_bug35388_workaround ? 2048 : 4096; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = HUNT_PIOBUF_NBUFS; Modified: stable/12/sys/dev/sfxge/common/medford_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/medford_nic.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/medford_nic.c Fri Dec 21 14:50:18 2018 (r342303) @@ -315,6 +315,13 @@ medford_board_cfg( encp->enc_rxq_limit = EFX_RXQ_LIMIT_TARGET; encp->enc_txq_limit = EFX_TXQ_LIMIT_TARGET; + /* + * The maximum supported transmit queue size is 2048. TXQs with 4096 + * descriptors are not supported as the top bit is used for vfifo + * stuffing. + */ + encp->enc_txq_max_ndescs = 2048; + encp->enc_buftbl_limit = 0xFFFFFFFF; encp->enc_piobuf_limit = MEDFORD_PIOBUF_NBUFS; Modified: stable/12/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 14:50:18 2018 (r342303) @@ -158,6 +158,8 @@ siena_board_cfg( encp->enc_rxq_limit = MIN(EFX_RXQ_LIMIT_TARGET, nrxq); encp->enc_txq_limit = MIN(EFX_TXQ_LIMIT_TARGET, ntxq); + encp->enc_txq_max_ndescs = 4096; + encp->enc_buftbl_limit = SIENA_SRAM_ROWS - (encp->enc_txq_limit * EFX_TXQ_DC_NDESCS(EFX_TXQ_DC_SIZE)) - (encp->enc_rxq_limit * EFX_RXQ_DC_NDESCS(EFX_RXQ_DC_SIZE)); Modified: stable/12/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 14:45:10 2018 (r342302) +++ stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 14:50:18 2018 (r342303) @@ -764,10 +764,10 @@ sfxge_create(struct sfxge_softc *sc) if (!ISP2(sfxge_tx_ring_entries) || (sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) || - (sfxge_tx_ring_entries > EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp)))) { + (sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) { log(LOG_ERR, "%s=%d must be power of 2 from %u to %u", SFXGE_PARAM_TX_RING, sfxge_tx_ring_entries, - EFX_TXQ_MINNDESCS, EFX_TXQ_MAXNDESCS(efx_nic_cfg_get(enp))); + EFX_TXQ_MINNDESCS, efx_nic_cfg_get(enp)->enc_txq_max_ndescs); error = EINVAL; goto fail_tx_ring_entries; } From owner-svn-src-stable@freebsd.org Fri Dec 21 14:52:48 2018 Return-Path: Delivered-To: svn-src-stable@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 0AB5F134BD06; Fri, 21 Dec 2018 14:52:48 +0000 (UTC) (envelope-from arybchik@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 A49896B3E6; Fri, 21 Dec 2018 14:52:47 +0000 (UTC) (envelope-from arybchik@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 907F3EEEA; Fri, 21 Dec 2018 14:52:47 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLEql2W030654; Fri, 21 Dec 2018 14:52:47 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLEqlbk030652; Fri, 21 Dec 2018 14:52:47 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211452.wBLEqlbk030652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 14:52:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342304 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342304 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A49896B3E6 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 14:52:48 -0000 Author: arybchik Date: Fri Dec 21 14:52:46 2018 New Revision: 342304 URL: https://svnweb.freebsd.org/changeset/base/342304 Log: MFC r340826 sfxge(4): fix ignoring function return value fix PreFAST issue, add missing annotation that function return value should not be ignored. Fix alignment. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18096 Modified: stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_phy.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:50:18 2018 (r342303) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:52:46 2018 (r342304) @@ -913,13 +913,13 @@ efx_phy_media_type_get( __in efx_nic_t *enp, __out efx_phy_media_type_t *typep); -extern efx_rc_t +extern __checkReturn efx_rc_t efx_phy_module_get_info( - __in efx_nic_t *enp, - __in uint8_t dev_addr, - __in uint8_t offset, - __in uint8_t len, - __out_bcount(len) uint8_t *data); + __in efx_nic_t *enp, + __in uint8_t dev_addr, + __in uint8_t offset, + __in uint8_t len, + __out_bcount(len) uint8_t *data); #if EFSYS_OPT_PHY_STATS Modified: stable/12/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_phy.c Fri Dec 21 14:50:18 2018 (r342303) +++ stable/12/sys/dev/sfxge/common/efx_phy.c Fri Dec 21 14:52:46 2018 (r342304) @@ -301,7 +301,7 @@ efx_phy_media_type_get( *typep = epp->ep_fixed_port_type; } - __checkReturn efx_rc_t + __checkReturn efx_rc_t efx_phy_module_get_info( __in efx_nic_t *enp, __in uint8_t dev_addr, From owner-svn-src-stable@freebsd.org Fri Dec 21 14:53:51 2018 Return-Path: Delivered-To: svn-src-stable@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 89D3F134BD7F; Fri, 21 Dec 2018 14:53:51 +0000 (UTC) (envelope-from arybchik@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 2CB8B6B53C; Fri, 21 Dec 2018 14:53:51 +0000 (UTC) (envelope-from arybchik@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 1F50FEEEB; Fri, 21 Dec 2018 14:53:51 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLErp4e030757; Fri, 21 Dec 2018 14:53:51 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLErpp4030756; Fri, 21 Dec 2018 14:53:51 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211453.wBLErpp4030756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 14:53:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342305 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2CB8B6B53C 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 14:53:51 -0000 Author: arybchik Date: Fri Dec 21 14:53:50 2018 New Revision: 342305 URL: https://svnweb.freebsd.org/changeset/base/342305 Log: MFC r340797 sfxge(4): fix potential buffer overflow in Tx queue init Improve error checking to avoid a caller overflowing the MCDI request buffer if the requested TXQ size was excessively large. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18067 Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 14:52:46 2018 (r342304) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 14:53:50 2018 (r342305) @@ -70,7 +70,7 @@ efx_mcdi_init_txq( EFX_TXQ_NBUFS(enp->en_nic_cfg.enc_txq_max_ndescs)); npages = EFX_TXQ_NBUFS(size); - if (npages > MC_CMD_INIT_TXQ_IN_DMA_ADDR_MAXNUM) { + if (MC_CMD_INIT_TXQ_IN_LEN(npages) > sizeof (payload)) { rc = EINVAL; goto fail1; } From owner-svn-src-stable@freebsd.org Fri Dec 21 14:58:17 2018 Return-Path: Delivered-To: svn-src-stable@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 2A7F3134BF02; Fri, 21 Dec 2018 14:58:17 +0000 (UTC) (envelope-from arybchik@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 BDBCC6B737; Fri, 21 Dec 2018 14:58:16 +0000 (UTC) (envelope-from arybchik@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 A6840EEF3; Fri, 21 Dec 2018 14:58:16 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLEwGei031047; Fri, 21 Dec 2018 14:58:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLEwGVB031044; Fri, 21 Dec 2018 14:58:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211458.wBLEwGVB031044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 14:58:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342306 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342306 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BDBCC6B737 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 14:58:17 -0000 Author: arybchik Date: Fri Dec 21 14:58:16 2018 New Revision: 342306 URL: https://svnweb.freebsd.org/changeset/base/342306 Log: MFC r340805 sfxge(4): define a handle to denote default RSS context Make the existing filter-specific define more general. This is the same as MC_CMD_RSS_CONTEXT_ALLOC_OUT_RSS_CONTEXT_ID_INVALID. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18075 Modified: stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:53:50 2018 (r342305) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 14:58:16 2018 (r342306) @@ -1817,6 +1817,9 @@ efx_rx_scatter_enable( __in unsigned int buf_size); #endif /* EFSYS_OPT_RX_SCATTER */ +/* Handle to represent use of the default RSS context. */ +#define EFX_RSS_CONTEXT_DEFAULT 0xffffffff + #if EFSYS_OPT_RX_SCALE typedef enum efx_rx_hash_alg_e { @@ -2206,7 +2209,6 @@ typedef struct efx_filter_spec_s { /* Default values for use in filter specifications */ -#define EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT 0xffffffff #define EFX_FILTER_SPEC_RX_DMAQ_ID_DROP 0xfff #define EFX_FILTER_SPEC_VID_UNSPEC 0xffff Modified: stable/12/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 14:53:50 2018 (r342305) +++ stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 14:58:16 2018 (r342306) @@ -307,7 +307,7 @@ efx_filter_spec_init_rx( memset(spec, 0, sizeof (*spec)); spec->efs_priority = priority; spec->efs_flags = EFX_FILTER_FLAG_RX | flags; - spec->efs_rss_context = EFX_FILTER_SPEC_RSS_CONTEXT_DEFAULT; + spec->efs_rss_context = EFX_RSS_CONTEXT_DEFAULT; spec->efs_dmaq_id = (uint16_t)erp->er_index; } From owner-svn-src-stable@freebsd.org Fri Dec 21 14:59:25 2018 Return-Path: Delivered-To: svn-src-stable@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 CF56A134BF88; Fri, 21 Dec 2018 14:59:25 +0000 (UTC) (envelope-from arybchik@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 75DAB6B889; Fri, 21 Dec 2018 14:59:25 +0000 (UTC) (envelope-from arybchik@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 68025EEF5; Fri, 21 Dec 2018 14:59:25 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLExPoF031152; Fri, 21 Dec 2018 14:59:25 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLExPAt031151; Fri, 21 Dec 2018 14:59:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211459.wBLExPAt031151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 14:59:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342307 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342307 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 75DAB6B889 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 14:59:26 -0000 Author: arybchik Date: Fri Dec 21 14:59:24 2018 New Revision: 342307 URL: https://svnweb.freebsd.org/changeset/base/342307 Log: MFC r340806 sfxge(4): fix default RSS context check on Siena Default RSS context check is carried out during filter insertion on Siena and it needs to be fixed Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18076 Modified: stable/12/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 14:58:16 2018 (r342306) +++ stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 14:59:24 2018 (r342307) @@ -459,9 +459,9 @@ siena_filter_spec_from_gen_spec( else EFSYS_ASSERT3U(gen_spec->efs_flags, &, EFX_FILTER_FLAG_RX); - /* Falconsiena only has one RSS context */ + /* Siena only has one RSS context */ if ((gen_spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) && - gen_spec->efs_rss_context != 0) { + gen_spec->efs_rss_context != EFX_RSS_CONTEXT_DEFAULT) { rc = EINVAL; goto fail1; } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:02:37 2018 Return-Path: Delivered-To: svn-src-stable@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 878DC134C215; Fri, 21 Dec 2018 15:02:37 +0000 (UTC) (envelope-from arybchik@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 2C5616BCC4; Fri, 21 Dec 2018 15:02:37 +0000 (UTC) (envelope-from arybchik@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 0635AF0B3; Fri, 21 Dec 2018 15:02:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF2akh035872; Fri, 21 Dec 2018 15:02:36 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF2aKd035870; Fri, 21 Dec 2018 15:02:36 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211502.wBLF2aKd035870@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342308 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342308 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2C5616BCC4 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:02:37 -0000 Author: arybchik Date: Fri Dec 21 15:02:36 2018 New Revision: 342308 URL: https://svnweb.freebsd.org/changeset/base/342308 Log: MFC r340799 sfxge(4): fix error code usage MCDI results returned in req.emr_rc have already been translated from MC_CMD_ERR_* to errno names, so using an MC_CMD_ERR_* value is incorrect. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18069 Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c stable/12/sys/dev/sfxge/common/ef10_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 14:59:24 2018 (r342307) +++ stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 15:02:36 2018 (r342308) @@ -130,7 +130,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 14:59:24 2018 (r342307) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:02:36 2018 (r342308) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != MC_CMD_ERR_EALREADY)) { + if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { rc = req.emr_rc; goto fail1; } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:03:45 2018 Return-Path: Delivered-To: svn-src-stable@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 BE51B134C2EC; Fri, 21 Dec 2018 15:03:45 +0000 (UTC) (envelope-from arybchik@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 63C3C6BE24; Fri, 21 Dec 2018 15:03:45 +0000 (UTC) (envelope-from arybchik@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 4495BF0B6; Fri, 21 Dec 2018 15:03:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF3jHg035978; Fri, 21 Dec 2018 15:03:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF3jqo035977; Fri, 21 Dec 2018 15:03:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211503.wBLF3jqo035977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342309 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342309 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 63C3C6BE24 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:03:45 -0000 Author: arybchik Date: Fri Dec 21 15:03:44 2018 New Revision: 342309 URL: https://svnweb.freebsd.org/changeset/base/342309 Log: MFC r340822 sfxge(4): fix check in NVRAM validate Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18092 Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 15:02:36 2018 (r342308) +++ stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 15:03:44 2018 (r342309) @@ -462,10 +462,11 @@ efx_nvram_validate( if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; - if (envop->envo_type_to_partn != NULL && - ((rc = envop->envo_buffer_validate(enp, partn, - partn_data, partn_size)) != 0)) - goto fail2; + if (envop->envo_buffer_validate != NULL) { + if ((rc = envop->envo_buffer_validate(enp, partn, + partn_data, partn_size)) != 0) + goto fail2; + } return (0); From owner-svn-src-stable@freebsd.org Fri Dec 21 15:05:02 2018 Return-Path: Delivered-To: svn-src-stable@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 0EB93134C3EF; Fri, 21 Dec 2018 15:05:02 +0000 (UTC) (envelope-from arybchik@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 A8F336BFBA; Fri, 21 Dec 2018 15:05:01 +0000 (UTC) (envelope-from arybchik@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 99F50F0BE; Fri, 21 Dec 2018 15:05:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF51BY036098; Fri, 21 Dec 2018 15:05:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF51i5036097; Fri, 21 Dec 2018 15:05:01 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211505.wBLF51i5036097@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:05:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342310 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A8F336BFBA 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:05:02 -0000 Author: arybchik Date: Fri Dec 21 15:05:01 2018 New Revision: 342310 URL: https://svnweb.freebsd.org/changeset/base/342310 Log: r340798 sfxge(4): fix out of bounds read in VIs allocation Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18068 Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 15:03:44 2018 (r342309) +++ stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 15:05:01 2018 (r342310) @@ -557,7 +557,7 @@ efx_mcdi_alloc_vis( { efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_OUT_LEN)]; + MC_CMD_ALLOC_VIS_EXT_OUT_LEN)]; efx_rc_t rc; if (vi_countp == NULL) { @@ -570,7 +570,7 @@ efx_mcdi_alloc_vis( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_ALLOC_VIS_OUT_LEN; + req.emr_out_length = MC_CMD_ALLOC_VIS_EXT_OUT_LEN; MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MIN_VI_COUNT, min_vi_count); MCDI_IN_SET_DWORD(req, ALLOC_VIS_IN_MAX_VI_COUNT, max_vi_count); From owner-svn-src-stable@freebsd.org Fri Dec 21 15:05:58 2018 Return-Path: Delivered-To: svn-src-stable@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 80261134C4AA; Fri, 21 Dec 2018 15:05:58 +0000 (UTC) (envelope-from arybchik@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 064546C118; Fri, 21 Dec 2018 15:05:58 +0000 (UTC) (envelope-from arybchik@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 E03DCF0C2; Fri, 21 Dec 2018 15:05:57 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF5v4V036190; Fri, 21 Dec 2018 15:05:57 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF5vHc036187; Fri, 21 Dec 2018 15:05:57 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211505.wBLF5vHc036187@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:05:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342311 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 064546C118 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_LONG(-1.00)[-0.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:05:58 -0000 Author: arybchik Date: Fri Dec 21 15:05:56 2018 New Revision: 342311 URL: https://svnweb.freebsd.org/changeset/base/342311 Log: MFC r340800 sfxge(4): let caller know that queue is already flushed Tx/Rx queue may be already flushed due to Tx/Rx error on the queue or MC reboot. Caller needs to know that the queue is already flushed to avoid waiting for flush done event. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18070 Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c stable/12/sys/dev/sfxge/common/ef10_rx.c stable/12/sys/dev/sfxge/common/ef10_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 15:05:01 2018 (r342310) +++ stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 15:05:56 2018 (r342311) @@ -434,7 +434,12 @@ efx_mcdi_fini_evq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the EVQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 15:05:01 2018 (r342310) +++ stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 15:05:56 2018 (r342311) @@ -130,7 +130,7 @@ efx_mcdi_fini_rxq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -138,7 +138,12 @@ efx_mcdi_fini_rxq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -720,7 +725,14 @@ ef10_rx_qflush( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the RXQ has already been destroyed. Callers need to know that + * the RXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:05:01 2018 (r342310) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:05:56 2018 (r342311) @@ -151,7 +151,7 @@ efx_mcdi_fini_txq( efx_mcdi_execute_quiet(enp, &req); - if ((req.emr_rc != 0) && (req.emr_rc != EALREADY)) { + if (req.emr_rc != 0) { rc = req.emr_rc; goto fail1; } @@ -159,7 +159,12 @@ efx_mcdi_fini_txq( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } @@ -690,7 +695,14 @@ ef10_tx_qpace( return (0); fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); + /* + * EALREADY is not an error, but indicates that the MC has rebooted and + * that the TXQ has already been destroyed. Callers need to know that + * the TXQ flush has completed to avoid waiting until timeout for a + * flush done event that will not be delivered. + */ + if (rc != EALREADY) + EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:06:55 2018 Return-Path: Delivered-To: svn-src-stable@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 92DF2134C554; Fri, 21 Dec 2018 15:06:55 +0000 (UTC) (envelope-from arybchik@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 366AD6C272; Fri, 21 Dec 2018 15:06:55 +0000 (UTC) (envelope-from arybchik@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 1B444F0C5; Fri, 21 Dec 2018 15:06:55 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF6sbJ036287; Fri, 21 Dec 2018 15:06:54 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF6sSN036286; Fri, 21 Dec 2018 15:06:54 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211506.wBLF6sSN036286@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342312 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342312 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 366AD6C272 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:06:55 -0000 Author: arybchik Date: Fri Dec 21 15:06:54 2018 New Revision: 342312 URL: https://svnweb.freebsd.org/changeset/base/342312 Log: r340796 sfxge(4): fix failure path in EF10 Tx queue PIO enable Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18066 Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:05:56 2018 (r342311) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:06:54 2018 (r342312) @@ -290,9 +290,9 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); - etp->et_pio_size = 0; fail2: EFSYS_PROBE(fail2); + etp->et_pio_size = 0; fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); From owner-svn-src-stable@freebsd.org Fri Dec 21 15:08:15 2018 Return-Path: Delivered-To: svn-src-stable@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 3E136134C658; Fri, 21 Dec 2018 15:08:15 +0000 (UTC) (envelope-from arybchik@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 D69996C403; Fri, 21 Dec 2018 15:08:14 +0000 (UTC) (envelope-from arybchik@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 C90A6F0CC; Fri, 21 Dec 2018 15:08:14 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLF8E5R036403; Fri, 21 Dec 2018 15:08:14 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLF8EfV036402; Fri, 21 Dec 2018 15:08:14 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211508.wBLF8EfV036402@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:08:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342313 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342313 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: D69996C403 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:08:15 -0000 Author: arybchik Date: Fri Dec 21 15:08:14 2018 New Revision: 342313 URL: https://svnweb.freebsd.org/changeset/base/342313 Log: MFC r340814 sfxge(4): fix result code in MCDI NVRAM update finish Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18084 Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 15:06:54 2018 (r342312) +++ stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 15:08:14 2018 (r342313) @@ -927,7 +927,7 @@ efx_mcdi_nvram_update_finish( efx_mcdi_req_t req; uint8_t payload[MAX(MC_CMD_NVRAM_UPDATE_FINISH_V2_IN_LEN, MC_CMD_NVRAM_UPDATE_FINISH_V2_OUT_LEN)]; - uint32_t result = 0; /* FIXME: use MC_CMD_NVRAM_VERIFY_RC_UNKNOWN */ + uint32_t result = MC_CMD_NVRAM_VERIFY_RC_UNKNOWN; efx_rc_t rc; (void) memset(payload, 0, sizeof (payload)); From owner-svn-src-stable@freebsd.org Fri Dec 21 15:10:09 2018 Return-Path: Delivered-To: svn-src-stable@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 16A0C134C7CF; Fri, 21 Dec 2018 15:10:09 +0000 (UTC) (envelope-from arybchik@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 AE8586C642; Fri, 21 Dec 2018 15:10:08 +0000 (UTC) (envelope-from arybchik@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 9F9F5F0D4; Fri, 21 Dec 2018 15:10:08 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFA8Xv036569; Fri, 21 Dec 2018 15:10:08 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFA7Lk036566; Fri, 21 Dec 2018 15:10:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211510.wBLFA7Lk036566@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342314 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342314 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AE8586C642 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.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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:10:09 -0000 Author: arybchik Date: Fri Dec 21 15:10:07 2018 New Revision: 342314 URL: https://svnweb.freebsd.org/changeset/base/342314 Log: MFC r340875 sfxge(4): fix build issue with PHY LED control enabled Fixed build issue with the EFSYS_OPT_PHY_LED_CONTROL for Huntigton and Medford. Submitted by: Vijay Srivastava Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18110 Modified: stable/12/sys/dev/sfxge/common/ef10_phy.c stable/12/sys/dev/sfxge/common/efx_check.h stable/12/sys/dev/sfxge/common/siena_nic.c stable/12/sys/dev/sfxge/common/siena_phy.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 15:08:14 2018 (r342313) +++ stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 15:10:07 2018 (r342314) @@ -283,7 +283,9 @@ ef10_phy_reconfigure( uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN)]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; boolean_t supported; efx_rc_t rc; Modified: stable/12/sys/dev/sfxge/common/efx_check.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_check.h Fri Dec 21 15:08:14 2018 (r342313) +++ stable/12/sys/dev/sfxge/common/efx_check.h Fri Dec 21 15:10:07 2018 (r342314) @@ -226,8 +226,8 @@ /* Support for PHY LED control */ #if EFSYS_OPT_PHY_LED_CONTROL -# if !EFSYS_OPT_SIENA -# error "PHY_LED_CONTROL requires SIENA" +# if !(EFSYS_OPT_SIENA || EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD) +# error "PHY_LED_CONTROL requires SIENA or HUNTINGTON or MEDFORD" # endif #endif /* EFSYS_OPT_PHY_LED_CONTROL */ Modified: stable/12/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 15:08:14 2018 (r342313) +++ stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 15:10:07 2018 (r342314) @@ -190,7 +190,9 @@ static __checkReturn efx_rc_t siena_phy_cfg( __in efx_nic_t *enp) { +#if EFSYS_OPT_PHY_STATS efx_nic_cfg_t *encp = &(enp->en_nic_cfg); +#endif /* EFSYS_OPT_PHY_STATS */ efx_rc_t rc; /* Fill out fields in enp->en_port and enp->en_nic_cfg from MCDI */ Modified: stable/12/sys/dev/sfxge/common/siena_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_phy.c Fri Dec 21 15:08:14 2018 (r342313) +++ stable/12/sys/dev/sfxge/common/siena_phy.c Fri Dec 21 15:10:07 2018 (r342314) @@ -278,7 +278,9 @@ siena_phy_reconfigure( MAX(MC_CMD_SET_LINK_IN_LEN, MC_CMD_SET_LINK_OUT_LEN))]; uint32_t cap_mask; +#if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; +#endif unsigned int speed; efx_rc_t rc; From owner-svn-src-stable@freebsd.org Fri Dec 21 15:11:54 2018 Return-Path: Delivered-To: svn-src-stable@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 67A08134CA7F; Fri, 21 Dec 2018 15:11:54 +0000 (UTC) (envelope-from arybchik@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 08EBE6CA0F; Fri, 21 Dec 2018 15:11:54 +0000 (UTC) (envelope-from arybchik@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 F0B68F14B; Fri, 21 Dec 2018 15:11:53 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFBreH041434; Fri, 21 Dec 2018 15:11:53 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFBrm2041431; Fri, 21 Dec 2018 15:11:53 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211511.wBLFBrm2041431@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:11:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342315 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342315 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 08EBE6CA0F 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.962,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:11:54 -0000 Author: arybchik Date: Fri Dec 21 15:11:52 2018 New Revision: 342315 URL: https://svnweb.freebsd.org/changeset/base/342315 Log: MFC r340883 sfxge(4): fix diagnostics support build without Siena The compilation failed because __efx_sram_pattern_fns was used in efx_nic.c, but defined in efx_sram.c which is only needed when supporting Siena. To fix it move all the code using __efx_sram_pattern_fns into Siena-specific files (except for the definition in efx_sram.c itself, as that file only needs to be included in Siena-supporting builds anyway). The functions to test registers and tables are unlikely to apply to any new hardware and so can be moved into Siena files. Since Huntington such tests have been implemented in firmware. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18117 Modified: stable/12/sys/dev/sfxge/common/efx_impl.h stable/12/sys/dev/sfxge/common/efx_nic.c stable/12/sys/dev/sfxge/common/siena_impl.h stable/12/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 15:10:07 2018 (r342314) +++ stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 15:11:52 2018 (r342315) @@ -1121,32 +1121,6 @@ efx_vpd_hunk_set( #endif /* EFSYS_OPT_VPD */ -#if EFSYS_OPT_DIAG - -extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; - -typedef struct efx_register_set_s { - unsigned int address; - unsigned int step; - unsigned int rows; - efx_oword_t mask; -} efx_register_set_t; - -extern __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count); - -extern __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count); - -#endif /* EFSYS_OPT_DIAG */ - #if EFSYS_OPT_MCDI extern __checkReturn efx_rc_t Modified: stable/12/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 15:10:07 2018 (r342314) +++ stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 15:11:52 2018 (r342315) @@ -643,139 +643,6 @@ fail1: return (rc); } - __checkReturn efx_rc_t -efx_nic_test_registers( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in size_t count) -{ - unsigned int bit; - efx_oword_t original; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - while (count > 0) { - /* This function is only suitable for registers */ - EFSYS_ASSERT(rsp->rows == 1); - - /* bit sweep on and off */ - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, - B_TRUE); - for (bit = 0; bit < 128; bit++) { - /* Is this bit in the mask? */ - if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) - continue; - - /* Test this bit can be set in isolation */ - reg = original; - EFX_AND_OWORD(reg, rsp->mask); - EFX_SET_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - /* Test this bit can be cleared in isolation */ - EFX_OR_OWORD(reg, rsp->mask); - EFX_CLEAR_OWORD_BIT(reg, bit); - - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, - B_TRUE); - EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, - B_TRUE); - - EFX_AND_OWORD(buf, rsp->mask); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail2; - } - } - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, - B_TRUE); - - --count; - ++rsp; - } - - return (0); - -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - /* Restore the old value */ - EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); - - return (rc); -} - - __checkReturn efx_rc_t -efx_nic_test_tables( - __in efx_nic_t *enp, - __in efx_register_set_t *rsp, - __in efx_pattern_type_t pattern, - __in size_t count) -{ - efx_sram_pattern_fn_t func; - unsigned int index; - unsigned int address; - efx_oword_t reg; - efx_oword_t buf; - efx_rc_t rc; - - EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); - func = __efx_sram_pattern_fns[pattern]; - - while (count > 0) { - /* Write */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); - - address += rsp->step; - } - - /* Read */ - address = rsp->address; - for (index = 0; index < rsp->rows; ++index) { - func(2 * index + 0, B_FALSE, ®.eo_qword[0]); - func(2 * index + 1, B_FALSE, ®.eo_qword[1]); - EFX_AND_OWORD(reg, rsp->mask); - EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); - if (memcmp(®, &buf, sizeof (reg))) { - rc = EIO; - goto fail1; - } - - address += rsp->step; - } - - ++rsp; - --count; - } - - return (0); - -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #endif /* EFSYS_OPT_DIAG */ #if EFSYS_OPT_LOOPBACK Modified: stable/12/sys/dev/sfxge/common/siena_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_impl.h Fri Dec 21 15:10:07 2018 (r342314) +++ stable/12/sys/dev/sfxge/common/siena_impl.h Fri Dec 21 15:11:52 2018 (r342315) @@ -60,6 +60,15 @@ siena_nic_init( #if EFSYS_OPT_DIAG +extern efx_sram_pattern_fn_t __efx_sram_pattern_fns[]; + +typedef struct siena_register_set_s { + unsigned int address; + unsigned int step; + unsigned int rows; + efx_oword_t mask; +} siena_register_set_t; + extern __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp); Modified: stable/12/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 15:10:07 2018 (r342314) +++ stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 15:11:52 2018 (r342315) @@ -457,7 +457,7 @@ siena_nic_unprobe( #if EFSYS_OPT_DIAG -static efx_register_set_t __siena_registers[] = { +static siena_register_set_t __siena_registers[] = { { FR_AZ_ADR_REGION_REG_OFST, 0, 1 }, { FR_CZ_USR_EV_CFG_OFST, 0, 1 }, { FR_AZ_RX_CFG_REG_OFST, 0, 1 }, @@ -489,7 +489,7 @@ static const uint32_t __siena_register_masks[] = { 0xFFFFFFFF, 0xFFFFFFFF, 0x00000007, 0x00000000 }; -static efx_register_set_t __siena_tables[] = { +static siena_register_set_t __siena_tables[] = { { FR_AZ_RX_FILTER_TBL0_OFST, FR_AZ_RX_FILTER_TBL0_STEP, FR_AZ_RX_FILTER_TBL0_ROWS }, { FR_CZ_RX_MAC_FILTER_TBL0_OFST, FR_CZ_RX_MAC_FILTER_TBL0_STEP, @@ -516,10 +516,144 @@ static const uint32_t __siena_table_masks[] = { }; __checkReturn efx_rc_t +siena_nic_test_registers( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in size_t count) +{ + unsigned int bit; + efx_oword_t original; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + while (count > 0) { + /* This function is only suitable for registers */ + EFSYS_ASSERT(rsp->rows == 1); + + /* bit sweep on and off */ + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &original, + B_TRUE); + for (bit = 0; bit < 128; bit++) { + /* Is this bit in the mask? */ + if (~(rsp->mask.eo_u32[bit >> 5]) & (1 << bit)) + continue; + + /* Test this bit can be set in isolation */ + reg = original; + EFX_AND_OWORD(reg, rsp->mask); + EFX_SET_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + /* Test this bit can be cleared in isolation */ + EFX_OR_OWORD(reg, rsp->mask); + EFX_CLEAR_OWORD_BIT(reg, bit); + + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, ®, + B_TRUE); + EFSYS_BAR_READO(enp->en_esbp, rsp->address, &buf, + B_TRUE); + + EFX_AND_OWORD(buf, rsp->mask); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail2; + } + } + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, + B_TRUE); + + --count; + ++rsp; + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + /* Restore the old value */ + EFSYS_BAR_WRITEO(enp->en_esbp, rsp->address, &original, B_TRUE); + + return (rc); +} + + __checkReturn efx_rc_t +siena_nic_test_tables( + __in efx_nic_t *enp, + __in siena_register_set_t *rsp, + __in efx_pattern_type_t pattern, + __in size_t count) +{ + efx_sram_pattern_fn_t func; + unsigned int index; + unsigned int address; + efx_oword_t reg; + efx_oword_t buf; + efx_rc_t rc; + + EFSYS_ASSERT(pattern < EFX_PATTERN_NTYPES); + func = __efx_sram_pattern_fns[pattern]; + + while (count > 0) { + /* Write */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_WRITEO(enp->en_esbp, address, ®, B_TRUE); + + address += rsp->step; + } + + /* Read */ + address = rsp->address; + for (index = 0; index < rsp->rows; ++index) { + func(2 * index + 0, B_FALSE, ®.eo_qword[0]); + func(2 * index + 1, B_FALSE, ®.eo_qword[1]); + EFX_AND_OWORD(reg, rsp->mask); + EFSYS_BAR_READO(enp->en_esbp, address, &buf, B_TRUE); + if (memcmp(®, &buf, sizeof (reg))) { + rc = EIO; + goto fail1; + } + + address += rsp->step; + } + + ++rsp; + --count; + } + + return (0); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + + + __checkReturn efx_rc_t siena_nic_register_test( __in efx_nic_t *enp) { - efx_register_set_t *rsp; + siena_register_set_t *rsp; const uint32_t *dwordp; unsigned int nitems; unsigned int count; @@ -553,21 +687,21 @@ siena_nic_register_test( rsp->mask.eo_u32[3] = *dwordp++; } - if ((rc = efx_nic_test_registers(enp, __siena_registers, + if ((rc = siena_nic_test_registers(enp, __siena_registers, EFX_ARRAY_SIZE(__siena_registers))) != 0) goto fail1; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_ALTERNATE, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail2; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BYTE_CHANGING, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail3; - if ((rc = efx_nic_test_tables(enp, __siena_tables, + if ((rc = siena_nic_test_tables(enp, __siena_tables, EFX_PATTERN_BIT_SWEEP, EFX_ARRAY_SIZE(__siena_tables))) != 0) goto fail4; From owner-svn-src-stable@freebsd.org Fri Dec 21 15:13:00 2018 Return-Path: Delivered-To: svn-src-stable@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 24E08134CB48; Fri, 21 Dec 2018 15:13:00 +0000 (UTC) (envelope-from arybchik@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 8B42F6CC96; Fri, 21 Dec 2018 15:12:59 +0000 (UTC) (envelope-from arybchik@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 9E570F293; Fri, 21 Dec 2018 15:12:58 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFCw6m041653; Fri, 21 Dec 2018 15:12:58 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFCw6w041652; Fri, 21 Dec 2018 15:12:58 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211512.wBLFCw6w041652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342316 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342316 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B42F6CC96 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:13:00 -0000 Author: arybchik Date: Fri Dec 21 15:12:58 2018 New Revision: 342316 URL: https://svnweb.freebsd.org/changeset/base/342316 Log: MFC r340884 sfxge(4): fix probes in licensing support EFSYS_PROBE1 takes one typed value (in addition to the probe name), whereas EFSYS_PROBE has just the probe name. Which to use is determined by the probe name - "fail1" probes are expected to include the function result. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18118 Modified: stable/12/sys/dev/sfxge/common/efx_lic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 15:11:52 2018 (r342315) +++ stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 15:12:58 2018 (r342316) @@ -522,7 +522,7 @@ efx_lic_v1v2_find_key( return (found); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -565,7 +565,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } @@ -1187,7 +1187,7 @@ fail3: fail2: EFSYS_PROBE(fail2); fail1: - EFSYS_PROBE(fail1); + EFSYS_PROBE1(fail1, boolean_t, B_FALSE); return (B_FALSE); } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:14:00 2018 Return-Path: Delivered-To: svn-src-stable@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 B2184134CBE4; Fri, 21 Dec 2018 15:14:00 +0000 (UTC) (envelope-from arybchik@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 592F16CE00; Fri, 21 Dec 2018 15:14:00 +0000 (UTC) (envelope-from arybchik@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 4471CF295; Fri, 21 Dec 2018 15:14:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFE0qg041757; Fri, 21 Dec 2018 15:14:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFE0rn041756; Fri, 21 Dec 2018 15:14:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211514.wBLFE0rn041756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:14:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342317 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 592F16CE00 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:14:00 -0000 Author: arybchik Date: Fri Dec 21 15:13:59 2018 New Revision: 342317 URL: https://svnweb.freebsd.org/changeset/base/342317 Log: MFC r340885 sfxge(4): fix warnings from VS2015 C compiler (C4310) Fix level 4 warning "C4310: cast truncates constant value"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18119 Modified: stable/12/sys/dev/sfxge/common/efx_bootcfg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 21 15:12:58 2018 (r342316) +++ stable/12/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 21 15:13:59 2018 (r342317) @@ -361,7 +361,7 @@ efx_bootcfg_read( rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { - payload[0] = (uint8_t)~DHCP_END; + payload[0] = (uint8_t)(~DHCP_END & 0xff); payload[1] = DHCP_END; used_bytes = 2; } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:15:08 2018 Return-Path: Delivered-To: svn-src-stable@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 08F9A134CCBA; Fri, 21 Dec 2018 15:15:08 +0000 (UTC) (envelope-from arybchik@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 A4C346CF7B; Fri, 21 Dec 2018 15:15:07 +0000 (UTC) (envelope-from arybchik@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 94EE8F299; Fri, 21 Dec 2018 15:15:07 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFF7wH041866; Fri, 21 Dec 2018 15:15:07 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFF7p3041865; Fri, 21 Dec 2018 15:15:07 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211515.wBLFF7p3041865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:15:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342318 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342318 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A4C346CF7B 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.960,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:15:08 -0000 Author: arybchik Date: Fri Dec 21 15:15:07 2018 New Revision: 342318 URL: https://svnweb.freebsd.org/changeset/base/342318 Log: MFC r340886 sfxge(4): fix warnings from VS2015 C compiler (C4244) Fix level 4 warning "C4244: '+=': conversion from 'unsigned int' to 'uint16_t', possible loss of data"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18120 Modified: stable/12/sys/dev/sfxge/common/efx_vpd.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_vpd.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_vpd.c Fri Dec 21 15:13:59 2018 (r342317) +++ stable/12/sys/dev/sfxge/common/efx_vpd.c Fri Dec 21 15:15:07 2018 (r342318) @@ -933,7 +933,7 @@ efx_vpd_hunk_set( } /* Modify tag length (large resource type) */ - taglen += (dest - source); + taglen += (uint16_t)(dest - source); EFX_POPULATE_WORD_1(word, EFX_WORD_0, taglen); data[offset - 2] = EFX_WORD_FIELD(word, EFX_BYTE_0); data[offset - 1] = EFX_WORD_FIELD(word, EFX_BYTE_1); From owner-svn-src-stable@freebsd.org Fri Dec 21 15:53:34 2018 Return-Path: Delivered-To: svn-src-stable@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 9876B134DD08; Fri, 21 Dec 2018 15:53:34 +0000 (UTC) (envelope-from arybchik@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 2E2336E5DC; Fri, 21 Dec 2018 15:53:34 +0000 (UTC) (envelope-from arybchik@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 1F2CFF95F; Fri, 21 Dec 2018 15:53:34 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFrYZj062762; Fri, 21 Dec 2018 15:53:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFrX06062760; Fri, 21 Dec 2018 15:53:33 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211553.wBLFrX06062760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342319 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342319 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 2E2336E5DC 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:53:34 -0000 Author: arybchik Date: Fri Dec 21 15:53:33 2018 New Revision: 342319 URL: https://svnweb.freebsd.org/changeset/base/342319 Log: MFC r340801 sfxge(4): provide information about supported tunnels VXLAN/NVGRE (and Geneve) support is available on SFN8xxx with full-feature firmware variant running. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18071 Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c stable/12/sys/dev/sfxge/common/efx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 15:15:07 2018 (r342318) +++ stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 15:53:33 2018 (r342319) @@ -1117,6 +1117,16 @@ ef10_get_datapath_caps( encp->enc_mac_stats_40g_tx_size_bins = CAP_FLAG2(flags2, MAC_STATS_40G_TX_SIZE_BINS) ? B_TRUE : B_FALSE; + /* + * Check if firmware supports VXLAN and NVGRE tunnels. + * The capability indicates Geneve protocol support as well. + */ + if (CAP_FLAG(flags, VXLAN_NVGRE)) + encp->enc_tunnel_encapsulations_supported = + (1u << EFX_TUNNEL_PROTOCOL_VXLAN) | + (1u << EFX_TUNNEL_PROTOCOL_GENEVE) | + (1u << EFX_TUNNEL_PROTOCOL_NVGRE); + #undef CAP_FLAG #undef CAP_FLAG2 Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:15:07 2018 (r342318) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:53:33 2018 (r342319) @@ -1087,6 +1087,14 @@ efx_bist_stop( #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 +typedef enum efx_tunnel_protocol_e { + EFX_TUNNEL_PROTOCOL_NONE = 0, + EFX_TUNNEL_PROTOCOL_VXLAN, + EFX_TUNNEL_PROTOCOL_GENEVE, + EFX_TUNNEL_PROTOCOL_NVGRE, + EFX_TUNNEL_NPROTOS +} efx_tunnel_protocol_t; + typedef struct efx_nic_cfg_s { uint32_t enc_board_type; uint32_t enc_phy_type; @@ -1184,6 +1192,7 @@ typedef struct efx_nic_cfg_s { boolean_t enc_init_evq_v2_supported; boolean_t enc_pm_and_rxdp_counters; boolean_t enc_mac_stats_40g_tx_size_bins; + uint32_t enc_tunnel_encapsulations_supported; /* External port identifier */ uint8_t enc_external_port; uint32_t enc_mcdi_max_payload_length; From owner-svn-src-stable@freebsd.org Fri Dec 21 15:55:45 2018 Return-Path: Delivered-To: svn-src-stable@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 14260134DE04; Fri, 21 Dec 2018 15:55:45 +0000 (UTC) (envelope-from arybchik@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 AD8F26E785; Fri, 21 Dec 2018 15:55:44 +0000 (UTC) (envelope-from arybchik@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 9B686F963; Fri, 21 Dec 2018 15:55:44 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFtie0062946; Fri, 21 Dec 2018 15:55:44 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFtiDl062945; Fri, 21 Dec 2018 15:55:44 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211555.wBLFtiDl062945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:55:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342320 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342320 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AD8F26E785 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:55:45 -0000 Author: arybchik Date: Fri Dec 21 15:55:44 2018 New Revision: 342320 URL: https://svnweb.freebsd.org/changeset/base/342320 Log: MFC r340802 sfxge(4): use proper MCDI command for encap filters MC_CMD_FILTER_OP_IN_EXT is needed to set filters for encapsulated packets. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18072 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:53:33 2018 (r342319) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:55:44 2018 (r342320) @@ -126,29 +126,29 @@ ef10_filter_init( #define MATCH_MASK(match) (EFX_MASK32(match) << EFX_LOW_BIT(match)) EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_HOST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_IP)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_IP)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_REM_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_SRC_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_SRC_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_MAC == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_MAC)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_MAC)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_LOC_PORT == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_DST_PORT)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_DST_PORT)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_ETHER_TYPE == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_ETHER_TYPE)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_ETHER_TYPE)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_INNER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_INNER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_INNER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_OUTER_VID == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_OUTER_VLAN)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_IP_PROTO)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_MCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == - MATCH_MASK(MC_CMD_FILTER_OP_IN_MATCH_UNKNOWN_UCAST_DST)); + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_UCAST_DST)); #undef MATCH_MASK EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (ef10_filter_table_t), eftp); @@ -189,27 +189,27 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REPLACE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); /* Fall through */ case MC_CMD_FILTER_OP_IN_OP_INSERT: case MC_CMD_FILTER_OP_IN_OP_SUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, filter_op); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, filter_op); break; default: EFSYS_ASSERT(0); @@ -217,63 +217,63 @@ efx_mcdi_filter_op_add( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_PORT_ID, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_PORT_ID, EVB_PORT_ID_ASSIGNED); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_MATCH_FIELDS, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_MATCH_FIELDS, spec->efs_match_flags); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_DEST, - MC_CMD_FILTER_OP_IN_RX_DEST_HOST); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_QUEUE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_DEST, + MC_CMD_FILTER_OP_EXT_IN_RX_DEST_HOST); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_QUEUE, spec->efs_dmaq_id); if (spec->efs_flags & EFX_FILTER_FLAG_RX_RSS) { - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_CONTEXT, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_CONTEXT, spec->efs_rss_context); } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_RX_MODE, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_RX_MODE, spec->efs_flags & EFX_FILTER_FLAG_RX_RSS ? - MC_CMD_FILTER_OP_IN_RX_MODE_RSS : - MC_CMD_FILTER_OP_IN_RX_MODE_SIMPLE); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_TX_DEST, - MC_CMD_FILTER_OP_IN_TX_DEST_DEFAULT); + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_RSS : + MC_CMD_FILTER_OP_EXT_IN_RX_MODE_SIMPLE); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_TX_DEST, + MC_CMD_FILTER_OP_EXT_IN_TX_DEST_DEFAULT); if (filter_op != MC_CMD_FILTER_OP_IN_OP_REPLACE) { /* * NOTE: Unlike most MCDI requests, the filter fields * are presented in network (big endian) byte order. */ - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_MAC), spec->efs_rem_mac, EFX_MAC_ADDR_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_MAC), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_MAC), spec->efs_loc_mac, EFX_MAC_ADDR_LEN); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_SRC_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_SRC_PORT, __CPU_TO_BE_16(spec->efs_rem_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_DST_PORT, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_DST_PORT, __CPU_TO_BE_16(spec->efs_loc_port)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_ETHER_TYPE, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_ETHER_TYPE, __CPU_TO_BE_16(spec->efs_ether_type)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_INNER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_INNER_VLAN, __CPU_TO_BE_16(spec->efs_inner_vid)); - MCDI_IN_SET_WORD(req, FILTER_OP_IN_OUTER_VLAN, + MCDI_IN_SET_WORD(req, FILTER_OP_EXT_IN_OUTER_VLAN, __CPU_TO_BE_16(spec->efs_outer_vid)); /* IP protocol (in low byte, high byte is zero) */ - MCDI_IN_SET_BYTE(req, FILTER_OP_IN_IP_PROTO, + MCDI_IN_SET_BYTE(req, FILTER_OP_EXT_IN_IP_PROTO, spec->efs_ip_proto); EFX_STATIC_ASSERT(sizeof (spec->efs_rem_host) == - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); EFX_STATIC_ASSERT(sizeof (spec->efs_loc_host) == - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_SRC_IP), + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_SRC_IP), &spec->efs_rem_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_SRC_IP_LEN); - memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_IN_DST_IP), + MC_CMD_FILTER_OP_EXT_IN_SRC_IP_LEN); + memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], - MC_CMD_FILTER_OP_IN_DST_IP_LEN); + MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); } efx_mcdi_execute(enp, &req); @@ -283,13 +283,13 @@ efx_mcdi_filter_op_add( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } - handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_LO); - handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_OUT_HANDLE_HI); + handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); + handle->efh_hi = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_HI); return (0); @@ -311,24 +311,24 @@ efx_mcdi_filter_op_delete( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_IN_LEN, - MC_CMD_FILTER_OP_OUT_LEN)]; + uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN)]; efx_rc_t rc; memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; - req.emr_in_length = MC_CMD_FILTER_OP_IN_LEN; + req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MC_CMD_FILTER_OP_OUT_LEN; + req.emr_out_length = MC_CMD_FILTER_OP_EXT_OUT_LEN; switch (filter_op) { case MC_CMD_FILTER_OP_IN_OP_REMOVE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_REMOVE); break; case MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE: - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_OP, + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_OP, MC_CMD_FILTER_OP_IN_OP_UNSUBSCRIBE); break; default: @@ -337,8 +337,8 @@ efx_mcdi_filter_op_delete( goto fail1; } - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_LO, handle->efh_lo); - MCDI_IN_SET_DWORD(req, FILTER_OP_IN_HANDLE_HI, handle->efh_hi); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_LO, handle->efh_lo); + MCDI_IN_SET_DWORD(req, FILTER_OP_EXT_IN_HANDLE_HI, handle->efh_hi); efx_mcdi_execute_quiet(enp, &req); @@ -347,7 +347,7 @@ efx_mcdi_filter_op_delete( goto fail2; } - if (req.emr_out_length_used < MC_CMD_FILTER_OP_OUT_LEN) { + if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; goto fail3; } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:56:42 2018 Return-Path: Delivered-To: svn-src-stable@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 D3AAB134DE94; Fri, 21 Dec 2018 15:56:41 +0000 (UTC) (envelope-from arybchik@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 797986E8DB; Fri, 21 Dec 2018 15:56:41 +0000 (UTC) (envelope-from arybchik@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 6ACBBF966; Fri, 21 Dec 2018 15:56:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFufK1063171; Fri, 21 Dec 2018 15:56:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFueqq063166; Fri, 21 Dec 2018 15:56:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211556.wBLFueqq063166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342321 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342321 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 797986E8DB 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.960,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:56:42 -0000 Author: arybchik Date: Fri Dec 21 15:56:40 2018 New Revision: 342321 URL: https://svnweb.freebsd.org/changeset/base/342321 Log: MFC r340803 sfxge(4): support filters for encapsulated packets This supports filters which match all unicast or multicast inner frames in VXLAN, GENEVE, or NVGRE packets. (Additional fields to match on can be added easily.) Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18073 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_filter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:55:44 2018 (r342320) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:56:40 2018 (r342321) @@ -145,6 +145,10 @@ ef10_filter_init( MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_OUTER_VLAN)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IP_PROTO == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IP_PROTO)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_MCAST_DST)); + EFX_STATIC_ASSERT(EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST == + MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_IFRM_UNKNOWN_UCAST_DST)); EFX_STATIC_ASSERT(EFX_FILTER_MATCH_UNKNOWN_MCAST_DST == MATCH_MASK(MC_CMD_FILTER_OP_EXT_IN_MATCH_UNKNOWN_MCAST_DST)); EFX_STATIC_ASSERT((uint32_t)EFX_FILTER_MATCH_UNKNOWN_UCAST_DST == @@ -274,18 +278,47 @@ efx_mcdi_filter_op_add( memcpy(MCDI_IN2(req, uint8_t, FILTER_OP_EXT_IN_DST_IP), &spec->efs_loc_host.eo_byte[0], MC_CMD_FILTER_OP_EXT_IN_DST_IP_LEN); + + /* + * On Medford, filters for encapsulated packets match based on + * the ether type and IP protocol in the outer frame. In + * addition we need to fill in the VNI or VSID type field. + */ + switch (spec->efs_encap_type) { + case EFX_TUNNEL_PROTOCOL_NONE: + break; + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VNI_TYPE, + spec->efs_encap_type == EFX_TUNNEL_PROTOCOL_VXLAN ? + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_VXLAN : + MC_CMD_FILTER_OP_EXT_IN_VNI_TYPE_GENEVE); + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + MCDI_IN_POPULATE_DWORD_1(req, + FILTER_OP_EXT_IN_VNI_OR_VSID, + FILTER_OP_EXT_IN_VSID_TYPE, + MC_CMD_FILTER_OP_EXT_IN_VSID_TYPE_NVGRE); + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } } efx_mcdi_execute(enp, &req); if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } if (req.emr_out_length_used < MC_CMD_FILTER_OP_EXT_OUT_LEN) { rc = EMSGSIZE; - goto fail3; + goto fail4; } handle->efh_lo = MCDI_OUT_DWORD(req, FILTER_OP_EXT_OUT_HANDLE_LO); @@ -293,6 +326,8 @@ efx_mcdi_filter_op_add( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: @@ -392,6 +427,8 @@ ef10_filter_equal( if (left->efs_ether_type != right->efs_ether_type) return (B_FALSE); if (left->efs_ip_proto != right->efs_ip_proto) + return (B_FALSE); + if (left->efs_encap_type != right->efs_encap_type) return (B_FALSE); return (B_TRUE); Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:55:44 2018 (r342320) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:56:40 2018 (r342321) @@ -2142,6 +2142,7 @@ efx_tx_qdestroy( #define EFX_IPPROTO_TCP 6 #define EFX_IPPROTO_UDP 17 +#define EFX_IPPROTO_GRE 47 /* Use RSS to spread across multiple queues */ #define EFX_FILTER_FLAG_RX_RSS 0x01 @@ -2160,6 +2161,10 @@ efx_tx_qdestroy( typedef unsigned int efx_filter_flags_t; +/* + * Flags which specify the fields to match on. The values are the same as in the + * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. + */ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host * address */ @@ -2174,6 +2179,10 @@ typedef enum efx_filter_match_flags_e { EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport * protocol */ + /* For encapsulated packets, match all multicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, + /* For encapsulated packets, match all unicast inner frames */ + EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, /* Match otherwise-unmatched multicast and broadcast packets */ EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, /* Match otherwise-unmatched unicast packets */ @@ -2199,21 +2208,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + uint32_t efs_match_flags; + uint32_t efs_priority:2; + uint32_t efs_flags:6; + uint32_t efs_dmaq_id:12; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; @@ -2284,6 +2294,11 @@ efx_filter_spec_set_eth_local( __in uint16_t vid, __in const uint8_t *addr); +extern void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type); + extern __checkReturn efx_rc_t efx_filter_spec_set_uc_def( __inout efx_filter_spec_t *spec); @@ -2291,6 +2306,19 @@ efx_filter_spec_set_uc_def( extern __checkReturn efx_rc_t efx_filter_spec_set_mc_def( __inout efx_filter_spec_t *spec); + +typedef enum efx_filter_inner_frame_match_e { + EFX_FILTER_INNER_FRAME_MATCH_OTHER = 0, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST, + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST +} efx_filter_inner_frame_match_t; + +extern __checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match); + #endif /* EFSYS_OPT_FILTER */ Modified: stable/12/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 15:55:44 2018 (r342320) +++ stable/12/sys/dev/sfxge/common/efx_filter.c Fri Dec 21 15:56:40 2018 (r342321) @@ -401,6 +401,17 @@ efx_filter_spec_set_eth_local( return (0); } + void +efx_filter_spec_set_ether_type( + __inout efx_filter_spec_t *spec, + __in uint16_t ether_type) +{ + EFSYS_ASSERT3P(spec, !=, NULL); + + spec->efs_ether_type = ether_type; + spec->efs_match_flags |= EFX_FILTER_MATCH_ETHER_TYPE; +} + /* * Specify matching otherwise-unmatched unicast in a filter specification */ @@ -425,6 +436,63 @@ efx_filter_spec_set_mc_def( spec->efs_match_flags |= EFX_FILTER_MATCH_UNKNOWN_MCAST_DST; return (0); +} + + +__checkReturn efx_rc_t +efx_filter_spec_set_encap_type( + __inout efx_filter_spec_t *spec, + __in efx_tunnel_protocol_t encap_type, + __in efx_filter_inner_frame_match_t inner_frame_match) +{ + uint32_t match_flags = 0; + uint8_t ip_proto; + efx_rc_t rc; + + EFSYS_ASSERT3P(spec, !=, NULL); + + switch (encap_type) { + case EFX_TUNNEL_PROTOCOL_VXLAN: + case EFX_TUNNEL_PROTOCOL_GENEVE: + ip_proto = EFX_IPPROTO_UDP; + break; + case EFX_TUNNEL_PROTOCOL_NVGRE: + ip_proto = EFX_IPPROTO_GRE; + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail1; + } + + switch (inner_frame_match) { + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_UCAST_DST: + match_flags |= EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST; + break; + case EFX_FILTER_INNER_FRAME_MATCH_OTHER: + /* This is for when specific inner frames are to be matched. */ + break; + default: + EFSYS_ASSERT(0); + rc = EINVAL; + goto fail2; + } + + spec->efs_encap_type = encap_type; + spec->efs_ip_proto = ip_proto; + spec->efs_match_flags |= (match_flags | EFX_FILTER_MATCH_IP_PROTO); + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } From owner-svn-src-stable@freebsd.org Fri Dec 21 15:57:40 2018 Return-Path: Delivered-To: svn-src-stable@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 06DBF134DF54; Fri, 21 Dec 2018 15:57:40 +0000 (UTC) (envelope-from arybchik@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 A05DC6EB06; Fri, 21 Dec 2018 15:57:39 +0000 (UTC) (envelope-from arybchik@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 90ACEF967; Fri, 21 Dec 2018 15:57:39 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFvdG1063274; Fri, 21 Dec 2018 15:57:39 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFvdP2063272; Fri, 21 Dec 2018 15:57:39 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211557.wBLFvdP2063272@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:57:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342322 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342322 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A05DC6EB06 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_LONG(-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] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:57:40 -0000 Author: arybchik Date: Fri Dec 21 15:57:38 2018 New Revision: 342322 URL: https://svnweb.freebsd.org/changeset/base/342322 Log: MFC r340804 sfxge(4): insert filters for encapsulated packets On Medford, with full-featured firmware running, encapsulated packets may not be delivered unless filters are inserted for them, as ordinary filters are not applied to encapsulated packets. So filters for encapsulated packets need to be inserted for each class of encapsulated packet. For simplicity, catch-all filters are always inserted. These may match more packets than the OS has asked for, but trying to insert more precise filters increases complexity for little gain. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18074 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c stable/12/sys/dev/sfxge/common/ef10_impl.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:56:40 2018 (r342321) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:57:38 2018 (r342322) @@ -1234,6 +1234,108 @@ fail1: return (rc); } +typedef struct ef10_filter_encap_entry_s { + uint16_t ether_type; + efx_tunnel_protocol_t encap_type; + uint32_t inner_frame_match; +} ef10_filter_encap_entry_t; + +#define EF10_ENCAP_FILTER_ENTRY(ipv, encap_type, inner_frame_match) \ + { EFX_ETHER_TYPE_##ipv, EFX_TUNNEL_PROTOCOL_##encap_type, \ + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_##inner_frame_match } + +static ef10_filter_encap_entry_t ef10_filter_encap_list[] = { + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, VXLAN, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, VXLAN, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, GENEVE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, GENEVE, MCAST_DST), + + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV4, NVGRE, MCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, UCAST_DST), + EF10_ENCAP_FILTER_ENTRY(IPV6, NVGRE, MCAST_DST), +}; + +#undef EF10_ENCAP_FILTER_ENTRY + +static __checkReturn efx_rc_t +ef10_filter_insert_encap_filters( + __in efx_nic_t *enp, + __in boolean_t mulcst, + __in efx_filter_flags_t filter_flags) +{ + ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; + uint32_t i; + efx_rc_t rc; + + EFX_STATIC_ASSERT(EFX_ARRAY_SIZE(ef10_filter_encap_list) <= + EFX_ARRAY_SIZE(table->eft_encap_filter_indexes)); + + /* + * On Medford, full-featured firmware can identify packets as being + * tunnel encapsulated, even if no encapsulated packet offloads are in + * use. When packets are identified as such, ordinary filters are not + * applied, only ones specific to encapsulated packets. Hence we need to + * insert filters for encapsulated packets in order to receive them. + * + * Separate filters need to be inserted for each ether type, + * encapsulation type, and inner frame type (unicast or multicast). To + * keep things simple and reduce the number of filters needed, catch-all + * filters for all combinations of types are inserted, even if + * all_unicst or all_mulcst have not been set. (These catch-all filters + * may well, however, fail to insert on unprivileged functions.) + */ + table->eft_encap_filter_count = 0; + for (i = 0; i < EFX_ARRAY_SIZE(ef10_filter_encap_list); i++) { + efx_filter_spec_t spec; + ef10_filter_encap_entry_t *encap_filter = + &ef10_filter_encap_list[i]; + + /* + * Skip multicast filters if we've not been asked for + * any multicast traffic. + */ + if ((mulcst == B_FALSE) && + (encap_filter->inner_frame_match == + EFX_FILTER_INNER_FRAME_MATCH_UNKNOWN_MCAST_DST)) + continue; + + efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, + filter_flags, + table->eft_default_rxq); + efx_filter_spec_set_ether_type(&spec, encap_filter->ether_type); + rc = efx_filter_spec_set_encap_type(&spec, + encap_filter->encap_type, + encap_filter->inner_frame_match); + if (rc != 0) + goto fail1; + + rc = ef10_filter_add_internal(enp, &spec, B_TRUE, + &table->eft_encap_filter_indexes[ + table->eft_encap_filter_count]); + if (rc != 0) { + if (rc != EACCES) + goto fail2; + } else { + table->eft_encap_filter_count++; + } + } + + return (0); + +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + static void ef10_filter_remove_old( __in efx_nic_t *enp) @@ -1329,6 +1431,12 @@ ef10_filter_reconfigure( } table->eft_mulcst_filter_count = 0; + for (i = 0; i < table->eft_encap_filter_count; i++) { + (void) ef10_filter_delete_internal(enp, + table->eft_encap_filter_indexes[i]); + } + table->eft_encap_filter_count = 0; + return (0); } @@ -1346,6 +1454,10 @@ ef10_filter_reconfigure( ef10_filter_set_entry_auto_old(table, table->eft_mulcst_filter_indexes[i]); } + for (i = 0; i < table->eft_encap_filter_count; i++) { + ef10_filter_set_entry_auto_old(table, + table->eft_encap_filter_indexes[i]); + } /* * Insert or renew unicast filters. @@ -1461,6 +1573,13 @@ ef10_filter_reconfigure( goto fail4; } } + } + + if (encp->enc_tunnel_encapsulations_supported != 0) { + /* Try to insert filters for encapsulated packets. */ + (void) ef10_filter_insert_encap_filters(enp, + mulcst || all_mulcst || brdcst, + filter_flags); } /* Remove old filters which were not renewed */ Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 15:56:40 2018 (r342321) +++ stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 15:57:38 2018 (r342322) @@ -990,6 +990,13 @@ typedef struct ef10_filter_entry_s { /* Allow for the broadcast address to be added to the multicast list */ #define EFX_EF10_FILTER_MULTICAST_FILTERS_MAX (EFX_MAC_MULTICAST_LIST_MAX + 1) +/* + * For encapsulated packets, there is one filter each for each combination of + * IPv4 or IPv6 outer frame, VXLAN, GENEVE or NVGRE packet type, and unicast or + * multicast inner frames. + */ +#define EFX_EF10_FILTER_ENCAP_FILTERS_MAX 12 + typedef struct ef10_filter_table_s { ef10_filter_entry_t eft_entry[EFX_EF10_FILTER_TBL_ROWS]; efx_rxq_t *eft_default_rxq; @@ -1001,6 +1008,9 @@ typedef struct ef10_filter_table_s { EFX_EF10_FILTER_MULTICAST_FILTERS_MAX]; uint32_t eft_mulcst_filter_count; boolean_t eft_using_all_mulcst; + uint32_t eft_encap_filter_indexes[ + EFX_EF10_FILTER_ENCAP_FILTERS_MAX]; + uint32_t eft_encap_filter_count; } ef10_filter_table_t; __checkReturn efx_rc_t From owner-svn-src-stable@freebsd.org Fri Dec 21 15:59:38 2018 Return-Path: Delivered-To: svn-src-stable@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 4712D134E061; Fri, 21 Dec 2018 15:59:38 +0000 (UTC) (envelope-from arybchik@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 E08066EC99; Fri, 21 Dec 2018 15:59:37 +0000 (UTC) (envelope-from arybchik@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 CD42CF96B; Fri, 21 Dec 2018 15:59:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLFxbJu063413; Fri, 21 Dec 2018 15:59:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLFxbmV063411; Fri, 21 Dec 2018 15:59:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211559.wBLFxbmV063411@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 15:59:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342323 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342323 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: E08066EC99 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 15:59:38 -0000 Author: arybchik Date: Fri Dec 21 15:59:37 2018 New Revision: 342323 URL: https://svnweb.freebsd.org/changeset/base/342323 Log: MFC r340887 sfxge(4): fix warnings from VS2015 C compiler (C4245) Fix level 4 warning "C4245: 'initializing': conversion from 'int' to 'uint32_t', signed/unsigned mismatch" warning; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18121 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c stable/12/sys/dev/sfxge/common/efx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:57:38 2018 (r342322) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 15:59:37 2018 (r342323) @@ -992,7 +992,7 @@ ef10_filter_supported_filters( size_t list_length; uint32_t i; efx_rc_t rc; - uint32_t all_filter_flags = + efx_filter_match_flags_t all_filter_flags = (EFX_FILTER_MATCH_REM_HOST | EFX_FILTER_MATCH_LOC_HOST | EFX_FILTER_MATCH_REM_MAC | EFX_FILTER_MATCH_REM_PORT | EFX_FILTER_MATCH_LOC_MAC | EFX_FILTER_MATCH_LOC_PORT | Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:57:38 2018 (r342322) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 15:59:37 2018 (r342323) @@ -2165,29 +2165,37 @@ typedef unsigned int efx_filter_flags_t; * Flags which specify the fields to match on. The values are the same as in the * MC_CMD_FILTER_OP/MC_CMD_FILTER_OP_EXT commands. */ -typedef enum efx_filter_match_flags_e { - EFX_FILTER_MATCH_REM_HOST = 0x0001, /* Match by remote IP host - * address */ - EFX_FILTER_MATCH_LOC_HOST = 0x0002, /* Match by local IP host - * address */ - EFX_FILTER_MATCH_REM_MAC = 0x0004, /* Match by remote MAC address */ - EFX_FILTER_MATCH_REM_PORT = 0x0008, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_MAC = 0x0010, /* Match by remote TCP/UDP port */ - EFX_FILTER_MATCH_LOC_PORT = 0x0020, /* Match by local TCP/UDP port */ - EFX_FILTER_MATCH_ETHER_TYPE = 0x0040, /* Match by Ether-type */ - EFX_FILTER_MATCH_INNER_VID = 0x0080, /* Match by inner VLAN ID */ - EFX_FILTER_MATCH_OUTER_VID = 0x0100, /* Match by outer VLAN ID */ - EFX_FILTER_MATCH_IP_PROTO = 0x0200, /* Match by IP transport - * protocol */ - /* For encapsulated packets, match all multicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST = 0x01000000, - /* For encapsulated packets, match all unicast inner frames */ - EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST = 0x02000000, - /* Match otherwise-unmatched multicast and broadcast packets */ - EFX_FILTER_MATCH_UNKNOWN_MCAST_DST = 0x40000000, - /* Match otherwise-unmatched unicast packets */ - EFX_FILTER_MATCH_UNKNOWN_UCAST_DST = 0x80000000, -} efx_filter_match_flags_t; + +/* Match by remote IP host address */ +#define EFX_FILTER_MATCH_REM_HOST 0x00000001 +/* Match by local IP host address */ +#define EFX_FILTER_MATCH_LOC_HOST 0x00000002 +/* Match by remote MAC address */ +#define EFX_FILTER_MATCH_REM_MAC 0x00000004 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_REM_PORT 0x00000008 +/* Match by remote TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_MAC 0x00000010 +/* Match by local TCP/UDP port */ +#define EFX_FILTER_MATCH_LOC_PORT 0x00000020 +/* Match by Ether-type */ +#define EFX_FILTER_MATCH_ETHER_TYPE 0x00000040 +/* Match by inner VLAN ID */ +#define EFX_FILTER_MATCH_INNER_VID 0x00000080 +/* Match by outer VLAN ID */ +#define EFX_FILTER_MATCH_OUTER_VID 0x00000100 +/* Match by IP transport protocol */ +#define EFX_FILTER_MATCH_IP_PROTO 0x00000200 +/* For encapsulated packets, match all multicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_MCAST_DST 0x01000000 +/* For encapsulated packets, match all unicast inner frames */ +#define EFX_FILTER_MATCH_IFRM_UNKNOWN_UCAST_DST 0x02000000 +/* Match otherwise-unmatched multicast and broadcast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_MCAST_DST 0x40000000 +/* Match otherwise-unmatched unicast packets */ +#define EFX_FILTER_MATCH_UNKNOWN_UCAST_DST 0x80000000 + +typedef uint32_t efx_filter_match_flags_t; typedef enum efx_filter_priority_s { EFX_FILTER_PRI_HINT = 0, /* Performance hint */ From owner-svn-src-stable@freebsd.org Fri Dec 21 16:02:32 2018 Return-Path: Delivered-To: svn-src-stable@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 0C1EA134E32A; Fri, 21 Dec 2018 16:02:32 +0000 (UTC) (envelope-from arybchik@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 A22006F1D6; Fri, 21 Dec 2018 16:02:31 +0000 (UTC) (envelope-from arybchik@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 7F40BFB10; Fri, 21 Dec 2018 16:02:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLG2V8K068359; Fri, 21 Dec 2018 16:02:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLG2U4u068353; Fri, 21 Dec 2018 16:02:30 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211602.wBLG2U4u068353@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:02:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342324 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342324 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: A22006F1D6 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:02:32 -0000 Author: arybchik Date: Fri Dec 21 16:02:29 2018 New Revision: 342324 URL: https://svnweb.freebsd.org/changeset/base/342324 Log: MFC r340888 sfxge(4): fix warnings from VS2015 C compiler (C4100) Fix multiple level 4 warnings "C4100: 'xxx': unreferenced formal parameter" no functional changes. The _NOTE(ARGUNUSED(xxx)) annotations are being exposed to the Visual Studio 2015 C compiler with the following: #define _NOTE_ARGUNUSED(...) UNREFERENCED_PARAMETER((__VA_ARGS__)); #define _NOTE(_annotation) _NOTE_ ## _annotation Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D18122 Modified: stable/12/sys/dev/sfxge/common/ef10_nvram.c stable/12/sys/dev/sfxge/common/ef10_rx.c stable/12/sys/dev/sfxge/common/ef10_tx.c stable/12/sys/dev/sfxge/common/efx_ev.c stable/12/sys/dev/sfxge/common/efx_lic.c stable/12/sys/dev/sfxge/common/efx_mcdi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 16:02:29 2018 (r342324) @@ -675,6 +675,7 @@ ef10_nvram_buffer_validate( int pos; efx_rc_t rc; + _NOTE(ARGUNUSED(enp, partn)) EFX_STATIC_ASSERT(sizeof (*header) <= EF10_NVRAM_CHUNK); if ((partn_data == NULL) || (partn_size == 0)) { @@ -1284,6 +1285,8 @@ ef10_nvram_buf_read_tlv( size_t length; caddr_t value; efx_rc_t rc; + + _NOTE(ARGUNUSED(enp)) if ((seg_data == NULL) || (max_seg_size == 0)) { rc = EINVAL; Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 16:02:29 2018 (r342324) @@ -657,6 +657,8 @@ ef10_rx_qpost( unsigned int offset; unsigned int id; + _NOTE(ARGUNUSED(completed)) + /* The client driver must not overfill the queue */ EFSYS_ASSERT3U(added - completed + n, <=, EFX_RXQ_LIMIT(erp->er_mask + 1)); Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 16:02:29 2018 (r342324) @@ -590,6 +590,8 @@ ef10_tx_qdesc_dma_create( __in boolean_t eop, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + /* No limitations on boundary crossing */ EFSYS_ASSERT(size <= etp->et_enp->en_nic_cfg.enc_tx_dma_desc_size_max); @@ -613,6 +615,8 @@ ef10_tx_qdesc_tso_create( __in uint8_t tcp_flags, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE4(tx_desc_tso_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint8_t, tcp_flags); @@ -635,6 +639,8 @@ ef10_tx_qdesc_tso2_create( __out_ecount(count) efx_desc_t *edp, __in int count) { + _NOTE(ARGUNUSED(etp, count)) + EFSYS_PROBE4(tx_desc_tso2_create, unsigned int, etp->et_index, uint16_t, ipv4_id, uint32_t, tcp_seq, uint16_t, tcp_mss); @@ -664,6 +670,8 @@ ef10_tx_qdesc_vlantci_create( __in uint16_t tci, __out efx_desc_t *edp) { + _NOTE(ARGUNUSED(etp)) + EFSYS_PROBE2(tx_desc_vlantci_create, unsigned int, etp->et_index, uint16_t, tci); Modified: stable/12/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 16:02:29 2018 (r342324) @@ -1421,6 +1421,8 @@ efx_ev_qstat_name( __in efx_nic_t *enp, __in unsigned int id) { + _NOTE(ARGUNUSED(enp)) + EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(id, <, EV_NQSTATS); Modified: stable/12/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 16:02:29 2018 (r342324) @@ -587,7 +587,7 @@ efx_lic_v1v2_read_key( { efx_rc_t rc; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(length <= (EFX_LICENSE_V1V2_PAYLOAD_LENGTH_MAX + EFX_LICENSE_V1V2_HEADER_LENGTH)); @@ -659,7 +659,7 @@ efx_lic_v1v2_delete_key( uint32_t move_start = offset + length; uint32_t move_length = end - move_start; - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(end <= buffer_size); /* Shift everything after the key down */ @@ -678,7 +678,7 @@ efx_lic_v1v2_create_partition( __in size_t buffer_size ) { - _NOTE(ARGUNUSED(enp)) + _NOTE(ARGUNUSED(enp, buffer_size)) EFSYS_ASSERT(EFX_LICENSE_V1V2_HEADER_LENGTH <= buffer_size); /* Write terminator */ Modified: stable/12/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 21 15:59:37 2018 (r342323) +++ stable/12/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 21 16:02:29 2018 (r342324) @@ -814,6 +814,8 @@ efx_mcdi_get_proxy_handle( { efx_rc_t rc; + _NOTE(ARGUNUSED(enp)) + /* * Return proxy handle from MCDI request that returned with error * MC_MCD_ERR_PROXY_PENDING. This handle is used to wait for a matching From owner-svn-src-stable@freebsd.org Fri Dec 21 16:06:26 2018 Return-Path: Delivered-To: svn-src-stable@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 B35F3134E4DF; Fri, 21 Dec 2018 16:06:26 +0000 (UTC) (envelope-from arybchik@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 5037E6F508; Fri, 21 Dec 2018 16:06:26 +0000 (UTC) (envelope-from arybchik@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 37998FB1F; Fri, 21 Dec 2018 16:06:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLG6Qlf068748; Fri, 21 Dec 2018 16:06:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLG6P9R068744; Fri, 21 Dec 2018 16:06:25 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211606.wBLG6P9R068744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:06:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342325 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5037E6F508 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:06:27 -0000 Author: arybchik Date: Fri Dec 21 16:06:25 2018 New Revision: 342325 URL: https://svnweb.freebsd.org/changeset/base/342325 Log: MFC r340889 sfxge(4): fix warnings from VS2015 C compiler (C4189) Fix multiple level 4 warnings "C4189: 'xxx': local variable is initialized but not referenced"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18123 Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c stable/12/sys/dev/sfxge/common/efx_ev.c stable/12/sys/dev/sfxge/common/efx_tx.c stable/12/sys/dev/sfxge/common/mcdi_mon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 16:02:29 2018 (r342324) +++ stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 16:06:25 2018 (r342325) @@ -576,7 +576,7 @@ ef10_ev_qdestroy( EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) efx_mcdi_fini_evq(eep->ee_enp, eep->ee_index); + (void) efx_mcdi_fini_evq(enp, eep->ee_index); } __checkReturn efx_rc_t @@ -1255,6 +1255,7 @@ ef10_ev_rxlabel_init( { efx_evq_rxq_state_t *eersp; + _NOTE(ARGUNUSED(type)) EFSYS_ASSERT3U(label, <, EFX_ARRAY_SIZE(eep->ee_rxq_state)); eersp = &eep->ee_rxq_state[label]; Modified: stable/12/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 16:02:29 2018 (r342324) +++ stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 16:06:25 2018 (r342325) @@ -228,14 +228,14 @@ efx_ev_qcreate( __deref_out efx_evq_t **eepp) { const efx_ev_ops_t *eevop = enp->en_eevop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_evq_t *eep; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_EV); - EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, encp->enc_evq_limit); + EFSYS_ASSERT3U(enp->en_ev_qcount + 1, <, + enp->en_nic_cfg.enc_evq_limit); switch (flags & EFX_EVQ_FLAGS_NOTIFY_MASK) { case EFX_EVQ_FLAGS_NOTIFY_INTERRUPT: Modified: stable/12/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 16:02:29 2018 (r342324) +++ stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 16:06:25 2018 (r342325) @@ -303,14 +303,14 @@ efx_tx_qcreate( __out unsigned int *addedp) { const efx_tx_ops_t *etxop = enp->en_etxop; - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_txq_t *etp; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_TX); - EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, encp->enc_txq_limit); + EFSYS_ASSERT3U(enp->en_tx_qcount + 1, <, + enp->en_nic_cfg.enc_txq_limit); /* Allocate an TXQ object */ EFSYS_KMEM_ALLOC(enp->en_esip, sizeof (efx_txq_t), etp); Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:02:29 2018 (r342324) +++ stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:06:25 2018 (r342325) @@ -265,7 +265,6 @@ mcdi_mon_ev( __out efx_mon_stat_value_t *valuep) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - efx_nic_cfg_t *encp = &(enp->en_nic_cfg); uint16_t port_mask; uint16_t sensor; uint16_t state; @@ -281,11 +280,13 @@ mcdi_mon_ev( value = (uint16_t)MCDI_EV_FIELD(eqp, SENSOREVT_VALUE); /* Hardware must support this MCDI sensor */ - EFSYS_ASSERT3U(sensor, <, (8 * encp->enc_mcdi_sensor_mask_size)); + EFSYS_ASSERT3U(sensor, <, + (8 * enp->en_nic_cfg.enc_mcdi_sensor_mask_size)); EFSYS_ASSERT((sensor % MCDI_MON_PAGE_SIZE) != MC_CMD_SENSOR_PAGE0_NEXT); - EFSYS_ASSERT(encp->enc_mcdi_sensor_maskp != NULL); - EFSYS_ASSERT((encp->enc_mcdi_sensor_maskp[sensor / MCDI_MON_PAGE_SIZE] & - (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); + EFSYS_ASSERT(enp->en_nic_cfg.enc_mcdi_sensor_maskp != NULL); + EFSYS_ASSERT( + (enp->en_nic_cfg.enc_mcdi_sensor_maskp[sensor/MCDI_MON_PAGE_SIZE] & + (1U << (sensor % MCDI_MON_PAGE_SIZE))) != 0); /* But we don't have to understand it */ if (sensor >= EFX_ARRAY_SIZE(mcdi_sensor_map)) { From owner-svn-src-stable@freebsd.org Fri Dec 21 16:07:14 2018 Return-Path: Delivered-To: svn-src-stable@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 73117134E598; Fri, 21 Dec 2018 16:07:14 +0000 (UTC) (envelope-from arybchik@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 DE76D6F69D; Fri, 21 Dec 2018 16:07:13 +0000 (UTC) (envelope-from arybchik@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 BDA2FFB21; Fri, 21 Dec 2018 16:07:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLG7DwZ068840; Fri, 21 Dec 2018 16:07:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLG7D0a068839; Fri, 21 Dec 2018 16:07:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211607.wBLG7D0a068839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:07:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342326 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342326 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DE76D6F69D 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:07:14 -0000 Author: arybchik Date: Fri Dec 21 16:07:13 2018 New Revision: 342326 URL: https://svnweb.freebsd.org/changeset/base/342326 Log: MFC r340890 sfxge(4): fix warnings from VS2015 C compiler (C4057) Fix two level 4 warnings "C4057: 'function': 'const uint8_t *' differs in indirection to slightly different base types from 'caddr_t'"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18124 Modified: stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_bootcfg.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 16:06:25 2018 (r342325) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 16:07:13 2018 (r342326) @@ -1466,13 +1466,13 @@ efx_bootcfg_copy_sector( extern efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size); extern efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size); #endif /* EFSYS_OPT_BOOTCFG */ Modified: stable/12/sys/dev/sfxge/common/efx_bootcfg.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 21 16:06:25 2018 (r342325) +++ stable/12/sys/dev/sfxge/common/efx_bootcfg.c Fri Dec 21 16:07:13 2018 (r342326) @@ -295,7 +295,7 @@ fail1: efx_rc_t efx_bootcfg_read( __in efx_nic_t *enp, - __out_bcount(size) caddr_t data, + __out_bcount(size) uint8_t *data, __in size_t size) { uint8_t *payload = NULL; @@ -358,7 +358,7 @@ efx_bootcfg_read( goto fail7; /* Verify that the area is correctly formatted and checksummed */ - rc = efx_bootcfg_verify(enp, (caddr_t)payload, sector_length, + rc = efx_bootcfg_verify(enp, payload, sector_length, &used_bytes); if (rc != 0 || used_bytes == 0) { payload[0] = (uint8_t)(~DHCP_END & 0xff); @@ -435,7 +435,7 @@ fail1: efx_rc_t efx_bootcfg_write( __in efx_nic_t *enp, - __in_bcount(size) caddr_t data, + __in_bcount(size) uint8_t *data, __in size_t size) { uint8_t *partn_data; From owner-svn-src-stable@freebsd.org Fri Dec 21 16:08:50 2018 Return-Path: Delivered-To: svn-src-stable@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 49FFC134E75F; Fri, 21 Dec 2018 16:08:50 +0000 (UTC) (envelope-from arybchik@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 DD5306F974; Fri, 21 Dec 2018 16:08:49 +0000 (UTC) (envelope-from arybchik@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 ADDC3FB28; Fri, 21 Dec 2018 16:08:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLG8nGH069103; Fri, 21 Dec 2018 16:08:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLG8ndR069102; Fri, 21 Dec 2018 16:08:49 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211608.wBLG8ndR069102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:08:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342327 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342327 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DD5306F974 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:08:50 -0000 Author: arybchik Date: Fri Dec 21 16:08:49 2018 New Revision: 342327 URL: https://svnweb.freebsd.org/changeset/base/342327 Log: MFC r340891 sfxge(4): fix warnings from VS2015 C compiler (C4214) Fix multiple level 4 warnings "C4214: nonstandard extension used: bit field types other than int"; no functional changes. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18125 Modified: stable/12/sys/dev/sfxge/common/efx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 16:07:13 2018 (r342326) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 16:08:49 2018 (r342327) @@ -2159,7 +2159,7 @@ efx_tx_qdestroy( /* Filter is for TX */ #define EFX_FILTER_FLAG_TX 0x10 -typedef unsigned int efx_filter_flags_t; +typedef uint8_t efx_filter_flags_t; /* * Flags which specify the fields to match on. The values are the same as in the @@ -2216,22 +2216,22 @@ typedef enum efx_filter_priority_s { */ typedef struct efx_filter_spec_s { - uint32_t efs_match_flags; - uint32_t efs_priority:2; - uint32_t efs_flags:6; - uint32_t efs_dmaq_id:12; - uint32_t efs_rss_context; - uint16_t efs_outer_vid; - uint16_t efs_inner_vid; - uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; - uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; - uint16_t efs_ether_type; - uint8_t efs_ip_proto; - efx_tunnel_protocol_t efs_encap_type; - uint16_t efs_loc_port; - uint16_t efs_rem_port; - efx_oword_t efs_rem_host; - efx_oword_t efs_loc_host; + efx_filter_match_flags_t efs_match_flags; + uint8_t efs_priority; + efx_filter_flags_t efs_flags; + uint16_t efs_dmaq_id; + uint32_t efs_rss_context; + uint16_t efs_outer_vid; + uint16_t efs_inner_vid; + uint8_t efs_loc_mac[EFX_MAC_ADDR_LEN]; + uint8_t efs_rem_mac[EFX_MAC_ADDR_LEN]; + uint16_t efs_ether_type; + uint8_t efs_ip_proto; + efx_tunnel_protocol_t efs_encap_type; + uint16_t efs_loc_port; + uint16_t efs_rem_port; + efx_oword_t efs_rem_host; + efx_oword_t efs_loc_host; } efx_filter_spec_t; From owner-svn-src-stable@freebsd.org Fri Dec 21 16:10:32 2018 Return-Path: Delivered-To: svn-src-stable@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 130C7134E823; Fri, 21 Dec 2018 16:10:32 +0000 (UTC) (envelope-from arybchik@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 AEB006FAE5; Fri, 21 Dec 2018 16:10:31 +0000 (UTC) (envelope-from arybchik@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 A130DFB2D; Fri, 21 Dec 2018 16:10:31 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGAVJ7069264; Fri, 21 Dec 2018 16:10:31 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGAVmD069263; Fri, 21 Dec 2018 16:10:31 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211610.wBLGAVmD069263@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:10:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342328 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AEB006FAE5 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:10:32 -0000 Author: arybchik Date: Fri Dec 21 16:10:31 2018 New Revision: 342328 URL: https://svnweb.freebsd.org/changeset/base/342328 Log: MFC r340892 sfxge(4): remove obsolete check for pre-Siena hardware The fail4 label was used twice, so it doesn't need removing. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18126 Modified: stable/12/sys/dev/sfxge/common/efx_rx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_rx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_rx.c Fri Dec 21 16:08:49 2018 (r342327) +++ stable/12/sys/dev/sfxge/common/efx_rx.c Fri Dec 21 16:10:31 2018 (r342328) @@ -1166,10 +1166,6 @@ siena_rx_qcreate( #if EFSYS_OPT_RX_SCATTER case EFX_RXQ_TYPE_SCATTER: - if (enp->en_family < EFX_FAMILY_SIENA) { - rc = EINVAL; - goto fail4; - } jumbo = B_TRUE; break; #endif /* EFSYS_OPT_RX_SCATTER */ From owner-svn-src-stable@freebsd.org Fri Dec 21 16:11:19 2018 Return-Path: Delivered-To: svn-src-stable@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 3D160134E8BE; Fri, 21 Dec 2018 16:11:19 +0000 (UTC) (envelope-from arybchik@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 03C386FCAA; Fri, 21 Dec 2018 16:11:19 +0000 (UTC) (envelope-from arybchik@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 EA286FC89; Fri, 21 Dec 2018 16:11:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGBIdT072346; Fri, 21 Dec 2018 16:11:18 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGBIU5072345; Fri, 21 Dec 2018 16:11:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211611.wBLGBIU5072345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:11:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342329 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342329 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 03C386FCAA 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:11:19 -0000 Author: arybchik Date: Fri Dec 21 16:11:18 2018 New Revision: 342329 URL: https://svnweb.freebsd.org/changeset/base/342329 Log: MFC r340894 sfxge(4): fix PreFAST static analysis warning (C6001) Fix warning "C6001: Using uninitialized memory '*sensor_maskp'" which could occur when the npages argument to efx_mcdi_sensor_info() is less than or equal to zero. Submitted by: Andrew Lee Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18128 Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:10:31 2018 (r342328) +++ stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:11:18 2018 (r342329) @@ -397,6 +397,11 @@ efx_mcdi_sensor_info( EFSYS_ASSERT(sensor_maskp != NULL); + if (npages < 1) { + rc = EINVAL; + goto fail1; + } + for (page = 0; page < npages; page++) { uint32_t mask; @@ -413,7 +418,7 @@ efx_mcdi_sensor_info( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail1; + goto fail2; } mask = MCDI_OUT_DWORD(req, SENSOR_INFO_OUT_MASK); @@ -421,18 +426,20 @@ efx_mcdi_sensor_info( if ((page != (npages - 1)) && ((mask & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) == 0)) { rc = EINVAL; - goto fail2; + goto fail3; } sensor_maskp[page] = mask; } if (sensor_maskp[npages - 1] & (1U << MC_CMD_SENSOR_PAGE0_NEXT)) { rc = EINVAL; - goto fail3; + goto fail4; } return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-stable@freebsd.org Fri Dec 21 16:13:01 2018 Return-Path: Delivered-To: svn-src-stable@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 2D573134EACF; Fri, 21 Dec 2018 16:13:01 +0000 (UTC) (envelope-from arybchik@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 C75537002F; Fri, 21 Dec 2018 16:13:00 +0000 (UTC) (envelope-from arybchik@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 B8F11FCE2; Fri, 21 Dec 2018 16:13:00 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGD0OY074248; Fri, 21 Dec 2018 16:13:00 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGD07g074245; Fri, 21 Dec 2018 16:13:00 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211613.wBLGD07g074245@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:13:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342330 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342330 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C75537002F 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:13:01 -0000 Author: arybchik Date: Fri Dec 21 16:12:59 2018 New Revision: 342330 URL: https://svnweb.freebsd.org/changeset/base/342330 Log: MFC r340895 sfxge(4): move BIU test code into Siena-specific file Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18129 Modified: stable/12/sys/dev/sfxge/common/efx_impl.h stable/12/sys/dev/sfxge/common/efx_nic.c stable/12/sys/dev/sfxge/common/siena_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:11:18 2018 (r342329) +++ stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:12:59 2018 (r342330) @@ -1050,10 +1050,6 @@ struct efx_txq_s { } while (B_FALSE) extern __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp); - -extern __checkReturn efx_rc_t efx_mac_select( __in efx_nic_t *enp); Modified: stable/12/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 16:11:18 2018 (r342329) +++ stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 16:12:59 2018 (r342330) @@ -107,78 +107,6 @@ efx_family( return (ENOTSUP); } - -#define EFX_BIU_MAGIC0 0x01234567 -#define EFX_BIU_MAGIC1 0xfedcba98 - - __checkReturn efx_rc_t -efx_nic_biu_test( - __in efx_nic_t *enp) -{ - efx_oword_t oword; - efx_rc_t rc; - - /* - * Write magic values to scratch registers 0 and 1, then - * verify that the values were written correctly. Interleave - * the accesses to ensure that the BIU is not just reading - * back the cached value that was last written. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail1; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail2; - } - - /* - * Perform the same test, with the values swapped. This - * ensures that subsequent tests don't start with the correct - * values already written into the scratch registers. - */ - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC1); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - - EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, EFX_BIU_MAGIC0); - EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC1) { - rc = EIO; - goto fail3; - } - - EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); - if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != EFX_BIU_MAGIC0) { - rc = EIO; - goto fail4; - } - - return (0); - -fail4: - EFSYS_PROBE(fail4); -fail3: - EFSYS_PROBE(fail3); -fail2: - EFSYS_PROBE(fail2); -fail1: - EFSYS_PROBE1(fail1, efx_rc_t, rc); - - return (rc); -} - #if EFSYS_OPT_SIENA static const efx_nic_ops_t __efx_nic_siena_ops = { Modified: stable/12/sys/dev/sfxge/common/siena_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 16:11:18 2018 (r342329) +++ stable/12/sys/dev/sfxge/common/siena_nic.c Fri Dec 21 16:12:59 2018 (r342330) @@ -213,6 +213,77 @@ fail1: return (rc); } +#define SIENA_BIU_MAGIC0 0x01234567 +#define SIENA_BIU_MAGIC1 0xfedcba98 + +static __checkReturn efx_rc_t +siena_nic_biu_test( + __in efx_nic_t *enp) +{ + efx_oword_t oword; + efx_rc_t rc; + + /* + * Write magic values to scratch registers 0 and 1, then + * verify that the values were written correctly. Interleave + * the accesses to ensure that the BIU is not just reading + * back the cached value that was last written. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail1; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail2; + } + + /* + * Perform the same test, with the values swapped. This + * ensures that subsequent tests don't start with the correct + * values already written into the scratch registers. + */ + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC1); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + + EFX_POPULATE_OWORD_1(oword, FRF_AZ_DRIVER_DW0, SIENA_BIU_MAGIC0); + EFX_BAR_TBL_WRITEO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 0, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC1) { + rc = EIO; + goto fail3; + } + + EFX_BAR_TBL_READO(enp, FR_AZ_DRIVER_REG, 1, &oword, B_TRUE); + if (EFX_OWORD_FIELD(oword, FRF_AZ_DRIVER_DW0) != SIENA_BIU_MAGIC0) { + rc = EIO; + goto fail4; + } + + return (0); + +fail4: + EFSYS_PROBE(fail4); +fail3: + EFSYS_PROBE(fail3); +fail2: + EFSYS_PROBE(fail2); +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); +} + __checkReturn efx_rc_t siena_nic_probe( __in efx_nic_t *enp) @@ -227,7 +298,7 @@ siena_nic_probe( EFSYS_ASSERT3U(enp->en_family, ==, EFX_FAMILY_SIENA); /* Test BIU */ - if ((rc = efx_nic_biu_test(enp)) != 0) + if ((rc = siena_nic_biu_test(enp)) != 0) goto fail1; /* Clear the region register */ From owner-svn-src-stable@freebsd.org Fri Dec 21 16:13:50 2018 Return-Path: Delivered-To: svn-src-stable@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 0A6DC134EB2C; Fri, 21 Dec 2018 16:13:50 +0000 (UTC) (envelope-from arybchik@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 5BC587016F; Fri, 21 Dec 2018 16:13:49 +0000 (UTC) (envelope-from arybchik@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 2071CFCE4; Fri, 21 Dec 2018 16:13:49 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGDnwj074355; Fri, 21 Dec 2018 16:13:49 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGDmhY074352; Fri, 21 Dec 2018 16:13:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211613.wBLGDmhY074352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:13:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342331 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342331 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BC587016F 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:13:50 -0000 Author: arybchik Date: Fri Dec 21 16:13:48 2018 New Revision: 342331 URL: https://svnweb.freebsd.org/changeset/base/342331 Log: MFC r340896 sfxge(4): remove Falcon-specific concurrency check Falcon support has been withdrawn from libefx, however, there is still an obsolete Falcon-specific assertion that efx_mac_stats_upload() and efx_port_poll() aren't concurrent. To be consistent with an overall Falcon support revocation it's desirable to remove it. Fix debug build invalid assertion failure. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18130 Modified: stable/12/sys/dev/sfxge/common/efx_impl.h stable/12/sys/dev/sfxge/common/efx_mac.c stable/12/sys/dev/sfxge/common/efx_port.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:12:59 2018 (r342330) +++ stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:13:48 2018 (r342331) @@ -287,7 +287,6 @@ typedef struct efx_port_s { uint32_t ep_default_adv_cap_mask; uint32_t ep_phy_cap_mask; boolean_t ep_mac_drain; - boolean_t ep_mac_stats_pending; #if EFSYS_OPT_BIST efx_bist_type_t ep_current_bist; #endif Modified: stable/12/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_mac.c Fri Dec 21 16:12:59 2018 (r342330) +++ stable/12/sys/dev/sfxge/common/efx_mac.c Fri Dec 21 16:13:48 2018 (r342331) @@ -731,16 +731,9 @@ efx_mac_stats_upload( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - /* - * Don't assert !ep_mac_stats_pending, because the client might - * have failed to finalise statistics when previously stopping - * the port. - */ if ((rc = emop->emo_stats_upload(enp, esmp)) != 0) goto fail1; - epp->ep_mac_stats_pending = B_TRUE; - return (0); fail1: @@ -800,8 +793,6 @@ efx_mac_stats_update( EFSYS_ASSERT(emop != NULL); rc = emop->emo_stats_update(enp, esmp, essp, generationp); - if (rc == 0) - epp->ep_mac_stats_pending = B_FALSE; return (rc); } Modified: stable/12/sys/dev/sfxge/common/efx_port.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:12:59 2018 (r342330) +++ stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:13:48 2018 (r342331) @@ -114,7 +114,6 @@ efx_port_poll( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PORT); EFSYS_ASSERT(emop != NULL); - EFSYS_ASSERT(!epp->ep_mac_stats_pending); if (link_modep == NULL) link_modep = &ignore_link_mode; From owner-svn-src-stable@freebsd.org Fri Dec 21 16:20:13 2018 Return-Path: Delivered-To: svn-src-stable@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 D8C07134ED0F; Fri, 21 Dec 2018 16:20:13 +0000 (UTC) (envelope-from arybchik@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 7ECA47046E; Fri, 21 Dec 2018 16:20:13 +0000 (UTC) (envelope-from arybchik@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 6F117FCF0; Fri, 21 Dec 2018 16:20:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGKDoi074807; Fri, 21 Dec 2018 16:20:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGKDcW074806; Fri, 21 Dec 2018 16:20:13 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211620.wBLGKDcW074806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342332 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342332 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7ECA47046E 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:20:14 -0000 Author: arybchik Date: Fri Dec 21 16:20:13 2018 New Revision: 342332 URL: https://svnweb.freebsd.org/changeset/base/342332 Log: MFC r341197 sfxge(4): fix comparison always true warning Loopback type used as bit index has efx_loopback_type_t type which is enum. clang complains that it is always true when it is compared with qword (64 bit) bits number boundary. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18228 Modified: stable/12/sys/dev/sfxge/common/efx_port.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_port.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:13:48 2018 (r342331) +++ stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:20:13 2018 (r342332) @@ -149,7 +149,7 @@ efx_port_loopback_set( EFSYS_ASSERT(link_mode < EFX_LINK_NMODES); if (EFX_TEST_QWORD_BIT(encp->enc_loopback_types[link_mode], - loopback_type) == 0) { + (int)loopback_type) == 0) { rc = ENOTSUP; goto fail1; } From owner-svn-src-stable@freebsd.org Fri Dec 21 16:21:22 2018 Return-Path: Delivered-To: svn-src-stable@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 120F3134EEB6; Fri, 21 Dec 2018 16:21:22 +0000 (UTC) (envelope-from arybchik@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 ADEF970650; Fri, 21 Dec 2018 16:21:21 +0000 (UTC) (envelope-from arybchik@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 85197FD39; Fri, 21 Dec 2018 16:21:21 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGLLFw077160; Fri, 21 Dec 2018 16:21:21 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGLK6n077155; Fri, 21 Dec 2018 16:21:20 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211621.wBLGLK6n077155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:21:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342333 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342333 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: ADEF970650 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_LONG(-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] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:21:22 -0000 Author: arybchik Date: Fri Dec 21 16:21:19 2018 New Revision: 342333 URL: https://svnweb.freebsd.org/changeset/base/342333 Log: MFC r341213 sfxge(4): fix PreFAST warnings because of unused return Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18244 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c stable/12/sys/dev/sfxge/common/ef10_mac.c stable/12/sys/dev/sfxge/common/ef10_nic.c stable/12/sys/dev/sfxge/common/ef10_nvram.c stable/12/sys/dev/sfxge/common/ef10_tx.c stable/12/sys/dev/sfxge/common/efx_port.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:21:19 2018 (r342333) @@ -1054,12 +1054,15 @@ ef10_filter_insert_unicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, addr); + rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, + addr); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_unicst_filter_count++; EFSYS_ASSERT(eftp->eft_unicst_filter_count <= @@ -1067,6 +1070,8 @@ ef10_filter_insert_unicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -1085,11 +1090,13 @@ ef10_filter_insert_all_unicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_uc_def(&spec); + rc = efx_filter_spec_set_uc_def(&spec); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_unicst_filter_indexes[eftp->eft_unicst_filter_count]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_unicst_filter_count++; EFSYS_ASSERT(eftp->eft_unicst_filter_count <= @@ -1097,6 +1104,8 @@ ef10_filter_insert_all_unicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); return (rc); @@ -1138,9 +1147,21 @@ ef10_filter_insert_multicast_list( filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_eth_local(&spec, + rc = efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, &addrs[i * EFX_MAC_ADDR_LEN]); + if (rc != 0) { + if (rollback == B_TRUE) { + /* Only stop upon failure if told to rollback */ + goto rollback; + } else { + /* + * Don't try to add a filter with a corrupt + * specification. + */ + continue; + } + } rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &filter_index); @@ -1163,8 +1184,12 @@ ef10_filter_insert_multicast_list( eftp->eft_default_rxq); EFX_MAC_BROADCAST_ADDR_SET(addr); - efx_filter_spec_set_eth_local(&spec, EFX_FILTER_SPEC_VID_UNSPEC, - addr); + rc = efx_filter_spec_set_eth_local(&spec, + EFX_FILTER_SPEC_VID_UNSPEC, addr); + if ((rc != 0) && (rollback == B_TRUE)) { + /* Only stop upon failure if told to rollback */ + goto rollback; + } rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &filter_index); @@ -1212,12 +1237,14 @@ ef10_filter_insert_all_multicast( efx_filter_spec_init_rx(&spec, EFX_FILTER_PRI_AUTO, filter_flags, eftp->eft_default_rxq); - efx_filter_spec_set_mc_def(&spec); + rc = efx_filter_spec_set_mc_def(&spec); + if (rc != 0) + goto fail1; rc = ef10_filter_add_internal(enp, &spec, B_TRUE, &eftp->eft_mulcst_filter_indexes[0]); if (rc != 0) - goto fail1; + goto fail2; eftp->eft_mulcst_filter_count = 1; eftp->eft_using_all_mulcst = B_TRUE; @@ -1228,6 +1255,8 @@ ef10_filter_insert_all_multicast( return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: stable/12/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:21:19 2018 (r342333) @@ -438,7 +438,7 @@ ef10_mac_filter_default_rxq_clear( ef10_filter_default_rxq_clear(enp); - efx_filter_reconfigure(enp, epp->ep_mac_addr, + (void) efx_filter_reconfigure(enp, epp->ep_mac_addr, epp->ep_all_unicst, epp->ep_mulcst, epp->ep_all_mulcst, epp->ep_brdcst, epp->ep_mulcst_addr_list, Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 16:21:19 2018 (r342333) @@ -823,7 +823,7 @@ fail1: for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; - efx_mcdi_free_piobuf(enp, *handlep); + (void) efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } enp->en_arch.ef10.ena_piobuf_count = 0; @@ -840,7 +840,7 @@ ef10_nic_free_piobufs( for (i = 0; i < enp->en_arch.ef10.ena_piobuf_count; i++) { handlep = &enp->en_arch.ef10.ena_piobuf_handle[i]; - efx_mcdi_free_piobuf(enp, *handlep); + (void) efx_mcdi_free_piobuf(enp, *handlep); *handlep = EFX_PIOBUF_HANDLE_INVALID; } enp->en_arch.ef10.ena_piobuf_count = 0; Modified: stable/12/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 16:21:19 2018 (r342333) @@ -1831,7 +1831,7 @@ ef10_nvram_partn_write_segment_tlv( goto fail7; /* Unlock the partition */ - ef10_nvram_partn_unlock(enp, partn, NULL); + (void) ef10_nvram_partn_unlock(enp, partn, NULL); EFSYS_KMEM_FREE(enp->en_esip, partn_size, partn_data); @@ -1846,7 +1846,7 @@ fail5: fail4: EFSYS_PROBE(fail4); - ef10_nvram_partn_unlock(enp, partn, NULL); + (void) ef10_nvram_partn_unlock(enp, partn, NULL); fail3: EFSYS_PROBE(fail3); Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 16:21:19 2018 (r342333) @@ -289,7 +289,7 @@ ef10_tx_qpio_enable( fail3: EFSYS_PROBE(fail3); - ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + (void) ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); fail2: EFSYS_PROBE(fail2); etp->et_pio_size = 0; @@ -307,10 +307,12 @@ ef10_tx_qpio_disable( if (etp->et_pio_size != 0) { /* Unlink the piobuf from this TXQ */ - ef10_nic_pio_unlink(enp, etp->et_index); + if (ef10_nic_pio_unlink(enp, etp->et_index) != 0) + return; /* Free the sub-allocated PIO block */ - ef10_nic_pio_free(enp, etp->et_pio_bufnum, etp->et_pio_blknum); + (void) ef10_nic_pio_free(enp, etp->et_pio_bufnum, + etp->et_pio_blknum); etp->et_pio_size = 0; etp->et_pio_write_offset = 0; } Modified: stable/12/sys/dev/sfxge/common/efx_port.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:20:13 2018 (r342332) +++ stable/12/sys/dev/sfxge/common/efx_port.c Fri Dec 21 16:21:19 2018 (r342333) @@ -66,7 +66,7 @@ efx_port_init( epp->ep_emop->emo_reconfigure(enp); /* Pick up current phy capababilities */ - efx_port_poll(enp, NULL); + (void) efx_port_poll(enp, NULL); /* * Turn on the PHY if available, otherwise reset it, and From owner-svn-src-stable@freebsd.org Fri Dec 21 16:22:14 2018 Return-Path: Delivered-To: svn-src-stable@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 221DA134EF1F; Fri, 21 Dec 2018 16:22:14 +0000 (UTC) (envelope-from arybchik@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 BBD1B7094C; Fri, 21 Dec 2018 16:22:13 +0000 (UTC) (envelope-from arybchik@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 904E2FE8A; Fri, 21 Dec 2018 16:22:13 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGMDE9077278; Fri, 21 Dec 2018 16:22:13 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGMC0Z077274; Fri, 21 Dec 2018 16:22:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211622.wBLGMC0Z077274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342334 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342334 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: BBD1B7094C 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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:22:14 -0000 Author: arybchik Date: Fri Dec 21 16:22:12 2018 New Revision: 342334 URL: https://svnweb.freebsd.org/changeset/base/342334 Log: MFC r341214 sfxge(4): fix SAL annotation for input buffers Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18245 Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h stable/12/sys/dev/sfxge/common/ef10_nvram.c stable/12/sys/dev/sfxge/common/efx_impl.h stable/12/sys/dev/sfxge/common/efx_nvram.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 16:21:19 2018 (r342333) +++ stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 16:22:12 2018 (r342334) @@ -440,7 +440,7 @@ ef10_nvram_partn_read( __in efx_nic_t *enp, __in uint32_t partn, __in unsigned int offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size); extern __checkReturn efx_rc_t Modified: stable/12/sys/dev/sfxge/common/ef10_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 16:21:19 2018 (r342333) +++ stable/12/sys/dev/sfxge/common/ef10_nvram.c Fri Dec 21 16:22:12 2018 (r342334) @@ -2000,7 +2000,7 @@ ef10_nvram_partn_write( __in efx_nic_t *enp, __in uint32_t partn, __in unsigned int offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size) { size_t chunk; Modified: stable/12/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:21:19 2018 (r342333) +++ stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 16:22:12 2018 (r342334) @@ -538,7 +538,7 @@ efx_mcdi_nvram_write( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size); __checkReturn efx_rc_t Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 16:21:19 2018 (r342333) +++ stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 16:22:12 2018 (r342334) @@ -860,7 +860,7 @@ efx_mcdi_nvram_write( __in efx_nic_t *enp, __in uint32_t partn, __in uint32_t offset, - __out_bcount(size) caddr_t data, + __in_bcount(size) caddr_t data, __in size_t size) { efx_mcdi_req_t req; From owner-svn-src-stable@freebsd.org Fri Dec 21 16:24:38 2018 Return-Path: Delivered-To: svn-src-stable@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 33FC9134F06C; Fri, 21 Dec 2018 16:24:38 +0000 (UTC) (envelope-from arybchik@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 C92FA70B7A; Fri, 21 Dec 2018 16:24:37 +0000 (UTC) (envelope-from arybchik@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 BBB6CFEB8; Fri, 21 Dec 2018 16:24:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGOb8e079865; Fri, 21 Dec 2018 16:24:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGObNd079864; Fri, 21 Dec 2018 16:24:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211624.wBLGObNd079864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:24:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342335 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342335 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C92FA70B7A 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:24:38 -0000 Author: arybchik Date: Fri Dec 21 16:24:37 2018 New Revision: 342335 URL: https://svnweb.freebsd.org/changeset/base/342335 Log: MFC r341215 sfxge(4): fix build because of no declaration Functions declared in mcdi_mon.h are implemented in mcdi_mon.c. The build fails if compiler options require declaration before definition. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18246 Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:22:12 2018 (r342334) +++ stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:24:37 2018 (r342335) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include "efx.h" #include "efx_impl.h" +#include "mcdi_mon.h" #if EFSYS_OPT_MON_MCDI From owner-svn-src-stable@freebsd.org Fri Dec 21 16:25:26 2018 Return-Path: Delivered-To: svn-src-stable@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 A27FC134F107; Fri, 21 Dec 2018 16:25:26 +0000 (UTC) (envelope-from arybchik@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 4315570CD2; Fri, 21 Dec 2018 16:25:26 +0000 (UTC) (envelope-from arybchik@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 35750FEBA; Fri, 21 Dec 2018 16:25:26 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGPQwI079965; Fri, 21 Dec 2018 16:25:26 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGPQ2Y079964; Fri, 21 Dec 2018 16:25:26 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211625.wBLGPQ2Y079964@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342336 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342336 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4315570CD2 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:25:26 -0000 Author: arybchik Date: Fri Dec 21 16:25:25 2018 New Revision: 342336 URL: https://svnweb.freebsd.org/changeset/base/342336 Log: MFC r341290 sfxge(4): check size of memory to read sensors data to Size of provided memory should be consistent with specified size. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18252 Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/mcdi_mon.c ============================================================================== --- stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:24:37 2018 (r342335) +++ stable/12/sys/dev/sfxge/common/mcdi_mon.c Fri Dec 21 16:25:25 2018 (r342336) @@ -322,7 +322,13 @@ efx_mcdi_read_sensors( uint8_t payload[MAX(MC_CMD_READ_SENSORS_EXT_IN_LEN, MC_CMD_READ_SENSORS_EXT_OUT_LEN)]; uint32_t addr_lo, addr_hi; + efx_rc_t rc; + if (EFSYS_MEM_SIZE(esmp) < size) { + rc = EINVAL; + goto fail1; + } + req.emr_cmd = MC_CMD_READ_SENSORS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_READ_SENSORS_EXT_IN_LEN; @@ -339,6 +345,11 @@ efx_mcdi_read_sensors( efx_mcdi_execute(enp, &req); return (req.emr_rc); + +fail1: + EFSYS_PROBE1(fail1, efx_rc_t, rc); + + return (rc); } static __checkReturn efx_rc_t From owner-svn-src-stable@freebsd.org Fri Dec 21 16:26:19 2018 Return-Path: Delivered-To: svn-src-stable@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 A7F1B134F18A; Fri, 21 Dec 2018 16:26:19 +0000 (UTC) (envelope-from arybchik@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 4F12570E1D; Fri, 21 Dec 2018 16:26:19 +0000 (UTC) (envelope-from arybchik@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 40D07FEBC; Fri, 21 Dec 2018 16:26:19 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGQJ18080079; Fri, 21 Dec 2018 16:26:19 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGQI8C080078; Fri, 21 Dec 2018 16:26:18 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211626.wBLGQI8C080078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342337 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342337 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4F12570E1D 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]; NEURAL_HAM_LONG(-1.00)[-0.999,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:26:19 -0000 Author: arybchik Date: Fri Dec 21 16:26:18 2018 New Revision: 342337 URL: https://svnweb.freebsd.org/changeset/base/342337 Log: MFC r341295 sfxge(4): avoid usage of too big arrays on stack Found by PreFAST static analysis. Submitted by: Martin Harvey Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18257 Modified: stable/12/sys/dev/sfxge/common/ef10_phy.c stable/12/sys/dev/sfxge/common/efx_nvram.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 16:25:25 2018 (r342336) +++ stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 16:26:18 2018 (r342337) @@ -528,14 +528,26 @@ ef10_bist_poll( unsigned long *valuesp, __in size_t count) { + /* + * MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results, + * whilst not wasting stack. + */ + uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)]; efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, - MCDI_CTL_SDU_LEN_MAX)]; uint32_t value_mask = 0; uint32_t result; efx_rc_t rc; + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_SFT9001_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MRSFP_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + EFX_STATIC_ASSERT(MC_CMD_POLL_BIST_OUT_MEM_LEN <= + MCDI_CTL_SDU_LEN_MAX_V1); + _NOTE(ARGUNUSED(type)) (void) memset(payload, 0, sizeof (payload)); @@ -543,7 +555,7 @@ ef10_bist_poll( req.emr_in_buf = payload; req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; req.emr_out_buf = payload; - req.emr_out_length = MCDI_CTL_SDU_LEN_MAX; + req.emr_out_length = MCDI_CTL_SDU_LEN_MAX_V1; efx_mcdi_execute(enp, &req); Modified: stable/12/sys/dev/sfxge/common/efx_nvram.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 16:25:25 2018 (r342336) +++ stable/12/sys/dev/sfxge/common/efx_nvram.c Fri Dec 21 16:26:18 2018 (r342337) @@ -864,23 +864,27 @@ efx_mcdi_nvram_write( __in size_t size) { efx_mcdi_req_t req; - uint8_t payload[MAX(MCDI_CTL_SDU_LEN_MAX_V1, - MCDI_CTL_SDU_LEN_MAX_V2)]; + uint8_t *payload; efx_rc_t rc; size_t max_data_size; + size_t payload_len = enp->en_nic_cfg.enc_mcdi_max_payload_length; - max_data_size = enp->en_nic_cfg.enc_mcdi_max_payload_length - - MC_CMD_NVRAM_WRITE_IN_LEN(0); - EFSYS_ASSERT3U(enp->en_nic_cfg.enc_mcdi_max_payload_length, >, 0); - EFSYS_ASSERT3U(max_data_size, <, - enp->en_nic_cfg.enc_mcdi_max_payload_length); + max_data_size = payload_len - MC_CMD_NVRAM_WRITE_IN_LEN(0); + EFSYS_ASSERT3U(payload_len, >, 0); + EFSYS_ASSERT3U(max_data_size, <, payload_len); if (size > max_data_size) { rc = EINVAL; goto fail1; } - (void) memset(payload, 0, sizeof (payload)); + EFSYS_KMEM_ALLOC(enp->en_esip, payload_len, payload); + if (payload == NULL) { + rc = ENOMEM; + goto fail2; + } + + (void) memset(payload, 0, payload_len); req.emr_cmd = MC_CMD_NVRAM_WRITE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_NVRAM_WRITE_IN_LEN(size); @@ -898,11 +902,16 @@ efx_mcdi_nvram_write( if (req.emr_rc != 0) { rc = req.emr_rc; - goto fail2; + goto fail3; } + EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload); + return (0); +fail3: + EFSYS_PROBE(fail3); + EFSYS_KMEM_FREE(enp->en_esip, payload_len, payload); fail2: EFSYS_PROBE(fail2); fail1: From owner-svn-src-stable@freebsd.org Fri Dec 21 16:27:38 2018 Return-Path: Delivered-To: svn-src-stable@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 75916134F262; Fri, 21 Dec 2018 16:27:38 +0000 (UTC) (envelope-from arybchik@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 B8AAE71066; Fri, 21 Dec 2018 16:27:37 +0000 (UTC) (envelope-from arybchik@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 71317FEC2; Fri, 21 Dec 2018 16:27:37 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGRbo3080309; Fri, 21 Dec 2018 16:27:37 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGRbgC080308; Fri, 21 Dec 2018 16:27:37 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211627.wBLGRbgC080308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342338 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342338 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B8AAE71066 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:27:38 -0000 Author: arybchik Date: Fri Dec 21 16:27:37 2018 New Revision: 342338 URL: https://svnweb.freebsd.org/changeset/base/342338 Log: MFC r341301 sfxge(4): prevent access to the NIC config before probe NIC config is initialized during NIC probe. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18263 Modified: stable/12/sys/dev/sfxge/common/efx_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 16:26:18 2018 (r342337) +++ stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 16:27:37 2018 (r342338) @@ -543,6 +543,7 @@ efx_nic_cfg_get( __in efx_nic_t *enp) { EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); + EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); return (&(enp->en_nic_cfg)); } From owner-svn-src-stable@freebsd.org Fri Dec 21 16:28:23 2018 Return-Path: Delivered-To: svn-src-stable@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 64BFB134F33F; Fri, 21 Dec 2018 16:28:23 +0000 (UTC) (envelope-from arybchik@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 05F55711D8; Fri, 21 Dec 2018 16:28:23 +0000 (UTC) (envelope-from arybchik@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 A94C3FEC6; Fri, 21 Dec 2018 16:28:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGSMib080418; Fri, 21 Dec 2018 16:28:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGSMNM080417; Fri, 21 Dec 2018 16:28:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211628.wBLGSMNM080417@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:28:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342339 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342339 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 05F55711D8 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:28:23 -0000 Author: arybchik Date: Fri Dec 21 16:28:22 2018 New Revision: 342339 URL: https://svnweb.freebsd.org/changeset/base/342339 Log: MFC r341302 sfxge(4): fix a typo in unicast filter insertion comment Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18264 Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:27:37 2018 (r342338) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:28:22 2018 (r342339) @@ -1491,7 +1491,7 @@ ef10_filter_reconfigure( /* * Insert or renew unicast filters. * - * Frimware does not perform chaining on unicast filters. As traffic is + * Firmware does not perform chaining on unicast filters. As traffic is * therefore only delivered to the first matching filter, we should * always insert the specific filter for our MAC address, to try and * ensure we get that traffic. From owner-svn-src-stable@freebsd.org Fri Dec 21 16:29:32 2018 Return-Path: Delivered-To: svn-src-stable@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 C2F7D134F411; Fri, 21 Dec 2018 16:29:32 +0000 (UTC) (envelope-from arybchik@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 64E6571397; Fri, 21 Dec 2018 16:29:32 +0000 (UTC) (envelope-from arybchik@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 56BA6FEDA; Fri, 21 Dec 2018 16:29:32 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGTW9b080534; Fri, 21 Dec 2018 16:29:32 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGTWNR080533; Fri, 21 Dec 2018 16:29:32 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211629.wBLGTWNR080533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:29:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342340 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342340 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 64E6571397 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:29:32 -0000 Author: arybchik Date: Fri Dec 21 16:29:31 2018 New Revision: 342340 URL: https://svnweb.freebsd.org/changeset/base/342340 Log: MFC r341309 sfxge(4): fix MAC Tx stats for less or equal to 64 bytes This statistic should include 64byte and smaller frames. Fix EF10 calculation to match Siena code. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18271 Modified: stable/12/sys/dev/sfxge/common/ef10_mac.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:28:22 2018 (r342339) +++ stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:29:31 2018 (r342340) @@ -615,7 +615,7 @@ ef10_mac_stats_update( EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_LT64_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_64_PKTS, &value); - EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); + EFSYS_STAT_INCR_QWORD(&(stat[EFX_MAC_TX_LE_64_PKTS]), &value); EF10_MAC_STAT_READ(esmp, MC_CMD_MAC_TX_65_TO_127_PKTS, &value); EFSYS_STAT_SET_QWORD(&(stat[EFX_MAC_TX_65_TO_127_PKTS]), &value); From owner-svn-src-stable@freebsd.org Fri Dec 21 16:30:22 2018 Return-Path: Delivered-To: svn-src-stable@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 D2954134F482; Fri, 21 Dec 2018 16:30:22 +0000 (UTC) (envelope-from arybchik@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 7959871508; Fri, 21 Dec 2018 16:30:22 +0000 (UTC) (envelope-from arybchik@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 6B1C6FEE0; Fri, 21 Dec 2018 16:30:22 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGUMU4080668; Fri, 21 Dec 2018 16:30:22 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGUMaM080667; Fri, 21 Dec 2018 16:30:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211630.wBLGUMaM080667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342341 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342341 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7959871508 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:30:23 -0000 Author: arybchik Date: Fri Dec 21 16:30:21 2018 New Revision: 342341 URL: https://svnweb.freebsd.org/changeset/base/342341 Log: MFC r341311 sfxge(4): make last byte of module information available Adjust bounds so the interface supports reading the last available byte of data. Submitted by: Richard Houldsworth Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18273 Modified: stable/12/sys/dev/sfxge/common/efx_phy.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_phy.c Fri Dec 21 16:29:31 2018 (r342340) +++ stable/12/sys/dev/sfxge/common/efx_phy.c Fri Dec 21 16:30:21 2018 (r342341) @@ -314,7 +314,7 @@ efx_phy_module_get_info( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT(data != NULL); - if ((uint32_t)offset + len > 0xff) { + if ((uint32_t)offset + len > 0x100) { rc = EINVAL; goto fail1; } From owner-svn-src-stable@freebsd.org Fri Dec 21 16:31:17 2018 Return-Path: Delivered-To: svn-src-stable@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 B5DC3134F51B; Fri, 21 Dec 2018 16:31:17 +0000 (UTC) (envelope-from arybchik@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 5975271700; Fri, 21 Dec 2018 16:31:17 +0000 (UTC) (envelope-from arybchik@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 4B2A018021; Fri, 21 Dec 2018 16:31:17 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGVH2f081740; Fri, 21 Dec 2018 16:31:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGVHUs081739; Fri, 21 Dec 2018 16:31:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211631.wBLGVHUs081739@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342342 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342342 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5975271700 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_LONG(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.956,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:31:17 -0000 Author: arybchik Date: Fri Dec 21 16:31:16 2018 New Revision: 342342 URL: https://svnweb.freebsd.org/changeset/base/342342 Log: MFC r341326 sfxge(4): ensure EvQ poll stops when abort is requested If an event handler requested an abort, only the inner loop was guarenteed to be broken out of - the outer loop could continue if total == batch. Fix this by poisoning batch to ensure it is different to total. Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18287 Modified: stable/12/sys/dev/sfxge/common/efx_ev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 16:30:21 2018 (r342341) +++ stable/12/sys/dev/sfxge/common/efx_ev.c Fri Dec 21 16:31:16 2018 (r342342) @@ -503,6 +503,14 @@ efx_ev_qpoll( if (should_abort) { /* Ignore subsequent events */ total = index + 1; + + /* + * Poison batch to ensure the outer + * loop is broken out of. + */ + EFSYS_ASSERT(batch <= EFX_EV_BATCH); + batch += (EFX_EV_BATCH << 1); + EFSYS_ASSERT(total != batch); break; } } From owner-svn-src-stable@freebsd.org Fri Dec 21 16:32:13 2018 Return-Path: Delivered-To: svn-src-stable@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 5A8BF134F6E5; Fri, 21 Dec 2018 16:32:13 +0000 (UTC) (envelope-from arybchik@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 F0F0D71A19; Fri, 21 Dec 2018 16:32:12 +0000 (UTC) (envelope-from arybchik@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 E30BE1806B; Fri, 21 Dec 2018 16:32:12 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGWCVv085734; Fri, 21 Dec 2018 16:32:12 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGWC7O085733; Fri, 21 Dec 2018 16:32:12 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211632.wBLGWC7O085733@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:32:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342343 - stable/12/sys/dev/sfxge X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge X-SVN-Commit-Revision: 342343 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: F0F0D71A19 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.956,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:32:13 -0000 Author: arybchik Date: Fri Dec 21 16:32:12 2018 New Revision: 342343 URL: https://svnweb.freebsd.org/changeset/base/342343 Log: MFC r341327 sfxge(4): rollback last seen VLAN TCI if Tx packet is dropped Early processing of a packet on transmit may change last seen VLAN TCI in the queue context. If such a packet is eventually dropped, last seen VLAN TCI must be set to its previous value. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18288 Modified: stable/12/sys/dev/sfxge/sfxge_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 16:31:16 2018 (r342342) +++ stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 16:32:12 2018 (r342343) @@ -361,6 +361,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, int rc; int i; int eop; + uint16_t hw_vlan_tci_prev; int vlan_tagged; KASSERT(!txq->blocked, ("txq->blocked")); @@ -412,6 +413,8 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, used_map = &stmp->map; + hw_vlan_tci_prev = txq->hw_vlan_tci; + vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf); if (vlan_tagged) { sfxge_next_stmp(txq, &stmp); @@ -463,6 +466,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, return (0); reject_mapped: + txq->hw_vlan_tci = hw_vlan_tci_prev; bus_dmamap_unload(txq->packet_dma_tag, *used_map); reject: /* Drop the packet on the floor. */ From owner-svn-src-stable@freebsd.org Fri Dec 21 16:58:02 2018 Return-Path: Delivered-To: svn-src-stable@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 BE20913502F5; Fri, 21 Dec 2018 16:58:01 +0000 (UTC) (envelope-from arybchik@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 70EAB72AAF; Fri, 21 Dec 2018 16:58:01 +0000 (UTC) (envelope-from arybchik@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 5FEFA1841E; Fri, 21 Dec 2018 16:58:01 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLGw12f096441; Fri, 21 Dec 2018 16:58:01 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLGvxhl096426; Fri, 21 Dec 2018 16:57:59 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211657.wBLGvxhl096426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 16:57:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342344 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342344 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 70EAB72AAF 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_LONG(-1.00)[-0.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 16:58:02 -0000 Author: arybchik Date: Fri Dec 21 16:57:59 2018 New Revision: 342344 URL: https://svnweb.freebsd.org/changeset/base/342344 Log: MFC r341297 sfxge(4): fix out of bounds read when dereferencing sdup Introduce and use macro to make sure that MCDI buffers allocated on stack are rounded up properly. Submitted by: Gautam Dawar Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18259 Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c stable/12/sys/dev/sfxge/common/ef10_filter.c stable/12/sys/dev/sfxge/common/ef10_intr.c stable/12/sys/dev/sfxge/common/ef10_mac.c stable/12/sys/dev/sfxge/common/ef10_nic.c stable/12/sys/dev/sfxge/common/ef10_phy.c stable/12/sys/dev/sfxge/common/ef10_rx.c stable/12/sys/dev/sfxge/common/ef10_tx.c stable/12/sys/dev/sfxge/common/efx_lic.c stable/12/sys/dev/sfxge/common/efx_mcdi.c stable/12/sys/dev/sfxge/common/efx_mcdi.h stable/12/sys/dev/sfxge/common/efx_nic.c stable/12/sys/dev/sfxge/common/efx_nvram.c stable/12/sys/dev/sfxge/common/mcdi_mon.c stable/12/sys/dev/sfxge/common/medford_nic.c stable/12/sys/dev/sfxge/common/siena_mac.c stable/12/sys/dev/sfxge/common/siena_nic.c stable/12/sys/dev/sfxge/common/siena_nvram.c stable/12/sys/dev/sfxge/common/siena_phy.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_ev.c Fri Dec 21 16:57:59 2018 (r342344) @@ -100,11 +100,10 @@ efx_mcdi_set_evq_tmr( __in uint32_t timer_ns) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_EVQ_TMR_IN_LEN, - MC_CMD_SET_EVQ_TMR_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_EVQ_TMR_IN_LEN, + MC_CMD_SET_EVQ_TMR_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_EVQ_TMR; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_EVQ_TMR_IN_LEN; @@ -150,9 +149,9 @@ efx_mcdi_init_evq( __in boolean_t low_latency) { efx_mcdi_req_t req; - uint8_t payload[ - MAX(MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), - MC_CMD_INIT_EVQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, + MC_CMD_INIT_EVQ_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_OUT_LEN); efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -167,7 +166,6 @@ efx_mcdi_init_evq( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_EVQ_IN_LEN(npages); @@ -287,9 +285,9 @@ efx_mcdi_init_evq_v2( __in uint32_t flags) { efx_mcdi_req_t req; - uint8_t payload[ - MAX(MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), - MC_CMD_INIT_EVQ_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, + MC_CMD_INIT_EVQ_V2_IN_LEN(EFX_EVQ_NBUFS(EFX_EVQ_MAXNEVS)), + MC_CMD_INIT_EVQ_V2_OUT_LEN); boolean_t interrupting; unsigned int evq_type; efx_qword_t *dma_addr; @@ -304,7 +302,6 @@ efx_mcdi_init_evq_v2( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_EVQ_V2_IN_LEN(npages); @@ -411,11 +408,10 @@ efx_mcdi_fini_evq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_EVQ_IN_LEN, - MC_CMD_FINI_EVQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_EVQ_IN_LEN, + MC_CMD_FINI_EVQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_EVQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_EVQ_IN_LEN; @@ -627,8 +623,8 @@ efx_mcdi_driver_event( __in efx_qword_t data) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_DRIVER_EVENT_IN_LEN, - MC_CMD_DRIVER_EVENT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRIVER_EVENT_IN_LEN, + MC_CMD_DRIVER_EVENT_OUT_LEN); efx_rc_t rc; req.emr_cmd = MC_CMD_DRIVER_EVENT; Modified: stable/12/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_filter.c Fri Dec 21 16:57:59 2018 (r342344) @@ -193,11 +193,10 @@ efx_mcdi_filter_op_add( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, - MC_CMD_FILTER_OP_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN); efx_rc_t rc; - memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; @@ -346,11 +345,10 @@ efx_mcdi_filter_op_delete( __inout ef10_filter_handle_t *handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FILTER_OP_EXT_IN_LEN, - MC_CMD_FILTER_OP_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FILTER_OP_EXT_IN_LEN, + MC_CMD_FILTER_OP_EXT_OUT_LEN); efx_rc_t rc; - memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FILTER_OP; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FILTER_OP_EXT_IN_LEN; @@ -914,13 +912,12 @@ efx_mcdi_get_parser_disp_info( __out size_t *list_lengthp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, - MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PARSER_DISP_INFO_IN_LEN, + MC_CMD_GET_PARSER_DISP_INFO_OUT_LENMAX); size_t matches_count; size_t list_size; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PARSER_DISP_INFO; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PARSER_DISP_INFO_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/ef10_intr.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_intr.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_intr.c Fri Dec 21 16:57:59 2018 (r342344) @@ -78,8 +78,8 @@ efx_mcdi_trigger_interrupt( __in unsigned int level) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_TRIGGER_INTERRUPT_IN_LEN, - MC_CMD_TRIGGER_INTERRUPT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_TRIGGER_INTERRUPT_IN_LEN, + MC_CMD_TRIGGER_INTERRUPT_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -90,7 +90,6 @@ efx_mcdi_trigger_interrupt( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_TRIGGER_INTERRUPT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_TRIGGER_INTERRUPT_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/ef10_mac.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_mac.c Fri Dec 21 16:57:59 2018 (r342344) @@ -102,11 +102,10 @@ efx_mcdi_vadapter_set_mac( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_SET_MAC_IN_LEN, - MC_CMD_VADAPTOR_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_SET_MAC_IN_LEN, + MC_CMD_VADAPTOR_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_SET_MAC_IN_LEN; @@ -168,11 +167,10 @@ efx_mcdi_mtu_set( __in uint32_t mtu) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, - MC_CMD_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; @@ -205,11 +203,10 @@ efx_mcdi_mtu_get( __out size_t *mtu) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_EXT_IN_LEN, - MC_CMD_SET_MAC_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_EXT_IN_LEN, + MC_CMD_SET_MAC_V2_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_EXT_IN_LEN; @@ -301,11 +298,10 @@ ef10_mac_reconfigure( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_MAC_IN_LEN, - MC_CMD_SET_MAC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_MAC_IN_LEN, + MC_CMD_SET_MAC_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_MAC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_MAC_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/ef10_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_nic.c Fri Dec 21 16:57:59 2018 (r342344) @@ -47,14 +47,13 @@ efx_mcdi_get_port_assignment( __out uint32_t *portp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN, - MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN, + MC_CMD_GET_PORT_ASSIGNMENT_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_ASSIGNMENT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PORT_ASSIGNMENT_IN_LEN; @@ -92,14 +91,13 @@ efx_mcdi_get_port_modes( __out_opt uint32_t *current_modep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PORT_MODES_IN_LEN, - MC_CMD_GET_PORT_MODES_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PORT_MODES_IN_LEN, + MC_CMD_GET_PORT_MODES_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PORT_MODES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PORT_MODES_IN_LEN; @@ -199,13 +197,12 @@ efx_mcdi_vadaptor_alloc( __in uint32_t port_id) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_ALLOC_IN_LEN, - MC_CMD_VADAPTOR_ALLOC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_ALLOC_IN_LEN, + MC_CMD_VADAPTOR_ALLOC_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT3U(enp->en_vport_id, ==, EVB_PORT_ID_NULL); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_ALLOC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_ALLOC_IN_LEN; @@ -238,11 +235,10 @@ efx_mcdi_vadaptor_free( __in uint32_t port_id) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VADAPTOR_FREE_IN_LEN, - MC_CMD_VADAPTOR_FREE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VADAPTOR_FREE_IN_LEN, + MC_CMD_VADAPTOR_FREE_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VADAPTOR_FREE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VADAPTOR_FREE_IN_LEN; @@ -272,14 +268,13 @@ efx_mcdi_get_mac_address_pf( __out_ecount_opt(6) uint8_t mac_addrp[6]) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_GET_MAC_ADDRESSES_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_MAC_ADDRESSES_IN_LEN, + MC_CMD_GET_MAC_ADDRESSES_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_MAC_ADDRESSES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_MAC_ADDRESSES_IN_LEN; @@ -330,14 +325,13 @@ efx_mcdi_get_mac_address_vf( __out_ecount_opt(6) uint8_t mac_addrp[6]) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN, - MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN, + MC_CMD_VPORT_GET_MAC_ADDRESSES_OUT_LENMAX); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_VPORT_GET_MAC_ADDRESSES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_VPORT_GET_MAC_ADDRESSES_IN_LEN; @@ -394,14 +388,13 @@ efx_mcdi_get_clock( __out uint32_t *dpcpu_freqp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CLOCK_IN_LEN, - MC_CMD_GET_CLOCK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CLOCK_IN_LEN, + MC_CMD_GET_CLOCK_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CLOCK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CLOCK_IN_LEN; @@ -453,11 +446,10 @@ efx_mcdi_get_vector_cfg( __out_opt uint32_t *vf_nvecp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_VECTOR_CFG_IN_LEN, - MC_CMD_GET_VECTOR_CFG_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_VECTOR_CFG_IN_LEN, + MC_CMD_GET_VECTOR_CFG_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_VECTOR_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_VECTOR_CFG_IN_LEN; @@ -501,11 +493,10 @@ efx_mcdi_get_capabilities( __out uint32_t *tso2ncp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_CAPABILITIES_IN_LEN, - MC_CMD_GET_CAPABILITIES_V2_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_CAPABILITIES_IN_LEN, + MC_CMD_GET_CAPABILITIES_V2_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_CAPABILITIES; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_CAPABILITIES_IN_LEN; @@ -556,8 +547,8 @@ efx_mcdi_alloc_vis( __out uint32_t *vi_shiftp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_VIS_IN_LEN, - MC_CMD_ALLOC_VIS_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ALLOC_VIS_IN_LEN, + MC_CMD_ALLOC_VIS_EXT_OUT_LEN); efx_rc_t rc; if (vi_countp == NULL) { @@ -565,7 +556,6 @@ efx_mcdi_alloc_vis( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ALLOC_VIS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_VIS_IN_LEN; @@ -648,8 +638,8 @@ efx_mcdi_alloc_piobuf( __out efx_piobuf_handle_t *handlep) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ALLOC_PIOBUF_IN_LEN, - MC_CMD_ALLOC_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ALLOC_PIOBUF_IN_LEN, + MC_CMD_ALLOC_PIOBUF_OUT_LEN); efx_rc_t rc; if (handlep == NULL) { @@ -657,7 +647,6 @@ efx_mcdi_alloc_piobuf( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ALLOC_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ALLOC_PIOBUF_IN_LEN; @@ -696,11 +685,10 @@ efx_mcdi_free_piobuf( __in efx_piobuf_handle_t handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FREE_PIOBUF_IN_LEN, - MC_CMD_FREE_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FREE_PIOBUF_IN_LEN, + MC_CMD_FREE_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FREE_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FREE_PIOBUF_IN_LEN; @@ -731,11 +719,10 @@ efx_mcdi_link_piobuf( __in efx_piobuf_handle_t handle) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LINK_PIOBUF_IN_LEN, - MC_CMD_LINK_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LINK_PIOBUF_IN_LEN, + MC_CMD_LINK_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LINK_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LINK_PIOBUF_IN_LEN; @@ -766,11 +753,10 @@ efx_mcdi_unlink_piobuf( __in uint32_t vi_index) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_UNLINK_PIOBUF_IN_LEN, - MC_CMD_UNLINK_PIOBUF_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_UNLINK_PIOBUF_IN_LEN, + MC_CMD_UNLINK_PIOBUF_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_UNLINK_PIOBUF; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_UNLINK_PIOBUF_IN_LEN; @@ -967,11 +953,10 @@ ef10_mcdi_get_pf_count( __out uint32_t *pf_countp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PF_COUNT_IN_LEN, - MC_CMD_GET_PF_COUNT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PF_COUNT_IN_LEN, + MC_CMD_GET_PF_COUNT_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PF_COUNT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PF_COUNT_IN_LEN; @@ -1503,8 +1488,8 @@ ef10_nic_reset( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_ENTITY_RESET_IN_LEN, - MC_CMD_ENTITY_RESET_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_ENTITY_RESET_IN_LEN, + MC_CMD_ENTITY_RESET_OUT_LEN); efx_rc_t rc; /* ef10_nic_reset() is called to recover from BADASSERT failures. */ @@ -1513,7 +1498,6 @@ ef10_nic_reset( if ((rc = efx_mcdi_exit_assertion_handler(enp)) != 0) goto fail2; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_ENTITY_RESET; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_ENTITY_RESET_IN_LEN; @@ -1830,6 +1814,5 @@ fail1: } #endif /* EFSYS_OPT_DIAG */ - #endif /* EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD */ Modified: stable/12/sys/dev/sfxge/common/ef10_phy.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_phy.c Fri Dec 21 16:57:59 2018 (r342344) @@ -205,11 +205,10 @@ ef10_phy_get_link( __out ef10_link_state_t *elsp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LINK_IN_LEN, - MC_CMD_GET_LINK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LINK_IN_LEN, + MC_CMD_GET_LINK_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LINK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LINK_IN_LEN; @@ -280,8 +279,8 @@ ef10_phy_reconfigure( { efx_port_t *epp = &(enp->en_port); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_SET_LINK_IN_LEN, - MC_CMD_SET_LINK_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_SET_LINK_IN_LEN, + MC_CMD_SET_LINK_OUT_LEN); uint32_t cap_mask; #if EFSYS_OPT_PHY_LED_CONTROL unsigned int led_mode; @@ -295,7 +294,6 @@ ef10_phy_reconfigure( if (supported == B_FALSE) goto out; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_SET_LINK; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_SET_LINK_IN_LEN; @@ -409,12 +407,11 @@ ef10_phy_verify( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PHY_STATE_IN_LEN, - MC_CMD_GET_PHY_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PHY_STATE_IN_LEN, + MC_CMD_GET_PHY_STATE_OUT_LEN); uint32_t state; efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PHY_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PHY_STATE_IN_LEN; @@ -532,7 +529,8 @@ ef10_bist_poll( * MCDI_CTL_SDU_LEN_MAX_V1 is large enough cover all BIST results, * whilst not wasting stack. */ - uint8_t payload[MAX(MC_CMD_POLL_BIST_IN_LEN, MCDI_CTL_SDU_LEN_MAX_V1)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_POLL_BIST_IN_LEN, + MCDI_CTL_SDU_LEN_MAX_V1); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; uint32_t value_mask = 0; @@ -550,7 +548,6 @@ ef10_bist_poll( _NOTE(ARGUNUSED(type)) - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_POLL_BIST; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_POLL_BIST_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/ef10_rx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_rx.c Fri Dec 21 16:57:59 2018 (r342344) @@ -49,8 +49,9 @@ efx_mcdi_init_rxq( __in boolean_t disable_scatter) { efx_mcdi_req_t req; - uint8_t payload[ - MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS))]; + EFX_MCDI_DECLARE_BUF(payload, + MC_CMD_INIT_RXQ_IN_LEN(EFX_RXQ_NBUFS(EFX_RXQ_MAXNDESCS)), + MC_CMD_INIT_RXQ_OUT_LEN); int npages = EFX_RXQ_NBUFS(size); int i; efx_qword_t *dma_addr; @@ -61,7 +62,6 @@ efx_mcdi_init_rxq( EFSYS_ASSERT3U(MC_CMD_INIT_RXQ_OUT_LEN, ==, 0); EFSYS_ASSERT3U(size, <=, EFX_RXQ_MAXNDESCS); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_RXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_RXQ_IN_LEN(npages); @@ -115,11 +115,10 @@ efx_mcdi_fini_rxq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_RXQ_IN_LEN, - MC_CMD_FINI_RXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_RXQ_IN_LEN, + MC_CMD_FINI_RXQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_RXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_RXQ_IN_LEN; @@ -157,8 +156,8 @@ efx_mcdi_rss_context_alloc( __out uint32_t *rss_contextp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN, - MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN, + MC_CMD_RSS_CONTEXT_ALLOC_OUT_LEN); uint32_t rss_context; uint32_t context_type; efx_rc_t rc; @@ -180,7 +179,6 @@ efx_mcdi_rss_context_alloc( goto fail2; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_ALLOC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_ALLOC_IN_LEN; @@ -237,8 +235,8 @@ efx_mcdi_rss_context_free( __in uint32_t rss_context) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_FREE_IN_LEN, - MC_CMD_RSS_CONTEXT_FREE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_FREE_IN_LEN, + MC_CMD_RSS_CONTEXT_FREE_OUT_LEN); efx_rc_t rc; if (rss_context == EF10_RSS_CONTEXT_INVALID) { @@ -246,7 +244,6 @@ efx_mcdi_rss_context_free( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_FREE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_FREE_IN_LEN; @@ -281,8 +278,8 @@ efx_mcdi_rss_context_set_flags( __in efx_rx_hash_type_t type) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_FLAGS_OUT_LEN); efx_rc_t rc; if (rss_context == EF10_RSS_CONTEXT_INVALID) { @@ -290,7 +287,6 @@ efx_mcdi_rss_context_set_flags( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_FLAGS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_FLAGS_IN_LEN; @@ -337,8 +333,8 @@ efx_mcdi_rss_context_set_key( __in size_t n) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_KEY_OUT_LEN); efx_rc_t rc; if (rss_context == EF10_RSS_CONTEXT_INVALID) { @@ -346,7 +342,6 @@ efx_mcdi_rss_context_set_key( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_KEY; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_KEY_IN_LEN; @@ -394,8 +389,8 @@ efx_mcdi_rss_context_set_table( __in size_t n) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN, - MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN, + MC_CMD_RSS_CONTEXT_SET_TABLE_OUT_LEN); uint8_t *req_table; int i, rc; @@ -404,7 +399,6 @@ efx_mcdi_rss_context_set_table( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_RSS_CONTEXT_SET_TABLE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_RSS_CONTEXT_SET_TABLE_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 16:57:59 2018 (r342344) @@ -58,8 +58,8 @@ efx_mcdi_init_txq( __in efsys_mem_t *esmp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS), - MC_CMD_INIT_TXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_INIT_TXQ_IN_LEN(EFX_TXQ_MAX_BUFS), + MC_CMD_INIT_TXQ_OUT_LEN); efx_qword_t *dma_addr; uint64_t addr; int npages; @@ -75,7 +75,6 @@ efx_mcdi_init_txq( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_INIT_TXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_INIT_TXQ_IN_LEN(npages); @@ -136,11 +135,10 @@ efx_mcdi_fini_txq( __in uint32_t instance) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FINI_TXQ_IN_LEN, - MC_CMD_FINI_TXQ_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FINI_TXQ_IN_LEN, + MC_CMD_FINI_TXQ_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FINI_TXQ; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FINI_TXQ_IN_LEN; Modified: stable/12/sys/dev/sfxge/common/efx_lic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/efx_lic.c Fri Dec 21 16:57:59 2018 (r342344) @@ -343,12 +343,11 @@ efx_mcdi_fc_license_update_license( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_FC_IN_LICENSE_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FC_IN_LICENSE_LEN, 0); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; @@ -389,13 +388,12 @@ efx_mcdi_fc_license_get_key_stats( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_FC_IN_LICENSE_LEN, - MC_CMD_FC_OUT_LICENSE_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_FC_IN_LICENSE_LEN, + MC_CMD_FC_OUT_LICENSE_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_SIENA); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_FC; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_FC_IN_LICENSE_LEN; @@ -714,8 +712,8 @@ efx_mcdi_licensed_app_state( __out boolean_t *licensedp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, - MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LICENSED_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_APP_STATE_OUT_LEN); uint32_t app_state; efx_rc_t rc; @@ -727,7 +725,6 @@ efx_mcdi_licensed_app_state( goto fail1; } - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LICENSED_APP_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LICENSED_APP_STATE_IN_LEN; @@ -773,12 +770,11 @@ efx_mcdi_licensing_update_licenses( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_LICENSING_IN_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_IN_LEN, 0); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_IN_LEN; @@ -816,13 +812,12 @@ efx_mcdi_licensing_get_key_stats( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_IN_LEN, - MC_CMD_LICENSING_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_IN_LEN, + MC_CMD_LICENSING_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_IN_LEN; @@ -880,12 +875,11 @@ efx_mcdi_licensing_v3_update_licenses( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MC_CMD_LICENSING_V3_IN_LEN]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_V3_IN_LEN, 0); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; @@ -916,13 +910,12 @@ efx_mcdi_licensing_v3_report_license( __out efx_key_stats_t *eksp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_V3_IN_LEN, - MC_CMD_LICENSING_V3_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_V3_IN_LEN, + MC_CMD_LICENSING_V3_OUT_LEN); efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LICENSING_V3; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LICENSING_V3_IN_LEN; @@ -979,14 +972,13 @@ efx_mcdi_licensing_v3_app_state( __out boolean_t *licensedp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, - MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN, + MC_CMD_GET_LICENSED_V3_APP_STATE_OUT_LEN); uint32_t app_state; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_MEDFORD); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_LICENSED_V3_APP_STATE; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_LICENSED_V3_APP_STATE_IN_LEN; @@ -1037,8 +1029,8 @@ efx_mcdi_licensing_v3_get_id( uint8_t *bufferp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LICENSING_GET_ID_V3_IN_LEN, - MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LICENSING_GET_ID_V3_IN_LEN, + MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN); efx_rc_t rc; req.emr_cmd = MC_CMD_LICENSING_GET_ID_V3; @@ -1049,7 +1041,6 @@ efx_mcdi_licensing_v3_get_id( req.emr_in_length = MC_CMD_LICENSING_GET_ID_V3_IN_LEN; req.emr_out_buf = bufferp; req.emr_out_length = MC_CMD_LICENSING_GET_ID_V3_OUT_LENMIN; - (void) memset(payload, 0, sizeof (payload)); } else { /* Request full buffer */ req.emr_in_buf = bufferp; Modified: stable/12/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 21 16:32:12 2018 (r342343) +++ stable/12/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 21 16:57:59 2018 (r342344) @@ -923,10 +923,10 @@ efx_mcdi_version( __out_opt efx_mcdi_boot_t *statusp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MAX(MC_CMD_GET_VERSION_IN_LEN, - MC_CMD_GET_VERSION_OUT_LEN), - MAX(MC_CMD_GET_BOOT_STATUS_IN_LEN, - MC_CMD_GET_BOOT_STATUS_OUT_LEN))]; + EFX_MCDI_DECLARE_BUF(payload, + MAX(MC_CMD_GET_VERSION_IN_LEN, MC_CMD_GET_BOOT_STATUS_IN_LEN), + MAX(MC_CMD_GET_VERSION_OUT_LEN, + MC_CMD_GET_BOOT_STATUS_OUT_LEN)); efx_word_t *ver_words; uint16_t version[4]; uint32_t build; @@ -935,7 +935,6 @@ efx_mcdi_version( EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_VERSION; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_VERSION_IN_LEN; @@ -1036,7 +1035,8 @@ efx_mcdi_do_reboot( __in efx_nic_t *enp, __in boolean_t after_assertion) { - uint8_t payload[MAX(MC_CMD_REBOOT_IN_LEN, MC_CMD_REBOOT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_REBOOT_IN_LEN, + MC_CMD_REBOOT_OUT_LEN); efx_mcdi_req_t req; efx_rc_t rc; @@ -1049,7 +1049,6 @@ efx_mcdi_do_reboot( */ EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_REBOOT; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_REBOOT_IN_LEN; @@ -1100,8 +1099,8 @@ efx_mcdi_read_assertion( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_ASSERTS_IN_LEN, - MC_CMD_GET_ASSERTS_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_ASSERTS_IN_LEN, + MC_CMD_GET_ASSERTS_OUT_LEN); const char *reason; unsigned int flags; unsigned int index; @@ -1202,11 +1201,10 @@ efx_mcdi_drv_attach( __in boolean_t attach) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_DRV_ATTACH_IN_LEN, - MC_CMD_DRV_ATTACH_EXT_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_DRV_ATTACH_IN_LEN, + MC_CMD_DRV_ATTACH_EXT_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_DRV_ATTACH; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_DRV_ATTACH_IN_LEN; @@ -1253,11 +1251,10 @@ efx_mcdi_get_board_cfg( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_BOARD_CFG_IN_LEN, - MC_CMD_GET_BOARD_CFG_OUT_LENMIN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_BOARD_CFG_IN_LEN, + MC_CMD_GET_BOARD_CFG_OUT_LENMIN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_BOARD_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_BOARD_CFG_IN_LEN; @@ -1333,11 +1330,10 @@ efx_mcdi_get_resource_limits( __out_opt uint32_t *ntxqp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_RESOURCE_LIMITS_IN_LEN, - MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_RESOURCE_LIMITS_IN_LEN, + MC_CMD_GET_RESOURCE_LIMITS_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_RESOURCE_LIMITS; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_RESOURCE_LIMITS_IN_LEN; @@ -1380,11 +1376,10 @@ efx_mcdi_get_phy_cfg( efx_port_t *epp = &(enp->en_port); efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_GET_PHY_CFG_IN_LEN, - MC_CMD_GET_PHY_CFG_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_GET_PHY_CFG_IN_LEN, + MC_CMD_GET_PHY_CFG_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_GET_PHY_CFG; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_GET_PHY_CFG_IN_LEN; @@ -1621,11 +1616,10 @@ efx_mcdi_bist_start( __in efx_bist_type_t type) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_START_BIST_IN_LEN, - MC_CMD_START_BIST_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_START_BIST_IN_LEN, + MC_CMD_START_BIST_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_START_BIST; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_START_BIST_IN_LEN; @@ -1684,11 +1678,10 @@ efx_mcdi_log_ctrl( __in efx_nic_t *enp) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_LOG_CTRL_IN_LEN, - MC_CMD_LOG_CTRL_OUT_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_LOG_CTRL_IN_LEN, + MC_CMD_LOG_CTRL_OUT_LEN); efx_rc_t rc; - (void) memset(payload, 0, sizeof (payload)); req.emr_cmd = MC_CMD_LOG_CTRL; req.emr_in_buf = payload; req.emr_in_length = MC_CMD_LOG_CTRL_IN_LEN; @@ -1733,8 +1726,8 @@ efx_mcdi_mac_stats( __in uint16_t period_ms) { efx_mcdi_req_t req; - uint8_t payload[MAX(MC_CMD_MAC_STATS_IN_LEN, - MC_CMD_MAC_STATS_OUT_DMA_LEN)]; + EFX_MCDI_DECLARE_BUF(payload, MC_CMD_MAC_STATS_IN_LEN, + MC_CMD_MAC_STATS_OUT_DMA_LEN); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Dec 21 17:02:43 2018 Return-Path: Delivered-To: svn-src-stable@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 EA7F81350A48; Fri, 21 Dec 2018 17:02:42 +0000 (UTC) (envelope-from arybchik@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 8B2247326B; Fri, 21 Dec 2018 17:02:42 +0000 (UTC) (envelope-from arybchik@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 668C8185C3; Fri, 21 Dec 2018 17:02:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLH2gQa001961; Fri, 21 Dec 2018 17:02:42 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLH2gAJ001959; Fri, 21 Dec 2018 17:02:42 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211702.wBLH2gAJ001959@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:02:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342345 - stable/12/sys/dev/sfxge X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge X-SVN-Commit-Revision: 342345 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 8B2247326B 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_LONG(-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] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:02:43 -0000 Author: arybchik Date: Fri Dec 21 17:02:41 2018 New Revision: 342345 URL: https://svnweb.freebsd.org/changeset/base/342345 Log: MFC r341782 sfxge(4): populate per-event queue stats in sysctl In order to find out why the first event queue and corresponding interrupt is triggered more frequent, it is useful to know which events go to each event queue. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18418 Modified: stable/12/sys/dev/sfxge/sfxge.h stable/12/sys/dev/sfxge/sfxge_ev.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/12/sys/dev/sfxge/sfxge.h Fri Dec 21 16:57:59 2018 (r342344) +++ stable/12/sys/dev/sfxge/sfxge.h Fri Dec 21 17:02:41 2018 (r342345) @@ -184,6 +184,10 @@ struct sfxge_evq { unsigned int buf_base_id; unsigned int entries; char lock_name[SFXGE_LOCK_NAME_MAX]; +#if EFSYS_OPT_QSTATS + clock_t stats_update_time; + uint64_t stats[EV_NQSTATS]; +#endif } __aligned(CACHE_LINE_SIZE); #define SFXGE_NDESCS 1024 @@ -275,6 +279,9 @@ struct sfxge_softc { struct ifnet *ifnet; unsigned int if_flags; struct sysctl_oid *stats_node; +#if EFSYS_OPT_QSTATS + struct sysctl_oid *evqs_stats_node; +#endif struct sysctl_oid *txqs_node; struct task task_reset; Modified: stable/12/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 16:57:59 2018 (r342344) +++ stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 17:02:41 2018 (r342345) @@ -443,29 +443,94 @@ sfxge_ev_wake_up(void *arg, uint32_t index) #if EFSYS_OPT_QSTATS static void +sfxge_evq_stat_update(struct sfxge_evq *evq) +{ + clock_t now; + + SFXGE_EVQ_LOCK(evq); + + if (__predict_false(evq->init_state != SFXGE_EVQ_STARTED)) + goto out; + + now = ticks; + if ((unsigned int)(now - evq->stats_update_time) < (unsigned int)hz) + goto out; + + evq->stats_update_time = now; + efx_ev_qstats_update(evq->common, evq->stats); + +out: + SFXGE_EVQ_UNLOCK(evq); +} + +static int +sfxge_evq_stat_handler(SYSCTL_HANDLER_ARGS) +{ + struct sfxge_evq *evq = arg1; + struct sfxge_softc *sc = evq->sc; + unsigned int id = arg2; + + SFXGE_ADAPTER_LOCK(sc); + + sfxge_evq_stat_update(evq); + + SFXGE_ADAPTER_UNLOCK(sc); + + return (SYSCTL_OUT(req, &evq->stats[id], sizeof(evq->stats[id]))); +} + +static int +sfxge_evq_stat_init(struct sfxge_evq *evq) +{ + struct sfxge_softc *sc = evq->sc; + struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(sc->dev); + char name[16]; + struct sysctl_oid *evq_stats_node; + unsigned int id; + + snprintf(name, sizeof(name), "%u", evq->index); + evq_stats_node = SYSCTL_ADD_NODE(ctx, + SYSCTL_CHILDREN(sc->evqs_stats_node), + OID_AUTO, name, CTLFLAG_RD, NULL, ""); + if (evq_stats_node == NULL) + return (ENOMEM); + + for (id = 0; id < EV_NQSTATS; id++) { + SYSCTL_ADD_PROC( + ctx, SYSCTL_CHILDREN(evq_stats_node), + OID_AUTO, efx_ev_qstat_name(sc->enp, id), + CTLTYPE_U64|CTLFLAG_RD, + evq, id, sfxge_evq_stat_handler, "Q", + ""); + } + + return (0); +} + +static void sfxge_ev_stat_update(struct sfxge_softc *sc) { struct sfxge_evq *evq; unsigned int index; clock_t now; + unsigned int id; SFXGE_ADAPTER_LOCK(sc); - if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED)) - goto out; - now = ticks; if ((unsigned int)(now - sc->ev_stats_update_time) < (unsigned int)hz) goto out; sc->ev_stats_update_time = now; - /* Add event counts from each event queue in turn */ + memset(sc->ev_stats, 0, sizeof(sc->ev_stats)); + + /* Update and add event counts from each event queue in turn */ for (index = 0; index < sc->evq_count; index++) { evq = sc->evq[index]; - SFXGE_EVQ_LOCK(evq); - efx_ev_qstats_update(evq->common, sc->ev_stats); - SFXGE_EVQ_UNLOCK(evq); + sfxge_evq_stat_update(evq); + for (id = 0; id < EV_NQSTATS; id++) + sc->ev_stats[id] += evq->stats[id]; } out: SFXGE_ADAPTER_UNLOCK(sc); @@ -672,7 +737,7 @@ sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int in #if EFSYS_OPT_QSTATS /* Add event counts before discarding the common evq state */ - efx_ev_qstats_update(evq->common, sc->ev_stats); + efx_ev_qstats_update(evq->common, evq->stats); #endif efx_ev_qdestroy(evq->common); @@ -873,7 +938,24 @@ sfxge_ev_qinit(struct sfxge_softc *sc, unsigned int in evq->init_state = SFXGE_EVQ_INITIALIZED; +#if EFSYS_OPT_QSTATS + rc = sfxge_evq_stat_init(evq); + if (rc != 0) + goto fail_evq_stat_init; +#endif + return (0); + +#if EFSYS_OPT_QSTATS +fail_evq_stat_init: + evq->init_state = SFXGE_EVQ_UNINITIALIZED; + SFXGE_EVQ_LOCK_DESTROY(evq); + sfxge_dma_free(esmp); + sc->evq[index] = NULL; + free(evq, M_SFXGE); + + return (rc); +#endif } void @@ -922,6 +1004,16 @@ sfxge_ev_init(struct sfxge_softc *sc) sc, 0, sfxge_int_mod_handler, "IU", "sfxge interrupt moderation (us)"); +#if EFSYS_OPT_QSTATS + sc->evqs_stats_node = SYSCTL_ADD_NODE( + device_get_sysctl_ctx(sc->dev), SYSCTL_CHILDREN(sc->stats_node), + OID_AUTO, "evq", CTLFLAG_RD, NULL, "Event queues stats"); + if (sc->evqs_stats_node == NULL) { + rc = ENOMEM; + goto fail_evqs_stats_node; + } +#endif + /* * Initialize the event queue(s) - one per interrupt. */ @@ -940,6 +1032,9 @@ fail: while (--index >= 0) sfxge_ev_qfini(sc, index); +#if EFSYS_OPT_QSTATS +fail_evqs_stats_node: +#endif sc->evq_count = 0; return (rc); } From owner-svn-src-stable@freebsd.org Fri Dec 21 17:10:49 2018 Return-Path: Delivered-To: svn-src-stable@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 593891350C75; Fri, 21 Dec 2018 17:10:49 +0000 (UTC) (envelope-from arybchik@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 EB79373521; Fri, 21 Dec 2018 17:10:48 +0000 (UTC) (envelope-from arybchik@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 DE38B185E6; Fri, 21 Dec 2018 17:10:48 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHAm1H002488; Fri, 21 Dec 2018 17:10:48 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHAmnU002487; Fri, 21 Dec 2018 17:10:48 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211710.wBLHAmnU002487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342346 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EB79373521 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.969,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:10:49 -0000 Author: arybchik Date: Fri Dec 21 17:10:48 2018 New Revision: 342346 URL: https://svnweb.freebsd.org/changeset/base/342346 Log: MFC r340831 sfxge(4): make MAC naming consistent with other modules Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18101 Modified: stable/12/sys/dev/sfxge/common/efx_mac.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx_mac.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_mac.c Fri Dec 21 17:02:41 2018 (r342345) +++ stable/12/sys/dev/sfxge/common/efx_mac.c Fri Dec 21 17:10:48 2018 (r342346) @@ -45,7 +45,7 @@ siena_mac_multicast_list_set( #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_SIENA -static const efx_mac_ops_t __efx_siena_mac_ops = { +static const efx_mac_ops_t __efx_mac_siena_ops = { siena_mac_poll, /* emo_poll */ siena_mac_up, /* emo_up */ siena_mac_reconfigure, /* emo_addr_set */ @@ -68,7 +68,7 @@ static const efx_mac_ops_t __efx_siena_mac_ops = { #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON || EFSYS_OPT_MEDFORD -static const efx_mac_ops_t __efx_ef10_mac_ops = { +static const efx_mac_ops_t __efx_mac_ef10_ops = { ef10_mac_poll, /* emo_poll */ ef10_mac_up, /* emo_up */ ef10_mac_addr_set, /* emo_addr_set */ @@ -811,21 +811,21 @@ efx_mac_select( switch (enp->en_family) { #if EFSYS_OPT_SIENA case EFX_FAMILY_SIENA: - emop = &__efx_siena_mac_ops; + emop = &__efx_mac_siena_ops; type = EFX_MAC_SIENA; break; #endif /* EFSYS_OPT_SIENA */ #if EFSYS_OPT_HUNTINGTON case EFX_FAMILY_HUNTINGTON: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_HUNTINGTON; break; #endif /* EFSYS_OPT_HUNTINGTON */ #if EFSYS_OPT_MEDFORD case EFX_FAMILY_MEDFORD: - emop = &__efx_ef10_mac_ops; + emop = &__efx_mac_ef10_ops; type = EFX_MAC_MEDFORD; break; #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-stable@freebsd.org Fri Dec 21 17:12:06 2018 Return-Path: Delivered-To: svn-src-stable@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 7D5021350EAA; Fri, 21 Dec 2018 17:12:06 +0000 (UTC) (envelope-from arybchik@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 1B81073935; Fri, 21 Dec 2018 17:12:06 +0000 (UTC) (envelope-from arybchik@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 0ADBD1874C; Fri, 21 Dec 2018 17:12:06 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHC5V7004083; Fri, 21 Dec 2018 17:12:05 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHC5eW004081; Fri, 21 Dec 2018 17:12:05 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211712.wBLHC5eW004081@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342347 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342347 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 1B81073935 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:12:06 -0000 Author: arybchik Date: Fri Dec 21 17:12:05 2018 New Revision: 342347 URL: https://svnweb.freebsd.org/changeset/base/342347 Log: MFC r340833 sfxge(4): support inner checksum offload on transmit Inner checksum offloads may be used only if firmware supports these tunnels. Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18102 Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 17:10:48 2018 (r342346) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 17:12:05 2018 (r342347) @@ -86,12 +86,16 @@ efx_mcdi_init_txq( MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_LABEL, label); MCDI_IN_SET_DWORD(req, INIT_TXQ_IN_INSTANCE, instance); - MCDI_IN_POPULATE_DWORD_7(req, INIT_TXQ_IN_FLAGS, + MCDI_IN_POPULATE_DWORD_9(req, INIT_TXQ_IN_FLAGS, INIT_TXQ_IN_FLAG_BUFF_MODE, 0, INIT_TXQ_IN_FLAG_IP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_IPV4) ? 0 : 1, INIT_TXQ_IN_FLAG_TCP_CSUM_DIS, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 0 : 1, + INIT_TXQ_EXT_IN_FLAG_INNER_IP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0, + INIT_TXQ_EXT_IN_FLAG_INNER_TCP_CSUM_EN, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, INIT_TXQ_EXT_IN_FLAG_TSOV2_EN, (flags & EFX_TXQ_FATSOV2) ? 1 : 0, INIT_TXQ_IN_FLAG_TCP_UDP_ONLY, 0, INIT_TXQ_IN_CRC_MODE, 0, @@ -195,14 +199,23 @@ ef10_tx_qcreate( __in efx_txq_t *etp, __out unsigned int *addedp) { + efx_nic_cfg_t *encp = &enp->en_nic_cfg; + uint16_t inner_csum; efx_qword_t desc; efx_rc_t rc; _NOTE(ARGUNUSED(id)) + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if (((flags & inner_csum) != 0) && + (encp->enc_tunnel_encapsulations_supported == 0)) { + rc = EINVAL; + goto fail1; + } + if ((rc = efx_mcdi_init_txq(enp, n, eep->ee_index, label, index, flags, esmp)) != 0) - goto fail1; + goto fail2; /* * A previous user of this TX queue may have written a descriptor to the @@ -213,19 +226,25 @@ ef10_tx_qcreate( * a no-op TX option descriptor. See bug29981 for details. */ *addedp = 1; - EFX_POPULATE_QWORD_4(desc, + EFX_POPULATE_QWORD_6(desc, ESF_DZ_TX_DESC_IS_OPT, 1, ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, ESF_DZ_TX_OPTION_UDP_TCP_CSUM, (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, ESF_DZ_TX_OPTION_IP_CSUM, - (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0); + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_IP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); ef10_tx_qpush(etp, *addedp, 0); return (0); +fail2: + EFSYS_PROBE(fail2); fail1: EFSYS_PROBE1(fail1, efx_rc_t, rc); Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:10:48 2018 (r342346) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:12:05 2018 (r342347) @@ -1999,9 +1999,11 @@ efx_tx_fini( #define EFX_TXQ_MAX_BUFS 8 /* Maximum independent of EFX_BUG35388_WORKAROUND. */ -#define EFX_TXQ_CKSUM_IPV4 0x0001 -#define EFX_TXQ_CKSUM_TCPUDP 0x0002 -#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_IPV4 0x0001 +#define EFX_TXQ_CKSUM_TCPUDP 0x0002 +#define EFX_TXQ_FATSOV2 0x0004 +#define EFX_TXQ_CKSUM_INNER_IPV4 0x0008 +#define EFX_TXQ_CKSUM_INNER_TCPUDP 0x0010 extern __checkReturn efx_rc_t efx_tx_qcreate( Modified: stable/12/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 17:10:48 2018 (r342346) +++ stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 17:12:05 2018 (r342347) @@ -905,6 +905,7 @@ siena_tx_qcreate( efx_nic_cfg_t *encp = &(enp->en_nic_cfg); efx_oword_t oword; uint32_t size; + uint16_t inner_csum; efx_rc_t rc; _NOTE(ARGUNUSED(esmp)) @@ -934,6 +935,12 @@ siena_tx_qcreate( goto fail3; } + inner_csum = EFX_TXQ_CKSUM_INNER_IPV4 | EFX_TXQ_CKSUM_INNER_TCPUDP; + if ((flags & inner_csum) != 0) { + rc = EINVAL; + goto fail4; + } + /* Set up the new descriptor queue */ *addedp = 0; @@ -956,6 +963,8 @@ siena_tx_qcreate( return (0); +fail4: + EFSYS_PROBE(fail4); fail3: EFSYS_PROBE(fail3); fail2: From owner-svn-src-stable@freebsd.org Fri Dec 21 17:18:35 2018 Return-Path: Delivered-To: svn-src-stable@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 7F2FB13512C2; Fri, 21 Dec 2018 17:18:35 +0000 (UTC) (envelope-from arybchik@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 20970741F2; Fri, 21 Dec 2018 17:18:35 +0000 (UTC) (envelope-from arybchik@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 0E4C818775; Fri, 21 Dec 2018 17:18:35 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHIY3Q007544; Fri, 21 Dec 2018 17:18:34 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHIYa9007537; Fri, 21 Dec 2018 17:18:34 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211718.wBLHIYa9007537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:18:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342348 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342348 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 20970741F2 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.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:18:35 -0000 Author: arybchik Date: Fri Dec 21 17:18:33 2018 New Revision: 342348 URL: https://svnweb.freebsd.org/changeset/base/342348 Log: MFC r341038 sfxge(4): add method to make checksum option descriptors Submitted by: Mark Spender Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18160 Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h stable/12/sys/dev/sfxge/common/ef10_tx.c stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_impl.h stable/12/sys/dev/sfxge/common/efx_tx.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/ef10_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 17:12:05 2018 (r342347) +++ stable/12/sys/dev/sfxge/common/ef10_impl.h Fri Dec 21 17:18:33 2018 (r342348) @@ -759,6 +759,11 @@ ef10_tx_qdesc_vlantci_create( __in uint16_t vlan_tci, __out efx_desc_t *edp); +extern void +ef10_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp); #if EFSYS_OPT_QSTATS Modified: stable/12/sys/dev/sfxge/common/ef10_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 17:12:05 2018 (r342347) +++ stable/12/sys/dev/sfxge/common/ef10_tx.c Fri Dec 21 17:18:33 2018 (r342348) @@ -201,7 +201,7 @@ ef10_tx_qcreate( { efx_nic_cfg_t *encp = &enp->en_nic_cfg; uint16_t inner_csum; - efx_qword_t desc; + efx_desc_t desc; efx_rc_t rc; _NOTE(ARGUNUSED(id)) @@ -226,19 +226,9 @@ ef10_tx_qcreate( * a no-op TX option descriptor. See bug29981 for details. */ *addedp = 1; - EFX_POPULATE_QWORD_6(desc, - ESF_DZ_TX_DESC_IS_OPT, 1, - ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, - ESF_DZ_TX_OPTION_UDP_TCP_CSUM, - (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, - ESF_DZ_TX_OPTION_IP_CSUM, - (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, - ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, - (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, - ESF_DZ_TX_OPTION_INNER_IP_CSUM, - (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); + ef10_tx_qdesc_checksum_create(etp, flags, &desc); - EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc); + EFSYS_MEM_WRITEQ(etp->et_esmp, 0, &desc.ed_eq); ef10_tx_qpush(etp, *addedp, 0); return (0); @@ -700,6 +690,30 @@ ef10_tx_qdesc_vlantci_create( ESE_DZ_TX_OPTION_DESC_VLAN, ESF_DZ_TX_VLAN_OP, tci ? 1 : 0, ESF_DZ_TX_VLAN_TAG1, tci); +} + + void +ef10_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp) +{ + _NOTE(ARGUNUSED(etp)); + + EFSYS_PROBE2(tx_desc_checksum_create, unsigned int, etp->et_index, + uint32_t, flags); + + EFX_POPULATE_QWORD_6(edp->ed_eq, + ESF_DZ_TX_DESC_IS_OPT, 1, + ESF_DZ_TX_OPTION_TYPE, ESE_DZ_TX_OPTION_DESC_CRC_CSUM, + ESF_DZ_TX_OPTION_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_IP_CSUM, + (flags & EFX_TXQ_CKSUM_IPV4) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_UDP_TCP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_TCPUDP) ? 1 : 0, + ESF_DZ_TX_OPTION_INNER_IP_CSUM, + (flags & EFX_TXQ_CKSUM_INNER_IPV4) ? 1 : 0); } Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:12:05 2018 (r342347) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:18:33 2018 (r342348) @@ -2112,6 +2112,12 @@ efx_tx_qdesc_vlantci_create( __in uint16_t tci, __out efx_desc_t *edp); +extern void +efx_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp); + #if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES Modified: stable/12/sys/dev/sfxge/common/efx_impl.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 17:12:05 2018 (r342347) +++ stable/12/sys/dev/sfxge/common/efx_impl.h Fri Dec 21 17:18:33 2018 (r342348) @@ -143,6 +143,8 @@ typedef struct efx_tx_ops_s { efx_desc_t *, int); void (*etxo_qdesc_vlantci_create)(efx_txq_t *, uint16_t, efx_desc_t *); + void (*etxo_qdesc_checksum_create)(efx_txq_t *, uint16_t, + efx_desc_t *); #if EFSYS_OPT_QSTATS void (*etxo_qstats_update)(efx_txq_t *, efsys_stat_t *); Modified: stable/12/sys/dev/sfxge/common/efx_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 17:12:05 2018 (r342347) +++ stable/12/sys/dev/sfxge/common/efx_tx.c Fri Dec 21 17:18:33 2018 (r342348) @@ -146,6 +146,7 @@ static const efx_tx_ops_t __efx_tx_siena_ops = { NULL, /* etxo_qdesc_tso_create */ NULL, /* etxo_qdesc_tso2_create */ NULL, /* etxo_qdesc_vlantci_create */ + NULL, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS siena_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -172,6 +173,7 @@ static const efx_tx_ops_t __efx_tx_hunt_ops = { ef10_tx_qdesc_tso_create, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_checksum_create, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -198,6 +200,7 @@ static const efx_tx_ops_t __efx_tx_medford_ops = { NULL, /* etxo_qdesc_tso_create */ ef10_tx_qdesc_tso2_create, /* etxo_qdesc_tso2_create */ ef10_tx_qdesc_vlantci_create, /* etxo_qdesc_vlantci_create */ + ef10_tx_qdesc_checksum_create, /* etxo_qdesc_checksum_create */ #if EFSYS_OPT_QSTATS ef10_tx_qstats_update, /* etxo_qstats_update */ #endif @@ -645,6 +648,21 @@ efx_tx_qdesc_vlantci_create( EFSYS_ASSERT(etxop->etxo_qdesc_vlantci_create != NULL); etxop->etxo_qdesc_vlantci_create(etp, tci, edp); +} + + void +efx_tx_qdesc_checksum_create( + __in efx_txq_t *etp, + __in uint16_t flags, + __out efx_desc_t *edp) +{ + efx_nic_t *enp = etp->et_enp; + const efx_tx_ops_t *etxop = enp->en_etxop; + + EFSYS_ASSERT3U(etp->et_magic, ==, EFX_TXQ_MAGIC); + EFSYS_ASSERT(etxop->etxo_qdesc_checksum_create != NULL); + + etxop->etxo_qdesc_checksum_create(etp, flags, edp); } From owner-svn-src-stable@freebsd.org Fri Dec 21 17:22:18 2018 Return-Path: Delivered-To: svn-src-stable@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 93F641351579; Fri, 21 Dec 2018 17:22:18 +0000 (UTC) (envelope-from arybchik@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 3982574625; Fri, 21 Dec 2018 17:22:18 +0000 (UTC) (envelope-from arybchik@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 1132C1891D; Fri, 21 Dec 2018 17:22:18 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHMHgt011666; Fri, 21 Dec 2018 17:22:17 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHMHpX011664; Fri, 21 Dec 2018 17:22:17 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211722.wBLHMHpX011664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342350 - stable/12/sys/dev/sfxge/common X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge/common X-SVN-Commit-Revision: 342350 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 3982574625 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]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US]; NEURAL_HAM_LONG(-1.00)[-0.999,0] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:22:18 -0000 Author: arybchik Date: Fri Dec 21 17:22:17 2018 New Revision: 342350 URL: https://svnweb.freebsd.org/changeset/base/342350 Log: MFC r341783 sfxge(4): report support for Tx checksum op descriptors FreeBSD driver needs a patch to provide a means for packets which do not need checksum offload but have flow ID set to avoid hitting only the first Tx queue (which has been used for packets not needing checksum offload). This should be possible on Huntington, Medford or Medford2 chips since these support toggling checksum offload on any given queue dynamically by means of pushing option descriptors. The patch for FreeBSD driver will then need a means to figure out whether the feature can be used, and testing adapter family might not be a good solution. This patch adds a feature bit specifically to indicate support for checksum option descriptors. The new feature bits may have more users in future, apart from the mentioned FreeBSD patch. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18388 Modified: stable/12/sys/dev/sfxge/common/efx.h stable/12/sys/dev/sfxge/common/efx_nic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/common/efx.h ============================================================================== --- stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:22:15 2018 (r342349) +++ stable/12/sys/dev/sfxge/common/efx.h Fri Dec 21 17:22:17 2018 (r342350) @@ -1086,6 +1086,7 @@ efx_bist_stop( #define EFX_FEATURE_PIO_BUFFERS 0x00000800 #define EFX_FEATURE_FW_ASSISTED_TSO 0x00001000 #define EFX_FEATURE_FW_ASSISTED_TSO_V2 0x00002000 +#define EFX_FEATURE_TXQ_CKSUM_OP_DESC 0x00008000 typedef enum efx_tunnel_protocol_e { EFX_TUNNEL_PROTOCOL_NONE = 0, Modified: stable/12/sys/dev/sfxge/common/efx_nic.c ============================================================================== --- stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 17:22:15 2018 (r342349) +++ stable/12/sys/dev/sfxge/common/efx_nic.c Fri Dec 21 17:22:17 2018 (r342350) @@ -217,7 +217,8 @@ efx_nic_create( EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | EFX_FEATURE_FW_ASSISTED_TSO | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_TXQ_CKSUM_OP_DESC; break; #endif /* EFSYS_OPT_HUNTINGTON */ @@ -236,7 +237,8 @@ efx_nic_create( EFX_FEATURE_MAC_HEADER_FILTERS | EFX_FEATURE_MCDI_DMA | EFX_FEATURE_PIO_BUFFERS | - EFX_FEATURE_FW_ASSISTED_TSO_V2; + EFX_FEATURE_FW_ASSISTED_TSO_V2 | + EFX_FEATURE_TXQ_CKSUM_OP_DESC; break; #endif /* EFSYS_OPT_MEDFORD */ From owner-svn-src-stable@freebsd.org Fri Dec 21 17:23:46 2018 Return-Path: Delivered-To: svn-src-stable@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 68FFF1351694; Fri, 21 Dec 2018 17:23:46 +0000 (UTC) (envelope-from arybchik@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 0E04074957; Fri, 21 Dec 2018 17:23:46 +0000 (UTC) (envelope-from arybchik@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 CBA4018932; Fri, 21 Dec 2018 17:23:45 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHNj0f012515; Fri, 21 Dec 2018 17:23:45 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHNjRO012511; Fri, 21 Dec 2018 17:23:45 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211723.wBLHNjRO012511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342351 - stable/12/sys/dev/sfxge X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge X-SVN-Commit-Revision: 342351 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 0E04074957 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.971,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:23:46 -0000 Author: arybchik Date: Fri Dec 21 17:23:44 2018 New Revision: 342351 URL: https://svnweb.freebsd.org/changeset/base/342351 Log: MFC r341784 sfxge(4): prepare the number of Tx queues on event queue 0 to become variable The number of Tx queues on event queue 0 can depend on the NIC family type, and this property will be leveraged by future patches. This patch prepares the code for this change. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18389 Modified: stable/12/sys/dev/sfxge/sfxge.c stable/12/sys/dev/sfxge/sfxge_ev.c stable/12/sys/dev/sfxge/sfxge_tx.c stable/12/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 17:22:17 2018 (r342350) +++ stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 17:23:44 2018 (r342351) @@ -151,8 +151,8 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc) limits.edl_min_evq_count = 1; limits.edl_max_evq_count = evq_max; - limits.edl_min_txq_count = SFXGE_TXQ_NTYPES; - limits.edl_max_txq_count = evq_max + SFXGE_TXQ_NTYPES - 1; + limits.edl_min_txq_count = SFXGE_EVQ0_N_TXQ(sc); + limits.edl_max_txq_count = evq_max + SFXGE_EVQ0_N_TXQ(sc) - 1; limits.edl_min_rxq_count = 1; limits.edl_max_rxq_count = evq_max; @@ -168,12 +168,12 @@ sfxge_estimate_rsrc_limits(struct sfxge_softc *sc) return (rc); } - KASSERT(txq_allocated >= SFXGE_TXQ_NTYPES, - ("txq_allocated < SFXGE_TXQ_NTYPES")); + KASSERT(txq_allocated >= SFXGE_EVQ0_N_TXQ(sc), + ("txq_allocated < %u", SFXGE_EVQ0_N_TXQ(sc))); sc->evq_max = MIN(evq_allocated, evq_max); sc->evq_max = MIN(rxq_allocated, sc->evq_max); - sc->evq_max = MIN(txq_allocated - (SFXGE_TXQ_NTYPES - 1), + sc->evq_max = MIN(txq_allocated - (SFXGE_EVQ0_N_TXQ(sc) - 1), sc->evq_max); KASSERT(sc->evq_max <= evq_max, @@ -205,7 +205,7 @@ sfxge_set_drv_limits(struct sfxge_softc *sc) limits.edl_min_evq_count = limits.edl_max_evq_count = sc->intr.n_alloc; limits.edl_min_txq_count = limits.edl_max_txq_count = - sc->intr.n_alloc + SFXGE_TXQ_NTYPES - 1; + sc->intr.n_alloc + SFXGE_EVQ0_N_TXQ(sc) - 1; limits.edl_min_rxq_count = limits.edl_max_rxq_count = sc->intr.n_alloc; Modified: stable/12/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 17:22:17 2018 (r342350) +++ stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 17:23:44 2018 (r342351) @@ -269,9 +269,10 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx { unsigned int index; - KASSERT((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || + KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) || (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); - index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_TXQ_NTYPES); + index = (evq->index == 0) ? + label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc)); return (evq->sc->txq[index]); } Modified: stable/12/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 17:22:17 2018 (r342350) +++ stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 17:23:44 2018 (r342351) @@ -1972,7 +1972,7 @@ sfxge_tx_init(struct sfxge_softc *sc) goto fail_tx_dpl_put_max; } - sc->txq_count = SFXGE_TXQ_NTYPES - 1 + sc->intr.n_alloc; + sc->txq_count = SFXGE_EVQ0_N_TXQ(sc) - 1 + sc->intr.n_alloc; sc->tso_fw_assisted = sfxge_tso_fw_assisted; if ((~encp->enc_features & EFX_FEATURE_FW_ASSISTED_TSO) || @@ -2001,9 +2001,9 @@ sfxge_tx_init(struct sfxge_softc *sc) goto fail2; for (index = 0; - index < sc->txq_count - SFXGE_TXQ_NTYPES + 1; + index < sc->txq_count - SFXGE_EVQ0_N_TXQ(sc) + 1; index++) { - if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NTYPES - 1 + index, + if ((rc = sfxge_tx_qinit(sc, SFXGE_EVQ0_N_TXQ(sc) - 1 + index, SFXGE_TXQ_IP_TCP_UDP_CKSUM, index)) != 0) goto fail3; } Modified: stable/12/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_tx.h Fri Dec 21 17:22:17 2018 (r342350) +++ stable/12/sys/dev/sfxge/sfxge_tx.h Fri Dec 21 17:23:44 2018 (r342351) @@ -139,6 +139,8 @@ enum sfxge_txq_type { SFXGE_TXQ_NTYPES }; +#define SFXGE_EVQ0_N_TXQ(_sc) SFXGE_TXQ_NTYPES + #define SFXGE_TXQ_UNBLOCK_LEVEL(_entries) (EFX_TXQ_LIMIT(_entries) / 4) #define SFXGE_TX_BATCH 64 From owner-svn-src-stable@freebsd.org Fri Dec 21 17:26:24 2018 Return-Path: Delivered-To: svn-src-stable@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 1982C13517DD; Fri, 21 Dec 2018 17:26:24 +0000 (UTC) (envelope-from arybchik@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 B49A974BC3; Fri, 21 Dec 2018 17:26:23 +0000 (UTC) (envelope-from arybchik@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 9E98D18937; Fri, 21 Dec 2018 17:26:23 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLHQNbH012844; Fri, 21 Dec 2018 17:26:23 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLHQMNI012840; Fri, 21 Dec 2018 17:26:22 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201812211726.wBLHQMNI012840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 21 Dec 2018 17:26:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342352 - stable/12/sys/dev/sfxge X-SVN-Group: stable-12 X-SVN-Commit-Author: arybchik X-SVN-Commit-Paths: stable/12/sys/dev/sfxge X-SVN-Commit-Revision: 342352 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: B49A974BC3 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.972,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 17:26:24 -0000 Author: arybchik Date: Fri Dec 21 17:26:22 2018 New Revision: 342352 URL: https://svnweb.freebsd.org/changeset/base/342352 Log: MFC r341785 sfxge(4): use n Tx queues instead of n + 2 on EF10 HW On EF10 HW we can avoid sending packets without checksum offload or with IP-only checksum offload to dedicated queues. Instead, we can use option descriptors to change offload policy on any queue during runtime. Thus, we don't need to create two dedicated queues. Submitted by: Ivan Malov Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18390 Modified: stable/12/sys/dev/sfxge/sfxge.c stable/12/sys/dev/sfxge/sfxge.h stable/12/sys/dev/sfxge/sfxge_ev.c stable/12/sys/dev/sfxge/sfxge_tx.c stable/12/sys/dev/sfxge/sfxge_tx.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/sfxge/sfxge.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 17:23:44 2018 (r342351) +++ stable/12/sys/dev/sfxge/sfxge.c Fri Dec 21 17:26:22 2018 (r342352) @@ -762,6 +762,11 @@ sfxge_create(struct sfxge_softc *sc) } sc->rxq_entries = sfxge_rx_ring_entries; + if (efx_nic_cfg_get(enp)->enc_features & EFX_FEATURE_TXQ_CKSUM_OP_DESC) + sc->txq_dynamic_cksum_toggle_supported = B_TRUE; + else + sc->txq_dynamic_cksum_toggle_supported = B_FALSE; + if (!ISP2(sfxge_tx_ring_entries) || (sfxge_tx_ring_entries < EFX_TXQ_MINNDESCS) || (sfxge_tx_ring_entries > efx_nic_cfg_get(enp)->enc_txq_max_ndescs)) { Modified: stable/12/sys/dev/sfxge/sfxge.h ============================================================================== --- stable/12/sys/dev/sfxge/sfxge.h Fri Dec 21 17:23:44 2018 (r342351) +++ stable/12/sys/dev/sfxge/sfxge.h Fri Dec 21 17:26:22 2018 (r342352) @@ -292,6 +292,8 @@ struct sfxge_softc { efx_nic_t *enp; efsys_lock_t enp_lock; + boolean_t txq_dynamic_cksum_toggle_supported; + unsigned int rxq_entries; unsigned int txq_entries; Modified: stable/12/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 17:23:44 2018 (r342351) +++ stable/12/sys/dev/sfxge/sfxge_ev.c Fri Dec 21 17:26:22 2018 (r342352) @@ -269,8 +269,11 @@ sfxge_get_txq_by_label(struct sfxge_evq *evq, enum sfx { unsigned int index; - KASSERT((evq->index == 0 && label < SFXGE_EVQ0_N_TXQ(evq->sc)) || - (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM), ("unexpected txq label")); + KASSERT((evq->sc->txq_dynamic_cksum_toggle_supported) ? (label == 0) : + ((evq->index == 0 && label < SFXGE_TXQ_NTYPES) || + (label == SFXGE_TXQ_IP_TCP_UDP_CKSUM)), + ("unexpected txq label")); + index = (evq->index == 0) ? label : (evq->index - 1 + SFXGE_EVQ0_N_TXQ(evq->sc)); return (evq->sc->txq[index]); Modified: stable/12/sys/dev/sfxge/sfxge_tx.c ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 17:23:44 2018 (r342351) +++ stable/12/sys/dev/sfxge/sfxge_tx.c Fri Dec 21 17:26:22 2018 (r342352) @@ -35,7 +35,7 @@ /* Theory of operation: * - * Tx queues allocation and mapping + * Tx queues allocation and mapping on Siena * * One Tx queue with enabled checksum offload is allocated per Rx channel * (event queue). Also 2 Tx queues (one without checksum offload and one @@ -46,6 +46,17 @@ * if event queue index is 0, TxQ-index = TxQ-label * [0..SFXGE_TXQ_NTYPES) * else TxQ-index = SFXGE_TXQ_NTYPES + EvQ-index - 1 * See sfxge_get_txq_by_label() sfxge_ev.c + * + * Tx queue allocation and mapping on EF10 + * + * One Tx queue with enabled checksum offload is allocated per Rx + * channel (event queue). Checksum offload on all Tx queues is enabled or + * disabled dynamically by inserting option descriptors, so the additional + * queues used on Siena are not required. + * + * TxQ label is always set to zero on EF10 hardware. + * So, event queue to Tx queue mapping is simple: + * TxQ-index = EvQ-index */ #include @@ -139,38 +150,75 @@ static void sfxge_tx_qlist_post(struct sfxge_txq *txq) static void sfxge_tx_qunblock(struct sfxge_txq *txq); static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf, const bus_dma_segment_t *dma_seg, int n_dma_seg, - int vlan_tagged); + int n_extra_descs); +static inline void +sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp) +{ + KASSERT((*pstmp)->flags == 0, ("stmp flags are not 0")); + if (__predict_false(*pstmp == + &txq->stmp[txq->ptr_mask])) + *pstmp = &txq->stmp[0]; + else + (*pstmp)++; +} + static int -sfxge_tx_maybe_insert_tag(struct sfxge_txq *txq, struct mbuf *mbuf) +sfxge_tx_maybe_toggle_cksum_offload(struct sfxge_txq *txq, struct mbuf *mbuf, + struct sfxge_tx_mapping **pstmp) { + uint16_t new_hw_cksum_flags; + efx_desc_t *desc; + + if (mbuf->m_pkthdr.csum_flags & + (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6 | CSUM_TSO)) { + /* + * We always set EFX_TXQ_CKSUM_IPV4 here because this + * configuration is the most useful, and this won't + * cause any trouble in case of IPv6 traffic anyway. + */ + new_hw_cksum_flags = EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP; + } else if (mbuf->m_pkthdr.csum_flags & CSUM_DELAY_IP) { + new_hw_cksum_flags = EFX_TXQ_CKSUM_IPV4; + } else { + new_hw_cksum_flags = 0; + } + + if (new_hw_cksum_flags == txq->hw_cksum_flags) + return (0); + + desc = &txq->pend_desc[txq->n_pend_desc]; + efx_tx_qdesc_checksum_create(txq->common, new_hw_cksum_flags, desc); + txq->hw_cksum_flags = new_hw_cksum_flags; + txq->n_pend_desc++; + + sfxge_next_stmp(txq, pstmp); + + return (1); +} + +static int +sfxge_tx_maybe_insert_tag(struct sfxge_txq *txq, struct mbuf *mbuf, + struct sfxge_tx_mapping **pstmp) +{ uint16_t this_tag = ((mbuf->m_flags & M_VLANTAG) ? mbuf->m_pkthdr.ether_vtag : 0); + efx_desc_t *desc; if (this_tag == txq->hw_vlan_tci) return (0); - efx_tx_qdesc_vlantci_create(txq->common, - bswap16(this_tag), - &txq->pend_desc[0]); - txq->n_pend_desc = 1; + desc = &txq->pend_desc[txq->n_pend_desc]; + efx_tx_qdesc_vlantci_create(txq->common, bswap16(this_tag), desc); txq->hw_vlan_tci = this_tag; + txq->n_pend_desc++; + + sfxge_next_stmp(txq, pstmp); + return (1); } -static inline void -sfxge_next_stmp(struct sfxge_txq *txq, struct sfxge_tx_mapping **pstmp) -{ - KASSERT((*pstmp)->flags == 0, ("stmp flags are not 0")); - if (__predict_false(*pstmp == - &txq->stmp[txq->ptr_mask])) - *pstmp = &txq->stmp[0]; - else - (*pstmp)++; -} - - void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq) { @@ -361,8 +409,9 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, int rc; int i; int eop; + uint16_t hw_cksum_flags_prev; uint16_t hw_vlan_tci_prev; - int vlan_tagged; + int n_extra_descs; KASSERT(!txq->blocked, ("txq->blocked")); @@ -413,14 +462,20 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, used_map = &stmp->map; + hw_cksum_flags_prev = txq->hw_cksum_flags; hw_vlan_tci_prev = txq->hw_vlan_tci; - vlan_tagged = sfxge_tx_maybe_insert_tag(txq, mbuf); - if (vlan_tagged) { - sfxge_next_stmp(txq, &stmp); - } + /* + * The order of option descriptors, which are used to leverage VLAN tag + * and checksum offloads, might be important. Changing checksum offload + * between VLAN option and packet descriptors probably does not work. + */ + n_extra_descs = sfxge_tx_maybe_toggle_cksum_offload(txq, mbuf, &stmp); + n_extra_descs += sfxge_tx_maybe_insert_tag(txq, mbuf, &stmp); + if (mbuf->m_pkthdr.csum_flags & CSUM_TSO) { - rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg, vlan_tagged); + rc = sfxge_tx_queue_tso(txq, mbuf, dma_seg, n_dma_seg, + n_extra_descs); if (rc < 0) goto reject_mapped; stmp = &txq->stmp[(rc - 1) & txq->ptr_mask]; @@ -431,7 +486,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, i = 0; for (;;) { - desc = &txq->pend_desc[i + vlan_tagged]; + desc = &txq->pend_desc[i + n_extra_descs]; eop = (i == n_dma_seg - 1); efx_tx_qdesc_dma_create(txq->common, dma_seg[i].ds_addr, @@ -443,7 +498,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, i++; sfxge_next_stmp(txq, &stmp); } - txq->n_pend_desc = n_dma_seg + vlan_tagged; + txq->n_pend_desc = n_dma_seg + n_extra_descs; } /* @@ -467,6 +522,7 @@ static int sfxge_tx_queue_mbuf(struct sfxge_txq *txq, reject_mapped: txq->hw_vlan_tci = hw_vlan_tci_prev; + txq->hw_cksum_flags = hw_cksum_flags_prev; bus_dmamap_unload(txq->packet_dma_tag, *used_map); reject: /* Drop the packet on the floor. */ @@ -840,8 +896,9 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) ("interface not up")); /* Pick the desired transmit queue. */ - if (m->m_pkthdr.csum_flags & - (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO)) { + if (sc->txq_dynamic_cksum_toggle_supported | + (m->m_pkthdr.csum_flags & + (CSUM_DELAY_DATA | CSUM_TCP_IPV6 | CSUM_UDP_IPV6 | CSUM_TSO))) { int index = 0; #ifdef RSS @@ -867,7 +924,9 @@ sfxge_if_transmit(struct ifnet *ifp, struct mbuf *m) if (m->m_pkthdr.csum_flags & CSUM_TSO) sfxge_parse_tx_packet(m); #endif - txq = sc->txq[SFXGE_TXQ_IP_TCP_UDP_CKSUM + index]; + index += (sc->txq_dynamic_cksum_toggle_supported == B_FALSE) ? + SFXGE_TXQ_IP_TCP_UDP_CKSUM : 0; + txq = sc->txq[index]; } else if (m->m_pkthdr.csum_flags & CSUM_DELAY_IP) { txq = sc->txq[SFXGE_TXQ_IP_CKSUM]; } else { @@ -1310,7 +1369,7 @@ static int tso_start_new_packet(struct sfxge_txq *txq, static int sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf *mbuf, const bus_dma_segment_t *dma_seg, int n_dma_seg, - int vlan_tagged) + int n_extra_descs) { struct sfxge_tso_state tso; unsigned int id; @@ -1327,7 +1386,7 @@ sfxge_tx_queue_tso(struct sfxge_txq *txq, struct mbuf tso.in_len = dma_seg->ds_len - (tso.header_len - skipped); tso.dma_addr = dma_seg->ds_addr + (tso.header_len - skipped); - id = (txq->added + vlan_tagged) & txq->ptr_mask; + id = (txq->added + n_extra_descs) & txq->ptr_mask; if (__predict_false(tso_start_new_packet(txq, &tso, &id))) return (-1); @@ -1491,6 +1550,8 @@ sfxge_tx_qstop(struct sfxge_softc *sc, unsigned int in efx_sram_buf_tbl_clear(sc->enp, txq->buf_base_id, EFX_TXQ_NBUFS(sc->txq_entries)); + txq->hw_cksum_flags = 0; + SFXGE_EVQ_UNLOCK(evq); SFXGE_TXQ_UNLOCK(txq); } @@ -1512,6 +1573,10 @@ sfxge_tx_max_pkt_desc(const struct sfxge_softc *sc, en unsigned int fa_tso_v1_max_descs = 0; unsigned int fa_tso_v2_max_descs = 0; + /* Checksum offload Tx option descriptor may be required */ + if (sc->txq_dynamic_cksum_toggle_supported) + max_descs++; + /* VLAN tagging Tx option descriptor may be required */ if (efx_nic_cfg_get(sc->enp)->enc_hw_tx_insert_vlan_enabled) max_descs++; @@ -1556,6 +1621,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i efsys_mem_t *esmp; uint16_t flags; unsigned int tso_fw_assisted; + unsigned int label; struct sfxge_evq *evq; unsigned int desc_index; int rc; @@ -1597,8 +1663,10 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i break; } + label = (sc->txq_dynamic_cksum_toggle_supported) ? 0 : txq->type; + /* Create the common code transmit queue. */ - if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, + if ((rc = efx_tx_qcreate(sc->enp, index, label, esmp, sc->txq_entries, txq->buf_base_id, flags, evq->common, &txq->common, &desc_index)) != 0) { /* Retry if no FATSOv2 resources, otherwise fail */ @@ -1608,7 +1676,7 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i /* Looks like all FATSOv2 contexts are used */ flags &= ~EFX_TXQ_FATSOV2; tso_fw_assisted &= ~SFXGE_FATSOV2; - if ((rc = efx_tx_qcreate(sc->enp, index, txq->type, esmp, + if ((rc = efx_tx_qcreate(sc->enp, index, label, esmp, sc->txq_entries, txq->buf_base_id, flags, evq->common, &txq->common, &desc_index)) != 0) goto fail; @@ -1631,6 +1699,9 @@ sfxge_tx_qstart(struct sfxge_softc *sc, unsigned int i txq->hw_vlan_tci = 0; + txq->hw_cksum_flags = flags & + (EFX_TXQ_CKSUM_IPV4 | EFX_TXQ_CKSUM_TCPUDP); + SFXGE_TXQ_UNLOCK(txq); return (0); @@ -1992,13 +2063,15 @@ sfxge_tx_init(struct sfxge_softc *sc) } /* Initialize the transmit queues */ - if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NON_CKSUM, - SFXGE_TXQ_NON_CKSUM, 0)) != 0) - goto fail; + if (sc->txq_dynamic_cksum_toggle_supported == B_FALSE) { + if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_NON_CKSUM, + SFXGE_TXQ_NON_CKSUM, 0)) != 0) + goto fail; - if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_IP_CKSUM, - SFXGE_TXQ_IP_CKSUM, 0)) != 0) - goto fail2; + if ((rc = sfxge_tx_qinit(sc, SFXGE_TXQ_IP_CKSUM, + SFXGE_TXQ_IP_CKSUM, 0)) != 0) + goto fail2; + } for (index = 0; index < sc->txq_count - SFXGE_EVQ0_N_TXQ(sc) + 1; Modified: stable/12/sys/dev/sfxge/sfxge_tx.h ============================================================================== --- stable/12/sys/dev/sfxge/sfxge_tx.h Fri Dec 21 17:23:44 2018 (r342351) +++ stable/12/sys/dev/sfxge/sfxge_tx.h Fri Dec 21 17:26:22 2018 (r342352) @@ -139,7 +139,9 @@ enum sfxge_txq_type { SFXGE_TXQ_NTYPES }; -#define SFXGE_EVQ0_N_TXQ(_sc) SFXGE_TXQ_NTYPES +#define SFXGE_EVQ0_N_TXQ(_sc) \ + ((_sc)->txq_dynamic_cksum_toggle_supported ? \ + 1 : SFXGE_TXQ_NTYPES) #define SFXGE_TXQ_UNBLOCK_LEVEL(_entries) (EFX_TXQ_LIMIT(_entries) / 4) @@ -205,6 +207,9 @@ struct sfxge_txq { unsigned int n_pend_desc; unsigned int added; unsigned int reaped; + + /* The last (or constant) set of HW offloads requested on the queue */ + uint16_t hw_cksum_flags; /* The last VLAN TCI seen on the queue if FW-assisted tagging is used */ From owner-svn-src-stable@freebsd.org Fri Dec 21 23:32:53 2018 Return-Path: Delivered-To: svn-src-stable@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 4BDB51335EB1; Fri, 21 Dec 2018 23:32:53 +0000 (UTC) (envelope-from mm@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 EA9648903F; Fri, 21 Dec 2018 23:32:52 +0000 (UTC) (envelope-from mm@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 DD1541C8C9; Fri, 21 Dec 2018 23:32:52 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLNWq9a009566; Fri, 21 Dec 2018 23:32:52 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLNWo2m009555; Fri, 21 Dec 2018 23:32:50 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201812212332.wBLNWo2m009555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 21 Dec 2018 23:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342359 - in stable/12: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils ... X-SVN-Group: stable-12 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/12: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils lib/libarchive lib/libarc... X-SVN-Commit-Revision: 342359 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: EA9648903F 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 23:32:53 -0000 Author: mm Date: Fri Dec 21 23:32:50 2018 New Revision: 342359 URL: https://svnweb.freebsd.org/changeset/base/342359 Log: MFC r339746,339751,339794,340866,340939,342042: Sync libarchive with vendor. Relevant vendor changes: PR #1013: Add missing h_base offset when performing absolute seeks in xar decompression PR #1023: Support extracting extattrs as non-root on non-user-writeable files PR #1061: Add support for extraction of RAR v5 archives PR #1066: Fix out of bounds read on empty string filename for gnutar, pax and v7tar PR #1067: Fix temporary file path buffer overflow in tests IS #1068: Correctly process and verify integer arguments passed to bsdcpio and bsdtar PR #1070: Don't default XAR entry atime/mtime to the current time PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses IS #1096: Support extracting ACLs with in-entry comments (GNU tar) PR #1102: RAR5 reader - fix big-endian problems PR #1105: Fix various crash, memory corruption and infinite loop conditions RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build Added: stable/12/contrib/libarchive/libarchive/archive_blake2.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2.h stable/12/contrib/libarchive/libarchive/archive_blake2_impl.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h stable/12/contrib/libarchive/libarchive/archive_blake2s_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c stable/12/contrib/libarchive/libarchive/archive_blake2sp_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar5.c - copied, changed from r339746, head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5.c - copied, changed from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu stable/12/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu Modified: stable/12/contrib/libarchive/COPYING stable/12/contrib/libarchive/NEWS stable/12/contrib/libarchive/README.md stable/12/contrib/libarchive/cpio/cpio.c stable/12/contrib/libarchive/libarchive/archive.h stable/12/contrib/libarchive/libarchive/archive_acl.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_all.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_by_code.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/12/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/12/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_mtree.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c stable/12/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/12/contrib/libarchive/libarchive/test/test_extattr_freebsd.c stable/12/contrib/libarchive/libarchive/test/test_fuzz.c stable/12/contrib/libarchive/libarchive/test/test_read_format_xar.c stable/12/contrib/libarchive/libarchive/test/test_write_disk_perms.c stable/12/contrib/libarchive/tar/bsdtar.c stable/12/contrib/libarchive/tar/write.c stable/12/contrib/libarchive/test_utils/test_main.c stable/12/lib/libarchive/Makefile stable/12/lib/libarchive/tests/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/libarchive/COPYING ============================================================================== --- stable/12/contrib/libarchive/COPYING Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/COPYING Fri Dec 21 23:32:50 2018 (r342359) @@ -23,6 +23,13 @@ the actual statements in the files are controlling. * The following source files are in the public domain: libarchive/archive_getdate.c +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have widely varying licensing terms. Please check individual files before @@ -34,7 +41,7 @@ do use the license below. The varying licensing of th seems to be an unavoidable mess. -Copyright (c) 2003-2009 +Copyright (c) 2003-2018 All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/12/contrib/libarchive/NEWS ============================================================================== --- stable/12/contrib/libarchive/NEWS Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/NEWS Fri Dec 21 23:32:50 2018 (r342359) @@ -1,3 +1,5 @@ +Oct 06, 2018: RAR 5.0 reader + Sep 03, 2018: libarchive 3.3.3 released Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files Modified: stable/12/contrib/libarchive/README.md ============================================================================== --- stable/12/contrib/libarchive/README.md Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/README.md Fri Dec 21 23:32:50 2018 (r342359) @@ -86,7 +86,7 @@ Currently, the library automatically detects and reads * 7-Zip archives * Microsoft CAB format * LHA and LZH archives - * RAR archives (with some limitations due to RAR's proprietary status) + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) * XAR archives The library also detects and handles any of the following before evaluating the archive: Modified: stable/12/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/12/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:32:50 2018 (r342359) @@ -134,8 +134,9 @@ main(int argc, char *argv[]) struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; + char *tptr; int uid, gid; - int opt; + int opt, t; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); @@ -204,9 +205,15 @@ main(int argc, char *argv[]) cpio->add_filter = opt; break; case 'C': /* NetBSD/OpenBSD */ - cpio->bytes_per_block = atoi(cpio->argument); - if (cpio->bytes_per_block <= 0) - lafe_errc(1, 0, "Invalid blocksize %s", cpio->argument); + errno = 0; + tptr = NULL; + t = (int)strtol(cpio->argument, &tptr, 10); + if (errno || t <= 0 || *(cpio->argument) == '\0' || + tptr == NULL || *tptr != '\0') { + lafe_errc(1, 0, "Invalid blocksize: %s", + cpio->argument); + } + cpio->bytes_per_block = t; break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; @@ -748,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath } if (cpio->option_rename) destpath = cpio_rename(destpath); - if (destpath == NULL) + if (destpath == NULL) { + archive_entry_free(entry); return (0); + } archive_entry_copy_pathname(entry, destpath); /* Modified: stable/12/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:32:50 2018 (r342359) @@ -338,6 +338,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 @@ -449,6 +450,7 @@ __LA_DECL int archive_read_support_format_iso9660(stru __LA_DECL int archive_read_support_format_lha(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_warc(struct archive *); Modified: stable/12/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- stable/12/contrib/libarchive/libarchive/archive_acl.c Fri Dec 21 23:22:37 2018 (r342358) +++ stable/12/contrib/libarchive/libarchive/archive_acl.c Fri Dec 21 23:32:50 2018 (r342359) @@ -753,8 +753,10 @@ archive_acl_to_text_w(struct archive_acl *acl, ssize_t append_entry_w(&wp, prefix, ap->type, ap->tag, flags, wname, ap->permset, id); count++; - } else if (r < 0 && errno == ENOMEM) + } else if (r < 0 && errno == ENOMEM) { + free(ws); return (NULL); + } } /* Add terminating character */ @@ -975,8 +977,10 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t prefix = NULL; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); - if (r != 0) + if (r != 0) { + free(s); return (NULL); + } if (count > 0) *p++ = separator; if (name == NULL || @@ -1581,18 +1585,30 @@ next_field_w(const wchar_t **wp, const wchar_t **start /* Scan for the separator. */ while (**wp != L'\0' && **wp != L',' && **wp != L':' && - **wp != L'\n') { + **wp != L'\n' && **wp != L'#') { (*wp)++; } *sep = **wp; - /* Trim trailing whitespace to locate end of field. */ - *end = *wp - 1; - while (**end == L' ' || **end == L'\t' || **end == L'\n') { - (*end)--; + /* Locate end of field, trim trailing whitespace if necessary */ + if (*wp == *start) { + *end = *wp; + } else { + *end = *wp - 1; + while (**end == L' ' || **end == L'\t' || **end == L'\n') { + (*end)--; + } + (*end)++; } - (*end)++; + /* Handle in-field comments */ + if (*sep == L'#') { + while (**wp != L'\0' && **wp != L',' && **wp != L'\n') { + (*wp)++; + } + *sep = **wp; + } + /* Adjust scanner location. */ if (**wp != L'\0') (*wp)++; @@ -1642,7 +1658,7 @@ archive_acl_from_text_l(struct archive_acl *acl, const ret = ARCHIVE_OK; types = 0; - while (text != NULL && *text != '\0') { + while (text != NULL && *text != '\0') { /* * Parse the fields out of the next entry, * advance 'text' to start of next entry. @@ -1707,6 +1723,11 @@ archive_acl_from_text_l(struct archive_acl *acl, const st = field[n].start + 1; len = field[n].end - field[n].start; + if (len == 0) { + ret = ARCHIVE_WARN; + continue; + } + switch (*s) { case 'u': if (len == 1 || (len == 4 @@ -2053,23 +2074,30 @@ next_field(const char **p, const char **start, *start = *p; /* Scan for the separator. */ - while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n') { + while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n' && + **p != '#') { (*p)++; } *sep = **p; - /* If the field is only whitespace, bail out now. */ - if (**p == '\0') { + /* Locate end of field, trim trailing whitespace if necessary */ + if (*p == *start) { *end = *p; - return; + } else { + *end = *p - 1; + while (**end == ' ' || **end == '\t' || **end == '\n') { + (*end)--; + } + (*end)++; } - /* Trim trailing whitespace to locate end of field. */ - *end = *p - 1; - while (**end == ' ' || **end == '\t' || **end == '\n') { - (*end)--; + /* Handle in-field comments */ + if (*sep == '#') { + while (**p != '\0' && **p != ',' && **p != '\n') { + (*p)++; + } + *sep = **p; } - (*end)++; /* Adjust scanner location. */ if (**p != '\0') Copied: stable/12/contrib/libarchive/libarchive/archive_blake2.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/archive_blake2.h Fri Dec 21 23:32:50 2018 (r342359, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2.h) @@ -0,0 +1,194 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_H +#define BLAKE2_H + +#include +#include + +#if defined(_MSC_VER) +#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +#else +#define BLAKE2_PACKED(x) x __attribute__((packed)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + enum blake2s_constant + { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 + }; + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + typedef struct blake2s_state__ + { + uint32_t h[8]; + uint32_t t[2]; + uint32_t f[2]; + uint8_t buf[BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2s_state; + + typedef struct blake2b_state__ + { + uint64_t h[8]; + uint64_t t[2]; + uint64_t f[2]; + uint8_t buf[BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2b_state; + + typedef struct blake2sp_state__ + { + blake2s_state S[8][1]; + blake2s_state R[1]; + uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2sp_state; + + typedef struct blake2bp_state__ + { + blake2b_state S[4][1]; + blake2b_state R[1]; + uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2bp_state; + + BLAKE2_PACKED(struct blake2s_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint16_t xof_length; /* 14 */ + uint8_t node_depth; /* 15 */ + uint8_t inner_length; /* 16 */ + /* uint8_t reserved[0]; */ + uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ + uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ + }); + + typedef struct blake2s_param__ blake2s_param; + + BLAKE2_PACKED(struct blake2b_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint32_t xof_length; /* 16 */ + uint8_t node_depth; /* 17 */ + uint8_t inner_length; /* 18 */ + uint8_t reserved[14]; /* 32 */ + uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ + uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ + }); + + typedef struct blake2b_param__ blake2b_param; + + typedef struct blake2xs_state__ + { + blake2s_state S[1]; + blake2s_param P[1]; + } blake2xs_state; + + typedef struct blake2xb_state__ + { + blake2b_state S[1]; + blake2b_param P[1]; + } blake2xb_state; + + /* Padded structs result in a compile-time error */ + enum { + BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + }; + + /* Streaming API */ + int blake2s_init( blake2s_state *S, size_t outlen ); + int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); + int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); + int blake2s_final( blake2s_state *S, void *out, size_t outlen ); + + int blake2b_init( blake2b_state *S, size_t outlen ); + int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); + int blake2b_final( blake2b_state *S, void *out, size_t outlen ); + + int blake2sp_init( blake2sp_state *S, size_t outlen ); + int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); + int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); + + int blake2bp_init( blake2bp_state *S, size_t outlen ); + int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); + int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); + + /* Variable output length API */ + int blake2xs_init( blake2xs_state *S, const size_t outlen ); + int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); + int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); + + int blake2xb_init( blake2xb_state *S, const size_t outlen ); + int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); + int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); + + /* Simple API */ + int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + /* This is simply an alias for blake2b */ + int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + +#if defined(__cplusplus) +} +#endif + +#endif Copied: stable/12/contrib/libarchive/libarchive/archive_blake2_impl.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/archive_blake2_impl.h Fri Dec 21 23:32:50 2018 (r342359, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) @@ -0,0 +1,160 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_IMPL_H +#define BLAKE2_IMPL_H + +#include +#include + +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) + #define BLAKE2_INLINE __inline + #elif defined(__GNUC__) + #define BLAKE2_INLINE __inline__ + #else + #define BLAKE2_INLINE + #endif +#else + #define BLAKE2_INLINE inline +#endif + +static BLAKE2_INLINE uint32_t load32( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint32_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8) | + (( uint32_t )( p[2] ) << 16) | + (( uint32_t )( p[3] ) << 24) ; +#endif +} + +static BLAKE2_INLINE uint64_t load64( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint64_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) | + (( uint64_t )( p[6] ) << 48) | + (( uint64_t )( p[7] ) << 56) ; +#endif +} + +static BLAKE2_INLINE uint16_t load16( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint16_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); +#endif +} + +static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + *p++ = ( uint8_t )w; w >>= 8; + *p++ = ( uint8_t )w; +#endif +} + +static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); +#endif +} + +static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); + p[6] = (uint8_t)(w >> 48); + p[7] = (uint8_t)(w >> 56); +#endif +} + +static BLAKE2_INLINE uint64_t load48( const void *src ) +{ + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) ; +} + +static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +{ + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); +} + +static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 32 - c ) ); +} + +static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 64 - c ) ); +} + +/* prevents compiler optimizing out memset() */ +static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +{ + static void *(*const volatile memset_v)(void *, int, size_t) = &memset; + memset_v(v, 0, n); +} + +#endif Copied: stable/12/contrib/libarchive/libarchive/archive_blake2s_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/archive_blake2s_ref.c Fri Dec 21 23:32:50 2018 (r342359, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) @@ -0,0 +1,367 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +static const uint32_t blake2s_IV[8] = +{ + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const uint8_t blake2s_sigma[10][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , +}; + +static void blake2s_set_lastnode( blake2s_state *S ) +{ + S->f[1] = (uint32_t)-1; +} + +/* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock( const blake2s_state *S ) +{ + return S->f[0] != 0; +} + +static void blake2s_set_lastblock( blake2s_state *S ) +{ + if( S->last_node ) blake2s_set_lastnode( S ); + + S->f[0] = (uint32_t)-1; +} + +static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +{ + S->t[0] += inc; + S->t[1] += ( S->t[0] < inc ); +} + +static void blake2s_init0( blake2s_state *S ) +{ + size_t i; + memset( S, 0, sizeof( blake2s_state ) ); + + for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; +} + +/* init2 xors IV with input parameter block */ +int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + size_t i; + + blake2s_init0( S ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) + S->h[i] ^= load32( &p[i * 4] ); + + S->outlen = P->digest_length; + return 0; +} + + +/* Sequential blake2s initialization */ +int blake2s_init( blake2s_state *S, size_t outlen ) +{ + blake2s_param P[1]; + + /* Move interval verification here? */ + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = 0; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + +int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +{ + blake2s_param P[1]; + + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + + if( blake2s_init_param( S, P ) < 0 ) return -1; + + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = rotr32(d ^ a, 16); \ + c = c + d; \ + b = rotr32(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = rotr32(d ^ a, 8); \ + c = c + d; \ + b = rotr32(b ^ c, 7); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) +{ + uint32_t m[16]; + uint32_t v[16]; + size_t i; + + for( i = 0; i < 16; ++i ) { + m[i] = load32( in + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = S->h[i]; + } + + v[ 8] = blake2s_IV[0]; + v[ 9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = S->t[0] ^ blake2s_IV[4]; + v[13] = S->t[1] ^ blake2s_IV[5]; + v[14] = S->f[0] ^ blake2s_IV[6]; + v[15] = S->f[1] ^ blake2s_IV[7]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + + for( i = 0; i < 8; ++i ) { + S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; + } +} + +#undef G +#undef ROUND + +int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + if( inlen > 0 ) + { + size_t left = S->buflen; + size_t fill = BLAKE2S_BLOCKBYTES - left; + if( inlen > fill ) + { + S->buflen = 0; + memcpy( S->buf + left, in, fill ); /* Fill buffer */ + blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); + blake2s_compress( S, S->buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); + blake2s_compress( S, in ); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } + } + memcpy( S->buf + S->buflen, in, inlen ); + S->buflen += inlen; + } + return 0; +} + +int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +{ + uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; + size_t i; + + if( out == NULL || outlen < S->outlen ) + return -1; + + if( blake2s_is_lastblock( S ) ) + return -1; + + blake2s_increment_counter( S, ( uint32_t )S->buflen ); + blake2s_set_lastblock( S ); + memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ + blake2s_compress( S, S->buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); + + memcpy( out, buffer, outlen ); + secure_zero_memory(buffer, sizeof(buffer)); + return 0; +} + +int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +{ + blake2s_state S[1]; + + /* Verify parameters */ + if ( NULL == in && inlen > 0 ) return -1; + + if ( NULL == out ) return -1; + + if ( NULL == key && keylen > 0) return -1; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( keylen > BLAKE2S_KEYBYTES ) return -1; + + if( keylen > 0 ) + { + if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; + } + else + { + if( blake2s_init( S, outlen ) < 0 ) return -1; + } + + blake2s_update( S, ( const uint8_t * )in, inlen ); + blake2s_final( S, out, outlen ); + return 0; +} + +#if defined(SUPERCOP) +int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +{ + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +} +#endif + +#if defined(BLAKE2S_SELFTEST) +#include +#include "blake2-kat.h" +int main( void ) +{ + uint8_t key[BLAKE2S_KEYBYTES]; + uint8_t buf[BLAKE2_KAT_LENGTH]; + size_t i, step; + + for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) + key[i] = ( uint8_t )i; + + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + buf[i] = ( uint8_t )i; + + /* Test simple API */ + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); + + if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) + { + goto fail; + } + } + + /* Test streaming API */ + for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { + for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s_state S; + uint8_t * p = buf; + size_t mlen = i; + int err = 0; + + if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { + goto fail; + } + + while (mlen >= step) { + if ( (err = blake2s_update(&S, p, step)) < 0 ) { + goto fail; + } + mlen -= step; + p += step; + } + if ( (err = blake2s_update(&S, p, mlen)) < 0) { + goto fail; + } + if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { + goto fail; + } + + if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { + goto fail; + } + } + } + + puts( "ok" ); + return 0; +fail: + puts("error"); + return -1; +} +#endif Copied: stable/12/contrib/libarchive/libarchive/archive_blake2sp_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/contrib/libarchive/libarchive/archive_blake2sp_ref.c Fri Dec 21 23:32:50 2018 (r342359, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) @@ -0,0 +1,359 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#if defined(_OPENMP) +#include +#endif + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +#define PARALLELISM_DEGREE 8 + +/* + blake2sp_init_param defaults to setting the expecting output length + from the digest_length parameter block field. + + In some cases, however, we do not want this, as the output length + of these instances is given by inner_length instead. +*/ +static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Dec 21 23:33:09 2018 Return-Path: Delivered-To: svn-src-stable@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 D57B31335F05; Fri, 21 Dec 2018 23:33:08 +0000 (UTC) (envelope-from mm@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 25A9F8913F; Fri, 21 Dec 2018 23:33:08 +0000 (UTC) (envelope-from mm@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 AB5B01C8CA; Fri, 21 Dec 2018 23:33:07 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLNX7Bi009655; Fri, 21 Dec 2018 23:33:07 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLNX5Rh009645; Fri, 21 Dec 2018 23:33:05 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201812212333.wBLNX5Rh009645@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 21 Dec 2018 23:33:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342360 - in stable/11: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils ... X-SVN-Group: stable-11 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/11: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils lib/libarchive lib/libarc... X-SVN-Commit-Revision: 342360 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 25A9F8913F 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 23:33:09 -0000 Author: mm Date: Fri Dec 21 23:33:05 2018 New Revision: 342360 URL: https://svnweb.freebsd.org/changeset/base/342360 Log: MFC r339746,339751,339794,340866,340939,342042: Sync libarchive with vendor. Relevant vendor changes: PR #1013: Add missing h_base offset when performing absolute seeks in xar decompression PR #1023: Support extracting extattrs as non-root on non-user-writeable files PR #1061: Add support for extraction of RAR v5 archives PR #1066: Fix out of bounds read on empty string filename for gnutar, pax and v7tar PR #1067: Fix temporary file path buffer overflow in tests IS #1068: Correctly process and verify integer arguments passed to bsdcpio and bsdtar PR #1070: Don't default XAR entry atime/mtime to the current time PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses IS #1096: Support extracting ACLs with in-entry comments (GNU tar) PR #1102: RAR5 reader - fix big-endian problems PR #1105: Fix various crash, memory corruption and infinite loop conditions RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build Added: stable/11/contrib/libarchive/libarchive/archive_blake2.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2.h stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h stable/11/contrib/libarchive/libarchive/archive_blake2s_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c stable/11/contrib/libarchive/libarchive/archive_blake2sp_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar5.c - copied, changed from r339746, head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5.c - copied, changed from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu stable/11/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu Modified: stable/11/contrib/libarchive/COPYING stable/11/contrib/libarchive/NEWS stable/11/contrib/libarchive/README.md stable/11/contrib/libarchive/cpio/cpio.c stable/11/contrib/libarchive/libarchive/archive.h stable/11/contrib/libarchive/libarchive/archive_acl.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_all.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_by_code.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/11/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/11/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_mtree.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c stable/11/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/11/contrib/libarchive/libarchive/test/test_extattr_freebsd.c stable/11/contrib/libarchive/libarchive/test/test_fuzz.c stable/11/contrib/libarchive/libarchive/test/test_read_format_xar.c stable/11/contrib/libarchive/libarchive/test/test_write_disk_perms.c stable/11/contrib/libarchive/tar/bsdtar.c stable/11/contrib/libarchive/tar/write.c stable/11/contrib/libarchive/test_utils/test_main.c stable/11/lib/libarchive/Makefile stable/11/lib/libarchive/tests/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/libarchive/COPYING ============================================================================== --- stable/11/contrib/libarchive/COPYING Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/COPYING Fri Dec 21 23:33:05 2018 (r342360) @@ -23,6 +23,13 @@ the actual statements in the files are controlling. * The following source files are in the public domain: libarchive/archive_getdate.c +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have widely varying licensing terms. Please check individual files before @@ -34,7 +41,7 @@ do use the license below. The varying licensing of th seems to be an unavoidable mess. -Copyright (c) 2003-2009 +Copyright (c) 2003-2018 All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/11/contrib/libarchive/NEWS ============================================================================== --- stable/11/contrib/libarchive/NEWS Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/NEWS Fri Dec 21 23:33:05 2018 (r342360) @@ -1,3 +1,5 @@ +Oct 06, 2018: RAR 5.0 reader + Sep 03, 2018: libarchive 3.3.3 released Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files Modified: stable/11/contrib/libarchive/README.md ============================================================================== --- stable/11/contrib/libarchive/README.md Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/README.md Fri Dec 21 23:33:05 2018 (r342360) @@ -86,7 +86,7 @@ Currently, the library automatically detects and reads * 7-Zip archives * Microsoft CAB format * LHA and LZH archives - * RAR archives (with some limitations due to RAR's proprietary status) + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) * XAR archives The library also detects and handles any of the following before evaluating the archive: Modified: stable/11/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/11/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:33:05 2018 (r342360) @@ -134,8 +134,9 @@ main(int argc, char *argv[]) struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; + char *tptr; int uid, gid; - int opt; + int opt, t; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); @@ -204,9 +205,15 @@ main(int argc, char *argv[]) cpio->add_filter = opt; break; case 'C': /* NetBSD/OpenBSD */ - cpio->bytes_per_block = atoi(cpio->argument); - if (cpio->bytes_per_block <= 0) - lafe_errc(1, 0, "Invalid blocksize %s", cpio->argument); + errno = 0; + tptr = NULL; + t = (int)strtol(cpio->argument, &tptr, 10); + if (errno || t <= 0 || *(cpio->argument) == '\0' || + tptr == NULL || *tptr != '\0') { + lafe_errc(1, 0, "Invalid blocksize: %s", + cpio->argument); + } + cpio->bytes_per_block = t; break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; @@ -748,8 +755,10 @@ file_to_archive(struct cpio *cpio, const char *srcpath } if (cpio->option_rename) destpath = cpio_rename(destpath); - if (destpath == NULL) + if (destpath == NULL) { + archive_entry_free(entry); return (0); + } archive_entry_copy_pathname(entry, destpath); /* Modified: stable/11/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:33:05 2018 (r342360) @@ -338,6 +338,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 @@ -449,6 +450,7 @@ __LA_DECL int archive_read_support_format_iso9660(stru __LA_DECL int archive_read_support_format_lha(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_warc(struct archive *); Modified: stable/11/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- stable/11/contrib/libarchive/libarchive/archive_acl.c Fri Dec 21 23:32:50 2018 (r342359) +++ stable/11/contrib/libarchive/libarchive/archive_acl.c Fri Dec 21 23:33:05 2018 (r342360) @@ -753,8 +753,10 @@ archive_acl_to_text_w(struct archive_acl *acl, ssize_t append_entry_w(&wp, prefix, ap->type, ap->tag, flags, wname, ap->permset, id); count++; - } else if (r < 0 && errno == ENOMEM) + } else if (r < 0 && errno == ENOMEM) { + free(ws); return (NULL); + } } /* Add terminating character */ @@ -975,8 +977,10 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t prefix = NULL; r = archive_mstring_get_mbs_l( &ap->name, &name, &len, sc); - if (r != 0) + if (r != 0) { + free(s); return (NULL); + } if (count > 0) *p++ = separator; if (name == NULL || @@ -1581,18 +1585,30 @@ next_field_w(const wchar_t **wp, const wchar_t **start /* Scan for the separator. */ while (**wp != L'\0' && **wp != L',' && **wp != L':' && - **wp != L'\n') { + **wp != L'\n' && **wp != L'#') { (*wp)++; } *sep = **wp; - /* Trim trailing whitespace to locate end of field. */ - *end = *wp - 1; - while (**end == L' ' || **end == L'\t' || **end == L'\n') { - (*end)--; + /* Locate end of field, trim trailing whitespace if necessary */ + if (*wp == *start) { + *end = *wp; + } else { + *end = *wp - 1; + while (**end == L' ' || **end == L'\t' || **end == L'\n') { + (*end)--; + } + (*end)++; } - (*end)++; + /* Handle in-field comments */ + if (*sep == L'#') { + while (**wp != L'\0' && **wp != L',' && **wp != L'\n') { + (*wp)++; + } + *sep = **wp; + } + /* Adjust scanner location. */ if (**wp != L'\0') (*wp)++; @@ -1642,7 +1658,7 @@ archive_acl_from_text_l(struct archive_acl *acl, const ret = ARCHIVE_OK; types = 0; - while (text != NULL && *text != '\0') { + while (text != NULL && *text != '\0') { /* * Parse the fields out of the next entry, * advance 'text' to start of next entry. @@ -1707,6 +1723,11 @@ archive_acl_from_text_l(struct archive_acl *acl, const st = field[n].start + 1; len = field[n].end - field[n].start; + if (len == 0) { + ret = ARCHIVE_WARN; + continue; + } + switch (*s) { case 'u': if (len == 1 || (len == 4 @@ -2053,23 +2074,30 @@ next_field(const char **p, const char **start, *start = *p; /* Scan for the separator. */ - while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n') { + while (**p != '\0' && **p != ',' && **p != ':' && **p != '\n' && + **p != '#') { (*p)++; } *sep = **p; - /* If the field is only whitespace, bail out now. */ - if (**p == '\0') { + /* Locate end of field, trim trailing whitespace if necessary */ + if (*p == *start) { *end = *p; - return; + } else { + *end = *p - 1; + while (**end == ' ' || **end == '\t' || **end == '\n') { + (*end)--; + } + (*end)++; } - /* Trim trailing whitespace to locate end of field. */ - *end = *p - 1; - while (**end == ' ' || **end == '\t' || **end == '\n') { - (*end)--; + /* Handle in-field comments */ + if (*sep == '#') { + while (**p != '\0' && **p != ',' && **p != '\n') { + (*p)++; + } + *sep = **p; } - (*end)++; /* Adjust scanner location. */ if (**p != '\0') Copied: stable/11/contrib/libarchive/libarchive/archive_blake2.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_blake2.h Fri Dec 21 23:33:05 2018 (r342360, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2.h) @@ -0,0 +1,194 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_H +#define BLAKE2_H + +#include +#include + +#if defined(_MSC_VER) +#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +#else +#define BLAKE2_PACKED(x) x __attribute__((packed)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + enum blake2s_constant + { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 + }; + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + typedef struct blake2s_state__ + { + uint32_t h[8]; + uint32_t t[2]; + uint32_t f[2]; + uint8_t buf[BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2s_state; + + typedef struct blake2b_state__ + { + uint64_t h[8]; + uint64_t t[2]; + uint64_t f[2]; + uint8_t buf[BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2b_state; + + typedef struct blake2sp_state__ + { + blake2s_state S[8][1]; + blake2s_state R[1]; + uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2sp_state; + + typedef struct blake2bp_state__ + { + blake2b_state S[4][1]; + blake2b_state R[1]; + uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2bp_state; + + BLAKE2_PACKED(struct blake2s_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint16_t xof_length; /* 14 */ + uint8_t node_depth; /* 15 */ + uint8_t inner_length; /* 16 */ + /* uint8_t reserved[0]; */ + uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ + uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ + }); + + typedef struct blake2s_param__ blake2s_param; + + BLAKE2_PACKED(struct blake2b_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint32_t xof_length; /* 16 */ + uint8_t node_depth; /* 17 */ + uint8_t inner_length; /* 18 */ + uint8_t reserved[14]; /* 32 */ + uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ + uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ + }); + + typedef struct blake2b_param__ blake2b_param; + + typedef struct blake2xs_state__ + { + blake2s_state S[1]; + blake2s_param P[1]; + } blake2xs_state; + + typedef struct blake2xb_state__ + { + blake2b_state S[1]; + blake2b_param P[1]; + } blake2xb_state; + + /* Padded structs result in a compile-time error */ + enum { + BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + }; + + /* Streaming API */ + int blake2s_init( blake2s_state *S, size_t outlen ); + int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); + int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); + int blake2s_final( blake2s_state *S, void *out, size_t outlen ); + + int blake2b_init( blake2b_state *S, size_t outlen ); + int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); + int blake2b_final( blake2b_state *S, void *out, size_t outlen ); + + int blake2sp_init( blake2sp_state *S, size_t outlen ); + int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); + int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); + + int blake2bp_init( blake2bp_state *S, size_t outlen ); + int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); + int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); + + /* Variable output length API */ + int blake2xs_init( blake2xs_state *S, const size_t outlen ); + int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); + int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); + + int blake2xb_init( blake2xb_state *S, const size_t outlen ); + int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); + int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); + + /* Simple API */ + int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + /* This is simply an alias for blake2b */ + int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + +#if defined(__cplusplus) +} +#endif + +#endif Copied: stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_blake2_impl.h Fri Dec 21 23:33:05 2018 (r342360, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) @@ -0,0 +1,160 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_IMPL_H +#define BLAKE2_IMPL_H + +#include +#include + +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) + #define BLAKE2_INLINE __inline + #elif defined(__GNUC__) + #define BLAKE2_INLINE __inline__ + #else + #define BLAKE2_INLINE + #endif +#else + #define BLAKE2_INLINE inline +#endif + +static BLAKE2_INLINE uint32_t load32( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint32_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8) | + (( uint32_t )( p[2] ) << 16) | + (( uint32_t )( p[3] ) << 24) ; +#endif +} + +static BLAKE2_INLINE uint64_t load64( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint64_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) | + (( uint64_t )( p[6] ) << 48) | + (( uint64_t )( p[7] ) << 56) ; +#endif +} + +static BLAKE2_INLINE uint16_t load16( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint16_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); +#endif +} + +static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + *p++ = ( uint8_t )w; w >>= 8; + *p++ = ( uint8_t )w; +#endif +} + +static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); +#endif +} + +static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); + p[6] = (uint8_t)(w >> 48); + p[7] = (uint8_t)(w >> 56); +#endif +} + +static BLAKE2_INLINE uint64_t load48( const void *src ) +{ + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) ; +} + +static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +{ + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); +} + +static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 32 - c ) ); +} + +static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 64 - c ) ); +} + +/* prevents compiler optimizing out memset() */ +static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +{ + static void *(*const volatile memset_v)(void *, int, size_t) = &memset; + memset_v(v, 0, n); +} + +#endif Copied: stable/11/contrib/libarchive/libarchive/archive_blake2s_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_blake2s_ref.c Fri Dec 21 23:33:05 2018 (r342360, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) @@ -0,0 +1,367 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +static const uint32_t blake2s_IV[8] = +{ + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const uint8_t blake2s_sigma[10][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , +}; + +static void blake2s_set_lastnode( blake2s_state *S ) +{ + S->f[1] = (uint32_t)-1; +} + +/* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock( const blake2s_state *S ) +{ + return S->f[0] != 0; +} + +static void blake2s_set_lastblock( blake2s_state *S ) +{ + if( S->last_node ) blake2s_set_lastnode( S ); + + S->f[0] = (uint32_t)-1; +} + +static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +{ + S->t[0] += inc; + S->t[1] += ( S->t[0] < inc ); +} + +static void blake2s_init0( blake2s_state *S ) +{ + size_t i; + memset( S, 0, sizeof( blake2s_state ) ); + + for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; +} + +/* init2 xors IV with input parameter block */ +int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + size_t i; + + blake2s_init0( S ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) + S->h[i] ^= load32( &p[i * 4] ); + + S->outlen = P->digest_length; + return 0; +} + + +/* Sequential blake2s initialization */ +int blake2s_init( blake2s_state *S, size_t outlen ) +{ + blake2s_param P[1]; + + /* Move interval verification here? */ + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = 0; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + +int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +{ + blake2s_param P[1]; + + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + + if( blake2s_init_param( S, P ) < 0 ) return -1; + + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = rotr32(d ^ a, 16); \ + c = c + d; \ + b = rotr32(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = rotr32(d ^ a, 8); \ + c = c + d; \ + b = rotr32(b ^ c, 7); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) +{ + uint32_t m[16]; + uint32_t v[16]; + size_t i; + + for( i = 0; i < 16; ++i ) { + m[i] = load32( in + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = S->h[i]; + } + + v[ 8] = blake2s_IV[0]; + v[ 9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = S->t[0] ^ blake2s_IV[4]; + v[13] = S->t[1] ^ blake2s_IV[5]; + v[14] = S->f[0] ^ blake2s_IV[6]; + v[15] = S->f[1] ^ blake2s_IV[7]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + + for( i = 0; i < 8; ++i ) { + S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; + } +} + +#undef G +#undef ROUND + +int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + if( inlen > 0 ) + { + size_t left = S->buflen; + size_t fill = BLAKE2S_BLOCKBYTES - left; + if( inlen > fill ) + { + S->buflen = 0; + memcpy( S->buf + left, in, fill ); /* Fill buffer */ + blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); + blake2s_compress( S, S->buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); + blake2s_compress( S, in ); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } + } + memcpy( S->buf + S->buflen, in, inlen ); + S->buflen += inlen; + } + return 0; +} + +int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +{ + uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; + size_t i; + + if( out == NULL || outlen < S->outlen ) + return -1; + + if( blake2s_is_lastblock( S ) ) + return -1; + + blake2s_increment_counter( S, ( uint32_t )S->buflen ); + blake2s_set_lastblock( S ); + memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ + blake2s_compress( S, S->buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); + + memcpy( out, buffer, outlen ); + secure_zero_memory(buffer, sizeof(buffer)); + return 0; +} + +int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +{ + blake2s_state S[1]; + + /* Verify parameters */ + if ( NULL == in && inlen > 0 ) return -1; + + if ( NULL == out ) return -1; + + if ( NULL == key && keylen > 0) return -1; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( keylen > BLAKE2S_KEYBYTES ) return -1; + + if( keylen > 0 ) + { + if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; + } + else + { + if( blake2s_init( S, outlen ) < 0 ) return -1; + } + + blake2s_update( S, ( const uint8_t * )in, inlen ); + blake2s_final( S, out, outlen ); + return 0; +} + +#if defined(SUPERCOP) +int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +{ + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +} +#endif + +#if defined(BLAKE2S_SELFTEST) +#include +#include "blake2-kat.h" +int main( void ) +{ + uint8_t key[BLAKE2S_KEYBYTES]; + uint8_t buf[BLAKE2_KAT_LENGTH]; + size_t i, step; + + for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) + key[i] = ( uint8_t )i; + + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + buf[i] = ( uint8_t )i; + + /* Test simple API */ + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); + + if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) + { + goto fail; + } + } + + /* Test streaming API */ + for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { + for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s_state S; + uint8_t * p = buf; + size_t mlen = i; + int err = 0; + + if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { + goto fail; + } + + while (mlen >= step) { + if ( (err = blake2s_update(&S, p, step)) < 0 ) { + goto fail; + } + mlen -= step; + p += step; + } + if ( (err = blake2s_update(&S, p, mlen)) < 0) { + goto fail; + } + if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { + goto fail; + } + + if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { + goto fail; + } + } + } + + puts( "ok" ); + return 0; +fail: + puts("error"); + return -1; +} +#endif Copied: stable/11/contrib/libarchive/libarchive/archive_blake2sp_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/contrib/libarchive/libarchive/archive_blake2sp_ref.c Fri Dec 21 23:33:05 2018 (r342360, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) @@ -0,0 +1,359 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#if defined(_OPENMP) +#include +#endif + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +#define PARALLELISM_DEGREE 8 + +/* + blake2sp_init_param defaults to setting the expecting output length + from the digest_length parameter block field. + + In some cases, however, we do not want this, as the output length + of these instances is given by inner_length instead. +*/ +static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Fri Dec 21 23:33:31 2018 Return-Path: Delivered-To: svn-src-stable@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 EB42E1335F68; Fri, 21 Dec 2018 23:33:30 +0000 (UTC) (envelope-from mm@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 9CED589259; Fri, 21 Dec 2018 23:33:30 +0000 (UTC) (envelope-from mm@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 72A901C8CB; Fri, 21 Dec 2018 23:33:30 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBLNXU69009729; Fri, 21 Dec 2018 23:33:30 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBLNXSnA009717; Fri, 21 Dec 2018 23:33:28 GMT (envelope-from mm@FreeBSD.org) Message-Id: <201812212333.wBLNXSnA009717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Fri, 21 Dec 2018 23:33:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r342361 - in stable/10: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils ... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/cpio contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/tar contrib/libarchive/test_utils lib/libarchive lib/libarc... X-SVN-Commit-Revision: 342361 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 9CED589259 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.998,0]; NEURAL_HAM_SHORT(-0.94)[-0.942,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2018 23:33:31 -0000 Author: mm Date: Fri Dec 21 23:33:28 2018 New Revision: 342361 URL: https://svnweb.freebsd.org/changeset/base/342361 Log: MFC r339746,339751,339794,340866,340939,342042: Sync libarchive with vendor. Relevant vendor changes: PR #1013: Add missing h_base offset when performing absolute seeks in xar decompression PR #1023: Support extracting extattrs as non-root on non-user-writeable files PR #1061: Add support for extraction of RAR v5 archives PR #1066: Fix out of bounds read on empty string filename for gnutar, pax and v7tar PR #1067: Fix temporary file path buffer overflow in tests IS #1068: Correctly process and verify integer arguments passed to bsdcpio and bsdtar PR #1070: Don't default XAR entry atime/mtime to the current time PR #1080: Spelling fixes PR #1084: RAR5 reader bugfixes PR #1091: fix use-after-free in delayed newc link processing PR #1092: Fix a few obvious resource leaks and strcpy() misuses IS #1096: Support extracting ACLs with in-entry comments (GNU tar) PR #1102: RAR5 reader - fix big-endian problems PR #1105: Fix various crash, memory corruption and infinite loop conditions RAR5 reader: FreeBSD build platform fixes for powerpc(64), mips(64), sparc64 and riscv64 RAR5 reader: more maybe-uninitialized size_t fixes for riscv64 FreeBSD build Added: stable/10/contrib/libarchive/libarchive/archive_blake2.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2.h stable/10/contrib/libarchive/libarchive/archive_blake2_impl.h - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h stable/10/contrib/libarchive/libarchive/archive_blake2s_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5.c - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5.c stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_arm.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_blake2.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_compressed.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_solid.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu - copied unchanged from r339746, head/contrib/libarchive/libarchive/test/test_read_format_rar5_win32.rar.uu Modified: stable/10/contrib/libarchive/COPYING stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/README.md stable/10/contrib/libarchive/cpio/cpio.c stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_read_support_format_all.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_by_code.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_xar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_pax.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c stable/10/contrib/libarchive/libarchive/test/test_read_format_xar.c stable/10/contrib/libarchive/tar/bsdtar.c stable/10/contrib/libarchive/test_utils/test_main.c stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/tests/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/COPYING ============================================================================== --- stable/10/contrib/libarchive/COPYING Fri Dec 21 23:33:05 2018 (r342360) +++ stable/10/contrib/libarchive/COPYING Fri Dec 21 23:33:28 2018 (r342361) @@ -23,6 +23,13 @@ the actual statements in the files are controlling. * The following source files are in the public domain: libarchive/archive_getdate.c +* The following source files are triple-licensed with the ability to choose + from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses: + libarchive/archive_blake2.h + libarchive/archive_blake2_impl.h + libarchive/archive_blake2s_ref.c + libarchive/archive_blake2sp_ref.c + * The build files---including Makefiles, configure scripts, and auxiliary scripts used as part of the compile process---have widely varying licensing terms. Please check individual files before @@ -34,7 +41,7 @@ do use the license below. The varying licensing of th seems to be an unavoidable mess. -Copyright (c) 2003-2009 +Copyright (c) 2003-2018 All rights reserved. Redistribution and use in source and binary forms, with or without Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Fri Dec 21 23:33:05 2018 (r342360) +++ stable/10/contrib/libarchive/NEWS Fri Dec 21 23:33:28 2018 (r342361) @@ -1,3 +1,5 @@ +Oct 06, 2018: RAR 5.0 reader + Sep 03, 2018: libarchive 3.3.3 released Jul 19, 2018: Avoid super-linear slowdown on malformed mtree files Modified: stable/10/contrib/libarchive/README.md ============================================================================== --- stable/10/contrib/libarchive/README.md Fri Dec 21 23:33:05 2018 (r342360) +++ stable/10/contrib/libarchive/README.md Fri Dec 21 23:33:28 2018 (r342361) @@ -86,7 +86,7 @@ Currently, the library automatically detects and reads * 7-Zip archives * Microsoft CAB format * LHA and LZH archives - * RAR archives (with some limitations due to RAR's proprietary status) + * RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status) * XAR archives The library also detects and handles any of the following before evaluating the archive: Modified: stable/10/contrib/libarchive/cpio/cpio.c ============================================================================== --- stable/10/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:33:05 2018 (r342360) +++ stable/10/contrib/libarchive/cpio/cpio.c Fri Dec 21 23:33:28 2018 (r342361) @@ -134,8 +134,9 @@ main(int argc, char *argv[]) struct cpio _cpio; /* Allocated on stack. */ struct cpio *cpio; const char *errmsg; + char *tptr; int uid, gid; - int opt; + int opt, t; cpio = &_cpio; memset(cpio, 0, sizeof(*cpio)); @@ -204,9 +205,15 @@ main(int argc, char *argv[]) cpio->add_filter = opt; break; case 'C': /* NetBSD/OpenBSD */ - cpio->bytes_per_block = atoi(cpio->argument); - if (cpio->bytes_per_block <= 0) - lafe_errc(1, 0, "Invalid blocksize %s", cpio->argument); + errno = 0; + tptr = NULL; + t = (int)strtol(cpio->argument, &tptr, 10); + if (errno || t <= 0 || *(cpio->argument) == '\0' || + tptr == NULL || *tptr != '\0') { + lafe_errc(1, 0, "Invalid blocksize: %s", + cpio->argument); + } + cpio->bytes_per_block = t; break; case 'c': /* POSIX 1997 */ cpio->format = "odc"; Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:33:05 2018 (r342360) +++ stable/10/contrib/libarchive/libarchive/archive.h Fri Dec 21 23:33:28 2018 (r342361) @@ -338,6 +338,7 @@ typedef const char *archive_passphrase_callback(struct #define ARCHIVE_FORMAT_LHA 0xB0000 #define ARCHIVE_FORMAT_CAB 0xC0000 #define ARCHIVE_FORMAT_RAR 0xD0000 +#define ARCHIVE_FORMAT_RAR_V5 (ARCHIVE_FORMAT_RAR | 1) #define ARCHIVE_FORMAT_7ZIP 0xE0000 #define ARCHIVE_FORMAT_WARC 0xF0000 @@ -449,6 +450,7 @@ __LA_DECL int archive_read_support_format_iso9660(stru __LA_DECL int archive_read_support_format_lha(struct archive *); __LA_DECL int archive_read_support_format_mtree(struct archive *); __LA_DECL int archive_read_support_format_rar(struct archive *); +__LA_DECL int archive_read_support_format_rar5(struct archive *); __LA_DECL int archive_read_support_format_raw(struct archive *); __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_warc(struct archive *); Copied: stable/10/contrib/libarchive/libarchive/archive_blake2.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_blake2.h Fri Dec 21 23:33:28 2018 (r342361, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2.h) @@ -0,0 +1,194 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_H +#define BLAKE2_H + +#include +#include + +#if defined(_MSC_VER) +#define BLAKE2_PACKED(x) __pragma(pack(push, 1)) x __pragma(pack(pop)) +#else +#define BLAKE2_PACKED(x) x __attribute__((packed)) +#endif + +#if defined(__cplusplus) +extern "C" { +#endif + + enum blake2s_constant + { + BLAKE2S_BLOCKBYTES = 64, + BLAKE2S_OUTBYTES = 32, + BLAKE2S_KEYBYTES = 32, + BLAKE2S_SALTBYTES = 8, + BLAKE2S_PERSONALBYTES = 8 + }; + + enum blake2b_constant + { + BLAKE2B_BLOCKBYTES = 128, + BLAKE2B_OUTBYTES = 64, + BLAKE2B_KEYBYTES = 64, + BLAKE2B_SALTBYTES = 16, + BLAKE2B_PERSONALBYTES = 16 + }; + + typedef struct blake2s_state__ + { + uint32_t h[8]; + uint32_t t[2]; + uint32_t f[2]; + uint8_t buf[BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2s_state; + + typedef struct blake2b_state__ + { + uint64_t h[8]; + uint64_t t[2]; + uint64_t f[2]; + uint8_t buf[BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + uint8_t last_node; + } blake2b_state; + + typedef struct blake2sp_state__ + { + blake2s_state S[8][1]; + blake2s_state R[1]; + uint8_t buf[8 * BLAKE2S_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2sp_state; + + typedef struct blake2bp_state__ + { + blake2b_state S[4][1]; + blake2b_state R[1]; + uint8_t buf[4 * BLAKE2B_BLOCKBYTES]; + size_t buflen; + size_t outlen; + } blake2bp_state; + + BLAKE2_PACKED(struct blake2s_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint16_t xof_length; /* 14 */ + uint8_t node_depth; /* 15 */ + uint8_t inner_length; /* 16 */ + /* uint8_t reserved[0]; */ + uint8_t salt[BLAKE2S_SALTBYTES]; /* 24 */ + uint8_t personal[BLAKE2S_PERSONALBYTES]; /* 32 */ + }); + + typedef struct blake2s_param__ blake2s_param; + + BLAKE2_PACKED(struct blake2b_param__ + { + uint8_t digest_length; /* 1 */ + uint8_t key_length; /* 2 */ + uint8_t fanout; /* 3 */ + uint8_t depth; /* 4 */ + uint32_t leaf_length; /* 8 */ + uint32_t node_offset; /* 12 */ + uint32_t xof_length; /* 16 */ + uint8_t node_depth; /* 17 */ + uint8_t inner_length; /* 18 */ + uint8_t reserved[14]; /* 32 */ + uint8_t salt[BLAKE2B_SALTBYTES]; /* 48 */ + uint8_t personal[BLAKE2B_PERSONALBYTES]; /* 64 */ + }); + + typedef struct blake2b_param__ blake2b_param; + + typedef struct blake2xs_state__ + { + blake2s_state S[1]; + blake2s_param P[1]; + } blake2xs_state; + + typedef struct blake2xb_state__ + { + blake2b_state S[1]; + blake2b_param P[1]; + } blake2xb_state; + + /* Padded structs result in a compile-time error */ + enum { + BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + }; + + /* Streaming API */ + int blake2s_init( blake2s_state *S, size_t outlen ); + int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2s_init_param( blake2s_state *S, const blake2s_param *P ); + int blake2s_update( blake2s_state *S, const void *in, size_t inlen ); + int blake2s_final( blake2s_state *S, void *out, size_t outlen ); + + int blake2b_init( blake2b_state *S, size_t outlen ); + int blake2b_init_key( blake2b_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2b_init_param( blake2b_state *S, const blake2b_param *P ); + int blake2b_update( blake2b_state *S, const void *in, size_t inlen ); + int blake2b_final( blake2b_state *S, void *out, size_t outlen ); + + int blake2sp_init( blake2sp_state *S, size_t outlen ); + int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2sp_update( blake2sp_state *S, const void *in, size_t inlen ); + int blake2sp_final( blake2sp_state *S, void *out, size_t outlen ); + + int blake2bp_init( blake2bp_state *S, size_t outlen ); + int blake2bp_init_key( blake2bp_state *S, size_t outlen, const void *key, size_t keylen ); + int blake2bp_update( blake2bp_state *S, const void *in, size_t inlen ); + int blake2bp_final( blake2bp_state *S, void *out, size_t outlen ); + + /* Variable output length API */ + int blake2xs_init( blake2xs_state *S, const size_t outlen ); + int blake2xs_init_key( blake2xs_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xs_update( blake2xs_state *S, const void *in, size_t inlen ); + int blake2xs_final(blake2xs_state *S, void *out, size_t outlen); + + int blake2xb_init( blake2xb_state *S, const size_t outlen ); + int blake2xb_init_key( blake2xb_state *S, const size_t outlen, const void *key, size_t keylen ); + int blake2xb_update( blake2xb_state *S, const void *in, size_t inlen ); + int blake2xb_final(blake2xb_state *S, void *out, size_t outlen); + + /* Simple API */ + int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2b( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2sp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2bp( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + int blake2xs( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + int blake2xb( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + + /* This is simply an alias for blake2b */ + int blake2( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ); + +#if defined(__cplusplus) +} +#endif + +#endif Copied: stable/10/contrib/libarchive/libarchive/archive_blake2_impl.h (from r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_blake2_impl.h Fri Dec 21 23:33:28 2018 (r342361, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2_impl.h) @@ -0,0 +1,160 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ +#ifndef BLAKE2_IMPL_H +#define BLAKE2_IMPL_H + +#include +#include + +#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) + #if defined(_MSC_VER) + #define BLAKE2_INLINE __inline + #elif defined(__GNUC__) + #define BLAKE2_INLINE __inline__ + #else + #define BLAKE2_INLINE + #endif +#else + #define BLAKE2_INLINE inline +#endif + +static BLAKE2_INLINE uint32_t load32( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint32_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8) | + (( uint32_t )( p[2] ) << 16) | + (( uint32_t )( p[3] ) << 24) ; +#endif +} + +static BLAKE2_INLINE uint64_t load64( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint64_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) | + (( uint64_t )( p[6] ) << 48) | + (( uint64_t )( p[7] ) << 56) ; +#endif +} + +static BLAKE2_INLINE uint16_t load16( const void *src ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + uint16_t w; + memcpy(&w, src, sizeof w); + return w; +#else + const uint8_t *p = ( const uint8_t * )src; + return ( uint16_t )((( uint32_t )( p[0] ) << 0) | + (( uint32_t )( p[1] ) << 8)); +#endif +} + +static BLAKE2_INLINE void store16( void *dst, uint16_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + *p++ = ( uint8_t )w; w >>= 8; + *p++ = ( uint8_t )w; +#endif +} + +static BLAKE2_INLINE void store32( void *dst, uint32_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); +#endif +} + +static BLAKE2_INLINE void store64( void *dst, uint64_t w ) +{ +#if defined(NATIVE_LITTLE_ENDIAN) + memcpy(dst, &w, sizeof w); +#else + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); + p[6] = (uint8_t)(w >> 48); + p[7] = (uint8_t)(w >> 56); +#endif +} + +static BLAKE2_INLINE uint64_t load48( const void *src ) +{ + const uint8_t *p = ( const uint8_t * )src; + return (( uint64_t )( p[0] ) << 0) | + (( uint64_t )( p[1] ) << 8) | + (( uint64_t )( p[2] ) << 16) | + (( uint64_t )( p[3] ) << 24) | + (( uint64_t )( p[4] ) << 32) | + (( uint64_t )( p[5] ) << 40) ; +} + +static BLAKE2_INLINE void store48( void *dst, uint64_t w ) +{ + uint8_t *p = ( uint8_t * )dst; + p[0] = (uint8_t)(w >> 0); + p[1] = (uint8_t)(w >> 8); + p[2] = (uint8_t)(w >> 16); + p[3] = (uint8_t)(w >> 24); + p[4] = (uint8_t)(w >> 32); + p[5] = (uint8_t)(w >> 40); +} + +static BLAKE2_INLINE uint32_t rotr32( const uint32_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 32 - c ) ); +} + +static BLAKE2_INLINE uint64_t rotr64( const uint64_t w, const unsigned c ) +{ + return ( w >> c ) | ( w << ( 64 - c ) ); +} + +/* prevents compiler optimizing out memset() */ +static BLAKE2_INLINE void secure_zero_memory(void *v, size_t n) +{ + static void *(*const volatile memset_v)(void *, int, size_t) = &memset; + memset_v(v, 0, n); +} + +#endif Copied: stable/10/contrib/libarchive/libarchive/archive_blake2s_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_blake2s_ref.c Fri Dec 21 23:33:28 2018 (r342361, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2s_ref.c) @@ -0,0 +1,367 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +static const uint32_t blake2s_IV[8] = +{ + 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL, + 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL +}; + +static const uint8_t blake2s_sigma[10][16] = +{ + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 } , + { 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3 } , + { 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4 } , + { 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8 } , + { 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13 } , + { 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9 } , + { 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11 } , + { 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10 } , + { 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5 } , + { 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13 , 0 } , +}; + +static void blake2s_set_lastnode( blake2s_state *S ) +{ + S->f[1] = (uint32_t)-1; +} + +/* Some helper functions, not necessarily useful */ +static int blake2s_is_lastblock( const blake2s_state *S ) +{ + return S->f[0] != 0; +} + +static void blake2s_set_lastblock( blake2s_state *S ) +{ + if( S->last_node ) blake2s_set_lastnode( S ); + + S->f[0] = (uint32_t)-1; +} + +static void blake2s_increment_counter( blake2s_state *S, const uint32_t inc ) +{ + S->t[0] += inc; + S->t[1] += ( S->t[0] < inc ); +} + +static void blake2s_init0( blake2s_state *S ) +{ + size_t i; + memset( S, 0, sizeof( blake2s_state ) ); + + for( i = 0; i < 8; ++i ) S->h[i] = blake2s_IV[i]; +} + +/* init2 xors IV with input parameter block */ +int blake2s_init_param( blake2s_state *S, const blake2s_param *P ) +{ + const unsigned char *p = ( const unsigned char * )( P ); + size_t i; + + blake2s_init0( S ); + + /* IV XOR ParamBlock */ + for( i = 0; i < 8; ++i ) + S->h[i] ^= load32( &p[i * 4] ); + + S->outlen = P->digest_length; + return 0; +} + + +/* Sequential blake2s initialization */ +int blake2s_init( blake2s_state *S, size_t outlen ) +{ + blake2s_param P[1]; + + /* Move interval verification here? */ + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = 0; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + +int blake2s_init_key( blake2s_state *S, size_t outlen, const void *key, size_t keylen ) +{ + blake2s_param P[1]; + + if ( ( !outlen ) || ( outlen > BLAKE2S_OUTBYTES ) ) return -1; + + if ( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = 1; + P->depth = 1; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = 0; + /* memset(P->reserved, 0, sizeof(P->reserved) ); */ + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + + if( blake2s_init_param( S, P ) < 0 ) return -1; + + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + blake2s_update( S, block, BLAKE2S_BLOCKBYTES ); + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + +#define G(r,i,a,b,c,d) \ + do { \ + a = a + b + m[blake2s_sigma[r][2*i+0]]; \ + d = rotr32(d ^ a, 16); \ + c = c + d; \ + b = rotr32(b ^ c, 12); \ + a = a + b + m[blake2s_sigma[r][2*i+1]]; \ + d = rotr32(d ^ a, 8); \ + c = c + d; \ + b = rotr32(b ^ c, 7); \ + } while(0) + +#define ROUND(r) \ + do { \ + G(r,0,v[ 0],v[ 4],v[ 8],v[12]); \ + G(r,1,v[ 1],v[ 5],v[ 9],v[13]); \ + G(r,2,v[ 2],v[ 6],v[10],v[14]); \ + G(r,3,v[ 3],v[ 7],v[11],v[15]); \ + G(r,4,v[ 0],v[ 5],v[10],v[15]); \ + G(r,5,v[ 1],v[ 6],v[11],v[12]); \ + G(r,6,v[ 2],v[ 7],v[ 8],v[13]); \ + G(r,7,v[ 3],v[ 4],v[ 9],v[14]); \ + } while(0) + +static void blake2s_compress( blake2s_state *S, const uint8_t in[BLAKE2S_BLOCKBYTES] ) +{ + uint32_t m[16]; + uint32_t v[16]; + size_t i; + + for( i = 0; i < 16; ++i ) { + m[i] = load32( in + i * sizeof( m[i] ) ); + } + + for( i = 0; i < 8; ++i ) { + v[i] = S->h[i]; + } + + v[ 8] = blake2s_IV[0]; + v[ 9] = blake2s_IV[1]; + v[10] = blake2s_IV[2]; + v[11] = blake2s_IV[3]; + v[12] = S->t[0] ^ blake2s_IV[4]; + v[13] = S->t[1] ^ blake2s_IV[5]; + v[14] = S->f[0] ^ blake2s_IV[6]; + v[15] = S->f[1] ^ blake2s_IV[7]; + + ROUND( 0 ); + ROUND( 1 ); + ROUND( 2 ); + ROUND( 3 ); + ROUND( 4 ); + ROUND( 5 ); + ROUND( 6 ); + ROUND( 7 ); + ROUND( 8 ); + ROUND( 9 ); + + for( i = 0; i < 8; ++i ) { + S->h[i] = S->h[i] ^ v[i] ^ v[i + 8]; + } +} + +#undef G +#undef ROUND + +int blake2s_update( blake2s_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + if( inlen > 0 ) + { + size_t left = S->buflen; + size_t fill = BLAKE2S_BLOCKBYTES - left; + if( inlen > fill ) + { + S->buflen = 0; + memcpy( S->buf + left, in, fill ); /* Fill buffer */ + blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES ); + blake2s_compress( S, S->buf ); /* Compress */ + in += fill; inlen -= fill; + while(inlen > BLAKE2S_BLOCKBYTES) { + blake2s_increment_counter(S, BLAKE2S_BLOCKBYTES); + blake2s_compress( S, in ); + in += BLAKE2S_BLOCKBYTES; + inlen -= BLAKE2S_BLOCKBYTES; + } + } + memcpy( S->buf + S->buflen, in, inlen ); + S->buflen += inlen; + } + return 0; +} + +int blake2s_final( blake2s_state *S, void *out, size_t outlen ) +{ + uint8_t buffer[BLAKE2S_OUTBYTES] = {0}; + size_t i; + + if( out == NULL || outlen < S->outlen ) + return -1; + + if( blake2s_is_lastblock( S ) ) + return -1; + + blake2s_increment_counter( S, ( uint32_t )S->buflen ); + blake2s_set_lastblock( S ); + memset( S->buf + S->buflen, 0, BLAKE2S_BLOCKBYTES - S->buflen ); /* Padding */ + blake2s_compress( S, S->buf ); + + for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */ + store32( buffer + sizeof( S->h[i] ) * i, S->h[i] ); + + memcpy( out, buffer, outlen ); + secure_zero_memory(buffer, sizeof(buffer)); + return 0; +} + +int blake2s( void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen ) +{ + blake2s_state S[1]; + + /* Verify parameters */ + if ( NULL == in && inlen > 0 ) return -1; + + if ( NULL == out ) return -1; + + if ( NULL == key && keylen > 0) return -1; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( keylen > BLAKE2S_KEYBYTES ) return -1; + + if( keylen > 0 ) + { + if( blake2s_init_key( S, outlen, key, keylen ) < 0 ) return -1; + } + else + { + if( blake2s_init( S, outlen ) < 0 ) return -1; + } + + blake2s_update( S, ( const uint8_t * )in, inlen ); + blake2s_final( S, out, outlen ); + return 0; +} + +#if defined(SUPERCOP) +int crypto_hash( unsigned char *out, unsigned char *in, unsigned long long inlen ) +{ + return blake2s( out, BLAKE2S_OUTBYTES, in, inlen, NULL, 0 ); +} +#endif + +#if defined(BLAKE2S_SELFTEST) +#include +#include "blake2-kat.h" +int main( void ) +{ + uint8_t key[BLAKE2S_KEYBYTES]; + uint8_t buf[BLAKE2_KAT_LENGTH]; + size_t i, step; + + for( i = 0; i < BLAKE2S_KEYBYTES; ++i ) + key[i] = ( uint8_t )i; + + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + buf[i] = ( uint8_t )i; + + /* Test simple API */ + for( i = 0; i < BLAKE2_KAT_LENGTH; ++i ) + { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s( hash, BLAKE2S_OUTBYTES, buf, i, key, BLAKE2S_KEYBYTES ); + + if( 0 != memcmp( hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES ) ) + { + goto fail; + } + } + + /* Test streaming API */ + for(step = 1; step < BLAKE2S_BLOCKBYTES; ++step) { + for (i = 0; i < BLAKE2_KAT_LENGTH; ++i) { + uint8_t hash[BLAKE2S_OUTBYTES]; + blake2s_state S; + uint8_t * p = buf; + size_t mlen = i; + int err = 0; + + if( (err = blake2s_init_key(&S, BLAKE2S_OUTBYTES, key, BLAKE2S_KEYBYTES)) < 0 ) { + goto fail; + } + + while (mlen >= step) { + if ( (err = blake2s_update(&S, p, step)) < 0 ) { + goto fail; + } + mlen -= step; + p += step; + } + if ( (err = blake2s_update(&S, p, mlen)) < 0) { + goto fail; + } + if ( (err = blake2s_final(&S, hash, BLAKE2S_OUTBYTES)) < 0) { + goto fail; + } + + if (0 != memcmp(hash, blake2s_keyed_kat[i], BLAKE2S_OUTBYTES)) { + goto fail; + } + } + } + + puts( "ok" ); + return 0; +fail: + puts("error"); + return -1; +} +#endif Copied: stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c (from r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_blake2sp_ref.c Fri Dec 21 23:33:28 2018 (r342361, copy of r339746, head/contrib/libarchive/libarchive/archive_blake2sp_ref.c) @@ -0,0 +1,359 @@ +/* + BLAKE2 reference source code package - reference C implementations + + Copyright 2012, Samuel Neves . You may use this under the + terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at + your option. The terms of these licenses can be found at: + + - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0 + - OpenSSL license : https://www.openssl.org/source/license.html + - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0 + + More information about the BLAKE2 hash function can be found at + https://blake2.net. +*/ + +#include +#include +#include + +#if defined(_OPENMP) +#include +#endif + +#include "archive_blake2.h" +#include "archive_blake2_impl.h" + +#define PARALLELISM_DEGREE 8 + +/* + blake2sp_init_param defaults to setting the expecting output length + from the digest_length parameter block field. + + In some cases, however, we do not want this, as the output length + of these instances is given by inner_length instead. +*/ +static int blake2sp_init_leaf_param( blake2s_state *S, const blake2s_param *P ) +{ + int err = blake2s_init_param(S, P); + S->outlen = P->inner_length; + return err; +} + +static int blake2sp_init_leaf( blake2s_state *S, size_t outlen, size_t keylen, uint32_t offset ) +{ + blake2s_param P[1]; + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = PARALLELISM_DEGREE; + P->depth = 2; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, offset ); + store16( &P->xof_length, 0 ); + P->node_depth = 0; + P->inner_length = BLAKE2S_OUTBYTES; + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2sp_init_leaf_param( S, P ); +} + +static int blake2sp_init_root( blake2s_state *S, size_t outlen, size_t keylen ) +{ + blake2s_param P[1]; + P->digest_length = (uint8_t)outlen; + P->key_length = (uint8_t)keylen; + P->fanout = PARALLELISM_DEGREE; + P->depth = 2; + store32( &P->leaf_length, 0 ); + store32( &P->node_offset, 0 ); + store16( &P->xof_length, 0 ); + P->node_depth = 1; + P->inner_length = BLAKE2S_OUTBYTES; + memset( P->salt, 0, sizeof( P->salt ) ); + memset( P->personal, 0, sizeof( P->personal ) ); + return blake2s_init_param( S, P ); +} + + +int blake2sp_init( blake2sp_state *S, size_t outlen ) +{ + size_t i; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + memset( S->buf, 0, sizeof( S->buf ) ); + S->buflen = 0; + S->outlen = outlen; + + if( blake2sp_init_root( S->R, outlen, 0 ) < 0 ) + return -1; + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + if( blake2sp_init_leaf( S->S[i], outlen, 0, i ) < 0 ) return -1; + + S->R->last_node = 1; + S->S[PARALLELISM_DEGREE - 1]->last_node = 1; + return 0; +} + +int blake2sp_init_key( blake2sp_state *S, size_t outlen, const void *key, size_t keylen ) +{ + size_t i; + + if( !outlen || outlen > BLAKE2S_OUTBYTES ) return -1; + + if( !key || !keylen || keylen > BLAKE2S_KEYBYTES ) return -1; + + memset( S->buf, 0, sizeof( S->buf ) ); + S->buflen = 0; + S->outlen = outlen; + + if( blake2sp_init_root( S->R, outlen, keylen ) < 0 ) + return -1; + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + if( blake2sp_init_leaf( S->S[i], outlen, keylen, i ) < 0 ) return -1; + + S->R->last_node = 1; + S->S[PARALLELISM_DEGREE - 1]->last_node = 1; + { + uint8_t block[BLAKE2S_BLOCKBYTES]; + memset( block, 0, BLAKE2S_BLOCKBYTES ); + memcpy( block, key, keylen ); + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + blake2s_update( S->S[i], block, BLAKE2S_BLOCKBYTES ); + + secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */ + } + return 0; +} + + +int blake2sp_update( blake2sp_state *S, const void *pin, size_t inlen ) +{ + const unsigned char * in = (const unsigned char *)pin; + size_t left = S->buflen; + size_t fill = sizeof( S->buf ) - left; + size_t i; + + if( left && inlen >= fill ) + { + memcpy( S->buf + left, in, fill ); + + for( i = 0; i < PARALLELISM_DEGREE; ++i ) + blake2s_update( S->S[i], S->buf + i * BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); + + in += fill; + inlen -= fill; + left = 0; + } + +#if defined(_OPENMP) + #pragma omp parallel shared(S), num_threads(PARALLELISM_DEGREE) +#else + for( i = 0; i < PARALLELISM_DEGREE; ++i ) +#endif + { +#if defined(_OPENMP) + size_t i = omp_get_thread_num(); +#endif + size_t inlen__ = inlen; + const unsigned char *in__ = ( const unsigned char * )in; + in__ += i * BLAKE2S_BLOCKBYTES; + + while( inlen__ >= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ) + { + blake2s_update( S->S[i], in__, BLAKE2S_BLOCKBYTES ); + in__ += PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; + inlen__ -= PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES; + } + } + + in += inlen - inlen % ( PARALLELISM_DEGREE * BLAKE2S_BLOCKBYTES ); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@freebsd.org Sat Dec 22 07:46:03 2018 Return-Path: Delivered-To: svn-src-stable@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 D6BC813495D2; Sat, 22 Dec 2018 07:46:02 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from thoth.sbs.de (thoth.sbs.de [192.35.17.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "thoth.sbs.de", Issuer "Siemens Issuing CA Internet Server 2017" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 548B6753FD; Sat, 22 Dec 2018 07:46:00 +0000 (UTC) (envelope-from Andre.Albsmeier@siemens.com) Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id wBM7XeXf022795 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 22 Dec 2018 08:33:40 +0100 Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.40.130]) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id wBM7Xeeu023236; Sat, 22 Dec 2018 08:33:40 +0100 Received: (from user@localhost) by curry.mchp.siemens.de (8.15.2/8.15.2) id wBM7Xe8u093619; Date: Sat, 22 Dec 2018 08:33:40 +0100 From: Andre Albsmeier To: Eugene Grosbein Cc: Ian Lepore , Andre Albsmeier , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: Re: svn commit: r341794 - stable/11/etc/periodic/weekly Message-ID: <20181222073340.GA27107@bali> References: <201812101424.wBAEOgbC053582@repo.freebsd.org> <20181215090926.GA33682@bali> <1544893102.76088.70.camel@freebsd.org> <3a15a5aa-913a-88eb-a072-86526ef4899e@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3a15a5aa-913a-88eb-a072-86526ef4899e@freebsd.org> User-Agent: Mutt/1.7.2 (2016-11-26) X-Rspamd-Queue-Id: 548B6753FD X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of Andre.Albsmeier@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=Andre.Albsmeier@siemens.com X-Spamd-Result: default: False [-1.80 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.95)[-0.953,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+exists:192.35.17.2.spf.siemens.com]; NEURAL_HAM_LONG(-0.97)[-0.973,0]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[siemens.com]; NEURAL_SPAM_SHORT(0.44)[0.443,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[meleagros.siemens.com,hylas.siemens.com,paxos.siemens.com,hephaistos.siemens.com,gordi.siemens.com,zetes.siemens.com,balduin.siemens.com]; RCPT_COUNT_SEVEN(0.00)[7]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; ASN(0.00)[asn:15465, ipnet:192.35.16.0/22, country:DE]; RCVD_IN_DNSWL_HI(-0.50)[2.17.35.192.list.dnswl.org : 127.0.13.3]; IP_SCORE(-0.00)[country: DE(-0.01)] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2018 07:46:03 -0000 On Sun, 16-Dec-2018 at 06:47:04 +0700, Eugene Grosbein wrote: > 15.12.2018 23:58, Ian Lepore wrote: > > > It uses sysrc, which sources in /usr/share/bsdconfig/common.subr; this > > is the first reference to sysrc in any periodic script, so it does > > establish a new dependency, requiring sysrc to be installed on any > > system that runs periodic scripts. > > Thanks, I've re-implemented this without sysrc. > > > A safer way to extract the root path of all running jails might be > > something like: > > > > if which -s jls; then > > allpaths="$(jls -d path)" > > for onepath in ${allpaths}; do > > # do whatever with ${onepath} here > > done > > fi > > This needs to check for all configured full-blown jails including maybe not running at the moment. > sysrc is handy but is not really necessary. > > Andre, this should fix it for your case, please test: > > fetch -o /tmp/noid.diff 'https://svnweb.freebsd.org/base/head/usr.sbin/periodic/etc/weekly/340.noid?view=patch&r1=342141&r2=342140&pathrev=342141' > cd /etc/periodic/weekly && patch -p5 < /tmp/noid.diff Yes, that fixes it, thanks. But please note that I don't use jails and don't have jail(8) installed at all (WITHOUT_JAIL). Also, maybe we should check if jail(8) exists before running $(jail ...) or even the whole "if" expression. The result will probably be the same but one can clearly see that it depends on jail(8) and maybe one can then even leave out the 2>/dev/null so errors can come through (no idea if this is something that can happen). Something like (bad indenting to be ignored): --- 340.noid.ORI 2018-12-22 08:26:24.515158000 +0100 +++ 340.noid 2018-12-22 08:27:51.985887000 +0100 @@ -21,6 +21,7 @@ # of this script. exclude='' +if [ -x /usr/sbin/jail ]; then if [ $(sysctl -n security.jail.jailed) = 0 ]; then # For jail_conf . /etc/rc.subr @@ -29,7 +30,7 @@ sep=: OIFS="$IFS" IFS="$sep" - for param in $(jail -f "$jail_conf" -e "$sep" 2>/dev/null) + for param in $(jail -f "$jail_conf" -e "$sep") do case "$param" in path=*) @@ -44,6 +45,7 @@ done IFS="$OIFS" fi +fi rc=$(find -H ${weekly_noid_dirs:-/} \ \( $exclude ! -fstype local -prune -or -name \* \) -and \ (Or replace the -x by some which(1) construct...) Sorry for the late reply but I was on holidays (and had to wait for the weekly run anyway). From owner-svn-src-stable@freebsd.org Sat Dec 22 10:55:41 2018 Return-Path: Delivered-To: svn-src-stable@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 B5066134EEC1; Sat, 22 Dec 2018 10:55:41 +0000 (UTC) (envelope-from eugen@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 5BDC1838C6; Sat, 22 Dec 2018 10:55:41 +0000 (UTC) (envelope-from eugen@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 52A6A23FC5; Sat, 22 Dec 2018 10:55:41 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMAtfY0070726; Sat, 22 Dec 2018 10:55:41 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMAtfKx070725; Sat, 22 Dec 2018 10:55:41 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812221055.wBMAtfKx070725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 22 Dec 2018 10:55:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342365 - stable/12/usr.sbin/periodic/etc/weekly X-SVN-Group: stable-12 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/12/usr.sbin/periodic/etc/weekly X-SVN-Commit-Revision: 342365 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 5BDC1838C6 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.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2018 10:55:41 -0000 Author: eugen Date: Sat Dec 22 10:55:40 2018 New Revision: 342365 URL: https://svnweb.freebsd.org/changeset/base/342365 Log: MFC r342141: periodic/weekly/340.noid: do not use sysrc(8) that depends on bsdinstall(8) and may be non-functional for system built WITHOUT_BSDINSTALL. (*) Also, add a check for jails sharing whole tree with host (path=/) and do not skip it. Reported by: Andre.Albsmeier@siemens.com (*) Modified: stable/12/usr.sbin/periodic/etc/weekly/340.noid Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.sbin/periodic/etc/weekly/340.noid ============================================================================== --- stable/12/usr.sbin/periodic/etc/weekly/340.noid Sat Dec 22 09:31:55 2018 (r342364) +++ stable/12/usr.sbin/periodic/etc/weekly/340.noid Sat Dec 22 10:55:40 2018 (r342365) @@ -22,13 +22,24 @@ case "$weekly_noid_enable" in exclude='' if [ $(sysctl -n security.jail.jailed) = 0 ]; then + # For jail_conf + . /etc/rc.subr + load_rc_config jail + sep=: OIFS="$IFS" IFS="$sep" - for param in $(jail -f "`sysrc -n jail_conf`" -e "$sep" 2>/dev/null) + for param in $(jail -f "$jail_conf" -e "$sep" 2>/dev/null) do case "$param" in - path=*) exclude="$exclude -path ${param#path=} -prune -or" + path=*) + _p=${param#path=} + if [ -z "$_p" -o "$_p" = / ]; then + continue + fi + + exclude="$exclude -path $_p -prune -or" + ;; esac done IFS="$OIFS" From owner-svn-src-stable@freebsd.org Sat Dec 22 10:57:53 2018 Return-Path: Delivered-To: svn-src-stable@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 2F32C134EFF6; Sat, 22 Dec 2018 10:57:53 +0000 (UTC) (envelope-from eugen@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 C6A1183A42; Sat, 22 Dec 2018 10:57:52 +0000 (UTC) (envelope-from eugen@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 B1F3123FCB; Sat, 22 Dec 2018 10:57:52 +0000 (UTC) (envelope-from eugen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMAvq9D070875; Sat, 22 Dec 2018 10:57:52 GMT (envelope-from eugen@FreeBSD.org) Received: (from eugen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMAvqMS070874; Sat, 22 Dec 2018 10:57:52 GMT (envelope-from eugen@FreeBSD.org) Message-Id: <201812221057.wBMAvqMS070874@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eugen set sender to eugen@FreeBSD.org using -f From: Eugene Grosbein Date: Sat, 22 Dec 2018 10:57:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r342366 - stable/11/etc/periodic/weekly X-SVN-Group: stable-11 X-SVN-Commit-Author: eugen X-SVN-Commit-Paths: stable/11/etc/periodic/weekly X-SVN-Commit-Revision: 342366 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: C6A1183A42 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.999,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2018 10:57:53 -0000 Author: eugen Date: Sat Dec 22 10:57:52 2018 New Revision: 342366 URL: https://svnweb.freebsd.org/changeset/base/342366 Log: MFC r342141: periodic/weekly/340.noid: do not use sysrc(8) that depends on bsdinstall(8) and may be non-functional for system built WITHOUT_BSDINSTALL. (*) Also, add a check for jails sharing whole tree with host (path=/) and do not skip it. Reported by: Andre.Albsmeier@siemens.com (*) Modified: stable/11/etc/periodic/weekly/340.noid Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/periodic/weekly/340.noid ============================================================================== --- stable/11/etc/periodic/weekly/340.noid Sat Dec 22 10:55:40 2018 (r342365) +++ stable/11/etc/periodic/weekly/340.noid Sat Dec 22 10:57:52 2018 (r342366) @@ -22,13 +22,24 @@ case "$weekly_noid_enable" in exclude='' if [ $(sysctl -n security.jail.jailed) = 0 ]; then + # For jail_conf + . /etc/rc.subr + load_rc_config jail + sep=: OIFS="$IFS" IFS="$sep" - for param in $(jail -f "`sysrc -n jail_conf`" -e "$sep" 2>/dev/null) + for param in $(jail -f "$jail_conf" -e "$sep" 2>/dev/null) do case "$param" in - path=*) exclude="$exclude -path ${param#path=} -prune -or" + path=*) + _p=${param#path=} + if [ -z "$_p" -o "$_p" = / ]; then + continue + fi + + exclude="$exclude -path $_p -prune -or" + ;; esac done IFS="$OIFS" From owner-svn-src-stable@freebsd.org Sat Dec 22 19:44:07 2018 Return-Path: Delivered-To: svn-src-stable@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 43CEF1339371; Sat, 22 Dec 2018 19:44:07 +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 DEC786E77C; Sat, 22 Dec 2018 19:44:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D31321A76; Sat, 22 Dec 2018 19:44:06 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id wBMJi6eL050844; Sat, 22 Dec 2018 19:44:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMJi6Ot050843; Sat, 22 Dec 2018 19:44:06 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812221944.wBMJi6Ot050843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 22 Dec 2018 19:44:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342370 - stable/12/sys/dev/fxp X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/dev/fxp X-SVN-Commit-Revision: 342370 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: DEC786E77C 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.963,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2018 19:44:07 -0000 Author: markj Date: Sat Dec 22 19:44:06 2018 New Revision: 342370 URL: https://svnweb.freebsd.org/changeset/base/342370 Log: MFC r342214: Remove a use of a negative array index from fxp(4). Modified: stable/12/sys/dev/fxp/if_fxp.c stable/12/sys/dev/fxp/if_fxpreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/fxp/if_fxp.c ============================================================================== --- stable/12/sys/dev/fxp/if_fxp.c Sat Dec 22 16:23:42 2018 (r342369) +++ stable/12/sys/dev/fxp/if_fxp.c Sat Dec 22 19:44:06 2018 (r342370) @@ -1627,7 +1627,7 @@ fxp_encap(struct fxp_softc *sc, struct mbuf **m_head) cbp->tbd_number = nseg; /* Configure TSO. */ if (m->m_pkthdr.csum_flags & CSUM_TSO) { - cbp->tbd[-1].tb_size = htole32(m->m_pkthdr.tso_segsz << 16); + cbp->tbdtso.tb_size = htole32(m->m_pkthdr.tso_segsz << 16); cbp->tbd[1].tb_size |= htole32(tcp_payload << 16); cbp->ipcb_ip_schedule |= FXP_IPCB_LARGESEND_ENABLE | FXP_IPCB_IP_CHECKSUM_ENABLE | Modified: stable/12/sys/dev/fxp/if_fxpreg.h ============================================================================== --- stable/12/sys/dev/fxp/if_fxpreg.h Sat Dec 22 16:23:42 2018 (r342369) +++ stable/12/sys/dev/fxp/if_fxpreg.h Sat Dec 22 19:44:06 2018 (r342370) @@ -281,10 +281,15 @@ struct fxp_cb_tx { uint16_t cb_status; uint16_t cb_command; uint32_t link_addr; - uint32_t tbd_array_addr; - uint16_t byte_count; - uint8_t tx_threshold; - uint8_t tbd_number; + union { + struct { + uint32_t tbd_array_addr; + uint16_t byte_count; + uint8_t tx_threshold; + uint8_t tbd_number; + }; + struct fxp_tbd tbdtso; + }; /* * The following structure isn't actually part of the TxCB, From owner-svn-src-stable@freebsd.org Sat Dec 22 19:45:03 2018 Return-Path: Delivered-To: svn-src-stable@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 9E0971339455; Sat, 22 Dec 2018 19:45:03 +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 44E2A6E8B8; Sat, 22 Dec 2018 19:45:03 +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 393241A78; Sat, 22 Dec 2018 19:45:03 +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 wBMJj3WY050953; Sat, 22 Dec 2018 19:45:03 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id wBMJj3BM050952; Sat, 22 Dec 2018 19:45:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201812221945.wBMJj3BM050952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 22 Dec 2018 19:45:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r342371 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 342371 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 44E2A6E8B8 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.963,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-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Dec 2018 19:45:03 -0000 Author: markj Date: Sat Dec 22 19:45:02 2018 New Revision: 342371 URL: https://svnweb.freebsd.org/changeset/base/342371 Log: MFC r342207: Fix DDB's "show malloc" after r338899. Modified: stable/12/sys/kern/kern_malloc.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_malloc.c ============================================================================== --- stable/12/sys/kern/kern_malloc.c Sat Dec 22 19:44:06 2018 (r342370) +++ stable/12/sys/kern/kern_malloc.c Sat Dec 22 19:45:02 2018 (r342371) @@ -1205,7 +1205,7 @@ restart: DB_SHOW_COMMAND(malloc, db_show_malloc) { struct malloc_type_internal *mtip; - struct malloc_type_internal *mtsp; + struct malloc_type_stats *mtsp; struct malloc_type *mtp; uint64_t allocs, frees; uint64_t alloced, freed; @@ -1221,10 +1221,10 @@ DB_SHOW_COMMAND(malloc, db_show_malloc) freed = 0; for (i = 0; i <= mp_maxid; i++) { mtsp = zpcpu_get_cpu(mtip->mti_stats, i); - allocs += mtip->mti_stats[i].mts_numallocs; - frees += mtip->mti_stats[i].mts_numfrees; - alloced += mtip->mti_stats[i].mts_memalloced; - freed += mtip->mti_stats[i].mts_memfreed; + allocs += mtsp->mts_numallocs; + frees += mtsp->mts_numfrees; + alloced += mtsp->mts_memalloced; + freed += mtsp->mts_memfreed; } db_printf("%18s %12ju %12juK %12ju\n", mtp->ks_shortdesc, allocs - frees,