From owner-svn-src-all@freebsd.org Sun May 10 00:34:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C85032D32F0; Sun, 10 May 2020 00:34:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KQ6n4sxhz4VdS; Sun, 10 May 2020 00:34:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A26D7247EB; Sun, 10 May 2020 00:34:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A0Y9C2071142; Sun, 10 May 2020 00:34:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A0Y92J071141; Sun, 10 May 2020 00:34:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005100034.04A0Y92J071141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 May 2020 00:34: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: r360862 - stable/12/sys/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/include X-SVN-Commit-Revision: 360862 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 00:34:09 -0000 Author: jhb Date: Sun May 10 00:34:09 2020 New Revision: 360862 URL: https://svnweb.freebsd.org/changeset/base/360862 Log: MFC 357255,357337: Fix definition of SSTATUS_SD and MSTATUS_SD. 357255: Fix definition of SSTATUS_SD The SD bit is defined as the MSB of the sstatus register, meaning its position will vary depending on the CSR's length. Previously, there were two (unused) defines for this, for the 32 and 64-bit cases, but their definitions were swapped. Consolidate these into one define: SSTATUS_SD, and make the definition dependent on the value of __riscv_xlen. 357337: Fix 64-bit value of SSTATUS_SD to use an unsigned long. While here, fix MSTATUS_SD to match SSTATUS_SD. Modified: stable/12/sys/riscv/include/riscvreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/riscvreg.h ============================================================================== --- stable/12/sys/riscv/include/riscvreg.h Sun May 10 00:28:43 2020 (r360861) +++ stable/12/sys/riscv/include/riscvreg.h Sun May 10 00:34:09 2020 (r360862) @@ -72,8 +72,11 @@ #define SSTATUS_XS_SHIFT 15 #define SSTATUS_XS_MASK (0x3 << SSTATUS_XS_SHIFT) #define SSTATUS_SUM (1 << 18) -#define SSTATUS32_SD (1 << 63) -#define SSTATUS64_SD (1 << 31) +#if __riscv_xlen == 64 +#define SSTATUS_SD (1ul << 63) +#else +#define SSTATUS_SD (1 << 31) +#endif #define MSTATUS_UIE (1 << 0) #define MSTATUS_SIE (1 << 1) @@ -107,8 +110,11 @@ #define MSTATUS_VM_SV48 10 #define MSTATUS_VM_SV57 11 #define MSTATUS_VM_SV64 12 -#define MSTATUS32_SD (1 << 63) -#define MSTATUS64_SD (1 << 31) +#if __riscv_xlen == 64 +#define MSTATUS_SD (1ul << 63) +#else +#define MSTATUS_SD (1 << 31) +#endif #define MSTATUS_PRV_U 0 /* user */ #define MSTATUS_PRV_S 1 /* supervisor */ From owner-svn-src-all@freebsd.org Sun May 10 01:53:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 510902D4B38; Sun, 10 May 2020 01:53:15 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: from mail-qk1-f175.google.com (mail-qk1-f175.google.com [209.85.222.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KRt15Qrvz4Ylr; Sun, 10 May 2020 01:53:13 +0000 (UTC) (envelope-from byond.lenox@gmail.com) Received: by mail-qk1-f175.google.com with SMTP id f13so5551417qkh.2; Sat, 09 May 2020 18:53:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JEjhkQ2+h7afKSH3fM9x187CBb3BlPWX0fJDa3iB3qM=; b=p+zPyHAFMYiI5hjLSj3+1ZkWBKUh+yhga38Ntb1LjH9dwoZT2nKeW+TJiyklcARorW KwgVnoQN3y4fucnllBAbTl2i9bBOhmPjc2SKDclob8PyLSLpKnjlG1m8EaKBhx8Dlk+x unijeqS6LIMvtLQEW0Gf0JRw6F+voNDOAHvmLWG1AY2R20GPDTUQWknIrGddCHFMStm8 t4+bL/u82TF13J6r8P5cmjdRR5VVBqZG3IVMsiwTjaX6yGj2lpDE7cvrERUIxH1nTKvO LLgUwjawi6i/9YJZll+lLh9pyP54/gqDXYgClTAzbvk/amohkVhMFh1qFUc6p2Dql57Y iHkw== X-Gm-Message-State: AGi0PuZUgcDfqbyx03edzj6gVquBX57xrdKlc4svBA4fVTu66NwokvqN DowTA5vjZL8/s6ng9FzNhJQuiJ8O X-Google-Smtp-Source: APiQypJHgBMaBdION+BknKdKej0FPXxJBZE58CEt3x5XRuV+t4OQsTcoMCseIcVsJbNgUJO6nWHzIQ== X-Received: by 2002:ae9:ed95:: with SMTP id c143mr5193023qkg.394.1589075592276; Sat, 09 May 2020 18:53:12 -0700 (PDT) Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com. [209.85.160.175]) by smtp.gmail.com with ESMTPSA id s15sm5686986qtc.31.2020.05.09.18.53.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 09 May 2020 18:53:12 -0700 (PDT) Received: by mail-qt1-f175.google.com with SMTP id h26so5013433qtu.8; Sat, 09 May 2020 18:53:11 -0700 (PDT) X-Received: by 2002:ac8:46d0:: with SMTP id h16mr10826153qto.242.1589075591681; Sat, 09 May 2020 18:53:11 -0700 (PDT) MIME-Version: 1.0 References: <202003311559.02VFxTKv095318@repo.freebsd.org> In-Reply-To: <202003311559.02VFxTKv095318@repo.freebsd.org> From: Kyle Evans Date: Sat, 9 May 2020 20:53:00 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r359488 - head/share/mk To: "Simon J. Gerraty" Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49KRt15Qrvz4Ylr X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of byondlenox@gmail.com designates 209.85.222.175 as permitted sender) smtp.mailfrom=byondlenox@gmail.com X-Spamd-Result: default: False [-3.02 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[self@kyle-evans.net,byondlenox@gmail.com]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyle-evans.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; IP_SCORE(-1.02)[ip: (-4.24), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.43), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[175.222.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FORGED_SENDER(0.30)[self@kyle-evans.net,byondlenox@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[175.222.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 01:53:15 -0000 On Tue, Mar 31, 2020 at 11:00 AM Simon J. Gerraty wrote: > > Author: sjg > Date: Tue Mar 31 15:59:29 2020 > New Revision: 359488 > URL: https://svnweb.freebsd.org/changeset/base/359488 > > Log: > Include ${.CURDIR}/local.init.mk if it exists > > This is handy for making local hacks to an app > (eg to build it as tool for non-BSD host) > without making a mess of the code base. > > Reviewed by: bdrewery > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org//D24101 > In hindsight, I wonder if this should have been ${.CURDIR}/Makefile.local instead, to match the convention used in ports already for this kind of thing. Thoughts? Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Sun May 10 02:13:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 61F9A2D5556; Sun, 10 May 2020 02:13:39 +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 49KSKb0czCz4Zjq; Sun, 10 May 2020 02:13:39 +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 10A8025AAC; Sun, 10 May 2020 02:13:39 +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 04A2DchG032695; Sun, 10 May 2020 02:13:38 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A2Dc1x032694; Sun, 10 May 2020 02:13:38 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005100213.04A2Dc1x032694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 10 May 2020 02:13: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: r360863 - stable/12/sys/cam/ctl X-SVN-Group: stable-12 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/12/sys/cam/ctl X-SVN-Commit-Revision: 360863 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 02:13:39 -0000 Author: mav Date: Sun May 10 02:13:38 2020 New Revision: 360863 URL: https://svnweb.freebsd.org/changeset/base/360863 Log: MFC r360610: Add session locking in cfiscsi_ioctl_handoff(). While there, remove ifdef around cs_target check in cfiscsi_ioctl_list(). I am not sure why this ifdef was added, but without this check code will crash below on NULL dereference. Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 00:34:09 2020 (r360862) +++ stable/12/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 02:13:38 2020 (r360863) @@ -1582,8 +1582,10 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) mtx_lock(&softc->lock); if (ct->ct_online == 0) { mtx_unlock(&softc->lock); + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); cfiscsi_target_release(ct); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1629,8 +1631,10 @@ restart: #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1692,10 +1696,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_printf(sb, "\n"); mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { -#ifdef ICL_KERNEL_PROXY if (cs->cs_target == NULL) continue; -#endif error = sbuf_printf(sb, "" "%s" "%s" From owner-svn-src-all@freebsd.org Sun May 10 02:14:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ABD722D55C3; Sun, 10 May 2020 02:14:23 +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 49KSLR47Nnz4Zqf; Sun, 10 May 2020 02:14:23 +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 8867E25AAD; Sun, 10 May 2020 02:14:23 +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 04A2ENjV032783; Sun, 10 May 2020 02:14:23 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A2ENKF032782; Sun, 10 May 2020 02:14:23 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005100214.04A2ENKF032782@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sun, 10 May 2020 02:14: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: r360864 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 360864 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 02:14:23 -0000 Author: mav Date: Sun May 10 02:14:23 2020 New Revision: 360864 URL: https://svnweb.freebsd.org/changeset/base/360864 Log: MFC r360610: Add session locking in cfiscsi_ioctl_handoff(). While there, remove ifdef around cs_target check in cfiscsi_ioctl_list(). I am not sure why this ifdef was added, but without this check code will crash below on NULL dereference. Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl_frontend_iscsi.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 02:13:38 2020 (r360863) +++ stable/11/sys/cam/ctl/ctl_frontend_iscsi.c Sun May 10 02:14:23 2020 (r360864) @@ -1571,8 +1571,10 @@ cfiscsi_ioctl_handoff(struct ctl_iscsi *ci) mtx_lock(&softc->lock); if (ct->ct_online == 0) { mtx_unlock(&softc->lock); + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); cfiscsi_target_release(ct); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), @@ -1618,8 +1620,10 @@ restart: #endif error = icl_conn_handoff(cs->cs_conn, cihp->socket); if (error != 0) { + CFISCSI_SESSION_LOCK(cs); cs->cs_handoff_in_progress = false; cfiscsi_session_terminate(cs); + CFISCSI_SESSION_UNLOCK(cs); ci->status = CTL_ISCSI_ERROR; snprintf(ci->error_str, sizeof(ci->error_str), "%s: icl_conn_handoff failed with error %d", @@ -1681,10 +1685,8 @@ cfiscsi_ioctl_list(struct ctl_iscsi *ci) sbuf_printf(sb, "\n"); mtx_lock(&softc->lock); TAILQ_FOREACH(cs, &softc->sessions, cs_next) { -#ifdef ICL_KERNEL_PROXY if (cs->cs_target == NULL) continue; -#endif error = sbuf_printf(sb, "" "%s" "%s" From owner-svn-src-all@freebsd.org Sun May 10 03:36:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AF2D2D6BFC; Sun, 10 May 2020 03:36:12 +0000 (UTC) (envelope-from adrian@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 49KV8q6zb0z4dw1; Sun, 10 May 2020 03:36:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EA3F826A21; Sun, 10 May 2020 03:36:11 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A3aBc1082769; Sun, 10 May 2020 03:36:11 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A3aBo5082767; Sun, 10 May 2020 03:36:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005100336.04A3aBo5082767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 10 May 2020 03:36:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360865 - head/sys/mips/atheros X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/mips/atheros X-SVN-Commit-Revision: 360865 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.32 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 03:36:12 -0000 Author: adrian Date: Sun May 10 03:36:11 2020 New Revision: 360865 URL: https://svnweb.freebsd.org/changeset/base/360865 Log: [atheros] [if_arge] Various fixes to avoid TX stalls and bad sized packets This is stuff I've been running for a couple years. It's inspired by changes I found in the linux ag71xx ethernet driver. * Delay between stopping DMA and checking to see if it's stopped; this gives the hardware time to do its thing. * Non-final frames in the chain need to be a multiple of 4 bytes in size. Ensure this is the case when assembling a TX DMA list. * Add counters for tx/rx underflow and too-short packets. * Log if TX/RX DMA couldn't be stopped when resetting the MAC. * Add some more debugging / logging around TX/RX ring bits. Tested: * AR7240, AR7241 * AR9344 (TL-WDR3600/TL-WDR4300 APs) * AR9331 (Carambola 2) Modified: head/sys/mips/atheros/if_arge.c head/sys/mips/atheros/if_argevar.h Modified: head/sys/mips/atheros/if_arge.c ============================================================================== --- head/sys/mips/atheros/if_arge.c Sun May 10 02:14:23 2020 (r360864) +++ head/sys/mips/atheros/if_arge.c Sun May 10 03:36:11 2020 (r360865) @@ -333,6 +333,11 @@ arge_attach_sysctl(device_t dev) 0, "number of TX unaligned packets (len)"); SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_pkts_unaligned_tooshort", CTLFLAG_RW, + &sc->stats.tx_pkts_unaligned_tooshort, + 0, "number of TX unaligned packets (mbuf length < 4 bytes)"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_pkts_nosegs", CTLFLAG_RW, &sc->stats.tx_pkts_nosegs, 0, "number of TX packets fail with no ring slots avail"); @@ -347,6 +352,13 @@ arge_attach_sysctl(device_t dev) SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "intr_ok", CTLFLAG_RW, &sc->stats.intr_ok, 0, "number of OK interrupts"); + + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "tx_underflow", CTLFLAG_RW, &sc->stats.tx_underflow, + 0, "Number of TX underflows"); + SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "rx_overflow", CTLFLAG_RW, &sc->stats.rx_overflow, + 0, "Number of RX overflows"); #ifdef ARGE_DEBUG SYSCTL_ADD_UINT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "tx_prod", CTLFLAG_RW, &sc->arge_cdata.arge_tx_prod, 0, ""); @@ -1365,15 +1377,24 @@ arge_set_pll(struct arge_softc *sc, int media, int dup static void arge_reset_dma(struct arge_softc *sc) { + uint32_t val; ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: called\n", __func__); ARGE_WRITE(sc, AR71XX_DMA_RX_CONTROL, 0); ARGE_WRITE(sc, AR71XX_DMA_TX_CONTROL, 0); + /* Give hardware a chance to finish */ + DELAY(1000); + ARGE_WRITE(sc, AR71XX_DMA_RX_DESC, 0); ARGE_WRITE(sc, AR71XX_DMA_TX_DESC, 0); + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: RX_STATUS=%08x, TX_STATUS=%08x\n", + __func__, + ARGE_READ(sc, AR71XX_DMA_RX_STATUS), + ARGE_READ(sc, AR71XX_DMA_TX_STATUS)); + /* Clear all possible RX interrupts */ while(ARGE_READ(sc, AR71XX_DMA_RX_STATUS) & DMA_RX_STATUS_PKT_RECVD) ARGE_WRITE(sc, AR71XX_DMA_RX_STATUS, DMA_RX_STATUS_PKT_RECVD); @@ -1397,6 +1418,24 @@ arge_reset_dma(struct arge_softc *sc) * flushed to RAM before underlying buffers are freed. */ arge_flush_ddr(sc); + + /* Check if we cleared RX status */ + val = ARGE_READ(sc, AR71XX_DMA_RX_STATUS); + if (val != 0) { + device_printf(sc->arge_dev, + "%s: unable to clear DMA_RX_STATUS: %08x\n", + __func__, val); + } + + /* Check if we cleared TX status */ + val = ARGE_READ(sc, AR71XX_DMA_TX_STATUS); + /* Mask out reserved bits */ + val = val & 0x00ffffff; + if (val != 0) { + device_printf(sc->arge_dev, + "%s: unable to clear DMA_TX_STATUS: %08x\n", + __func__, val); + } } static void @@ -1417,9 +1456,13 @@ arge_init_locked(struct arge_softc *sc) ARGE_LOCK_ASSERT(sc); + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: called\n", __func__); + if ((ifp->if_flags & IFF_UP) && (ifp->if_drv_flags & IFF_DRV_RUNNING)) return; + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: init'ing\n", __func__); + /* Init circular RX list. */ if (arge_rx_ring_init(sc) != 0) { device_printf(sc->arge_dev, @@ -1431,6 +1474,7 @@ arge_init_locked(struct arge_softc *sc) /* Init tx descriptors. */ arge_tx_ring_init(sc); + /* Restart DMA */ arge_reset_dma(sc); if (sc->arge_miibus) { @@ -1452,6 +1496,11 @@ arge_init_locked(struct arge_softc *sc) arge_update_link_locked(sc); } + ARGEDEBUG(sc, ARGE_DBG_RESET, "%s: desc ring; TX=0x%x, RX=0x%x\n", + __func__, + ARGE_TX_RING_ADDR(sc, 0), + ARGE_RX_RING_ADDR(sc, 0)); + ARGE_WRITE(sc, AR71XX_DMA_TX_DESC, ARGE_TX_RING_ADDR(sc, 0)); ARGE_WRITE(sc, AR71XX_DMA_RX_DESC, ARGE_RX_RING_ADDR(sc, 0)); @@ -1495,6 +1544,15 @@ arge_mbuf_chain_is_tx_aligned(struct arge_softc *sc, s sc->stats.tx_pkts_unaligned_len++; return 0; } + + /* + * All chips have this requirement for length being greater + * than 4. + */ + if ((m->m_next != NULL) && ((m->m_len < 4))) { + sc->stats.tx_pkts_unaligned_tooshort++; + return 0; + } } return 1; } @@ -1582,6 +1640,11 @@ arge_encap(struct arge_softc *sc, struct mbuf **m_head tmp |= ARGE_DESC_EMPTY; desc->packet_ctrl = tmp; + ARGEDEBUG(sc, ARGE_DBG_TX, " [%d / %d] addr=0x%x, len=%d\n", + i, + prod, + (uint32_t) txsegs[i].ds_addr, (int) txsegs[i].ds_len); + /* XXX Note: only relevant for older MACs; but check length! */ if ((sc->arge_hw_flags & ARGE_HW_FLG_TX_DESC_ALIGN_4BYTE) && (txsegs[i].ds_addr & 3)) @@ -2606,7 +2669,7 @@ arge_intr(void *arg) } /* - * If we've finished TXing and there's space for more packets + * If we've finished RX /or/ TX and there's space for more packets * to be queued for TX, do so. Otherwise we may end up in a * situation where the interface send queue was filled * whilst the hardware queue was full, then the hardware @@ -2620,8 +2683,7 @@ arge_intr(void *arg) * after a TX underrun, then having the hardware queue added * to below. */ - if (status & (DMA_INTR_TX_PKT_SENT | DMA_INTR_TX_UNDERRUN) && - (ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { + if ((ifp->if_drv_flags & IFF_DRV_OACTIVE) == 0) { if (!IFQ_IS_EMPTY(&ifp->if_snd)) arge_start_locked(ifp); } Modified: head/sys/mips/atheros/if_argevar.h ============================================================================== --- head/sys/mips/atheros/if_argevar.h Sun May 10 02:14:23 2020 (r360864) +++ head/sys/mips/atheros/if_argevar.h Sun May 10 03:36:11 2020 (r360865) @@ -206,6 +206,7 @@ struct arge_softc { uint32_t tx_pkts_unaligned; uint32_t tx_pkts_unaligned_start; uint32_t tx_pkts_unaligned_len; + uint32_t tx_pkts_unaligned_tooshort; uint32_t tx_pkts_nosegs; uint32_t tx_pkts_aligned; uint32_t rx_overflow; From owner-svn-src-all@freebsd.org Sun May 10 09:34:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0E442DFAB7; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@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 49Kf6d3l7Sz3ySH; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 7BA122EFA; Sun, 10 May 2020 09:34:49 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A9YnRc006388; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9YnB5006386; Sun, 10 May 2020 09:34:49 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005100934.04A9YnB5006386@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Sun, 10 May 2020 09:34:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360866 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 360866 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 09:34:49 -0000 Author: melifaro Date: Sun May 10 09:34:48 2020 New Revision: 360866 URL: https://svnweb.freebsd.org/changeset/base/360866 Log: Remove rtalloc1(_fib) KPI. Last user of rtalloc1() KPI has been eliminated in rS360631. As kernel is now fully switched to use new routing KPI defined in rS359823, remove old lookup functions. Differential Revision: https://reviews.freebsd.org/D24776 Modified: head/sys/net/route.c head/sys/net/route.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.c Sun May 10 09:34:48 2020 (r360866) @@ -420,76 +420,6 @@ sys_setfib(struct thread *td, struct setfib_args *uap) } /* - * Look up the route that matches the address given - * Or, at least try.. Create a cloned route if needed. - * - * The returned route, if any, is locked. - */ -struct rtentry * -rtalloc1(struct sockaddr *dst, int report, u_long ignflags) -{ - - return (rtalloc1_fib(dst, report, ignflags, RT_DEFAULT_FIB)); -} - -struct rtentry * -rtalloc1_fib(struct sockaddr *dst, int report, u_long ignflags, - u_int fibnum) -{ - RIB_RLOCK_TRACKER; - struct rib_head *rh; - struct radix_node *rn; - struct rtentry *newrt; - struct rt_addrinfo info; - int err = 0, msgtype = RTM_MISS; - - KASSERT((fibnum < rt_numfibs), ("rtalloc1_fib: bad fibnum")); - rh = rt_tables_get_rnh(fibnum, dst->sa_family); - newrt = NULL; - if (rh == NULL) - goto miss; - - /* - * Look up the address in the table for that Address Family - */ - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RLOCK(rh); -#ifdef INVARIANTS - else - RIB_LOCK_ASSERT(rh); -#endif - rn = rh->rnh_matchaddr(dst, &rh->head); - if (rn && ((rn->rn_flags & RNF_ROOT) == 0)) { - newrt = RNTORT(rn); - RT_LOCK(newrt); - RT_ADDREF(newrt); - if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - return (newrt); - - } else if ((ignflags & RTF_RNH_LOCKED) == 0) - RIB_RUNLOCK(rh); - /* - * Either we hit the root or could not find any match, - * which basically means: "cannot get there from here". - */ -miss: - RTSTAT_INC(rts_unreach); - - if (report) { - /* - * If required, report the failure to the supervising - * Authorities. - * For a delete, this is not an error. (report == 0) - */ - bzero(&info, sizeof(info)); - info.rti_info[RTAX_DST] = dst; - rt_missmsg_fib(msgtype, &info, 0, err, fibnum); - } - return (newrt); -} - -/* * Remove a reference count from an rtentry. * If the count gets low enough, take it out of the routing table */ Modified: head/sys/net/route.h ============================================================================== --- head/sys/net/route.h Sun May 10 03:36:11 2020 (r360865) +++ head/sys/net/route.h Sun May 10 09:34:48 2020 (r360866) @@ -392,8 +392,6 @@ struct sockaddr *rtsock_fix_netmask(const struct socka /* * Note the following locking behavior: * - * rtalloc1() returns a locked rtentry - * * rtfree() and RTFREE_LOCKED() require a locked rtentry * * RTFREE() uses an unlocked entry. @@ -414,14 +412,12 @@ void rt_flushifroutes(struct ifnet *ifp); /* XXX MRT COMPAT VERSIONS THAT SET UNIVERSE to 0 */ /* Thes are used by old code not yet converted to use multiple FIBS */ -struct rtentry *rtalloc1(struct sockaddr *, int, u_long); int rtinit(struct ifaddr *, int, int); /* XXX MRT NEW VERSIONS THAT USE FIBs * For now the protocol indepedent versions are the same as the AF_INET ones * but this will change.. */ -struct rtentry *rtalloc1_fib(struct sockaddr *, int, u_long, u_int); int rtioctl_fib(u_long, caddr_t, u_int); int rtrequest_fib(int, struct sockaddr *, struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int); From owner-svn-src-all@freebsd.org Sun May 10 09:50:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E5A832E0294; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KfSz5hkjz40QP; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BEC6D3174; Sun, 10 May 2020 09:50:43 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A9ohc8013629; Sun, 10 May 2020 09:50:43 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9ohX8013628; Sun, 10 May 2020 09:50:43 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005100950.04A9ohX8013628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 10 May 2020 09:50:43 +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: r360867 - stable/11/sys/netpfil/pf X-SVN-Group: stable-11 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/11/sys/netpfil/pf X-SVN-Commit-Revision: 360867 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 09:50:44 -0000 Author: kp Date: Sun May 10 09:50:43 2020 New Revision: 360867 URL: https://svnweb.freebsd.org/changeset/base/360867 Log: MFC r360609: pf: Improve DIOCADDRULE validation We expect the addrwrap.p.dyn value to be set to NULL (and assert such), but do not verify it on input. Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com Modified: stable/11/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/11/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:34:48 2020 (r360866) +++ stable/11/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:50:43 2020 (r360867) @@ -1152,6 +1152,11 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in error = EINVAL; break; } + if (pr->rule.src.addr.p.dyn != NULL || + pr->rule.dst.addr.p.dyn != NULL) { + error = EINVAL; + break; + } #ifndef INET if (pr->rule.af == AF_INET) { error = EAFNOSUPPORT; From owner-svn-src-all@freebsd.org Sun May 10 09:50:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 022E22E02AA; Sun, 10 May 2020 09:50:45 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KfT06JSNz40XG; Sun, 10 May 2020 09:50:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D271F3177; Sun, 10 May 2020 09:50:44 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04A9oi1e014637; Sun, 10 May 2020 09:50:44 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04A9oidw014621; Sun, 10 May 2020 09:50:44 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005100950.04A9oidw014621@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Sun, 10 May 2020 09:50: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: r360868 - stable/12/sys/netpfil/pf X-SVN-Group: stable-12 X-SVN-Commit-Author: kp X-SVN-Commit-Paths: stable/12/sys/netpfil/pf X-SVN-Commit-Revision: 360868 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 09:50:45 -0000 Author: kp Date: Sun May 10 09:50:44 2020 New Revision: 360868 URL: https://svnweb.freebsd.org/changeset/base/360868 Log: MFC r360609: pf: Improve DIOCADDRULE validation We expect the addrwrap.p.dyn value to be set to NULL (and assert such), but do not verify it on input. Reported-by: syzbot+936a89182e7d8f927de1@syzkaller.appspotmail.com Modified: stable/12/sys/netpfil/pf/pf_ioctl.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/pf/pf_ioctl.c ============================================================================== --- stable/12/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:50:43 2020 (r360867) +++ stable/12/sys/netpfil/pf/pf_ioctl.c Sun May 10 09:50:44 2020 (r360868) @@ -1556,6 +1556,11 @@ pfioctl(struct cdev *dev, u_long cmd, caddr_t addr, in error = EINVAL; break; } + if (pr->rule.src.addr.p.dyn != NULL || + pr->rule.dst.addr.p.dyn != NULL) { + error = EINVAL; + break; + } #ifndef INET if (pr->rule.af == AF_INET) { error = EAFNOSUPPORT; From owner-svn-src-all@freebsd.org Sun May 10 10:03:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F6582E0838; Sun, 10 May 2020 10:03:11 +0000 (UTC) (envelope-from tuexen@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 49KflL6dvTz41Tk; Sun, 10 May 2020 10:03:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DD9B8370C; Sun, 10 May 2020 10:03:10 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AA3AqM024800; Sun, 10 May 2020 10:03:10 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AA3A2w024799; Sun, 10 May 2020 10:03:10 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101003.04AA3A2w024799@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 10:03:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360869 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360869 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 10:03:11 -0000 Author: tuexen Date: Sun May 10 10:03:10 2020 New Revision: 360869 URL: https://svnweb.freebsd.org/changeset/base/360869 Log: Only drop DATA chunk with lower priorities as specified in RFC 7496. This issue was found by looking at a reproducer generated by syzkaller. MFC after: 3 days Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun May 10 09:50:44 2020 (r360868) +++ head/sys/netinet/sctp_output.c Sun May 10 10:03:10 2020 (r360869) @@ -6199,11 +6199,11 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, * This one is PR-SCTP AND buffer space * limited type */ - if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { + if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { /* * Lower numbers equates to higher * priority so if the one we are - * looking at has a larger or equal + * looking at has a larger * priority we want to drop the data * and NOT retransmit it. */ @@ -6234,7 +6234,7 @@ sctp_prune_prsctp(struct sctp_tcb *stcb, TAILQ_FOREACH_SAFE(chk, &asoc->send_queue, sctp_next, nchk) { /* Here we must move to the sent queue and mark */ if (PR_SCTP_BUF_ENABLED(chk->flags)) { - if (chk->rec.data.timetodrop.tv_sec >= (long)srcv->sinfo_timetolive) { + if (chk->rec.data.timetodrop.tv_sec > (long)srcv->sinfo_timetolive) { if (chk->data) { /* * We release the book_size @@ -12617,7 +12617,7 @@ sctp_lower_sosend(struct socket *so, top = SCTP_HEADER_TO_CHAIN(i_pak); sndlen = SCTP_HEADER_LEN(i_pak); } - SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zu\n", + SCTPDBG(SCTP_DEBUG_OUTPUT1, "Send called addr:%p send length %zd\n", (void *)addr, sndlen); if ((inp->sctp_flags & SCTP_PCB_FLAGS_TCPTYPE) && From owner-svn-src-all@freebsd.org Sun May 10 13:07:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 54A782E6F41; Sun, 10 May 2020 13:07:01 +0000 (UTC) (envelope-from manu@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 49KkqT1cPJz4BXB; Sun, 10 May 2020 13:07:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 32A905A26; Sun, 10 May 2020 13:07:01 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AD71XB036241; Sun, 10 May 2020 13:07:01 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AD712L036240; Sun, 10 May 2020 13:07:01 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101307.04AD712L036240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 13:07:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360870 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 360870 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 13:07:01 -0000 Author: manu Date: Sun May 10 13:07:00 2020 New Revision: 360870 URL: https://svnweb.freebsd.org/changeset/base/360870 Log: linuxkpi: Add bitmap_alloc and bitmap_free This is a simple call to kmallock_array/kfree, therefore include linux/slab.h as this is where the kmalloc_array/kfree definition is. Sponsored-by: The FreeBSD Foundation Reviewed by: hselsasky Differential Revision: https://reviews.freebsd.org/D24794 Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 10:03:10 2020 (r360869) +++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:07:00 2020 (r360870) @@ -30,6 +30,7 @@ #define _LINUX_BITMAP_H_ #include +#include static inline void bitmap_zero(unsigned long *addr, const unsigned int size) @@ -307,6 +308,12 @@ bitmap_xor(unsigned long *dst, const unsigned long *sr for (i = 0; i != end; i++) dst[i] = src1[i] ^ src2[i]; +} + +static inline void +bitmap_free(const unsigned long *bitmap) +{ + kfree(bitmap); } #endif /* _LINUX_BITMAP_H_ */ From owner-svn-src-all@freebsd.org Sun May 10 13:12:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE9182E71B3; Sun, 10 May 2020 13:12:05 +0000 (UTC) (envelope-from manu@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 49KkxK4cNpz4Bth; Sun, 10 May 2020 13:12:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 999F05AC1; Sun, 10 May 2020 13:12:05 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ADC5aj040726; Sun, 10 May 2020 13:12:05 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ADC52j040725; Sun, 10 May 2020 13:12:05 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101312.04ADC52j040725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 13:12:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360871 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 360871 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 13:12:05 -0000 Author: manu Date: Sun May 10 13:12:05 2020 New Revision: 360871 URL: https://svnweb.freebsd.org/changeset/base/360871 Log: linuxkpi: Really add bitmap_alloc and bitmap_zalloc This was missing in r360870 Sponsored-by: The FreeBSD Foundation Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h Modified: head/sys/compat/linuxkpi/common/include/linux/bitmap.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:07:00 2020 (r360870) +++ head/sys/compat/linuxkpi/common/include/linux/bitmap.h Sun May 10 13:12:05 2020 (r360871) @@ -310,6 +310,19 @@ bitmap_xor(unsigned long *dst, const unsigned long *sr dst[i] = src1[i] ^ src2[i]; } +static inline unsigned long * +bitmap_alloc(unsigned int size, gfp_t flags) +{ + return (kmalloc_array(BITS_TO_LONGS(size), + sizeof(unsigned long), flags)); +} + +static inline unsigned long * +bitmap_zalloc(unsigned int size, gfp_t flags) +{ + return (bitmap_alloc(size, flags | __GFP_ZERO)); +} + static inline void bitmap_free(const unsigned long *bitmap) { From owner-svn-src-all@freebsd.org Sun May 10 13:43:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A4A52E8152 for ; Sun, 10 May 2020 13:43:33 +0000 (UTC) (envelope-from mshino@syd.odn.ne.jp) Received: from cmta511.odn.ne.jp (mta511.odn.ne.jp [210.134.90.68]) by mx1.freebsd.org (Postfix) with ESMTP id 49KldZ5SV1z4DRP for ; Sun, 10 May 2020 13:43:30 +0000 (UTC) (envelope-from mshino@syd.odn.ne.jp) Received: from vmsa507.odn.ne.jp by cmsa507.odn.ne.jp with ESMTP id <20200510133741261.FBYP.5206.cmsa507.odn.ne.jp@msa507.odn.ne.jp> for ; Sun, 10 May 2020 22:37:41 +0900 Received: from msrg5071.rgserv.odn.ne.jp by vmsa507.odn.ne.jp with ESMTP id <20200510133741251.CRMP.23648.vmsa507.odn.ne.jp@msa507.odn.ne.jp> for ; Sun, 10 May 2020 22:37:41 +0900 Received: from mail.china.com (156.236.74.136) by msrg5071.rgserv.odn.ne.jp (9.0.018.07.06) id 5E783BE30659F747 for svn-src-all@freebsd.org; Sun, 10 May 2020 22:37:41 +0900 Reply-To: Sender: mshino@syd.odn.ne.jp Date: Sun, 10 May 2020 21:37:13 +0800 From: "Spring" To: Subject: Re:h5vebpn Message-ID: <20200510213721687460@syd.odn.ne.jp> X-mailer: Foxmail 6, 13, 102, 15 [cn] Mime-Version: 1.0 X-Rspamd-Queue-Id: 49KldZ5SV1z4DRP X-Spamd-Bar: +++++++++++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=163.com (policy=none); spf=pass (mx1.freebsd.org: domain of mshino@syd.odn.ne.jp designates 210.134.90.68 as permitted sender) smtp.mailfrom=mshino@syd.odn.ne.jp X-Spamd-Result: default: False [11.60 / 15.00]; HAS_REPLYTO(0.00)[springyangbest@163.com]; R_SPF_ALLOW(0.00)[+ip4:210.134.90.64/26]; FREEMAIL_FROM(0.00)[163.com]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MIME_BASE64_TEXT(0.10)[]; FORGED_SENDER(0.30)[springyangbest@163.com,mshino@syd.odn.ne.jp]; RCVD_NO_TLS_LAST(0.10)[]; RECEIVED_SPAMHAUS_PBL(0.00)[136.74.236.156.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~]; R_DKIM_NA(0.00)[]; RECEIVED_SPAMHAUS_SBL(5.00)[136.74.236.156.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.2]; ASN(0.00)[asn:4725, ipnet:210.134.64.0/19, country:JP]; FROM_NEQ_ENVFROM(0.00)[springyangbest@163.com,mshino@syd.odn.ne.jp]; ARC_NA(0.00)[]; FAKE_REPLY(1.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/related,multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; FREEMAIL_REPLYTO(0.00)[163.com]; NEURAL_SPAM_MEDIUM(1.00)[1.000,0]; RCPT_COUNT_ONE(0.00)[1]; BAD_REP_POLICIES(0.10)[]; IP_SCORE_FREEMAIL(0.00)[]; IP_SCORE(0.00)[ip: (2.19), ipnet: 210.134.64.0/19(1.94), asn: 4725(3.21), country: JP(0.05)]; NEURAL_SPAM_LONG(1.00)[1.000,0]; RCVD_IN_DNSWL_NONE(0.00)[68.90.134.210.list.dnswl.org : 127.0.5.0]; XM_CASE(0.50)[]; RBL_SENDERSCORE(2.00)[68.90.134.210.bl.score.senderscore.com]; GREYLIST(0.00)[pass,body]; DMARC_POLICY_SOFTFAIL(0.10)[163.com : SPF not aligned (relaxed), No valid DKIM, none] X-Spam: Yes Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 13:43:33 -0000 RGVhciBTaXIsDQpHb29kIGRheSEgVGhpcyBpcyBTcHJpbmcgWWFuZyBmcm9tIE5pbmdibyBZaW56 aG91IEdldCBNYWNoaW5lcnkgTFRELg0KV2UgYXJlIHNwZWNpYWxpemluZyBpbiBtYW51ZmFjdHVy aW5nIHRoZSBoaWdoIHF1YWxpdHkgaHlkcmF1bGljIGJyZWFrZXIvaGFtbWVyIGNoaXNlbHMgZm9y IGFsbCBtb2RlbHMgaHlkcmF1bGljIGJyZWFrZXJzL2hhbW1lcnMgKFRoZSBjaGlzZWwgZGlhbWV0 ZXIgY2FuIGJlIGZyb20gNDVtbS0zMDBtbSksDQpXZSBhbHNvIHN1cHBseSBhbGwgaGlnaCBxdWFs aXR5IGh5ZHJhdWxpYyBicmVha2VycyBhbmQgdGhlIHNwYXJlIHBhcnRzLHN1Y2ggYXMgSHlkcmF1 bGljIGJyZWFrZXIgcGlzdG9ucyxidXNoZXMscGlucyxib2x0cyxmcm9udCBoZWFkcyBhbmQgYmFj ayBoZWFkcyxzZWFsIGtpdHMsIGRpYXBocmFnbXMgYW5kIHNvIG9uIHdoaWNoIGNhbiBzdWl0YWJs ZSBmb3IgbW9zdCBicmFuZHMgb2YgdGhlIEh5ZHJhdWxpYyBicmVha2Vycy4NCkRvICB5b3UgaW50 ZXJlc3QgaW4gb3VyIHByb2R1Y3RzPyBJZiB5ZXMsIHdlIGNhbiBzaG93IHNhbXBsZXMgYXMgeW91 ciByZXF1dGVzLg0KDQpUaGFua3MNClNwcmluZyBZYW5nIChQcmVzaWRlbnQpIA0KTklOR0JPIFlJ TlpIT1UgR0VUIE1BQ0hJTkVSWSBMVEQuDQpBREQ6IE5vLjI4OCxaaG9uZ3pob3UgUmQsV3V4aWFu ZyxZaW56aG91IERpc3QuLE5pbmdibyxDaGluYQ0KU0tZUEU6IHNwcmluZ3lhbmdiZXN0 From owner-svn-src-all@freebsd.org Sun May 10 14:09:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 464942E88FA; Sun, 10 May 2020 14:09:31 +0000 (UTC) (envelope-from manu@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 49KmCb1B7kz4FMJ; Sun, 10 May 2020 14:09:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 23D7365A5; Sun, 10 May 2020 14:09:31 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AE9Vnl073578; Sun, 10 May 2020 14:09:31 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AE9VHM073577; Sun, 10 May 2020 14:09:31 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005101409.04AE9VHM073577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sun, 10 May 2020 14:09:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360872 - head/sys/dev/qlnx/qlnxe X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/dev/qlnx/qlnxe X-SVN-Commit-Revision: 360872 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:09:31 -0000 Author: manu Date: Sun May 10 14:09:30 2020 New Revision: 360872 URL: https://svnweb.freebsd.org/changeset/base/360872 Log: qnlx: Do not redifines types. r360870 added linux/slab.h into liunx/bitmap.h and this include linux/types.h The qlnx driver is redefining some of those types so remove them and add an explicit linux/types.h include. Pointy hat: manu Reported by: Austin Shafer Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h Modified: head/sys/dev/qlnx/qlnxe/bcm_osal.h ============================================================================== --- head/sys/dev/qlnx/qlnxe/bcm_osal.h Sun May 10 13:12:05 2020 (r360871) +++ head/sys/dev/qlnx/qlnxe/bcm_osal.h Sun May 10 14:09:30 2020 (r360872) @@ -34,6 +34,8 @@ #include "ecore_status.h" #include +#include + #if __FreeBSD_version >= 1200032 #include #else @@ -112,11 +114,6 @@ extern void qlnx_vf_flr_update(void *p_hwfn); #define s32 uint32_t #ifndef QLNX_RDMA - -typedef uint16_t __le16; -typedef uint32_t __le32; -typedef uint16_t __be16; -typedef uint32_t __be32; static __inline unsigned long roundup_pow_of_two(unsigned long x) From owner-svn-src-all@freebsd.org Sun May 10 14:46:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 851B22E93E0; Sun, 10 May 2020 14:46:47 +0000 (UTC) (envelope-from glebius@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 49Kn2b30GMz4Gk7; Sun, 10 May 2020 14:46:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 620516D25; Sun, 10 May 2020 14:46:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AEklcu098006; Sun, 10 May 2020 14:46:47 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AEkle7098005; Sun, 10 May 2020 14:46:47 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <202005101446.04AEkle7098005@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sun, 10 May 2020 14:46: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: r360873 - stable/12/contrib/bsnmp/snmpd X-SVN-Group: stable-12 X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: stable/12/contrib/bsnmp/snmpd X-SVN-Commit-Revision: 360873 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:46:47 -0000 Author: glebius Date: Sun May 10 14:46:46 2020 New Revision: 360873 URL: https://svnweb.freebsd.org/changeset/base/360873 Log: Merge r360138: Fix immediate crash when snmpd is bound to a specific IP address. The code that sets up msghdr must first fully fill in the msghdr itself, and only then use CMSG_xxx() macros. PR: 246323 Modified: stable/12/contrib/bsnmp/snmpd/trans_inet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/bsnmp/snmpd/trans_inet.c ============================================================================== --- stable/12/contrib/bsnmp/snmpd/trans_inet.c Sun May 10 14:09:30 2020 (r360872) +++ stable/12/contrib/bsnmp/snmpd/trans_inet.c Sun May 10 14:46:46 2020 (r360873) @@ -71,7 +71,7 @@ typedef void input_func(int, void *); typedef int activate_func(struct inet_port *); typedef void deactivate_func(struct inet_port *); typedef void parse_ctrl_func(struct port_sock *, const struct msghdr *); -typedef void setsrc_func(struct port_sock *, struct msghdr *); +typedef void setsrc_func(struct port_sock *, struct msghdr *, char *); static create_func ipv4_create; static input_func ipv4_input; @@ -401,13 +401,12 @@ inet_send2(struct tport *tp, const u_char *buf, size_t msg.msg_name = (void *)pi->peer; msg.msg_namelen = pi->peerlen; - msg.msg_control = NULL; - msg.msg_controllen = 0; - char cbuf[XMIT_CBUF_SIZE]; if (s->set_ret_source) { - msg.msg_control = cbuf; - s->setsrc(s, &msg); + s->setsrc(s, &msg, cbuf); + } else { + msg.msg_control = NULL; + msg.msg_controllen = 0; } return (sendmsg(s->input.fd, &msg, 0)); @@ -638,18 +637,20 @@ ipv4_parse_ctrl(struct port_sock *sock, const struct m * \param msg message */ static void -ipv4_setsrc(struct port_sock *sock, struct msghdr *msg) +ipv4_setsrc(struct port_sock *sock, struct msghdr *msg, char *cbuf) { - struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg); + struct cmsghdr *cmsg; + msg->msg_control = cbuf; + msg->msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); + /* select outgoing interface by setting source address */ + cmsg = CMSG_FIRSTHDR(msg); cmsg->cmsg_level = IPPROTO_IP; cmsg->cmsg_type = IP_SENDSRCADDR; cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_addr)); memcpy(CMSG_DATA(cmsg), &sock->ret_source.a4, sizeof(struct in_addr)); - - msg->msg_controllen = CMSG_SPACE(sizeof(struct in_addr)); } /** @@ -877,18 +878,20 @@ ipv6_parse_ctrl(struct port_sock *sock, const struct m * \param msg message */ static void -ipv6_setsrc(struct port_sock *sock, struct msghdr *msg) +ipv6_setsrc(struct port_sock *sock, struct msghdr *msg, char *cbuf) { - struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg); + struct cmsghdr *cmsg; + msg->msg_control = cbuf; + msg->msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); + /* select outgoing interface by setting source address */ + cmsg = CMSG_FIRSTHDR(msg); cmsg->cmsg_level = IPPROTO_IPV6; cmsg->cmsg_type = IPV6_PKTINFO; cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); memcpy(CMSG_DATA(cmsg), &sock->ret_source.a6, sizeof(struct in6_pktinfo)); - - msg->msg_controllen = CMSG_SPACE(sizeof(struct in6_pktinfo)); } /** From owner-svn-src-all@freebsd.org Sun May 10 14:53:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E5842E981E; Sun, 10 May 2020 14:53:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kn9x2pCpz4HCJ; Sun, 10 May 2020 14:53:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 59D506F1C; Sun, 10 May 2020 14:53:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AEr9ag004305; Sun, 10 May 2020 14:53:09 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AEr8NP004304; Sun, 10 May 2020 14:53:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005101453.04AEr8NP004304@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sun, 10 May 2020 14:53:08 +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: r360874 - in stable/12/sys: arm64/arm64 riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable/12/sys: arm64/arm64 riscv/riscv X-SVN-Commit-Revision: 360874 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:53:09 -0000 Author: jhb Date: Sun May 10 14:53:08 2020 New Revision: 360874 URL: https://svnweb.freebsd.org/changeset/base/360874 Log: MFC 356839: Save and restore floating point registers in get/set_mcontext(). arm64 and riscv were only saving and restoring floating point registers for sendsig() and sys_sigreturn(), but not for getcontext(), setcontext(), and swapcontext(). While here, remove an always-false check for uap being NULL from sys_sigreturn(). Modified: stable/12/sys/arm64/arm64/machdep.c stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm64/arm64/machdep.c ============================================================================== --- stable/12/sys/arm64/arm64/machdep.c Sun May 10 14:46:46 2020 (r360873) +++ stable/12/sys/arm64/arm64/machdep.c Sun May 10 14:53:08 2020 (r360874) @@ -95,6 +95,8 @@ __FBSDID("$FreeBSD$"); #include #endif +static void get_fpcontext(struct thread *td, mcontext_t *mcp); +static void set_fpcontext(struct thread *td, mcontext_t *mcp); enum arm64_bus arm64_bus_method = ARM64_BUS_NONE; @@ -385,6 +387,7 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int c mcp->mc_gpregs.gp_sp = tf->tf_sp; mcp->mc_gpregs.gp_lr = tf->tf_lr; mcp->mc_gpregs.gp_elr = tf->tf_elr; + get_fpcontext(td, mcp); return (0); } @@ -406,6 +409,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf->tf_lr = mcp->mc_gpregs.gp_lr; tf->tf_elr = mcp->mc_gpregs.gp_elr; tf->tf_spsr = mcp->mc_gpregs.gp_spsr; + set_fpcontext(td, mcp); return (0); } @@ -577,15 +581,12 @@ sys_sigreturn(struct thread *td, struct sigreturn_args ucontext_t uc; int error; - if (uap == NULL) - return (EFAULT); if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); error = set_mcontext(td, &uc.uc_mcontext); if (error != 0) return (error); - set_fpcontext(td, &uc.uc_mcontext); /* Restore signal mask. */ kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); @@ -657,7 +658,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask /* Fill in the frame to copy out */ bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); - get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Sun May 10 14:46:46 2020 (r360873) +++ stable/12/sys/riscv/riscv/machdep.c Sun May 10 14:53:08 2020 (r360874) @@ -95,6 +95,9 @@ __FBSDID("$FreeBSD$"); #include #endif +static void get_fpcontext(struct thread *td, mcontext_t *mcp); +static void set_fpcontext(struct thread *td, mcontext_t *mcp); + struct pcpu __pcpu[MAXCPU]; static struct trapframe proc0_tf; @@ -350,6 +353,7 @@ get_mcontext(struct thread *td, mcontext_t *mcp, int c mcp->mc_gpregs.gp_tp = tf->tf_tp; mcp->mc_gpregs.gp_sepc = tf->tf_sepc; mcp->mc_gpregs.gp_sstatus = tf->tf_sstatus; + get_fpcontext(td, mcp); return (0); } @@ -370,6 +374,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf->tf_gp = mcp->mc_gpregs.gp_gp; tf->tf_sepc = mcp->mc_gpregs.gp_sepc; tf->tf_sstatus = mcp->mc_gpregs.gp_sstatus; + set_fpcontext(td, mcp); return (0); } @@ -519,8 +524,6 @@ sys_sigreturn(struct thread *td, struct sigreturn_args ucontext_t uc; int error; - if (uap == NULL) - return (EFAULT); if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); @@ -537,8 +540,6 @@ sys_sigreturn(struct thread *td, struct sigreturn_args if (error != 0) return (error); - set_fpcontext(td, &uc.uc_mcontext); - /* Restore signal mask. */ kern_sigprocmask(td, SIG_SETMASK, &uc.uc_sigmask, NULL, 0); @@ -606,7 +607,6 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask /* Fill in the frame to copy out */ bzero(&frame, sizeof(frame)); get_mcontext(td, &frame.sf_uc.uc_mcontext, 0); - get_fpcontext(td, &frame.sf_uc.uc_mcontext); frame.sf_si = ksi->ksi_info; frame.sf_uc.uc_sigmask = *mask; frame.sf_uc.uc_stack.ss_flags = (td->td_pflags & TDP_ALTSTACK) ? From owner-svn-src-all@freebsd.org Sun May 10 14:56:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 806512E9B46; Sun, 10 May 2020 14:56:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49KnFk2tZTz4HcT; Sun, 10 May 2020 14:56:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5DF0A6F26; Sun, 10 May 2020 14:56:26 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AEuQPS004547; Sun, 10 May 2020 14:56:26 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AEuQYQ004546; Sun, 10 May 2020 14:56:26 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005101456.04AEuQYQ004546@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 10 May 2020 14:56: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: r360875 - stable/12/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Commit-Revision: 360875 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:56:26 -0000 Author: emaste Date: Sun May 10 14:56:25 2020 New Revision: 360875 URL: https://svnweb.freebsd.org/changeset/base/360875 Log: MFC r360801: Merge commit 21e5e1724b75 from llvm git: getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD Once we hit AT_NULL, we need to bail out of the loop; not just the enclosing switch. This fixes basic usage (e.g. `cc --version`) when AT_EXECPATH isn't present on older branches (e.g. under emu-user-static, at the moment), where we would previously run off the end of ::environ. Patch By: kevans Reviewed By: arichardson Modified: stable/12/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc ============================================================================== --- stable/12/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:53:08 2020 (r360874) +++ stable/12/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:56:25 2020 (r360875) @@ -208,14 +208,9 @@ std::string getMainExecutable(const char *argv0, void while (*p++ != 0) ; // Iterate through auxiliary vectors for AT_EXECPATH. - for (;;) { - switch (*(uintptr_t *)p++) { - case AT_EXECPATH: + for (; *(uintptr_t *)p != AT_NULL; p++) { + if (*(uintptr_t *)p++ == AT_EXECPATH) return *p; - case AT_NULL: - break; - } - p++; } #endif // Fall back to argv[0] if auxiliary vectors are not available. From owner-svn-src-all@freebsd.org Sun May 10 14:59:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CF492E9C31; Sun, 10 May 2020 14:59:02 +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 49KnJj6Y2tz4HlB; Sun, 10 May 2020 14:59:01 +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 D76AC6F28; Sun, 10 May 2020 14:59:01 +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 04AEx1pr004717; Sun, 10 May 2020 14:59:01 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AEx1Pb004716; Sun, 10 May 2020 14:59:01 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005101459.04AEx1Pb004716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 10 May 2020 14:59:01 +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: r360876 - stable/11/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/contrib/llvm-project/llvm/lib/Support/Unix X-SVN-Commit-Revision: 360876 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 14:59:02 -0000 Author: emaste Date: Sun May 10 14:59:01 2020 New Revision: 360876 URL: https://svnweb.freebsd.org/changeset/base/360876 Log: MFC r360801: Merge commit 21e5e1724b75 from llvm git: getMainExecutable: Fix hand-rolled AT_EXECPATH for older FreeBSD Once we hit AT_NULL, we need to bail out of the loop; not just the enclosing switch. This fixes basic usage (e.g. `cc --version`) when AT_EXECPATH isn't present on older branches (e.g. under emu-user-static, at the moment), where we would previously run off the end of ::environ. Patch By: kevans Reviewed By: arichardson Modified: stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Directory Properties: stable/11/ (props changed) stable/11/contrib/llvm-project/llvm/ (props changed) Modified: stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc ============================================================================== --- stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:56:25 2020 (r360875) +++ stable/11/contrib/llvm-project/llvm/lib/Support/Unix/Path.inc Sun May 10 14:59:01 2020 (r360876) @@ -208,14 +208,9 @@ std::string getMainExecutable(const char *argv0, void while (*p++ != 0) ; // Iterate through auxiliary vectors for AT_EXECPATH. - for (;;) { - switch (*(uintptr_t *)p++) { - case AT_EXECPATH: + for (; *(uintptr_t *)p != AT_NULL; p++) { + if (*(uintptr_t *)p++ == AT_EXECPATH) return *p; - case AT_NULL: - break; - } - p++; } #endif // Fall back to argv[0] if auxiliary vectors are not available. From owner-svn-src-all@freebsd.org Sun May 10 16:11:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96E672EBA09; Sun, 10 May 2020 16:11:20 +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 49Kpw83sFhz4MPh; Sun, 10 May 2020 16:11:20 +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 7DAC17DF9; Sun, 10 May 2020 16:11:20 +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 04AGBKfT049118; Sun, 10 May 2020 16:11:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AGBKnD049116; Sun, 10 May 2020 16:11:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005101611.04AGBKnD049116@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 10 May 2020 16:11:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360877 - head/tools/pkgbase X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/tools/pkgbase X-SVN-Commit-Revision: 360877 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 16:11:20 -0000 Author: emaste Date: Sun May 10 16:11:19 2020 New Revision: 360877 URL: https://svnweb.freebsd.org/changeset/base/360877 Log: Add pkgbase METALOG parse/check tool `metalog.lua` is a script that reads METALOG file created by pkgbase (make packages) and generates reports about the installed system and issues. This was developed as part of Yang's W2020 University of Waterloo co- operative education term with the FreeBSD Foundation. kevans provided some initial review; we will iterate on it in the tree. Submitted by: Yang Wang <2333@outlook.jp> Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24563 Added: head/tools/pkgbase/ head/tools/pkgbase/README.md (contents, props changed) head/tools/pkgbase/metalog_reader.lua (contents, props changed) Added: head/tools/pkgbase/README.md ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/pkgbase/README.md Sun May 10 16:11:19 2020 (r360877) @@ -0,0 +1,61 @@ +`metalog.lua` is a script that reads METALOG file created by pkgbase +(make packages) and generates reports about the installed system +and issues + +the script accepts an mtree file in a format that's returned by +`mtree -c | mtree -C` + +synopsis: +``` +metalog_reader.lua [-h] [-a | -c | -p [-count] [-size] [-f...]] [-W...] [-v] metalog-path +``` + +options: + +* `-a` prints all scan results. this is the default option if no option is + provided. +* `-c` lints the file and gives warnings/errors, including duplication and + conflicting metadata + * `-Wcheck-notagdir` entries with dir type and no tags will be also included + the first time they appear (1) +* `-p` list all package names found in the file as exactly specified by + `tags=package=...` + * `-count` display the number of files of the package + * `-size` display the size of the package + * `-fsetgid` only include packages with setgid files + * `-fsetuid` only include packages with setuid files + * `-fsetid` only include packages with setgid or setuid files +* `-v` verbose mode +* `-h` help page + +some examples: + +* `metalog_reader.lua -a METALOG` + prints all scan results described below. this is the default option +* `metalog_reader.lua -c METALOG` + only prints errors and warnings found in the file +* `metalog_reader.lua -c -Wcheck-notagdir METALOG` + prints errors and warnings found in the file, including directories with no + tags +* `metalog_reader.lua -p METALOG` + only prints all the package names found in the file +* `metalog_reader.lua -p -count -size METALOG` + prints all the package names, followed by number of files, followed by total + size +* `metalog_reader.lua -p -size -fsetid METALOG` + prints packages that has either setuid/setgid files, followed by the total + size +* `metalog_reader.lua -p -fsetuid -fsetgid METALOG` + prints packages that has both setuid and setgid files (if more than one + filters are specified, they are composed using logic and) +* `metalog_reader.lua -p -count -size -fsetuid METALOG` + prints packages that has setuid files, followed by number of files and total + size + +(1) if we have two entries +``` +./bin type=dir uname=root gname=wheel mode=0755 +./bin type=dir uname=root gname=wheel mode=0755 tags=... +``` +by default, this is not warned. if the option is enabled, this will be warned +as the second line sufficiently covers the first line. Added: head/tools/pkgbase/metalog_reader.lua ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/pkgbase/metalog_reader.lua Sun May 10 16:11:19 2020 (r360877) @@ -0,0 +1,521 @@ +#!/usr/libexec/flua + +-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD +-- +-- Copyright(c) 2020 The FreeBSD Foundation. +-- +-- Redistribution and use in source and binary forms, with or without +-- modification, are permitted provided that the following conditions +-- are met: +-- 1. Redistributions of source code must retain the above copyright +-- notice, this list of conditions and the following disclaimer. +-- 2. Redistributions in binary form must reproduce the above copyright +-- notice, this list of conditions and the following disclaimer in the +-- documentation and/or other materials provided with the distribution. +-- +-- THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +-- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +-- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +-- ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +-- SUCH DAMAGE. + +-- $FreeBSD$ + +function main(args) + if #args == 0 then usage() end + local filename + local printall, checkonly, pkgonly = + #args == 1, false, false + local dcount, dsize, fuid, fgid, fid = + false, false, false, false, false + local verbose = false + local w_notagdirs = false + + local i = 1 + while i <= #args do + if args[i] == '-h' then + usage(true) + elseif args[i] == '-a' then + printall = true + elseif args[i] == '-c' then + printall = false + checkonly = true + elseif args[i] == '-p' then + printall = false + pkgonly = true + while i < #args do + i = i+1 + if args[i] == '-count' then + dcount = true + elseif args[i] == '-size' then + dsize = true + elseif args[i] == '-fsetuid' then + fuid = true + elseif args[i] == '-fsetgid' then + fgid = true + elseif args[i] == '-fsetid' then + fid = true + else + i = i-1 + break + end + end + elseif args[i] == '-v' then + verbose = true + elseif args[i] == '-Wcheck-notagdir' then + w_notagdirs = true + elseif args[i]:match('^%-') then + io.stderr:write('Unknown argument '..args[i]..'.\n') + usage() + else + filename = args[i] + end + i = i+1 + end + + if filename == nil then + io.stderr:write('Missing filename.\n') + usage() + end + + local sess = Analysis_session(filename, verbose, w_notagdirs) + + if printall then + io.write('--- PACKAGE REPORTS ---\n') + io.write(sess.pkg_report_full()) + io.write('--- LINTING REPORTS ---\n') + print_lints(sess) + elseif checkonly then + print_lints(sess) + elseif pkgonly then + io.write(sess.pkg_report_simple(dcount, dsize, { + fuid and sess.pkg_issetuid or nil, + fgid and sess.pkg_issetgid or nil, + fid and sess.pkg_issetid or nil + })) + else + io.stderr:write('This text should not be displayed.') + usage() + end +end + +--- @param man boolean +function usage(man) + local sn = 'Usage: '..arg[0].. ' [-h] [-a | -c | -p [-count] [-size] [-f...]] [-W...] metalog-path \n' + if man then + io.write('\n') + io.write(sn) + io.write( +[[ + +The script reads METALOG file created by pkgbase (make packages) and generates +reports about the installed system and issues. It accepts an mtree file in a +format that's returned by `mtree -c | mtree -C` + + Options: + -a prints all scan results. this is the default option if no option + is provided. + -c lints the file and gives warnings/errors, including duplication + and conflicting metadata + -Wcheck-notagdir entries with dir type and no tags will be also + included the first time they appear + -p list all package names found in the file as exactly specified by + `tags=package=...` + -count display the number of files of the package + -size display the size of the package + -fsetgid only include packages with setgid files + -fsetuid only include packages with setuid files + -fsetid only include packages with setgid or setuid files + -v verbose mode + -h help page + +]]) + os.exit() + else + io.stderr:write(sn) + os.exit(1) + end +end + +--- @param sess Analysis_session +function print_lints(sess) + local dupwarn, duperr = sess.dup_report() + io.write(dupwarn) + io.write(duperr) + local inodewarn, inodeerr = sess.inode_report() + io.write(inodewarn) + io.write(inodeerr) +end + +--- @param t table +function sortedPairs(t) + local sortedk = {} + for k in next, t do sortedk[#sortedk+1] = k end + table.sort(sortedk) + local i = 0 + return function() + i = i + 1 + return sortedk[i], t[sortedk[i]] + end +end + +--- @param t table +--- @param f function U> +function table_map(t, f) + local res = {} + for k, v in pairs(t) do res[k] = f(v) end + return res +end + +--- @class MetalogRow +-- a table contaning file's info, from a line content from METALOG file +-- all fields in the table are strings +-- sample output: +-- { +-- filename = ./usr/share/man/man3/inet6_rthdr_segments.3.gz +-- lineno = 5 +-- attrs = { +-- gname = 'wheel' +-- uname = 'root' +-- mode = '0444' +-- size = '1166' +-- time = nil +-- type = 'file' +-- tags = 'package=clibs,debug' +-- } +-- } +--- @param line string +function MetalogRow(line, lineno) + local res, attrs = {}, {} + local filename, rest = line:match('^(%S+) (.+)$') + -- mtree file has space escaped as '\\040', not affecting splitting + -- string by space + for attrpair in rest:gmatch('[^ ]+') do + local k, v = attrpair:match('^(.-)=(.+)') + attrs[k] = v + end + res.filename = filename + res.linenum = lineno + res.attrs = attrs + return res +end + +-- check if an array of MetalogRows are equivalent. if not, the first field +-- that's different is returned secondly +--- @param rows MetalogRow[] +--- @param ignore_name boolean +--- @param ignore_tags boolean +function metalogrows_all_equal(rows, ignore_name, ignore_tags) + local __eq = function(l, o) + if not ignore_name and l.filename ~= o.filename then + return false, 'filename' + end + -- ignoring linenum in METALOG file as it's not relavant + for k in pairs(l.attrs) do + if ignore_tags and k == 'tags' then goto continue end + if l.attrs[k] ~= o.attrs[k] and o.attrs[k] ~= nil then + return false, k + end + ::continue:: + end + return true + end + for _, v in ipairs(rows) do + local bol, offby = __eq(v, rows[1]) + if not bol then return false, offby end + end + return true +end + +--- @param tagstr string +function pkgname_from_tag(tagstr) + local ext, pkgname, pkgend = '', '', '' + for seg in tagstr:gmatch('[^,]+') do + if seg:match('package=') then + pkgname = seg:sub(9) + elseif seg == 'development' or seg == 'profile' + or seg == 'debug' or seg == 'docs' then + pkgend = seg + else + ext = ext == '' and seg or ext..'-'..seg + end + end + pkgname = pkgname + ..(ext == '' and '' or '-'..ext) + ..(pkgend == '' and '' or '-'..pkgend) + return pkgname +end + +--- @class Analysis_session +--- @param metalog string +--- @param verbose boolean +--- @param w_notagdirs boolean turn on to also check directories +function Analysis_session(metalog, verbose, w_notagdirs) + local files = {} -- map + -- set is map. if bool is true then elem exists + local pkgs = {} -- map> + ----- used to keep track of files not belonging to a pkg. not used so + ----- it is commented with ----- + -----local nopkg = {} -- set + --- @public + local swarn = {} + --- @public + local serrs = {} + + -- returns number of files in package and size of package + -- nil is returned upon errors + --- @param pkgname string + local function pkg_size(pkgname) + local filecount, sz = 0, 0 + for filename in pairs(pkgs[pkgname]) do + local rows = files[filename] + -- normally, there should be only one row per filename + -- if these rows are equal, there should be warning, but it + -- does not affect size counting. if not, it is an error + if #rows > 1 and not metalogrows_all_equal(rows) then + return nil + end + local row = rows[1] + if row.attrs.type == 'file' then + sz = sz + tonumber(row.attrs.size) + end + filecount = filecount + 1 + end + return filecount, sz + end + + --- @param pkgname string + --- @param mode number + local function pkg_ismode(pkgname, mode) + for filename in pairs(pkgs[pkgname]) do + for _, row in ipairs(files[filename]) do + if tonumber(row.attrs.mode, 8) & mode ~= 0 then + return true + end + end + end + return false + end + + --- @param pkgname string + --- @public + local function pkg_issetuid(pkgname) + return pkg_ismode(pkgname, 2048) + end + + --- @param pkgname string + --- @public + local function pkg_issetgid(pkgname) + return pkg_ismode(pkgname, 1024) + end + + --- @param pkgname string + --- @public + local function pkg_issetid(pkgname) + return pkg_issetuid(pkgname) or pkg_issetgid(pkgname) + end + + -- sample return: + -- { [*string]: { count=1, size=2, issetuid=true, issetgid=true } } + local function pkg_report_helper_table() + local res = {} + for pkgname in pairs(pkgs) do + res[pkgname] = {} + res[pkgname].count, + res[pkgname].size = pkg_size(pkgname) + res[pkgname].issetuid = pkg_issetuid(pkgname) + res[pkgname].issetgid = pkg_issetgid(pkgname) + end + return res + end + + -- returns a string describing package scan report + --- @public + local function pkg_report_full() + local sb = {} + for pkgname, v in sortedPairs(pkg_report_helper_table()) do + sb[#sb+1] = 'Package '..pkgname..':' + if v.issetuid or v.issetgid then + sb[#sb+1] = ''..table.concat({ + v.issetuid and ' setuid' or '', + v.issetgid and ' setgid' or '' }, '') + end + sb[#sb+1] = '\n number of files: '..(v.count or '?') + ..'\n total size: '..(v.size or '?') + sb[#sb+1] = '\n' + end + return table.concat(sb, '') + end + + --- @param have_count boolean + --- @param have_size boolean + --- @param filters function[] + --- @public + -- returns a string describing package size report. + -- sample: "mypackage 2 2048"* if both booleans are true + local function pkg_report_simple(have_count, have_size, filters) + filters = filters or {} + local sb = {} + for pkgname, v in sortedPairs(pkg_report_helper_table()) do + local pred = true + -- doing a foldl to all the function results with (and) + for _, f in pairs(filters) do pred = pred and f(pkgname) end + if pred then + sb[#sb+1] = pkgname..table.concat({ + have_count and (' '..(v.count or '?')) or '', + have_size and (' '..(v.size or '?')) or ''}, '') + ..'\n' + end + end + return table.concat(sb, '') + end + + -- returns a string describing duplicate file warnings, + -- returns a string describing duplicate file errors + --- @public + local function dup_report() + local warn, errs = {}, {} + for filename, rows in sortedPairs(files) do + if #rows == 1 then goto continue end + local iseq, offby = metalogrows_all_equal(rows) + if iseq then -- repeated line, just a warning + warn[#warn+1] = 'warning: '..filename + ..' repeated with same meta: line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + warn[#warn+1] = '\n' + elseif not metalogrows_all_equal(rows, false, true) then + -- same filename (possibly different tags), different metadata, an error + errs[#errs+1] = 'error: '..filename + ..' exists in multiple locations and with different meta: line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + ..'. off by "'..offby..'"' + errs[#errs+1] = '\n' + end + ::continue:: + end + return table.concat(warn, ''), table.concat(errs, '') + end + + -- returns a string describing warnings of found hard links + -- returns a string describing errors of found hard links + --- @public + local function inode_report() + -- obtain inodes of filenames + local attributes = require('lfs').attributes + local inm = {} -- map + local unstatables = {} -- string[] + for filename in pairs(files) do + -- i only took the first row of a filename, + -- and skip links and folders + if files[filename][1].attrs.type ~= 'file' then + goto continue + end + -- make ./xxx become /xxx so that we can stat + filename = filename:sub(2) + local fs = attributes(filename) + if fs == nil then + unstatables[#unstatables+1] = filename + goto continue + end + local inode = fs.ino + inm[inode] = inm[inode] or {} + -- add back the dot prefix + table.insert(inm[inode], '.'..filename) + ::continue:: + end + + local warn, errs = {}, {} + for _, filenames in pairs(inm) do + if #filenames == 1 then goto continue end + -- i only took the first row of a filename + local rows = table_map(filenames, function(e) + return files[e][1] + end) + local iseq, offby = metalogrows_all_equal(rows, true, true) + if not iseq then + errs[#errs+1] = 'error: ' + ..'entries point to the same inode but have different meta: ' + ..table.concat(filenames, ',')..' in line ' + ..table.concat( + table_map(rows, function(e) return e.linenum end), ',') + ..'. off by "'..offby..'"' + errs[#errs+1] = '\n' + end + ::continue:: + end + + if #unstatables > 0 then + warn[#warn+1] = verbose and + 'note: skipped checking inodes: '..table.concat(unstatables, ',')..'\n' + or + 'note: skipped checking inodes for '..#unstatables..' entries\n' + end + + return table.concat(warn, ''), table.concat(errs, '') + end + + do + local fp, errmsg, errcode = io.open(metalog, 'r') + if fp == nil then + io.stderr:write('cannot open '..metalog..': '..errmsg..': '..errcode..'\n') + os.exit(1) + end + + -- scan all lines and put file data into the dictionaries + local firsttimes = {} -- set + local lineno = 0 + for line in fp:lines() do + -----local isinpkg = false + lineno = lineno + 1 + -- skip lines begining with # + if line:match('^%s*#') then goto continue end + -- skip blank lines + if line:match('^%s*$') then goto continue end + + local data = MetalogRow(line, lineno) + -- entries with dir and no tags... ignore for the first time + if not w_notagdirs and + data.attrs.tags == nil and data.attrs.type == 'dir' + and not firsttimes[data.filename] then + firsttimes[data.filename] = true + goto continue + end + + files[data.filename] = files[data.filename] or {} + table.insert(files[data.filename], data) + + if data.attrs.tags ~= nil then + pkgname = pkgname_from_tag(data.attrs.tags) + pkgs[pkgname] = pkgs[pkgname] or {} + pkgs[pkgname][data.filename] = true + ------isinpkg = true + end + -----if not isinpkg then nopkg[data.filename] = true end + ::continue:: + end + + fp:close() + end + + return { + warn = swarn, + errs = serrs, + pkg_issetuid = pkg_issetuid, + pkg_issetgid = pkg_issetgid, + pkg_issetid = pkg_issetid, + pkg_report_full = pkg_report_full, + pkg_report_simple = pkg_report_simple, + dup_report = dup_report, + inode_report = inode_report + } +end + +main(arg) From owner-svn-src-all@freebsd.org Sun May 10 17:19:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9BD42ED57E; Sun, 10 May 2020 17:19:20 +0000 (UTC) (envelope-from tuexen@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 49KrQc4VNTz4Qb8; Sun, 10 May 2020 17:19:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9591A8A0E; Sun, 10 May 2020 17:19:20 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AHJKUa090576; Sun, 10 May 2020 17:19:20 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AHJJB8090571; Sun, 10 May 2020 17:19:19 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101719.04AHJJB8090571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 17:19:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360878 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360878 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 17:19:20 -0000 Author: tuexen Date: Sun May 10 17:19:19 2020 New Revision: 360878 URL: https://svnweb.freebsd.org/changeset/base/360878 Log: Ensure that we have a path when starting the T3 RXT timer. Reported by: syzbot+f2321629047f89486fa3@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctp_asconf.c head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_timer.c head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_asconf.c ============================================================================== --- head/sys/netinet/sctp_asconf.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_asconf.c Sun May 10 17:19:19 2020 (r360878) @@ -1032,9 +1032,14 @@ sctp_assoc_immediate_retrans(struct sctp_tcb *stcb, st (stcb->asoc.sent_queue_cnt > 0)) { struct sctp_tmit_chunk *chk; - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); - sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, - stcb, chk->whoTo); + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); + } } } return; Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_indata.c Sun May 10 17:19:19 2020 (r360878) @@ -4439,7 +4439,12 @@ again: } } } - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); @@ -5279,7 +5284,12 @@ again: } } } - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_input.c Sun May 10 17:19:19 2020 (r360878) @@ -2956,6 +2956,7 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c { /* cp must not be used, others call this without a c-ack :-) */ struct sctp_association *asoc; + struct sctp_tmit_chunk *chk; SCTPDBG(SCTP_DEBUG_INPUT2, "sctp_handle_cookie_ack: handling COOKIE-ACK\n"); @@ -3059,11 +3060,13 @@ sctp_handle_cookie_ack(struct sctp_cookie_ack_chunk *c closed_socket: /* Toss the cookie if I can */ sctp_toss_old_cookies(stcb, asoc); - if (!TAILQ_EMPTY(&asoc->sent_queue)) { - /* Restart the timer if we have pending data */ - struct sctp_tmit_chunk *chk; - - chk = TAILQ_FIRST(&asoc->sent_queue); + /* Restart the timer if we have pending data */ + TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); } } @@ -5159,6 +5162,7 @@ process_control_chunks: } else { struct mbuf *ret_buf; struct sctp_inpcb *linp; + struct sctp_tmit_chunk *chk; if (stcb) { linp = NULL; @@ -5220,14 +5224,13 @@ process_control_chunks: got_auth = 1; auth_skipped = 0; } - if (!TAILQ_EMPTY(&stcb->asoc.sent_queue)) { - /* - * Restart the timer if we have - * pending data - */ - struct sctp_tmit_chunk *chk; - - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); + /* Restart the timer if we have pending data */ + TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); } } Modified: head/sys/netinet/sctp_timer.c ============================================================================== --- head/sys/netinet/sctp_timer.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctp_timer.c Sun May 10 17:19:19 2020 (r360878) @@ -974,7 +974,12 @@ sctp_t3rxt_timer(struct sctp_inpcb *inp, /* C3. See if we need to send a Fwd-TSN */ if (SCTP_TSN_GT(stcb->asoc.advanced_peer_ack_point, stcb->asoc.last_acked_seq)) { send_forward_tsn(stcb, &stcb->asoc); - if (lchk) { + for (; lchk != NULL; lchk = TAILQ_NEXT(lchk, sctp_next)) { + if (lchk->whoTo != NULL) { + break; + } + } + if (lchk != NULL) { /* Assure a timer is up */ sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, lchk->whoTo); } Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 10 16:11:19 2020 (r360877) +++ head/sys/netinet/sctputil.c Sun May 10 17:19:19 2020 (r360878) @@ -1841,14 +1841,19 @@ sctp_timeout_handler(void *t) struct sctp_tmit_chunk *chk; /* - * safeguard. If there on some on the sent queue + * Safeguard. If there on some on the sent queue * somewhere but no timers running something is * wrong... so we start a timer on the first chunk * on the send queue on whatever net it is sent to. */ - chk = TAILQ_FIRST(&stcb->asoc.sent_queue); - sctp_timer_start(SCTP_TIMER_TYPE_SEND, inp, stcb, - chk->whoTo); + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { + if (chk->whoTo != NULL) { + break; + } + } + if (chk != NULL) { + sctp_timer_start(SCTP_TIMER_TYPE_SEND, stcb->sctp_ep, stcb, chk->whoTo); + } } break; case SCTP_TIMER_TYPE_INIT: From owner-svn-src-all@freebsd.org Sun May 10 17:43:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AC91A2EDF5A; Sun, 10 May 2020 17:43:42 +0000 (UTC) (envelope-from tuexen@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 49Kryk48VXz4Rwp; Sun, 10 May 2020 17:43:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 89BF88FBA; Sun, 10 May 2020 17:43:42 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AHhgea008754; Sun, 10 May 2020 17:43:42 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AHhg66008753; Sun, 10 May 2020 17:43:42 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005101743.04AHhg66008753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 17:43:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360879 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360879 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 17:43:42 -0000 Author: tuexen Date: Sun May 10 17:43:42 2020 New Revision: 360879 URL: https://svnweb.freebsd.org/changeset/base/360879 Log: Remove trailing whitespace. Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun May 10 17:19:19 2020 (r360878) +++ head/sys/netinet/tcp_usrreq.c Sun May 10 17:43:42 2020 (r360879) @@ -1373,7 +1373,7 @@ tcp_usr_close(struct socket *so) NET_EPOCH_EXIT(et); } -static int +static int tcp_pru_options_support(struct tcpcb *tp, int flags) { /* From owner-svn-src-all@freebsd.org Sun May 10 18:17:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2BC052EECE0; Sun, 10 May 2020 18:17:26 +0000 (UTC) (envelope-from jrm@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 49Ksjf0J8nz4Tdx; Sun, 10 May 2020 18:17:26 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 05B229580; Sun, 10 May 2020 18:17:26 +0000 (UTC) (envelope-from jrm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AIHPAp027271; Sun, 10 May 2020 18:17:25 GMT (envelope-from jrm@FreeBSD.org) Received: (from jrm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AIHPIX027269; Sun, 10 May 2020 18:17:25 GMT (envelope-from jrm@FreeBSD.org) Message-Id: <202005101817.04AIHPIX027269@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrm set sender to jrm@FreeBSD.org using -f From: Joseph Mingrone Date: Sun, 10 May 2020 18:17:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org Subject: svn commit: r360880 - svnadmin/conf X-SVN-Group: svnadmin X-SVN-Commit-Author: jrm X-SVN-Commit-Paths: svnadmin/conf X-SVN-Commit-Revision: 360880 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 18:17:26 -0000 Author: jrm (ports committer) Date: Sun May 10 18:17:25 2020 New Revision: 360880 URL: https://svnweb.freebsd.org/changeset/base/360880 Log: Retire idle commit bits for dexuan and leitao Approved by: core (allanjude) Differential Revision: https://reviews.freebsd.org/D24799 Modified: svnadmin/conf/access svnadmin/conf/mentors Modified: svnadmin/conf/access ============================================================================== --- svnadmin/conf/access Sun May 10 17:43:42 2020 (r360879) +++ svnadmin/conf/access Sun May 10 18:17:25 2020 (r360880) @@ -59,7 +59,6 @@ davidcs dchagin delphij des -dexuan dfr dim dougm @@ -123,7 +122,6 @@ kib kibab kp landonf -leitao loos lstewart luporl Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Sun May 10 17:43:42 2020 (r360879) +++ svnadmin/conf/mentors Sun May 10 18:17:25 2020 (r360880) @@ -24,7 +24,6 @@ johalun imp jrtc27 brooks Co-mentor: jhb kadesai ken Co-mentor: scottl, ambrisko kaktus kib Co-mentor: mjg -leitao jhibbits Co-mentor: nwhitehorn miwi araujo mjoras rstone nick philip Co-mentor: kp From owner-svn-src-all@freebsd.org Sun May 10 19:00:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 196502F0EFB; Sun, 10 May 2020 19:00:59 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ktgt6mX3z4XJR; Sun, 10 May 2020 19:00:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E38E19DB6; Sun, 10 May 2020 19:00:58 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AJ0w0W051821; Sun, 10 May 2020 19:00:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AJ0v5h051816; Sun, 10 May 2020 19:00:57 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005101900.04AJ0v5h051816@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sun, 10 May 2020 19:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360881 - in head/sys/powerpc: aim booke include powerpc X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys/powerpc: aim booke include powerpc X-SVN-Commit-Revision: 360881 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 19:00:59 -0000 Author: jhibbits Date: Sun May 10 19:00:57 2020 New Revision: 360881 URL: https://svnweb.freebsd.org/changeset/base/360881 Log: powerpc: Add a CPU-custom machine check handler Summary: Some machine checks are process-recoverable, others are not. Let a CPU-specific handler decide what to do. This works around a machine check error hit while building www/firefox and mail/thunderbird, which would otherwise cause the build to fail. More work is needed to handle all possible machine check conditions, but this is sufficient to unblock some ports building. Differential Revision: https://reviews.freebsd.org/D23731 Modified: head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/trap_subr64.S head/sys/powerpc/booke/machdep_e500.c head/sys/powerpc/include/cpu.h head/sys/powerpc/include/spr.h head/sys/powerpc/powerpc/trap.c Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/aim/aim_machdep.c Sun May 10 19:00:57 2020 (r360881) @@ -515,6 +515,32 @@ memcpy(pcpu->pc_aim.slb, PCPU_GET(aim.slb), sizeof(pcp #endif } +/* Return 0 on handled success, otherwise signal number. */ +int +cpu_machine_check(struct thread *td, struct trapframe *frame, int *ucode) +{ +#ifdef __powerpc64__ + /* + * This block is 64-bit CPU specific currently. Punt running in 32-bit + * mode on 64-bit CPUs. + */ + /* Check if the important information is in DSISR */ + if ((frame->srr1 & SRR1_MCHK_DATA) != 0) { + printf("Machine check, DSISR: %016lx\n", frame->cpu.aim.dsisr); + /* SLB multi-hit is recoverable. */ + if ((frame->cpu.aim.dsisr & DSISR_MC_SLB_MULTIHIT) != 0) + return (0); + /* TODO: Add other machine check recovery procedures. */ + } else { + if ((frame->srr1 & SRR1_MCHK_IFETCH_M) == SRR1_MCHK_IFETCH_SLBMH) + return (0); + } +#endif + *ucode = BUS_OBJERR; + return (SIGBUS); +} + + #ifndef __powerpc64__ uint64_t va_to_vsid(pmap_t pm, vm_offset_t va) Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/aim/trap_subr64.S Sun May 10 19:00:57 2020 (r360881) @@ -797,6 +797,8 @@ generictrap: std %r31,(PC_TEMPSAVE+CPUSAVE_R31)(%r1) mfdar %r30 std %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DAR)(%r1) + mfdsisr %r30 + std %r30,(PC_TEMPSAVE+CPUSAVE_AIM_DSISR)(%r1) mfsprg1 %r1 /* restore SP, in case of branch */ mfsprg2 %r28 /* save LR */ mfcr %r29 /* save CR */ Modified: head/sys/powerpc/booke/machdep_e500.c ============================================================================== --- head/sys/powerpc/booke/machdep_e500.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/booke/machdep_e500.c Sun May 10 19:00:57 2020 (r360881) @@ -119,3 +119,15 @@ void booke_disable_l2_cache(void) { } + +/* Return 0 on handled success, otherwise signal number. */ +int +cpu_machine_check(struct thread *td, struct trapframe *frame, int *ucode) +{ + register_t mcsr; + + mcsr = mfspr(SPR_MCSR); + + *ucode = BUS_OBJERR; + return (SIGBUS); +} Modified: head/sys/powerpc/include/cpu.h ============================================================================== --- head/sys/powerpc/include/cpu.h Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/include/cpu.h Sun May 10 19:00:57 2020 (r360881) @@ -134,6 +134,8 @@ get_cyclecount(void) extern char btext[]; extern char etext[]; +struct thread; + #ifdef __powerpc64__ extern void enter_idle_powerx(void); extern uint64_t can_wakeup; @@ -146,5 +148,6 @@ void cpu_sleep(void); void flush_disable_caches(void); void fork_trampoline(void); void swi_vm(void *); +int cpu_machine_check(struct thread *, struct trapframe *, int *); #endif /* _MACHINE_CPU_H_ */ Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/include/spr.h Sun May 10 19:00:57 2020 (r360881) @@ -108,6 +108,15 @@ #define DSISR_DABR 0x00400000 /* DABR match */ #define DSISR_SEGMENT 0x00200000 /* XXX; not in 6xx PEM */ #define DSISR_EAR 0x00100000 /* eciwx/ecowx && EAR[E] == 0 */ +#define DSISR_MC_UE_DEFERRED 0x00008000 /* UE deferred error */ +#define DSISR_MC_UE_TABLEWALK 0x00004000 /* UE deferred error during tablewalk */ +#define DSISR_MC_DERAT_MULTIHIT 0x00000800 /* D-ERAT multi-hit */ +#define DSISR_MC_TLB_MULTIHIT 0x00000400 /* TLB multi-hit */ +#define DSISR_MC_TLBIE_ERR 0x00000200 /* TLBIE or TLBIEL programming error */ +#define DSISR_MC_SLB_PARITY 0x00000100 /* SLB parity error */ +#define DSISR_MC_SLB_MULTIHIT 0x00000080 /* SLB Multi-hit detected (D-side) */ +#define DSISR_MC_BAD_REAL_LD 0x00000040 /* Bad real address for load. */ +#define DSISR_MC_BAD_ADDR 0x00000020 /* Bad address for load or store tablewalk */ #define SPR_DAR 0x013 /* .68 Data Address Register */ #define SPR_RTCU_W 0x014 /* .6. 601 RTC Upper - Write */ #define SPR_RTCL_W 0x015 /* .6. 601 RTC Lower - Write */ @@ -115,9 +124,12 @@ #define SPR_SDR1 0x019 /* .68 Page table base address register */ #define SPR_SRR0 0x01a /* 468 Save/Restore Register 0 */ #define SPR_SRR1 0x01b /* 468 Save/Restore Register 1 */ -#define SRR1_ISI_PFAULT 0x40000000 /* ISI page not found */ -#define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ -#define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ +#define SRR1_ISI_PFAULT 0x40000000 /* ISI page not found */ +#define SRR1_ISI_NOEXECUTE 0x10000000 /* Memory marked no-execute */ +#define SRR1_ISI_PP 0x08000000 /* PP bits forbid access */ +#define SRR1_MCHK_DATA 0x00200000 /* Machine check data in DSISR */ +#define SRR1_MCHK_IFETCH_M 0x081c0000 /* Machine check instr fetch mask */ +#define SRR1_MCHK_IFETCH_SLBMH 0x000c0000 /* SLB multihit */ #define SPR_DECAR 0x036 /* ..8 Decrementer auto reload */ #define SPR_EIE 0x050 /* ..8 Exception Interrupt ??? */ #define SPR_EID 0x051 /* ..8 Exception Interrupt ??? */ @@ -725,6 +737,16 @@ #define SPR_MCARU 0x239 /* ..8 Machine Check Address register upper bits */ #define SPR_MCSR 0x23c /* ..8 Machine Check Syndrome register */ +#define MCSR_MCP 0x80000000 /* Machine check input signal to core */ +#define MCSR_L2MMU_MHIT 0x08000000 /* L2 MMU simultaneous hit */ +#define MCSR_NMI 0x00100000 /* Non-maskable interrupt */ +#define MCSR_MAV 0x00080000 /* MCAR address valid */ +#define MCSR_MEA 0x00040000 /* MCAR effective address */ +#define MCSR_IF 0x00010000 /* Instruction fetch error report */ +#define MCSR_LD 0x00008000 /* Load instruction error report */ +#define MCSR_ST 0x00004000 /* Store instruction error report */ +#define MCSR_LDG 0x00002000 /* Guarded load instruction error report */ +#define MCSR_TLBSYNC 0x00000002 /* Simultaneous TLBSYNC detected */ #define SPR_MCAR 0x23d /* ..8 Machine Check Address register */ #define SPR_ESR 0x003e /* ..8 Exception Syndrome Register */ Modified: head/sys/powerpc/powerpc/trap.c ============================================================================== --- head/sys/powerpc/powerpc/trap.c Sun May 10 18:17:25 2020 (r360880) +++ head/sys/powerpc/powerpc/trap.c Sun May 10 19:00:57 2020 (r360881) @@ -402,13 +402,8 @@ trap(struct trapframe *frame) break; case EXC_MCHK: - /* - * Note that this may not be recoverable for the user - * process, depending on the type of machine check, - * but it at least prevents the kernel from dying. - */ - sig = SIGBUS; - ucode = BUS_OBJERR; + sig = cpu_machine_check(td, frame, &ucode); + printtrap(frame->exc, frame, 0, (frame->srr1 & PSL_PR)); break; #if defined(__powerpc64__) && defined(AIM) @@ -513,18 +508,17 @@ cpu_printtrap(u_int vector, struct trapframe *frame, i uint16_t ver; switch (vector) { + case EXC_MCHK: + ver = mfpvr() >> 16; + if (MPC745X_P(ver)) + printf(" msssr0 = 0x%b\n", + (int)mfspr(SPR_MSSSR0), MSSSR_BITMASK); case EXC_DSE: case EXC_DSI: case EXC_DTMISS: printf(" dsisr = 0x%lx\n", (u_long)frame->cpu.aim.dsisr); break; - case EXC_MCHK: - ver = mfpvr() >> 16; - if (MPC745X_P(ver)) - printf(" msssr0 = 0x%b\n", - (int)mfspr(SPR_MSSSR0), MSSSR_BITMASK); - break; } #elif defined(BOOKE) vm_paddr_t pa; @@ -556,14 +550,13 @@ printtrap(u_int vector, struct trapframe *frame, int i case EXC_DSI: case EXC_DTMISS: case EXC_ALI: + case EXC_MCHK: printf(" virtual address = 0x%" PRIxPTR "\n", frame->dar); break; case EXC_ISE: case EXC_ISI: case EXC_ITMISS: printf(" virtual address = 0x%" PRIxPTR "\n", frame->srr0); - break; - case EXC_MCHK: break; } cpu_printtrap(vector, frame, isfatal, user); From owner-svn-src-all@freebsd.org Sun May 10 20:28:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DF9BC2F2C71; Sun, 10 May 2020 20:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Kwd25byFz4cZZ; Sun, 10 May 2020 20:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBC21AE92; Sun, 10 May 2020 20:28:38 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AKSciA007144; Sun, 10 May 2020 20:28:38 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AKScO4007143; Sun, 10 May 2020 20:28:38 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005102028.04AKScO4007143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sun, 10 May 2020 20:28:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360882 - head X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360882 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 20:28:38 -0000 Author: kevans Date: Sun May 10 20:28:38 2020 New Revision: 360882 URL: https://svnweb.freebsd.org/changeset/base/360882 Log: buildworld: add back in missing semicolon if foo; then blah else blah; fi has a drastically different meaning than if foo; then blah; else blah; fi. Fix it. Reported by: 0mp X-MFC-With: r360833 Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun May 10 19:00:57 2020 (r360881) +++ head/Makefile.inc1 Sun May 10 20:28:38 2020 (r360882) @@ -1409,7 +1409,7 @@ distributeworld installworld stageworld: _installcheck # basis, otherwise we'll just mention that we're not doing it to raise # awareness. @if which certctl>/dev/null; then \ - certctl rehash \ + certctl rehash; \ else \ echo "No certctl on the host, not rehashing target -- /etc/ssl may not be populated."; \ fi From owner-svn-src-all@freebsd.org Sun May 10 22:54:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9B392F66A0; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@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 49KzsL4Vlrz3HlC; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 95B89CDFC; Sun, 10 May 2020 22:54:30 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04AMsU7i098986; Sun, 10 May 2020 22:54:30 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04AMsUBW098985; Sun, 10 May 2020 22:54:30 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005102254.04AMsUBW098985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sun, 10 May 2020 22:54:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360885 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360885 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 10 May 2020 22:54:30 -0000 Author: tuexen Date: Sun May 10 22:54:30 2020 New Revision: 360885 URL: https://svnweb.freebsd.org/changeset/base/360885 Log: Ensure that the SCTP iterator runs with an stcb and inp, which belong to each other. Reported by: syzbot+82d39d14f2f765e38db0@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun May 10 21:37:39 2020 (r360884) +++ head/sys/netinet/sctputil.c Sun May 10 22:54:30 2020 (r360885) @@ -1489,6 +1489,7 @@ select_a_new_ep: } tinp = it->inp; it->inp = LIST_NEXT(it->inp, sctp_list); + it->stcb = NULL; SCTP_INP_RUNLOCK(tinp); if (it->inp == NULL) { goto done_with_iterator; @@ -1558,6 +1559,9 @@ select_a_new_ep: atomic_add_int(&it->stcb->asoc.refcnt, -1); iteration_count = 0; } + KASSERT(it->inp == it->stcb->sctp_ep, + ("%s: stcb %p does not belong to inp %p, but inp %p", + __func__, it->stcb, it->inp, it->stcb->sctp_ep)); /* run function on this one */ (*it->function_assoc) (it->inp, it->stcb, it->pointer, it->val); @@ -1590,6 +1594,7 @@ no_stcb: } else { it->inp = LIST_NEXT(it->inp, sctp_list); } + it->stcb = NULL; if (it->inp == NULL) { goto done_with_iterator; } From owner-svn-src-all@freebsd.org Mon May 11 02:33:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B2262D32C6; Mon, 11 May 2020 02:33:39 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49L4kB6tL4z3wqk; Mon, 11 May 2020 02:33:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E6EF3F773; Mon, 11 May 2020 02:33:38 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B2Xcqj033581; Mon, 11 May 2020 02:33:38 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B2XcpD033576; Mon, 11 May 2020 02:33:38 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005110233.04B2XcpD033576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 11 May 2020 02:33:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm X-SVN-Commit-Revision: 360887 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 02:33:39 -0000 Author: jhibbits Date: Mon May 11 02:33:37 2020 New Revision: 360887 URL: https://svnweb.freebsd.org/changeset/base/360887 Log: powerpc64: Implement Radix MMU for POWER9 CPUs Summary: POWER9 supports two MMU formats: traditional hashed page tables, and Radix page tables, similar to what's presesnt on most other architectures. The PowerISA also specifies a process table -- a table of page table pointers-- which on the POWER9 is only available with the Radix MMU, so we can take advantage of it with the Radix MMU driver. Written by Matt Macy. Differential Revision: https://reviews.freebsd.org/D19516 Added: head/sys/powerpc/aim/mmu_radix.c (contents, props changed) Modified: head/sys/conf/files.powerpc head/sys/powerpc/aim/aim_machdep.c head/sys/powerpc/aim/mmu_oea.c head/sys/powerpc/aim/mmu_oea64.c head/sys/powerpc/booke/pmap.c head/sys/powerpc/include/cpufunc.h head/sys/powerpc/include/mmuvar.h head/sys/powerpc/include/param.h head/sys/powerpc/include/pmap.h head/sys/powerpc/include/proc.h head/sys/powerpc/include/pte.h head/sys/powerpc/include/spr.h head/sys/powerpc/include/sr.h head/sys/powerpc/include/vmparam.h head/sys/powerpc/powerpc/machdep.c head/sys/powerpc/powerpc/mmu_if.m head/sys/powerpc/powerpc/pmap_dispatch.c head/sys/powerpc/powerpc/trap.c head/sys/vm/vm_fault.c Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 (r360886) +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 (r360887) @@ -135,6 +135,7 @@ powerpc/aim/locore.S optional aim no-obj powerpc/aim/aim_machdep.c optional aim powerpc/aim/mmu_oea.c optional aim powerpc powerpc/aim/mmu_oea64.c optional aim +powerpc/aim/mmu_radix.c optional aim powerpc64 powerpc/aim/moea64_if.m optional aim powerpc/aim/moea64_native.c optional aim powerpc/aim/mp_cpudep.c optional aim Modified: head/sys/powerpc/aim/aim_machdep.c ============================================================================== --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 02:33:37 2020 (r360887) @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); struct bat battable[16]; #endif +int radix_mmu = 0; + #ifndef __powerpc64__ /* Bits for running on 64-bit systems in 32-bit mode. */ extern void *testppc64, *testppc64size; @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) * in case the platform module had a better idea of what we * should do. */ - if (cpu_features & PPC_FEATURE_64) + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { + radix_mmu = 0; + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); + if (radix_mmu) + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); + else + pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); + } else if (cpu_features & PPC_FEATURE_64) pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); else pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 02:33:37 2020 (r360887) @@ -322,6 +322,7 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t void moea_scan_init(mmu_t mmu); vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); +boolean_t moea_page_is_mapped(mmu_t mmu, vm_page_t m); static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), /* Internal interfaces */ MMUMETHOD(mmu_bootstrap, moea_bootstrap), @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) { +} + +boolean_t +moea_page_is_mapped(mmu_t mmu, vm_page_t m) +{ + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); } /* Modified: head/sys/powerpc/aim/mmu_oea64.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 (r360886) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 02:33:37 2020 (r360887) @@ -120,8 +120,7 @@ uintptr_t moea64_get_unique_vsid(void); * */ -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) +#define PV_LOCK_COUNT PA_LOCK_COUNT static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; /* @@ -130,8 +129,7 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; * index at (N << 45). */ #ifdef __powerpc64__ -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ - (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) +#define PV_LOCK_IDX(pa) ((pa_index(pa) * (((pa) >> 45) + 1)) % PV_LOCK_COUNT) #else #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) #endif @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size void moea64_scan_init(mmu_t mmu); vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), #ifdef __powerpc64__ MMUMETHOD(mmu_page_array_startup, moea64_page_array_startup), #endif @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) ("moea64_quick_remove_page: invalid address")); mtx_unlock(PCPU_PTR(aim.qmap_lock)); sched_unpin(); +} + +boolean_t +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) +{ + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); } /* Added: head/sys/powerpc/aim/mmu_radix.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 (r360887) @@ -0,0 +1,6507 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Matthew Macy + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include +__FBSDID("$FreeBSD$"); + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef INVARIANTS +#include +#endif + +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) + +#include "opt_ddb.h" +#ifdef DDB +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); +#endif + +#define PG_W RPTE_WIRED +#define PG_V RPTE_VALID +#define PG_MANAGED RPTE_MANAGED +#define PG_PROMOTED RPTE_PROMOTED +#define PG_M RPTE_C +#define PG_A RPTE_R +#define PG_X RPTE_EAA_X +#define PG_RW RPTE_EAA_W +#define PG_PTE_CACHE RPTE_ATTR_MASK + +#define RPTE_SHIFT 9 +#define NLS_MASK ((1UL<<5)-1) +#define RPTE_ENTRIES (1UL<> L3_PAGE_SIZE_SHIFT); +} + +static __inline vm_pindex_t +pmap_pml3e_index(vm_offset_t va) +{ + + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); +} + +static __inline vm_pindex_t +pmap_pml2e_index(vm_offset_t va) +{ + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); +} + +static __inline vm_pindex_t +pmap_pml1e_index(vm_offset_t va) +{ + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); +} + +/* Return various clipped indexes for a given VA */ +static __inline vm_pindex_t +pmap_pte_index(vm_offset_t va) +{ + + return ((va >> PAGE_SHIFT) & RPTE_MASK); +} + +/* Return a pointer to the PT slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) +{ + pt_entry_t *pte; + vm_paddr_t ptepa; + + ptepa = (*l3e & NLB_MASK); + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); + return (&pte[pmap_pte_index(va)]); +} + +/* Return a pointer to the PD slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) +{ + pt_entry_t *l3e; + vm_paddr_t l3pa; + + l3pa = (*l2e & NLB_MASK); + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); + return (&l3e[pmap_pml3e_index(va)]); +} + +/* Return a pointer to the PD slot that corresponds to a VA */ +static __inline pt_entry_t * +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) +{ + pt_entry_t *l2e; + vm_paddr_t l2pa; + + l2pa = (*l1e & NLB_MASK); + + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); + return (&l2e[pmap_pml2e_index(va)]); +} + +static __inline pml1_entry_t * +pmap_pml1e(pmap_t pmap, vm_offset_t va) +{ + + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); +} + +static pt_entry_t * +pmap_pml2e(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l1e; + + l1e = pmap_pml1e(pmap, va); + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l1e_to_l2e(l1e, va)); +} + +static __inline pt_entry_t * +pmap_pml3e(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l2e; + + l2e = pmap_pml2e(pmap, va); + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l2e_to_l3e(l2e, va)); +} + +static __inline pt_entry_t * +pmap_pte(pmap_t pmap, vm_offset_t va) +{ + pt_entry_t *l3e; + + l3e = pmap_pml3e(pmap, va); + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) + return (NULL); + return (pmap_l3e_to_pte(l3e, va)); +} + +int nkpt = 64; +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, + "Number of kernel page table pages allocated on bootup"); + +vm_paddr_t dmaplimit; + +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); + +static int pg_ps_enabled = 1; +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, + &pg_ps_enabled, 0, "Are large page mappings enabled?"); +#ifdef INVARIANTS +#define VERBOSE_PMAP 0 +#define VERBOSE_PROTECT 0 +static int pmap_logging; +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, + &pmap_logging, 0, "verbose debug logging"); +#endif + +static u_int64_t KPTphys; /* phys addr of kernel level 1 */ + +//static vm_paddr_t KERNend; /* phys addr of end of bootstrap data */ + +static vm_offset_t qframe = 0; +static struct mtx qframe_mtx; +static epoch_t pmap_epoch; + +void mmu_radix_activate(mmu_t mmu, struct thread *); +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, vm_ooffset_t, vm_offset_t *, + vm_size_t); +void mmu_radix_clear_modify(mmu_t, vm_page_t); +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, vm_offset_t *); +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, u_int, int8_t); +void mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, + vm_prot_t); +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, vm_offset_t va); +vm_page_t mmu_radix_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); +void mmu_radix_kenter(mmu_t, vm_offset_t, vm_paddr_t); +vm_paddr_t mmu_radix_kextract(mmu_t, vm_offset_t); +void mmu_radix_kremove(mmu_t, vm_offset_t); +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, vm_object_t, + vm_pindex_t, vm_size_t); +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void mmu_radix_page_init(mmu_t, vm_page_t); +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); +void mmu_radix_pinit(mmu_t, pmap_t); +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); +void mmu_radix_qremove(mmu_t, vm_offset_t, int); +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); +void mmu_radix_release(mmu_t, pmap_t); +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); +void mmu_radix_remove_all(mmu_t, vm_page_t); +void mmu_radix_remove_pages(mmu_t, pmap_t); +void mmu_radix_remove_write(mmu_t, vm_page_t); +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); +void mmu_radix_zero_page(mmu_t, vm_page_t); +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); +void mmu_radix_page_array_startup(mmu_t mmu, long pages); + +#include "mmu_oea64.h" +#include "mmu_if.h" +#include "moea64_if.h" + +/* + * Kernel MMU interface + */ + +static void mmu_radix_bootstrap(mmu_t mmup, + vm_offset_t kernelstart, vm_offset_t kernelend); + +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, + vm_page_t *mb, vm_offset_t b_offset, int xfersize); +static void mmu_radix_growkernel(mmu_t, vm_offset_t); +static void mmu_radix_init(mmu_t); +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); +static void mmu_radix_pinit0(mmu_t, pmap_t); + +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, vm_size_t); +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t ma); +static boolean_t mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); +static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, + void **va); +static void mmu_radix_scan_init(mmu_t mmu); +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); + +static mmu_method_t mmu_radix_methods[] = { + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), + MMUMETHOD(mmu_init, mmu_radix_init), + MMUMETHOD(mmu_map, mmu_radix_map), + MMUMETHOD(mmu_mincore, mmu_radix_mincore), + MMUMETHOD(mmu_pinit, mmu_radix_pinit), + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), + + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), + MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), + MMUMETHOD(mmu_protect, mmu_radix_protect), + /* pmap dispatcher interface */ + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), + MMUMETHOD(mmu_copy, mmu_radix_copy), + MMUMETHOD(mmu_enter, mmu_radix_enter), + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), + MMUMETHOD(mmu_extract, mmu_radix_extract), + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), + MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), + MMUMETHOD(mmu_page_init, mmu_radix_page_init), + MMUMETHOD(mmu_page_wired_mappings, mmu_radix_page_wired_mappings), + MMUMETHOD(mmu_qenter, mmu_radix_qenter), + MMUMETHOD(mmu_qremove, mmu_radix_qremove), + MMUMETHOD(mmu_release, mmu_radix_release), + MMUMETHOD(mmu_remove, mmu_radix_remove), + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), + MMUMETHOD(mmu_unwire, mmu_radix_unwire), + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), + MMUMETHOD(mmu_activate, mmu_radix_activate), + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), + MMUMETHOD(mmu_quick_remove_page, mmu_radix_quick_remove_page), + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), + MMUMETHOD(mmu_page_array_startup, mmu_radix_page_array_startup), + + /* Internal interfaces */ + MMUMETHOD(mmu_kenter, mmu_radix_kenter), + MMUMETHOD(mmu_kextract, mmu_radix_kextract), + MMUMETHOD(mmu_kremove, mmu_radix_kremove), + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), + MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), + { 0, 0 } +}; + +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); + +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) + +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, + struct rwlock **lockp); +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, vm_offset_t va); +static int pmap_unuse_pt(pmap_t, vm_offset_t, pml3_entry_t, struct spglist *); +static int pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_offset_t sva, + struct spglist *free, struct rwlock **lockp); +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, + pml3_entry_t ptepde, struct spglist *free, struct rwlock **lockp); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); +static bool pmap_remove_page(pmap_t pmap, vm_offset_t va, pml3_entry_t *pde, + struct spglist *free); +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, + pml3_entry_t *l3e, struct spglist *free, struct rwlock **lockp); + +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t l3e, + u_int flags, struct rwlock **lockp); +#if VM_NRESERVLEVEL > 0 +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, + struct rwlock **lockp); +#endif +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); +static vm_page_t mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool *invalidate); + +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, + vm_prot_t prot, struct rwlock **lockp); +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, + u_int flags, vm_page_t m, struct rwlock **lockp); + +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); +static void free_pv_chunk(struct pv_chunk *pc); +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); +static vm_page_t pmap_allocl3e(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, + struct rwlock **lockp); +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, + struct spglist *free); +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); + +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); +static void pmap_invalidate_all(pmap_t pmap); +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool flush); + +/* + * Internal flags for pmap_enter()'s helper functions. + */ +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ + +#define UNIMPLEMENTED() panic("%s not implemented", __func__) +#define UNTESTED() panic("%s not yet tested", __func__) + + + +/* Number of supported PID bits */ +static unsigned int isa3_pid_bits; + +/* PID to start allocating from */ +static unsigned int isa3_base_pid; + +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) + + +/* + * Map of physical memory regions. + */ +static struct mem_region *regions, *pregions; +static struct numa_mem_region *numa_pregions; +static u_int phys_avail_count; +static int regions_sz, pregions_sz, numa_pregions_sz; +static struct pate *isa3_parttab; +static struct prte *isa3_proctab; +static vmem_t *asid_arena; + +extern void bs_remap_earlyboot(void); + +#define RADIX_PGD_SIZE_SHIFT 16 +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) + +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) + +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) /* number of userland PML1 pages */ +#define NUPDPE (NUPML1E * NL2EPG)/* number of userland PDP pages */ +#define NUPDE (NUPDPE * NL3EPG) /* number of userland PD entries */ + +/* POWER9 only permits a 64k partition table size. */ +#define PARTTAB_SIZE_SHIFT 16 +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) + +#define PARTTAB_HR (1UL << 63) /* host uses radix */ +#define PARTTAB_GR (1UL << 63) /* guest uses radix must match host */ + +/* TLB flush actions. Used as argument to tlbiel_all() */ +enum { + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for current LPID */ + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ +}; + +#define NPV_LIST_LOCKS MAXCPU +static int pmap_initialized; +static vm_paddr_t proctab0pa; +static vm_paddr_t parttab_phys; +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); + +/* + * Data for the pv entry allocation mechanism. + * Updates to pv_invl_gen are protected by the pv_list_locks[] + * elements, but reads are not. + */ +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); +static struct mtx __exclusive_cache_line pv_chunks_mutex; +static struct rwlock __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; +static struct md_page *pv_table; +static struct md_page pv_dummy; + +#ifdef PV_STATS +#define PV_STAT(x) do { x ; } while (0) +#else +#define PV_STAT(x) do { } while (0) +#endif + +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) + +#define PHYS_TO_PV_LIST_LOCK(pa) \ + (&pv_list_locks[pa_radix_index(pa) % NPV_LIST_LOCKS]) + +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ + struct rwlock **_lockp = (lockp); \ + struct rwlock *_new_lock; \ + \ + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ + if (_new_lock != *_lockp) { \ + if (*_lockp != NULL) \ + rw_wunlock(*_lockp); \ + *_lockp = _new_lock; \ + rw_wlock(*_lockp); \ + } \ +} while (0) + +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) + +#define RELEASE_PV_LIST_LOCK(lockp) do { \ + struct rwlock **_lockp = (lockp); \ + \ + if (*_lockp != NULL) { \ + rw_wunlock(*_lockp); \ + *_lockp = NULL; \ + } \ +} while (0) + +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) + +/* + * We support 52 bits, hence: + * bits 52 - 31 = 21, 0b10101 + * RTS encoding details + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long + */ +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) + + +static int powernv_enabled = 1; + +static inline void +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, + uint32_t pid, uint32_t ric, uint32_t prs) +{ + uint64_t rb; + uint64_t rs; + + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); + + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) + : "memory"); +} + +static void +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) +{ + uint32_t set; + + __asm __volatile("ptesync": : :"memory"); + + /* + * Flush the first set of the TLB, and the entire Page Walk Cache + * and partition table entries. Then flush the remaining sets of the + * TLB. + */ + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); + for (set = 1; set < num_sets; set++) + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); + + /* Do the same for process scoped entries. */ + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); + for (set = 1; set < num_sets; set++) + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1); + + __asm __volatile("ptesync": : :"memory"); +} + +static void +mmu_radix_tlbiel_flush(int scope) +{ + int is; + + MPASS(scope == TLB_INVAL_SCOPE_LPID || + scope == TLB_INVAL_SCOPE_GLOBAL); + is = scope + 2; + + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); +} + +static void +mmu_radix_init_amor(void) +{ + /* + * In HV mode, we init AMOR (Authority Mask Override Register) so that + * the hypervisor and guest can setup IAMR (Instruction Authority Mask + * Register), enable key 0 and set it to 1. + * + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) + */ + mtspr(SPR_AMOR, (3ul << 62)); +} + +static void +mmu_radix_init_iamr(void) +{ + /* + * Radix always uses key0 of the IAMR to determine if an access is + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent instruction + * fetch. + */ + mtspr(SPR_IAMR, (1ul << 62)); +} + +static void +mmu_radix_pid_set(pmap_t pmap) +{ + + mtspr(SPR_PID, pmap->pm_pid); + isync(); +} + +/* Quick sort callout for comparing physical addresses. */ +static int +pa_cmp(const void *a, const void *b) +{ + const vm_paddr_t *pa = a, *pb = b; + + if (*pa < *pb) + return (-1); + else if (*pa > *pb) + return (1); + else + return (0); +} + +#define pte_load_store(ptep, pte) atomic_swap_long(ptep, pte) +#define pte_load_clear(ptep) atomic_swap_long(ptep, 0) +#define pte_store(ptep, pte) do { \ + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ +} while (0) +/* + * NB: should only be used for adding directories - not for direct mappings + */ +#define pde_store(ptep, pa) do { \ + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ +} while (0) + +#define pte_clear(ptep) do { \ + *(u_long *)(ptep) = (u_long)(0); \ +} while (0) + +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ + +/* + * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB + * (PTE) page mappings have identical settings for the following fields: + */ +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | PG_PTE_CACHE | \ + PG_M | PG_A | RPTE_EAA_MASK | PG_V) + + +static void +pmap_epoch_init(void *arg __unused) +{ + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); +} +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); + +static bool +pmap_not_in_di(void) +{ + + return (curthread->td_md.md_invl_gen.gen == 0); +} + +#define PMAP_ASSERT_NOT_IN_DI() \ + KASSERT(pmap_not_in_di(), ("DI already started")) + +static void +pmap_delayed_invl_started(epoch_tracker_t et) +{ + epoch_enter_preempt(pmap_epoch, et); + curthread->td_md.md_invl_gen.gen = 1; +} + +static void +pmap_delayed_invl_finished(epoch_tracker_t et) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 11 05:53:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E00E2D71FB; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@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 49L98T3JSTz46Yg; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6CA9A19D36; Mon, 11 May 2020 05:53:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B5rDUf057601; Mon, 11 May 2020 05:53:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B5rDq8057599; Mon, 11 May 2020 05:53:13 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005110553.04B5rDq8057599@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 11 May 2020 05:53:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360888 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 360888 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 05:53:13 -0000 Author: adrian Date: Mon May 11 05:53:12 2020 New Revision: 360888 URL: https://svnweb.freebsd.org/changeset/base/360888 Log: [ar9300] Disable unconditionally reducing transmit power in the case of FCC. Ok, yeah, the commit title is a bit misleading. This has to do with CDD (cyclic delay diversity) - how this and later wifi hardware transmits lower rates over more antennas. Eg, if you're transmitting legacy 11abg rates on 2 or 3 antennas, you COULD just send them all at the same time or you could delay each by tens/hundreds of nanoseconds to try and get some better diversity characteristics. However, this has a fun side effect - the antenna pattern is no longer a bunch of interacting dipoles, but are a bunch of interacting dipoles plus a bunch of changing phases. And it's frequency dependent - 50-200nS is not exactly the same fraction of a wavelength across all of 2GHz or 5GHz! Thus the power spectral density and maximum directional gain that you're effectively getting is not .. well, as flat as it once was. For more information, look up FCC/OET 13TR1003 in the FCC technical report database. It has pretty graphics and everything. Anyway, the problem lies thusly - the CDD code just subtracts another 3dB or 5dB for the lower rates based on transmit antenna configuration. However, it's not done based on operating configuration and it doesn't take into account how far from any regulatory limits the hardware is at. It also doesn't let us do things like transmit legacy rates and frames on a single antenna without losing up to 5dB when we absolutely don't need to in that case (there's no CDD used when one antenna is used!) This shows up as the hardware behaving even worse for longer distance links at 20MHz because, well, those are the exact rates losing a bunch more transmit power. * For lower power NICs (ie the majority of what is out there!) it's highly unlikely we're going to hit anywhere near the PSD limits. * It's doing it based on the existing limits from the CTL table (conformance testing limits) - this isn't the regulatory max! It's what the NIC is allowed to put out in each frequency and rate configuration! So things like band edges, power amplifier behaviour and maximum current draw apply here. Blindly subtracting 3 to 5dB from /this/ value is /very/ conservative.. * /and/ ath9k just plainly doesn't do any of this at all. So, for now disable it and get the TX power back, thus matching what ath9k in Linux is doing. If/once I get some more cycles I'll look at making it a bit more adaptive and really only kick in if we're a few dB away from hard regulatory limits. Tested: * AR9344 (2GHz + SoC, 2x2 configuration) - AP and STA modes * QCA9580 (5GHz 2x2 and 3x3 configurations) - AP and STA modes Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Mon May 11 02:33:37 2020 (r360887) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_eeprom.c Mon May 11 05:53:12 2020 (r360888) @@ -3040,6 +3040,33 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, ahp->reg_dmn = ath_hal_getctl(ah, chan); /* + * After reading FCC/OET 13TR1003 (Directional Gain of IEEE 802.11 + * MIMO devices employing cyclic delay diversity) and looking at what + * ath9k does, let's disable the CDD check until it's clearer exactly + * how the maximum cap should be applied here. + * + * Right now the CDD check is simply unconditionally reducing the + * gain of legacy and 1/2 stream rates depending upon the chainmask. + * (CDD is used when transmitting rates that don't already use up the + * full set of streams - eg OFDM or MCS0-7 on a 2 or 3 chain TX path.) + * + * It's dropping the 2-chain TX by 3dB and 3-chain by 5dB to "meet" + * power spectral density requirements but it's not currently taking + * into account how close to the regulatory limit the hardware/antenna + * system is already at. It doesn't help that the conductive testing + * limits have the array gain at 0dB for all AR9300/derivative + * configurations. + * + * It also doesn't let us do single chain transmit at the full allowed + * power for the regulatory/CTL limits as it subtracts it from what's + * programmed into the hardware. + * + * ath9k doesn't factor any of the CDD stuff into account, so I'm going + * to disable it here and in the TPC path until I get a better idea + * of what to really do here. + */ +#if 0 + /* * Always use CDD/direct per rate power table for register based approach. * For FCC, CDD calculations should factor in the array gain, hence * this adjust call. ETSI and MKK does not have this requirement. @@ -3050,6 +3077,7 @@ ar9300_eeprom_set_transmit_power(struct ath_hal *ah, __func__); ar9300_adjust_reg_txpower_cdd(ah, target_power_val_t2); } +#endif if (ar9300_eeprom_get(ahp, EEP_PAPRD_ENABLED)) { for (i = 0; i < ar9300_rate_size; i++) { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Mon May 11 02:33:37 2020 (r360887) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_phy.c Mon May 11 05:53:12 2020 (r360888) @@ -55,10 +55,12 @@ static inline void ar9300_init_rate_txpower_stbc(struc const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, int rt_ss_offset, int rt_ds_offset, int rt_ts_offset, u_int8_t chainmask); +#endif #define AR9300_11A_RT_OFDM_OFFSET 0 HAL_RATE_TABLE ar9300_11a_table = { @@ -442,6 +444,8 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_2TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[1] + twice_array_gain; + + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 2 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -471,6 +475,7 @@ ar9300_adjust_reg_txpower_cdd(struct ath_hal *ah, ((int16_t)AH_MIN((ahp->twice_antenna_reduction - (ahp->twice_antenna_gain + AR9300_TXBF_3TX_ARRAY_GAIN)), 0)); cdd_power = ahp->upper_limit[2] + twice_array_gain; + HALDEBUG(ah, HAL_DEBUG_CALIBRATE, "%s: 3 chain; cdd_power=%d", __func__, cdd_power); /* Adjust OFDM legacy rates as well */ for (i = ALL_TARGET_LEGACY_6_24; i <= ALL_TARGET_LEGACY_54; i++) { if (power_per_rate[i] > cdd_power) { @@ -531,6 +536,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_SS_OFFSET, AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain has to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -538,6 +544,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NA_RT_HT_DS_OFFSET, AR9300_11NA_RT_HT_TS_OFFSET, chainmask); } +#endif break; case HAL_MODE_11G: ar9300_init_rate_txpower_cck(ah, rt, power_per_rate, chainmask); @@ -561,6 +568,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_SS_OFFSET, AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); +#if 0 /* For FCC the array gain needs to be factored for CDD mode */ if (is_reg_dmn_fcc(ath_hal_getctl(ah, chan))) { ar9300_adjust_rate_txpower_cdd(ah, rt, is40, @@ -568,6 +576,7 @@ ar9300_init_rate_txpower(struct ath_hal *ah, u_int mod AR9300_11NG_RT_HT_DS_OFFSET, AR9300_11NG_RT_HT_TS_OFFSET, chainmask); } +#endif break; default: HALDEBUG(ah, HAL_DEBUG_POWER_MGMT, "%s: invalid mode 0x%x\n", @@ -941,6 +950,10 @@ ar9300_init_rate_txpower_stbc(struct ath_hal *ah, cons return; } +/* + * To see why this is disabled, look at ar9300_eeprom.c for FCC/OET 13TR1003. + */ +#if 0 static inline void ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, const HAL_RATE_TABLE *rt, HAL_BOOL is40, @@ -1037,6 +1050,7 @@ ar9300_adjust_rate_txpower_cdd(struct ath_hal *ah, con return; } +#endif void ar9300_disp_tpc_tables(struct ath_hal *ah) { From owner-svn-src-all@freebsd.org Mon May 11 06:09:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6176B2D7648; Mon, 11 May 2020 06:09:19 +0000 (UTC) (envelope-from melifaro@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 49L9W31z4cz47F8; Mon, 11 May 2020 06:09:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3EEF219F1F; Mon, 11 May 2020 06:09:19 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B69JKj064143; Mon, 11 May 2020 06:09:19 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B69IQ5064141; Mon, 11 May 2020 06:09:18 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005110609.04B69IQ5064141@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 May 2020 06:09:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360889 - in head/sys/net: . route X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: in head/sys/net: . route X-SVN-Commit-Revision: 360889 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 06:09:19 -0000 Author: melifaro Date: Mon May 11 06:09:18 2020 New Revision: 360889 URL: https://svnweb.freebsd.org/changeset/base/360889 Log: Remove unused rnh_close callback from rtable & cleanup depends. rnh_close callbackes was used by the in[6]_clsroute() handlers, doing cleanup in the route cloning code. Route cloning was eliminated somewhere around r186119. Last callback user was eliminated in r186215, 11 years ago. Differential Revision: https://reviews.freebsd.org/D24793 Modified: head/sys/net/route.c head/sys/net/route/route_var.h Modified: head/sys/net/route.c ============================================================================== --- head/sys/net/route.c Mon May 11 05:53:12 2020 (r360888) +++ head/sys/net/route.c Mon May 11 06:09:18 2020 (r360889) @@ -426,11 +426,8 @@ sys_setfib(struct thread *td, struct setfib_args *uap) void rtfree(struct rtentry *rt) { - struct rib_head *rnh; KASSERT(rt != NULL,("%s: NULL rt", __func__)); - rnh = rt_tables_get_rnh(rt->rt_fibnum, rt_key(rt)->sa_family); - KASSERT(rnh != NULL,("%s: NULL rnh", __func__)); RT_LOCK_ASSERT(rt); @@ -445,18 +442,6 @@ rtfree(struct rtentry *rt) } /* - * On last reference give the "close method" a chance - * to cleanup private state. This also permits (for - * IPv4 and IPv6) a chance to decide if the routing table - * entry should be purged immediately or at a later time. - * When an immediate purge is to happen the close routine - * typically calls rtexpunge which clears the RTF_UP flag - * on the entry so that the code below reclaims the storage. - */ - if (rt->rt_refcnt == 0 && rnh->rnh_close) - rnh->rnh_close((struct radix_node *)rt, &rnh->head); - - /* * If we are no longer "up" (and ref == 0) * then we can free the resources associated * with the route. @@ -1501,7 +1486,6 @@ add_route(struct rib_head *rnh, struct rt_addrinfo *in return (ENOBUFS); } rt->rt_flags = RTF_UP | flags; - rt->rt_fibnum = rnh->rib_fibnum; rt->rt_nhop = nh; /* Fill in dst */ Modified: head/sys/net/route/route_var.h ============================================================================== --- head/sys/net/route/route_var.h Mon May 11 05:53:12 2020 (r360888) +++ head/sys/net/route/route_var.h Mon May 11 06:09:18 2020 (r360889) @@ -50,7 +50,6 @@ struct rib_head { rn_lookup_f_t *rnh_lookup; /* exact match for sockaddr */ rn_walktree_t *rnh_walktree; /* traverse tree */ rn_walktree_from_t *rnh_walktree_from; /* traverse tree below a */ - rn_close_t *rnh_close; /*do something when the last ref drops*/ rnh_preadd_entry_f_t *rnh_preadd; /* hook to alter record prior to insertion */ rt_gen_t rnh_gen; /* generation counter */ int rnh_multipath; /* multipath capable ? */ @@ -144,7 +143,6 @@ struct rtentry { int rt_flags; /* up/down?, host/net */ int rt_refcnt; /* # held references */ - u_int rt_fibnum; /* which FIB */ u_long rt_weight; /* absolute weight */ u_long rt_expire; /* lifetime for route, e.g. redirect */ #define rt_endzero rt_mtx From owner-svn-src-all@freebsd.org Mon May 11 06:59:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB7E32D940B; Mon, 11 May 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LBcP4XFmz49Hc; Mon, 11 May 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96D811A899; Mon, 11 May 2020 06:59:01 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B6x1Bf095285; Mon, 11 May 2020 06:59:01 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B6x1p8095284; Mon, 11 May 2020 06:59:01 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005110659.04B6x1p8095284@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 11 May 2020 06:59: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: r360890 - stable/12/stand/libsa/zfs X-SVN-Group: stable-12 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/12/stand/libsa/zfs X-SVN-Commit-Revision: 360890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 06:59:01 -0000 Author: tsoome Date: Mon May 11 06:59:01 2020 New Revision: 360890 URL: https://svnweb.freebsd.org/changeset/base/360890 Log: MFC r360836: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. Modified: stable/12/stand/libsa/zfs/zfs.c Directory Properties: stable/12/ (props changed) Modified: stable/12/stand/libsa/zfs/zfs.c ============================================================================== --- stable/12/stand/libsa/zfs/zfs.c Mon May 11 06:09:18 2020 (r360889) +++ stable/12/stand/libsa/zfs/zfs.c Mon May 11 06:59:01 2020 (r360890) @@ -417,7 +417,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -441,14 +441,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* + * Full data return from read sectors. + * Note, there is still corner case where we read + * from sector boundary, but less than sector size, e.g. reading 512B + * from 4k sector. + */ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ From owner-svn-src-all@freebsd.org Mon May 11 07:01:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 92ED32D965C; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LBft3RRSz49TZ; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 713701A8E2; Mon, 11 May 2020 07:01:10 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B71A8X096240; Mon, 11 May 2020 07:01:10 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B71ATl096239; Mon, 11 May 2020 07:01:10 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <202005110701.04B71ATl096239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Mon, 11 May 2020 07:01: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: r360891 - stable/11/stand/libsa/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: tsoome X-SVN-Commit-Paths: stable/11/stand/libsa/zfs X-SVN-Commit-Revision: 360891 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 07:01:10 -0000 Author: tsoome Date: Mon May 11 07:01:10 2020 New Revision: 360891 URL: https://svnweb.freebsd.org/changeset/base/360891 Log: MFC r360836: loader: vdev_read() can corrupt memory When reading less than sector size but from sector boundary, the vdev_read() will read full sector into the provided buffer and therefore corrupting memory past buffer end. Modified: stable/11/stand/libsa/zfs/zfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/libsa/zfs/zfs.c ============================================================================== --- stable/11/stand/libsa/zfs/zfs.c Mon May 11 06:59:01 2020 (r360890) +++ stable/11/stand/libsa/zfs/zfs.c Mon May 11 07:01:10 2020 (r360891) @@ -417,7 +417,7 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void full_sec_size -= secsz; /* Return of partial sector data requires a bounce buffer. */ - if ((head > 0) || do_tail_read) { + if ((head > 0) || do_tail_read || bytes < secsz) { bouncebuf = zfs_alloc(secsz); if (bouncebuf == NULL) { printf("vdev_read: out of memory\n"); @@ -441,14 +441,28 @@ vdev_read(vdev_t *vdev, void *priv, off_t offset, void outbuf += min(secsz - head, bytes); } - /* Full data return from read sectors */ + /* + * Full data return from read sectors. + * Note, there is still corner case where we read + * from sector boundary, but less than sector size, e.g. reading 512B + * from 4k sector. + */ if (full_sec_size > 0) { - res = read(fd, outbuf, full_sec_size); - if (res != full_sec_size) { - ret = EIO; - goto error; + if (bytes < full_sec_size) { + res = read(fd, bouncebuf, secsz); + if (res != secsz) { + ret = EIO; + goto error; + } + memcpy(outbuf, bouncebuf, bytes); + } else { + res = read(fd, outbuf, full_sec_size); + if (res != full_sec_size) { + ret = EIO; + goto error; + } + outbuf += full_sec_size; } - outbuf += full_sec_size; } /* Partial data return from last sector */ From owner-svn-src-all@freebsd.org Mon May 11 07:20:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19EC82D9A30; Mon, 11 May 2020 07:20:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LC5K6vTgz4BTn; Mon, 11 May 2020 07:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E83521AC50; Mon, 11 May 2020 07:20:37 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B7Kb5G007994; Mon, 11 May 2020 07:20:37 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B7KbvL007993; Mon, 11 May 2020 07:20:37 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005110720.04B7KbvL007993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 11 May 2020 07:20: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: r360892 - stable/12/sbin/swapon X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/sbin/swapon X-SVN-Commit-Revision: 360892 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 07:20:38 -0000 Author: delphij Date: Mon May 11 07:20:37 2020 New Revision: 360892 URL: https://svnweb.freebsd.org/changeset/base/360892 Log: MFC r360619: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. Modified: stable/12/sbin/swapon/swapon.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/swapon/swapon.c ============================================================================== --- stable/12/sbin/swapon/swapon.c Mon May 11 07:01:10 2020 (r360891) +++ stable/12/sbin/swapon/swapon.c Mon May 11 07:20:37 2020 (r360892) @@ -548,8 +548,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, &p, 10); if (errno == 0) { @@ -604,14 +603,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\0'; From owner-svn-src-all@freebsd.org Mon May 11 07:21:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4AB62D9AB7; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LC6v4N3Gz4BpG; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 915C21ACD5; Mon, 11 May 2020 07:21:59 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B7LxTa012955; Mon, 11 May 2020 07:21:59 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B7LxMZ012954; Mon, 11 May 2020 07:21:59 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005110721.04B7LxMZ012954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 11 May 2020 07:21:59 +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: r360893 - stable/11/sbin/swapon X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/sbin/swapon X-SVN-Commit-Revision: 360893 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 07:21:59 -0000 Author: delphij Date: Mon May 11 07:21:59 2020 New Revision: 360893 URL: https://svnweb.freebsd.org/changeset/base/360893 Log: MFC r360619: - Fix logic error in swapoff case: follow same handling of p and linelen in the swapon case. - Use strlcpy instead of strncpy. Modified: stable/11/sbin/swapon/swapon.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/swapon/swapon.c ============================================================================== --- stable/11/sbin/swapon/swapon.c Mon May 11 07:20:37 2020 (r360892) +++ stable/11/sbin/swapon/swapon.c Mon May 11 07:21:59 2020 (r360893) @@ -527,8 +527,7 @@ swap_on_off_md(const char *name, char *mntops, int doi ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); errno = 0; ul = strtoul(linebuf, &p, 10); if (errno == 0) { @@ -583,14 +582,13 @@ swap_on_off_md(const char *name, char *mntops, int doi goto err; } p = fgetln(sfd, &linelen); - if (p == NULL && - (linelen < 2 || linelen > sizeof(linebuf) - 1)) { + if (p == NULL || + (linelen < 2 || linelen > sizeof(linebuf))) { warn("mdconfig (list) unexpected output"); ret = NULL; goto err; } - strncpy(linebuf, p, linelen); - linebuf[linelen - 1] = '\0'; + strlcpy(linebuf, p, linelen); p = strchr(linebuf, ' '); if (p != NULL) *p = '\0'; From owner-svn-src-all@freebsd.org Mon May 11 08:40:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75D4D2DB2CE; Mon, 11 May 2020 08:40:34 +0000 (UTC) (envelope-from arichardson@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 49LDsZ2Z6nz4GRl; Mon, 11 May 2020 08:40:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 538191BB77; Mon, 11 May 2020 08:40:34 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04B8eYv3057167; Mon, 11 May 2020 08:40:34 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04B8eXHF057165; Mon, 11 May 2020 08:40:33 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202005110840.04B8eXHF057165@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Mon, 11 May 2020 08:40:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360894 - in head/stand/i386: boot2 pxeldr zfsboot X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: in head/stand/i386: boot2 pxeldr zfsboot X-SVN-Commit-Revision: 360894 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 08:40:34 -0000 Author: arichardson Date: Mon May 11 08:40:33 2020 New Revision: 360894 URL: https://svnweb.freebsd.org/changeset/base/360894 Log: Avoid using non-portable dd conv=osync option The same thing can be achieved using the bs=$SIZE and conv=sync options. Unlike conv=osync, conv=sync is support on both Linux and macOS. Reviewed By: imp, jhb (earlier version) Obtained from: CheriBSD Differential Revision: https://reviews.freebsd.org/D24788 Modified: head/stand/i386/boot2/Makefile head/stand/i386/pxeldr/Makefile head/stand/i386/zfsboot/Makefile Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/boot2/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -66,7 +66,7 @@ BOOT2SIZE= 7680 boot2: boot2.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync boot2.ld: boot2.ldr boot2.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l boot2.ldr \ Modified: head/stand/i386/pxeldr/Makefile ============================================================================== --- head/stand/i386/pxeldr/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/pxeldr/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -31,7 +31,7 @@ CLEANFILES+= ${BOOT}.tmp ${BOOT}: ${LDR} ${LOADER} cat ${LDR} ${LOADER} > ${.TARGET}.tmp - ${DD} if=${.TARGET}.tmp of=${.TARGET} obs=2k conv=osync + ${DD} if=${.TARGET}.tmp of=${.TARGET} bs=2048 conv=sync rm ${.TARGET}.tmp LDFLAGS+=${LDFLAGS_BIN} Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Mon May 11 07:21:59 2020 (r360893) +++ head/stand/i386/zfsboot/Makefile Mon May 11 08:40:33 2020 (r360894) @@ -62,7 +62,7 @@ BOOT2SIZE= 262144 zfsboot2: zfsboot.ld @set -- `ls -l ${.ALLSRC}`; x=$$((${BOOT2SIZE}-$$5)); \ echo "$$x bytes available"; test $$x -ge 0 - ${DD} if=${.ALLSRC} of=${.TARGET} obs=${BOOT2SIZE} conv=osync + ${DD} if=${.ALLSRC} of=${.TARGET} bs=${BOOT2SIZE} conv=sync zfsboot.ld: zfsboot.ldr zfsboot.bin ${BTXKERN} btxld -v -E ${ORG2} -f bin -b ${BTXKERN} -l zfsboot.ldr \ From owner-svn-src-all@freebsd.org Mon May 11 15:17:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF0782E3C5F; Mon, 11 May 2020 15:17:57 +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 49LPh5485hz4g8k; Mon, 11 May 2020 15:17:57 +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 852042066B; Mon, 11 May 2020 15:17:57 +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 04BFHveW006133; Mon, 11 May 2020 15:17:57 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFHvoi006132; Mon, 11 May 2020 15:17:57 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111517.04BFHvoi006132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 15:17: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: r360895 - 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: 360895 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:17:57 -0000 Author: markj Date: Mon May 11 15:17:57 2020 New Revision: 360895 URL: https://svnweb.freebsd.org/changeset/base/360895 Log: MFC r360378: Avoid returning POLLIN if the pipe descriptor is not open for reading. Modified: stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Mon May 11 08:40:33 2020 (r360894) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:17:57 2020 (r360895) @@ -1432,7 +1432,8 @@ pipe_poll(struct file *fp, int events, struct ucred *a if ((events & POLLINIGNEOF) == 0) { if (rpipe->pipe_state & PIPE_EOF) { - revents |= (events & (POLLIN | POLLRDNORM)); + if (fp->f_flag & FREAD) + revents |= (events & (POLLIN | POLLRDNORM)); if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) revents |= POLLHUP; From owner-svn-src-all@freebsd.org Mon May 11 15:20:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 650472E3D33; Mon, 11 May 2020 15:20:06 +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 49LPkZ1y19z4gK0; Mon, 11 May 2020 15:20: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 3E4D62067D; Mon, 11 May 2020 15:20: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 04BFK6wD006812; Mon, 11 May 2020 15:20:06 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFK5fR006809; Mon, 11 May 2020 15:20:05 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111520.04BFK5fR006809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 15:20: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: r360896 - in stable/12/sys: fs/fifofs kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/sys: fs/fifofs kern X-SVN-Commit-Revision: 360896 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:20:06 -0000 Author: markj Date: Mon May 11 15:20:05 2020 New Revision: 360896 URL: https://svnweb.freebsd.org/changeset/base/360896 Log: MFC r360379: Call pipeselwakeup() after toggling PIPE_EOF. Modified: stable/12/sys/fs/fifofs/fifo_vnops.c stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/fs/fifofs/fifo_vnops.c ============================================================================== --- stable/12/sys/fs/fifofs/fifo_vnops.c Mon May 11 15:17:57 2020 (r360895) +++ stable/12/sys/fs/fifofs/fifo_vnops.c Mon May 11 15:20:05 2020 (r360896) @@ -173,8 +173,10 @@ fifo_open(ap) fip->fi_rgen++; if (fip->fi_readers == 1) { fpipe->pipe_state &= ~PIPE_EOF; - if (fip->fi_writers > 0) + if (fip->fi_writers > 0) { wakeup(&fip->fi_writers); + pipeselwakeup(fpipe); + } } fp->f_pipegen = fpipe->pipe_wgen - fip->fi_writers; } @@ -189,8 +191,10 @@ fifo_open(ap) fip->fi_wgen++; if (fip->fi_writers == 1) { fpipe->pipe_state &= ~PIPE_EOF; - if (fip->fi_readers > 0) + if (fip->fi_readers > 0) { wakeup(&fip->fi_readers); + pipeselwakeup(fpipe); + } } } if ((ap->a_mode & O_NONBLOCK) == 0) { @@ -209,6 +213,7 @@ fifo_open(ap) fpipe->pipe_state |= PIPE_EOF; if (fpipe->pipe_state & PIPE_WANTW) wakeup(fpipe); + pipeselwakeup(fpipe); PIPE_UNLOCK(fpipe); fifo_cleanup(vp); } @@ -237,6 +242,7 @@ fifo_open(ap) if (fpipe->pipe_state & PIPE_WANTR) wakeup(fpipe); fpipe->pipe_wgen++; + pipeselwakeup(fpipe); PIPE_UNLOCK(fpipe); fifo_cleanup(vp); } Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Mon May 11 15:17:57 2020 (r360895) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:05 2020 (r360896) @@ -1608,8 +1608,6 @@ pipeclose(struct pipe *cpipe) pipelock(cpipe, 0); pp = cpipe->pipe_pair; - pipeselwakeup(cpipe); - /* * If the other side is blocked, wake it up saying that * we want to close it down. @@ -1623,17 +1621,16 @@ pipeclose(struct pipe *cpipe) pipelock(cpipe, 0); } + pipeselwakeup(cpipe); /* * Disconnect from peer, if any. */ ppipe = cpipe->pipe_peer; if (ppipe->pipe_present == PIPE_ACTIVE) { - pipeselwakeup(ppipe); - ppipe->pipe_state |= PIPE_EOF; wakeup(ppipe); - KNOTE_LOCKED(&ppipe->pipe_sel.si_note, 0); + pipeselwakeup(ppipe); } /* From owner-svn-src-all@freebsd.org Mon May 11 15:20:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2F33B2E3DBE; Mon, 11 May 2020 15:20:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LPlF0NYFz3Brc; Mon, 11 May 2020 15:20:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0786120794; Mon, 11 May 2020 15:20:41 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFKe9Q007017; Mon, 11 May 2020 15:20:40 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFKemo007013; Mon, 11 May 2020 15:20:40 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111520.04BFKemo007013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 15:20: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: r360897 - in stable/12: lib/libc/sys sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: lib/libc/sys sys/kern X-SVN-Commit-Revision: 360897 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:20:41 -0000 Author: markj Date: Mon May 11 15:20:40 2020 New Revision: 360897 URL: https://svnweb.freebsd.org/changeset/base/360897 Log: MFC r360380: Fix handling of EV_EOF for named pipes. PR: 203366, 224615, 246350 Modified: stable/12/lib/libc/sys/kqueue.2 stable/12/sys/kern/sys_pipe.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/sys/kqueue.2 ============================================================================== --- stable/12/lib/libc/sys/kqueue.2 Mon May 11 15:20:05 2020 (r360896) +++ stable/12/lib/libc/sys/kqueue.2 Mon May 11 15:20:40 2020 (r360897) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 21, 2020 +.Dd April 27, 2020 .Dt KQUEUE 2 .Os .Sh NAME @@ -323,8 +323,7 @@ When the last writer disconnects, the filter will set .Dv EV_EOF in .Va flags . -This may be cleared by passing in -.Dv EV_CLEAR , +This will be cleared by the filter when a new writer connects, at which point the filter will resume waiting for data to become available before returning. @@ -343,9 +342,10 @@ For sockets, pipes and fifos, .Va data will contain the amount of space remaining in the write buffer. -The filter will set EV_EOF when the reader disconnects, and for -the fifo case, this may be cleared by use of -.Dv EV_CLEAR . +The filter will set +.Dv EV_EOF +when the reader disconnects, and for the fifo case, this will be cleared +when a new reader connects. Note that this filter is not supported for vnodes or BPF devices. .Pp For sockets, the low water mark and socket error handling is Modified: stable/12/sys/kern/sys_pipe.c ============================================================================== --- stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:05 2020 (r360896) +++ stable/12/sys/kern/sys_pipe.c Mon May 11 15:20:40 2020 (r360897) @@ -826,7 +826,12 @@ unlocked_error: } } - if ((rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt) >= PIPE_BUF) + /* + * Only wake up writers if there was actually something read. + * Otherwise, when calling read(2) at EOF, a spurious wakeup occurs. + */ + if (nread > 0 && + rpipe->pipe_buffer.size - rpipe->pipe_buffer.cnt >= PIPE_BUF) pipeselwakeup(rpipe); PIPE_UNLOCK(rpipe); @@ -1728,48 +1733,54 @@ filt_pipedetach(struct knote *kn) static int filt_piperead(struct knote *kn, long hint) { + struct file *fp = kn->kn_fp; struct pipe *rpipe = kn->kn_hook; - struct pipe *wpipe = rpipe->pipe_peer; - int ret; PIPE_LOCK_ASSERT(rpipe, MA_OWNED); kn->kn_data = rpipe->pipe_buffer.cnt; if (kn->kn_data == 0) kn->kn_data = rpipe->pipe_map.cnt; - if ((rpipe->pipe_state & PIPE_EOF) || - wpipe->pipe_present != PIPE_ACTIVE || - (wpipe->pipe_state & PIPE_EOF)) { + if ((rpipe->pipe_state & PIPE_EOF) != 0 && + ((rpipe->pipe_state & PIPE_NAMED) == 0 || + fp->f_pipegen != rpipe->pipe_wgen)) { kn->kn_flags |= EV_EOF; return (1); } - ret = kn->kn_data > 0; - return ret; + kn->kn_flags &= ~EV_EOF; + return (kn->kn_data > 0); } /*ARGSUSED*/ static int filt_pipewrite(struct knote *kn, long hint) { - struct pipe *wpipe; + struct pipe *wpipe = kn->kn_hook; /* * If this end of the pipe is closed, the knote was removed from the * knlist and the list lock (i.e., the pipe lock) is therefore not held. */ - wpipe = kn->kn_hook; + if (wpipe->pipe_present == PIPE_ACTIVE || + (wpipe->pipe_state & PIPE_NAMED) != 0) { + PIPE_LOCK_ASSERT(wpipe, MA_OWNED); + + if (wpipe->pipe_state & PIPE_DIRECTW) { + kn->kn_data = 0; + } else if (wpipe->pipe_buffer.size > 0) { + kn->kn_data = wpipe->pipe_buffer.size - + wpipe->pipe_buffer.cnt; + } else { + kn->kn_data = PIPE_BUF; + } + } + if (wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { - kn->kn_data = 0; kn->kn_flags |= EV_EOF; return (1); } - PIPE_LOCK_ASSERT(wpipe, MA_OWNED); - kn->kn_data = (wpipe->pipe_buffer.size > 0) ? - (wpipe->pipe_buffer.size - wpipe->pipe_buffer.cnt) : PIPE_BUF; - if (wpipe->pipe_state & PIPE_DIRECTW) - kn->kn_data = 0; - + kn->kn_flags &= ~EV_EOF; return (kn->kn_data >= PIPE_BUF); } From owner-svn-src-all@freebsd.org Mon May 11 15:21:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 051502E3E4E; Mon, 11 May 2020 15:21:05 +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 49LPlh6l9dz3C44; Mon, 11 May 2020 15:21:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E26BE207CF; Mon, 11 May 2020 15:21:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFL4d7008198; Mon, 11 May 2020 15:21:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFL4r9008191; Mon, 11 May 2020 15:21:04 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111521.04BFL4r9008191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 15:21: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: r360898 - in stable/12/tests/sys: fifo kern/pipe X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12/tests/sys: fifo kern/pipe X-SVN-Commit-Revision: 360898 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:21:05 -0000 Author: markj Date: Mon May 11 15:21:03 2020 New Revision: 360898 URL: https://svnweb.freebsd.org/changeset/base/360898 Log: MFC r360381: Add some regression tests for read and write kevents on pipes. Added: stable/12/tests/sys/fifo/fifo_kqueue.c - copied unchanged from r360381, head/tests/sys/fifo/fifo_kqueue.c stable/12/tests/sys/kern/pipe/pipe_kqueue_test.c - copied unchanged from r360381, head/tests/sys/kern/pipe/pipe_kqueue_test.c Modified: stable/12/tests/sys/fifo/Makefile stable/12/tests/sys/kern/pipe/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/tests/sys/fifo/Makefile ============================================================================== --- stable/12/tests/sys/fifo/Makefile Mon May 11 15:20:40 2020 (r360897) +++ stable/12/tests/sys/fifo/Makefile Mon May 11 15:21:03 2020 (r360898) @@ -4,6 +4,7 @@ TESTSDIR= ${TESTSBASE}/sys/fifo PLAIN_TESTS_C+= fifo_create PLAIN_TESTS_C+= fifo_io +ATF_TESTS_C+= fifo_kqueue PLAIN_TESTS_C+= fifo_misc PLAIN_TESTS_C+= fifo_open Copied: stable/12/tests/sys/fifo/fifo_kqueue.c (from r360381, head/tests/sys/fifo/fifo_kqueue.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/fifo/fifo_kqueue.c Mon May 11 15:21:03 2020 (r360898, copy of r360381, head/tests/sys/fifo/fifo_kqueue.c) @@ -0,0 +1,430 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jan Kokemüller + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__writes); +ATF_TC_BODY(fifo_kqueue__writes, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0); + EV_SET(&kev[1], p[1], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + + ATF_REQUIRE(kevent(kq, kev, 2, NULL, 0, NULL) == 0); + + /* A new writer should immediately get a EVFILT_WRITE event. */ + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 16384); + ATF_REQUIRE(kev[0].udata == 0); + + /* Filling up the pipe should make the EVFILT_WRITE disappear. */ + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading (PIPE_BUF - 1) bytes will not trigger a EVFILT_WRITE yet. */ + + for (int i = 0; i < PIPE_BUF - 1; ++i) { + ATF_REQUIRE(read(p[0], &c, 1) == 1); + } + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading one additional byte triggers the EVFILT_WRITE. */ + + ATF_REQUIRE(read(p[0], &c, 1) == 1); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF); + ATF_REQUIRE(kev[0].udata == 0); + + /* + * Reading another byte triggers the EVFILT_WRITE again with a changed + * 'data' field. + */ + + ATF_REQUIRE(read(p[0], &c, 1) == 1); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF + 1); + ATF_REQUIRE(kev[0].udata == 0); + + /* + * Closing the read end should make a EV_EOF appear but leave the 'data' + * field unchanged. + */ + + ATF_REQUIRE(close(p[0]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), NULL) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == (EV_CLEAR | EV_EOF)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF + 1); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__connecting_reader); +ATF_TC_BODY(fifo_kqueue__connecting_reader, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0); + EV_SET(&kev[1], p[1], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + + ATF_REQUIRE(kevent(kq, kev, 2, NULL, 0, NULL) == 0); + + /* A new writer should immediately get a EVFILT_WRITE event. */ + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* + * Filling the pipe, reading (PIPE_BUF + 1) bytes, then closing the + * read end leads to a EVFILT_WRITE with EV_EOF set. + */ + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + for (int i = 0; i < PIPE_BUF + 1; ++i) { + ATF_REQUIRE(read(p[0], &c, 1) == 1); + } + + ATF_REQUIRE(close(p[0]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), NULL) == 1); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE((kev[0].flags & EV_EOF) != 0); + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Opening the reader again must trigger the EVFILT_WRITE. */ + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + r = kevent(kq, NULL, 0, kev, nitems(kev), &(struct timespec) { 1, 0 }); + ATF_REQUIRE(r == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF + 1); + ATF_REQUIRE(kev[0].udata == 0); + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__reads); +ATF_TC_BODY(fifo_kqueue__reads, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + /* Check that EVFILT_READ behaves sensibly on a FIFO reader. */ + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + for (int i = 0; i < PIPE_BUF + 1; ++i) { + ATF_REQUIRE(read(p[0], &c, 1) == 1); + } + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + + ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 65023); + ATF_REQUIRE(kev[0].udata == 0); + + while ((r = read(p[0], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__read_eof_wakeups); +ATF_TC_BODY(fifo_kqueue__read_eof_wakeups, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* + * Closing the writer must trigger a EVFILT_READ edge with EV_EOF set. + */ + + ATF_REQUIRE(close(p[1]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE(kev[0].udata == 0); + + /* + * Trying to read from a closed pipe should not trigger EVFILT_READ + * edges. + */ + + char c; + ATF_REQUIRE(read(p[0], &c, 1) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); +} + +ATF_TC_WITHOUT_HEAD(fifo_kqueue__read_eof_state_when_reconnecting); +ATF_TC_BODY(fifo_kqueue__read_eof_state_when_reconnecting, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(mkfifo("testfifo", 0600) == 0); + + ATF_REQUIRE((p[0] = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR, 0, 0, 0); + ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* + * Closing the writer must trigger a EVFILT_READ edge with EV_EOF set. + */ + + ATF_REQUIRE(close(p[1]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE(kev[0].udata == 0); + + /* A new reader shouldn't see the EOF flag. */ + + { + int new_reader; + ATF_REQUIRE((new_reader = open("testfifo", + O_RDONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + int new_kq = kqueue(); + ATF_REQUIRE(new_kq >= 0); + + struct kevent new_kev[32]; + EV_SET(&new_kev[0], new_reader, EVFILT_READ, EV_ADD | EV_CLEAR, + 0, 0, 0); + ATF_REQUIRE(kevent(new_kq, new_kev, 1, NULL, 0, NULL) == 0); + + ATF_REQUIRE(kevent(new_kq, NULL, 0, new_kev, nitems(new_kev), + &(struct timespec) { 0, 0 }) == 0); + + ATF_REQUIRE(close(new_kq) == 0); + ATF_REQUIRE(close(new_reader) == 0); + } + + /* + * Simply reopening the writer does not trigger the EVFILT_READ again -- + * EV_EOF should be cleared, but there is no data yet so the filter + * does not trigger. + */ + + ATF_REQUIRE((p[1] = open("testfifo", + O_WRONLY | O_CLOEXEC | O_NONBLOCK)) >= 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Writing a byte should trigger a EVFILT_READ. */ + + char c = 0; + ATF_REQUIRE(write(p[1], &c, 1) == 1); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 1); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, fifo_kqueue__writes); + ATF_TP_ADD_TC(tp, fifo_kqueue__connecting_reader); + ATF_TP_ADD_TC(tp, fifo_kqueue__reads); + ATF_TP_ADD_TC(tp, fifo_kqueue__read_eof_wakeups); + ATF_TP_ADD_TC(tp, fifo_kqueue__read_eof_state_when_reconnecting); + + return atf_no_error(); +} Modified: stable/12/tests/sys/kern/pipe/Makefile ============================================================================== --- stable/12/tests/sys/kern/pipe/Makefile Mon May 11 15:20:40 2020 (r360897) +++ stable/12/tests/sys/kern/pipe/Makefile Mon May 11 15:21:03 2020 (r360898) @@ -5,6 +5,7 @@ TESTSDIR= ${TESTSBASE}/sys/kern/pipe PLAIN_TESTS_C+= big_pipe_test PLAIN_TESTS_C+= pipe_fstat_bug_test PLAIN_TESTS_C+= pipe_ino_test +ATF_TESTS_C+= pipe_kqueue_test PLAIN_TESTS_C+= pipe_overcommit1_test PLAIN_TESTS_C+= pipe_overcommit2_test PLAIN_TESTS_C+= pipe_reverse2_test Copied: stable/12/tests/sys/kern/pipe/pipe_kqueue_test.c (from r360381, head/tests/sys/kern/pipe/pipe_kqueue_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/12/tests/sys/kern/pipe/pipe_kqueue_test.c Mon May 11 15:21:03 2020 (r360898, copy of r360381, head/tests/sys/kern/pipe/pipe_kqueue_test.c) @@ -0,0 +1,366 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2020 Jan Kokemüller + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +ATF_TC_WITHOUT_HEAD(pipe_kqueue__write_end); +ATF_TC_BODY(pipe_kqueue__write_end, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); + ATF_REQUIRE(p[0] >= 0); + ATF_REQUIRE(p[1] >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR, 0, 0, 0); + + ATF_REQUIRE(kevent(kq, kev, 1, NULL, 0, NULL) == 0); + + /* Test that EVFILT_WRITE behaves sensibly on the write end. */ + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 16384); + ATF_REQUIRE(kev[0].udata == 0); + + /* Filling up the pipe should make the EVFILT_WRITE disappear. */ + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading (PIPE_BUF - 1) bytes will not trigger a EVFILT_WRITE yet. */ + + for (int i = 0; i < PIPE_BUF - 1; ++i) { + ATF_REQUIRE(read(p[0], &c, 1) == 1); + } + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 0); + + /* Reading one additional byte triggers the EVFILT_WRITE. */ + + ATF_REQUIRE(read(p[0], &c, 1) == 1); + + r = kevent(kq, NULL, 0, kev, nitems(kev), &(struct timespec) { 0, 0 }); + ATF_REQUIRE(r == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF); + ATF_REQUIRE(kev[0].udata == 0); + + /* + * Reading another byte triggers the EVFILT_WRITE again with a changed + * 'data' field. + */ + + ATF_REQUIRE(read(p[0], &c, 1) == 1); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == EV_CLEAR); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF + 1); + ATF_REQUIRE(kev[0].udata == 0); + + /* + * Closing the read end should make a EV_EOF appear but leave the 'data' + * field unchanged. + */ + + ATF_REQUIRE(close(p[0]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == (EV_CLEAR | EV_EOF | EV_ONESHOT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == PIPE_BUF + 1); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_read_end); +ATF_TC_BODY(pipe_kqueue__closed_read_end, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); + ATF_REQUIRE(p[0] >= 0); + ATF_REQUIRE(p[1] >= 0); + + ATF_REQUIRE(close(p[0]) == 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[1], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + EV_SET(&kev[1], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + + /* + * Trying to register EVFILT_WRITE when the pipe is closed leads to an + * EPIPE error. + */ + + ATF_REQUIRE(kevent(kq, kev, 2, kev, 2, NULL) == 2); + ATF_REQUIRE((kev[0].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[1].data == EPIPE); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_read_end_register_before_close); +ATF_TC_BODY(pipe_kqueue__closed_read_end_register_before_close, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); + ATF_REQUIRE(p[0] >= 0); + ATF_REQUIRE(p[1] >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[1], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + EV_SET(&kev[1], p[1], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + + /* + * Registering EVFILT_WRITE before the pipe is closed leads to a + * EVFILT_WRITE event with EV_EOF set. + */ + + ATF_REQUIRE(kevent(kq, kev, 2, kev, 2, NULL) == 2); + ATF_REQUIRE((kev[0].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[1].data == 0); + + ATF_REQUIRE(close(p[0]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 2); + { + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == + (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 16384); + ATF_REQUIRE(kev[0].udata == 0); + } + { + ATF_REQUIRE(kev[1].ident == (uintptr_t)p[1]); + ATF_REQUIRE(kev[1].filter == EVFILT_READ); + ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[1].fflags == 0); + ATF_REQUIRE(kev[1].data == 0); + ATF_REQUIRE(kev[1].udata == 0); + } + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[1]) == 0); +} + +ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end); +ATF_TC_BODY(pipe_kqueue__closed_write_end, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); + ATF_REQUIRE(p[0] >= 0); + ATF_REQUIRE(p[1] >= 0); + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(close(p[1]) == 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + + /* + * Trying to register EVFILT_WRITE when the pipe is closed leads to an + * EPIPE error. + */ + + ATF_REQUIRE(kevent(kq, kev, 2, kev, 2, NULL) == 2); + ATF_REQUIRE((kev[0].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[1].data == EPIPE); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 1); + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_READ); + ATF_REQUIRE(kev[0].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 65536); + ATF_REQUIRE(kev[0].udata == 0); + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); +} + +ATF_TC_WITHOUT_HEAD(pipe_kqueue__closed_write_end_register_before_close); +ATF_TC_BODY(pipe_kqueue__closed_write_end_register_before_close, tc) +{ + int p[2] = { -1, -1 }; + + ATF_REQUIRE(pipe2(p, O_CLOEXEC | O_NONBLOCK) == 0); + ATF_REQUIRE(p[0] >= 0); + ATF_REQUIRE(p[1] >= 0); + + int kq = kqueue(); + ATF_REQUIRE(kq >= 0); + + struct kevent kev[32]; + EV_SET(&kev[0], p[0], EVFILT_READ, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + EV_SET(&kev[1], p[0], EVFILT_WRITE, EV_ADD | EV_CLEAR | EV_RECEIPT, /**/ + 0, 0, 0); + + /* + * Registering EVFILT_WRITE before the pipe is closed leads to a + * EVFILT_WRITE event with EV_EOF set. + */ + + ATF_REQUIRE(kevent(kq, kev, 2, kev, 2, NULL) == 2); + ATF_REQUIRE((kev[0].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[0].data == 0); + ATF_REQUIRE((kev[1].flags & EV_ERROR) != 0); + ATF_REQUIRE(kev[1].data == 0); + + char c = 0; + ssize_t r; + while ((r = write(p[1], &c, 1)) == 1) { + } + ATF_REQUIRE(r < 0); + ATF_REQUIRE(errno == EAGAIN || errno == EWOULDBLOCK); + + ATF_REQUIRE(close(p[1]) == 0); + + ATF_REQUIRE(kevent(kq, NULL, 0, kev, nitems(kev), + &(struct timespec) { 0, 0 }) == 2); + { + ATF_REQUIRE(kev[0].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[0].filter == EVFILT_WRITE); + ATF_REQUIRE(kev[0].flags == + (EV_EOF | EV_CLEAR | EV_ONESHOT | EV_RECEIPT)); + ATF_REQUIRE(kev[0].fflags == 0); + ATF_REQUIRE(kev[0].data == 4096 || + kev[0].data == 512 /* on FreeBSD 11.3 */); + ATF_REQUIRE(kev[0].udata == 0); + } + { + ATF_REQUIRE(kev[1].ident == (uintptr_t)p[0]); + ATF_REQUIRE(kev[1].filter == EVFILT_READ); + ATF_REQUIRE(kev[1].flags == (EV_EOF | EV_CLEAR | EV_RECEIPT)); + ATF_REQUIRE(kev[1].fflags == 0); + ATF_REQUIRE(kev[1].data == 65536); + ATF_REQUIRE(kev[1].udata == 0); + } + + ATF_REQUIRE(close(kq) == 0); + ATF_REQUIRE(close(p[0]) == 0); +} + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, pipe_kqueue__write_end); + ATF_TP_ADD_TC(tp, pipe_kqueue__closed_read_end); + ATF_TP_ADD_TC(tp, pipe_kqueue__closed_read_end_register_before_close); + ATF_TP_ADD_TC(tp, pipe_kqueue__closed_write_end); + ATF_TP_ADD_TC(tp, pipe_kqueue__closed_write_end_register_before_close); + + return atf_no_error(); +} From owner-svn-src-all@freebsd.org Mon May 11 15:32:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F6C82E4308; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@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 49LQ0y3hFgz3Cwg; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5F56920A50; Mon, 11 May 2020 15:32:34 +0000 (UTC) (envelope-from takawata@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFWYMD021332; Mon, 11 May 2020 15:32:34 GMT (envelope-from takawata@FreeBSD.org) Received: (from takawata@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFWXlb021326; Mon, 11 May 2020 15:32:33 GMT (envelope-from takawata@FreeBSD.org) Message-Id: <202005111532.04BFWXlb021326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: takawata set sender to takawata@FreeBSD.org using -f From: Takanori Watanabe Date: Mon, 11 May 2020 15:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360899 - head/usr.sbin/bluetooth/hccontrol X-SVN-Group: head X-SVN-Commit-Author: takawata X-SVN-Commit-Paths: head/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 360899 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:32:34 -0000 Author: takawata Date: Mon May 11 15:32:32 2020 New Revision: 360899 URL: https://svnweb.freebsd.org/changeset/base/360899 Log: Add le_scan subcommand to hccontrol. PR: 246141 Submitted by: Marc Veldman Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c (contents, props changed) Modified: head/usr.sbin/bluetooth/hccontrol/Makefile head/usr.sbin/bluetooth/hccontrol/hccontrol.8 head/usr.sbin/bluetooth/hccontrol/hccontrol.h head/usr.sbin/bluetooth/hccontrol/le.c head/usr.sbin/bluetooth/hccontrol/node.c head/usr.sbin/bluetooth/hccontrol/util.c Modified: head/usr.sbin/bluetooth/hccontrol/Makefile ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/Makefile Mon May 11 15:32:32 2020 (r360899) @@ -8,7 +8,7 @@ PROG= hccontrol MAN= hccontrol.8 SRCS= send_recv.c link_policy.c link_control.c le.c\ host_controller_baseband.c info.c status.c node.c hccontrol.c \ - util.c + util.c adv_data.c WARNS?= 2 LIBADD= bluetooth Added: head/usr.sbin/bluetooth/hccontrol/adv_data.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bluetooth/hccontrol/adv_data.c Mon May 11 15:32:32 2020 (r360899) @@ -0,0 +1,249 @@ +/*- + * adv_data.c + * + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + + * Copyright (c) 2020 Marc Veldman + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $Id$ + * $FreeBSD$ + */ + +#include +#include +#include +#include +#define L2CAP_SOCKET_CHECKED +#include +#include "hccontrol.h" + +static char* const adv_data2str(int len, uint8_t* data, char* buffer, + int size); +static char* const adv_name2str(int len, uint8_t* advdata, char* buffer, + int size); +static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, + int size); + +void dump_adv_data(int len, uint8_t* advdata) +{ + int n=0; + fprintf(stdout, "\tADV Data: "); + for (n = 0; n < len+1; n++) { + fprintf(stdout, "%02x ", advdata[n]); + } + fprintf(stdout, "\n"); +} + +void print_adv_data(int len, uint8_t* advdata) +{ + int n=0; + while(n < len) + { + char buffer[2048]; + uint8_t datalen = advdata[n]; + uint8_t datatype = advdata[++n]; + /* Skip type */ + ++n; + datalen--; + switch (datatype) { + case 0x01: + fprintf(stdout, + "\tFlags: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x02: + fprintf(stdout, + "\tIncomplete list of service" + " class UUIDs (16-bit): %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x03: + fprintf(stdout, + "\tComplete list of service " + "class UUIDs (16-bit): %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x07: + fprintf(stdout, + "\tComplete list of service " + "class UUIDs (128 bit): %s\n", + adv_uuid2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x08: + fprintf(stdout, + "\tShortened local name: %s\n", + adv_name2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x09: + fprintf(stdout, + "\tComplete local name: %s\n", + adv_name2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x0a: + fprintf(stdout, + "\tTx Power level: %d dBm\n", + (int8_t)advdata[n]); + break; + case 0x0d: + fprintf(stdout, + "\tClass of device: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x16: + fprintf(stdout, + "\tService data: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0x19: + fprintf(stdout, + "\tAppearance: %s\n", + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + break; + case 0xff: + fprintf(stdout, + "\tManufacturer: %s\n", + hci_manufacturer2str( + advdata[n]|advdata[n+1]<<8)); + fprintf(stdout, + "\tManufacturer specific data: %s\n", + adv_data2str( + datalen-2, + &advdata[n+2], + buffer, + sizeof(buffer))); + break; + default: + fprintf(stdout, + "\tUNKNOWN datatype: %02x data %s\n", + datatype, + adv_data2str( + datalen, + &advdata[n], + buffer, + sizeof(buffer))); + } + n += datalen; + } +} + +static char* const adv_data2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + int i = 0; + char tmpbuf[5]; + + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + + while(i < datalen) { + (void)snprintf(tmpbuf, sizeof(tmpbuf), "%02x ", data[i]); + /* Check if buffer is full */ + if (strlcat(buffer, tmpbuf, size) > size) + break; + i++; + } + return buffer; +} + +static char* const adv_name2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + + (void)strlcpy(buffer, (char*)data, datalen+1); + return buffer; +} + +static char* const adv_uuid2str(int datalen, uint8_t* data, char* buffer, + int size) +{ + int i; + uuid_t uuid; + uint32_t ustatus; + char* tmpstr; + + if (buffer == NULL) + return NULL; + + memset(buffer, 0, size); + if (datalen < 16) + return buffer; + uuid.time_low = le32dec(data+12); + uuid.time_mid = le16dec(data+10); + uuid.time_hi_and_version = le16dec(data+8); + uuid.clock_seq_hi_and_reserved = data[7]; + uuid.clock_seq_low = data[6]; + for(i = 0; i < _UUID_NODE_LEN; i++){ + uuid.node[i] = data[5 - i]; + } + uuid_to_string(&uuid, &tmpstr, &ustatus); + if(ustatus == uuid_s_ok) { + strlcpy(buffer, tmpstr, size); + } + free(tmpstr); + + return buffer; +} Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 11 15:32:32 2020 (r360899) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd April 27, 2020 +.Dd May 3, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -156,6 +156,7 @@ are: .It Cm LE_Set_Scan_Enable .It Cm LE_Read_Supported_States .It Cm LE_Read_Buffer_Size +.It Cm LE Scan .El .Pp The currently supported node commands in Modified: head/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 11 15:32:32 2020 (r360899) @@ -79,6 +79,10 @@ char const * hci_cc2str (int); char const * hci_con_state2str (int); char const * hci_status2str (int); char const * hci_bdaddr2str (bdaddr_t const *); +char const * hci_addrtype2str (int type); + +void dump_adv_data(int len, uint8_t* advdata); +void print_adv_data(int len, uint8_t* advdata); #endif /* _HCCONTROL_H_ */ Modified: head/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/le.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/le.c Mon May 11 15:32:32 2020 (r360899) @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -60,6 +61,8 @@ static int le_enable(int s, int argc, char *argv[]); static int le_set_advertising_enable(int s, int argc, char *argv[]); static int le_set_advertising_param(int s, int argc, char *argv[]); static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); +static int le_scan(int s, int argc, char *argv[]); +static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -613,6 +616,152 @@ le_read_buffer_size(int s, int argc, char *argv[]) return (OK); } +static int +le_scan(int s, int argc, char *argv[]) +{ + int n, bufsize, scancount, numscans; + bool verbose; + uint8_t active = 0; + char ch; + + char b[512]; + ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; + + ng_hci_le_set_scan_parameters_cp scan_param_cp; + ng_hci_le_set_scan_parameters_rp scan_param_rp; + + ng_hci_le_set_scan_enable_cp scan_enable_cp; + ng_hci_le_set_scan_enable_rp scan_enable_rp; + + optreset = 1; + optind = 0; + verbose = false; + numscans = 1; + + while ((ch = getopt(argc, argv , "an:v")) != -1) { + switch(ch) { + case 'a': + active = 1; + break; + case 'n': + numscans = (uint8_t)strtol(optarg, NULL, 10); + break; + case 'v': + verbose = true; + break; + } + } + + scan_param_cp.le_scan_type = active; + scan_param_cp.le_scan_interval = (uint16_t)(100/0.625); + scan_param_cp.le_scan_window = (uint16_t)(50/0.625); + /* Address type public */ + scan_param_cp.own_address_type = 0; + /* 'All' filter policy */ + scan_param_cp.scanning_filter_policy = 0; + n = sizeof(scan_param_rp); + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_PARAMETERS), + (void *)&scan_param_cp, sizeof(scan_param_cp), + (void *)&scan_param_rp, &n) == ERROR) + return (ERROR); + + if (scan_param_rp.status != 0x00) { + fprintf(stdout, "LE_Set_Scan_Parameters failed. Status: %s [%#02x]\n", + hci_status2str(scan_param_rp.status), + scan_param_rp.status); + return (FAILED); + } + + /* Enable scanning */ + n = sizeof(scan_enable_rp); + scan_enable_cp.le_scan_enable = 1; + scan_enable_cp.filter_duplicates = 1; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&scan_enable_cp, sizeof(scan_enable_cp), + (void *)&scan_enable_rp, &n) == ERROR) + return (ERROR); + + if (scan_enable_rp.status != 0x00) { + fprintf(stdout, "LE_Scan_Enable enable failed. Status: %s [%#02x]\n", + hci_status2str(scan_enable_rp.status), + scan_enable_rp.status); + return (FAILED); + } + + scancount = 0; + while (scancount < numscans) { + /* wait for scan events */ + bufsize = sizeof(b); + if (hci_recv(s, b, &bufsize) == ERROR) { + return (ERROR); + } + + if (bufsize < sizeof(*e)) { + errno = EIO; + return (ERROR); + } + scancount++; + if (e->event == NG_HCI_EVENT_LE) { + fprintf(stdout, "Scan %d\n", scancount); + handle_le_event(e, verbose); + } + } + + fprintf(stdout, "Scan complete\n"); + + /* Disable scanning */ + n = sizeof(scan_enable_rp); + scan_enable_cp.le_scan_enable = 0; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_SCAN_ENABLE), + (void *)&scan_enable_cp, sizeof(scan_enable_cp), + (void *)&scan_enable_rp, &n) == ERROR) + return (ERROR); + + if (scan_enable_rp.status != 0x00) { + fprintf(stdout, "LE_Scan_Enable disable failed. Status: %s [%#02x]\n", + hci_status2str(scan_enable_rp.status), + scan_enable_rp.status); + return (FAILED); + } + + return (OK); +} + +static void handle_le_event(ng_hci_event_pkt_t* e, bool verbose) +{ + int rc; + ng_hci_le_ep *leer = + (ng_hci_le_ep *)(e + 1); + ng_hci_le_advertising_report_ep *advrep = + (ng_hci_le_advertising_report_ep *)(leer + 1); + ng_hci_le_advreport *reports = + (ng_hci_le_advreport *)(advrep + 1); + + if (leer->subevent_code == NG_HCI_LEEV_ADVREP) { + fprintf(stdout, "Scan result, num_reports: %d\n", + advrep->num_reports); + for(rc = 0; rc < advrep->num_reports; rc++) { + uint8_t length = (uint8_t)reports[rc].length_data; + fprintf(stdout, "\tBD_ADDR %s \n", + hci_bdaddr2str(&reports[rc].bdaddr)); + fprintf(stdout, "\tAddress type: %s\n", + hci_addrtype2str(reports[rc].addr_type)); + if (length > 0 && verbose) { + dump_adv_data(length, reports[rc].data); + print_adv_data(length, reports[rc].data); + fprintf(stdout, + "\tRSSI: %d dBm\n", + (int8_t)reports[rc].data[length]); + fprintf(stdout, "\n"); + } + } + } +} + struct hci_command le_commands[] = { { "le_enable", @@ -684,5 +833,11 @@ struct hci_command le_commands[] = { "le_read_buffer_size [-v 1|2]\n" "Read the maximum size of ACL and ISO data packets", &le_read_buffer_size + }, + { + "le_scan", + "le_scan [-a] [-v] [-n number_of_scans]\n" + "Do an LE scan", + &le_scan }, }; Modified: head/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/node.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/node.c Mon May 11 15:32:32 2020 (r360899) @@ -211,83 +211,6 @@ hci_flush_neighbor_cache(int s, int argc, char **argv) return (OK); } /* hci_flush_neighbor_cache */ -#define MIN(a,b) (((a)>(b)) ? (b) :(a) ) - -static int hci_dump_adv(uint8_t *data, int length) -{ - int elemlen; - int type; - int i; - - while(length>0){ - elemlen = *data; - data++; - length --; - if(length<=0) - break; - type = *data; - data++; - length --; - elemlen--; - if(length <= 0) - break; - switch(type){ - case 0x1: - printf("NDflag:%x\n", *data); - break; - case 0x8: - case 0x9: - printf("LocalName:"); - for(i = 0; i < MIN(length,elemlen); i++){ - putchar(data[i]); - } - printf("\n"); - break; - case 0x6: - case 0x7: - { - uuid_t uuid; - char *uuidstr; - uint32_t ustatus; - if (elemlen < 16) - break; - uuid.time_low = le32dec(data+12); - uuid.time_mid = le16dec(data+10); - uuid.time_hi_and_version = le16dec(data+8); - uuid.clock_seq_hi_and_reserved = data[7]; - uuid.clock_seq_low = data[6]; - for(i = 0; i < _UUID_NODE_LEN; i++){ - uuid.node[i] = data[5 - i]; - } - uuid_to_string(&uuid, &uuidstr, &ustatus); - - printf("ServiceUUID: %s\n", uuidstr); - break; - } - case 0xff: - if (elemlen < 2) - break; - printf("Vendor:%s:", - hci_manufacturer2str(data[0]|data[1]<<8)); - for (i = 2; i < MIN(length,elemlen); i++) { - printf("%02x ",data[i]); - } - printf("\n"); - break; - default: - printf("Type%d:", type); - for(i=0; i < MIN(length,elemlen); i++){ - printf("%02x ",data[i]); - } - printf("\n"); - break; - } - data += elemlen; - length -= elemlen; - } - return 0; -} -#undef MIN /* Send Read_Neighbor_Cache command to the node */ static int hci_read_neighbor_cache(int s, int argc, char **argv) @@ -337,8 +260,8 @@ hci_read_neighbor_cache(int s, int argc, char **argv) r.entries[n].features[6], r.entries[n].features[7], r.entries[n].clock_offset, r.entries[n].page_scan_mode, r.entries[n].page_scan_rep_mode); - hci_dump_adv(r.entries[n].extinq_data, - r.entries[n].extinq_size); + print_adv_data(r.entries[n].extinq_size, + r.entries[n].extinq_data); fprintf(stdout,"\n"); } out: Modified: head/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- head/usr.sbin/bluetooth/hccontrol/util.c Mon May 11 15:21:03 2020 (r360898) +++ head/usr.sbin/bluetooth/hccontrol/util.c Mon May 11 15:32:32 2020 (r360899) @@ -3281,3 +3281,17 @@ hci_bdaddr2str(bdaddr_t const *ba) return (buffer); } /* hci_bdaddr2str */ + +char const * +hci_addrtype2str(int type) +{ + static char const * const t[] = { + /* 0x00 */ "Public Device Address", + /* 0x01 */ "Random Device Address", + /* 0x02 */ "Public Identity Address", + /* 0x03 */ "Random (static) Identity Address" + }; + + return (type >= SIZE(t)? "?" : t[type]); +} /* hci_addrtype2str */ + From owner-svn-src-all@freebsd.org Mon May 11 15:38:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C311C2E43F9; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@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 49LQ844pnsz3DD7; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 9B7AE20A5A; Mon, 11 May 2020 15:38:44 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BFci49021825; Mon, 11 May 2020 15:38:44 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BFci1g021824; Mon, 11 May 2020 15:38:44 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005111538.04BFci1g021824@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 11 May 2020 15:38:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360900 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360900 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 15:38:44 -0000 Author: freqlabs Date: Mon May 11 15:38:44 2020 New Revision: 360900 URL: https://svnweb.freebsd.org/changeset/base/360900 Log: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24753 Modified: head/sys/kern/vfs_export.c Modified: head/sys/kern/vfs_export.c ============================================================================== --- head/sys/kern/vfs_export.c Mon May 11 15:32:32 2020 (r360899) +++ head/sys/kern/vfs_export.c Mon May 11 15:38:44 2020 (r360900) @@ -112,6 +112,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -300,10 +305,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -518,8 +527,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); From owner-svn-src-all@freebsd.org Mon May 11 16:14:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0CE2B2E4F88; Mon, 11 May 2020 16:14:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LQx86bBpz3FyR; Mon, 11 May 2020 16:14:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD4EF211E8; Mon, 11 May 2020 16:14:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BGEKu7046042; Mon, 11 May 2020 16:14:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BGEKnL046041; Mon, 11 May 2020 16:14:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005111614.04BGEKnL046041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 16:14: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: r360901 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 360901 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 16:14:21 -0000 Author: jhb Date: Mon May 11 16:14:20 2020 New Revision: 360901 URL: https://svnweb.freebsd.org/changeset/base/360901 Log: MFC 356840,357344: Add stricter checks on user changes to SSTATUS. 356840: Check for invalid sstatus values in set_mcontext(). Previously, this check was only in sys_sigreturn() which meant that user applications could write invalid values to the register via setcontext() or swapcontext(). 357344: Add stricter checks on user changes to SSTATUS. Rather than trying to blacklist which bits userland can't write to via sigreturn() or setcontext(), only permit changes to whitelisted bits. - Permit arbitrary writes to bits in the user-writable USTATUS register that shadows SSTATUS. - Ignore changes in write-only bits maintained by the CPU. - Ignore the user-supplied value of the FS field used to track floating point state and instead set it to a value matching the actions taken by set_fpcontext(). Modified: stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Mon May 11 15:38:44 2020 (r360900) +++ stable/12/sys/riscv/riscv/machdep.c Mon May 11 16:14:20 2020 (r360901) @@ -365,6 +365,19 @@ set_mcontext(struct thread *td, mcontext_t *mcp) tf = td->td_frame; + /* + * Permit changes to the USTATUS bits of SSTATUS. + * + * Ignore writes to read-only bits (SD, XS). + * + * Ignore writes to the FS field as set_fpcontext() will set + * it explicitly. + */ + if (((mcp->mc_gpregs.gp_sstatus ^ tf->tf_sstatus) & + ~(SSTATUS_SD | SSTATUS_XS_MASK | SSTATUS_FS_MASK | SSTATUS_UPIE | + SSTATUS_UIE)) != 0) + return (EINVAL); + memcpy(tf->tf_t, mcp->mc_gpregs.gp_t, sizeof(tf->tf_t)); memcpy(tf->tf_s, mcp->mc_gpregs.gp_s, sizeof(tf->tf_s)); memcpy(tf->tf_a, mcp->mc_gpregs.gp_a, sizeof(tf->tf_a)); @@ -416,7 +429,12 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) { #ifdef FPE struct pcb *curpcb; +#endif + td->td_frame->tf_sstatus &= ~SSTATUS_FS_MASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_OFF; + +#ifdef FPE critical_enter(); if ((mcp->mc_flags & _MC_FP_VALID) != 0) { @@ -426,6 +444,7 @@ set_fpcontext(struct thread *td, mcontext_t *mcp) sizeof(mcp->mc_fpregs)); curpcb->pcb_fcsr = mcp->mc_fpregs.fp_fcsr; curpcb->pcb_fpflags = mcp->mc_fpregs.fp_flags & PCB_FP_USERMASK; + td->td_frame->tf_sstatus |= SSTATUS_FS_CLEAN; } critical_exit(); @@ -520,21 +539,11 @@ struct sigreturn_args { int sys_sigreturn(struct thread *td, struct sigreturn_args *uap) { - uint64_t sstatus; ucontext_t uc; int error; if (copyin(uap->sigcntxp, &uc, sizeof(uc))) return (EFAULT); - - /* - * Make sure the processor mode has not been tampered with and - * interrupts have not been disabled. - * Supervisor interrupts in user mode are always enabled. - */ - sstatus = uc.uc_mcontext.mc_gpregs.gp_sstatus; - if ((sstatus & SSTATUS_SPP) != 0) - return (EINVAL); error = set_mcontext(td, &uc.uc_mcontext); if (error != 0) From owner-svn-src-all@freebsd.org Mon May 11 17:42:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 06A052E66D7; Mon, 11 May 2020 17:42:06 +0000 (UTC) (envelope-from erj@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 49LStP6TR4z3Kwb; Mon, 11 May 2020 17:42:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D99F6222AF; Mon, 11 May 2020 17:42:05 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BHg5WN001119; Mon, 11 May 2020 17:42:05 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BHg40G001112; Mon, 11 May 2020 17:42:04 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005111742.04BHg40G001112@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 11 May 2020 17:42:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360902 - in head/sys/dev: e1000 ixgbe ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys/dev: e1000 ixgbe ixl X-SVN-Commit-Revision: 360902 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 17:42:06 -0000 Author: erj Date: Mon May 11 17:42:04 2020 New Revision: 360902 URL: https://svnweb.freebsd.org/changeset/base/360902 Log: em/ix/ixv/ixl/iavf: Implement ifdi_needs_restart iflib method Pursuant to r360398, implement driver-specific versions of the ifdi_needs_restart iflib device method. Some (if not most?) Intel network cards don't need reinitializing when a VLAN is added or removed from the device hardware, so these implement ifdi_needs_restart in a way that tell iflib not to bring the interface up or down when a VLAN is added or removed, regardless of whether the VLAN_HWFILTER interface capability flag is set or not. This could potentially solve several PRs relating to link flaps that occur when VLANs are added/removed to devices. Signed-off-by: Eric Joyner PR: 240818, 241785 Reviewed by: gallatin@, olivier@ MFC after: 3 days MFC with: r360398 Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D24659 Modified: head/sys/dev/e1000/if_em.c head/sys/dev/ixgbe/if_ix.c head/sys/dev/ixgbe/if_ixv.c head/sys/dev/ixl/if_iavf.c head/sys/dev/ixl/if_ixl.c Modified: head/sys/dev/e1000/if_em.c ============================================================================== --- head/sys/dev/e1000/if_em.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/e1000/if_em.c Mon May 11 17:42:04 2020 (r360902) @@ -251,6 +251,7 @@ static void em_if_timer(if_ctx_t ctx, uint16_t qid); static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static void em_if_watchdog_reset(if_ctx_t ctx); +static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static void em_identify_hardware(if_ctx_t ctx); static int em_allocate_pci_resources(if_ctx_t ctx); @@ -400,6 +401,7 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -437,6 +439,7 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -4035,6 +4038,25 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) adapter->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); + } +} + +/* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); } } Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixgbe/if_ix.c Mon May 11 17:42:04 2020 (r360902) @@ -139,6 +139,7 @@ static void ixgbe_if_update_admin_status(if_ctx_t ctx) static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); +static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); int ixgbe_intr(void *arg); /************************************************************************ @@ -273,6 +274,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), + DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1234,6 +1236,25 @@ ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) req->dev_addr, &req->data[i]); return (0); } /* ixgbe_if_i2c_req */ + +/* ixgbe_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); + } +} /************************************************************************ * ixgbe_add_media_types Modified: head/sys/dev/ixgbe/if_ixv.c ============================================================================== --- head/sys/dev/ixgbe/if_ixv.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixgbe/if_ixv.c Mon May 11 17:42:04 2020 (r360902) @@ -110,6 +110,7 @@ static void ixv_if_register_vlan(if_ctx_t, u16); static void ixv_if_unregister_vlan(if_ctx_t, u16); static uint64_t ixv_if_get_counter(if_ctx_t, ift_counter); +static bool ixv_if_needs_restart(if_ctx_t, enum iflib_restart_event); static void ixv_save_stats(struct adapter *); static void ixv_init_stats(struct adapter *); @@ -172,6 +173,7 @@ static device_method_t ixv_if_methods[] = { DEVMETHOD(ifdi_vlan_register, ixv_if_register_vlan), DEVMETHOD(ifdi_vlan_unregister, ixv_if_unregister_vlan), DEVMETHOD(ifdi_get_counter, ixv_if_get_counter), + DEVMETHOD(ifdi_needs_restart, ixv_if_needs_restart), DEVMETHOD_END }; @@ -1186,6 +1188,25 @@ ixv_if_get_counter(if_ctx_t ctx, ift_counter cnt) return (if_get_counter_default(ifp, cnt)); } } /* ixv_if_get_counter */ + +/* ixv_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixv_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* XXX: This may not need to return true */ + default: + return (true); + } +} /************************************************************************ * ixv_initialize_transmit_units - Enable transmit unit. Modified: head/sys/dev/ixl/if_iavf.c ============================================================================== --- head/sys/dev/ixl/if_iavf.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixl/if_iavf.c Mon May 11 17:42:04 2020 (r360902) @@ -92,6 +92,7 @@ static void iavf_if_vlan_register(if_ctx_t ctx, u16 v static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); static void iavf_if_stop(if_ctx_t ctx); +static bool iavf_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static int iavf_allocate_pci_resources(struct iavf_sc *); static int iavf_reset_complete(struct i40e_hw *); @@ -190,6 +191,7 @@ static device_method_t iavf_if_methods[] = { DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), + DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), DEVMETHOD_END }; @@ -1467,7 +1469,27 @@ iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt) } } - +/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* This case must return true if VLAN anti-spoof checks are + * enabled by the PF driver for the VF. + */ + default: + return (true); + } +} + static void iavf_free_pci_resources(struct iavf_sc *sc) { Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon May 11 16:14:20 2020 (r360901) +++ head/sys/dev/ixl/if_ixl.c Mon May 11 17:42:04 2020 (r360902) @@ -117,6 +117,7 @@ static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); +static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); #ifdef PCI_IOV static void ixl_if_vflr_handle(if_ctx_t ctx); #endif @@ -187,6 +188,7 @@ static device_method_t ixl_if_methods[] = { DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), + DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), @@ -1650,6 +1652,24 @@ ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_ } return (error); +} + +/* ixl_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for every event. + * + * @returns true if iflib needs to reinit the interface, false otherwise + */ +static bool +ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } } static u_int From owner-svn-src-all@freebsd.org Mon May 11 18:10:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F3F82E6FC5; Mon, 11 May 2020 18:10:35 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49LTWF6DbVz3MN9; Mon, 11 May 2020 18:10:33 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 55C473C0199; Mon, 11 May 2020 18:10:27 +0000 (UTC) Date: Mon, 11 May 2020 18:10:27 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360833 - head Message-ID: <20200511181027.GA60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="5mCyUwZo2JvN/JJP" Content-Disposition: inline In-Reply-To: <202005090201.04921Tpf028388@repo.freebsd.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49LTWF6DbVz3MN9 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; IP_SCORE(-3.63)[ip: (-9.55), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.80), country: US(-0.05)]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:10:35 -0000 --5mCyUwZo2JvN/JJP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > Author: kevans > Date: Sat May 9 02:01:29 2020 > New Revision: 360833 > URL: https://svnweb.freebsd.org/changeset/base/360833 >=20 > Log: > installworld: attempt a certctl rehash at the tail end > =20 > This can be run as root or normal user with no problem; if they hadn't > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl = to > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENS= SL + > WITH_CAROOT with a populated /etc/ssl that they can then use with an > appropriate *ssl from somewhere else. > =20 > Cross-builds are fine because this will always use the host certctl, or= just > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > =20 > MFC after: 1 week > Differential Revision: https://reviews.freebsd.org/D24641 >=20 > Modified: > head/Makefile.inc1 >=20 > Modified: head/Makefile.inc1 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installc= heck > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > .endfor > .endif > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > + # friends, which we likely don't want. We'll rehash on a best-effort > + # basis, otherwise we'll just mention that we're not doing it to raise > + # awareness. > + @if which certctl>/dev/null; then \ > + certctl rehash \ Does this update METALOG with the added links? It seems a little weird to rely on DESTDIR from the environment. In general I'm not enthusiastic about additions to installworld that do anything other than copying files, creating links, etc in simple ways. -- Brooks --5mCyUwZo2JvN/JJP Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeuZURAAoJEKzQXbSebgfAVx8IAJpjGA7VQT+08/rV2+4QkpO+ Dc1JDgQKqiEVwqeqPocmY22a+9fxh2hKyOQsV3cXK7jLpoapdEaVE8talZZFec/C Bs/G8hEb7EbXOwwtPOpiwtVGAqUkqTIjaw5VgnddW0ifQn5v5/oIgDoBYAtD9ahw AiEUY5Rpc4M3Hbn/8ZctOHfZ08OXgpMZy6c8FaUqame/I21D5eIAcJX7ICurFYvq 0If/QfXWKMyGNy1YsPoxxmIAs8ITYJ9fiRf33cfe8kggYQISfjL7chLtSp+2zCE4 cjey/a+8Qrob0K/BFXw6Bbj9ijEt8+rAPsbmqAM7zug/xYukPh+vMNT/QCsfGcw= =C34C -----END PGP SIGNATURE----- --5mCyUwZo2JvN/JJP-- From owner-svn-src-all@freebsd.org Mon May 11 18:45:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0AC12E7DA9; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVHV25xpz3PN8; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qv1-f48.google.com (mail-qv1-f48.google.com [209.85.219.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 36C6314862; Mon, 11 May 2020 18:45:26 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qv1-f48.google.com with SMTP id v15so927726qvr.8; Mon, 11 May 2020 11:45:26 -0700 (PDT) X-Gm-Message-State: AGi0PuahnAEMfzym0oB9qXATc/hKRvEW8fgJgTQrWWEDdRrHKgGgHc7v mptWZOkG33eTZX1leIPNI3lEJPZLyXXMUUKOH60= X-Google-Smtp-Source: APiQypJanY8PSvfGTpnjUP8SXqdvSLHQdPxLyDGAv0qOdPrOpmnx+g6f/U9oSd/mzq26Ad+yLZos7bsh1O5ySBA1z/k= X-Received: by 2002:a05:6214:28d:: with SMTP id l13mr17301508qvv.181.1589222725681; Mon, 11 May 2020 11:45:25 -0700 (PDT) MIME-Version: 1.0 References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> In-Reply-To: <20200511181027.GA60902@spindle.one-eyed-alien.net> From: Kyle Evans Date: Mon, 11 May 2020 13:45:14 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360833 - head To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:45:26 -0000 On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > Author: kevans > > Date: Sat May 9 02:01:29 2020 > > New Revision: 360833 > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > Log: > > installworld: attempt a certctl rehash at the tail end > > > > This can be run as root or normal user with no problem; if they hadn't > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > appropriate *ssl from somewhere else. > > > > Cross-builds are fine because this will always use the host certctl, or just > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > MFC after: 1 week > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > Modified: > > head/Makefile.inc1 > > > > Modified: head/Makefile.inc1 > > ============================================================================== > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installcheck > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > .endfor > > .endif > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > > + # friends, which we likely don't want. We'll rehash on a best-effort > > + # basis, otherwise we'll just mention that we're not doing it to raise > > + # awareness. > > + @if which certctl>/dev/null; then \ > > + certctl rehash \ > > Does this update METALOG with the added links? > > It seems a little weird to rely on DESTDIR from the environment. > > In general I'm not enthusiastic about additions to installworld that do > anything other than copying files, creating links, etc in simple ways. I will happily back this out if I can get some qualified eyes to review/improve it. It does not update METALOG, and it probably should. Agreed on DESTDIR. As for point #3, I guess we can continue spreading `certctl rehash` all over the tree in various points that may need it; the release(7) scripts will need to be done if we don't do it here at a minimum, and I haven't put much thought into it beyond that. The close-to-infuriating part of the caroot project has been that it's incredibly hard to get almost anyone else (with some obvious exceptions) to do more than informal discussion on the matter; actual review, in particular, is difficult to obtain. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Mon May 11 18:47:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6EA522E7E50; Mon, 11 May 2020 18:47:39 +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 49LVL32LyMz3PVl; Mon, 11 May 2020 18:47:39 +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 475A622E0D; Mon, 11 May 2020 18:47:39 +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 04BIld1k038355; Mon, 11 May 2020 18:47:39 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BIlcxr038354; Mon, 11 May 2020 18:47:38 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111847.04BIlcxr038354@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 18:47:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360903 - in head: share/man/man5 sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man5 sys/netpfil/pf X-SVN-Commit-Revision: 360903 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:47:39 -0000 Author: markj Date: Mon May 11 18:47:38 2020 New Revision: 360903 URL: https://svnweb.freebsd.org/changeset/base/360903 Log: pf: Don't allocate per-table entry counters unless required. pf by default does not do per-table address accounting unless the "counters" keyword is specified in the corresponding pf.conf table definition. Yet, we always allocate 12 per-CPU counters per table. For large tables this carries a lot of overhead, so only allocate counters when they will actually be used. A further enhancement might be to use a dedicated UMA zone to allocate counter arrays for table entries, since close to half of the structure size comes from counter pointers. A related issue is the cost of zeroing counters, since counter_u64_zero() calls smp_rendezvous() on some architectures. Reported by: loos, Jim Pingle Reviewed by: kp MFC after: 2 weeks Sponsored by: Rubicon Communications, LLC (Netgate) Differential Revision: https://reviews.freebsd.org/D24803 Modified: head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf_table.c Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Mon May 11 17:42:04 2020 (r360902) +++ head/share/man/man5/pf.conf.5 Mon May 11 18:47:38 2020 (r360903) @@ -189,6 +189,7 @@ The .Ar counters flag enables per-address packet and byte counters which can be displayed with .Xr pfctl 8 . +Note that this feature carries significant memory overhead for large tables. .El .Pp For example, Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Mon May 11 17:42:04 2020 (r360902) +++ head/sys/netpfil/pf/pf_table.c Mon May 11 18:47:38 2020 (r360903) @@ -144,9 +144,9 @@ static void pfr_mark_addrs(struct pfr_ktable *); static struct pfr_kentry *pfr_lookup_addr(struct pfr_ktable *, struct pfr_addr *, int); -static bool pfr_create_kentry_counter(struct pfr_kcounters *, - int, int); -static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *); +static bool pfr_create_kentry_counter(struct pfr_kentry *, int, + int); +static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool); static void pfr_destroy_kentries(struct pfr_kentryworkq *); static void pfr_destroy_kentry_counter(struct pfr_kcounters *, int, int); @@ -155,8 +155,8 @@ static void pfr_insert_kentries(struct pfr_ktable *, struct pfr_kentryworkq *, long); static void pfr_remove_kentries(struct pfr_ktable *, struct pfr_kentryworkq *); -static void pfr_clstats_kentries(struct pfr_kentryworkq *, long, - int); +static void pfr_clstats_kentries(struct pfr_ktable *, + struct pfr_kentryworkq *, long, int); static void pfr_reset_feedback(struct pfr_addr *, int); static void pfr_prepare_network(union sockaddr_union *, int, int); static int pfr_route_kentry(struct pfr_ktable *, @@ -285,7 +285,8 @@ pfr_add_addrs(struct pfr_table *tbl, struct pfr_addr * ad->pfra_fback = PFR_FB_NONE; } if (p == NULL && q == NULL) { - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -451,7 +452,8 @@ pfr_set_addrs(struct pfr_table *tbl, struct pfr_addr * ad.pfra_fback = PFR_FB_DUPLICATE; goto _skip; } - p = pfr_create_kentry(&ad); + p = pfr_create_kentry(&ad, + (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(tmpkt, p)) { @@ -485,7 +487,7 @@ _skip: if (!(flags & PFR_FLAG_DUMMY)) { pfr_insert_kentries(kt, &addq, tzero); pfr_remove_kentries(kt, &delq); - pfr_clstats_kentries(&changeq, tzero, INVERT_NEG_FLAG); + pfr_clstats_kentries(kt, &changeq, tzero, INVERT_NEG_FLAG); } else pfr_destroy_kentries(&addq); if (nadd != NULL) @@ -623,7 +625,7 @@ pfr_get_astats(struct pfr_table *tbl, struct pfr_astat pfr_walktree, &w); if (!rv && (flags & PFR_FLAG_CLSTATS)) { pfr_enqueue_addrs(kt, &workq, NULL, 0); - pfr_clstats_kentries(&workq, tzero, 0); + pfr_clstats_kentries(kt, &workq, tzero, 0); } if (rv) return (rv); @@ -671,7 +673,7 @@ pfr_clr_astats(struct pfr_table *tbl, struct pfr_addr } if (!(flags & PFR_FLAG_DUMMY)) - pfr_clstats_kentries(&workq, 0, 0); + pfr_clstats_kentries(kt, &workq, 0, 0); if (nzero != NULL) *nzero = xzero; return (0); @@ -784,31 +786,28 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr } static bool -pfr_create_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) +pfr_create_kentry_counter(struct pfr_kentry *ke, int pfr_dir, int pfr_op) { - kc->pfrkc_packets[pfr_dir][pfr_op] = counter_u64_alloc(M_NOWAIT); - if (! kc->pfrkc_packets[pfr_dir][pfr_op]) - return (false); + counter_u64_t c; - kc->pfrkc_bytes[pfr_dir][pfr_op] = counter_u64_alloc(M_NOWAIT); - if (! kc->pfrkc_bytes[pfr_dir][pfr_op]) { - /* Previous allocation will be freed through - * pfr_destroy_kentry() */ + c = counter_u64_alloc(M_NOWAIT); + if (c == NULL) return (false); - } - - kc->pfrkc_tzero = 0; - + ke->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op] = c; + c = counter_u64_alloc(M_NOWAIT); + if (c == NULL) + return (false); + ke->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op] = c; return (true); } static struct pfr_kentry * -pfr_create_kentry(struct pfr_addr *ad) +pfr_create_kentry(struct pfr_addr *ad, bool counters) { struct pfr_kentry *ke; int pfr_dir, pfr_op; - ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); + ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); if (ke == NULL) return (NULL); @@ -819,14 +818,16 @@ pfr_create_kentry(struct pfr_addr *ad) ke->pfrke_af = ad->pfra_af; ke->pfrke_net = ad->pfra_net; ke->pfrke_not = ad->pfra_not; - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) { - if (! pfr_create_kentry_counter(&ke->pfrke_counters, - pfr_dir, pfr_op)) { - pfr_destroy_kentry(ke); - return (NULL); + ke->pfrke_counters.pfrkc_tzero = 0; + if (counters) + for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) + for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op++) { + if (!pfr_create_kentry_counter(ke, pfr_dir, + pfr_op)) { + pfr_destroy_kentry(ke); + return (NULL); + } } - } return (ke); } @@ -844,8 +845,12 @@ pfr_destroy_kentries(struct pfr_kentryworkq *workq) static void pfr_destroy_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) { - counter_u64_free(kc->pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_free(kc->pfrkc_bytes[pfr_dir][pfr_op]); + counter_u64_t c; + + if ((c = kc->pfrkc_packets[pfr_dir][pfr_op]) != NULL) + counter_u64_free(c); + if ((c = kc->pfrkc_bytes[pfr_dir][pfr_op]) != NULL) + counter_u64_free(c); } static void @@ -890,7 +895,7 @@ pfr_insert_kentry(struct pfr_ktable *kt, struct pfr_ad p = pfr_lookup_addr(kt, ad, 1); if (p != NULL) return (0); - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, (kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) return (ENOMEM); @@ -930,22 +935,28 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } static void -pfr_clstats_kentries(struct pfr_kentryworkq *workq, long tzero, int negchange) +pfr_clear_kentry_counters(struct pfr_kentry *p, int pfr_dir, int pfr_op) { + counter_u64_zero(p->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op]); + counter_u64_zero(p->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op]); +} + +static void +pfr_clstats_kentries(struct pfr_ktable *kt, struct pfr_kentryworkq *workq, + long tzero, int negchange) +{ struct pfr_kentry *p; - int pfr_dir, pfr_op; + int pfr_dir, pfr_op; SLIST_FOREACH(p, workq, pfrke_workq) { if (negchange) p->pfrke_not = !p->pfrke_not; - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) { - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) { - counter_u64_zero(p->pfrke_counters. - pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_zero(p->pfrke_counters. - pfrkc_bytes[pfr_dir][pfr_op]); - } - } + if ((kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0) + for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) + for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; + pfr_op++) + pfr_clear_kentry_counters(p, pfr_dir, + pfr_op); p->pfrke_counters.pfrkc_tzero = tzero; } } @@ -1551,7 +1562,8 @@ _skip: senderr(EINVAL); if (pfr_lookup_addr(shadow, ad, 1) != NULL) continue; - p = pfr_create_kentry(ad); + p = pfr_create_kentry(ad, + (shadow->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0); if (p == NULL) senderr(ENOMEM); if (pfr_route_kentry(shadow, p)) { @@ -1707,7 +1719,7 @@ pfr_commit_ktable(struct pfr_ktable *kt, long tzero) pfr_enqueue_addrs(kt, &delq, NULL, ENQUEUE_UNMARKED_ONLY); pfr_insert_kentries(kt, &addq, tzero); pfr_remove_kentries(kt, &delq); - pfr_clstats_kentries(&changeq, tzero, INVERT_NEG_FLAG); + pfr_clstats_kentries(kt, &changeq, tzero, INVERT_NEG_FLAG); pfr_destroy_kentries(&garbageq); } else { /* kt cannot contain addresses */ @@ -1888,7 +1900,7 @@ pfr_clstats_ktable(struct pfr_ktable *kt, long tzero, if (recurse) { pfr_enqueue_addrs(kt, &addrq, NULL, 0); - pfr_clstats_kentries(&addrq, tzero, 0); + pfr_clstats_kentries(kt, &addrq, tzero, 0); } for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) { for (pfr_op = 0; pfr_op < PFR_OP_TABLE_MAX; pfr_op ++) { From owner-svn-src-all@freebsd.org Mon May 11 18:47:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9A9852E7EA0; Mon, 11 May 2020 18:47:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVLJ1dGqz3Pcc; Mon, 11 May 2020 18:47:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3324F22E0E; Mon, 11 May 2020 18:47:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BIlqic038408; Mon, 11 May 2020 18:47:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BIlqrO038407; Mon, 11 May 2020 18:47:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005111847.04BIlqrO038407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 18:47: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: r360904 - stable/12/sys/riscv/include X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/include X-SVN-Commit-Revision: 360904 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 18:47:52 -0000 Author: jhb Date: Mon May 11 18:47:51 2020 New Revision: 360904 URL: https://svnweb.freebsd.org/changeset/base/360904 Log: MFC 357595: Fix EXCP_MASK to include all relevant bits from scause. While cause codes higher than 16 are reserved, the exception code field of the register is defined to be all bits but the upper-most bit. Modified: stable/12/sys/riscv/include/riscvreg.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/include/riscvreg.h ============================================================================== --- stable/12/sys/riscv/include/riscvreg.h Mon May 11 18:47:38 2020 (r360903) +++ stable/12/sys/riscv/include/riscvreg.h Mon May 11 18:47:51 2020 (r360904) @@ -37,8 +37,7 @@ #ifndef _MACHINE_RISCVREG_H_ #define _MACHINE_RISCVREG_H_ -#define EXCP_SHIFT 0 -#define EXCP_MASK (0xf << EXCP_SHIFT) +#define EXCP_MASK (~EXCP_INTR) #define EXCP_MISALIGNED_FETCH 0 #define EXCP_FAULT_FETCH 1 #define EXCP_ILLEGAL_INSTRUCTION 2 From owner-svn-src-all@freebsd.org Mon May 11 19:07:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 19B692E85F7; Mon, 11 May 2020 19:07:34 +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 49LVn15Vp5z3RBM; Mon, 11 May 2020 19:07: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 B3C7823207; Mon, 11 May 2020 19:07: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 04BJ7XP1051444; Mon, 11 May 2020 19:07:33 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJ7XQs051443; Mon, 11 May 2020 19:07:33 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111907.04BJ7XQs051443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 19:07:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360905 - in head/tests/sys/netpfil: common pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/tests/sys/netpfil: common pf X-SVN-Commit-Revision: 360905 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:07:34 -0000 Author: markj Date: Mon May 11 19:07:33 2020 New Revision: 360905 URL: https://svnweb.freebsd.org/changeset/base/360905 Log: Remove the svn:executable property from some pf test files. The test makefiles will handle setting mode bits during install. Also, Phabricator gets upset when uploading an executable plain-text file without a shebang. MFC after: 1 week Modified: Directory Properties: head/tests/sys/netpfil/common/forward.sh (props changed) head/tests/sys/netpfil/pf/anchor.sh (props changed) head/tests/sys/netpfil/pf/forward.sh (props changed) head/tests/sys/netpfil/pf/fragmentation.sh (props changed) head/tests/sys/netpfil/pf/icmp.sh (props changed) head/tests/sys/netpfil/pf/names.sh (props changed) head/tests/sys/netpfil/pf/nat.sh (props changed) head/tests/sys/netpfil/pf/pass_block.sh (props changed) head/tests/sys/netpfil/pf/pfsync.sh (props changed) head/tests/sys/netpfil/pf/rdr.sh (props changed) head/tests/sys/netpfil/pf/route_to.sh (props changed) head/tests/sys/netpfil/pf/set_skip.sh (props changed) head/tests/sys/netpfil/pf/set_tos.sh (props changed) head/tests/sys/netpfil/pf/synproxy.sh (props changed) From owner-svn-src-all@freebsd.org Mon May 11 19:08:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A090E2E869F; Mon, 11 May 2020 19:08:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVnc1V6Mz3RLx; Mon, 11 May 2020 19:08:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2C23523209; Mon, 11 May 2020 19:08:04 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJ84L8051512; Mon, 11 May 2020 19:08:04 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJ83Te051510; Mon, 11 May 2020 19:08:03 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005111908.04BJ83Te051510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Mon, 11 May 2020 19:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360906 - head/tests/sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/tests/sys/netpfil/pf X-SVN-Commit-Revision: 360906 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:08:04 -0000 Author: markj Date: Mon May 11 19:08:03 2020 New Revision: 360906 URL: https://svnweb.freebsd.org/changeset/base/360906 Log: Add a basic table entry counter regression test. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24809 Added: head/tests/sys/netpfil/pf/table.sh (contents, props changed) Modified: head/tests/sys/netpfil/pf/Makefile Modified: head/tests/sys/netpfil/pf/Makefile ============================================================================== --- head/tests/sys/netpfil/pf/Makefile Mon May 11 19:07:33 2020 (r360905) +++ head/tests/sys/netpfil/pf/Makefile Mon May 11 19:08:03 2020 (r360906) @@ -16,6 +16,7 @@ ATF_TESTS_SH+= anchor \ route_to \ synproxy \ set_skip \ + table \ pfsync \ icmp Added: head/tests/sys/netpfil/pf/table.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/netpfil/pf/table.sh Mon May 11 19:08:03 2020 (r360906) @@ -0,0 +1,115 @@ +# $FreeBSD$ +# +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2020 Mark Johnston +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. + +. $(atf_get_srcdir)/utils.subr + +TABLE_STATS_ZERO_REGEXP='Packets: 0[[:space:]]*Bytes: 0[[:space:]]' +TABLE_STATS_NONZERO_REGEXP='Packets: [1-9][0-9]*[[:space:]]*Bytes: [1-9][0-9]*[[:space:]]' + +atf_test_case "v4_counters" "cleanup" +v4_counters_head() +{ + atf_set descr 'Verify per-address counters for v4' + atf_set require.user root +} + +v4_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a 192.0.2.1/24 up + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b 192.0.2.2/24 up + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 192.0.2.1 }" \ + "block all" \ + "pass in from to any" \ + "pass out from any to " + + atf_check -s exit:0 -o ignore ping -c 3 192.0.2.2 + + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo -T show -vv +} + +v4_counters_cleanup() +{ + pft_cleanup +} + +atf_test_case "v6_counters" "cleanup" +v6_counters_head() +{ + atf_set descr 'Verify per-address counters for v6' + atf_set require.user root +} + +v6_counters_body() +{ + pft_init + + epair_send=$(vnet_mkepair) + ifconfig ${epair_send}a inet6 2001:db8:42::1/64 up no_dad -ifdisabled + + vnet_mkjail alcatraz ${epair_send}b + jexec alcatraz ifconfig ${epair_send}b inet6 2001:db8:42::2/64 up no_dad + jexec alcatraz pfctl -e + + pft_set_rules alcatraz \ + "table counters { 2001:db8:42::1 }" \ + "block all" \ + "pass in from to any" \ + "pass out from any to " + + atf_check -s exit:0 -o ignore ping6 -c 3 2001:db8:42::2 + + atf_check -s exit:0 -e ignore \ + -o match:'In/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'In/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + -o match:'Out/Block:.*'"$TABLE_STATS_ZERO_REGEXP" \ + -o match:'Out/Pass:.*'"$TABLE_STATS_NONZERO_REGEXP" \ + jexec alcatraz pfctl -t foo6 -T show -vv +} + +v6_counters_cleanup() +{ + pft_cleanup +} + +atf_init_test_cases() +{ + atf_add_test_case "v4_counters" + atf_add_test_case "v6_counters" +} From owner-svn-src-all@freebsd.org Mon May 11 19:10:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1A40C2E882B; Mon, 11 May 2020 19:10:24 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrH6yyNz3wlV; Mon, 11 May 2020 19:10:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E637623211; Mon, 11 May 2020 19:10:23 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJANWc051687; Mon, 11 May 2020 19:10:23 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJANTP051686; Mon, 11 May 2020 19:10:23 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJANTP051686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360907 - releng/11.4/release/doc/en_US.ISO8859-1 X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1 X-SVN-Commit-Revision: 360907 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:24 -0000 Author: gjb Date: Mon May 11 19:10:23 2020 New Revision: 360907 URL: https://svnweb.freebsd.org/changeset/base/360907 Log: Add the installation SUBDIR (commented for now). Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/Makefile Mon May 11 19:08:03 2020 (r360906) +++ releng/11.4/release/doc/en_US.ISO8859-1/Makefile Mon May 11 19:10:23 2020 (r360907) @@ -4,6 +4,7 @@ RELN_ROOT?= ${.CURDIR}/.. SUBDIR = relnotes SUBDIR+= hardware +#SUBDIR+= installation SUBDIR+= readme SUBDIR+= errata From owner-svn-src-all@freebsd.org Mon May 11 19:10:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8E3732E8855; Mon, 11 May 2020 19:10:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrL24WGz3wlw; Mon, 11 May 2020 19:10:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A27123213; Mon, 11 May 2020 19:10:26 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJAQXr051776; Mon, 11 May 2020 19:10:26 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJAQfu051775; Mon, 11 May 2020 19:10:26 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJAQfu051775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360909 - releng/11.4/release/doc/en_US.ISO8859-1/installation X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/installation X-SVN-Commit-Revision: 360909 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:26 -0000 Author: gjb Date: Mon May 11 19:10:25 2020 New Revision: 360909 URL: https://svnweb.freebsd.org/changeset/base/360909 Log: Update version information in the installation page. Bump the copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml Mon May 11 19:10:24 2020 (r360908) +++ releng/11.4/release/doc/en_US.ISO8859-1/installation/article.xml Mon May 11 19:10:25 2020 (r360909) @@ -4,7 +4,7 @@ %release; - + ]>
$FreeBSD$ - 2018 + 2020 The &os; Documentation Project @@ -82,8 +82,7 @@ The &man.freebsd-update.8; utility supports binary upgrades of &arch.i386; and &arch.amd64; systems running earlier FreeBSD releases. Systems running - 10.3-RELEASE, - 11.0-RELEASE can upgrade as follows: + 11.3-RELEASE can upgrade as follows: &prompt.root; freebsd-update fetch &prompt.root; freebsd-update install From owner-svn-src-all@freebsd.org Mon May 11 19:10:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BE0D2E8838; Mon, 11 May 2020 19:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrK0dDMz3wlW; Mon, 11 May 2020 19:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10D1E23212; Mon, 11 May 2020 19:10:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJAO37051733; Mon, 11 May 2020 19:10:24 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJAOpc051732; Mon, 11 May 2020 19:10:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJAOpc051732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360908 - releng/11.4/release/doc/share/xml X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/share/xml X-SVN-Commit-Revision: 360908 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:25 -0000 Author: gjb Date: Mon May 11 19:10:24 2020 New Revision: 360908 URL: https://svnweb.freebsd.org/changeset/base/360908 Log: Update version number information in release.ent. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/share/xml/release.ent Modified: releng/11.4/release/doc/share/xml/release.ent ============================================================================== --- releng/11.4/release/doc/share/xml/release.ent Mon May 11 19:10:23 2020 (r360907) +++ releng/11.4/release/doc/share/xml/release.ent Mon May 11 19:10:24 2020 (r360908) @@ -6,7 +6,7 @@ - + - + - + @@ -37,10 +37,10 @@ or "release" --> - + - - + + From owner-svn-src-all@freebsd.org Mon May 11 19:10:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C4AA2E8886; Mon, 11 May 2020 19:10:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrN1xcFz3wnT; Mon, 11 May 2020 19:10:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 547D723214; Mon, 11 May 2020 19:10:27 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJARC3051819; Mon, 11 May 2020 19:10:27 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJARU7051818; Mon, 11 May 2020 19:10:27 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJARU7051818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360910 - releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 360910 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:30 -0000 Author: gjb Date: Mon May 11 19:10:26 2020 New Revision: 360910 URL: https://svnweb.freebsd.org/changeset/base/360910 Log: Prune entries from 11.3-RELEASE. Bump copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 11 19:10:25 2020 (r360909) +++ releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Mon May 11 19:10:26 2020 (r360910) @@ -24,10 +24,8 @@ $FreeBSD$ - - - 2019 + 2020 The &os; Documentation Project @@ -161,151 +159,19 @@ Userland Configuration Changes - The &man.jail.8; utility has been - updated to include a new &man.jail.conf.5; parameter, - allow.read_msgbuf, which prevents jailed - processes and users from accessing the &man.dmesg.8; buffer. - This parameter is set to false by - default. - - The system &man.crontab.5;, - /etc/crontab, has been updated to set - PATH for consistency with the &man.cron.8; - daemon. - - The default &man.devd.conf.5; has been - updated to prevent duplicated &man.hostapd.8; and - &man.wpa.supplicant.8; startup via &man.devd.8;. +   Userland Application Changes - The &man.cpuset.1;, &man.sockstat.1;, - &man.ipfw.8;, and &man.ugidfw.8; utilities have been updated - to support &man.jail.8; names. - - The &man.newfs.msdos.8; utililty has - been updated to include a new flag, -T, - which is used to specify the timestamp for build - reproducibility. - - The &man.dd.1; utility has been updated - to add a new statusoperand, - progress, which reports the current status - on a single line every second. - - The &man.last.1; utility has been - updated to include &man.libxo.3; support. - - The &man.lastlogin.8; utility has been - updated to include &man.libxo.3; support. - - The &man.traceroute.8; utility has been - updated to include &man.libcasper.3; support. - - The &man.diff.1; utility has been - updated to implement -B and - --ignore-blank-lines support. - - The &man.makewhatis.1; utility has been - updated to prevent operating within read-only - directories. - - The &man.jail.8; utility has been - updated to add a new flag, -e, which takes - a &man.jail.conf.5; parameter as an argument and prints a list - of non-wildcard jails with the specified parameter. - - The &man.ktrdump.8; utility has been - updated to include the -l flag which - enables "live" mode when specified. - - The &man.trim.8; utility has been added, - which deletes content for blocks on flash-based storage - devices that use wear-leveling algorithms. - - The &man.gzip.1; utility has been - updated to add -l support for &man.xz.1; - files. - - The &man.newfs.8; and &man.tunefs.8; - utilities have been updated to allow underscores in label - names. - - The &man.pfctl.8; utility has been - updated to provide clearer output and reference the - net.pf.request_maxcount &man.sysctl.8; - if a defined table is too large. - - The &man.newfs.8; and &man.tunefs.8; - utilities have been updated to allow dashes in label - names. - - The &man.fdisk.8; utility has been - updated to support sectors larger than 2048 bytes. - - The &man.sh.1; utility has been updated - to add the pipefail option which simplifies - checking the exit status of all commands in a pipeline. - - The &man.patch.1; utility has been - updated to exit successfully if the input patch file is - zero-length. +   Contributed Software - The &man.xz.1; utility has been updated - to version 5.2.4. - - The &man.file.1; utility has been - updated to version 5.34. - - The - ELF Tool Chain has been updated to - version r3614. - - The - lld utility has been updated to add - -z interpose, marking the object file as - an interposer. - - The &man.file.1; utility has been - updated to fix incorrect date reporting for &man.dump.8; - files. - - The LUA - &man.loader.8; has been merged. - - The &man.ntpd.8; utilities have been - updated to version 4.2.8p13. - - Timezone data files have been updated to - version 2019a. - - The clang, - llvm, - lld, - lldb, and - compiler-rt utilities as well as - libc++ have been updated to - upstream version 8.0.0. - - The WPA - utilities have been updated to version 2.8. - - OpenSSL has - been updated to version 1.0.2s. - - The &man.libarchive.3; library has been - updated to version 3.3.3, with additional fixes from - upstream. - - OpenPAM has - been updated to the latest upstream version. +   @@ -318,56 +184,20 @@ <filename class="directory">/etc/rc.d</filename> Scripts - Support for auxiliary - RAM has been added to - /etc/rc.initdiskless. - - The &man.rcorder.8; utility has been - updated to add support for - /etc/rc.resume. - - The jail_conf - definition, which defaults to - /etc/jail.conf, has been moved from - the &man.jail.8; &man.rc.8; script to - /etc/defaults/rc.conf. - - The rc_service - variable has been added to &man.rc.subr.8;, which defaults to - the path of the service being executed in case the service - needs to re-invoke itself. +   <filename class="directory">/etc/periodic</filename> Scripts - The &man.periodic.8; weekly - 340.noid script has been updated to - prevent decending into the root directory of jails. +   Runtime Libraries and API - The &man.pcap.3; library has been - updated to version 1.9.0 (pre-release). - - The &man.setproctitle.fast.3; function - has been added, which is optimized for high-frequency process - title updates. - - The &man.kqueue.2; system call has been - updated to allow updating - EVFILT_TIMER. - - The &man.pthread.get.name.np.3; function - has been added, which is used to retrieve the function name - associated with a thread. - - The &man.pthread.3; library has been - updated to improve POSIX compliance. +   @@ -393,25 +223,7 @@ General Kernel Changes - The &man.ddb.4; debugging utility has been - updated to print command-line arguments to a process. - - The number of MSI - IRQs have been converted from a constant to - a tunable. The default remains at 512, - which can now be changed during boot with the - machdep.num_msi_irqs &man.sysctl.8;. - - The kernel will now log the &man.jail.8; - ID when logging a process exit. The - &man.jail.8; ID 0 - represents processes that are not jailed. - - Warnings for features deprecated in - future releases will now be printed on all &os; - versions. +   @@ -448,14 +260,7 @@ Device Drivers - The &man.ichwd.4; driver has been updated - to include support for TCO watchdog timers - in the Lewisburg PCH (C620) chipset. - - The &man.random.4; driver has been - updated to improve performance during expensive - reseeding. +   @@ -467,30 +272,7 @@ Network Drivers - The TP-Link® TL-WN321G™ - network adapter now uses the &man.run.4; driver instead of the - &man.rum.4; driver. - - The - &man.lagg.4; driver has been updated to allow changing the - MTU without requiring destroying and - recreating the interface. - - The &man.ccr.4; driver has been added, - providing support for Chelsio® T6™ cryptography - accelerators. - - The &man.cxgbe.4; driver has been updated - to include support for hash filters, NAT - offloading, and - SMAC/DMAC swapping - filters. - - The &man.cxgbe.4; T4, T5, and T6 firmware - has been updated to version 1.23.0.0. +   @@ -505,18 +287,13 @@ Hardware Support - The &man.vt.4; keyboard mapping has been - updated to include uk.macbook.kbd - support. +   Virtualization Support - Support - for PS/2 scan codes for - NumLock, ScrollLock, and - numerical keypad keys has been added to &man.bhyve.8;. +   @@ -535,8 +312,7 @@ General Storage - Deprecation warnings have been added for - weaker algorithms when creating &man.geli.8; providers. +   @@ -548,14 +324,7 @@ ZFS - An - issue that could result in a system hang during - ZFS vnode reclamation has been - fixed. - - The - ZFS filesystem has been updated to - implement parallel mounting. +   @@ -574,21 +343,7 @@ Boot Loader Changes - The functionality provided by - zfsloader has been added to - &man.loader.8;. Once the system boot blocks have been updated - following UPDATING, - zfsloader is no longer needed. A hard - link to &man.loader.8; has been added to ease in the - transition. - - The &man.loader.8; has been updated to - extend &man.geli.8; support to all architectures. - - The UEFI boot - &man.loader.8; has been updated to better determine the system - console type and device if not defined in - &man.loader.conf.5;. +   @@ -607,15 +362,7 @@ General Network Changes - The &man.ipfw.8; firewall has been - updated to include new rule options, - record-state, set-limit, - and defer-action. - - Support for NAT64 - CLAT has been added, as defined in - RFC6877. +   From owner-svn-src-all@freebsd.org Mon May 11 19:10:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D16562E88AF; Mon, 11 May 2020 19:10:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrS20byz3wrM; Mon, 11 May 2020 19:10:32 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A0B3323216; Mon, 11 May 2020 19:10:29 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJATq8051905; Mon, 11 May 2020 19:10:29 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJAT4Z051904; Mon, 11 May 2020 19:10:29 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJAT4Z051904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360912 - releng/11.4/release/doc/en_US.ISO8859-1/readme X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/readme X-SVN-Commit-Revision: 360912 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:36 -0000 Author: gjb Date: Mon May 11 19:10:29 2020 New Revision: 360912 URL: https://svnweb.freebsd.org/changeset/base/360912 Log: Fix a mailing list reference. Bump copyright year while here. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 11 19:10:28 2020 (r360911) +++ releng/11.4/release/doc/en_US.ISO8859-1/readme/article.xml Mon May 11 19:10:29 2020 (r360912) @@ -44,6 +44,8 @@ 2016 2017 2018 + 2019 + 2020 The &os; Documentation Project @@ -231,7 +233,7 @@ please send mail to the &a.questions;. If you are tracking the &release.branch; development - efforts, you must join the &a.current;, + efforts, you must join the &a.stable;, in order to keep abreast of recent developments and changes that may affect the way you use and maintain the system. From owner-svn-src-all@freebsd.org Mon May 11 19:10:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E4D6F2E88A7; Mon, 11 May 2020 19:10:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVrR0Ts9z3wqT; Mon, 11 May 2020 19:10:30 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CB3023215; Mon, 11 May 2020 19:10:28 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJASfC051862; Mon, 11 May 2020 19:10:28 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJASx1051861; Mon, 11 May 2020 19:10:28 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111910.04BJASx1051861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:10:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360911 - releng/11.4/release/doc/en_US.ISO8859-1/errata X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 360911 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:10:43 -0000 Author: gjb Date: Mon May 11 19:10:28 2020 New Revision: 360911 URL: https://svnweb.freebsd.org/changeset/base/360911 Log: Prune open issues and late-breaking news sections from the errata page. Note that the errata page will be maintained until 11.4 reaches EoL. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Mon May 11 19:10:26 2020 (r360910) +++ releng/11.4/release/doc/en_US.ISO8859-1/errata/article.xml Mon May 11 19:10:28 2020 (r360911) @@ -49,8 +49,7 @@ &os;. This errata document for &os; &release; will be maintained - until the release of &os; &release.next; (if - applicable). + until &os; &release; reaches end-of-life. @@ -97,38 +96,8 @@ - [2019-07-04] An issue which can cause a crash when - connecting to a &man.bhyve.4; instance with - a VNC client under certain circumstances - had been reported. An errata notice is planned - post-release. + No open issues. - - - [2019-07-04] An issue booting &man.bhyve.4; virtual - machines compiled with &man.clang.1; version 8.0.0 or later - had been reported late in the release cycle. An errata - notice is planned post-release. - - This issue is believed to only affect OpenBSD virtual - machines compiled with &man.clang.1;. - - - - [2019-07-04] An issue when upgrading from &os; 11.3 - to &os; 12.0 (which occurred earlier in time, - comparatively), had been reported where the - com.delphix:spacemap_v2 &man.zpool.8; - feature does not exist on &os; 12.0, will fail to - import the ZFS pool. - - At this time, it is advised to defer migrating from - &os; 11.3 to &os; 12.x until &os; 12.1 is - available. - - Upgrading from earlier &os; 11.x releases to - &os; 12.0 are believed to be unaffected. - @@ -137,27 +106,7 @@ - [2019-12-06] An issue has been reported with the - &os; 11.3-RELEASE images on the Google Compute Engine - platform which causes virtual machines to fail to start - properly. - - While we intend to investigate how to handle similar - situations should they arise in the future, updated images - will not be provided as of this time. - - Users wanting to use &os; in Google Compute Engine are - advised to use 12.0-RELEASE or 12.1-RELEASE, or for those - who wish to track 11.X, the - freebsd-11-3-stable-amd64-v20190801 - snapshot from stable/11 has been - - reported to work correctly. - - More details can be found in PR - 242303. + No late-breaking news. From owner-svn-src-all@freebsd.org Mon May 11 19:16:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6B6AC2E8C94; Mon, 11 May 2020 19:16:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LVzk2Cmfz3xlh; Mon, 11 May 2020 19:16:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47516233E6; Mon, 11 May 2020 19:16:50 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJGoEI057846; Mon, 11 May 2020 19:16:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJGogJ057845; Mon, 11 May 2020 19:16:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005111916.04BJGogJ057845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Mon, 11 May 2020 19:16:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360913 - releng/11.4/release/doc/en_US.ISO8859-1 X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1 X-SVN-Commit-Revision: 360913 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:16:50 -0000 Author: gjb Date: Mon May 11 19:16:49 2020 New Revision: 360913 URL: https://svnweb.freebsd.org/changeset/base/360913 Log: Uncomment the installation SUBDIR entry. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile Modified: releng/11.4/release/doc/en_US.ISO8859-1/Makefile ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/Makefile Mon May 11 19:10:29 2020 (r360912) +++ releng/11.4/release/doc/en_US.ISO8859-1/Makefile Mon May 11 19:16:49 2020 (r360913) @@ -4,7 +4,7 @@ RELN_ROOT?= ${.CURDIR}/.. SUBDIR = relnotes SUBDIR+= hardware -#SUBDIR+= installation +SUBDIR+= installation SUBDIR+= readme SUBDIR+= errata From owner-svn-src-all@freebsd.org Mon May 11 19:17:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 76FCA2E8CF8; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LW0Z2WsRz3xsc; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 51F3C233E7; Mon, 11 May 2020 19:17:34 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJHYKu057927; Mon, 11 May 2020 19:17:34 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJHYJj057926; Mon, 11 May 2020 19:17:34 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005111917.04BJHYJj057926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 11 May 2020 19:17:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360914 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 360914 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:17:34 -0000 Author: gallatin Date: Mon May 11 19:17:33 2020 New Revision: 360914 URL: https://svnweb.freebsd.org/changeset/base/360914 Log: Ktls: never skip stamping tags for NIC TLS The newer RACK and BBR TCP stacks have added a mechanism to disable hardware packet pacing for TCP retransmits. This mechanism works by skipping the send-tag stamp on rate-limited connections when the TCP stack calls ip_output() with the IP_NO_SND_TAG_RL flag set. When doing NIC TLS, we must ignore this flag, as NIC TLS packets must always be stamped. Failure to stamp a NIC TLS packet will result in crypto issues. Reviewed by: hselasky, rrs Sponsored by: Netflix, Mellanox Modified: head/sys/netinet/ip_output.c head/sys/netinet6/ip6_output.c Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Mon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet/ip_output.c Mon May 11 19:17:33 2020 (r360914) @@ -242,6 +242,10 @@ ip_output_send(struct inpcb *inp, struct ifnet *ifp, s error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon May 11 19:16:49 2020 (r360913) +++ head/sys/netinet6/ip6_output.c Mon May 11 19:17:33 2020 (r360914) @@ -353,6 +353,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT From owner-svn-src-all@freebsd.org Mon May 11 19:36:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3EF9F2E9689; Mon, 11 May 2020 19:36:39 +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 49LWQb0zW1z40FF; Mon, 11 May 2020 19:36:39 +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 1C525237A4; Mon, 11 May 2020 19:36:39 +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 04BJacaP070027; Mon, 11 May 2020 19:36:38 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJac6K070026; Mon, 11 May 2020 19:36:38 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005111936.04BJac6K070026@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 11 May 2020 19:36:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360915 - head/lib/csu X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/lib/csu X-SVN-Commit-Revision: 360915 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:36:39 -0000 Author: dim Date: Mon May 11 19:36:38 2020 New Revision: 360915 URL: https://svnweb.freebsd.org/changeset/base/360915 Log: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24797 Modified: head/lib/csu/Makefile.inc Modified: head/lib/csu/Makefile.inc ============================================================================== --- head/lib/csu/Makefile.inc Mon May 11 19:17:33 2020 (r360914) +++ head/lib/csu/Makefile.inc Mon May 11 19:36:38 2020 (r360915) @@ -13,6 +13,9 @@ NO_WMISSING_VARIABLE_DECLARATIONS= OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + CFLAGS_CRTS= -DSHARED ${PICFLAG} crtbegin.o: crtbegin.c From owner-svn-src-all@freebsd.org Mon May 11 19:57:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A01D62E9D5A; Mon, 11 May 2020 19:57:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LWtx3lZ6z41RS; Mon, 11 May 2020 19:57:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BBD923B92; Mon, 11 May 2020 19:57:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BJvjWE082693; Mon, 11 May 2020 19:57:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BJvjvE082692; Mon, 11 May 2020 19:57:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005111957.04BJvjvE082692@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 19:57: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: r360916 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 360916 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 19:57:45 -0000 Author: jhb Date: Mon May 11 19:57:45 2020 New Revision: 360916 URL: https://svnweb.freebsd.org/changeset/base/360916 Log: MFC 357594: Use csr_read() to read sstatus instead of inline assembly. While here, remove a local variable to avoid the CSR read in non-debug kernels. Modified: stable/12/sys/riscv/riscv/trap.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/trap.c ============================================================================== --- stable/12/sys/riscv/riscv/trap.c Mon May 11 19:36:38 2020 (r360915) +++ stable/12/sys/riscv/riscv/trap.c Mon May 11 19:57:45 2020 (r360916) @@ -246,12 +246,10 @@ void do_trap_supervisor(struct trapframe *frame) { uint64_t exception; - uint64_t sstatus; /* Ensure we came from supervisor mode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=&r" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == SSTATUS_SPP, - ("We must came from S mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == + SSTATUS_SPP, ("Came from S mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { @@ -306,7 +304,6 @@ do_trap_user(struct trapframe *frame) { uint64_t exception; struct thread *td; - uint64_t sstatus; struct pcb *pcb; td = curthread; @@ -314,9 +311,8 @@ do_trap_user(struct trapframe *frame) pcb = td->td_pcb; /* Ensure we came from usermode, interrupts disabled */ - __asm __volatile("csrr %0, sstatus" : "=&r" (sstatus)); - KASSERT((sstatus & (SSTATUS_SPP | SSTATUS_SIE)) == 0, - ("We must came from U mode with interrupts disabled")); + KASSERT((csr_read(sstatus) & (SSTATUS_SPP | SSTATUS_SIE)) == 0, + ("Came from U mode with interrupts enabled")); exception = (frame->tf_scause & EXCP_MASK); if (frame->tf_scause & EXCP_INTR) { From owner-svn-src-all@freebsd.org Mon May 11 20:10:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5A162EA0BA; Mon, 11 May 2020 20:10:01 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LX954tcmz41yV; Mon, 11 May 2020 20:10:01 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A303223D74; Mon, 11 May 2020 20:10:01 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKA1ie088749; Mon, 11 May 2020 20:10:01 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKA1dh088748; Mon, 11 May 2020 20:10:01 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005112010.04BKA1dh088748@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Mon, 11 May 2020 20:10: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: r360917 - stable/12/sys/dev/pci X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/dev/pci X-SVN-Commit-Revision: 360917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:10:01 -0000 Author: jhibbits Date: Mon May 11 20:10:01 2020 New Revision: 360917 URL: https://svnweb.freebsd.org/changeset/base/360917 Log: MFC r350571: Fix the build after r350570. Signed char cannot compare to values above 0x7f. Use unsigned instead. Modified: stable/12/sys/dev/pci/vga_pci.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/pci/vga_pci.c ============================================================================== --- stable/12/sys/dev/pci/vga_pci.c Mon May 11 19:57:45 2020 (r360916) +++ stable/12/sys/dev/pci/vga_pci.c Mon May 11 20:10:01 2020 (r360917) @@ -170,7 +170,7 @@ vga_pci_map_bios(device_t dev, size_t *size) device_t pcib; uint32_t rom_addr; uint16_t config; - volatile char *bios; + volatile unsigned char *bios; int i, rid, found; #if defined(__amd64__) || defined(__i386__) From owner-svn-src-all@freebsd.org Mon May 11 20:30:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6905C2EAB5C; Mon, 11 May 2020 20:30:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXcl28BNz44y0; Mon, 11 May 2020 20:30:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 44BF82417D; Mon, 11 May 2020 20:30:31 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKUVAE004150; Mon, 11 May 2020 20:30:31 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKUTBt004140; Mon, 11 May 2020 20:30:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112030.04BKUTBt004140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys X-SVN-Commit-Revision: 360918 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:30:31 -0000 Author: jhb Date: Mon May 11 20:30:28 2020 New Revision: 360918 URL: https://svnweb.freebsd.org/changeset/base/360918 Log: Remove ubsec(4). This driver was previously marked for deprecation in r360710. Approved by: csprng (cem, gordon, delphij) Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24766 Deleted: head/share/man/man4/ubsec.4 head/sys/dev/ubsec/ubsec.c head/sys/dev/ubsec/ubsecreg.h head/sys/dev/ubsec/ubsecvar.h head/sys/modules/ubsec/Makefile Modified: head/ObsoleteFiles.inc head/share/man/man4/Makefile head/share/man/man4/crypto.4 head/share/man/man4/rndtest.4 head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options head/sys/dev/random/random_harvestq.c head/sys/modules/Makefile head/sys/sys/random.h Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Mon May 11 20:10:01 2020 (r360917) +++ head/ObsoleteFiles.inc Mon May 11 20:30:28 2020 (r360918) @@ -36,6 +36,9 @@ # xargs -n1 | sort | uniq -d; # done +# 2020xxxx: Remove ubsec(4) +OLD_FILES+=usr/share/man/man4/ubsec.4.gz + # 20200506: GNU objdump 2.17.50 retired OLD_FILES+=usr/bin/objdump OLD_FILES+=usr/share/man/man1/objdump.1.gz Modified: head/share/man/man4/Makefile ============================================================================== --- head/share/man/man4/Makefile Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/Makefile Mon May 11 20:30:28 2020 (r360918) @@ -966,7 +966,6 @@ MAN+= \ uart.4 \ uath.4 \ ubsa.4 \ - ubsec.4 \ ubser.4 \ ubtbcmfw.4 \ uchcom.4 \ Modified: head/share/man/man4/crypto.4 ============================================================================== --- head/share/man/man4/crypto.4 Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/crypto.4 Mon May 11 20:30:28 2020 (r360918) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 4 .Os .Sh NAME @@ -424,7 +424,6 @@ The semantics of these arguments are currently undocum .Xr ipsec 4 , .Xr padlock 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 7 , .Xr geli 8 , .Xr crypto 9 Modified: head/share/man/man4/rndtest.4 ============================================================================== --- head/share/man/man4/rndtest.4 Mon May 11 20:10:01 2020 (r360917) +++ head/share/man/man4/rndtest.4 Mon May 11 20:30:28 2020 (r360918) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 11, 2003 +.Dd May 11, 2020 .Dt RNDTEST 4 .Os .Sh NAME @@ -54,7 +54,6 @@ Failures are optionally reported on the console. .Xr hifn 4 , .Xr random 4 , .Xr safe 4 , -.Xr ubsec 4 , .Xr crypto 9 .Sh HISTORY The idea for this and the original code came from Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/NOTES Mon May 11 20:30:28 2020 (r360918) @@ -2630,10 +2630,6 @@ device hifn # Hifn 7951, 7781, etc. options HIFN_DEBUG # enable debugging support: hw.hifn.debug options HIFN_RNDTEST # enable rndtest support -device ubsec # Broadcom 5501, 5601, 58xx -options UBSEC_DEBUG # enable debugging support: hw.ubsec.debug -options UBSEC_RNDTEST # enable rndtest support - ##################################################################### Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/files Mon May 11 20:30:28 2020 (r360918) @@ -3182,7 +3182,6 @@ dev/uart/uart_dev_z8530.c optional uart uart_z8530 | u dev/uart/uart_if.m optional uart dev/uart/uart_subr.c optional uart dev/uart/uart_tty.c optional uart -dev/ubsec/ubsec.c optional ubsec # # USB controller drivers # Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon May 11 20:10:01 2020 (r360917) +++ head/sys/conf/options Mon May 11 20:30:28 2020 (r360918) @@ -734,11 +734,6 @@ BCE_NVRAM_WRITE_SUPPORT opt_bce.h SOCKBUF_DEBUG opt_global.h -# options for ubsec driver -UBSEC_DEBUG opt_ubsec.h -UBSEC_RNDTEST opt_ubsec.h -UBSEC_NO_RNG opt_ubsec.h - # options for hifn driver HIFN_DEBUG opt_hifn.h HIFN_RNDTEST opt_hifn.h Modified: head/sys/dev/random/random_harvestq.c ============================================================================== --- head/sys/dev/random/random_harvestq.c Mon May 11 20:10:01 2020 (r360917) +++ head/sys/dev/random/random_harvestq.c Mon May 11 20:30:28 2020 (r360918) @@ -347,7 +347,6 @@ static const char *random_source_descr[ENTROPYSOURCE] [RANDOM_PURE_OCTEON] = "PURE_OCTEON", /* PURE_START */ [RANDOM_PURE_SAFE] = "PURE_SAFE", [RANDOM_PURE_GLXSB] = "PURE_GLXSB", - [RANDOM_PURE_UBSEC] = "PURE_UBSEC", [RANDOM_PURE_HIFN] = "PURE_HIFN", [RANDOM_PURE_RDRAND] = "PURE_RDRAND", [RANDOM_PURE_NEHEMIAH] = "PURE_NEHEMIAH", Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon May 11 20:10:01 2020 (r360917) +++ head/sys/modules/Makefile Mon May 11 20:30:28 2020 (r360918) @@ -354,7 +354,6 @@ SUBDIR= \ twe \ tws \ uart \ - ubsec \ udf \ udf_iconv \ ufs \ Modified: head/sys/sys/random.h ============================================================================== --- head/sys/sys/random.h Mon May 11 20:10:01 2020 (r360917) +++ head/sys/sys/random.h Mon May 11 20:30:28 2020 (r360918) @@ -92,7 +92,6 @@ enum random_entropy_source { RANDOM_PURE_OCTEON = RANDOM_PURE_START, RANDOM_PURE_SAFE, RANDOM_PURE_GLXSB, - RANDOM_PURE_UBSEC, RANDOM_PURE_HIFN, RANDOM_PURE_RDRAND, RANDOM_PURE_NEHEMIAH, From owner-svn-src-all@freebsd.org Mon May 11 20:34:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 683542EB122; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@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 49LXjn274Lz45c5; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4419A2434A; Mon, 11 May 2020 20:34:53 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKYruw009954; Mon, 11 May 2020 20:34:53 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKYq1J009950; Mon, 11 May 2020 20:34:52 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005112034.04BKYq1J009950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 11 May 2020 20:34:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360919 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 360919 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:34:53 -0000 Author: mr Date: Mon May 11 20:34:52 2020 New Revision: 360919 URL: https://svnweb.freebsd.org/changeset/base/360919 Log: Patch systat -zarc to display cumulative rate and round down large numbers by SI units PR: 237664 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Modified: head/usr.bin/systat/Makefile head/usr.bin/systat/extern.h head/usr.bin/systat/main.c head/usr.bin/systat/zarc.c Modified: head/usr.bin/systat/Makefile ============================================================================== --- head/usr.bin/systat/Makefile Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/Makefile Mon May 11 20:34:52 2020 (r360919) @@ -4,7 +4,7 @@ .include PROG= systat -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c sysput.c \ netcmds.c netstat.c pigs.c swap.c icmp.c \ mode.c ip.c sctp.c tcp.c zarc.c \ vmstat.c convtbl.c ifcmds.c ifstat.c Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/extern.h Mon May 11 20:34:52 2020 (r360919) @@ -165,6 +165,8 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); +void sysputstrs(WINDOW* , int, int, int); +void sysputuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ @@ -176,4 +178,4 @@ char *sysctl_dynread(const char *, size_t *); void show ## name(void) SYSTAT_CMD( zarc ); -SYSTAT_CMD ( sctp ); +SYSTAT_CMD( sctp ); Modified: head/usr.bin/systat/main.c ============================================================================== --- head/usr.bin/systat/main.c Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/main.c Mon May 11 20:34:52 2020 (r360919) @@ -300,17 +300,8 @@ display(void) GETSYSCTL("kstat.zfs.misc.arcstats.dbuf_size", arc_stat); arc[6] += arc_stat; wmove(wload, 0, 0); wclrtoeol(wload); - for (i = 0 ; i < nitems(arc); i++) { - if (arc[i] > 10llu * 1024 * 1024 * 1024 ) { - wprintw(wload, "%7lluG", arc[i] >> 30); - } - else if (arc[i] > 10 * 1024 * 1024 ) { - wprintw(wload, "%7lluM", arc[i] >> 20); - } - else { - wprintw(wload, "%7lluK", arc[i] >> 10); - } - } + for (i = 0 ; i < nitems(arc); i++) + sysputuint64(wload, 0, i*8+2, 6, arc[i], 0); } } (*curcmd->c_refresh)(); Modified: head/usr.bin/systat/zarc.c ============================================================================== --- head/usr.bin/systat/zarc.c Mon May 11 20:30:28 2020 (r360918) +++ head/usr.bin/systat/zarc.c Mon May 11 20:34:52 2020 (r360919) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 - 2017 Yoshihiro Ota + * Copyright (c) 2014 - 2017, 2019 Yoshihiro Ota * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,16 +32,16 @@ __FBSDID("$FreeBSD$"); #include #include -/* #include */ #include #include #include +#include #include "systat.h" #include "extern.h" #include "devs.h" -struct zfield{ +struct zfield { uint64_t arcstats; uint64_t arcstats_demand_data; uint64_t arcstats_demand_metadata; @@ -57,18 +57,25 @@ static struct zarcstats { struct zfield misses; } curstat, initstat, oldstat; +struct zarcrates { + struct zfield current; + struct zfield total; +}; + static void getinfo(struct zarcstats *ls); WINDOW * openzarc(void) { - return (subwin(stdscr, LINES-3-1, 0, MAINWIN_ROW, 0)); + + return (subwin(stdscr, LINES - 3 - 1, 0, MAINWIN_ROW, 0)); } void closezarc(WINDOW *w) { + if (w == NULL) return; wclear(w); @@ -80,12 +87,12 @@ void labelzarc(void) { int row = 1; + wmove(wnd, 0, 0); wclrtoeol(wnd); - mvwprintw(wnd, 0, 31+1, "%4.4s %7.7s %7.7s %12.12s %12.12s", - "rate", "hits", "misses", "total hits", "total misses"); -#define L(str) mvwprintw(wnd, row, 5, #str); \ - mvwprintw(wnd, row, 31, ":"); \ - mvwprintw(wnd, row, 31+4, "%%"); ++row + mvwprintw(wnd, 0, 31+1, "%4.4s %6.6s %6.6s | Total %4.4s %6.6s %6.6s", + "Rate", "Hits", "Misses", "Rate", "Hits", "Misses"); +#define L(str) mvwprintw(wnd, row++, 5, \ + "%-26.26s: %% | %%", #str) L(arcstats); L(arcstats.demand_data); L(arcstats.demand_metadata); @@ -98,21 +105,23 @@ labelzarc(void) dslabel(12, 0, 18); } -static int calc(uint64_t hits, uint64_t misses) +static int +calc_rate(uint64_t hits, uint64_t misses) { - if( hits ) - return 100 * hits / ( hits + misses ); + if(hits) + return 100 * hits / (hits + misses); else return 0; } static void -domode(struct zarcstats *delta, struct zarcstats *rate) +domode(struct zarcstats *delta, struct zarcrates *rate) { #define DO(stat) \ delta->hits.stat = (curstat.hits.stat - oldstat.hits.stat); \ delta->misses.stat = (curstat.misses.stat - oldstat.misses.stat); \ - rate->hits.stat = calc(delta->hits.stat, delta->misses.stat) + rate->current.stat = calc_rate(delta->hits.stat, delta->misses.stat); \ + rate->total.stat = calc_rate(curstat.hits.stat, curstat.misses.stat) DO(arcstats); DO(arcstats_demand_data); DO(arcstats_demand_metadata); @@ -136,21 +145,20 @@ void showzarc(void) { int row = 1; - struct zarcstats delta, rate; + struct zarcstats delta = {}; + struct zarcrates rate = {}; - memset(&delta, 0, sizeof delta); - memset(&rate, 0, sizeof rate); - domode(&delta, &rate); -#define DO(stat, col, fmt) \ - mvwprintw(wnd, row, col, fmt, stat) -#define R(stat) DO(rate.hits.stat, 31+1, "%3"PRIu64) -#define H(stat) DO(delta.hits.stat, 31+1+5, "%7"PRIu64); \ - DO(curstat.hits.stat, 31+1+5+8+8, "%12"PRIu64) -#define M(stat) DO(delta.misses.stat, 31+1+5+8, "%7"PRIu64); \ - DO(curstat.misses.stat, 31+1+5+8+8+13, "%12"PRIu64) -#define E(stat) R(stat); H(stat); M(stat); ++row +#define DO(stat, col, width) \ + sysputuint64(wnd, row, col, width, stat, HN_DIVISOR_1000) +#define RATES(stat) mvwprintw(wnd, row, 31+1, "%3"PRIu64, rate.current.stat);\ + mvwprintw(wnd, row, 31+1+5+7+7+8, "%3"PRIu64, rate.total.stat) +#define HITS(stat) DO(delta.hits.stat, 31+1+5, 6); \ + DO(curstat.hits.stat, 31+1+5+7+7+8+5, 6) +#define MISSES(stat) DO(delta.misses.stat, 31+1+5+7, 6); \ + DO(curstat.misses.stat, 31+1+5+7+7+8+5+7, 6) +#define E(stat) RATES(stat); HITS(stat); MISSES(stat); ++row E(arcstats); E(arcstats_demand_data); E(arcstats_demand_metadata); @@ -161,9 +169,9 @@ showzarc(void) E(vdev_cache_stats); #undef DO #undef E -#undef M -#undef H -#undef R +#undef MISSES +#undef HITS +#undef RATES dsshow(12, 0, 18, &cur_dev, &last_dev); } @@ -180,6 +188,7 @@ initzarc(void) void resetzarc(void) { + initzarc(); } @@ -193,11 +202,11 @@ getinfo(struct zarcstats *ls) cur_dev.dinfo = tmp_dinfo; last_dev.snap_time = cur_dev.snap_time; - dsgetinfo( &cur_dev ); + dsgetinfo(&cur_dev); - size_t size = sizeof( ls->hits.arcstats ); - if ( sysctlbyname("kstat.zfs.misc.arcstats.hits", - &ls->hits.arcstats, &size, NULL, 0 ) != 0 ) + size_t size = sizeof(ls->hits.arcstats); + if (sysctlbyname("kstat.zfs.misc.arcstats.hits", + &ls->hits.arcstats, &size, NULL, 0) != 0) return; GETSYSCTL("kstat.zfs.misc.arcstats.misses", ls->misses.arcstats); @@ -234,6 +243,7 @@ getinfo(struct zarcstats *ls) void fetchzarc(void) { + oldstat = curstat; getinfo(&curstat); } From owner-svn-src-all@freebsd.org Mon May 11 20:40:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B44692EB45D; Mon, 11 May 2020 20:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXrJ4H62z46KJ; Mon, 11 May 2020 20:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E1A42438C; Mon, 11 May 2020 20:40:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKeWCR010309; Mon, 11 May 2020 20:40:32 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKeUlr010298; Mon, 11 May 2020 20:40:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112040.04BKeUlr010298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:40:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360920 - in head: share/man/man4 share/man/man9 sys/dev/cesa sys/dev/hifn sys/dev/sec sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/dev/cesa sys/dev/hifn sys/dev/sec sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360920 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:40:32 -0000 Author: jhb Date: Mon May 11 20:40:30 2020 New Revision: 360920 URL: https://svnweb.freebsd.org/changeset/base/360920 Log: Remove incomplete support for plain MD5 from OCF. Although a few drivers supported this algorithm, there were never any in-kernel consumers. cryptosoft and cryptodev never supported it, and there was not a software xform auth_hash for it. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24767 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/sec/sec.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.c head/sys/opencrypto/cryptosoft.c Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 20:34:52 2020 (r360919) +++ head/share/man/man4/hifn.4 Mon May 11 20:40:30 2020 (r360920) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 19, 2009 +.Dd May 11, 2020 .Dt HIFN 4 .Os .Sh NAME @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, MD5, +AES (7955 and 7956 only), ARC4, MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:34:52 2020 (r360919) +++ head/share/man/man9/crypto.9 Mon May 11 20:40:30 2020 (r360920) @@ -17,7 +17,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 27, 2020 +.Dd May 11, 2020 .Dt CRYPTO 9 .Os .Sh NAME @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5 .It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/cesa/cesa.c Mon May 11 20:40:30 2020 (r360920) @@ -1607,7 +1607,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: @@ -1686,12 +1685,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cs->cs_mblen = 1; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5; - break; case CRYPTO_MD5_HMAC: cs->cs_mblen = MD5_BLOCK_LEN; cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 20:40:30 2020 (r360920) @@ -2315,7 +2315,6 @@ hifn_auth_supported(struct hifn_softc *sc, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: break; case CRYPTO_MD5_HMAC: @@ -2524,11 +2523,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_MAC; switch (csp->csp_auth_alg) { - case CRYPTO_MD5: - cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | - HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH | - HIFN_MAC_CMD_POS_IPSEC; - break; case CRYPTO_MD5_HMAC: cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC | Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/dev/sec/sec.c Mon May 11 20:40:30 2020 (r360920) @@ -1180,7 +1180,6 @@ sec_auth_supported(struct sec_softc *sc, if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) return (false); break; - case CRYPTO_MD5: case CRYPTO_SHA1: break; default: @@ -1530,7 +1529,6 @@ static bool sec_mdeu_can_handle(u_int alg) { switch (alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: @@ -1554,8 +1552,6 @@ sec_mdeu_config(const struct crypto_session_params *cs switch (csp->csp_auth_alg) { case CRYPTO_MD5_HMAC: *mode |= SEC_MDEU_MODE_HMAC; - /* FALLTHROUGH */ - case CRYPTO_MD5: *eu = SEC_EU_MDEU_A; *mode |= SEC_MDEU_MODE_MD5; *hashlen = MD5_HASH_LEN; Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 20:40:30 2020 (r360920) @@ -376,7 +376,6 @@ xlp_sec_auth_supported(const struct crypto_session_par { switch (csp->csp_auth_alg) { - case CRYPTO_MD5: case CRYPTO_SHA1: case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 20:40:30 2020 (r360920) @@ -273,10 +273,6 @@ nlm_get_digest_param(struct xlp_sec_command *cmd, const struct crypto_session_params *csp) { switch(csp->csp_auth_alg) { - case CRYPTO_MD5: - cmd->hashalg = NLM_HASH_MD5; - cmd->hashmode = NLM_HASH_MODE_SHA1; - break; case CRYPTO_SHA1: cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/crypto.c Mon May 11 20:40:30 2020 (r360920) @@ -550,10 +550,6 @@ crypto_auth_hash(const struct crypto_session_params *c return (&auth_hash_key_md5); case CRYPTO_SHA1_KPDK: return (&auth_hash_key_sha1); -#ifdef notyet - case CRYPTO_MD5: - return (&auth_hash_md5); -#endif case CRYPTO_SHA1: return (&auth_hash_sha1); case CRYPTO_SHA2_224: @@ -704,7 +700,6 @@ static enum alg_type { [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, [CRYPTO_ARC4] = ALG_CIPHER, - [CRYPTO_MD5] = ALG_DIGEST, [CRYPTO_SHA1] = ALG_DIGEST, [CRYPTO_NULL_HMAC] = ALG_DIGEST, [CRYPTO_NULL_CBC] = ALG_CIPHER, Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/cryptodev.c Mon May 11 20:40:30 2020 (r360920) @@ -506,11 +506,6 @@ cryptof_ioctl( return (EINVAL); } break; -#ifdef notdef - case CRYPTO_MD5: - thash = &auth_hash_md5; - break; -#endif case CRYPTO_SHA1: thash = &auth_hash_sha1; break; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:34:52 2020 (r360919) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:40:30 2020 (r360920) @@ -980,9 +980,6 @@ swcr_setup_auth(struct swcr_session *ses, if (csp->csp_mode == CSP_MODE_DIGEST) ses->swcr_process = swcr_authcompute; break; -#ifdef notdef - case CRYPTO_MD5: -#endif case CRYPTO_SHA1: case CRYPTO_SHA2_224: case CRYPTO_SHA2_256: From owner-svn-src-all@freebsd.org Mon May 11 20:41:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 22C012EB665; Mon, 11 May 2020 20:41:04 +0000 (UTC) (envelope-from melifaro@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 49LXrw09wyz46hD; Mon, 11 May 2020 20:41:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0175E2450D; Mon, 11 May 2020 20:41:04 +0000 (UTC) (envelope-from melifaro@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKf3u9012031; Mon, 11 May 2020 20:41:03 GMT (envelope-from melifaro@FreeBSD.org) Received: (from melifaro@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKf3tN012030; Mon, 11 May 2020 20:41:03 GMT (envelope-from melifaro@FreeBSD.org) Message-Id: <202005112041.04BKf3tN012030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: melifaro set sender to melifaro@FreeBSD.org using -f From: "Alexander V. Chernikov" Date: Mon, 11 May 2020 20:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360921 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: melifaro X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360921 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:41:04 -0000 Author: melifaro Date: Mon May 11 20:41:03 2020 New Revision: 360921 URL: https://svnweb.freebsd.org/changeset/base/360921 Log: Fix NOINET[6] build by using af-independent route lookup function. Reported by: rpokala Modified: head/sys/netinet/sctp_os_bsd.h Modified: head/sys/netinet/sctp_os_bsd.h ============================================================================== --- head/sys/netinet/sctp_os_bsd.h Mon May 11 20:40:30 2020 (r360920) +++ head/sys/netinet/sctp_os_bsd.h Mon May 11 20:41:03 2020 (r360921) @@ -402,10 +402,7 @@ typedef struct route sctp_route_t; #define SCTP_RTALLOC(ro, vrf_id, fibnum) \ { \ if ((ro)->ro_nh == NULL) { \ - if ((ro)->ro_dst.sa_family == AF_INET) \ - (ro)->ro_nh = fib4_lookup(fibnum, ((struct sockaddr_in *)&(ro)->ro_dst)->sin_addr, 0, NHR_REF, 0); \ - if ((ro)->ro_dst.sa_family == AF_INET6) \ - (ro)->ro_nh = fib6_lookup(fibnum, &((struct sockaddr_in6 *)&(ro)->ro_dst)->sin6_addr, 0, NHR_REF, 0); \ + (ro)->ro_nh = rib_lookup(fibnum, &(ro)->ro_dst, NHR_REF, 0); \ } \ } From owner-svn-src-all@freebsd.org Mon May 11 20:41:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FDDE2EB70E; Mon, 11 May 2020 20:41:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXsN02Lnz46rS; Mon, 11 May 2020 20:41:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D77482452F; Mon, 11 May 2020 20:41:27 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKfRN4014395; Mon, 11 May 2020 20:41:27 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKfRU1014394; Mon, 11 May 2020 20:41:27 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112041.04BKfRU1014394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:41: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: r360922 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 360922 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:41:28 -0000 Author: jhb Date: Mon May 11 20:41:27 2020 New Revision: 360922 URL: https://svnweb.freebsd.org/changeset/base/360922 Log: MFC 357630: Fix DDB to unwind across exception frames. While here, add an extra line of information for exceptions and interrupts and compress the per-frame line down to one line to match other architectures. Modified: stable/12/sys/riscv/riscv/db_trace.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/db_trace.c ============================================================================== --- stable/12/sys/riscv/riscv/db_trace.c Mon May 11 20:41:03 2020 (r360921) +++ stable/12/sys/riscv/riscv/db_trace.c Mon May 11 20:41:27 2020 (r360922) @@ -2,6 +2,7 @@ * Copyright (c) 2015 The FreeBSD Foundation * Copyright (c) 2016 Ruslan Bukin * All rights reserved. + * Copyright (c) 2020 John Baldwin * * Portions of this software were developed by Semihalf under * the sponsorship of the FreeBSD Foundation. @@ -38,15 +39,18 @@ #include __FBSDID("$FreeBSD$"); + #include -#include #include -#include +#include + #include #include +#include #include #include +#include void db_md_list_watchpoints() @@ -80,9 +84,6 @@ db_stack_trace_cmd(struct unwind_state *frame) while (1) { pc = frame->pc; - if (unwind_frame(frame) < 0) - break; - sym = db_search_symbol(pc, DB_STGY_ANY, &offset); if (sym == C_DB_SYM_NULL) { value = 0; @@ -94,11 +95,32 @@ db_stack_trace_cmd(struct unwind_state *frame) db_printsym(frame->pc, DB_STGY_PROC); db_printf("\n"); - db_printf("\t pc = 0x%016lx ra = 0x%016lx\n", - pc, frame->pc); - db_printf("\t sp = 0x%016lx fp = 0x%016lx\n", - frame->sp, frame->fp); - db_printf("\n"); + if (strcmp(name, "cpu_exception_handler_supervisor") == 0 || + strcmp(name, "cpu_exception_handler_user") == 0) { + struct trapframe *tf; + + tf = (struct trapframe *)(uintptr_t)frame->sp; + + if (tf->tf_scause & EXCP_INTR) + db_printf("--- interrupt %ld\n", + tf->tf_scause & EXCP_MASK); + else + db_printf("--- exception %ld, tval = %#lx\n", + tf->tf_scause & EXCP_MASK, + tf->tf_stval); + frame->sp = (uint64_t)tf->tf_sp; + frame->fp = (uint64_t)tf->tf_s[0]; + frame->pc = (uint64_t)tf->tf_sepc; + if (!INKERNEL(frame->fp)) + break; + continue; + } + + if (strcmp(name, "fork_trampoline") == 0) + break; + + if (unwind_frame(frame) < 0) + break; } } From owner-svn-src-all@freebsd.org Mon May 11 20:44:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EC1552EBA3E for ; Mon, 11 May 2020 20:44:12 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LXwW4kbGz47NN for ; Mon, 11 May 2020 20:44:11 +0000 (UTC) (envelope-from kevin.bowling@kev009.com) Received: by mail-io1-xd41.google.com with SMTP id i19so11393202ioh.12 for ; Mon, 11 May 2020 13:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kev009.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JmYKuk47ZFALbZxrlZRpWQGMRLRXhDZ1kuEguFbR3CA=; b=Cii3dl7Y5zSkVe+BgWdsIoPVdXnGb69SLgC448LRw7XbgiSLB/UqahRWSO8Q5XwZoh olv8tQiuOH/fD0A3Mh/BnpiU6MwgU7EKqS1kLwLxAyh3ZWx8ZWan4O8A0Wyj3KQp8WkB V/c+UWM+SGgj9N2zNbQZpyqwr+nF4OsTxqtAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JmYKuk47ZFALbZxrlZRpWQGMRLRXhDZ1kuEguFbR3CA=; b=mkwPo6yIDwSJ0T+GkTL8WiGNAGfUw+pggBX1dQAwJ/kk0PFva4qS6Lx615TN7F6kwL O//CsL4KKL6yiMamn2SWMqIGp0vwJc6Rfu1zbjRHNDlNnBtEYkdlfXj0QBgGOAhkjula MWhRCo37aGklhxor+fv7i/gCP45Oi9isVwl7kjrSAQScxq0lyScdz+f0CtsIMhoJKK68 jtB9b7gQy6PYNe765U0a0zhO12cUPyW1suX6ABYvHGa2eXklu8y7CS2xb76g+oQDH4kz Q7NN1cgcG99D02I+zR/nFd5zy+ELIWsXh9ILxGaqON/drJFp9ZJZI4QWTAbw5amBpgaG 81pw== X-Gm-Message-State: AGi0Pubox8lkN70PqwO7aEQd1WctLIUT/ULdYG+Ceb+/cNUiIGihrtvB xtVeFfFNjVhYvgcdRc6W0IB367UReDarV+mjNBIuGA== X-Google-Smtp-Source: APiQypJgpe80b3jHW7kDJjfqAeFbB5USJeSEoiu4N5+B4EbWzu/lybUgxPFnVk1PAt0Qq5PAQvkrMCa9cuWiKCnKsTI= X-Received: by 2002:a6b:cd8e:: with SMTP id d136mr17283501iog.113.1589229849664; Mon, 11 May 2020 13:44:09 -0700 (PDT) MIME-Version: 1.0 References: <202005110233.04B2XcpD033576@repo.freebsd.org> In-Reply-To: <202005110233.04B2XcpD033576@repo.freebsd.org> From: Kevin Bowling Date: Mon, 11 May 2020 13:43:58 -0700 Message-ID: Subject: Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm To: Justin Hibbits Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49LXwW4kbGz47NN X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none (invalid DKIM record) header.d=kev009.com header.s=google header.b=Cii3dl7Y; dmarc=none; spf=pass (mx1.freebsd.org: domain of kevin.bowling@kev009.com designates 2607:f8b0:4864:20::d41 as permitted sender) smtp.mailfrom=kevin.bowling@kev009.com X-Spamd-Result: default: False [-2.41 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[kev009.com]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[kev009.com:~]; RCVD_IN_DNSWL_NONE(0.00)[1.4.d.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_DKIM_PERMFAIL(0.00)[kev009.com:s=google]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-0.11)[ip: (0.23), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:44:13 -0000 Were there any major changes you can summarize from the P9BSD integration, and any TODO list (perhaps wiki for this question)? On Sun, May 10, 2020 at 7:33 PM Justin Hibbits wrote: > > Author: jhibbits > Date: Mon May 11 02:33:37 2020 > New Revision: 360887 > URL: https://svnweb.freebsd.org/changeset/base/360887 > > Log: > powerpc64: Implement Radix MMU for POWER9 CPUs > > Summary: > POWER9 supports two MMU formats: traditional hashed page tables, and Radix > page tables, similar to what's presesnt on most other architectures. The > PowerISA also specifies a process table -- a table of page table pointers-- > which on the POWER9 is only available with the Radix MMU, so we can take > advantage of it with the Radix MMU driver. > > Written by Matt Macy. > > Differential Revision: https://reviews.freebsd.org/D19516 > > Added: > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > Modified: > head/sys/conf/files.powerpc > head/sys/powerpc/aim/aim_machdep.c > head/sys/powerpc/aim/mmu_oea.c > head/sys/powerpc/aim/mmu_oea64.c > head/sys/powerpc/booke/pmap.c > head/sys/powerpc/include/cpufunc.h > head/sys/powerpc/include/mmuvar.h > head/sys/powerpc/include/param.h > head/sys/powerpc/include/pmap.h > head/sys/powerpc/include/proc.h > head/sys/powerpc/include/pte.h > head/sys/powerpc/include/spr.h > head/sys/powerpc/include/sr.h > head/sys/powerpc/include/vmparam.h > head/sys/powerpc/powerpc/machdep.c > head/sys/powerpc/powerpc/mmu_if.m > head/sys/powerpc/powerpc/pmap_dispatch.c > head/sys/powerpc/powerpc/trap.c > head/sys/vm/vm_fault.c > > Modified: head/sys/conf/files.powerpc > ============================================================================== > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 (r360887) > @@ -135,6 +135,7 @@ powerpc/aim/locore.S optional aim no-obj > powerpc/aim/aim_machdep.c optional aim > powerpc/aim/mmu_oea.c optional aim powerpc > powerpc/aim/mmu_oea64.c optional aim > +powerpc/aim/mmu_radix.c optional aim powerpc64 > powerpc/aim/moea64_if.m optional aim > powerpc/aim/moea64_native.c optional aim > powerpc/aim/mp_cpudep.c optional aim > > Modified: head/sys/powerpc/aim/aim_machdep.c > ============================================================================== > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 02:33:37 2020 (r360887) > @@ -136,6 +136,8 @@ __FBSDID("$FreeBSD$"); > struct bat battable[16]; > #endif > > +int radix_mmu = 0; > + > #ifndef __powerpc64__ > /* Bits for running on 64-bit systems in 32-bit mode. */ > extern void *testppc64, *testppc64size; > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > * in case the platform module had a better idea of what we > * should do. > */ > - if (cpu_features & PPC_FEATURE_64) > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > + radix_mmu = 0; > + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); > + if (radix_mmu) > + pmap_mmu_install(MMU_TYPE_RADIX, BUS_PROBE_GENERIC); > + else > + pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > + } else if (cpu_features & PPC_FEATURE_64) > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > else > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > Modified: head/sys/powerpc/aim/mmu_oea.c > ============================================================================== > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 02:33:37 2020 (r360887) > @@ -322,6 +322,7 @@ void moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t > void moea_scan_init(mmu_t mmu); > vm_offset_t moea_quick_enter_page(mmu_t mmu, vm_page_t m); > void moea_quick_remove_page(mmu_t mmu, vm_offset_t addr); > +boolean_t moea_page_is_mapped(mmu_t mmu, vm_page_t m); > static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, > volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, > @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { > MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), > MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), > MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), > + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), > > /* Internal interfaces */ > MMUMETHOD(mmu_bootstrap, moea_bootstrap), > @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) > void > moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) > { > +} > + > +boolean_t > +moea_page_is_mapped(mmu_t mmu, vm_page_t m) > +{ > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > } > > /* > > Modified: head/sys/powerpc/aim/mmu_oea64.c > ============================================================================== > --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 (r360886) > +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 02:33:37 2020 (r360887) > @@ -120,8 +120,7 @@ uintptr_t moea64_get_unique_vsid(void); > * > */ > > -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) > -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) > +#define PV_LOCK_COUNT PA_LOCK_COUNT > static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > > /* > @@ -130,8 +129,7 @@ static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > * index at (N << 45). > */ > #ifdef __powerpc64__ > -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ > - (((pa) >> 45) % MAXMEMDOM) * PV_LOCK_PER_DOM) > +#define PV_LOCK_IDX(pa) ((pa_index(pa) * (((pa) >> 45) + 1)) % PV_LOCK_COUNT) > #else > #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) > #endif > @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size > void moea64_scan_init(mmu_t mmu); > vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); > void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); > +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); > static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, > volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t addr, > @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { > MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), > MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), > MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), > + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), > #ifdef __powerpc64__ > MMUMETHOD(mmu_page_array_startup, moea64_page_array_startup), > #endif > @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr) > ("moea64_quick_remove_page: invalid address")); > mtx_unlock(PCPU_PTR(aim.qmap_lock)); > sched_unpin(); > +} > + > +boolean_t > +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) > +{ > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > } > > /* > > Added: head/sys/powerpc/aim/mmu_radix.c > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 (r360887) > @@ -0,0 +1,6507 @@ > +/*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > + * Copyright (c) 2018 Matthew Macy > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + */ > + > + > +#include > +__FBSDID("$FreeBSD$"); > + > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > + > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > + > +#ifdef INVARIANTS > +#include > +#endif > + > +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) > +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) > +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) > + > +#include "opt_ddb.h" > +#ifdef DDB > +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); > +#endif > + > +#define PG_W RPTE_WIRED > +#define PG_V RPTE_VALID > +#define PG_MANAGED RPTE_MANAGED > +#define PG_PROMOTED RPTE_PROMOTED > +#define PG_M RPTE_C > +#define PG_A RPTE_R > +#define PG_X RPTE_EAA_X > +#define PG_RW RPTE_EAA_W > +#define PG_PTE_CACHE RPTE_ATTR_MASK > + > +#define RPTE_SHIFT 9 > +#define NLS_MASK ((1UL<<5)-1) > +#define RPTE_ENTRIES (1UL< +#define RPTE_MASK (RPTE_ENTRIES-1) > + > +#define NLB_SHIFT 0 > +#define NLB_MASK (((1UL<<52)-1) << 8) > + > +extern int nkpt; > +extern caddr_t crashdumpmap; > + > +#define RIC_FLUSH_TLB 0 > +#define RIC_FLUSH_PWC 1 > +#define RIC_FLUSH_ALL 2 > + > +#define POWER9_TLB_SETS_RADIX 128 /* # sets in POWER9 TLB Radix mode */ > + > +#define PPC_INST_TLBIE 0x7c000264 > +#define PPC_INST_TLBIEL 0x7c000224 > +#define PPC_INST_SLBIA 0x7c0003e4 > + > +#define ___PPC_RA(a) (((a) & 0x1f) << 16) > +#define ___PPC_RB(b) (((b) & 0x1f) << 11) > +#define ___PPC_RS(s) (((s) & 0x1f) << 21) > +#define ___PPC_RT(t) ___PPC_RS(t) > +#define ___PPC_R(r) (((r) & 0x1) << 16) > +#define ___PPC_PRS(prs) (((prs) & 0x1) << 17) > +#define ___PPC_RIC(ric) (((ric) & 0x3) << 18) > + > +#define PPC_SLBIA(IH) __XSTRING(.long PPC_INST_SLBIA | \ > + ((IH & 0x7) << 21)) > +#define PPC_TLBIE_5(rb,rs,ric,prs,r) \ > + __XSTRING(.long PPC_INST_TLBIE | \ > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > + ___PPC_R(r)) > + > +#define PPC_TLBIEL(rb,rs,ric,prs,r) \ > + __XSTRING(.long PPC_INST_TLBIEL | \ > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > + ___PPC_R(r)) > + > +#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) > + > +static __inline void > +ttusync(void) > +{ > + __asm __volatile("eieio; tlbsync; ptesync" ::: "memory"); > +} > + > +#define TLBIEL_INVAL_SEL_MASK 0xc00 /* invalidation selector */ > +#define TLBIEL_INVAL_PAGE 0x000 /* invalidate a single page */ > +#define TLBIEL_INVAL_SET_PID 0x400 /* invalidate a set for the current PID */ > +#define TLBIEL_INVAL_SET_LPID 0x800 /* invalidate a set for current LPID */ > +#define TLBIEL_INVAL_SET 0xc00 /* invalidate a set for all LPIDs */ > + > +#define TLBIE_ACTUAL_PAGE_MASK 0xe0 > +#define TLBIE_ACTUAL_PAGE_4K 0x00 > +#define TLBIE_ACTUAL_PAGE_64K 0xa0 > +#define TLBIE_ACTUAL_PAGE_2M 0x20 > +#define TLBIE_ACTUAL_PAGE_1G 0x40 > + > +#define TLBIE_PRS_PARTITION_SCOPE 0x0 > +#define TLBIE_PRS_PROCESS_SCOPE 0x1 > + > +#define TLBIE_RIC_INVALIDATE_TLB 0x0 /* Invalidate just TLB */ > +#define TLBIE_RIC_INVALIDATE_PWC 0x1 /* Invalidate just PWC */ > +#define TLBIE_RIC_INVALIDATE_ALL 0x2 /* Invalidate TLB, PWC, > + * cached {proc, part}tab entries > + */ > +#define TLBIE_RIC_INVALIDATE_SEQ 0x3 /* HPT - only: > + * Invalidate a range of translations > + */ > + > +static __inline void > +radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, uint32_t pid, uint32_t lpid, > + vm_offset_t va, uint16_t ap) > +{ > + uint64_t rb, rs; > + > + MPASS((va & PAGE_MASK) == 0); > + > + rs = ((uint64_t)pid << 32) | lpid; > + rb = va | is | ap; > + __asm __volatile(PPC_TLBIE_5(%0, %1, %2, %3, 1) : : > + "r" (rb), "r" (rs), "i" (ric), "i" (prs)); > +} > + > +static __inline void > +radix_tlbie_invlpg_user_4k(uint32_t pid, vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_4K); > +} > + > +static __inline void > +radix_tlbie_invlpg_user_2m(uint32_t pid, vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, pid, 0, va, TLBIE_ACTUAL_PAGE_2M); > +} > + > +static __inline void > +radix_tlbie_invlpwc_user(uint32_t pid) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_flush_user(uint32_t pid) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_invlpg_kernel_4k(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_4K); > +} > + > +static __inline void > +radix_tlbie_invlpg_kernel_2m(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_2M); > +} > + > +/* 1GB pages aren't currently supported. */ > +static __inline __unused void > +radix_tlbie_invlpg_kernel_1g(vm_offset_t va) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_1G); > +} > + > +static __inline void > +radix_tlbie_invlpwc_kernel(void) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > +} > + > +static __inline void > +radix_tlbie_flush_kernel(void) > +{ > + > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, TLBIE_PRS_PROCESS_SCOPE, > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > +} > + > +static __inline vm_pindex_t > +pmap_l3e_pindex(vm_offset_t va) > +{ > + return ((va & PG_FRAME) >> L3_PAGE_SIZE_SHIFT); > +} > + > +static __inline vm_pindex_t > +pmap_pml3e_index(vm_offset_t va) > +{ > + > + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); > +} > + > +static __inline vm_pindex_t > +pmap_pml2e_index(vm_offset_t va) > +{ > + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); > +} > + > +static __inline vm_pindex_t > +pmap_pml1e_index(vm_offset_t va) > +{ > + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); > +} > + > +/* Return various clipped indexes for a given VA */ > +static __inline vm_pindex_t > +pmap_pte_index(vm_offset_t va) > +{ > + > + return ((va >> PAGE_SHIFT) & RPTE_MASK); > +} > + > +/* Return a pointer to the PT slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) > +{ > + pt_entry_t *pte; > + vm_paddr_t ptepa; > + > + ptepa = (*l3e & NLB_MASK); > + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); > + return (&pte[pmap_pte_index(va)]); > +} > + > +/* Return a pointer to the PD slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) > +{ > + pt_entry_t *l3e; > + vm_paddr_t l3pa; > + > + l3pa = (*l2e & NLB_MASK); > + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); > + return (&l3e[pmap_pml3e_index(va)]); > +} > + > +/* Return a pointer to the PD slot that corresponds to a VA */ > +static __inline pt_entry_t * > +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) > +{ > + pt_entry_t *l2e; > + vm_paddr_t l2pa; > + > + l2pa = (*l1e & NLB_MASK); > + > + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); > + return (&l2e[pmap_pml2e_index(va)]); > +} > + > +static __inline pml1_entry_t * > +pmap_pml1e(pmap_t pmap, vm_offset_t va) > +{ > + > + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); > +} > + > +static pt_entry_t * > +pmap_pml2e(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l1e; > + > + l1e = pmap_pml1e(pmap, va); > + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l1e_to_l2e(l1e, va)); > +} > + > +static __inline pt_entry_t * > +pmap_pml3e(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l2e; > + > + l2e = pmap_pml2e(pmap, va); > + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l2e_to_l3e(l2e, va)); > +} > + > +static __inline pt_entry_t * > +pmap_pte(pmap_t pmap, vm_offset_t va) > +{ > + pt_entry_t *l3e; > + > + l3e = pmap_pml3e(pmap, va); > + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) > + return (NULL); > + return (pmap_l3e_to_pte(l3e, va)); > +} > + > +int nkpt = 64; > +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, > + "Number of kernel page table pages allocated on bootup"); > + > +vm_paddr_t dmaplimit; > + > +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); > + > +static int pg_ps_enabled = 1; > +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | CTLFLAG_NOFETCH, > + &pg_ps_enabled, 0, "Are large page mappings enabled?"); > +#ifdef INVARIANTS > +#define VERBOSE_PMAP 0 > +#define VERBOSE_PROTECT 0 > +static int pmap_logging; > +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, > + &pmap_logging, 0, "verbose debug logging"); > +#endif > + > +static u_int64_t KPTphys; /* phys addr of kernel level 1 */ > + > +//static vm_paddr_t KERNend; /* phys addr of end of bootstrap data */ > + > +static vm_offset_t qframe = 0; > +static struct mtx qframe_mtx; > +static epoch_t pmap_epoch; > + > +void mmu_radix_activate(mmu_t mmu, struct thread *); > +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, int); > +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, vm_ooffset_t, vm_offset_t *, > + vm_size_t); > +void mmu_radix_clear_modify(mmu_t, vm_page_t); > +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, vm_offset_t); > +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, > + volatile const void *uaddr, void **kaddr, size_t ulen, size_t *klen); > +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, vm_offset_t *); > +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t, u_int, int8_t); > +void mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_page_t, > + vm_prot_t); > +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, vm_prot_t); > +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, vm_offset_t va); > +vm_page_t mmu_radix_extract_and_hold(mmu_t, pmap_t, vm_offset_t, vm_prot_t); > +void mmu_radix_kenter(mmu_t, vm_offset_t, vm_paddr_t); > +vm_paddr_t mmu_radix_kextract(mmu_t, vm_offset_t); > +void mmu_radix_kremove(mmu_t, vm_offset_t); > +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); > +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); > +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); > +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, vm_object_t, > + vm_pindex_t, vm_size_t); > +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); > +void mmu_radix_page_init(mmu_t, vm_page_t); > +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); > +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); > +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); > +void mmu_radix_pinit(mmu_t, pmap_t); > +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, vm_prot_t); > +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); > +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); > +void mmu_radix_qremove(mmu_t, vm_offset_t, int); > +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); > +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); > +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); > +void mmu_radix_release(mmu_t, pmap_t); > +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > +void mmu_radix_remove_all(mmu_t, vm_page_t); > +void mmu_radix_remove_pages(mmu_t, pmap_t); > +void mmu_radix_remove_write(mmu_t, vm_page_t); > +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > +void mmu_radix_zero_page(mmu_t, vm_page_t); > +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); > +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, vm_memattr_t); > +void mmu_radix_page_array_startup(mmu_t mmu, long pages); > + > +#include "mmu_oea64.h" > +#include "mmu_if.h" > +#include "moea64_if.h" > + > +/* > + * Kernel MMU interface > + */ > + > +static void mmu_radix_bootstrap(mmu_t mmup, > + vm_offset_t kernelstart, vm_offset_t kernelend); > + > +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); > +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, vm_offset_t a_offset, > + vm_page_t *mb, vm_offset_t b_offset, int xfersize); > +static void mmu_radix_growkernel(mmu_t, vm_offset_t); > +static void mmu_radix_init(mmu_t); > +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, vm_paddr_t *); > +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); > +static void mmu_radix_pinit0(mmu_t, pmap_t); > + > +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); > +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, vm_memattr_t); > +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, vm_size_t); > +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, vm_paddr_t, vm_memattr_t ma); > +static boolean_t mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); > +static void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, > + void **va); > +static void mmu_radix_scan_init(mmu_t mmu); > +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); > + > +static mmu_method_t mmu_radix_methods[] = { > + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), > + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), > + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), > + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), > + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), > + MMUMETHOD(mmu_init, mmu_radix_init), > + MMUMETHOD(mmu_map, mmu_radix_map), > + MMUMETHOD(mmu_mincore, mmu_radix_mincore), > + MMUMETHOD(mmu_pinit, mmu_radix_pinit), > + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), > + > + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), > + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), > + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), > + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), > + MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), > + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), > + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), > + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), > + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), > + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), > + MMUMETHOD(mmu_protect, mmu_radix_protect), > + /* pmap dispatcher interface */ > + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), > + MMUMETHOD(mmu_copy, mmu_radix_copy), > + MMUMETHOD(mmu_enter, mmu_radix_enter), > + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), > + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), > + MMUMETHOD(mmu_extract, mmu_radix_extract), > + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), > + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), > + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), > + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), > + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), > + MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), > + MMUMETHOD(mmu_page_init, mmu_radix_page_init), > + MMUMETHOD(mmu_page_wired_mappings, mmu_radix_page_wired_mappings), > + MMUMETHOD(mmu_qenter, mmu_radix_qenter), > + MMUMETHOD(mmu_qremove, mmu_radix_qremove), > + MMUMETHOD(mmu_release, mmu_radix_release), > + MMUMETHOD(mmu_remove, mmu_radix_remove), > + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), > + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), > + MMUMETHOD(mmu_unwire, mmu_radix_unwire), > + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), > + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), > + MMUMETHOD(mmu_activate, mmu_radix_activate), > + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), > + MMUMETHOD(mmu_quick_remove_page, mmu_radix_quick_remove_page), > + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), > + MMUMETHOD(mmu_page_array_startup, mmu_radix_page_array_startup), > + > + /* Internal interfaces */ > + MMUMETHOD(mmu_kenter, mmu_radix_kenter), > + MMUMETHOD(mmu_kextract, mmu_radix_kextract), > + MMUMETHOD(mmu_kremove, mmu_radix_kremove), > + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), > + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), > + MMUMETHOD(mmu_decode_kernel_ptr, mmu_radix_decode_kernel_ptr), > + { 0, 0 } > +}; > + > +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); > + > +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) > + > +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t *l3e, vm_offset_t va, > + struct rwlock **lockp); > +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, vm_offset_t va); > +static int pmap_unuse_pt(pmap_t, vm_offset_t, pml3_entry_t, struct spglist *); > +static int pmap_remove_l3e(pmap_t pmap, pml3_entry_t *pdq, vm_offset_t sva, > + struct spglist *free, struct rwlock **lockp); > +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, vm_offset_t sva, > + pml3_entry_t ptepde, struct spglist *free, struct rwlock **lockp); > +static vm_page_t pmap_remove_pt_page(pmap_t pmap, vm_offset_t va); > +static bool pmap_remove_page(pmap_t pmap, vm_offset_t va, pml3_entry_t *pde, > + struct spglist *free); > +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, vm_offset_t eva, > + pml3_entry_t *l3e, struct spglist *free, struct rwlock **lockp); > + > +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t l3e, > + u_int flags, struct rwlock **lockp); > +#if VM_NRESERVLEVEL > 0 > +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, vm_paddr_t pa, > + struct rwlock **lockp); > +#endif > +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, vm_offset_t va); > +static int pmap_insert_pt_page(pmap_t pmap, vm_page_t mpte); > +static vm_page_t mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t m, > + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool *invalidate); > + > +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, vm_page_t m, > + vm_prot_t prot, struct rwlock **lockp); > +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, pml3_entry_t newpde, > + u_int flags, vm_page_t m, struct rwlock **lockp); > + > +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct rwlock **lockp); > +static void free_pv_chunk(struct pv_chunk *pc); > +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, struct rwlock **lockp); > +static vm_page_t pmap_allocl3e(pmap_t pmap, vm_offset_t va, > + struct rwlock **lockp); > +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, > + struct rwlock **lockp); > +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, > + struct spglist *free); > +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, vm_page_t m, struct spglist *free); > + > +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); > +static void pmap_invalidate_all(pmap_t pmap); > +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, int mode, bool flush); > + > +/* > + * Internal flags for pmap_enter()'s helper functions. > + */ > +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't reclaim PV entries. */ > +#define PMAP_ENTER_NOREPLACE 0x2000000 /* Don't replace mappings. */ > + > +#define UNIMPLEMENTED() panic("%s not implemented", __func__) > +#define UNTESTED() panic("%s not yet tested", __func__) > + > + > + > +/* Number of supported PID bits */ > +static unsigned int isa3_pid_bits; > + > +/* PID to start allocating from */ > +static unsigned int isa3_base_pid; > + > +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) > +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) > + > + > +/* > + * Map of physical memory regions. > + */ > +static struct mem_region *regions, *pregions; > +static struct numa_mem_region *numa_pregions; > +static u_int phys_avail_count; > +static int regions_sz, pregions_sz, numa_pregions_sz; > +static struct pate *isa3_parttab; > +static struct prte *isa3_proctab; > +static vmem_t *asid_arena; > + > +extern void bs_remap_earlyboot(void); > + > +#define RADIX_PGD_SIZE_SHIFT 16 > +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) > + > +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) > +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) > +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) > + > +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) /* number of userland PML1 pages */ > +#define NUPDPE (NUPML1E * NL2EPG)/* number of userland PDP pages */ > +#define NUPDE (NUPDPE * NL3EPG) /* number of userland PD entries */ > + > +/* POWER9 only permits a 64k partition table size. */ > +#define PARTTAB_SIZE_SHIFT 16 > +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) > + > +#define PARTTAB_HR (1UL << 63) /* host uses radix */ > +#define PARTTAB_GR (1UL << 63) /* guest uses radix must match host */ > + > +/* TLB flush actions. Used as argument to tlbiel_all() */ > +enum { > + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for current LPID */ > + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ > +}; > + > +#define NPV_LIST_LOCKS MAXCPU > +static int pmap_initialized; > +static vm_paddr_t proctab0pa; > +static vm_paddr_t parttab_phys; > +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); > + > +/* > + * Data for the pv entry allocation mechanism. > + * Updates to pv_invl_gen are protected by the pv_list_locks[] > + * elements, but reads are not. > + */ > +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = TAILQ_HEAD_INITIALIZER(pv_chunks); > +static struct mtx __exclusive_cache_line pv_chunks_mutex; > +static struct rwlock __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; > +static struct md_page *pv_table; > +static struct md_page pv_dummy; > + > +#ifdef PV_STATS > +#define PV_STAT(x) do { x ; } while (0) > +#else > +#define PV_STAT(x) do { } while (0) > +#endif > + > +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) > +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) > + > +#define PHYS_TO_PV_LIST_LOCK(pa) \ > + (&pv_list_locks[pa_radix_index(pa) % NPV_LIST_LOCKS]) > + > +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ > + struct rwlock **_lockp = (lockp); \ > + struct rwlock *_new_lock; \ > + \ > + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ > + if (_new_lock != *_lockp) { \ > + if (*_lockp != NULL) \ > + rw_wunlock(*_lockp); \ > + *_lockp = _new_lock; \ > + rw_wlock(*_lockp); \ > + } \ > +} while (0) > + > +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ > + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) > + > +#define RELEASE_PV_LIST_LOCK(lockp) do { \ > + struct rwlock **_lockp = (lockp); \ > + \ > + if (*_lockp != NULL) { \ > + rw_wunlock(*_lockp); \ > + *_lockp = NULL; \ > + } \ > +} while (0) > + > +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ > + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) > + > +/* > + * We support 52 bits, hence: > + * bits 52 - 31 = 21, 0b10101 > + * RTS encoding details > + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long > + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long > + */ > +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) > + > + > +static int powernv_enabled = 1; > + > +static inline void > +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, > + uint32_t pid, uint32_t ric, uint32_t prs) > +{ > + uint64_t rb; > + uint64_t rs; > + > + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); > + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); > + > + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) > + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) > + : "memory"); > +} > + > +static void > +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) > +{ > + uint32_t set; > + > + __asm __volatile("ptesync": : :"memory"); > + > + /* > + * Flush the first set of the TLB, and the entire Page Walk Cache > + * and partition table entries. Then flush the remaining sets of the > + * TLB. > + */ > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); > + for (set = 1; set < num_sets; set++) > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 0); > + > + /* Do the same for process scoped entries. */ > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); > + for (set = 1; set < num_sets; set++) > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, 1); > + > + __asm __volatile("ptesync": : :"memory"); > +} > + > +static void > +mmu_radix_tlbiel_flush(int scope) > +{ > + int is; > + > + MPASS(scope == TLB_INVAL_SCOPE_LPID || > + scope == TLB_INVAL_SCOPE_GLOBAL); > + is = scope + 2; > + > + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); > + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : :"memory"); > +} > + > +static void > +mmu_radix_init_amor(void) > +{ > + /* > + * In HV mode, we init AMOR (Authority Mask Override Register) so that > + * the hypervisor and guest can setup IAMR (Instruction Authority Mask > + * Register), enable key 0 and set it to 1. > + * > + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) > + */ > + mtspr(SPR_AMOR, (3ul << 62)); > +} > + > +static void > +mmu_radix_init_iamr(void) > +{ > + /* > + * Radix always uses key0 of the IAMR to determine if an access is > + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent instruction > + * fetch. > + */ > + mtspr(SPR_IAMR, (1ul << 62)); > +} > + > +static void > +mmu_radix_pid_set(pmap_t pmap) > +{ > + > + mtspr(SPR_PID, pmap->pm_pid); > + isync(); > +} > + > +/* Quick sort callout for comparing physical addresses. */ > +static int > +pa_cmp(const void *a, const void *b) > +{ > + const vm_paddr_t *pa = a, *pb = b; > + > + if (*pa < *pb) > + return (-1); > + else if (*pa > *pb) > + return (1); > + else > + return (0); > +} > + > +#define pte_load_store(ptep, pte) atomic_swap_long(ptep, pte) > +#define pte_load_clear(ptep) atomic_swap_long(ptep, 0) > +#define pte_store(ptep, pte) do { \ > + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ > + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ > +} while (0) > +/* > + * NB: should only be used for adding directories - not for direct mappings > + */ > +#define pde_store(ptep, pa) do { \ > + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ > +} while (0) > + > +#define pte_clear(ptep) do { \ > + *(u_long *)(ptep) = (u_long)(0); \ > +} while (0) > + > +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports 2MB superpages */ > + > +/* > + * Promotion to a 2MB (PDE) page mapping requires that the corresponding 4KB > + * (PTE) page mappings have identical settings for the following fields: > + */ > +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | PG_PTE_CACHE | \ > + PG_M | PG_A | RPTE_EAA_MASK | PG_V) > + > + > +static void > +pmap_epoch_init(void *arg __unused) > +{ > + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | EPOCH_LOCKED); > +} > +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, NULL); > + > +static bool > +pmap_not_in_di(void) > +{ > + > + return (curthread->td_md.md_invl_gen.gen == 0); > +} > + > +#define PMAP_ASSERT_NOT_IN_DI() \ > + KASSERT(pmap_not_in_di(), ("DI already started")) > + > +static void > +pmap_delayed_invl_started(epoch_tracker_t et) > +{ > + epoch_enter_preempt(pmap_epoch, et); > + curthread->td_md.md_invl_gen.gen = 1; > +} > + > +static void > +pmap_delayed_invl_finished(epoch_tracker_t et) > +{ > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Mon May 11 20:52:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B33222EBE13; Mon, 11 May 2020 20:52:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY5w4Mb9z47yl; Mon, 11 May 2020 20:52:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 911302479D; Mon, 11 May 2020 20:52:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKqKIt022258; Mon, 11 May 2020 20:52:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKqJXv020744; Mon, 11 May 2020 20:52:19 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112052.04BKqJXv020744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:52:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360923 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360923 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:52:20 -0000 Author: jhb Date: Mon May 11 20:52:18 2020 New Revision: 360923 URL: https://svnweb.freebsd.org/changeset/base/360923 Log: Remove support for the cast128 encryption algorithm. It no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24768 Deleted: head/sys/opencrypto/cast.c head/sys/opencrypto/cast.h head/sys/opencrypto/castsb.h head/sys/opencrypto/xform_cast5.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:41:27 2020 (r360922) +++ head/share/man/man9/crypto.9 Mon May 11 20:52:18 2020 (r360923) @@ -134,7 +134,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC -.It Dv CRYPTO_CAST_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:41:27 2020 (r360922) +++ head/sys/conf/files Mon May 11 20:52:18 2020 (r360923) @@ -4797,7 +4797,6 @@ dev/mlx5/mlx5_en/mlx5_en_port_buffer.c optional mlx5e compile-with "${OFED_C}" # crypto support -opencrypto/cast.c optional crypto | ipsec | ipsec_support opencrypto/criov.c optional crypto | ipsec | ipsec_support opencrypto/crypto.c optional crypto | ipsec | ipsec_support opencrypto/cryptodev.c optional cryptodev Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 20:41:27 2020 (r360922) +++ head/sys/modules/crypto/Makefile Mon May 11 20:52:18 2020 (r360923) @@ -22,7 +22,7 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodiu KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c -SRCS += cast.c cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c +SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/crypto.c Mon May 11 20:52:18 2020 (r360923) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_3des); case CRYPTO_BLF_CBC: return (&enc_xform_blf); - case CRYPTO_CAST_CBC: - return (&enc_xform_cast5); case CRYPTO_SKIPJACK_CBC: return (&enc_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: @@ -691,7 +689,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_CAST_CBC] = ALG_CIPHER, [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) @@ -119,7 +119,6 @@ #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 #define SKIPJACK_BLOCK_LEN 8 -#define CAST128_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -145,8 +144,6 @@ #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #define BLOWFISH_MIN_KEY 5 #define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ -#define CAST_MIN_KEY 5 -#define CAST_MAX_KEY 16 #define SKIPJACK_MIN_KEY 10 #define SKIPJACK_MAX_KEY SKIPJACK_MIN_KEY #define RIJNDAEL_MIN_KEY 16 Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:52:18 2020 (r360923) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/xform.c Mon May 11 20:52:18 2020 (r360923) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -94,7 +93,6 @@ struct enc_xform enc_xform_arc4 = { #include "xform_des1.c" #include "xform_des3.c" #include "xform_blf.c" -#include "xform_cast5.c" #include "xform_skipjack.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 20:41:27 2020 (r360922) +++ head/sys/opencrypto/xform_enc.h Mon May 11 20:52:18 2020 (r360923) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -74,7 +73,6 @@ extern struct enc_xform enc_xform_null; extern struct enc_xform enc_xform_des; extern struct enc_xform enc_xform_3des; extern struct enc_xform enc_xform_blf; -extern struct enc_xform enc_xform_cast5; extern struct enc_xform enc_xform_skipjack; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; From owner-svn-src-all@freebsd.org Mon May 11 20:53:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BDD432EBEA6; Mon, 11 May 2020 20:53:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-qt1-x842.google.com (mail-qt1-x842.google.com [IPv6:2607:f8b0:4864:20::842]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY6z1P4Gz488m; Mon, 11 May 2020 20:53:15 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: by mail-qt1-x842.google.com with SMTP id j2so8979105qtr.12; Mon, 11 May 2020 13:53:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SUjCHLgQgqVdREWizdR8DVZDyL2u7APRfvftlb7Cygk=; b=XugszPjA8W95YdgFu3fxNW490nfmn7dYTItb6gyARWTKymgwCPyNSYZf9N8eK56tyU Q1Mtz/vYbA/jAZ3WjVu4WTN4XiUeXvJUGGxU/v5QQ2RgFdn/z7th9pa1v9KDidlp7xW8 lHjNspPMMQ8uqV/HtJFqT/6bX4JQ2JZuKuirLrR/LWK9G2dqzB1DpBKObvgx2D2tswIw /tOKhy8aIGxABCtn//YmtngcbAT4Rlr/InYxy9BeJav1JSDhbP4tcirBXg8lPLR+tu/S ckqGCKWIU49FhOnX/hHNkTNMU8MFp6IABtyEzpmF9XOFvTuVM4RH+J01m7oXIR9R6jqV Il+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=SUjCHLgQgqVdREWizdR8DVZDyL2u7APRfvftlb7Cygk=; b=BpD/TodCekt4WNo/86vnBz2L4YMhGHjsyOLDE6yq45pDWu8PE/a4DwQPe7X8xsfsLC k5zlVfRt2N7hnG75poFqeSGH5kSlzkcBXDd2iBT14i8OBIQdwi4lUnAYkTSRwxR3A401 IiIkSmpHzSmpmwS2zQATbR28UU3ZKJm2SDrwrW/TRTkjWJXox48UTNaZ1rsiisxZdDVl aVC5Xdh4aIXs4aa1qgaYzY2HHyTRbTwJGZuUwdSwisx2sradRwAjwwBuJ33dvdKKLVWS rRWe1vamB/ie+qLXvgtCi4juU9kgVOR/vgfzZbeVFy2I+UU2TKFH3ss73fgqqQ/TK379 zteQ== X-Gm-Message-State: AGi0PuYdxDuIqqlralSeHJnYVTSTA7oMz4FUGqfGQdZG93Znc/P0778B mgbE0C6UW0vPuuQw3e5k4lWLCcUaEL4= X-Google-Smtp-Source: APiQypIdtgx7RS7FGxuHi2ctAoxjKm7TfRn9p58KtQteQq/KUXcPrpgKzL2lMoemYuTkWCaaAf489w== X-Received: by 2002:ac8:3252:: with SMTP id y18mr17018174qta.131.1589230393919; Mon, 11 May 2020 13:53:13 -0700 (PDT) Received: from titan.knownspace (173-19-125-130.client.mchsi.com. [173.19.125.130]) by smtp.gmail.com with ESMTPSA id s56sm2595506qtk.45.2020.05.11.13.53.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 May 2020 13:53:13 -0700 (PDT) Sender: Justin Hibbits Date: Mon, 11 May 2020 15:53:10 -0500 From: Justin Hibbits To: Kevin Bowling Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360887 - in head/sys: conf powerpc/aim powerpc/booke powerpc/include powerpc/powerpc vm Message-ID: <20200511155310.08c2f1cf@titan.knownspace> In-Reply-To: References: <202005110233.04B2XcpD033576@repo.freebsd.org> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; powerpc64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49LY6z1P4Gz488m X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=XugszPjA; dmarc=none; spf=pass (mx1.freebsd.org: domain of chmeeedalf@gmail.com designates 2607:f8b0:4864:20::842 as permitted sender) smtp.mailfrom=chmeeedalf@gmail.com X-Spamd-Result: default: False [-2.35 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-0.996,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[2.4.8.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; IP_SCORE(-0.16)[ip: (0.02), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.43), country: US(-0.05)]; FORGED_SENDER(0.30)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[130.125.19.173.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[jhibbits@freebsd.org,chmeeedalf@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:53:15 -0000 On Mon, 11 May 2020 13:43:58 -0700 Kevin Bowling wrote: > Were there any major changes you can summarize from the P9BSD > integration, and any TODO list (perhaps wiki for this question)? The committed version lacks minidumps, which luporl@ had implemented in OEA64 a few months ago, so I still have to pull that in. Also, Radix pmap is currently disabled by default, enabled with 'radix_mmu=1' boot arg, because it's extremely unstable in anything but the most mundane cases (can pass buildworld, but a lot of ports trigger machine checks), so that all needs fixed. The rest of the TODO list from POWER9BSD consists of: * IFUNCify pmap and its ancillary functions (copy*()) * Bring in the soft-interrupt-disable feature Someone (Alfredo?) is working on IFUNCifying pmap, but nobody's yet done the soft interrupt disabling. I have a patch to implement it, but last time I tested it, it fell over quite quickly, so I must've missed something. I think that's it. - Justin > > On Sun, May 10, 2020 at 7:33 PM Justin Hibbits > wrote: > > > > Author: jhibbits > > Date: Mon May 11 02:33:37 2020 > > New Revision: 360887 > > URL: https://svnweb.freebsd.org/changeset/base/360887 > > > > Log: > > powerpc64: Implement Radix MMU for POWER9 CPUs > > > > Summary: > > POWER9 supports two MMU formats: traditional hashed page tables, > > and Radix page tables, similar to what's presesnt on most other > > architectures. The PowerISA also specifies a process table -- a > > table of page table pointers-- which on the POWER9 is only > > available with the Radix MMU, so we can take advantage of it with > > the Radix MMU driver. > > > > Written by Matt Macy. > > > > Differential Revision: https://reviews.freebsd.org/D19516 > > > > Added: > > head/sys/powerpc/aim/mmu_radix.c (contents, props changed) > > Modified: > > head/sys/conf/files.powerpc > > head/sys/powerpc/aim/aim_machdep.c > > head/sys/powerpc/aim/mmu_oea.c > > head/sys/powerpc/aim/mmu_oea64.c > > head/sys/powerpc/booke/pmap.c > > head/sys/powerpc/include/cpufunc.h > > head/sys/powerpc/include/mmuvar.h > > head/sys/powerpc/include/param.h > > head/sys/powerpc/include/pmap.h > > head/sys/powerpc/include/proc.h > > head/sys/powerpc/include/pte.h > > head/sys/powerpc/include/spr.h > > head/sys/powerpc/include/sr.h > > head/sys/powerpc/include/vmparam.h > > head/sys/powerpc/powerpc/machdep.c > > head/sys/powerpc/powerpc/mmu_if.m > > head/sys/powerpc/powerpc/pmap_dispatch.c > > head/sys/powerpc/powerpc/trap.c > > head/sys/vm/vm_fault.c > > > > Modified: head/sys/conf/files.powerpc > > ============================================================================== > > --- head/sys/conf/files.powerpc Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/conf/files.powerpc Mon May 11 02:33:37 2020 > > (r360887) @@ -135,6 +135,7 @@ powerpc/aim/locore.S > > optional aim no-obj powerpc/aim/aim_machdep.c > > optional aim powerpc/aim/mmu_oea.c optional > > aim powerpc powerpc/aim/mmu_oea64.c optional > > aim +powerpc/aim/mmu_radix.c optional aim > > powerpc64 powerpc/aim/moea64_if.m optional aim > > powerpc/aim/moea64_native.c optional aim > > powerpc/aim/mp_cpudep.c optional aim > > > > Modified: head/sys/powerpc/aim/aim_machdep.c > > ============================================================================== > > --- head/sys/powerpc/aim/aim_machdep.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/aim_machdep.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -136,6 +136,8 @@ > > __FBSDID("$FreeBSD$"); struct bat battable[16]; > > #endif > > > > +int radix_mmu = 0; > > + > > #ifndef __powerpc64__ > > /* Bits for running on 64-bit systems in 32-bit mode. */ > > extern void *testppc64, *testppc64size; > > @@ -451,7 +453,14 @@ aim_cpu_init(vm_offset_t toc) > > * in case the platform module had a better idea of what we > > * should do. > > */ > > - if (cpu_features & PPC_FEATURE_64) > > + if (cpu_features2 & PPC_FEATURE2_ARCH_3_00) { > > + radix_mmu = 0; > > + TUNABLE_INT_FETCH("radix_mmu", &radix_mmu); > > + if (radix_mmu) > > + pmap_mmu_install(MMU_TYPE_RADIX, > > BUS_PROBE_GENERIC); > > + else > > + pmap_mmu_install(MMU_TYPE_G5, > > BUS_PROBE_GENERIC); > > + } else if (cpu_features & PPC_FEATURE_64) > > pmap_mmu_install(MMU_TYPE_G5, BUS_PROBE_GENERIC); > > else > > pmap_mmu_install(MMU_TYPE_OEA, BUS_PROBE_GENERIC); > > > > Modified: head/sys/powerpc/aim/mmu_oea.c > > ============================================================================== > > --- head/sys/powerpc/aim/mmu_oea.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/mmu_oea.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -322,6 +322,7 @@ void > > moea_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t void > > moea_scan_init(mmu_t mmu); vm_offset_t moea_quick_enter_page(mmu_t > > mmu, vm_page_t m); void moea_quick_remove_page(mmu_t mmu, > > vm_offset_t addr); +boolean_t moea_page_is_mapped(mmu_t mmu, > > vm_page_t m); static int moea_map_user_ptr(mmu_t mmu, pmap_t pm, > > volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); static int moea_decode_kernel_ptr(mmu_t mmu, vm_offset_t > > addr, @@ -364,6 +365,7 @@ static mmu_method_t moea_methods[] = { > > MMUMETHOD(mmu_page_set_memattr, moea_page_set_memattr), > > MMUMETHOD(mmu_quick_enter_page, moea_quick_enter_page), > > MMUMETHOD(mmu_quick_remove_page, moea_quick_remove_page), > > + MMUMETHOD(mmu_page_is_mapped, moea_page_is_mapped), > > > > /* Internal interfaces */ > > MMUMETHOD(mmu_bootstrap, moea_bootstrap), > > @@ -1102,6 +1104,12 @@ moea_quick_enter_page(mmu_t mmu, vm_page_t m) > > void > > moea_quick_remove_page(mmu_t mmu, vm_offset_t addr) > > { > > +} > > + > > +boolean_t > > +moea_page_is_mapped(mmu_t mmu, vm_page_t m) > > +{ > > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > > } > > > > /* > > > > Modified: head/sys/powerpc/aim/mmu_oea64.c > > ============================================================================== > > --- head/sys/powerpc/aim/mmu_oea64.c Mon May 11 01:20:40 2020 > > (r360886) +++ head/sys/powerpc/aim/mmu_oea64.c Mon May 11 > > 02:33:37 2020 (r360887) @@ -120,8 +120,7 @@ uintptr_t > > moea64_get_unique_vsid(void); * > > */ > > > > -#define PV_LOCK_PER_DOM (PA_LOCK_COUNT * 3) > > -#define PV_LOCK_COUNT (PV_LOCK_PER_DOM * MAXMEMDOM) > > +#define PV_LOCK_COUNT PA_LOCK_COUNT > > static struct mtx_padalign pv_lock[PV_LOCK_COUNT]; > > > > /* > > @@ -130,8 +129,7 @@ static struct mtx_padalign > > pv_lock[PV_LOCK_COUNT]; > > * index at (N << 45). > > */ > > #ifdef __powerpc64__ > > -#define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_PER_DOM + \ > > - (((pa) >> 45) % MAXMEMDOM) * > > PV_LOCK_PER_DOM) +#define PV_LOCK_IDX(pa) ((pa_index(pa) * > > (((pa) >> 45) + 1)) % PV_LOCK_COUNT) #else > > #define PV_LOCK_IDX(pa) (pa_index(pa) % PV_LOCK_COUNT) > > #endif > > @@ -305,6 +303,7 @@ void moea64_dumpsys_map(mmu_t mmu, vm_paddr_t > > pa, size void moea64_scan_init(mmu_t mmu); > > vm_offset_t moea64_quick_enter_page(mmu_t mmu, vm_page_t m); > > void moea64_quick_remove_page(mmu_t mmu, vm_offset_t addr); > > +boolean_t moea64_page_is_mapped(mmu_t mmu, vm_page_t m); > > static int moea64_map_user_ptr(mmu_t mmu, pmap_t pm, > > volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); static int moea64_decode_kernel_ptr(mmu_t mmu, vm_offset_t > > addr, @@ -353,6 +352,7 @@ static mmu_method_t moea64_methods[] = { > > MMUMETHOD(mmu_page_set_memattr, moea64_page_set_memattr), > > MMUMETHOD(mmu_quick_enter_page, moea64_quick_enter_page), > > MMUMETHOD(mmu_quick_remove_page, moea64_quick_remove_page), > > + MMUMETHOD(mmu_page_is_mapped, moea64_page_is_mapped), > > #ifdef __powerpc64__ > > MMUMETHOD(mmu_page_array_startup, > > moea64_page_array_startup), #endif > > @@ -1423,6 +1423,12 @@ moea64_quick_remove_page(mmu_t mmu, > > vm_offset_t addr) ("moea64_quick_remove_page: invalid address")); > > mtx_unlock(PCPU_PTR(aim.qmap_lock)); > > sched_unpin(); > > +} > > + > > +boolean_t > > +moea64_page_is_mapped(mmu_t mmu, vm_page_t m) > > +{ > > + return (!LIST_EMPTY(&(m)->md.mdpg_pvoh)); > > } > > > > /* > > > > Added: head/sys/powerpc/aim/mmu_radix.c > > ============================================================================== > > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > +++ head/sys/powerpc/aim/mmu_radix.c Mon May 11 02:33:37 2020 > > (r360887) @@ -0,0 +1,6507 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > > + * > > + * Copyright (c) 2018 Matthew Macy > > + * > > + * Redistribution and use in source and binary forms, with or > > without > > + * modification, are permitted provided that the following > > conditions > > + * are met: > > + * > > + * 1. Redistributions of source code must retain the above > > copyright > > + * notice, this list of conditions and the following disclaimer. > > + * 2. Redistributions in binary form must reproduce the above > > copyright > > + * notice, this list of conditions and the following disclaimer > > in the > > + * documentation and/or other materials provided with the > > distribution. > > + * > > + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY > > EXPRESS OR > > + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED > > WARRANTIES > > + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE > > DISCLAIMED. > > + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, > > + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES > > (INCLUDING, BUT > > + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; > > LOSS OF USE, > > + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND > > ON ANY > > + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR > > TORT > > + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF > > THE USE OF > > + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH > > DAMAGE. > > + */ > > + > > + > > +#include > > +__FBSDID("$FreeBSD$"); > > + > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > + > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > +#include > > + > > +#ifdef INVARIANTS > > +#include > > +#endif > > + > > +#define PPC_BITLSHIFT(bit) (sizeof(long)*NBBY - 1 - (bit)) > > +#define PPC_BIT(bit) (1UL << PPC_BITLSHIFT(bit)) > > +#define PPC_BITLSHIFT_VAL(val, bit) ((val) << PPC_BITLSHIFT(bit)) > > + > > +#include "opt_ddb.h" > > +#ifdef DDB > > +static void pmap_pte_walk(pml1_entry_t *l1, vm_offset_t va); > > +#endif > > + > > +#define PG_W RPTE_WIRED > > +#define PG_V RPTE_VALID > > +#define PG_MANAGED RPTE_MANAGED > > +#define PG_PROMOTED RPTE_PROMOTED > > +#define PG_M RPTE_C > > +#define PG_A RPTE_R > > +#define PG_X RPTE_EAA_X > > +#define PG_RW RPTE_EAA_W > > +#define PG_PTE_CACHE RPTE_ATTR_MASK > > + > > +#define RPTE_SHIFT 9 > > +#define NLS_MASK ((1UL<<5)-1) > > +#define RPTE_ENTRIES (1UL< > +#define RPTE_MASK (RPTE_ENTRIES-1) > > + > > +#define NLB_SHIFT 0 > > +#define NLB_MASK (((1UL<<52)-1) << 8) > > + > > +extern int nkpt; > > +extern caddr_t crashdumpmap; > > + > > +#define RIC_FLUSH_TLB 0 > > +#define RIC_FLUSH_PWC 1 > > +#define RIC_FLUSH_ALL 2 > > + > > +#define POWER9_TLB_SETS_RADIX 128 /* # sets in POWER9 TLB > > Radix mode */ + > > +#define PPC_INST_TLBIE 0x7c000264 > > +#define PPC_INST_TLBIEL 0x7c000224 > > +#define PPC_INST_SLBIA 0x7c0003e4 > > + > > +#define ___PPC_RA(a) (((a) & 0x1f) << 16) > > +#define ___PPC_RB(b) (((b) & 0x1f) << 11) > > +#define ___PPC_RS(s) (((s) & 0x1f) << 21) > > +#define ___PPC_RT(t) ___PPC_RS(t) > > +#define ___PPC_R(r) (((r) & 0x1) << 16) > > +#define ___PPC_PRS(prs) (((prs) & 0x1) << 17) > > +#define ___PPC_RIC(ric) (((ric) & 0x3) << 18) > > + > > +#define PPC_SLBIA(IH) __XSTRING(.long PPC_INST_SLBIA | \ > > + ((IH & 0x7) << 21)) > > +#define PPC_TLBIE_5(rb,rs,ric,prs,r) > > \ > > + __XSTRING(.long PPC_INST_TLBIE | \ > > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > > + ___PPC_R(r)) > > + > > +#define PPC_TLBIEL(rb,rs,ric,prs,r) \ > > + __XSTRING(.long PPC_INST_TLBIEL | \ > > + ___PPC_RB(rb) | ___PPC_RS(rs) | \ > > + ___PPC_RIC(ric) | ___PPC_PRS(prs) | \ > > + ___PPC_R(r)) > > + > > +#define PPC_INVALIDATE_ERAT PPC_SLBIA(7) > > + > > +static __inline void > > +ttusync(void) > > +{ > > + __asm __volatile("eieio; tlbsync; ptesync" ::: "memory"); > > +} > > + > > +#define TLBIEL_INVAL_SEL_MASK 0xc00 /* invalidation selector */ > > +#define TLBIEL_INVAL_PAGE 0x000 /* invalidate a single page > > */ +#define TLBIEL_INVAL_SET_PID 0x400 /* invalidate a set for > > the current PID */ +#define TLBIEL_INVAL_SET_LPID 0x800 /* > > invalidate a set for current LPID */ +#define TLBIEL_INVAL_SET > > 0xc00 /* invalidate a set for all LPIDs */ + > > +#define TLBIE_ACTUAL_PAGE_MASK 0xe0 > > +#define TLBIE_ACTUAL_PAGE_4K 0x00 > > +#define TLBIE_ACTUAL_PAGE_64K 0xa0 > > +#define TLBIE_ACTUAL_PAGE_2M 0x20 > > +#define TLBIE_ACTUAL_PAGE_1G 0x40 > > + > > +#define TLBIE_PRS_PARTITION_SCOPE 0x0 > > +#define TLBIE_PRS_PROCESS_SCOPE 0x1 > > + > > +#define TLBIE_RIC_INVALIDATE_TLB 0x0 /* Invalidate just > > TLB */ +#define TLBIE_RIC_INVALIDATE_PWC 0x1 /* > > Invalidate just PWC */ +#define TLBIE_RIC_INVALIDATE_ALL 0x2 > > /* Invalidate TLB, PWC, > > + * cached {proc, > > part}tab entries > > + */ > > +#define TLBIE_RIC_INVALIDATE_SEQ 0x3 /* HPT - only: > > + * Invalidate a > > range of translations > > + */ > > + > > +static __inline void > > +radix_tlbie(uint8_t ric, uint8_t prs, uint16_t is, uint32_t pid, > > uint32_t lpid, > > + vm_offset_t va, uint16_t ap) > > +{ > > + uint64_t rb, rs; > > + > > + MPASS((va & PAGE_MASK) == 0); > > + > > + rs = ((uint64_t)pid << 32) | lpid; > > + rb = va | is | ap; > > + __asm __volatile(PPC_TLBIE_5(%0, %1, %2, %3, 1) : : > > + "r" (rb), "r" (rs), "i" (ric), "i" (prs)); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_user_4k(uint32_t pid, vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, pid, 0, va, > > TLBIE_ACTUAL_PAGE_4K); +} > > + > > +static __inline void > > +radix_tlbie_invlpg_user_2m(uint32_t pid, vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, pid, 0, va, > > TLBIE_ACTUAL_PAGE_2M); +} > > + > > +static __inline void > > +radix_tlbie_invlpwc_user(uint32_t pid) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_flush_user(uint32_t pid) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_PID, pid, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_kernel_4k(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_4K); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpg_kernel_2m(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_2M); > > +} > > + > > +/* 1GB pages aren't currently supported. */ > > +static __inline __unused void > > +radix_tlbie_invlpg_kernel_1g(vm_offset_t va) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_TLB, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_PAGE, 0, 0, va, TLBIE_ACTUAL_PAGE_1G); > > +} > > + > > +static __inline void > > +radix_tlbie_invlpwc_kernel(void) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_PWC, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > > +} > > + > > +static __inline void > > +radix_tlbie_flush_kernel(void) > > +{ > > + > > + radix_tlbie(TLBIE_RIC_INVALIDATE_ALL, > > TLBIE_PRS_PROCESS_SCOPE, > > + TLBIEL_INVAL_SET_LPID, 0, 0, 0, 0); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_l3e_pindex(vm_offset_t va) > > +{ > > + return ((va & PG_FRAME) >> L3_PAGE_SIZE_SHIFT); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml3e_index(vm_offset_t va) > > +{ > > + > > + return ((va >> L3_PAGE_SIZE_SHIFT) & RPTE_MASK); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml2e_index(vm_offset_t va) > > +{ > > + return ((va >> L2_PAGE_SIZE_SHIFT) & RPTE_MASK); > > +} > > + > > +static __inline vm_pindex_t > > +pmap_pml1e_index(vm_offset_t va) > > +{ > > + return ((va & PG_FRAME) >> L1_PAGE_SIZE_SHIFT); > > +} > > + > > +/* Return various clipped indexes for a given VA */ > > +static __inline vm_pindex_t > > +pmap_pte_index(vm_offset_t va) > > +{ > > + > > + return ((va >> PAGE_SHIFT) & RPTE_MASK); > > +} > > + > > +/* Return a pointer to the PT slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l3e_to_pte(pt_entry_t *l3e, vm_offset_t va) > > +{ > > + pt_entry_t *pte; > > + vm_paddr_t ptepa; > > + > > + ptepa = (*l3e & NLB_MASK); > > + pte = (pt_entry_t *)PHYS_TO_DMAP(ptepa); > > + return (&pte[pmap_pte_index(va)]); > > +} > > + > > +/* Return a pointer to the PD slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l2e_to_l3e(pt_entry_t *l2e, vm_offset_t va) > > +{ > > + pt_entry_t *l3e; > > + vm_paddr_t l3pa; > > + > > + l3pa = (*l2e & NLB_MASK); > > + l3e = (pml3_entry_t *)PHYS_TO_DMAP(l3pa); > > + return (&l3e[pmap_pml3e_index(va)]); > > +} > > + > > +/* Return a pointer to the PD slot that corresponds to a VA */ > > +static __inline pt_entry_t * > > +pmap_l1e_to_l2e(pt_entry_t *l1e, vm_offset_t va) > > +{ > > + pt_entry_t *l2e; > > + vm_paddr_t l2pa; > > + > > + l2pa = (*l1e & NLB_MASK); > > + > > + l2e = (pml2_entry_t *)PHYS_TO_DMAP(l2pa); > > + return (&l2e[pmap_pml2e_index(va)]); > > +} > > + > > +static __inline pml1_entry_t * > > +pmap_pml1e(pmap_t pmap, vm_offset_t va) > > +{ > > + > > + return (&pmap->pm_pml1[pmap_pml1e_index(va)]); > > +} > > + > > +static pt_entry_t * > > +pmap_pml2e(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l1e; > > + > > + l1e = pmap_pml1e(pmap, va); > > + if (l1e == NULL || (*l1e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l1e_to_l2e(l1e, va)); > > +} > > + > > +static __inline pt_entry_t * > > +pmap_pml3e(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l2e; > > + > > + l2e = pmap_pml2e(pmap, va); > > + if (l2e == NULL || (*l2e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l2e_to_l3e(l2e, va)); > > +} > > + > > +static __inline pt_entry_t * > > +pmap_pte(pmap_t pmap, vm_offset_t va) > > +{ > > + pt_entry_t *l3e; > > + > > + l3e = pmap_pml3e(pmap, va); > > + if (l3e == NULL || (*l3e & RPTE_VALID) == 0) > > + return (NULL); > > + return (pmap_l3e_to_pte(l3e, va)); > > +} > > + > > +int nkpt = 64; > > +SYSCTL_INT(_machdep, OID_AUTO, nkpt, CTLFLAG_RD, &nkpt, 0, > > + "Number of kernel page table pages allocated on bootup"); > > + > > +vm_paddr_t dmaplimit; > > + > > +SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap > > parameters"); + > > +static int pg_ps_enabled = 1; > > +SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_enabled, CTLFLAG_RDTUN | > > CTLFLAG_NOFETCH, > > + &pg_ps_enabled, 0, "Are large page mappings enabled?"); > > +#ifdef INVARIANTS > > +#define VERBOSE_PMAP 0 > > +#define VERBOSE_PROTECT 0 > > +static int pmap_logging; > > +SYSCTL_INT(_vm_pmap, OID_AUTO, pmap_logging, CTLFLAG_RWTUN, > > + &pmap_logging, 0, "verbose debug logging"); > > +#endif > > + > > +static u_int64_t KPTphys; /* phys addr of kernel > > level 1 */ + > > +//static vm_paddr_t KERNend; /* phys addr of end of > > bootstrap data */ + > > +static vm_offset_t qframe = 0; > > +static struct mtx qframe_mtx; > > +static epoch_t pmap_epoch; > > + > > +void mmu_radix_activate(mmu_t mmu, struct thread *); > > +void mmu_radix_advise(mmu_t mmu, pmap_t, vm_offset_t, vm_offset_t, > > int); +void mmu_radix_align_superpage(mmu_t mmu, vm_object_t, > > vm_ooffset_t, vm_offset_t *, > > + vm_size_t); > > +void mmu_radix_clear_modify(mmu_t, vm_page_t); > > +void mmu_radix_copy(mmu_t, pmap_t, pmap_t, vm_offset_t, vm_size_t, > > vm_offset_t); +int mmu_radix_map_user_ptr(mmu_t mmu, pmap_t pm, > > + volatile const void *uaddr, void **kaddr, size_t ulen, size_t > > *klen); +int mmu_radix_decode_kernel_ptr(mmu_t, vm_offset_t, int *, > > vm_offset_t *); +int mmu_radix_enter(mmu_t, pmap_t, vm_offset_t, > > vm_page_t, vm_prot_t, u_int, int8_t); +void > > mmu_radix_enter_object(mmu_t, pmap_t, vm_offset_t, vm_offset_t, > > vm_page_t, > > + vm_prot_t); > > +void mmu_radix_enter_quick(mmu_t, pmap_t, vm_offset_t, vm_page_t, > > vm_prot_t); +vm_paddr_t mmu_radix_extract(mmu_t, pmap_t pmap, > > vm_offset_t va); +vm_page_t mmu_radix_extract_and_hold(mmu_t, > > pmap_t, vm_offset_t, vm_prot_t); +void mmu_radix_kenter(mmu_t, > > vm_offset_t, vm_paddr_t); +vm_paddr_t mmu_radix_kextract(mmu_t, > > vm_offset_t); +void mmu_radix_kremove(mmu_t, vm_offset_t); > > +boolean_t mmu_radix_is_modified(mmu_t, vm_page_t); > > +boolean_t mmu_radix_is_prefaultable(mmu_t, pmap_t, vm_offset_t); > > +boolean_t mmu_radix_is_referenced(mmu_t, vm_page_t); > > +void mmu_radix_object_init_pt(mmu_t, pmap_t, vm_offset_t, > > vm_object_t, > > + vm_pindex_t, vm_size_t); > > +boolean_t mmu_radix_page_exists_quick(mmu_t, pmap_t, vm_page_t); > > +void mmu_radix_page_init(mmu_t, vm_page_t); > > +boolean_t mmu_radix_page_is_mapped(mmu_t, vm_page_t m); > > +void mmu_radix_page_set_memattr(mmu_t, vm_page_t, vm_memattr_t); > > +int mmu_radix_page_wired_mappings(mmu_t, vm_page_t); > > +void mmu_radix_pinit(mmu_t, pmap_t); > > +void mmu_radix_protect(mmu_t, pmap_t, vm_offset_t, vm_offset_t, > > vm_prot_t); +boolean_t mmu_radix_ps_enabled(mmu_t, pmap_t); > > +void mmu_radix_qenter(mmu_t, vm_offset_t, vm_page_t *, int); > > +void mmu_radix_qremove(mmu_t, vm_offset_t, int); > > +vm_offset_t mmu_radix_quick_enter_page(mmu_t, vm_page_t); > > +void mmu_radix_quick_remove_page(mmu_t, vm_offset_t); > > +boolean_t mmu_radix_ts_referenced(mmu_t, vm_page_t); > > +void mmu_radix_release(mmu_t, pmap_t); > > +void mmu_radix_remove(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > > +void mmu_radix_remove_all(mmu_t, vm_page_t); > > +void mmu_radix_remove_pages(mmu_t, pmap_t); > > +void mmu_radix_remove_write(mmu_t, vm_page_t); > > +void mmu_radix_unwire(mmu_t, pmap_t, vm_offset_t, vm_offset_t); > > +void mmu_radix_zero_page(mmu_t, vm_page_t); > > +void mmu_radix_zero_page_area(mmu_t, vm_page_t, int, int); > > +int mmu_radix_change_attr(mmu_t, vm_offset_t, vm_size_t, > > vm_memattr_t); +void mmu_radix_page_array_startup(mmu_t mmu, long > > pages); + > > +#include "mmu_oea64.h" > > +#include "mmu_if.h" > > +#include "moea64_if.h" > > + > > +/* > > + * Kernel MMU interface > > + */ > > + > > +static void mmu_radix_bootstrap(mmu_t mmup, > > + vm_offset_t kernelstart, vm_offset_t kernelend); > > + > > +static void mmu_radix_copy_page(mmu_t, vm_page_t, vm_page_t); > > +static void mmu_radix_copy_pages(mmu_t mmu, vm_page_t *ma, > > vm_offset_t a_offset, > > + vm_page_t *mb, vm_offset_t b_offset, int xfersize); > > +static void mmu_radix_growkernel(mmu_t, vm_offset_t); > > +static void mmu_radix_init(mmu_t); > > +static int mmu_radix_mincore(mmu_t, pmap_t, vm_offset_t, > > vm_paddr_t *); +static vm_offset_t mmu_radix_map(mmu_t, vm_offset_t > > *, vm_paddr_t, vm_paddr_t, int); +static void > > mmu_radix_pinit0(mmu_t, pmap_t); + > > +static void *mmu_radix_mapdev(mmu_t, vm_paddr_t, vm_size_t); > > +static void *mmu_radix_mapdev_attr(mmu_t, vm_paddr_t, vm_size_t, > > vm_memattr_t); +static void mmu_radix_unmapdev(mmu_t, vm_offset_t, > > vm_size_t); +static void mmu_radix_kenter_attr(mmu_t, vm_offset_t, > > vm_paddr_t, vm_memattr_t ma); +static boolean_t > > mmu_radix_dev_direct_mapped(mmu_t, vm_paddr_t, vm_size_t); +static > > void mmu_radix_dumpsys_map(mmu_t mmu, vm_paddr_t pa, size_t sz, > > + void **va); > > +static void mmu_radix_scan_init(mmu_t mmu); > > +static void mmu_radix_cpu_bootstrap(mmu_t, int ap); > > + > > +static mmu_method_t mmu_radix_methods[] = { > > + MMUMETHOD(mmu_bootstrap, mmu_radix_bootstrap), > > + MMUMETHOD(mmu_copy_page, mmu_radix_copy_page), > > + MMUMETHOD(mmu_copy_pages, mmu_radix_copy_pages), > > + MMUMETHOD(mmu_cpu_bootstrap, mmu_radix_cpu_bootstrap), > > + MMUMETHOD(mmu_growkernel, mmu_radix_growkernel), > > + MMUMETHOD(mmu_init, mmu_radix_init), > > + MMUMETHOD(mmu_map, mmu_radix_map), > > + MMUMETHOD(mmu_mincore, mmu_radix_mincore), > > + MMUMETHOD(mmu_pinit, mmu_radix_pinit), > > + MMUMETHOD(mmu_pinit0, mmu_radix_pinit0), > > + > > + MMUMETHOD(mmu_mapdev, mmu_radix_mapdev), > > + MMUMETHOD(mmu_mapdev_attr, mmu_radix_mapdev_attr), > > + MMUMETHOD(mmu_unmapdev, mmu_radix_unmapdev), > > + MMUMETHOD(mmu_kenter_attr, mmu_radix_kenter_attr), > > + > > MMUMETHOD(mmu_dev_direct_mapped,mmu_radix_dev_direct_mapped), > > + MMUMETHOD(mmu_scan_init, mmu_radix_scan_init), > > + MMUMETHOD(mmu_dumpsys_map, mmu_radix_dumpsys_map), > > + MMUMETHOD(mmu_page_is_mapped, mmu_radix_page_is_mapped), > > + MMUMETHOD(mmu_ps_enabled, mmu_radix_ps_enabled), > > + MMUMETHOD(mmu_object_init_pt, mmu_radix_object_init_pt), > > + MMUMETHOD(mmu_protect, mmu_radix_protect), > > + /* pmap dispatcher interface */ > > + MMUMETHOD(mmu_clear_modify, mmu_radix_clear_modify), > > + MMUMETHOD(mmu_copy, mmu_radix_copy), > > + MMUMETHOD(mmu_enter, mmu_radix_enter), > > + MMUMETHOD(mmu_enter_object, mmu_radix_enter_object), > > + MMUMETHOD(mmu_enter_quick, mmu_radix_enter_quick), > > + MMUMETHOD(mmu_extract, mmu_radix_extract), > > + MMUMETHOD(mmu_extract_and_hold, mmu_radix_extract_and_hold), > > + MMUMETHOD(mmu_is_modified, mmu_radix_is_modified), > > + MMUMETHOD(mmu_is_prefaultable, mmu_radix_is_prefaultable), > > + MMUMETHOD(mmu_is_referenced, mmu_radix_is_referenced), > > + MMUMETHOD(mmu_ts_referenced, mmu_radix_ts_referenced), > > + > > MMUMETHOD(mmu_page_exists_quick,mmu_radix_page_exists_quick), > > + MMUMETHOD(mmu_page_init, mmu_radix_page_init), > > + MMUMETHOD(mmu_page_wired_mappings, > > mmu_radix_page_wired_mappings), > > + MMUMETHOD(mmu_qenter, mmu_radix_qenter), > > + MMUMETHOD(mmu_qremove, mmu_radix_qremove), > > + MMUMETHOD(mmu_release, mmu_radix_release), > > + MMUMETHOD(mmu_remove, mmu_radix_remove), > > + MMUMETHOD(mmu_remove_all, mmu_radix_remove_all), > > + MMUMETHOD(mmu_remove_write, mmu_radix_remove_write), > > + MMUMETHOD(mmu_unwire, mmu_radix_unwire), > > + MMUMETHOD(mmu_zero_page, mmu_radix_zero_page), > > + MMUMETHOD(mmu_zero_page_area, mmu_radix_zero_page_area), > > + MMUMETHOD(mmu_activate, mmu_radix_activate), > > + MMUMETHOD(mmu_quick_enter_page, mmu_radix_quick_enter_page), > > + MMUMETHOD(mmu_quick_remove_page, > > mmu_radix_quick_remove_page), > > + MMUMETHOD(mmu_page_set_memattr, mmu_radix_page_set_memattr), > > + MMUMETHOD(mmu_page_array_startup, > > mmu_radix_page_array_startup), + > > + /* Internal interfaces */ > > + MMUMETHOD(mmu_kenter, mmu_radix_kenter), > > + MMUMETHOD(mmu_kextract, mmu_radix_kextract), > > + MMUMETHOD(mmu_kremove, mmu_radix_kremove), > > + MMUMETHOD(mmu_change_attr, mmu_radix_change_attr), > > + MMUMETHOD(mmu_map_user_ptr, mmu_radix_map_user_ptr), > > + MMUMETHOD(mmu_decode_kernel_ptr, > > mmu_radix_decode_kernel_ptr), > > + { 0, 0 } > > +}; > > + > > +MMU_DEF(mmu_radix, MMU_TYPE_RADIX, mmu_radix_methods, 0); > > + > > +#define METHODVOID(m) mmu_radix_ ## m(mmu_t mmup) > > + > > +static boolean_t pmap_demote_l3e_locked(pmap_t pmap, pml3_entry_t > > *l3e, vm_offset_t va, > > + struct rwlock **lockp); > > +static boolean_t pmap_demote_l3e(pmap_t pmap, pml3_entry_t *pde, > > vm_offset_t va); +static int pmap_unuse_pt(pmap_t, vm_offset_t, > > pml3_entry_t, struct spglist *); +static int pmap_remove_l3e(pmap_t > > pmap, pml3_entry_t *pdq, vm_offset_t sva, > > + struct spglist *free, struct rwlock **lockp); > > +static int pmap_remove_pte(pmap_t pmap, pt_entry_t *ptq, > > vm_offset_t sva, > > + pml3_entry_t ptepde, struct spglist *free, struct rwlock > > **lockp); +static vm_page_t pmap_remove_pt_page(pmap_t pmap, > > vm_offset_t va); +static bool pmap_remove_page(pmap_t pmap, > > vm_offset_t va, pml3_entry_t *pde, > > + struct spglist *free); > > +static bool pmap_remove_ptes(pmap_t pmap, vm_offset_t sva, > > vm_offset_t eva, > > + pml3_entry_t *l3e, struct spglist *free, struct rwlock > > **lockp); + > > +static bool pmap_pv_insert_l3e(pmap_t pmap, vm_offset_t va, > > pml3_entry_t l3e, > > + u_int flags, struct rwlock **lockp); > > +#if VM_NRESERVLEVEL > 0 > > +static void pmap_pv_promote_l3e(pmap_t pmap, vm_offset_t va, > > vm_paddr_t pa, > > + struct rwlock **lockp); > > +#endif > > +static void pmap_pvh_free(struct md_page *pvh, pmap_t pmap, > > vm_offset_t va); +static int pmap_insert_pt_page(pmap_t pmap, > > vm_page_t mpte); +static vm_page_t > > mmu_radix_enter_quick_locked(pmap_t pmap, vm_offset_t va, vm_page_t > > m, > > + vm_prot_t prot, vm_page_t mpte, struct rwlock **lockp, bool > > *invalidate); + > > +static bool pmap_enter_2mpage(pmap_t pmap, vm_offset_t va, > > vm_page_t m, > > + vm_prot_t prot, struct rwlock **lockp); > > +static int pmap_enter_l3e(pmap_t pmap, vm_offset_t va, > > pml3_entry_t newpde, > > + u_int flags, vm_page_t m, struct rwlock **lockp); > > + > > +static vm_page_t reclaim_pv_chunk(pmap_t locked_pmap, struct > > rwlock **lockp); +static void free_pv_chunk(struct pv_chunk *pc); > > +static vm_page_t _pmap_allocpte(pmap_t pmap, vm_pindex_t > > ptepindex, struct rwlock **lockp); +static vm_page_t > > pmap_allocl3e(pmap_t pmap, vm_offset_t va, > > + struct rwlock **lockp); > > +static vm_page_t pmap_allocpte(pmap_t pmap, vm_offset_t va, > > + struct rwlock **lockp); > > +static void _pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, > > vm_page_t m, > > + struct spglist *free); > > +static boolean_t pmap_unwire_ptp(pmap_t pmap, vm_offset_t va, > > vm_page_t m, struct spglist *free); + > > +static void pmap_invalidate_page(pmap_t pmap, vm_offset_t start); > > +static void pmap_invalidate_all(pmap_t pmap); > > +static int pmap_change_attr_locked(vm_offset_t va, vm_size_t size, > > int mode, bool flush); + > > +/* > > + * Internal flags for pmap_enter()'s helper functions. > > + */ > > +#define PMAP_ENTER_NORECLAIM 0x1000000 /* Don't > > reclaim PV entries. */ +#define PMAP_ENTER_NOREPLACE > > 0x2000000 /* Don't replace mappings. */ + > > +#define UNIMPLEMENTED() panic("%s not implemented", __func__) > > +#define UNTESTED() panic("%s not yet tested", __func__) > > + > > + > > + > > +/* Number of supported PID bits */ > > +static unsigned int isa3_pid_bits; > > + > > +/* PID to start allocating from */ > > +static unsigned int isa3_base_pid; > > + > > +#define PROCTAB_SIZE_SHIFT (isa3_pid_bits + 4) > > +#define PROCTAB_ENTRIES (1ul << isa3_pid_bits) > > + > > + > > +/* > > + * Map of physical memory regions. > > + */ > > +static struct mem_region *regions, *pregions; > > +static struct numa_mem_region *numa_pregions; > > +static u_int phys_avail_count; > > +static int regions_sz, pregions_sz, numa_pregions_sz; > > +static struct pate *isa3_parttab; > > +static struct prte *isa3_proctab; > > +static vmem_t *asid_arena; > > + > > +extern void bs_remap_earlyboot(void); > > + > > +#define RADIX_PGD_SIZE_SHIFT 16 > > +#define RADIX_PGD_SIZE (1UL << RADIX_PGD_SIZE_SHIFT) > > + > > +#define RADIX_PGD_INDEX_SHIFT (RADIX_PGD_SIZE_SHIFT-3) > > +#define NL2EPG (PAGE_SIZE/sizeof(pml2_entry_t)) > > +#define NL3EPG (PAGE_SIZE/sizeof(pml3_entry_t)) > > + > > +#define NUPML1E (RADIX_PGD_SIZE/sizeof(uint64_t)) > > /* number of userland PML1 pages */ +#define NUPDPE > > (NUPML1E * NL2EPG)/* number of userland PDP pages */ +#define > > NUPDE (NUPDPE * NL3EPG) /* number of userland > > PD entries */ + +/* POWER9 only permits a 64k partition table size. > > */ +#define PARTTAB_SIZE_SHIFT 16 > > +#define PARTTAB_SIZE (1UL << PARTTAB_SIZE_SHIFT) > > + > > +#define PARTTAB_HR (1UL << 63) /* host uses radix */ > > +#define PARTTAB_GR (1UL << 63) /* guest uses radix > > must match host */ + > > +/* TLB flush actions. Used as argument to tlbiel_all() */ > > +enum { > > + TLB_INVAL_SCOPE_LPID = 0, /* invalidate TLBs for > > current LPID */ > > + TLB_INVAL_SCOPE_GLOBAL = 1, /* invalidate all TLBs */ > > +}; > > + > > +#define NPV_LIST_LOCKS MAXCPU > > +static int pmap_initialized; > > +static vm_paddr_t proctab0pa; > > +static vm_paddr_t parttab_phys; > > +CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); > > + > > +/* > > + * Data for the pv entry allocation mechanism. > > + * Updates to pv_invl_gen are protected by the pv_list_locks[] > > + * elements, but reads are not. > > + */ > > +static TAILQ_HEAD(pch, pv_chunk) pv_chunks = > > TAILQ_HEAD_INITIALIZER(pv_chunks); +static struct mtx > > __exclusive_cache_line pv_chunks_mutex; +static struct rwlock > > __exclusive_cache_line pv_list_locks[NPV_LIST_LOCKS]; +static > > struct md_page *pv_table; +static struct md_page pv_dummy; > > + > > +#ifdef PV_STATS > > +#define PV_STAT(x) do { x ; } while (0) > > +#else > > +#define PV_STAT(x) do { } while (0) > > +#endif > > + > > +#define pa_radix_index(pa) ((pa) >> L3_PAGE_SIZE_SHIFT) > > +#define pa_to_pvh(pa) (&pv_table[pa_radix_index(pa)]) > > + > > +#define PHYS_TO_PV_LIST_LOCK(pa) \ > > + (&pv_list_locks[pa_radix_index(pa) % > > NPV_LIST_LOCKS]) + > > +#define CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, pa) do { \ > > + struct rwlock **_lockp = (lockp); \ > > + struct rwlock *_new_lock; \ > > + \ > > + _new_lock = PHYS_TO_PV_LIST_LOCK(pa); \ > > + if (_new_lock != *_lockp) { \ > > + if (*_lockp != NULL) \ > > + rw_wunlock(*_lockp); \ > > + *_lockp = _new_lock; \ > > + rw_wlock(*_lockp); \ > > + } \ > > +} while (0) > > + > > +#define CHANGE_PV_LIST_LOCK_TO_VM_PAGE(lockp, m) \ > > + CHANGE_PV_LIST_LOCK_TO_PHYS(lockp, VM_PAGE_TO_PHYS(m)) > > + > > +#define RELEASE_PV_LIST_LOCK(lockp) do { \ > > + struct rwlock **_lockp = (lockp); \ > > + \ > > + if (*_lockp != NULL) { \ > > + rw_wunlock(*_lockp); \ > > + *_lockp = NULL; \ > > + } \ > > +} while (0) > > + > > +#define VM_PAGE_TO_PV_LIST_LOCK(m) \ > > + PHYS_TO_PV_LIST_LOCK(VM_PAGE_TO_PHYS(m)) > > + > > +/* > > + * We support 52 bits, hence: > > + * bits 52 - 31 = 21, 0b10101 > > + * RTS encoding details > > + * bits 0 - 3 of rts -> bits 6 - 8 unsigned long > > + * bits 4 - 5 of rts -> bits 62 - 63 of unsigned long > > + */ > > +#define RTS_SIZE ((0x2UL << 61) | (0x5UL << 5)) > > + > > + > > +static int powernv_enabled = 1; > > + > > +static inline void > > +tlbiel_radix_set_isa300(uint32_t set, uint32_t is, > > + uint32_t pid, uint32_t ric, uint32_t prs) > > +{ > > + uint64_t rb; > > + uint64_t rs; > > + > > + rb = PPC_BITLSHIFT_VAL(set, 51) | PPC_BITLSHIFT_VAL(is, 53); > > + rs = PPC_BITLSHIFT_VAL((uint64_t)pid, 31); > > + > > + __asm __volatile(PPC_TLBIEL(%0, %1, %2, %3, 1) > > + : : "r"(rb), "r"(rs), "i"(ric), "i"(prs) > > + : "memory"); > > +} > > + > > +static void > > +tlbiel_flush_isa3(uint32_t num_sets, uint32_t is) > > +{ > > + uint32_t set; > > + > > + __asm __volatile("ptesync": : :"memory"); > > + > > + /* > > + * Flush the first set of the TLB, and the entire Page Walk > > Cache > > + * and partition table entries. Then flush the remaining > > sets of the > > + * TLB. > > + */ > > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 0); > > + for (set = 1; set < num_sets; set++) > > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, > > 0); + > > + /* Do the same for process scoped entries. */ > > + tlbiel_radix_set_isa300(0, is, 0, RIC_FLUSH_ALL, 1); > > + for (set = 1; set < num_sets; set++) > > + tlbiel_radix_set_isa300(set, is, 0, RIC_FLUSH_TLB, > > 1); + > > + __asm __volatile("ptesync": : :"memory"); > > +} > > + > > +static void > > +mmu_radix_tlbiel_flush(int scope) > > +{ > > + int is; > > + > > + MPASS(scope == TLB_INVAL_SCOPE_LPID || > > + scope == TLB_INVAL_SCOPE_GLOBAL); > > + is = scope + 2; > > + > > + tlbiel_flush_isa3(POWER9_TLB_SETS_RADIX, is); > > + __asm __volatile(PPC_INVALIDATE_ERAT "; isync" : : > > :"memory"); +} > > + > > +static void > > +mmu_radix_init_amor(void) > > +{ > > + /* > > + * In HV mode, we init AMOR (Authority Mask Override > > Register) so that > > + * the hypervisor and guest can setup IAMR (Instruction > > Authority Mask > > + * Register), enable key 0 and set it to 1. > > + * > > + * AMOR = 0b1100 .... 0000 (Mask for key 0 is 11) > > + */ > > + mtspr(SPR_AMOR, (3ul << 62)); > > +} > > + > > +static void > > +mmu_radix_init_iamr(void) > > +{ > > + /* > > + * Radix always uses key0 of the IAMR to determine if an > > access is > > + * allowed. We set bit 0 (IBM bit 1) of key0, to prevent > > instruction > > + * fetch. > > + */ > > + mtspr(SPR_IAMR, (1ul << 62)); > > +} > > + > > +static void > > +mmu_radix_pid_set(pmap_t pmap) > > +{ > > + > > + mtspr(SPR_PID, pmap->pm_pid); > > + isync(); > > +} > > + > > +/* Quick sort callout for comparing physical addresses. */ > > +static int > > +pa_cmp(const void *a, const void *b) > > +{ > > + const vm_paddr_t *pa = a, *pb = b; > > + > > + if (*pa < *pb) > > + return (-1); > > + else if (*pa > *pb) > > + return (1); > > + else > > + return (0); > > +} > > + > > +#define pte_load_store(ptep, pte) > > atomic_swap_long(ptep, pte) +#define pte_load_clear(ptep) > > atomic_swap_long(ptep, 0) +#define pte_store(ptep, > > pte) do { \ > > + MPASS((pte) & (RPTE_EAA_R | RPTE_EAA_W | RPTE_EAA_X)); \ > > + *(u_long *)(ptep) = (u_long)((pte) | PG_V | RPTE_LEAF); \ > > +} while (0) > > +/* > > + * NB: should only be used for adding directories - not for direct > > mappings > > + */ > > +#define pde_store(ptep, pa) do { > > \ > > + *(u_long *)(ptep) = (u_long)(pa|RPTE_VALID|RPTE_SHIFT); \ > > +} while (0) > > + > > +#define pte_clear(ptep) do { > > \ > > + *(u_long *)(ptep) = (u_long)(0); \ > > +} while (0) > > + > > +#define PMAP_PDE_SUPERPAGE (1 << 8) /* supports > > 2MB superpages */ + > > +/* > > + * Promotion to a 2MB (PDE) page mapping requires that the > > corresponding 4KB > > + * (PTE) page mappings have identical settings for the following > > fields: > > + */ > > +#define PG_PTE_PROMOTE (PG_X | PG_MANAGED | PG_W | > > PG_PTE_CACHE | \ > > + PG_M | PG_A | RPTE_EAA_MASK | PG_V) > > + > > + > > +static void > > +pmap_epoch_init(void *arg __unused) > > +{ > > + pmap_epoch = epoch_alloc("pmap", EPOCH_PREEMPT | > > EPOCH_LOCKED); +} > > +SYSINIT(epoch, SI_SUB_EPOCH + 1, SI_ORDER_ANY, pmap_epoch_init, > > NULL); + > > +static bool > > +pmap_not_in_di(void) > > +{ > > + > > + return (curthread->td_md.md_invl_gen.gen == 0); > > +} > > + > > +#define PMAP_ASSERT_NOT_IN_DI() \ > > + KASSERT(pmap_not_in_di(), ("DI already started")) > > + > > +static void > > +pmap_delayed_invl_started(epoch_tracker_t et) > > +{ > > + epoch_enter_preempt(pmap_epoch, et); > > + curthread->td_md.md_invl_gen.gen = 1; > > +} > > + > > +static void > > +pmap_delayed_invl_finished(epoch_tracker_t et) > > +{ > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > _______________________________________________ > > svn-src-head@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/svn-src-head > > To unsubscribe, send any mail to > > "svn-src-head-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Mon May 11 20:55:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 451682EBFA5; Mon, 11 May 2020 20:55:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LY9110v2z48Lk; Mon, 11 May 2020 20:55:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D7EF247D0; Mon, 11 May 2020 20:55:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKt0aK022472; Mon, 11 May 2020 20:55:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKsxS3022425; Mon, 11 May 2020 20:54:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112054.04BKsxS3022425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:54:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360924 - in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360924 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:55:01 -0000 Author: jhb Date: Mon May 11 20:54:59 2020 New Revision: 360924 URL: https://svnweb.freebsd.org/changeset/base/360924 Log: Remove support for the skipjack encryption algorithm. This was removed from IPsec in r286100 and no longer has any in-tree consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24769 Deleted: head/sys/opencrypto/skipjack.c head/sys/opencrypto/skipjack.h head/sys/opencrypto/xform_skipjack.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:52:18 2020 (r360923) +++ head/share/man/man9/crypto.9 Mon May 11 20:54:59 2020 (r360924) @@ -138,7 +138,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_DES_CBC .It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC -.It Dv CRYPTO_SKIPJACK_CBC .El .Pp The following authenticated encryption with additional data (AEAD) Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 20:52:18 2020 (r360923) +++ head/sys/conf/files Mon May 11 20:54:59 2020 (r360924) @@ -4806,7 +4806,6 @@ opencrypto/cryptodeflate.c optional crypto | ipsec | i opencrypto/gmac.c optional crypto | ipsec | ipsec_support opencrypto/gfmult.c optional crypto | ipsec | ipsec_support opencrypto/rmd160.c optional crypto | ipsec | ipsec_support -opencrypto/skipjack.c optional crypto | ipsec | ipsec_support opencrypto/xform.c optional crypto | ipsec | ipsec_support opencrypto/xform_poly1305.c optional crypto \ compile-with "${NORMAL_C} -I$S/contrib/libsodium/src/libsodium/include -I$S/crypto/libsodium" Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 20:52:18 2020 (r360923) +++ head/sys/modules/crypto/Makefile Mon May 11 20:54:59 2020 (r360924) @@ -23,7 +23,7 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -SRCS += skipjack.c bf_enc.c bf_ecb.c bf_skey.c +SRCS += bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha256c.c sha512c.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/crypto.c Mon May 11 20:54:59 2020 (r360924) @@ -604,8 +604,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_3des); case CRYPTO_BLF_CBC: return (&enc_xform_blf); - case CRYPTO_SKIPJACK_CBC: - return (&enc_xform_skipjack); case CRYPTO_RIJNDAEL128_CBC: return (&enc_xform_rijndael128); case CRYPTO_AES_XTS: @@ -689,7 +687,6 @@ static enum alg_type { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, [CRYPTO_BLF_CBC] = ALG_CIPHER, - [CRYPTO_SKIPJACK_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/cryptodev.h Mon May 11 20:54:59 2020 (r360924) @@ -118,7 +118,6 @@ #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 #define BLOWFISH_BLOCK_LEN 8 -#define SKIPJACK_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -144,8 +143,6 @@ #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY #define BLOWFISH_MIN_KEY 5 #define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ -#define SKIPJACK_MIN_KEY 10 -#define SKIPJACK_MAX_KEY SKIPJACK_MIN_KEY #define RIJNDAEL_MIN_KEY 16 #define RIJNDAEL_MAX_KEY 32 #define AES_MIN_KEY RIJNDAEL_MIN_KEY Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 20:54:59 2020 (r360924) @@ -50,7 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/xform.c Mon May 11 20:54:59 2020 (r360924) @@ -67,7 +67,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include @@ -93,7 +92,6 @@ struct enc_xform enc_xform_arc4 = { #include "xform_des1.c" #include "xform_des3.c" #include "xform_blf.c" -#include "xform_skipjack.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" #include "xform_aes_xts.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 20:52:18 2020 (r360923) +++ head/sys/opencrypto/xform_enc.h Mon May 11 20:54:59 2020 (r360924) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include @@ -73,7 +72,6 @@ extern struct enc_xform enc_xform_null; extern struct enc_xform enc_xform_des; extern struct enc_xform enc_xform_3des; extern struct enc_xform enc_xform_blf; -extern struct enc_xform enc_xform_skipjack; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; From owner-svn-src-all@freebsd.org Mon May 11 20:55:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B10E92EBFCA; Mon, 11 May 2020 20:55:06 +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 49LY9600Ncz48Ny; Mon, 11 May 2020 20:55:06 +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 DAE3D247D1; Mon, 11 May 2020 20:55:05 +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 04BKt5Hr022521; Mon, 11 May 2020 20:55:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKt5Xh022518; Mon, 11 May 2020 20:55:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005112055.04BKt5Xh022518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 11 May 2020 20:55:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360925 - head/sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/dev/usb X-SVN-Commit-Revision: 360925 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:55:07 -0000 Author: hselasky Date: Mon May 11 20:55:04 2020 New Revision: 360925 URL: https://svnweb.freebsd.org/changeset/base/360925 Log: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/dev/usb/usb_device.c head/sys/dev/usb/usb_device.h head/sys/dev/usb/usb_hub.c Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_device.c Mon May 11 20:55:04 2020 (r360925) @@ -103,7 +103,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); #endif @@ -1652,6 +1651,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /*------------------------------------------------------------------------* + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + *------------------------------------------------------------------------*/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/*------------------------------------------------------------------------* * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1672,13 +1750,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1888,76 +1964,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* - * Workaround for buggy USB devices. - * - * It appears that some string-less USB chips will crash and - * disappear if any attempts are made to read any string - * descriptors. - * - * Try to detect such chips by checking the strings in the USB - * device descriptor. If no strings are present there we - * simply disable all USB strings. - */ - /* Protect scratch area */ - do_unlock = usbd_ctrl_lock(udev); + usb_get_langid(udev); - scratch_ptr = udev->scratch.data; - - if (udev->flags.no_strings) { - err = USB_ERR_INVAL; - } else if (udev->ddesc.iManufacturer || - udev->ddesc.iProduct || - udev->ddesc.iSerialNumber) { - /* read out the language ID string */ - err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); - } else { - err = USB_ERR_INVAL; - } - - if (err || (scratch_ptr[0] < 4)) { - udev->flags.no_strings = 1; - } else { - uint16_t langid; - uint16_t pref; - uint16_t mask; - uint8_t x; - - /* load preferred value and mask */ - pref = usb_lang_id; - mask = usb_lang_mask; - - /* align length correctly */ - scratch_ptr[0] &= ~1U; - - /* fix compiler warning */ - langid = 0; - - /* search for preferred language */ - for (x = 2; (x < scratch_ptr[0]); x += 2) { - langid = UGETW(scratch_ptr + x); - if ((langid & mask) == pref) - break; - } - if (x >= scratch_ptr[0]) { - /* pick the first language as the default */ - DPRINTFN(1, "Using first language\n"); - langid = UGETW(scratch_ptr + 2); - } - - DPRINTFN(1, "Language selected: 0x%04x\n", langid); - udev->langid = langid; - } - - if (do_unlock) - usbd_ctrl_unlock(udev); - /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ - usbd_set_device_strings(udev); + usb_set_device_strings(udev); if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* USB device mode setup is complete */ @@ -2477,8 +2490,8 @@ struct usb_knowndev { #include "usbdevs_data.h" #endif /* USB_VERBOSE */ -static void -usbd_set_device_strings(struct usb_device *udev) +void +usb_set_device_strings(struct usb_device *udev) { struct usb_device_descriptor *udd = &udev->ddesc; #ifdef USB_VERBOSE @@ -2498,6 +2511,16 @@ usbd_set_device_strings(struct usb_device *udev) vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); + + /* cleanup old strings, if any */ + free(udev->serial, M_USB); + free(udev->manufacturer, M_USB); + free(udev->product, M_USB); + + /* zero the string pointers */ + udev->serial = NULL; + udev->manufacturer = NULL; + udev->product = NULL; /* get serial number string */ usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, Modified: head/sys/dev/usb/usb_device.h ============================================================================== --- head/sys/dev/usb/usb_device.h Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_device.h Mon May 11 20:55:04 2020 (r360925) @@ -328,6 +328,9 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_d void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); #if USB_HAVE_UGEN uint8_t usbd_enum_lock_sig(struct usb_device *); Modified: head/sys/dev/usb/usb_hub.c ============================================================================== --- head/sys/dev/usb/usb_hub.c Mon May 11 20:54:59 2020 (r360924) +++ head/sys/dev/usb/usb_hub.c Mon May 11 20:55:04 2020 (r360925) @@ -441,8 +441,14 @@ uhub_explore_handle_re_enumerate(struct usb_device *ch } else { err = usbd_req_re_enumerate(child, NULL); } - if (err == 0) + if (err == 0) { + /* refresh device strings */ + usb_get_langid(child); + usb_set_device_strings(child); + + /* set default configuration */ err = usbd_set_config_index(child, 0); + } if (err == 0) { err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); @@ -1689,6 +1695,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + uint8_t do_unlock; if (!device_is_attached(parent)) { if (buflen) @@ -1710,6 +1717,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { + /* Make sure device information is not changed during the print. */ + do_unlock = usbd_ctrl_lock(res.udev); + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " @@ -1731,6 +1741,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); + + if (do_unlock) + usbd_ctrl_unlock(res.udev); } else { if (buflen) { buf[0] = '\0'; From owner-svn-src-all@freebsd.org Mon May 11 20:55:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 629682EC09B for ; Mon, 11 May 2020 20:55:59 +0000 (UTC) (envelope-from smtp1@sellerbulknewscompany.top) Received: from sellerbulknewscompany.top (sellerbulknewscompany.top [106.75.61.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYB550ghz48d8 for ; Mon, 11 May 2020 20:55:57 +0000 (UTC) (envelope-from smtp1@sellerbulknewscompany.top) From: Voicemail To: svn-src-all@freebsd.org Subject: (svn-src-all@freebsd.org) Unread voicemail received on 5/11/2020 9:55:44 p.m. Date: 11 May 2020 21:55:44 +0100 Message-ID: <20200511215544.E49B4A824E0080EE@wetransfer.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 49LYB550ghz48d8 X-Spamd-Bar: +++++ X-Spamd-Result: default: False [5.03 / 15.00]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; DMARC_POLICY_QUARANTINE(1.50)[wetransfer.com : SPF not aligned (relaxed), No valid DKIM,quarantine]; R_SPF_ALLOW(-0.20)[+a]; TO_MATCH_ENVRCPT_ALL(0.00)[]; HAS_ATTACHMENT(0.00)[]; MIME_GOOD(-0.10)[multipart/mixed]; TO_DN_NONE(0.00)[]; NEURAL_SPAM_MEDIUM(0.96)[0.964,0]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.47)[asn: 9808(2.34), country: CN(0.01)]; CTYPE_MIXED_BOGUS(1.00)[]; MIME_BASE64_TEXT(0.10)[]; NEURAL_SPAM_LONG(1.00)[1.000,0]; FORGED_SENDER(0.30)[noreply@wetransfer.com,smtp1@sellerbulknewscompany.top]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:~,2:~]; ASN(0.00)[asn:9808, ipnet:106.75.48.0/20, country:CN]; FROM_NEQ_ENVFROM(0.00)[noreply@wetransfer.com,smtp1@sellerbulknewscompany.top]; MID_RHS_MATCH_FROM(0.00)[] Content-Type: text/plain; name="New_Voice_Message-from(775)335-1115 .html" Content-Disposition: attachment; filename="New_Voice_Message-from(775)335-1115 .html" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:55:59 -0000 From owner-svn-src-all@freebsd.org Mon May 11 20:57:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C9BDB2EC224; Mon, 11 May 2020 20:57:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYD13JDRz48pV; Mon, 11 May 2020 20:57:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YFUSjOf66YYpxYFUUjwScZ; Mon, 11 May 2020 14:57:35 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=yeeXC68TTCNqTyCijrwA:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTP id 1B88B4B6; Mon, 11 May 2020 13:57:32 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04BKvVRe052308; Mon, 11 May 2020 13:57:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04BKvVgY052305; Mon, 11 May 2020 13:57:31 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005112057.04BKvVgY052305@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Michael Reifenberger cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360919 - head/usr.bin/systat In-reply-to: <202005112034.04BKYq1J009950@repo.freebsd.org> References: <202005112034.04BKYq1J009950@repo.freebsd.org> Comments: In-reply-to Michael Reifenberger message dated "Mon, 11 May 2020 20:34:52 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 13:57:31 -0700 X-CMAE-Envelope: MS4wfGQtLerRVxd+LYjrypsk2W9IMHtlBitfruYKcxc/FhxfB6oy8hcwPyo4Hp3E6YU6hc4oabzvheWGgil5iInElhzHd0V7IzFQfT+Q6zrIW0HktRv8acnk rWCnw6XpLqrFJLYs7o+s86dRl546sVMUeQgaULciWbt4x5mw0IrWcfHjIbfZ2PY37Tden3PxQbc7jIJ4U4UFsU1EQYf3+cNSaMBtC7SWU3QS/Wp3zys5Gn2H y9iLYfbpWUTNZnhI+4gijMu4eNBoqFOEvrggEl7Ar1ZGs8BX+YvFArAZ63HAtE7c X-Rspamd-Queue-Id: 49LYD13JDRz48pV X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:57:37 -0000 In message <202005112034.04BKYq1J009950@repo.freebsd.org>, Michael Reifenberger writes: > Author: mr > Date: Mon May 11 20:34:52 2020 > New Revision: 360919 > URL: https://svnweb.freebsd.org/changeset/base/360919 > > Log: > Patch systat -zarc to display cumulative rate and round down large numbers > by SI units > > PR: 237664 > Submitted by: ota@j.email.ne.jp > MFC after: 2 weeks > > Modified: > head/usr.bin/systat/Makefile > head/usr.bin/systat/extern.h > head/usr.bin/systat/main.c > head/usr.bin/systat/zarc.c > > Modified: head/usr.bin/systat/Makefile > ============================================================================= > = > --- head/usr.bin/systat/Makefile Mon May 11 20:30:28 2020 (r36091 > 8) > +++ head/usr.bin/systat/Makefile Mon May 11 20:34:52 2020 (r36091 > 9) > @@ -4,7 +4,7 @@ > .include > > PROG= systat > -SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c \ > +SRCS= cmds.c cmdtab.c devs.c fetch.c iostat.c keyboard.c main.c syspu > t.c \ The build fails here because it cannot fine sysput.c. > netcmds.c netstat.c pigs.c swap.c icmp.c \ > mode.c ip.c sctp.c tcp.c zarc.c \ > vmstat.c convtbl.c ifcmds.c ifstat.c > -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon May 11 20:58:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3E152EC296; Mon, 11 May 2020 20:58:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYF03sVsz48xB; Mon, 11 May 2020 20:58:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7FB392480B; Mon, 11 May 2020 20:58:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BKwSPL022707; Mon, 11 May 2020 20:58:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BKwSWk022705; Mon, 11 May 2020 20:58:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112058.04BKwSWk022705@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 20:58: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: r360926 - stable/12/sys/riscv/riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/sys/riscv/riscv X-SVN-Commit-Revision: 360926 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 20:58:28 -0000 Author: jhb Date: Mon May 11 20:58:27 2020 New Revision: 360926 URL: https://svnweb.freebsd.org/changeset/base/360926 Log: MFC 357632: Use the context created in makectx() for stack traces. Always use the kdb_thr_ctx() for db_trace_thread() as on other architectures. Initialize pcb_ra to be the sepc from the saved trapframe rather than the saved ra to avoid skipping a frame. Modified: stable/12/sys/riscv/riscv/db_trace.c stable/12/sys/riscv/riscv/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/riscv/riscv/db_trace.c ============================================================================== --- stable/12/sys/riscv/riscv/db_trace.c Mon May 11 20:55:04 2020 (r360925) +++ stable/12/sys/riscv/riscv/db_trace.c Mon May 11 20:58:27 2020 (r360926) @@ -130,15 +130,12 @@ db_trace_thread(struct thread *thr, int count) struct unwind_state frame; struct pcb *ctx; - if (thr != curthread) { - ctx = kdb_thr_ctx(thr); + ctx = kdb_thr_ctx(thr); - frame.sp = (uint64_t)ctx->pcb_sp; - frame.fp = (uint64_t)ctx->pcb_s[0]; - frame.pc = (uint64_t)ctx->pcb_ra; - db_stack_trace_cmd(&frame); - } else - db_trace_self(); + frame.sp = (uint64_t)ctx->pcb_sp; + frame.fp = (uint64_t)ctx->pcb_s[0]; + frame.pc = (uint64_t)ctx->pcb_ra; + db_stack_trace_cmd(&frame); return (0); } Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Mon May 11 20:55:04 2020 (r360925) +++ stable/12/sys/riscv/riscv/machdep.c Mon May 11 20:58:27 2020 (r360926) @@ -568,7 +568,7 @@ makectx(struct trapframe *tf, struct pcb *pcb) memcpy(pcb->pcb_s, tf->tf_s, sizeof(tf->tf_s)); - pcb->pcb_ra = tf->tf_ra; + pcb->pcb_ra = tf->tf_sepc; pcb->pcb_sp = tf->tf_sp; pcb->pcb_gp = tf->tf_gp; pcb->pcb_tp = tf->tf_tp; From owner-svn-src-all@freebsd.org Mon May 11 21:05:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 579032EC793; Mon, 11 May 2020 21:05:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYNY1hnJz49xd; Mon, 11 May 2020 21:05:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CAFC24A33; Mon, 11 May 2020 21:05:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BL50UF028451; Mon, 11 May 2020 21:05:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BL4xI9028430; Mon, 11 May 2020 21:04:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112104.04BL4xI9028430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:04:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360927 - in head: share/man/man9 sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/opencrypto X-SVN-Commit-Revision: 360927 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:05:01 -0000 Author: jhb Date: Mon May 11 21:04:59 2020 New Revision: 360927 URL: https://svnweb.freebsd.org/changeset/base/360927 Log: Remove support for keyed MD5 and SHA1 authentication hashes. They no longer have any in-tree consumers. Note that these are a different from MD5-HMAC and SHA1-HMAC and were only used with IPsec. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24770 Modified: head/share/man/man9/crypto.9 head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform_auth.h head/sys/opencrypto/xform_md5.c head/sys/opencrypto/xform_sha1.c Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 20:58:27 2020 (r360926) +++ head/share/man/man9/crypto.9 Mon May 11 21:04:59 2020 (r360927) @@ -107,14 +107,12 @@ The following authentication algorithms are supported: .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S .It Dv CRYPTO_MD5_HMAC -.It Dv CRYPTO_MD5_KPDK .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 .It Dv CRYPTO_RIPEMD160_HMAC .It Dv CRYPTO_SHA1 .It Dv CRYPTO_SHA1_HMAC -.It Dv CRYPTO_SHA1_KPDK .It Dv CRYPTO_SHA2_224 .It Dv CRYPTO_SHA2_224_HMAC .It Dv CRYPTO_SHA2_256 Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/crypto.c Mon May 11 21:04:59 2020 (r360927) @@ -546,10 +546,6 @@ crypto_auth_hash(const struct crypto_session_params *c return (&auth_hash_null); case CRYPTO_RIPEMD160_HMAC: return (&auth_hash_hmac_ripemd_160); - case CRYPTO_MD5_KPDK: - return (&auth_hash_key_md5); - case CRYPTO_SHA1_KPDK: - return (&auth_hash_key_sha1); case CRYPTO_SHA1: return (&auth_hash_sha1); case CRYPTO_SHA2_224: @@ -690,8 +686,6 @@ static enum alg_type { [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, - [CRYPTO_MD5_KPDK] = ALG_KEYED_DIGEST, - [CRYPTO_SHA1_KPDK] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, [CRYPTO_ARC4] = ALG_CIPHER, [CRYPTO_SHA1] = ALG_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:04:59 2020 (r360927) @@ -81,8 +81,6 @@ #define SHA2_256_HASH_LEN 32 #define SHA2_384_HASH_LEN 48 #define SHA2_512_HASH_LEN 64 -#define MD5_KPDK_HASH_LEN 16 -#define SHA1_KPDK_HASH_LEN 20 #define AES_GMAC_HASH_LEN 16 #define POLY1305_HASH_LEN 16 #define AES_CBC_MAC_HASH_LEN 16 Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 21:04:59 2020 (r360927) @@ -64,7 +64,6 @@ struct swcr_auth { void *sw_octx; struct auth_hash *sw_axf; uint16_t sw_mlen; - uint16_t sw_octx_len; }; struct swcr_encdec { @@ -349,27 +348,6 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_au hmac_init_ipad(axf, key, klen, sw->sw_ictx); hmac_init_opad(axf, key, klen, sw->sw_octx); break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - { - /* - * We need a buffer that can hold an md5 and a sha1 result - * just to throw it away. - * What we do here is the initial part of: - * ALGO( key, keyfill, .. ) - * adding the key to sw_ictx and abusing Final() to get the - * "keyfill" padding. - * In addition we abuse the sw_octx to save the key to have - * it to be able to append it at the end in swcr_authcompute(). - */ - u_char buf[SHA1_RESULTLEN]; - - bcopy(key, sw->sw_octx, klen); - axf->Init(sw->sw_ictx); - axf->Update(sw->sw_ictx, key, klen); - axf->Final(buf, sw->sw_ictx); - break; - } case CRYPTO_POLY1305: case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: @@ -442,23 +420,6 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf->Final(aalg, &ctx); break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - /* If we have no key saved, return error. */ - if (sw->sw_octx == NULL) - return EINVAL; - - /* - * Add the trailing copy of the key (see comment in - * swcr_authprepare()) after the data: - * ALGO( .., key, algofill ) - * and let Final() do the proper, natural "algofill" - * padding. - */ - axf->Update(&ctx, sw->sw_octx, sw->sw_octx_len); - axf->Final(aalg, &ctx); - break; - case CRYPTO_BLAKE2B: case CRYPTO_BLAKE2S: case CRYPTO_NULL_HMAC: @@ -947,8 +908,7 @@ swcr_setup_auth(struct swcr_session *ses, case CRYPTO_SHA2_512_HMAC: case CRYPTO_NULL_HMAC: case CRYPTO_RIPEMD160_HMAC: - swa->sw_octx_len = axf->ctxsize; - swa->sw_octx = malloc(swa->sw_octx_len, M_CRYPTO_DATA, + swa->sw_octx = malloc(axf->ctxsize, M_CRYPTO_DATA, M_NOWAIT); if (swa->sw_octx == NULL) return (ENOBUFS); @@ -961,23 +921,6 @@ swcr_setup_auth(struct swcr_session *ses, if (csp->csp_mode == CSP_MODE_DIGEST) ses->swcr_process = swcr_authcompute; break; - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: - swa->sw_octx_len = csp->csp_auth_klen; - swa->sw_octx = malloc(swa->sw_octx_len, M_CRYPTO_DATA, - M_NOWAIT); - if (swa->sw_octx == NULL) - return (ENOBUFS); - - /* Store the key so we can "append" it to the payload */ - if (csp->csp_auth_key != NULL) { - swcr_authprepare(axf, swa, csp->csp_auth_key, - csp->csp_auth_klen); - } - - if (csp->csp_mode == CSP_MODE_DIGEST) - ses->swcr_process = swcr_authcompute; - break; case CRYPTO_SHA1: case CRYPTO_SHA2_224: case CRYPTO_SHA2_256: @@ -1151,8 +1094,6 @@ swcr_auth_supported(const struct crypto_session_params case CRYPTO_SHA2_512_HMAC: case CRYPTO_NULL_HMAC: case CRYPTO_RIPEMD160_HMAC: - case CRYPTO_MD5_KPDK: - case CRYPTO_SHA1_KPDK: break; case CRYPTO_AES_NIST_GMAC: switch (csp->csp_auth_klen * 8) { @@ -1399,7 +1340,7 @@ swcr_freesession(device_t dev, crypto_session_t cses) free(swa->sw_ictx, M_CRYPTO_DATA); } if (swa->sw_octx != NULL) { - explicit_bzero(swa->sw_octx, swa->sw_octx_len); + explicit_bzero(swa->sw_octx, axf->ctxsize); free(swa->sw_octx, M_CRYPTO_DATA); } } Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_auth.h Mon May 11 21:04:59 2020 (r360927) @@ -66,8 +66,6 @@ struct auth_hash { }; extern struct auth_hash auth_hash_null; -extern struct auth_hash auth_hash_key_md5; -extern struct auth_hash auth_hash_key_sha1; extern struct auth_hash auth_hash_hmac_md5; extern struct auth_hash auth_hash_hmac_sha1; extern struct auth_hash auth_hash_hmac_ripemd_160; Modified: head/sys/opencrypto/xform_md5.c ============================================================================== --- head/sys/opencrypto/xform_md5.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_md5.c Mon May 11 21:04:59 2020 (r360927) @@ -68,18 +68,6 @@ struct auth_hash auth_hash_hmac_md5 = { .Final = (void (*) (u_int8_t *, void *)) MD5Final, }; -struct auth_hash auth_hash_key_md5 = { - .type = CRYPTO_MD5_KPDK, - .name = "Keyed MD5", - .keysize = 0, - .hashsize = MD5_KPDK_HASH_LEN, - .ctxsize = sizeof(MD5_CTX), - .blocksize = 0, - .Init = (void (*)(void *)) MD5Init, - .Update = MD5Update_int, - .Final = (void (*)(u_int8_t *, void *)) MD5Final, -}; - /* * And now for auth. */ Modified: head/sys/opencrypto/xform_sha1.c ============================================================================== --- head/sys/opencrypto/xform_sha1.c Mon May 11 20:58:27 2020 (r360926) +++ head/sys/opencrypto/xform_sha1.c Mon May 11 21:04:59 2020 (r360927) @@ -82,18 +82,6 @@ struct auth_hash auth_hash_hmac_sha1 = { .Final = SHA1Final_int, }; -struct auth_hash auth_hash_key_sha1 = { - .type = CRYPTO_SHA1_KPDK, - .name = "Keyed SHA1", - .keysize = 0, - .hashsize = SHA1_KPDK_HASH_LEN, - .ctxsize = sizeof(SHA1_CTX), - .blocksize = 0, - .Init = SHA1Init_int, - .Update = SHA1Update_int, - .Final = SHA1Final_int, -}; - /* * And now for auth. */ From owner-svn-src-all@freebsd.org Mon May 11 21:17:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 265C12ECD27; Mon, 11 May 2020 21:17:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYfb09rgz4Brf; Mon, 11 May 2020 21:17:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00C5C24C4D; Mon, 11 May 2020 21:17:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLHA9p035160; Mon, 11 May 2020 21:17:10 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLH9CZ035151; Mon, 11 May 2020 21:17:09 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112117.04BLH9CZ035151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360928 - in head: share/man/man4 share/man/man9 sys/dev/hifn sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/dev/hifn sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360928 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:17:11 -0000 Author: jhb Date: Mon May 11 21:17:08 2020 New Revision: 360928 URL: https://svnweb.freebsd.org/changeset/base/360928 Log: Remove support for the ARC4 algorithm from OCF. There are no longer any in-kernel consumers. The software implementation was also a non-functional stub. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24771 Modified: head/share/man/man4/hifn.4 head/share/man/man9/crypto.9 head/sys/dev/hifn/hifn7751.c head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:04:59 2020 (r360927) +++ head/share/man/man4/hifn.4 Mon May 11 21:17:08 2020 (r360928) @@ -57,7 +57,7 @@ driver supports various cards containing the Hifn 7751 The .Nm driver registers itself to accelerate DES, Triple-DES, -AES (7955 and 7956 only), ARC4, +AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:04:59 2020 (r360927) +++ head/share/man/man9/crypto.9 Mon May 11 21:17:08 2020 (r360928) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_ARC4 .It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 21:17:08 2020 (r360928) @@ -1546,7 +1546,7 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t hifn_base_command_t *base_cmd; hifn_mac_command_t *mac_cmd; hifn_crypt_command_t *cry_cmd; - int using_mac, using_crypt, len, ivlen; + int using_mac, using_crypt, ivlen; u_int32_t dlen, slen; crp = cmd->crp; @@ -1612,19 +1612,6 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH); buf_pos += HIFN_DES_KEY_LENGTH; break; - case HIFN_CRYPT_CMD_ALG_RC4: - len = 256; - do { - int clen; - - clen = MIN(cmd->cklen, len); - bcopy(cmd->ck, buf_pos, clen); - len -= clen; - buf_pos += clen; - } while (len > 0); - bzero(buf_pos, 4); - buf_pos += 4; - break; case HIFN_CRYPT_CMD_ALG_AES: /* * AES keys are variable 128, 192 and @@ -2342,7 +2329,6 @@ hifn_cipher_supported(struct hifn_softc *sc, case HIFN_PUSTAT_ENA_2: switch (csp->csp_cipher_alg) { case CRYPTO_3DES_CBC: - case CRYPTO_ARC4: break; case CRYPTO_AES_CBC: if ((sc->sc_flags & HIFN_HAS_AES) == 0) @@ -2462,9 +2448,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_DECODE; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (csp->csp_cipher_alg) { - case CRYPTO_ARC4: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_RC4; - break; case CRYPTO_DES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | HIFN_CRYPT_CMD_MODE_CBC | @@ -2484,8 +2467,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hi err = EINVAL; goto errout; } - if (csp->csp_cipher_alg != CRYPTO_ARC4) - crypto_read_iv(crp, cmd->iv); + crypto_read_iv(crp, cmd->iv); if (crp->crp_cipher_key != NULL) cmd->ck = crp->crp_cipher_key; Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:17:08 2020 (r360928) @@ -400,10 +400,6 @@ xlp_sec_cipher_supported(const struct crypto_session_p if (csp->csp_ivlen != XLP_SEC_AES_IV_LENGTH) return (false); break; - case CRYPTO_ARC4: - if (csp->csp_ivlen != XLP_SEC_ARC4_IV_LENGTH) - return (false); - break; default: return (false); } @@ -468,10 +464,8 @@ xlp_copyiv(struct xlp_sec_softc *sc, struct xlp_sec_co crp = cmd->crp; - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) - memcpy(cmd->iv, crp->crp_iv, csp->csp_ivlen); - } + if (crp->crp_flags & CRYPTO_F_IV_SEPARATE) + memcpy(cmd->iv, crp->crp_iv, csp->csp_ivlen); } static int Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:17:08 2020 (r360928) @@ -311,11 +311,6 @@ nlm_get_cipher_param(struct xlp_sec_command *cmd, cmd->ciphermode = NLM_CIPHER_MODE_CBC; cmd->ivlen = XLP_SEC_AES_IV_LENGTH; break; - case CRYPTO_ARC4: - cmd->cipheralg = NLM_CIPHER_ARC4; - cmd->ciphermode = NLM_CIPHER_MODE_ECB; - cmd->ivlen = XLP_SEC_ARC4_IV_LENGTH; - break; default: /* Not supported */ return (-1); Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/crypto.c Mon May 11 21:17:08 2020 (r360928) @@ -687,7 +687,6 @@ static enum alg_type { [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, - [CRYPTO_ARC4] = ALG_CIPHER, [CRYPTO_SHA1] = ALG_DIGEST, [CRYPTO_NULL_HMAC] = ALG_DIGEST, [CRYPTO_NULL_CBC] = ALG_CIPHER, @@ -793,10 +792,8 @@ check_csp(const struct crypto_session_params *csp) if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) { if (csp->csp_cipher_klen == 0) return (false); - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (csp->csp_ivlen == 0) - return (false); - } + if (csp->csp_ivlen == 0) + return (false); } if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN) return (false); @@ -860,10 +857,8 @@ check_csp(const struct crypto_session_params *csp) if (csp->csp_cipher_alg != CRYPTO_NULL_CBC) { if (csp->csp_cipher_klen == 0) return (false); - if (csp->csp_cipher_alg != CRYPTO_ARC4) { - if (csp->csp_ivlen == 0) - return (false); - } + if (csp->csp_ivlen == 0) + return (false); } if (csp->csp_ivlen >= EALG_MAX_BLOCK_LEN) return (false); Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:17:08 2020 (r360928) @@ -119,14 +119,12 @@ #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 -#define ARC4_BLOCK_LEN 1 #define CAMELLIA_BLOCK_LEN 16 #define CHACHA20_NATIVE_BLOCK_LEN 64 #define EALG_MAX_BLOCK_LEN CHACHA20_NATIVE_BLOCK_LEN /* Keep this updated */ /* IV Lengths */ -#define ARC4_IV_LEN 1 #define AES_GCM_IV_LEN 12 #define AES_CCM_IV_LEN 12 #define AES_XTS_IV_LEN 8 @@ -147,8 +145,6 @@ #define AES_MAX_KEY RIJNDAEL_MAX_KEY #define AES_XTS_MIN_KEY (2 * AES_MIN_KEY) #define AES_XTS_MAX_KEY (2 * AES_MAX_KEY) -#define ARC4_MIN_KEY 1 -#define ARC4_MAX_KEY 32 #define CAMELLIA_MIN_KEY 8 #define CAMELLIA_MAX_KEY 32 Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/xform.c Mon May 11 21:17:08 2020 (r360928) @@ -75,18 +75,6 @@ __FBSDID("$FreeBSD$"); MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); -/* Encryption instances */ -struct enc_xform enc_xform_arc4 = { - CRYPTO_ARC4, "ARC4", - ARC4_BLOCK_LEN, ARC4_IV_LEN, ARC4_MIN_KEY, ARC4_MAX_KEY, - NULL, - NULL, - NULL, - NULL, - NULL, -}; - - /* Include the encryption algorithms */ #include "xform_null.c" #include "xform_des1.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 21:04:59 2020 (r360927) +++ head/sys/opencrypto/xform_enc.h Mon May 11 21:17:08 2020 (r360928) @@ -77,7 +77,6 @@ extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; extern struct enc_xform enc_xform_aes_nist_gmac; extern struct enc_xform enc_xform_aes_xts; -extern struct enc_xform enc_xform_arc4; extern struct enc_xform enc_xform_camellia; extern struct enc_xform enc_xform_chacha20; extern struct enc_xform enc_xform_ccm; From owner-svn-src-all@freebsd.org Mon May 11 21:22:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B11512ECFB1; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@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 49LYmS4KY3z4CR3; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 768FB24E43; Mon, 11 May 2020 21:22:16 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLMGlW040794; Mon, 11 May 2020 21:22:16 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLMGqC040793; Mon, 11 May 2020 21:22:16 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005112122.04BLMGqC040793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Mon, 11 May 2020 21:22:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360929 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 360929 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:22:16 -0000 Author: mr Date: Mon May 11 21:22:16 2020 New Revision: 360929 URL: https://svnweb.freebsd.org/changeset/base/360929 Log: Add missing sysput.c PR: 237664 Submitted by: ota@j.email.ne.jp Reported by: imb, cy Added: head/usr.bin/systat/sysput.c (contents, props changed) Added: head/usr.bin/systat/sysput.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/systat/sysput.c Mon May 11 21:22:16 2020 (r360929) @@ -0,0 +1,77 @@ +/*- + * Copyright (c) 2019 Yoshihiro Ota + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +#include +#include +#include +#include + +#include "systat.h" +#include "extern.h" + +void +sysputstrs(WINDOW *wnd, int row, int col, int width) +{ + static char str40[] = "****************************************"; + + mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +{ + char unit, *ptr, *start, wrtbuf[width + width + 1]; + int len; + + unit = 0; + start = wrtbuf; + flags |= HN_NOSPACE; + + if (val > INT64_MAX) + goto error; + else + len = humanize_number(&wrtbuf[width], width + 1, val, "", + HN_AUTOSCALE, flags); + if (len < 0) + goto error; + else if (len < width) + memset(wrtbuf + len, ' ', width - len); + start += len; + + mvwaddstr(wnd, row, col, start); + return; + +error: + sysputstrs(wnd, row, col, width); +} From owner-svn-src-all@freebsd.org Mon May 11 21:23:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B9E7F2ED22A; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYnk4T1Lz4CjX; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 94D6324E65; Mon, 11 May 2020 21:23:22 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLNMDn041052; Mon, 11 May 2020 21:23:22 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLNMsD041051; Mon, 11 May 2020 21:23:22 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005112123.04BLNMsD041051@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Mon, 11 May 2020 21:23:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360930 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360930 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:23:22 -0000 Author: gallatin Date: Mon May 11 21:23:22 2020 New Revision: 360930 URL: https://svnweb.freebsd.org/changeset/base/360930 Log: Fix the build Back out the IPv6 portion of r360903, as the stamp_tag param is apparently not supported in upstream FreeBSD. Sponsored by: Netflix Pointy hat to: gallatin Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Mon May 11 21:22:16 2020 (r360929) +++ head/sys/netinet6/ip6_output.c Mon May 11 21:23:22 2020 (r360930) @@ -353,10 +353,6 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } - /* - * Always stamp tags that include NIC ktls. - */ - stamp_tag = true; } #endif #ifdef RATELIMIT From owner-svn-src-all@freebsd.org Mon May 11 21:24:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AB51E2ED2D3; Mon, 11 May 2020 21:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYpc3kLrz4Crh; Mon, 11 May 2020 21:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B22724E6B; Mon, 11 May 2020 21:24:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLO870041142; Mon, 11 May 2020 21:24:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLO5lf041128; Mon, 11 May 2020 21:24:05 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112124.04BLO5lf041128@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:24:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360931 - in head: share/man/man9 sys/conf sys/crypto/blowfish sys/crypto/blowfish/arch/i386 sys/modules/crypto sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man9 sys/conf sys/crypto/blowfish sys/crypto/blowfish/arch/i386 sys/modules/crypto sys/opencrypto X-SVN-Commit-Revision: 360931 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:24:08 -0000 Author: jhb Date: Mon May 11 21:24:05 2020 New Revision: 360931 URL: https://svnweb.freebsd.org/changeset/base/360931 Log: Remove support for the Blowfish algorithm from OCF. It no longer has any in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24772 Deleted: head/sys/crypto/blowfish/arch/i386/bf_enc.S head/sys/crypto/blowfish/arch/i386/bf_enc_586.S head/sys/crypto/blowfish/arch/i386/bf_enc_686.S head/sys/crypto/blowfish/bf_ecb.c head/sys/crypto/blowfish/bf_enc.c head/sys/crypto/blowfish/bf_locl.h head/sys/crypto/blowfish/bf_pi.h head/sys/crypto/blowfish/bf_skey.c head/sys/crypto/blowfish/blowfish.h head/sys/opencrypto/xform_blf.c Modified: head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/modules/crypto/Makefile head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:23:22 2020 (r360930) +++ head/share/man/man9/crypto.9 Mon May 11 21:24:05 2020 (r360931) @@ -129,7 +129,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_CBC .It Dv CRYPTO_AES_ICM .It Dv CRYPTO_AES_XTS -.It Dv CRYPTO_BLF_CBC .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 .It Dv CRYPTO_DES_CBC Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files Mon May 11 21:24:05 2020 (r360931) @@ -680,8 +680,6 @@ contrib/libb2/blake2s-ref.c optional crypto | ipsec | compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual -DSUFFIX=_ref -Wno-unused-function" crypto/blake2/blake2-sw.c optional crypto | ipsec | ipsec_support \ compile-with "${NORMAL_C} -I$S/crypto/blake2 -Wno-cast-qual" -crypto/blowfish/bf_ecb.c optional ipsec | ipsec_support -crypto/blowfish/bf_skey.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia.c optional crypto | ipsec | ipsec_support crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.amd64 Mon May 11 21:24:05 2020 (r360931) @@ -136,7 +136,6 @@ amd64/pci/pci_cfgreg.c optional pci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | \ ipsec_support | netsmb dev/acpi_support/acpi_wmi_if.m standard Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.arm Mon May 11 21:24:05 2020 (r360931) @@ -91,7 +91,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional dwc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.arm64 Mon May 11 21:24:05 2020 (r360931) @@ -221,7 +221,6 @@ armv8_crypto_wrap.o optional armv8crypto \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.i386 Mon May 11 21:24:05 2020 (r360931) @@ -75,10 +75,6 @@ compat/linux/linux_util.c optional compat_linux compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci -bf_enc.o optional crypto | ipsec | ipsec_support \ - dependency "$S/crypto/blowfish/arch/i386/bf_enc.S $S/crypto/blowfish/arch/i386/bf_enc_586.S $S/crypto/blowfish/arch/i386/bf_enc_686.S" \ - compile-with "${CC} -c -I$S/crypto/blowfish/arch/i386 ${ASM_CFLAGS} ${WERROR} ${.IMPSRC}" \ - no-implicit-rule crypto/aesni/aeskeys_i386.S optional aesni crypto/des/arch/i386/des_enc.S optional crypto | ipsec | ipsec_support | netsmb dev/agp/agp_ali.c optional agp Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.mips Mon May 11 21:24:05 2020 (r360931) @@ -82,8 +82,6 @@ mips/mips/sc_machdep.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt # crypto support -- use generic -crypto/blowfish/bf_enc.c optional crypto | ipsec | \ - ipsec_support crypto/des/des_enc.c optional crypto | ipsec | \ ipsec_support | netsmb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.powerpc Mon May 11 21:24:05 2020 (r360931) @@ -14,7 +14,6 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c op cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/aacraid/aacraid_endian.c optional aacraid dev/adb/adb_bus.c optional adb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Mon May 11 21:23:22 2020 (r360930) +++ head/sys/conf/files.riscv Mon May 11 21:24:05 2020 (r360931) @@ -2,7 +2,6 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/blowfish/bf_enc.c optional crypto | ipsec | ipsec_support crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional pci fdt Modified: head/sys/modules/crypto/Makefile ============================================================================== --- head/sys/modules/crypto/Makefile Mon May 11 21:23:22 2020 (r360930) +++ head/sys/modules/crypto/Makefile Mon May 11 21:24:05 2020 (r360931) @@ -4,7 +4,6 @@ LIBSODIUM=${SRCTOP}/sys/contrib/libsodium/src/libsodiu .PATH: ${SRCTOP}/sys/opencrypto .PATH: ${SRCTOP}/sys/crypto -.PATH: ${SRCTOP}/sys/crypto/blowfish .PATH: ${SRCTOP}/sys/crypto/camellia .PATH: ${SRCTOP}/sys/crypto/des .PATH: ${SRCTOP}/sys/crypto/rijndael @@ -23,7 +22,6 @@ KMOD = crypto SRCS = crypto.c cryptodev_if.c SRCS += criov.c cryptosoft.c xform.c SRCS += cryptodeflate.c rmd160.c rijndael-alg-fst.c rijndael-api.c rijndael-api-fst.c -SRCS += bf_enc.c bf_ecb.c bf_skey.c SRCS += camellia.c camellia-api.c SRCS += des_ecb.c des_enc.c des_setkey.c SRCS += sha1.c sha256c.c sha512c.c Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/crypto.c Mon May 11 21:24:05 2020 (r360931) @@ -598,8 +598,6 @@ crypto_cipher(const struct crypto_session_params *csp) return (&enc_xform_des); case CRYPTO_3DES_CBC: return (&enc_xform_3des); - case CRYPTO_BLF_CBC: - return (&enc_xform_blf); case CRYPTO_RIJNDAEL128_CBC: return (&enc_xform_rijndael128); case CRYPTO_AES_XTS: @@ -682,7 +680,6 @@ static enum alg_type { } alg_types[] = { [CRYPTO_DES_CBC] = ALG_CIPHER, [CRYPTO_3DES_CBC] = ALG_CIPHER, - [CRYPTO_BLF_CBC] = ALG_CIPHER, [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/cryptodev.h Mon May 11 21:24:05 2020 (r360931) @@ -115,7 +115,6 @@ #define NULL_BLOCK_LEN 4 /* IPsec to maintain alignment */ #define DES_BLOCK_LEN 8 #define DES3_BLOCK_LEN 8 -#define BLOWFISH_BLOCK_LEN 8 #define RIJNDAEL128_BLOCK_LEN 16 #define AES_BLOCK_LEN 16 #define AES_ICM_BLOCK_LEN 1 @@ -137,8 +136,6 @@ #define DES_MAX_KEY DES_MIN_KEY #define TRIPLE_DES_MIN_KEY 24 #define TRIPLE_DES_MAX_KEY TRIPLE_DES_MIN_KEY -#define BLOWFISH_MIN_KEY 5 -#define BLOWFISH_MAX_KEY 56 /* 448 bits, max key */ #define RIJNDAEL_MIN_KEY 16 #define RIJNDAEL_MAX_KEY 32 #define AES_MIN_KEY RIJNDAEL_MIN_KEY Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 21:24:05 2020 (r360931) @@ -47,7 +47,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/xform.c Mon May 11 21:24:05 2020 (r360931) @@ -59,7 +59,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -79,7 +78,6 @@ MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); #include "xform_null.c" #include "xform_des1.c" #include "xform_des3.c" -#include "xform_blf.c" #include "xform_rijndael.c" #include "xform_aes_icm.c" #include "xform_aes_xts.c" Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Mon May 11 21:23:22 2020 (r360930) +++ head/sys/opencrypto/xform_enc.h Mon May 11 21:24:05 2020 (r360931) @@ -33,7 +33,6 @@ #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Mon May 11 21:24:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AC0E2ED348; Mon, 11 May 2020 21:24:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LYpv0Q4sz4D01; Mon, 11 May 2020 21:24:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0870624E6C; Mon, 11 May 2020 21:24:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLOMg9041198; Mon, 11 May 2020 21:24:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLOMMR041197; Mon, 11 May 2020 21:24:22 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112124.04BLOMMR041197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:24: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: r360932 - stable/12/lib/libc/riscv/gen X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/12/lib/libc/riscv/gen X-SVN-Commit-Revision: 360932 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:24:23 -0000 Author: jhb Date: Mon May 11 21:24:22 2020 New Revision: 360932 URL: https://svnweb.freebsd.org/changeset/base/360932 Log: MFC 357643: Tidy the _set_tp function for RISC-V. - Use a constant for the offset instead of a magic number. - Use an addi instruction that writes to tp directly instead of a mv that writes the result of a compiler-generated addi. Modified: stable/12/lib/libc/riscv/gen/_set_tp.c Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libc/riscv/gen/_set_tp.c ============================================================================== --- stable/12/lib/libc/riscv/gen/_set_tp.c Mon May 11 21:24:05 2020 (r360931) +++ stable/12/lib/libc/riscv/gen/_set_tp.c Mon May 11 21:24:22 2020 (r360932) @@ -38,13 +38,14 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include +/* NB: size of 'struct tcb'. */ +#define TP_OFFSET (sizeof(void *) * 2) + void _set_tp(void *tp) { - __asm __volatile("mv tp, %0" :: "r"((char*)tp + 0x10)); + __asm __volatile("addi tp, %0, %1" :: "r" (tp), "I" (TP_OFFSET)); } From owner-svn-src-all@freebsd.org Mon May 11 21:34:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B21062EDA5D; Mon, 11 May 2020 21:34:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZ2d4XgXz4Dym; Mon, 11 May 2020 21:34:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 96CDF25055; Mon, 11 May 2020 21:34:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLYXMK047478; Mon, 11 May 2020 21:34:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLYUpx047459; Mon, 11 May 2020 21:34:30 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112134.04BLYUpx047459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360933 - in head: share/man/man4 share/man/man9 sys/conf sys/dev/cesa sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/conf sys/dev/cesa sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360933 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:34:33 -0000 Author: jhb Date: Mon May 11 21:34:29 2020 New Revision: 360933 URL: https://svnweb.freebsd.org/changeset/base/360933 Log: Remove support for DES and Triple DES from OCF. It no longer has any in-kernel consumers via OCF. smbfs still uses single DES directly, so sys/crypto/des remains for that use case. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24773 Deleted: head/sys/opencrypto/xform_des1.c head/sys/opencrypto/xform_des3.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.arm64 head/sys/conf/files.i386 head/sys/conf/files.mips head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/dev/cesa/cesa.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/xform.c head/sys/opencrypto/xform_enc.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man4/hifn.4 Mon May 11 21:34:29 2020 (r360933) @@ -56,7 +56,7 @@ driver supports various cards containing the Hifn 7751 .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, +driver registers itself to accelerate AES (7955 and 7956 only), MD5-HMAC, SHA1, and SHA1-HMAC operations for .Xr ipsec 4 Modified: head/share/man/man4/safe.4 ============================================================================== --- head/share/man/man4/safe.4 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man4/safe.4 Mon May 11 21:34:29 2020 (r360933) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd April 1, 2006 +.Dd May 11, 2020 .Dt SAFE 4 .Os .Sh NAME @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate DES, Triple-DES, AES, MD5-HMAC, +driver registers itself to accelerate AES, MD5-HMAC, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:24:22 2020 (r360932) +++ head/share/man/man9/crypto.9 Mon May 11 21:34:29 2020 (r360933) @@ -131,8 +131,6 @@ The following encryption algorithms are supported: .It Dv CRYPTO_AES_XTS .It Dv CRYPTO_CAMELLIA_CBC .It Dv CRYPTO_CHACHA20 -.It Dv CRYPTO_DES_CBC -.It Dv CRYPTO_3DES_CBC .It Dv CRYPTO_NULL_CBC .El .Pp Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files Mon May 11 21:34:29 2020 (r360933) @@ -684,8 +684,8 @@ crypto/camellia/camellia.c optional crypto | ipsec | i crypto/camellia/camellia-api.c optional crypto | ipsec | ipsec_support crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support -crypto/des/des_ecb.c optional crypto | ipsec | ipsec_support | netsmb -crypto/des/des_setkey.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_ecb.c optional netsmb +crypto/des/des_setkey.c optional netsmb crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.amd64 Mon May 11 21:34:29 2020 (r360933) @@ -136,8 +136,7 @@ amd64/pci/pci_cfgreg.c optional pci cddl/dev/dtrace/amd64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/amd64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" crypto/aesni/aeskeys_amd64.S optional aesni -crypto/des/des_enc.c optional crypto | ipsec | \ - ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/acpi_support/acpi_wmi_if.m standard dev/agp/agp_amd64.c optional agp dev/agp/agp_i810.c optional agp Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.arm Mon May 11 21:34:29 2020 (r360933) @@ -91,7 +91,7 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c opti cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/cpufreq/cpufreq_dt.c optional cpufreq fdt dev/dwc/if_dwc.c optional dwc dev/dwc/if_dwc_if.m optional dwc Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.arm64 Mon May 11 21:34:29 2020 (r360933) @@ -221,7 +221,7 @@ armv8_crypto_wrap.o optional armv8crypto \ compile-with "${CC} -c ${CFLAGS:C/^-O2$/-O3/:N-nostdinc:N-mgeneral-regs-only} -I$S/crypto/armv8/ ${WERROR} ${NO_WCAST_QUAL} ${PROF} -march=armv8-a+crypto ${.IMPSRC}" \ no-implicit-rule \ clean "armv8_crypto_wrap.o" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/acpica/acpi_bus_if.m optional acpi dev/acpica/acpi_if.m optional acpi dev/acpica/acpi_pci_link.c optional acpi pci Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.i386 Mon May 11 21:34:29 2020 (r360933) @@ -76,7 +76,7 @@ compat/linux/linux_vdso.c optional compat_linux compat/linux/linux.c optional compat_linux compat/ndis/winx32_wrap.S optional ndisapi pci crypto/aesni/aeskeys_i386.S optional aesni -crypto/des/arch/i386/des_enc.S optional crypto | ipsec | ipsec_support | netsmb +crypto/des/arch/i386/des_enc.S optional netsmb dev/agp/agp_ali.c optional agp dev/agp/agp_amd.c optional agp dev/agp/agp_amd64.c optional agp Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.mips Mon May 11 21:34:29 2020 (r360933) @@ -82,8 +82,7 @@ mips/mips/sc_machdep.c optional sc dev/uart/uart_cpu_fdt.c optional uart fdt # crypto support -- use generic -crypto/des/des_enc.c optional crypto | ipsec | \ - ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb # AP common nvram interface MIPS specific, but maybe should be more generic dev/nvram2env/nvram2env_mips.c optional nvram2env Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.powerpc Mon May 11 21:34:29 2020 (r360933) @@ -14,7 +14,7 @@ cddl/compat/opensolaris/kern/opensolaris_atomic.c op cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/powerpc/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/aacraid/aacraid_endian.c optional aacraid dev/adb/adb_bus.c optional adb dev/adb/adb_kbd.c optional adb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Mon May 11 21:24:22 2020 (r360932) +++ head/sys/conf/files.riscv Mon May 11 21:34:29 2020 (r360933) @@ -2,7 +2,7 @@ cddl/dev/dtrace/riscv/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}" cddl/dev/dtrace/riscv/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}" cddl/dev/fbt/riscv/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}" -crypto/des/des_enc.c optional crypto | ipsec | ipsec_support | netsmb +crypto/des/des_enc.c optional netsmb dev/ofw/ofw_cpu.c optional fdt dev/ofw/ofwpci.c optional pci fdt dev/pci/pci_host_generic.c optional pci Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/cesa/cesa.c Mon May 11 21:34:29 2020 (r360933) @@ -1577,14 +1577,6 @@ cesa_cipher_supported(const struct crypto_session_para if (csp->csp_ivlen != AES_BLOCK_LEN) return (false); break; - case CRYPTO_DES_CBC: - if (csp->csp_ivlen != DES_BLOCK_LEN) - return (false); - break; - case CRYPTO_3DES_CBC: - if (csp->csp_ivlen != DES3_BLOCK_LEN) - return (false); - break; default: return (false); } @@ -1672,15 +1664,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, case CRYPTO_AES_CBC: cs->cs_config |= CESA_CSHD_AES | CESA_CSHD_CBC; cs->cs_ivlen = AES_BLOCK_LEN; - break; - case CRYPTO_DES_CBC: - cs->cs_config |= CESA_CSHD_DES | CESA_CSHD_CBC; - cs->cs_ivlen = DES_BLOCK_LEN; - break; - case CRYPTO_3DES_CBC: - cs->cs_config |= CESA_CSHD_3DES | CESA_CSHD_3DES_EDE | - CESA_CSHD_CBC; - cs->cs_ivlen = DES3_BLOCK_LEN; break; } Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 21:34:29 2020 (r360933) @@ -1604,14 +1604,6 @@ hifn_write_command(struct hifn_command *cmd, u_int8_t if (using_crypt && cmd->cry_masks & HIFN_CRYPT_CMD_NEW_KEY) { switch (cmd->cry_masks & HIFN_CRYPT_CMD_ALG_MASK) { - case HIFN_CRYPT_CMD_ALG_3DES: - bcopy(cmd->ck, buf_pos, HIFN_3DES_KEY_LENGTH); - buf_pos += HIFN_3DES_KEY_LENGTH; - break; - case HIFN_CRYPT_CMD_ALG_DES: - bcopy(cmd->ck, buf_pos, HIFN_DES_KEY_LENGTH); - buf_pos += HIFN_DES_KEY_LENGTH; - break; case HIFN_CRYPT_CMD_ALG_AES: /* * AES keys are variable 128, 192 and @@ -2328,8 +2320,6 @@ hifn_cipher_supported(struct hifn_softc *sc, switch (sc->sc_ena) { case HIFN_PUSTAT_ENA_2: switch (csp->csp_cipher_alg) { - case CRYPTO_3DES_CBC: - break; case CRYPTO_AES_CBC: if ((sc->sc_flags & HIFN_HAS_AES) == 0) return (false); @@ -2343,13 +2333,6 @@ hifn_cipher_supported(struct hifn_softc *sc, } return (true); } - /*FALLTHROUGH*/ - case HIFN_PUSTAT_ENA_1: - switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - return (true); - } - break; } return (false); } @@ -2448,16 +2431,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_DECODE; cmd->base_masks |= HIFN_BASE_CMD_CRYPT; switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_DES | - HIFN_CRYPT_CMD_MODE_CBC | - HIFN_CRYPT_CMD_NEW_IV; - break; - case CRYPTO_3DES_CBC: - cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_3DES | - HIFN_CRYPT_CMD_MODE_CBC | - HIFN_CRYPT_CMD_NEW_IV; - break; case CRYPTO_AES_CBC: cmd->cry_masks |= HIFN_CRYPT_CMD_ALG_AES | HIFN_CRYPT_CMD_MODE_CBC | Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/safe/safe.c Mon May 11 21:34:29 2020 (r360933) @@ -694,20 +694,6 @@ safe_cipher_supported(struct safe_softc *sc, { switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - if ((sc->sc_devinfo & SAFE_DEVINFO_DES) == 0) - return (false); - if (csp->csp_ivlen != 8) - return (false); - if (csp->csp_cipher_alg == CRYPTO_DES_CBC) { - if (csp->csp_cipher_klen != 8) - return (false); - } else { - if (csp->csp_cipher_klen != 24) - return (false); - } - break; case CRYPTO_AES_CBC: if ((sc->sc_devinfo & SAFE_DEVINFO_AES) == 0) return (false); @@ -866,14 +852,6 @@ safe_process(device_t dev, struct cryptop *crp, int hi safe_setup_enckey(ses, crp->crp_cipher_key); switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - cmd0 |= SAFE_SA_CMD0_DES; - cmd1 |= SAFE_SA_CMD1_CBC; - break; - case CRYPTO_3DES_CBC: - cmd0 |= SAFE_SA_CMD0_3DES; - cmd1 |= SAFE_SA_CMD1_CBC; - break; case CRYPTO_AES_CBC: cmd0 |= SAFE_SA_CMD0_AES; cmd1 |= SAFE_SA_CMD1_CBC; Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/dev/sec/sec.c Mon May 11 21:34:29 2020 (r360933) @@ -106,12 +106,6 @@ static int sec_aesu_make_desc(struct sec_softc *sc, const struct crypto_session_params *csp, struct sec_desc *desc, struct cryptop *crp); -/* DEU */ -static bool sec_deu_newsession(const struct crypto_session_params *csp); -static int sec_deu_make_desc(struct sec_softc *sc, - const struct crypto_session_params *csp, struct sec_desc *desc, - struct cryptop *crp); - /* MDEU */ static bool sec_mdeu_can_handle(u_int alg); static int sec_mdeu_config(const struct crypto_session_params *csp, @@ -154,10 +148,6 @@ static struct sec_eu_methods sec_eus[] = { sec_aesu_make_desc, }, { - sec_deu_newsession, - sec_deu_make_desc, - }, - { sec_mdeu_newsession, sec_mdeu_make_desc, }, @@ -1147,12 +1137,6 @@ sec_cipher_supported(const struct crypto_session_param if (csp->csp_ivlen != AES_BLOCK_LEN) return (false); break; - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - /* DEU */ - if (csp->csp_ivlen != DES_BLOCK_LEN) - return (false); - break; default: return (false); } @@ -1462,55 +1446,6 @@ sec_aesu_make_desc(struct sec_softc *sc, if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { hd->shd_mode0 |= SEC_AESU_MODE_ED; - hd->shd_dir = 0; - } else - hd->shd_dir = 1; - - if (csp->csp_mode == CSP_MODE_ETA) - error = sec_build_common_s_desc(sc, desc, csp, crp); - else - error = sec_build_common_ns_desc(sc, desc, csp, crp); - - return (error); -} - -/* DEU */ - -static bool -sec_deu_newsession(const struct crypto_session_params *csp) -{ - - switch (csp->csp_cipher_alg) { - case CRYPTO_DES_CBC: - case CRYPTO_3DES_CBC: - return (true); - default: - return (false); - } -} - -static int -sec_deu_make_desc(struct sec_softc *sc, const struct crypto_session_params *csp, - struct sec_desc *desc, struct cryptop *crp) -{ - struct sec_hw_desc *hd = desc->sd_desc; - int error; - - hd->shd_eu_sel0 = SEC_EU_DEU; - hd->shd_mode0 = SEC_DEU_MODE_CBC; - - switch (csp->csp_cipher_alg) { - case CRYPTO_3DES_CBC: - hd->shd_mode0 |= SEC_DEU_MODE_TS; - break; - case CRYPTO_DES_CBC: - break; - default: - return (EINVAL); - } - - if (CRYPTO_OP_IS_ENCRYPT(crp->crp_op)) { - hd->shd_mode0 |= SEC_DEU_MODE_ED; hd->shd_dir = 0; } else hd->shd_dir = 1; Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:24:22 2020 (r360932) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:34:29 2020 (r360933) @@ -90,12 +90,10 @@ __FBSDID("$FreeBSD$"); } while (0) #define ESP_HEADER_LENGTH 8 -#define DES_CBC_IV_LENGTH 8 #define AES_CBC_IV_LENGTH 16 #define ESP_HMAC_LEN 12 #define ESP_HEADER_LENGTH 8 -#define DES_CBC_IV_LENGTH 8 /****************************************************************************/ @@ -320,125 +318,6 @@ octo_calc_hash(uint8_t auth, unsigned char *key, uint6 } /****************************************************************************/ -/* DES functions */ - -int -octo_des_cbc_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - uint64_t *data; - int data_i, data_l; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - while (crypt_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - crypt_off -= 8; - } - - while (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - IOV_CONSUME(iov, data, data_i, data_l); - crypt_len -= 8; - } - - return 0; -} - - -int -octo_des_cbc_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - uint64_t *data; - int data_i, data_l; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x7) || (crypt_off + crypt_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - while (crypt_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - crypt_off -= 8; - } - - while (crypt_len > 0) { - CVMX_MT_3DES_DEC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - IOV_CONSUME(iov, data, data_i, data_l); - crypt_len -= 8; - } - - return 0; -} - -/****************************************************************************/ /* AES functions */ int @@ -773,593 +652,6 @@ octo_null_sha1_encrypt( data++; CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* DES MD5 */ - -int -octo_des_cbc_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_des_cbc_md5_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_DEC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* DES SHA */ - -int -octo_des_cbc_sha1_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2, tmp3; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load SHA1 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - CVMX_MT_HSH_IV(od->octo_hminner[2], 2); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *first = data32; - mydata.data32[0] = *first; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata.data32[1] = *data32; - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_3DES_ENC_CBC(*data); - CVMX_MF_3DES_RESULT(*data); - crypt_len -= 8; - } - } else - crypt_off -= 8; - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_SHA_UNIT(*data, next); - auth_len -= 8; - } - } else - auth_off -= 8; - *first = mydata.data32[0]; - *data32 = mydata.data32[1]; - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_SHA_UNIT(tmp, next); - } else { - CVM_LOAD_SHA_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_SHA_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_SHA_UNIT(((uint64_t) 0x0ULL), next); - } - CVM_LOAD_SHA_UNIT((uint64_t) ((alen + 64) << 3), next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - tmp3 = 0; - CVMX_MF_HSH_IV(tmp3, 2); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - CVMX_MT_HSH_IV(od->octo_hmouter[2], 2); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - tmp3 |= 0x0000000080000000; - CVMX_MT_HSH_DAT(tmp3, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_MT_HSH_STARTSHA((uint64_t) ((64 + 20) << 3)); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_des_cbc_sha1_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata; - uint64_t *data = &mydata.data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2, tmp3; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load 3DES Key */ - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - if (od->octo_encklen == 24) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - } else if (od->octo_encklen == 8) { - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 1); - CVMX_MT_3DES_KEY(((uint64_t *) od->octo_enckey)[0], 2); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - - CVMX_MT_3DES_IV(* (uint64_t *) ivp); - - /* Load SHA1 IV */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon May 11 21:39:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E80132EDB31; Mon, 11 May 2020 21:39:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZ7p5rpGz4FCD; Mon, 11 May 2020 21:39:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3F032507D; Mon, 11 May 2020 21:39:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLd238047739; Mon, 11 May 2020 21:39:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLd2jr047738; Mon, 11 May 2020 21:39:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112139.04BLd2jr047738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 21:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360934 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 360934 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:39:03 -0000 Author: jhb Date: Mon May 11 21:39:02 2020 New Revision: 360934 URL: https://svnweb.freebsd.org/changeset/base/360934 Log: kgssapi no longer supports RC4, so don't list it as a build dependency. Reviewed by: cem Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24774 Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Mon May 11 21:34:29 2020 (r360933) +++ head/sys/conf/files Mon May 11 21:39:02 2020 (r360934) @@ -686,7 +686,7 @@ crypto/chacha20/chacha.c standard crypto/chacha20/chacha-sw.c optional crypto | ipsec | ipsec_support crypto/des/des_ecb.c optional netsmb crypto/des/des_setkey.c optional netsmb -crypto/rc4/rc4.c optional netgraph_mppc_encryption | kgssapi +crypto/rc4/rc4.c optional netgraph_mppc_encryption crypto/rijndael/rijndael-alg-fst.c optional crypto | ekcd | geom_bde | \ ipsec | ipsec_support | !random_loadable | wlan_ccmp crypto/rijndael/rijndael-api-fst.c optional ekcd | geom_bde | !random_loadable From owner-svn-src-all@freebsd.org Mon May 11 21:42:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E07322EDD4C; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZCb5fjXz4Fcr; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD40725255; Mon, 11 May 2020 21:42:19 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BLgJYj052525; Mon, 11 May 2020 21:42:19 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BLgJNB052524; Mon, 11 May 2020 21:42:19 GMT (envelope-from kp@FreeBSD.org) Message-Id: <202005112142.04BLgJNB052524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Mon, 11 May 2020 21:42:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360935 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 360935 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 21:42:19 -0000 Author: kp Date: Mon May 11 21:42:19 2020 New Revision: 360935 URL: https://svnweb.freebsd.org/changeset/base/360935 Log: opencrypto: Add missing ioctl exit SDTs The opencrypto ioctl code has very useful probe points at the various exit points. These allow us to figure out exactly why a request failed. However, a few paths did not have these probe points. Add them here. Reviewed by: jhb Modified: head/sys/opencrypto/cryptodev.c Modified: head/sys/opencrypto/cryptodev.c ============================================================================== --- head/sys/opencrypto/cryptodev.c Mon May 11 21:39:02 2020 (r360934) +++ head/sys/opencrypto/cryptodev.c Mon May 11 21:42:19 2020 (r360935) @@ -465,6 +465,8 @@ cryptof_ioctl( /* Should always be paired with GCM. */ if (sop->cipher != CRYPTO_AES_NIST_GCM_16) { CRYPTDEB("GMAC without GCM"); + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } break; @@ -539,8 +541,10 @@ cryptof_ioctl( return (EINVAL); } - if (txform == NULL && thash == NULL) + if (txform == NULL && thash == NULL) { + SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); + } memset(&csp, 0, sizeof(csp)); @@ -550,13 +554,18 @@ cryptof_ioctl( case CRYPTO_AES_128_NIST_GMAC: case CRYPTO_AES_192_NIST_GMAC: case CRYPTO_AES_256_NIST_GMAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; @@ -564,14 +573,19 @@ cryptof_ioctl( switch (sop->mac) { #ifdef COMPAT_FREEBSD12 case CRYPTO_AES_CCM_CBC_MAC: - if (sop->keylen != sop->mackeylen) + if (sop->keylen != sop->mackeylen) { + SDT_PROBE1(opencrypto, dev, ioctl, + error, __LINE__); return (EINVAL); + } thash = NULL; break; #endif case 0: break; default: + SDT_PROBE1(opencrypto, dev, ioctl, error, + __LINE__); return (EINVAL); } csp.csp_mode = CSP_MODE_AEAD; From owner-svn-src-all@freebsd.org Mon May 11 22:08:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D28352EE60F; Mon, 11 May 2020 22:08:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZnS5Y6rz4Grx; Mon, 11 May 2020 22:08:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B4FEB25646; Mon, 11 May 2020 22:08:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BM8CX4065868; Mon, 11 May 2020 22:08:12 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BM880f065840; Mon, 11 May 2020 22:08:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112208.04BM880f065840@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:08:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360936 - in head: share/man/man4 share/man/man9 sys/crypto/via sys/dev/cesa sys/dev/glxsb sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/ope... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: share/man/man4 share/man/man9 sys/crypto/via sys/dev/cesa sys/dev/glxsb sys/dev/hifn sys/dev/safe sys/dev/sec sys/mips/cavium/cryptocteon sys/mips/nlm/dev/sec sys/opencrypto X-SVN-Commit-Revision: 360936 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:08:12 -0000 Author: jhb Date: Mon May 11 22:08:08 2020 New Revision: 360936 URL: https://svnweb.freebsd.org/changeset/base/360936 Log: Remove MD5 HMAC from OCF. There are no in-kernel consumers. Reviewed by: cem Relnotes: yes Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D24775 Deleted: head/sys/opencrypto/xform_md5.c Modified: head/share/man/man4/hifn.4 head/share/man/man4/safe.4 head/share/man/man9/crypto.9 head/sys/crypto/via/padlock_hash.c head/sys/dev/cesa/cesa.c head/sys/dev/glxsb/glxsb.c head/sys/dev/hifn/hifn7751.c head/sys/dev/safe/safe.c head/sys/dev/sec/sec.c head/sys/mips/cavium/cryptocteon/cavium_crypto.c head/sys/mips/cavium/cryptocteon/cryptocteon.c head/sys/mips/cavium/cryptocteon/cryptocteonvar.h head/sys/mips/nlm/dev/sec/nlmsec.c head/sys/mips/nlm/dev/sec/nlmseclib.c head/sys/opencrypto/crypto.c head/sys/opencrypto/cryptodev.h head/sys/opencrypto/cryptosoft.c head/sys/opencrypto/xform.c head/sys/opencrypto/xform.h head/sys/opencrypto/xform_auth.h Modified: head/share/man/man4/hifn.4 ============================================================================== --- head/share/man/man4/hifn.4 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man4/hifn.4 Mon May 11 22:08:08 2020 (r360936) @@ -58,7 +58,7 @@ The .Nm driver registers itself to accelerate AES (7955 and 7956 only), -MD5-HMAC, SHA1, and SHA1-HMAC operations for +SHA1, and SHA1-HMAC operations for .Xr ipsec 4 and .Xr crypto 4 . Modified: head/share/man/man4/safe.4 ============================================================================== --- head/share/man/man4/safe.4 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man4/safe.4 Mon May 11 22:08:08 2020 (r360936) @@ -60,7 +60,7 @@ driver supports cards containing SafeNet crypto accele .Pp The .Nm -driver registers itself to accelerate AES, MD5-HMAC, +driver registers itself to accelerate AES, SHA1-HMAC, and NULL operations for .Xr ipsec 4 and Modified: head/share/man/man9/crypto.9 ============================================================================== --- head/share/man/man9/crypto.9 Mon May 11 21:42:19 2020 (r360935) +++ head/share/man/man9/crypto.9 Mon May 11 22:08:08 2020 (r360936) @@ -106,7 +106,6 @@ The following authentication algorithms are supported: .It Dv CRYPTO_AES_NIST_GMAC .It Dv CRYPTO_BLAKE2B .It Dv CRYPTO_BLAKE2S -.It Dv CRYPTO_MD5_HMAC .It Dv CRYPTO_NULL_HMAC .It Dv CRYPTO_POLY1305 .It Dv CRYPTO_RIPEMD160 Modified: head/sys/crypto/via/padlock_hash.c ============================================================================== --- head/sys/crypto/via/padlock_hash.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/crypto/via/padlock_hash.c Mon May 11 22:08:08 2020 (r360936) @@ -321,9 +321,6 @@ padlock_hash_lookup(int alg) case CRYPTO_NULL_HMAC: axf = &auth_hash_null; break; - case CRYPTO_MD5_HMAC: - axf = &auth_hash_hmac_md5; - break; case CRYPTO_SHA1_HMAC: if ((via_feature_xcrypt & VIA_HAS_SHA) != 0) axf = &padlock_hmac_sha1; Modified: head/sys/dev/cesa/cesa.c ============================================================================== --- head/sys/dev/cesa/cesa.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/cesa/cesa.c Mon May 11 22:08:08 2020 (r360936) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -434,14 +433,6 @@ cesa_set_mkey(struct cesa_session *cs, int alg, const hout = (uint32_t *)cs->cs_hiv_out; switch (alg) { - case CRYPTO_MD5_HMAC: - hmac_init_ipad(&auth_hash_hmac_md5, mkey, mklen, &auth_ctx); - memcpy(hin, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - hmac_init_opad(&auth_hash_hmac_md5, mkey, mklen, &auth_ctx); - memcpy(hout, auth_ctx.md5ctx.state, - sizeof(auth_ctx.md5ctx.state)); - break; case CRYPTO_SHA1_HMAC: hmac_init_ipad(&auth_hash_hmac_sha1, mkey, mklen, &auth_ctx); memcpy(hin, auth_ctx.sha1ctx.h.b32, @@ -1599,7 +1590,6 @@ cesa_auth_supported(struct cesa_softc *sc, sc->sc_soc_id == MV_DEV_88F6810)) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: break; @@ -1668,14 +1658,6 @@ cesa_newsession(device_t dev, crypto_session_t cses, } switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cs->cs_mblen = MD5_BLOCK_LEN; - cs->cs_hlen = (csp->csp_auth_mlen == 0) ? MD5_HASH_LEN : - csp->csp_auth_mlen; - cs->cs_config |= CESA_CSHD_MD5_HMAC; - if (cs->cs_hlen == CESA_HMAC_TRUNC_LEN) - cs->cs_config |= CESA_CSHD_96_BIT_HMAC; - break; case CRYPTO_SHA1: cs->cs_mblen = 1; cs->cs_hlen = (csp->csp_auth_mlen == 0) ? SHA1_HASH_LEN : Modified: head/sys/dev/glxsb/glxsb.c ============================================================================== --- head/sys/dev/glxsb/glxsb.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/glxsb/glxsb.c Mon May 11 22:08:08 2020 (r360936) @@ -497,7 +497,6 @@ glxsb_crypto_probesession(device_t dev, const struct c case CSP_MODE_ETA: switch (csp->csp_auth_alg) { case CRYPTO_NULL_HMAC: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_RIPEMD160_HMAC: case CRYPTO_SHA2_256_HMAC: Modified: head/sys/dev/hifn/hifn7751.c ============================================================================== --- head/sys/dev/hifn/hifn7751.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/hifn/hifn7751.c Mon May 11 22:08:08 2020 (r360936) @@ -2296,7 +2296,6 @@ hifn_auth_supported(struct hifn_softc *sc, switch (csp->csp_auth_alg) { case CRYPTO_SHA1: break; - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: if (csp->csp_auth_klen > HIFN_MAC_KEY_LENGTH) return (false); @@ -2478,11 +2477,6 @@ hifn_process(device_t dev, struct cryptop *crp, int hi cmd->base_masks |= HIFN_BASE_CMD_MAC; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cmd->mac_masks |= HIFN_MAC_CMD_ALG_MD5 | - HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HMAC | - HIFN_MAC_CMD_POS_IPSEC | HIFN_MAC_CMD_TRUNC; - break; case CRYPTO_SHA1: cmd->mac_masks |= HIFN_MAC_CMD_ALG_SHA1 | HIFN_MAC_CMD_RESULT | HIFN_MAC_CMD_MODE_HASH | @@ -2495,8 +2489,7 @@ hifn_process(device_t dev, struct cryptop *crp, int hi break; } - if (csp->csp_auth_alg == CRYPTO_SHA1_HMAC || - csp->csp_auth_alg == CRYPTO_MD5_HMAC) { + if (csp->csp_auth_alg == CRYPTO_SHA1_HMAC) { cmd->mac_masks |= HIFN_MAC_CMD_NEW_KEY; if (crp->crp_auth_key != NULL) mackey = crp->crp_auth_key; Modified: head/sys/dev/safe/safe.c ============================================================================== --- head/sys/dev/safe/safe.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/safe/safe.c Mon May 11 22:08:08 2020 (r360936) @@ -638,28 +638,17 @@ static void safe_setup_mackey(struct safe_session *ses, int algo, const uint8_t *key, int klen) { - MD5_CTX md5ctx; SHA1_CTX sha1ctx; int i; - if (algo == CRYPTO_MD5_HMAC) { - hmac_init_ipad(&auth_hash_hmac_md5, key, klen, &md5ctx); - bcopy(md5ctx.state, ses->ses_hminner, sizeof(md5ctx.state)); + hmac_init_ipad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); + bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32)); - hmac_init_opad(&auth_hash_hmac_md5, key, klen, &md5ctx); - bcopy(md5ctx.state, ses->ses_hmouter, sizeof(md5ctx.state)); + hmac_init_opad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); + bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32)); - explicit_bzero(&md5ctx, sizeof(md5ctx)); - } else { - hmac_init_ipad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); - bcopy(sha1ctx.h.b32, ses->ses_hminner, sizeof(sha1ctx.h.b32)); + explicit_bzero(&sha1ctx, sizeof(sha1ctx)); - hmac_init_opad(&auth_hash_hmac_sha1, key, klen, &sha1ctx); - bcopy(sha1ctx.h.b32, ses->ses_hmouter, sizeof(sha1ctx.h.b32)); - - explicit_bzero(&sha1ctx, sizeof(sha1ctx)); - } - /* PE is little-endian, insure proper byte order */ for (i = 0; i < N(ses->ses_hminner); i++) { ses->ses_hminner[i] = htole32(ses->ses_hminner[i]); @@ -674,10 +663,6 @@ safe_auth_supported(struct safe_softc *sc, { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - if ((sc->sc_devinfo & SAFE_DEVINFO_MD5) == 0) - return (false); - break; case CRYPTO_SHA1_HMAC: if ((sc->sc_devinfo & SAFE_DEVINFO_SHA1) == 0) return (false); @@ -755,10 +740,7 @@ safe_newsession(device_t dev, crypto_session_t cses, if (csp->csp_auth_alg != 0) { ses->ses_mlen = csp->csp_auth_mlen; if (ses->ses_mlen == 0) { - if (csp->csp_auth_alg == CRYPTO_MD5_HMAC) - ses->ses_mlen = MD5_HASH_LEN; - else - ses->ses_mlen = SHA1_HASH_LEN; + ses->ses_mlen = SHA1_HASH_LEN; } if (csp->csp_auth_key != NULL) { @@ -907,10 +889,6 @@ safe_process(device_t dev, struct cryptop *crp, int hi } switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - cmd0 |= SAFE_SA_CMD0_MD5; - cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */ - break; case CRYPTO_SHA1_HMAC: cmd0 |= SAFE_SA_CMD0_SHA1; cmd1 |= SAFE_SA_CMD1_HMAC; /* NB: enable HMAC */ Modified: head/sys/dev/sec/sec.c ============================================================================== --- head/sys/dev/sec/sec.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/dev/sec/sec.c Mon May 11 22:08:08 2020 (r360936) @@ -1158,7 +1158,6 @@ sec_auth_supported(struct sec_softc *sc, if (sc->sc_version < 3) return (false); /* FALLTHROUGH */ - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256_HMAC: if (csp->csp_auth_klen > SEC_MAX_KEY_LEN) @@ -1465,7 +1464,6 @@ sec_mdeu_can_handle(u_int alg) { switch (alg) { case CRYPTO_SHA1: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256_HMAC: case CRYPTO_SHA2_384_HMAC: @@ -1485,12 +1483,6 @@ sec_mdeu_config(const struct crypto_session_params *cs *eu = SEC_EU_NONE; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - *mode |= SEC_MDEU_MODE_HMAC; - *eu = SEC_EU_MDEU_A; - *mode |= SEC_MDEU_MODE_MD5; - *hashlen = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: *mode |= SEC_MDEU_MODE_HMAC; /* FALLTHROUGH */ Modified: head/sys/mips/cavium/cryptocteon/cavium_crypto.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cavium_crypto.c Mon May 11 22:08:08 2020 (r360936) @@ -458,104 +458,6 @@ octo_aes_cbc_decrypt( } /****************************************************************************/ -/* MD5 */ - -int -octo_null_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - uint64_t *data; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || - (auth_off & 0x7) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data, data_i, data_l); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (auth_off > 0) { - IOV_CONSUME(iov, data, data_i, data_l); - auth_off -= 8; - } - - while (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 8; - IOV_CONSUME(iov, data, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data = (uint64_t *)icv; - CVMX_MF_HSH_IV(*data, 0); - data++; - CVMX_MF_HSH_IV(tmp1, 1); - *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ /* SHA1 */ int @@ -652,351 +554,6 @@ octo_null_sha1_encrypt( data++; CVMX_MF_HSH_IV(tmp1, 1); *(uint32_t *)data = (uint32_t) (tmp1 >> 32); - - return 0; -} - -/****************************************************************************/ -/* AES MD5 */ - -int -octo_aes_cbc_md5_encrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata[2]; - uint64_t *pdata = &mydata[0].data64[0]; - uint64_t *data = &mydata[1].data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load AES Key */ - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - - if (od->octo_encklen == 16) { - CVMX_MT_AES_KEY(0x0, 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 24) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 32) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); - - CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); - CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *pdata32[3]; - - pdata32[0] = data32; - mydata[0].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - pdata32[1] = data32; - mydata[0].data32[1] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - pdata32[2] = data32; - mydata[1].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - - mydata[1].data32[1] = *data32; - - - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_AES_ENC_CBC0(*pdata); - CVMX_MT_AES_ENC_CBC1(*data); - CVMX_MF_AES_RESULT(*pdata, 0); - CVMX_MF_AES_RESULT(*data, 1); - crypt_len -= 16; - } - } else - crypt_off -= 16; - - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*pdata, next); - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 16; - } - } else - auth_off -= 16; - - *pdata32[0] = mydata[0].data32[0]; - *pdata32[1] = mydata[0].data32[1]; - *pdata32[2] = mydata[1].data32[0]; - *data32 = mydata[1].data32[1]; - - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); - - return 0; -} - -int -octo_aes_cbc_md5_decrypt( - struct octo_sess *od, - struct iovec *iov, size_t iovcnt, size_t iovlen, - int auth_off, int auth_len, - int crypt_off, int crypt_len, - uint8_t *icv, uint8_t *ivp) -{ - int next = 0; - union { - uint32_t data32[2]; - uint64_t data64[1]; - } mydata[2]; - uint64_t *pdata = &mydata[0].data64[0]; - uint64_t *data = &mydata[1].data64[0]; - uint32_t *data32; - uint64_t tmp1, tmp2; - int data_i, data_l, alen = auth_len; - - dprintf("%s()\n", __func__); - - if (__predict_false(od == NULL || iov==NULL || iovlen==0 || ivp==NULL || - (crypt_off & 0x3) || (crypt_off + crypt_len > iovlen) || - (crypt_len & 0x7) || - (auth_len & 0x7) || - (auth_off & 0x3) || (auth_off + auth_len > iovlen))) { - dprintf("%s: Bad parameters od=%p iov=%p iovlen=%jd " - "auth_off=%d auth_len=%d crypt_off=%d crypt_len=%d " - "icv=%p ivp=%p\n", __func__, od, iov, iovlen, - auth_off, auth_len, crypt_off, crypt_len, icv, ivp); - return -EINVAL; - } - - IOV_INIT(iov, data32, data_i, data_l); - - CVMX_PREFETCH0(ivp); - CVMX_PREFETCH0(od->octo_enckey); - - /* load AES Key */ - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[0], 0); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[1], 1); - - if (od->octo_encklen == 16) { - CVMX_MT_AES_KEY(0x0, 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 24) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(0x0, 3); - } else if (od->octo_encklen == 32) { - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[2], 2); - CVMX_MT_AES_KEY(((uint64_t *) od->octo_enckey)[3], 3); - } else { - dprintf("%s: Bad key length %d\n", __func__, od->octo_encklen); - return -EINVAL; - } - CVMX_MT_AES_KEYLENGTH(od->octo_encklen / 8 - 1); - - CVMX_MT_AES_IV(((uint64_t *) ivp)[0], 0); - CVMX_MT_AES_IV(((uint64_t *) ivp)[1], 1); - - /* Load MD5 IV */ - CVMX_MT_HSH_IV(od->octo_hminner[0], 0); - CVMX_MT_HSH_IV(od->octo_hminner[1], 1); - - while (crypt_off > 0 && auth_off > 0) { - IOV_CONSUME(iov, data32, data_i, data_l); - crypt_off -= 4; - auth_off -= 4; - } - - while (crypt_len > 0 || auth_len > 0) { - uint32_t *pdata32[3]; - - pdata32[0] = data32; - mydata[0].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - pdata32[1] = data32; - mydata[0].data32[1] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - pdata32[2] = data32; - mydata[1].data32[0] = *data32; - IOV_CONSUME(iov, data32, data_i, data_l); - mydata[1].data32[1] = *data32; - - if (auth_off <= 0) { - if (auth_len > 0) { - CVM_LOAD_MD5_UNIT(*pdata, next); - CVM_LOAD_MD5_UNIT(*data, next); - auth_len -= 16; - } - } else - auth_off -= 16; - - if (crypt_off <= 0) { - if (crypt_len > 0) { - CVMX_MT_AES_DEC_CBC0(*pdata); - CVMX_MT_AES_DEC_CBC1(*data); - CVMX_MF_AES_RESULT(*pdata, 0); - CVMX_MF_AES_RESULT(*data, 1); - crypt_len -= 16; - } - } else - crypt_off -= 16; - - *pdata32[0] = mydata[0].data32[0]; - *pdata32[1] = mydata[0].data32[1]; - *pdata32[2] = mydata[1].data32[0]; - *data32 = mydata[1].data32[1]; - - IOV_CONSUME(iov, data32, data_i, data_l); - } - - /* finish the hash */ - CVMX_PREFETCH0(od->octo_hmouter); -#if 0 - if (__predict_false(inplen)) { - uint64_t tmp = 0; - uint8_t *p = (uint8_t *) & tmp; - p[inplen] = 0x80; - do { - inplen--; - p[inplen] = ((uint8_t *) data)[inplen]; - } while (inplen); - CVM_LOAD_MD5_UNIT(tmp, next); - } else { - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); - } -#else - CVM_LOAD_MD5_UNIT(0x8000000000000000ULL, next); -#endif - - /* Finish Inner hash */ - while (next != 7) { - CVM_LOAD_MD5_UNIT(((uint64_t) 0x0ULL), next); - } - CVMX_ES64(tmp1, ((alen + 64) << 3)); - CVM_LOAD_MD5_UNIT(tmp1, next); - - /* Get the inner hash of HMAC */ - CVMX_MF_HSH_IV(tmp1, 0); - CVMX_MF_HSH_IV(tmp2, 1); - - /* Initialize hash unit */ - CVMX_MT_HSH_IV(od->octo_hmouter[0], 0); - CVMX_MT_HSH_IV(od->octo_hmouter[1], 1); - - CVMX_MT_HSH_DAT(tmp1, 0); - CVMX_MT_HSH_DAT(tmp2, 1); - CVMX_MT_HSH_DAT(0x8000000000000000ULL, 2); - CVMX_MT_HSH_DATZ(3); - CVMX_MT_HSH_DATZ(4); - CVMX_MT_HSH_DATZ(5); - CVMX_MT_HSH_DATZ(6); - CVMX_ES64(tmp1, ((64 + 16) << 3)); - CVMX_MT_HSH_STARTMD5(tmp1); - - /* save the HMAC */ - data32 = (uint32_t *)icv; - CVMX_MF_HSH_IV(tmp1, 0); - *data32 = (uint32_t) (tmp1 >> 32); - data32++; - *data32 = (uint32_t) tmp1; - data32++; - CVMX_MF_HSH_IV(tmp1, 1); - *data32 = (uint32_t) (tmp1 >> 32); return 0; } Modified: head/sys/mips/cavium/cryptocteon/cryptocteon.c ============================================================================== --- head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cryptocteon.c Mon May 11 22:08:08 2020 (r360936) @@ -101,9 +101,6 @@ cryptocteon_auth_supported(const struct crypto_session u_int hash_len; switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - hash_len = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: hash_len = SHA1_HASH_LEN; break; @@ -197,9 +194,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t ocd->octo_mlen = csp->csp_auth_mlen; if (csp->csp_auth_mlen == 0) { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_mlen = MD5_HASH_LEN; - break; case CRYPTO_SHA1_HMAC: ocd->octo_mlen = SHA1_HASH_LEN; break; @@ -209,10 +203,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t switch (csp->csp_mode) { case CSP_MODE_DIGEST: switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_encrypt = octo_null_md5_encrypt; - ocd->octo_decrypt = octo_null_md5_encrypt; - break; case CRYPTO_SHA1_HMAC: ocd->octo_encrypt = octo_null_sha1_encrypt; ocd->octo_decrypt = octo_null_sha1_encrypt; @@ -231,10 +221,6 @@ cryptocteon_newsession(device_t dev, crypto_session_t switch (csp->csp_cipher_alg) { case CRYPTO_AES_CBC: switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - ocd->octo_encrypt = octo_aes_cbc_md5_encrypt; - ocd->octo_decrypt = octo_aes_cbc_md5_decrypt; - break; case CRYPTO_SHA1_HMAC: ocd->octo_encrypt = octo_aes_cbc_sha1_encrypt; ocd->octo_decrypt = octo_aes_cbc_sha1_decrypt; Modified: head/sys/mips/cavium/cryptocteon/cryptocteonvar.h ============================================================================== --- head/sys/mips/cavium/cryptocteon/cryptocteonvar.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/cavium/cryptocteon/cryptocteonvar.h Mon May 11 22:08:08 2020 (r360936) @@ -64,15 +64,12 @@ extern int cryptocteon_debug; void octo_calc_hash(uint8_t, unsigned char *, uint64_t *, uint64_t *); /* XXX Actually just hashing functions, not encryption. */ -octo_encrypt_t octo_null_md5_encrypt; octo_encrypt_t octo_null_sha1_encrypt; octo_encrypt_t octo_aes_cbc_encrypt; -octo_encrypt_t octo_aes_cbc_md5_encrypt; octo_encrypt_t octo_aes_cbc_sha1_encrypt; octo_decrypt_t octo_aes_cbc_decrypt; -octo_decrypt_t octo_aes_cbc_md5_decrypt; octo_decrypt_t octo_aes_cbc_sha1_decrypt; #endif /* !_MIPS_CAVIUM_CRYPTOCTEON_CRYPTOCTEONVAR_H_ */ Modified: head/sys/mips/nlm/dev/sec/nlmsec.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/nlm/dev/sec/nlmsec.c Mon May 11 22:08:08 2020 (r360936) @@ -377,7 +377,6 @@ xlp_sec_auth_supported(const struct crypto_session_par switch (csp->csp_auth_alg) { case CRYPTO_SHA1: - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: break; default: Modified: head/sys/mips/nlm/dev/sec/nlmseclib.c ============================================================================== --- head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/mips/nlm/dev/sec/nlmseclib.c Mon May 11 22:08:08 2020 (r360936) @@ -253,10 +253,6 @@ nlm_get_digest_param(struct xlp_sec_command *cmd, cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; break; - case CRYPTO_MD5_HMAC: - cmd->hashalg = NLM_HASH_MD5; - cmd->hashmode = NLM_HASH_MODE_SHA1; - break; case CRYPTO_SHA1_HMAC: cmd->hashalg = NLM_HASH_SHA; cmd->hashmode = NLM_HASH_MODE_SHA1; Modified: head/sys/opencrypto/crypto.c ============================================================================== --- head/sys/opencrypto/crypto.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/crypto.c Mon May 11 22:08:08 2020 (r360936) @@ -530,8 +530,6 @@ crypto_auth_hash(const struct crypto_session_params *c { switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: - return (&auth_hash_hmac_md5); case CRYPTO_SHA1_HMAC: return (&auth_hash_hmac_sha1); case CRYPTO_SHA2_224_HMAC: @@ -674,7 +672,6 @@ static enum alg_type { ALG_COMPRESSION, ALG_AEAD } alg_types[] = { - [CRYPTO_MD5_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_SHA1_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_RIPEMD160_HMAC] = ALG_KEYED_DIGEST, [CRYPTO_AES_CBC] = ALG_CIPHER, Modified: head/sys/opencrypto/cryptodev.h ============================================================================== --- head/sys/opencrypto/cryptodev.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/cryptodev.h Mon May 11 22:08:08 2020 (r360936) @@ -74,7 +74,6 @@ /* Hash values */ #define NULL_HASH_LEN 16 -#define MD5_HASH_LEN 16 #define SHA1_HASH_LEN 20 #define RIPEMD160_HASH_LEN 20 #define SHA2_224_HASH_LEN 28 @@ -87,7 +86,6 @@ /* Maximum hash algorithm result length */ #define HASH_MAX_LEN SHA2_512_HASH_LEN /* Keep this updated */ -#define MD5_BLOCK_LEN 64 #define SHA1_BLOCK_LEN 64 #define RIPEMD160_BLOCK_LEN 64 #define SHA2_224_BLOCK_LEN 64 @@ -210,7 +208,7 @@ /* NB: deprecated */ struct session_op { u_int32_t cipher; /* ie. CRYPTO_AES_CBC */ - u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ + u_int32_t mac; /* ie. CRYPTO_SHA2_256_HMAC */ u_int32_t keylen; /* cipher key */ c_caddr_t key; @@ -227,7 +225,7 @@ struct session_op { */ struct session2_op { u_int32_t cipher; /* ie. CRYPTO_AES_CBC */ - u_int32_t mac; /* ie. CRYPTO_MD5_HMAC */ + u_int32_t mac; /* ie. CRYPTO_SHA2_256_HMAC */ u_int32_t keylen; /* cipher key */ c_caddr_t key; Modified: head/sys/opencrypto/cryptosoft.c ============================================================================== --- head/sys/opencrypto/cryptosoft.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/cryptosoft.c Mon May 11 22:08:08 2020 (r360936) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -336,7 +335,6 @@ swcr_authprepare(struct auth_hash *axf, struct swcr_au { switch (axf->type) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -403,7 +401,6 @@ swcr_authcompute(struct swcr_session *ses, struct cryp axf->Final(aalg, &ctx); break; - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -899,7 +896,6 @@ swcr_setup_auth(struct swcr_session *ses, return (ENOBUFS); switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: @@ -1085,7 +1081,6 @@ swcr_auth_supported(const struct crypto_session_params if (axf == NULL) return (false); switch (csp->csp_auth_alg) { - case CRYPTO_MD5_HMAC: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_224_HMAC: case CRYPTO_SHA2_256_HMAC: Modified: head/sys/opencrypto/xform.c ============================================================================== --- head/sys/opencrypto/xform.c Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform.c Mon May 11 22:08:08 2020 (r360936) @@ -66,8 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include @@ -82,7 +80,6 @@ MALLOC_DEFINE(M_XDATA, "xform", "xform data buffers"); /* Include the authentication and hashing algorithms */ #include "xform_gmac.c" -#include "xform_md5.c" #include "xform_rmd160.c" #include "xform_sha1.c" #include "xform_sha2.c" Modified: head/sys/opencrypto/xform.h ============================================================================== --- head/sys/opencrypto/xform.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform.h Mon May 11 22:08:08 2020 (r360936) @@ -31,7 +31,6 @@ #ifndef _CRYPTO_XFORM_H_ #define _CRYPTO_XFORM_H_ -#include #include #include #include Modified: head/sys/opencrypto/xform_auth.h ============================================================================== --- head/sys/opencrypto/xform_auth.h Mon May 11 21:42:19 2020 (r360935) +++ head/sys/opencrypto/xform_auth.h Mon May 11 22:08:08 2020 (r360936) @@ -34,7 +34,6 @@ #include #include -#include #include #include #include @@ -66,7 +65,6 @@ struct auth_hash { }; extern struct auth_hash auth_hash_null; -extern struct auth_hash auth_hash_hmac_md5; extern struct auth_hash auth_hash_hmac_sha1; extern struct auth_hash auth_hash_hmac_ripemd_160; extern struct auth_hash auth_hash_hmac_sha2_224; @@ -89,7 +87,6 @@ extern struct auth_hash auth_hash_ccm_cbc_mac_192; extern struct auth_hash auth_hash_ccm_cbc_mac_256; union authctx { - MD5_CTX md5ctx; SHA1_CTX sha1ctx; RMD160_CTX rmd160ctx; SHA224_CTX sha224ctx; From owner-svn-src-all@freebsd.org Mon May 11 22:15:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A1C322EE854; Mon, 11 May 2020 22:15:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LZyB3pcyz4HKr; Mon, 11 May 2020 22:15:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7DFC525826; Mon, 11 May 2020 22:15:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMFkKT071809; Mon, 11 May 2020 22:15:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMFkh8071808; Mon, 11 May 2020 22:15:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112215.04BMFkh8071808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360937 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 360937 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:15:46 -0000 Author: jhb Date: Mon May 11 22:15:46 2020 New Revision: 360937 URL: https://svnweb.freebsd.org/changeset/base/360937 Log: Document removal of deprecated algorithms from OCF. Sponsored by: Chelsio Communications Modified: head/RELNOTES Modified: head/RELNOTES ============================================================================== --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. Changes to this file should not be MFCed. +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from + the kernel open cryptographic framework (OCF). + r360562: Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5-HMAC, and Skipjack algorithms from /dev/crypto. From owner-svn-src-all@freebsd.org Mon May 11 22:17:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7284E2EEA56; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@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 49Lb052SSHz4HdX; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4F8A825828; Mon, 11 May 2020 22:17:25 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMHPu8071953; Mon, 11 May 2020 22:17:25 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMHP4e071952; Mon, 11 May 2020 22:17:25 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005112217.04BMHP4e071952@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Mon, 11 May 2020 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: r360938 - stable/11/lib/msun/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: stable/11/lib/msun/tests X-SVN-Commit-Revision: 360938 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:17:25 -0000 Author: lwhsu Date: Mon May 11 22:17:24 2020 New Revision: 360938 URL: https://svnweb.freebsd.org/changeset/base/360938 Log: MFC r358887 (partially): Temporarily skip 2 failing tests after llvm10 import The DDifference of the original revision to -head is only lib.msun.ctrig_test.test_inf_inputs skipped. PR: 244732 Sponsored by: The FreeBSD Foundation Modified: stable/11/lib/msun/tests/ctrig_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/msun/tests/ctrig_test.c ============================================================================== --- stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:15:46 2020 (r360937) +++ stable/11/lib/msun/tests/ctrig_test.c Mon May 11 22:17:24 2020 (r360938) @@ -248,6 +248,9 @@ ATF_TC_BODY(test_inf_inputs, tc) long double complex z, c, s; unsigned i; + if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) + atf_tc_skip("https://bugs.freebsd.org/244732"); + /* * IN CSINH CCOSH CTANH * Inf,Inf +-Inf,NaN inval +-Inf,NaN inval 1,+-0 From owner-svn-src-all@freebsd.org Mon May 11 22:19:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F0CF62EEC4C; Mon, 11 May 2020 22:19:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lb2K4Fwkz4HvC; Mon, 11 May 2020 22:19:21 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YGlZjPKVLYYpxYGlbjwiNZ; Mon, 11 May 2020 16:19:20 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=N7pfFusovxdZa5IrGW0A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTP id BF783596; Mon, 11 May 2020 15:19:15 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04BMJFVS081757; Mon, 11 May 2020 15:19:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04BMJFRZ081754; Mon, 11 May 2020 15:19:15 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005112219.04BMJFRZ081754@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: John Baldwin cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360937 - head In-reply-to: <202005112215.04BMFkh8071808@repo.freebsd.org> References: <202005112215.04BMFkh8071808@repo.freebsd.org> Comments: In-reply-to John Baldwin message dated "Mon, 11 May 2020 22:15:46 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 15:19:15 -0700 X-CMAE-Envelope: MS4wfAKOcCr8AkYy+IPSlP6jTs1rMFHxI6fvbS0033SlE4W9c0Ocrqff6+TJM+yBw1M7ZISTzNWgFL97cocYz8EiX7ThJVQoWN2KpgwCLpUCtXVzHVTkR5qo PpWCQ4eGxbS2Ice6HyXzSoMF6JdImilMl5LFPr5NYRqHuZ/6VpcIRGbQHFrKJXVvL2qwfVO+xZo6Ei0hwsLbbTb3brih6TjdlkB50QpRoqgKHvCckFeIYVuw DoRXvU4bueoQW+8GhGvXbrg+F6wJVTj/JDJRf2PZL0aDo5D63+EK0GxxlCUmCFyS X-Rspamd-Queue-Id: 49Lb2K4Fwkz4HvC X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:19:22 -0000 In message <202005112215.04BMFkh8071808@repo.freebsd.org>, John Baldwin writes: > Author: jhb > Date: Mon May 11 22:15:46 2020 > New Revision: 360937 > URL: https://svnweb.freebsd.org/changeset/base/360937 > > Log: > Document removal of deprecated algorithms from OCF. > > Sponsored by: Chelsio Communications > > Modified: > head/RELNOTES > > Modified: head/RELNOTES > ============================================================================= > = > --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) > +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) > @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. > > Changes to this file should not be MFCed. > > +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: > + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, > + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from > + the kernel open cryptographic framework (OCF). > + > r360562: > Remove support for ARC4, Blowfish, Cast, DES, Triple DES, > MD5-HMAC, and Skipjack algorithms from /dev/crypto. > Do we need a __FreeBSD_version bump? -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Mon May 11 22:26:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 71FAD2EEE75; Mon, 11 May 2020 22:26:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbBm2JGsz4JL8; Mon, 11 May 2020 22:26:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4559B25A2E; Mon, 11 May 2020 22:26:40 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMQeWT078283; Mon, 11 May 2020 22:26:40 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMQe70078282; Mon, 11 May 2020 22:26:40 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005112226.04BMQe70078282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Mon, 11 May 2020 22:26:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360939 - in head: sbin/sunlabel share/man/man4/man4.sparc64 sys/arm/mv/discovery sys/arm/mv/kirkwood sys/arm/mv/orion sys/arm/ralink sys/cddl/contrib/opensolaris/common/atomic/aarch64 ... X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in head: sbin/sunlabel share/man/man4/man4.sparc64 sys/arm/mv/discovery sys/arm/mv/kirkwood sys/arm/mv/orion sys/arm/ralink sys/cddl/contrib/opensolaris/common/atomic/aarch64 sys/cddl/contrib/opensola... X-SVN-Commit-Revision: 360939 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:26:40 -0000 Author: jhb Date: Mon May 11 22:26:39 2020 New Revision: 360939 URL: https://svnweb.freebsd.org/changeset/base/360939 Log: Remove various empty directories. Some of these I orphaned today, others were emptied by earlier commits to head. Deleted: head/sbin/sunlabel/ head/share/man/man4/man4.sparc64/ head/sys/arm/mv/discovery/ head/sys/arm/mv/kirkwood/ head/sys/arm/mv/orion/ head/sys/arm/ralink/ head/sys/cddl/contrib/opensolaris/common/atomic/aarch64/ head/sys/cddl/contrib/opensolaris/common/atomic/amd64/ head/sys/cddl/contrib/opensolaris/common/atomic/powerpc64/ head/sys/cddl/contrib/opensolaris/common/atomic/sparc64/ head/sys/crypto/blowfish/ head/sys/dev/auxio/ head/sys/dev/bktr/ head/sys/dev/sound/sbus/ head/sys/dev/ubsec/ head/sys/modules/auxio/ head/sys/modules/bktr/ head/sys/modules/epic/ head/sys/modules/sound/driver/audiocs/ head/sys/modules/ubsec/ head/sys/modules/vpo/ head/usr.bin/elf2aout/ head/usr.sbin/eeprom/ From owner-svn-src-all@freebsd.org Mon May 11 22:38:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29C782D8C0A; Mon, 11 May 2020 22:38:33 +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 49LbSS6t3lz4JyM; Mon, 11 May 2020 22:38:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C8E5925BFD; Mon, 11 May 2020 22:38:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMcWaT084431; Mon, 11 May 2020 22:38:32 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMcWBV084430; Mon, 11 May 2020 22:38:32 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005112238.04BMcWBV084430@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 11 May 2020 22:38:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360940 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 360940 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:38:33 -0000 Author: kib Date: Mon May 11 22:38:32 2020 New Revision: 360940 URL: https://svnweb.freebsd.org/changeset/base/360940 Log: sigfastblock: fix delivery of the pending signals in single-threaded processes. If single-threaded process receives a signal during critical section established by sigfastblock(2) word, unblock did not caused signal delivery because sigfastblock(SIGFASTBLOCK_UNBLOCK) failed to request ast handling of the pending signals. Set TDF_ASTPENDING | TDF_NEEDSIGCHK on unblock or when kernel forces end of sigfastblock critical section, to cause syscall exit to recheck and deliver any signal pending. Reported by: corydoras@ridiculousfish.com PR: 246385 Sponsored by: The FreeBSD Foundation Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Mon May 11 22:26:39 2020 (r360939) +++ head/sys/kern/kern_sig.c Mon May 11 22:38:32 2020 (r360940) @@ -3976,6 +3976,22 @@ sigfastblock_fetch_sig(struct thread *td, bool sendsig return (true); } +static void +sigfastblock_resched(struct thread *td, bool resched) +{ + struct proc *p; + + if (resched) { + p = td->td_proc; + PROC_LOCK(p); + reschedule_signals(p, td->td_sigmask, 0); + PROC_UNLOCK(p); + } + thread_lock(td); + td->td_flags |= TDF_ASTPENDING | TDF_NEEDSIGCHK; + thread_unlock(td); +} + int sys_sigfastblock(struct thread *td, struct sigfastblock_args *uap) { @@ -4046,11 +4062,8 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc * signals to current thread. But notify others about * fake unblock. */ - if (error == 0 && p->p_numthreads != 1) { - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, error == 0 && p->p_numthreads != 1); + break; case SIGFASTBLOCK_UNSETPTR: @@ -4079,7 +4092,6 @@ sys_sigfastblock(struct thread *td, struct sigfastbloc void sigfastblock_clear(struct thread *td) { - struct proc *p; bool resched; if ((td->td_pflags & TDP_SIGFASTBLOCK) == 0) @@ -4088,12 +4100,7 @@ sigfastblock_clear(struct thread *td) resched = (td->td_pflags & TDP_SIGFASTPENDING) != 0 || SIGPENDING(td); td->td_pflags &= ~(TDP_SIGFASTBLOCK | TDP_SIGFASTPENDING); - if (resched) { - p = td->td_proc; - PROC_LOCK(p); - reschedule_signals(p, td->td_sigmask, 0); - PROC_UNLOCK(p); - } + sigfastblock_resched(td, resched); } void From owner-svn-src-all@freebsd.org Mon May 11 22:39:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B815B2D8D51; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbV14QdYz4K8C; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9327A25C07; Mon, 11 May 2020 22:39:53 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMdrAc084553; Mon, 11 May 2020 22:39:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMdrq9084552; Mon, 11 May 2020 22:39:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112239.04BMdrq9084552@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:39:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360941 - head/sys/geom/mirror X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/geom/mirror X-SVN-Commit-Revision: 360941 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:39:53 -0000 Author: cem Date: Mon May 11 22:39:53 2020 New Revision: 360941 URL: https://svnweb.freebsd.org/changeset/base/360941 Log: geom(4) mirror: Do not panic on gmirror(8) insert, resize Geom_mirror initialization occurs in spurts and the present of a non-destroyed g_mirror softc does not always indicate that the geom has launched (i.e., has an sc_provider). Some gmirror(8) commands (via g_mirror_ctl) depend on a g_mirror's sc_provider (insert and resize). For those commands, g_mirror_ctl is modified to sleep-poll in an interruptible way until the target geom is either launched or destroyed. Reviewed by: markj Tested by: markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24780 Modified: head/sys/geom/mirror/g_mirror_ctl.c Modified: head/sys/geom/mirror/g_mirror_ctl.c ============================================================================== --- head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:38:32 2020 (r360940) +++ head/sys/geom/mirror/g_mirror_ctl.c Mon May 11 22:39:53 2020 (r360941) @@ -44,6 +44,10 @@ __FBSDID("$FreeBSD$"); #include #include +/* + * Configure, Rebuild, Remove, Deactivate, Forget, and Stop operations do not + * seem to depend on any particular g_mirror initialization state. + */ static struct g_mirror_softc * g_mirror_find_device(struct g_class *mp, const char *name) { @@ -61,6 +65,10 @@ g_mirror_find_device(struct g_class *mp, const char *n strcmp(sc->sc_name, name) == 0) { g_topology_unlock(); sx_xlock(&sc->sc_lock); + if ((sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { + sx_xunlock(&sc->sc_lock); + return (NULL); + } return (sc); } } @@ -68,6 +76,55 @@ g_mirror_find_device(struct g_class *mp, const char *n return (NULL); } +/* Insert and Resize operations depend on a launched GEOM (sc_provider). */ +#define GMFL_VALID_FLAGS (M_WAITOK | M_NOWAIT) +static struct g_mirror_softc * +g_mirror_find_launched_device(struct g_class *mp, const char *name, int flags) +{ + struct g_mirror_softc *sc; + int error; + + KASSERT((flags & ~GMFL_VALID_FLAGS) == 0 && + flags != GMFL_VALID_FLAGS && flags != 0, + ("%s: Invalid flags %x\n", __func__, (unsigned)flags)); +#undef GMFL_VALID_FLAGS + + while (true) { + sc = g_mirror_find_device(mp, name); + if (sc == NULL) + return (NULL); + if (sc->sc_provider != NULL) + return (sc); + if (flags & M_NOWAIT) { + sx_xunlock(&sc->sc_lock); + return (NULL); + } + + /* + * This is a dumb hack. G_mirror does not expose any real + * wakeup API for observing state changes, and even if it did, + * its "RUNNING" state does not actually reflect all softc + * elements being initialized. + * + * Revamping g_mirror to have a 3rd, ACTUALLY_RUNNING state and + * updating all assertions and sc_state checks is a large work + * and would be easy to introduce regressions. + * + * Revamping g_mirror to have a wakeup for state changes would + * be difficult if one wanted to capture more than just + * sc_state and sc_provider. + * + * For now, just dummy sleep-poll until sc_provider shows up, + * the user cancels, or the g_mirror is destroyed. + */ + error = sx_sleep(&sc, &sc->sc_lock, PRIBIO | PCATCH | PDROP, + "GM:launched", 1); + if (error != 0 && error != EWOULDBLOCK) + return (NULL); + } + __unreachable(); +} + static struct g_mirror_disk * g_mirror_find_disk(struct g_mirror_softc *sc, const char *name) { @@ -605,7 +662,7 @@ g_mirror_ctl_insert(struct gctl_req *req, struct g_cla gctl_error(req, "No 'arg%u' argument.", 0); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return; @@ -847,7 +904,7 @@ g_mirror_ctl_resize(struct gctl_req *req, struct g_cla gctl_error(req, "Invalid '%s' argument.", "size"); return; } - sc = g_mirror_find_device(mp, name); + sc = g_mirror_find_launched_device(mp, name, M_WAITOK); if (sc == NULL) { gctl_error(req, "No such device: %s.", name); return; From owner-svn-src-all@freebsd.org Mon May 11 22:47:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E8F52D96B2; Mon, 11 May 2020 22:47:21 +0000 (UTC) (envelope-from tuexen@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 49Lbfd2kDXz4KnQ; Mon, 11 May 2020 22:47:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 543AB25DF6; Mon, 11 May 2020 22:47:21 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMlL0m090300; Mon, 11 May 2020 22:47:21 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMlLX5090299; Mon, 11 May 2020 22:47:21 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005112247.04BMlLX5090299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 11 May 2020 22:47:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360942 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 360942 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:47:21 -0000 Author: tuexen Date: Mon May 11 22:47:20 2020 New Revision: 360942 URL: https://svnweb.freebsd.org/changeset/base/360942 Log: Fix a copy and paste error introduced in r360878. Reported-by: syzbot+a0863e972771f2f0d4b3@syzkaller.appspotmail.com Reported-by: syzbot+4481757e967ba83c445a@syzkaller.appspotmail.com MFC after: 3 days Modified: head/sys/netinet/sctp_input.c Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Mon May 11 22:39:53 2020 (r360941) +++ head/sys/netinet/sctp_input.c Mon May 11 22:47:20 2020 (r360942) @@ -5225,7 +5225,7 @@ process_control_chunks: auth_skipped = 0; } /* Restart the timer if we have pending data */ - TAILQ_FOREACH(chk, &asoc->sent_queue, sctp_next) { + TAILQ_FOREACH(chk, &stcb->asoc.sent_queue, sctp_next) { if (chk->whoTo != NULL) { break; } From owner-svn-src-all@freebsd.org Mon May 11 22:48:01 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B2C02D972C; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbgP1cLSz4Kvj; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3290225DF7; Mon, 11 May 2020 22:48:01 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMm1KJ090369; Mon, 11 May 2020 22:48:01 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMm1Ap090368; Mon, 11 May 2020 22:48:01 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112248.04BMm1Ap090368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:48:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360943 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 360943 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:48:01 -0000 Author: cem Date: Mon May 11 22:48:00 2020 New Revision: 360943 URL: https://svnweb.freebsd.org/changeset/base/360943 Log: copystr(9): Move to deprecate [1/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Reviewed by: jhb MFC after: i² days Differential Revision: yes (see 2/2) Modified: head/share/man/man9/copy.9 Modified: head/share/man/man9/copy.9 ============================================================================== --- head/share/man/man9/copy.9 Mon May 11 22:47:20 2020 (r360942) +++ head/share/man/man9/copy.9 Mon May 11 22:48:00 2020 (r360943) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 15, 2017 +.Dd May 11, 2020 .Dt COPY 9 .Os .Sh NAME @@ -45,7 +45,7 @@ .Nm copyout_nofault , .Nm copystr , .Nm copyinstr -.Nd kernel copy functions +.Nd heterogenous address space copy functions .Sh SYNOPSIS .In sys/types.h .In sys/systm.h @@ -57,18 +57,21 @@ .Fn copyout "const void *kaddr" "void *uaddr" "size_t len" .Ft int .Fn copyout_nofault "const void *kaddr" "void *uaddr" "size_t len" -.Ft int +.Ft int __deprecated .Fn copystr "const void *kfaddr" "void *kdaddr" "size_t len" "size_t *done" .Ft int .Fn copyinstr "const void *uaddr" "void *kaddr" "size_t len" "size_t *done" .Sh DESCRIPTION The .Nm -functions are designed to copy contiguous data from one address +functions are designed to copy contiguous data from one address space to another. -All but +.Pp .Fn copystr -copy data from user-space to kernel-space or vice-versa. +is deprecated and should be replaced with +.Xr strlcpy 9 . +It will be removed from +.Fx 13 . .Pp The .Fn copyin From owner-svn-src-all@freebsd.org Mon May 11 22:51:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 284FD2D9970; Mon, 11 May 2020 22:51:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LblH0JW5z4LNR; Mon, 11 May 2020 22:51:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:e804:1989:c6ed:be50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5179B181ED; Mon, 11 May 2020 22:51:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360937 - head To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005112215.04BMFkh8071808@repo.freebsd.org> <202005112219.04BMJFRZ081754@slippy.cwsent.com> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <7584e240-6f27-ae72-8447-86d77ec1541f@FreeBSD.org> Date: Mon, 11 May 2020 15:51:20 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005112219.04BMJFRZ081754@slippy.cwsent.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:51:23 -0000 On 5/11/20 3:19 PM, Cy Schubert wrote: > In message <202005112215.04BMFkh8071808@repo.freebsd.org>, John Baldwin > writes: >> Author: jhb >> Date: Mon May 11 22:15:46 2020 >> New Revision: 360937 >> URL: https://svnweb.freebsd.org/changeset/base/360937 >> >> Log: >> Document removal of deprecated algorithms from OCF. >> >> Sponsored by: Chelsio Communications >> >> Modified: >> head/RELNOTES >> >> Modified: head/RELNOTES >> ============================================================================= >> = >> --- head/RELNOTES Mon May 11 22:08:08 2020 (r360936) >> +++ head/RELNOTES Mon May 11 22:15:46 2020 (r360937) >> @@ -10,6 +10,11 @@ newline. Entries should be separated by a newline. >> >> Changes to this file should not be MFCed. >> >> +r360920,r360923,r360924,r360927,r360928,r360931,r360933,r360936: >> + Remove support for ARC4, Blowfish, Cast, DES, Triple DES, MD5, >> + MD5-KPDK, MD5-HMAC, SHA1-KPDK, and Skipjack algorithms from >> + the kernel open cryptographic framework (OCF). >> + >> r360562: >> Remove support for ARC4, Blowfish, Cast, DES, Triple DES, >> MD5-HMAC, and Skipjack algorithms from /dev/crypto. >> > > Do we need a __FreeBSD_version bump? We shouldn't. I did not remove any of the CRYPTO_* constants that list algorithms since OpenSSL assumes some of them exist unconditionally. OpenSSL's /dev/crypto engine could use some love (it doesn't support AES-GCM on FreeBSD for example), but I've also found that using the engine isn't really beneficial. Doing crypto in the kernel via KTLS seems to perform better for hardware accelerators than the /dev/crypto interface. -- John Baldwin From owner-svn-src-all@freebsd.org Mon May 11 22:57:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3705B2D9FB7; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LbtD0jx6z4LqD; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 13BE725FE7; Mon, 11 May 2020 22:57:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04BMvNw9096454; Mon, 11 May 2020 22:57:23 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04BMvMx2096445; Mon, 11 May 2020 22:57:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005112257.04BMvMx2096445@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Mon, 11 May 2020 22:57:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Commit-Revision: 360944 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 May 2020 22:57:24 -0000 Author: cem Date: Mon May 11 22:57:21 2020 New Revision: 360944 URL: https://svnweb.freebsd.org/changeset/base/360944 Log: copystr(9): Move to deprecate [2/2] Unlike the other copy*() functions, it does not serve to copy from one address space to another or protect against potential faults. It's just an older incarnation of the now-more-common strlcpy(). Add a coccinelle script to tools/ which can be used to mechanically convert existing instances where replacement with strlcpy is trivial. In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the code was further refactored manually to simplify. Replace the declaration of copystr() in systm.h with a small macro wrapper around strlcpy. Remove N redundant MI implementations of copystr. For MIPS, this entailed inlining the assembler copystr into the only consumer, copyinstr, and making the latter a leaf function. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D24672 Added: head/tools/coccinelle/ head/tools/coccinelle/copystr9.cocci (contents, props changed) Deleted: head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/amd64/amd64/support.S Mon May 11 22:57:21 2020 (r360944) @@ -1417,43 +1417,6 @@ copyinstr_toolong: jmp cpystrflt_x /* - * copystr(from, to, maxlen, int *lencopied) - * %rdi, %rsi, %rdx, %rcx - */ -ENTRY(copystr) - PUSH_FRAME_POINTER - movq %rdx,%r8 /* %r8 = maxlen */ - - incq %rdx -1: - decq %rdx - jz 4f - movb (%rdi),%al - movb %al,(%rsi) - incq %rsi - incq %rdi - testb %al,%al - jnz 1b - - /* Success -- 0 byte reached */ - decq %rdx - xorl %eax,%eax -2: - testq %rcx,%rcx - jz 3f - /* set *lencopied and return %rax */ - subq %rdx,%r8 - movq %r8,(%rcx) -3: - POP_FRAME_POINTER - ret -4: - /* rdx is zero -- return ENAMETOOLONG */ - movl $ENAMETOOLONG,%eax - jmp 2b -END(copystr) - -/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/arm/arm/copystr.S Mon May 11 22:57:21 2020 (r360944) @@ -60,39 +60,6 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif -/* - * r0 - from - * r1 - to - * r2 - maxlens - * r3 - lencopied - * - * Copy string from r0 to r1 - */ -ENTRY(copystr) - stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ - teq r2, #0x00000000 - mov r5, #0x00000000 - moveq r0, #ENAMETOOLONG - beq 2f - -1: ldrb r4, [r0], #0x0001 - add r5, r5, #0x00000001 - teq r4, #0x00000000 - strb r4, [r1], #0x0001 - teqne r5, r2 - bne 1b - - teq r4, #0x00000000 - moveq r0, #0x00000000 - movne r0, #ENAMETOOLONG - -2: teq r3, #0x00000000 - strne r5, [r3] - - ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ - RET -END(copystr) - #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/fs/fuse/fuse_vfsops.c Mon May 11 22:57:21 2020 (r360944) @@ -303,8 +303,6 @@ fuse_vfsop_mount(struct mount *mp) int daemon_timeout; int fd; - size_t len; - struct cdev *fdev; struct fuse_data *data = NULL; struct thread *td; @@ -432,8 +430,8 @@ fuse_vfsop_mount(struct mount *mp) strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); } - copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); - bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); + memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); mp->mnt_iosize_max = MAXPHYS; /* Now handshaking with daemon */ Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/fs/unionfs/union_vfsops.c Mon May 11 22:57:21 2020 (r360944) @@ -83,7 +83,6 @@ unionfs_domount(struct mount *mp) char *tmp; char *ep; int len; - size_t done; int below; uid_t uid; gid_t gid; @@ -304,12 +303,8 @@ unionfs_domount(struct mount *mp) */ vfs_getnewfsid(mp); - len = MNAMELEN - 1; - tmp = mp->mnt_stat.f_mntfromname; - copystr((below ? ":" : ":"), tmp, len, &done); - len -= done - 1; - tmp += done - 1; - copystr(target, tmp, len, NULL); + snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN, "<%s>:%s", + below ? "below" : "above", target); UNIONFSDEBUG("unionfs_mount: from %s, on %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Mon May 11 22:48:00 2020 (r360943) +++ head/sys/i386/i386/support.s Mon May 11 22:57:21 2020 (r360944) @@ -233,47 +233,6 @@ ENTRY(memcpy) ret END(memcpy) -/* - * copystr(from, to, maxlen, int *lencopied) - MP SAFE - */ -ENTRY(copystr) - pushl %esi - pushl %edi - - movl 12(%esp),%esi /* %esi = from */ - movl 16(%esp),%edi /* %edi = to */ - movl 20(%esp),%edx /* %edx = maxlen */ - incl %edx -1: - decl %edx - jz 4f - lodsb - stosb - orb %al,%al - jnz 1b - - /* Success -- 0 byte reached */ - decl %edx - xorl %eax,%eax - jmp 6f -4: - /* edx is zero -- return ENAMETOOLONG */ - movl $ENAMETOOLONG,%eax - -6: - /* set *lencopied and return %eax */ - movl 20(%esp),%ecx - subl %edx,%ecx - movl 24(%esp),%edx - testl %edx,%edx - jz 7f - movl %ecx,(%edx) -7: - popl %edi - popl %esi - ret -END(copystr) - ENTRY(bcmp) pushl %edi pushl %esi Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Mon May 11 22:48:00 2020 (r360943) +++ head/sys/kern/subr_csan.c Mon May 11 22:57:21 2020 (r360944) @@ -350,19 +350,11 @@ kcsan_strlen(const char *str) return (s - str); } -#undef copystr #undef copyin #undef copyin_nofault #undef copyinstr #undef copyout #undef copyout_nofault - -int -kcsan_copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done) -{ - kcsan_access((uintptr_t)kdaddr, len, true, false, __RET_ADDR); - return copystr(kfaddr, kdaddr, len, done); -} int kcsan_copyin(const void *uaddr, void *kaddr, size_t len) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Mon May 11 22:48:00 2020 (r360943) +++ head/sys/mips/mips/support.S Mon May 11 22:57:21 2020 (r360944) @@ -105,12 +105,22 @@ .text /* - * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied) - * Copy a NIL-terminated string, at most maxlen characters long. Return the - * number of characters copied (including the NIL) in *lencopied. If the - * string is too long, return ENAMETOOLONG; else return 0. + * Copy a null terminated string from the user address space into + * the kernel address space. + * + * copyinstr(fromaddr, toaddr, maxlength, &lencopied) + * caddr_t fromaddr; + * caddr_t toaddr; + * u_int maxlength; + * u_int *lencopied; */ -LEAF(copystr) +LEAF(copyinstr) + PTR_LA v0, __copyinstr_err + blt a0, zero, __copyinstr_err # make sure address is in user space + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S v0, U_PCB_ONFAULT(v1) + move t0, a2 beq a2, zero, 4f 1: @@ -128,37 +138,14 @@ LEAF(copystr) PTR_SUBU a2, t0, a2 # if the 4th arg was non-NULL PTR_S a2, 0(a3) 3: - j ra # v0 is 0 or ENAMETOOLONG + + PTR_S zero, U_PCB_ONFAULT(v1) + j ra nop -END(copystr) - -/* - * Copy a null terminated string from the user address space into - * the kernel address space. - * - * copyinstr(fromaddr, toaddr, maxlength, &lencopied) - * caddr_t fromaddr; - * caddr_t toaddr; - * u_int maxlength; - * u_int *lencopied; - */ -NESTED(copyinstr, CALLFRAME_SIZ, ra) - PTR_SUBU sp, sp, CALLFRAME_SIZ - .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) - PTR_LA v0, copyerr - blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space - REG_S ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - jal _C_LABEL(copystr) - PTR_S v0, U_PCB_ONFAULT(v1) - REG_L ra, CALLFRAME_RA(sp) - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S zero, U_PCB_ONFAULT(v1) - j ra - PTR_ADDU sp, sp, CALLFRAME_SIZ +__copyinstr_err: + j ra + li v0, EFAULT END(copyinstr) /* Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Mon May 11 22:48:00 2020 (r360943) +++ head/sys/sys/systm.h Mon May 11 22:57:21 2020 (r360944) @@ -362,9 +362,17 @@ void *memcpy_early(void * _Nonnull to, const void * _N void *memmove_early(void * _Nonnull dest, const void * _Nonnull src, size_t n); #define bcopy_early(from, to, len) memmove_early((to), (from), (len)) -int copystr(const void * _Nonnull __restrict kfaddr, - void * _Nonnull __restrict kdaddr, size_t len, - size_t * __restrict lencopied); +#define copystr(src, dst, len, outlen) ({ \ + size_t __r, __len, *__outlen; \ + \ + __len = (len); \ + __outlen = (outlen); \ + __r = strlcpy((dst), (src), __len); \ + if (__outlen != NULL) \ + *__outlen = ((__r >= __len) ? __len : __r); \ + ((__r >= __len) ? ENAMETOOLONG : 0); \ +}) + int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); @@ -378,11 +386,9 @@ int copyout_nofault(const void * _Nonnull __restrict k void * __restrict udaddr, size_t len); #ifdef KCSAN -int kcsan_copystr(const void *, void *, size_t, size_t *); int kcsan_copyin(const void *, void *, size_t); int kcsan_copyinstr(const void *, void *, size_t, size_t *); int kcsan_copyout(const void *, void *, size_t); -#define copystr(kf, k, l, lc) kcsan_copystr((kf), (k), (l), (lc)) #define copyin(u, k, l) kcsan_copyin((u), (k), (l)) #define copyinstr(u, k, l, lc) kcsan_copyinstr((u), (k), (l), (lc)) #define copyout(k, u, l) kcsan_copyout((k), (u), (l)) Added: head/tools/coccinelle/copystr9.cocci ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/coccinelle/copystr9.cocci Mon May 11 22:57:21 2020 (r360944) @@ -0,0 +1,39 @@ +@ nostorederror_nostoredlen @ + expression __src, __dst, __len; + statement S1; +@@ + + S1 +-copystr(__src, __dst, __len, NULL); ++strlcpy(__dst, __src, __len); + +@ ifcondition_nostoredlen @ + expression __src, __dst, __len; + statement S1; +@@ + if ( +( +-copystr(__src, __dst, __len, NULL) == ENAMETOOLONG +| +-copystr(__src, __dst, __len, NULL) != 0 +| +-copystr(__src, __dst, __len, NULL) +) ++strlcpy(__dst, __src, __len) >= __len + ) S1 + +@ nostorederror_storedlen1 @ + expression __src, __dst, __len; + identifier __done; + statement S1; +@@ + S1 +( +-copystr(__src, __dst, __len, &__done); ++__done = strlcpy(__dst, __src, __len); ++__done = MIN(__done, __len); +| +-copystr(__src, __dst, __len, __done); ++ *__done = strlcpy(__dst, __src, __len); ++ *__done = MIN(*__done, __len); +) From owner-svn-src-all@freebsd.org Tue May 12 00:42:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1AFC72DC5C6; Tue, 12 May 2020 00:42:17 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LfCD71JPz4SHL; Tue, 12 May 2020 00:42:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EBEDD27383; Tue, 12 May 2020 00:42:16 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C0gGBL067018; Tue, 12 May 2020 00:42:16 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C0gGM6067016; Tue, 12 May 2020 00:42:16 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005120042.04C0gGM6067016@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 12 May 2020 00:42:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360946 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 360946 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 00:42:17 -0000 Author: cem Date: Tue May 12 00:42:16 2020 New Revision: 360946 URL: https://svnweb.freebsd.org/changeset/base/360946 Log: Remove deleted files from the build Fix build break introduced in r360944. Reported by: kevans Modified: head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.arm64 Tue May 12 00:42:16 2020 (r360946) @@ -133,7 +133,6 @@ arm64/arm64/busdma_machdep.c standard arm64/arm64/bzero.S standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard -arm64/arm64/copystr.c standard arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.powerpc Tue May 12 00:42:16 2020 (r360946) @@ -241,7 +241,6 @@ powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.c standard powerpc/powerpc/copyinout.c standard -powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/cpu_subr64.S optional powerpc64 powerpc/powerpc/db_disasm.c optional ddb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue May 12 00:36:37 2020 (r360945) +++ head/sys/conf/files.riscv Tue May 12 00:42:16 2020 (r360946) @@ -37,7 +37,6 @@ riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard -riscv/riscv/copystr.c standard riscv/riscv/cpufunc_asm.S standard riscv/riscv/db_disasm.c optional ddb riscv/riscv/db_interface.c optional ddb From owner-svn-src-all@freebsd.org Tue May 12 01:01:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 346942DCE71; Tue, 12 May 2020 01:01:49 +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 49Lfdn0gH1z4TCn; Tue, 12 May 2020 01:01:49 +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 120C02783A; Tue, 12 May 2020 01:01:49 +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 04C11mIb076065; Tue, 12 May 2020 01:01:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C11m8Q076064; Tue, 12 May 2020 01:01:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005120101.04C11m8Q076064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 01:01: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: r360947 - stable/12/usr.bin/elfctl X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/usr.bin/elfctl X-SVN-Commit-Revision: 360947 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:01:49 -0000 Author: emaste Date: Tue May 12 01:01:48 2020 New Revision: 360947 URL: https://svnweb.freebsd.org/changeset/base/360947 Log: MFC r360676: elfctl: update earliest FreeBSD revision to 12.2 elfctl has been merged to stable/12, and so will appear in FreeBSD 12.2 Reported by: Dewayne Geraghty Sponsored by: The FreeBSD Foundation Modified: stable/12/usr.bin/elfctl/elfctl.1 Directory Properties: stable/12/ (props changed) Modified: stable/12/usr.bin/elfctl/elfctl.1 ============================================================================== --- stable/12/usr.bin/elfctl/elfctl.1 Tue May 12 00:42:16 2020 (r360946) +++ stable/12/usr.bin/elfctl/elfctl.1 Tue May 12 01:01:48 2020 (r360947) @@ -85,7 +85,7 @@ elfctl -e +aslr file .Sh HISTORY .Nm first appeared in -.Fx 13.0 . +.Fx 12.2 . .Sh AUTHORS .Nm was written by From owner-svn-src-all@freebsd.org Tue May 12 01:04:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B23EB2DCF18; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@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 49LfjG4GGbz4TQW; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8D59327882; Tue, 12 May 2020 01:04:50 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C14o7H079509; Tue, 12 May 2020 01:04:50 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C14oe1079508; Tue, 12 May 2020 01:04:50 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005120104.04C14oe1079508@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Tue, 12 May 2020 01:04:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360948 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 360948 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:04:50 -0000 Author: bdragon Date: Tue May 12 01:04:50 2020 New Revision: 360948 URL: https://svnweb.freebsd.org/changeset/base/360948 Log: [PowerPC64] Minor correctness fix in rstcode. TRAP_ENTRY(0) should be TRAP_GENTRAP(0) here. However, in practice, it doesn't matter, as the only time TRAP_ENTRY and TRAP_GENTRAP can differ is when bridge mode is active, which is impossible on the 64 bit kernel. Fix it anyway in case we ever need to add a trap preamble on PPC64. Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:01:48 2020 (r360947) +++ head/sys/powerpc/aim/trap_subr64.S Tue May 12 01:04:50 2020 (r360948) @@ -318,7 +318,7 @@ CNAME(rstcode): * It is software reset when 46:47 = 0b00 */ /* 0x00 */ - ld %r2,TRAP_ENTRY(0) /* Real-mode &generictrap */ + ld %r2,TRAP_GENTRAP(0) /* Real-mode &generictrap */ mfsrr1 %r9 /* Load SRR1 into r9 */ andis. %r9,%r9,0x3 /* Logic AND with 46:47 bits */ From owner-svn-src-all@freebsd.org Tue May 12 01:36:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BFB242DE07A; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@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 49LgQ84d7gz4W69; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 99CFB27E89; Tue, 12 May 2020 01:36:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1amlF097851; Tue, 12 May 2020 01:36:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1am6u097850; Tue, 12 May 2020 01:36:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120136.04C1am6u097850@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 01:36:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360950 - head/tools/tools/ath/ath_ee_9300_print X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/ath_ee_9300_print X-SVN-Commit-Revision: 360950 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:36:48 -0000 Author: adrian Date: Tue May 12 01:36:48 2020 New Revision: 360950 URL: https://svnweb.freebsd.org/changeset/base/360950 Log: [ar9300] Update the ar9300 eeprom dump utility to include target power and CTL. This lets me easily see what the EEPROM target power and regulatory compliance table limits are. (Yeah, should've done this in 2013..) Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:23:05 2020 (r360949) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020 (r360950) @@ -37,6 +37,34 @@ struct ath_hal; #include "ar9300/ar9300eep.h" +static const char * +eeprom_9300_ctl_idx_to_mode(uint8_t idx) +{ + switch (idx & 0xf) { + /* 2G CTLs */ + case 1: return "CCK"; + case 2: return "OFDM"; + case 5: return "HT20"; + case 7: return "HT40"; + /* 5G CTLs */ + case 0: return "OFDM"; + case 6: return "HT20"; + case 8: return "HT40"; + default: return ""; + } +} + +static const char * +eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) +{ + switch (idx & 0xf0) { + case 0x10: return "FCC"; + case 0x30: return "ETSI"; + case 0x40: return "JP"; + } +} + + static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -156,6 +184,246 @@ eeprom_9300_modal_print(const OSPREY_MODAL_EEP_HEADER } static void +eeprom_9300_print_2g_target_cck(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_CCK_TARGET_POWERS; i++) { + printf("| Freq %u CCK: pow2x 1/5L %u 5S %u 11L %u 11S %u\n", + FBIN2FREQ(ee->cal_target_freqbin_cck[i], 1), + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_1L_5L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_5S], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11L], + ee->cal_target_power_cck[i].t_pow2x[LEGACY_TARGET_RATE_11S]); + } +} + +static void +eeprom_9300_print_2g_target_ofdm(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u OFDM: pow2x 6/12/18/24M %u 36M %u 48M %u 54M %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g[i], 1), + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_6_24], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_36], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_48], + ee->cal_target_power_2g[i].t_pow2x[LEGACY_TARGET_RATE_54]); + } +} + +static void +eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_2G_40_TARGET_POWERS; i++) { + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_2g_ctls(const ar9300_eeprom_t *ee) +{ + int i, j; + + for (i = 0; i < OSPREY_NUM_CTLS_2G; i++) { + printf("| CTL index 0x%.02x (%s %s)\n", + ee->ctl_index_2g[i], + eeprom_9300_ctl_idx_to_regdomain(ee->ctl_index_2g[i]), + eeprom_9300_ctl_idx_to_mode(ee->ctl_index_2g[i])); + for (j = 0; j < OSPREY_NUM_BAND_EDGES_2G; j++) { + printf("| Freq %u pow2x %u flags 0x%x\n", + FBIN2FREQ(ee->ctl_freqbin_2G[i][j], 1), + ee->ctl_power_data_2g[i].ctl_edges[j].t_power, + ee->ctl_power_data_2g[i].ctl_edges[j].flag); + } + printf("\n"); + } +} + +static void +eeprom_9300_print_5g_target_ofdm(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_20_TARGET_POWERS; i++) { + printf("| Freq %u OFDM: pow2x 6/12/18/24M %u 36M %u 48M %u 54M %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g[i], 0), + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_6_24], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_36], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_48], + ee->cal_target_power_5g[i].t_pow2x[LEGACY_TARGET_RATE_54]); + } +} + +static void +eeprom_9300_print_5g_target_ht20(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_20_TARGET_POWERS; i++) { + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht20[i], 0), + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_5g_ht20[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_5g_target_ht40(const ar9300_eeprom_t *ee) +{ + int i; + + for (i = 0; i < OSPREY_NUM_5G_40_TARGET_POWERS; i++) { + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_4], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_5], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_6], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_12], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_13], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_14], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", + FBIN2FREQ(ee->cal_target_freqbin_5g_ht40[i], 0), + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_20], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_21], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_22], + ee->cal_target_power_5g_ht40[i].t_pow2x[HT_TARGET_RATE_23]); + } +} + +static void +eeprom_9300_print_5g_ctls(const ar9300_eeprom_t *ee) +{ + int i, j; + + for (i = 0; i < OSPREY_NUM_CTLS_5G; i++) { + printf("| CTL index 0x%.02x (%s %s)\n", ee->ctl_index_5g[i], + eeprom_9300_ctl_idx_to_regdomain(ee->ctl_index_5g[i]), + eeprom_9300_ctl_idx_to_mode(ee->ctl_index_5g[i])); + for (j = 0; j < OSPREY_NUM_BAND_EDGES_5G; j++) { + printf("| Freq %u pow2x %u Flags 0x%x\n", + FBIN2FREQ(ee->ctl_freqbin_5G[i][j], 0), + ee->ctl_power_data_5g[i].ctl_edges[j].t_power, + ee->ctl_power_data_5g[i].ctl_edges[j].flag); + } + printf("\n"); + } +} + +static void load_eeprom_dump(const char *file, uint16_t *buf) { unsigned int r[8]; @@ -222,9 +490,19 @@ main(int argc, char *argv[]) printf("\n2GHz modal:\n"); eeprom_9300_modal_print(&ee->modal_header_2g); + // TODO: open-loop calibration + eeprom_9300_print_2g_target_cck(ee); + eeprom_9300_print_2g_target_ofdm(ee); + eeprom_9300_print_2g_target_ht20(ee); + eeprom_9300_print_2g_target_ht40(ee); + eeprom_9300_print_2g_ctls(ee); printf("\n5GHz modal:\n"); eeprom_9300_modal_print(&ee->modal_header_5g); + eeprom_9300_print_5g_target_ofdm(ee); + eeprom_9300_print_5g_target_ht20(ee); + eeprom_9300_print_5g_target_ht40(ee); + eeprom_9300_print_5g_ctls(ee); free(eep); exit(0); From owner-svn-src-all@freebsd.org Tue May 12 01:40:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3A6D2DE1F8; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@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 49LgVm3xbrz4WHw; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8209E27EAB; Tue, 12 May 2020 01:40:48 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1emho098097; Tue, 12 May 2020 01:40:48 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1em5s098096; Tue, 12 May 2020 01:40:48 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120140.04C1em5s098096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 01:40:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360951 - head/tools/tools/ath/ath_ee_9300_print X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/ath_ee_9300_print X-SVN-Commit-Revision: 360951 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:40:48 -0000 Author: adrian Date: Tue May 12 01:40:48 2020 New Revision: 360951 URL: https://svnweb.freebsd.org/changeset/base/360951 Log: [ar9300] Fix up this tool after test compiling it with LLVM. Le oops. Modified: head/tools/tools/ath/ath_ee_9300_print/main.c Modified: head/tools/tools/ath/ath_ee_9300_print/main.c ============================================================================== --- head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:36:48 2020 (r360950) +++ head/tools/tools/ath/ath_ee_9300_print/main.c Tue May 12 01:40:48 2020 (r360951) @@ -61,10 +61,10 @@ eeprom_9300_ctl_idx_to_regdomain(uint8_t idx) case 0x10: return "FCC"; case 0x30: return "ETSI"; case 0x40: return "JP"; + default: return ""; } } - static void eeprom_9300_hdr_print(const uint16_t *buf) { @@ -219,7 +219,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_20_TARGET_POWERS; i++) { - printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -229,7 +229,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -239,7 +239,7 @@ eeprom_9300_print_2g_target_ht20(const ar9300_eeprom_t ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT20 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht20[i], 1), ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht20[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -258,7 +258,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t int i; for (i = 0; i < OSPREY_NUM_2G_40_TARGET_POWERS; i++) { - printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS0-7 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -268,7 +268,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_5], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_6], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_7]); - printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS8-15 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], @@ -278,7 +278,7 @@ eeprom_9300_print_2g_target_ht40(const ar9300_eeprom_t ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_13], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_14], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_15]); - printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u %u\n", + printf("| Freq %u HT40 MCS16-23 pow2x %u %u %u %u %u %u %u %u\n", FBIN2FREQ(ee->cal_target_freqbin_2g_ht40[i], 1), ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_0_8_16], ee->cal_target_power_2g_ht40[i].t_pow2x[HT_TARGET_RATE_1_3_9_11_17_19], From owner-svn-src-all@freebsd.org Tue May 12 01:47:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C0112DE640; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LgfZ0S9Rz4WqC; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0ADE5A8; Tue, 12 May 2020 01:47:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C1lX8V004311; Tue, 12 May 2020 01:47:33 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C1lXdV004310; Tue, 12 May 2020 01:47:33 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005120147.04C1lXdV004310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Tue, 12 May 2020 01:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360952 - head/lib/libz X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libz X-SVN-Commit-Revision: 360952 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 01:47:34 -0000 Author: delphij Date: Tue May 12 01:47:33 2020 New Revision: 360952 URL: https://svnweb.freebsd.org/changeset/base/360952 Log: Generate zlib.pc from source. Reviewed by: bapt MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24806 Deleted: head/lib/libz/zlib.pc Modified: head/lib/libz/Makefile Modified: head/lib/libz/Makefile ============================================================================== --- head/lib/libz/Makefile Tue May 12 01:40:48 2020 (r360951) +++ head/lib/libz/Makefile Tue May 12 01:47:33 2020 (r360952) @@ -53,6 +53,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-all@freebsd.org Tue May 12 02:20:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7A25F2DF524; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@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 49LhNX2hyPz4YQj; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 57F586D7; Tue, 12 May 2020 02:20:28 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C2KStY022685; Tue, 12 May 2020 02:20:28 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C2KRWW022682; Tue, 12 May 2020 02:20:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120220.04C2KRWW022682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 02:20:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360953 - in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys: contrib/dev/ath/ath_hal/ar9300 dev/ath/ath_hal X-SVN-Commit-Revision: 360953 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 02:20:28 -0000 Author: adrian Date: Tue May 12 02:20:27 2020 New Revision: 360953 URL: https://svnweb.freebsd.org/changeset/base/360953 Log: [ath_hal] [ath_hal_ar9300] Fix endian macros to work in and out of kernel tree. Yes, people shouldn't use bitfields in C for structure parsing. If someone ever wants a cleanup task then it'd be great to remove them from this vendor code and other places in the ar9285/ar9287 HALs. Alas, here we are. AH_BYTE_ORDER wasn't defined and neither were the two values it could be. So when compiling ath_ee_print_9300 it'd default to the big endian struct layout and get a WHOLE lot of stuff wrong. So: * move AH_BYTE_ORDER into ath_hal/ah.h where it can be used by everyone. * ensure that AH_BYTE_ORDER is actually defined before using it! This should work on both big and little endian platforms. Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300.h Tue May 12 02:20:27 2020 (r360953) @@ -19,18 +19,14 @@ #include "ar9300_freebsd_inc.h" -#define AH_BIG_ENDIAN 4321 -#define AH_LITTLE_ENDIAN 1234 - -#if _BYTE_ORDER == _BIG_ENDIAN -#define AH_BYTE_ORDER AH_BIG_ENDIAN -#else -#define AH_BYTE_ORDER AH_LITTLE_ENDIAN -#endif - /* XXX doesn't belong here */ #define AR_EEPROM_MODAL_SPURS 5 +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* * (a) this should be N(a), * (b) FreeBSD does define nitems, @@ -43,9 +39,7 @@ #include "ah_devid.h" #include "ar9300eep.h" /* For Eeprom definitions */ - #define AR9300_MAGIC 0x19741014 - /* MAC register values */ Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300eep.h Tue May 12 02:20:27 2020 (r360953) @@ -18,13 +18,17 @@ #define _ATH_AR9300_EEP_H_ #include "opt_ah.h" - #include "ah.h" #if defined(WIN32) || defined(WIN64) #pragma pack (push, ar9300, 1) #endif +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + /* FreeBSD extras - should be in ah_eeprom.h ? */ #define AR_EEPROM_EEPCAP_COMPRESS_DIS 0x0001 #define AR_EEPROM_EEPCAP_AES_DIS 0x0002 @@ -345,11 +349,13 @@ typedef struct CalCtlEdgePwr { u_int8_t flag :2, t_power :6; } __packed CAL_CTL_EDGE_PWR; -#else +#elif AH_BYTE_ORDER == AH_LITTLE_ENDIAN typedef struct CalCtlEdgePwr { u_int8_t t_power :6, flag :2; } __packed CAL_CTL_EDGE_PWR; +#else +#error AH_BYTE_ORDER undefined! #endif typedef struct ospCalCtlData_5G { Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Tue May 12 01:47:33 2020 (r360952) +++ head/sys/dev/ath/ath_hal/ah.h Tue May 12 02:20:27 2020 (r360953) @@ -33,6 +33,18 @@ #include "ah_osdep.h" /* + * Endianness macros; used by various structures and code. + */ +#define AH_BIG_ENDIAN 4321 +#define AH_LITTLE_ENDIAN 1234 + +#if _BYTE_ORDER == _BIG_ENDIAN +#define AH_BYTE_ORDER AH_BIG_ENDIAN +#else +#define AH_BYTE_ORDER AH_LITTLE_ENDIAN +#endif + +/* * The maximum number of TX/RX chains supported. * This is intended to be used by various statistics gathering operations * (NF, RSSI, EVM). From owner-svn-src-all@freebsd.org Tue May 12 02:23:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A7FAE2DF810; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@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 49LhRj3zNCz4YqZ; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 83C438B1; Tue, 12 May 2020 02:23:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C2ND2K028396; Tue, 12 May 2020 02:23:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C2NB3K028384; Tue, 12 May 2020 02:23:11 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005120223.04C2NB3K028384@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Tue, 12 May 2020 02:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360954 - head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/contrib/dev/ath/ath_hal/ar9300 X-SVN-Commit-Revision: 360954 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 02:23:13 -0000 Author: adrian Date: Tue May 12 02:23:11 2020 New Revision: 360954 URL: https://svnweb.freebsd.org/changeset/base/360954 Log: [ath_hal_ar9300] Ensure AH_BYTE_ORDER is defined before used. Same deal here - ensure endian bits are set here first! Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_ap121.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateAP121_h__ #define __ar9300templateAP121_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_ap121= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_aphrodite.h Tue May 12 02:23:11 2020 (r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateAphrodite_h__ #define __ar9300templateAphrodite_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_aphrodite= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_cus157.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300template_cus157_h__ #define __ar9300template_cus157_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t Ar9300Template_cus157= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_generic.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateGeneric_h__ #define __ar9300templateGeneric_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_generic= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb112.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateHB112_h__ #define __ar9300templateHB112_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb112= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_hb116.h Tue May 12 02:23:11 2020 (r360954) @@ -26,6 +26,11 @@ #ifndef __ar9300templateHB116_h__ #define __ar9300templateHB116_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_hb116= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_osprey_k31.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateOsprey_k31_h__ #define __ar9300templateOsprey_k31_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_osprey_k31= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_wasp_2.h Tue May 12 02:23:11 2020 (r360954) @@ -24,6 +24,12 @@ #ifndef __ar9300template_wasp_2_h__ #define __ar9300template_wasp_2_h__ + +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_wasp_2= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb112.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateXB112_h__ #define __ar9300templateXB112_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_xb112= { Modified: head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h ============================================================================== --- head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Tue May 12 02:20:27 2020 (r360953) +++ head/sys/contrib/dev/ath/ath_hal/ar9300/ar9300template_xb113.h Tue May 12 02:23:11 2020 (r360954) @@ -25,6 +25,11 @@ #ifndef __ar9300templateXB113_h__ #define __ar9300templateXB113_h__ +/* Ensure that AH_BYTE_ORDER is defined */ +#ifndef AH_BYTE_ORDER +#error AH_BYTE_ORDER needs to be defined! +#endif + static ar9300_eeprom_t ar9300_template_xb113= { From owner-svn-src-all@freebsd.org Tue May 12 03:18:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3F482E0DB9; Tue, 12 May 2020 03:18:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pj1-x102f.google.com (mail-pj1-x102f.google.com [IPv6:2607:f8b0:4864:20::102f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LjgF5Jpwz4cdj; Tue, 12 May 2020 03:18:17 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-pj1-x102f.google.com with SMTP id e6so8701036pjt.4; Mon, 11 May 2020 20:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q5LRHiKwKw7FAbakmo7vETJ1hq3WsR9W3SH3qlMORKk=; b=jpn8NzJDcce1b2bYXV1PbTpOCoH/8tM8LvOnzMqzSl8sAyJJ9uGGqSuPuis9Oz/VsL hDbO/GrY9j+5l6wmuBN+u55ZQV5XmVFplgHiN0prQXJ6XFswZCebk0xr+nb1gvn1NKGl oLNn4O9/dGILZ+RvS24Dsx1hxO6ErE4IykaGIeO/7GdbrW6pjtswAfqcHKWeQcSrffMl UZDrvWD/LuKhIlJn0Jk6+me0Lugsula5/VpP87N8tFpP9WVkor1cIh/brLVx8XBWm4mp EAJZoH5JUg/ZNGa33xlJvXu7vnlEbVwljzpaytZtCtst+hiBynJUWS8OWBka+wQ7zCuw 4TRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Q5LRHiKwKw7FAbakmo7vETJ1hq3WsR9W3SH3qlMORKk=; b=dF8qS5bZKvF/RkLmPKShHTAx0iMHMwCEua2bG1hDZ+c6fikH1+ONwqJhTTBkMVmKR7 UfcCgZ2XigEccxPPCO/JVGCfhPTui8Ai4lHZta5B4jypyCd1K0tlj+JNYZVAKGrK1bbT ebqmWLgWv+/kfVMHItpxz3vudxlxAhB0/0b9HzM2jtYDkAqfgoIiBwOHXXBz6498Dmj+ hAxu2n7Ps3lVqf1Qv5cEtt+4CpogKnStT0j8hWWVh2jIDocByq0bmiIV+XO+Adv0/YSi zTzDbkcZ5JC7iQmuPsN0uGhdWKCzSXBS/e+xDXYApDUsrMNfxUMT1WICTZWec2CCMQXY W9zg== X-Gm-Message-State: AGi0PuZvFS7SCHUsO0F4YQF5iNNC123D1jQqglnTq/JkZkRJY+5/4SYy NxFnLrAyqPUea1Kqi17dDZWat9oYAZk= X-Google-Smtp-Source: APiQypJV61XSTFdij5vetXZnq8ZUItXJJpLyyBsEK4CWaTqRnWNZMvYscp+zZlgm42Gnq4sdrGnrwg== X-Received: by 2002:a17:90a:a50b:: with SMTP id a11mr26008341pjq.143.1589253496041; Mon, 11 May 2020 20:18:16 -0700 (PDT) Received: from [192.168.20.26] (c-73-19-52-228.hsd1.wa.comcast.net. [73.19.52.228]) by smtp.gmail.com with ESMTPSA id v133sm10493201pfc.113.2020.05.11.20.18.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 20:18:15 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: svn commit: r360905 - in head/tests/sys/netpfil: common pf From: Enji Cooper In-Reply-To: <202005111907.04BJ7XQs051443@repo.freebsd.org> Date: Mon, 11 May 2020 20:18:15 -0700 Cc: src-committers , svn-src-all , svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <38FB0E56-E339-4446-9239-25F27DBCA27D@gmail.com> References: <202005111907.04BJ7XQs051443@repo.freebsd.org> To: Mark Johnston X-Mailer: Apple Mail (2.3608.80.23.2.2) X-Rspamd-Queue-Id: 49LjgF5Jpwz4cdj X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 03:18:17 -0000 > On May 11, 2020, at 12:07 PM, Mark Johnston wrote: >=20 > Author: markj > Date: Mon May 11 19:07:33 2020 > New Revision: 360905 > URL: https://svnweb.freebsd.org/changeset/base/360905 >=20 > Log: > Remove the svn:executable property from some pf test files. >=20 > The test makefiles will handle setting mode bits during install. = Also, > Phabricator gets upset when uploading an executable plain-text file > without a shebang. Awesome =E2=80=94 thanks for doing this! Cheers, -Enji= From owner-svn-src-all@freebsd.org Tue May 12 03:28:34 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B00E52E0FF7; Tue, 12 May 2020 03:28:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ljv62QGJz4d4V; Tue, 12 May 2020 03:28:34 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YLanjuuffng7KYLapjQhfI; Mon, 11 May 2020 21:28:31 -0600 X-Authority-Analysis: v=2.3 cv=ecemg4MH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=EkcXrb_YAAAA:8 a=UQqzRo2VMZOa0133vbQA:9 a=IB-5xOalOEsgZyZU:21 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=UDnyf2zBuKT2w-IlGP_r:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTP id B5BE8D3B; Mon, 11 May 2020 20:28:28 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04C3SRid081100; Mon, 11 May 2020 20:28:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04C3SR2X081094; Mon, 11 May 2020 20:28:27 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005120328.04C3SR2X081094@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Conrad Meyer cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle In-reply-to: <202005112257.04BMvMx2096445@repo.freebsd.org> References: <202005112257.04BMvMx2096445@repo.freebsd.org> Comments: In-reply-to Conrad Meyer message dated "Mon, 11 May 2020 22:57:22 -0000." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 20:28:27 -0700 X-CMAE-Envelope: MS4wfOArhZV3RjvfOR5gjmvxBRl8CQC50U3RcSvcjuz11JeXVn1RoWhTs7xSn5wyXgru0ug9RF7saD6gXDrJtcTW5s5SgUvhAIiwPgsxtlGv978AHOAk1K/S lMJb0M7AcvCuyccPT3FegOvZbpt+7ru2R2ApL47pnZKJpVoPbLBKGm3q7HbdsI+XLQj2l6QN6hI9MTg6Kh//5VJDzBFf36VfmOtn3A6vhfHtKrWJEggNVIyZ 9l1lT7B/3xBrKhQnVn/kJfc3vTSJ1YMTO1O2BGt88DJqLvxglV/Y3SXjAkRi0du+ X-Rspamd-Queue-Id: 49Ljv62QGJz4d4V X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 03:28:34 -0000 In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer writes: > Author: cem > Date: Mon May 11 22:57:21 2020 > New Revision: 360944 > URL: https://svnweb.freebsd.org/changeset/base/360944 > > Log: > copystr(9): Move to deprecate [2/2] > > Unlike the other copy*() functions, it does not serve to copy from one > address space to another or protect against potential faults. It's just > an older incarnation of the now-more-common strlcpy(). > > Add a coccinelle script to tools/ which can be used to mechanically > convert existing instances where replacement with strlcpy is trivial. > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > code was further refactored manually to simplify. > > Replace the declaration of copystr() in systm.h with a small macro > wrapper around strlcpy. > > Remove N redundant MI implementations of copystr. For MIPS, this > entailed inlining the assembler copystr into the only consumer, > copyinstr, and making the latter a leaf function. > > Reviewed by: jhb > Differential Revision: https://reviews.freebsd.org/D24672 > > Added: > head/tools/coccinelle/ > head/tools/coccinelle/copystr9.cocci (contents, props changed) > Deleted: > head/sys/arm64/arm64/copystr.c > head/sys/powerpc/powerpc/copystr.c > head/sys/riscv/riscv/copystr.c > Modified: > head/sys/amd64/amd64/support.S > head/sys/arm/arm/copystr.S > head/sys/fs/fuse/fuse_vfsops.c > head/sys/fs/unionfs/union_vfsops.c > head/sys/i386/i386/support.s > head/sys/kern/subr_csan.c > head/sys/mips/mips/support.S > head/sys/sys/systm.h > Hi Conrad, This is causing a failure to boot with geom_mirror: GEOM_MIRROR: Device mirror/gm0 launched (2/2). GEOM_MIRROR: Device mirror/gm1 launched (2/2). GEOM_MIRROR: Device mirror/gm2 launched (2/2). GEOM_MIRROR: Device mirror/gm3 launched (2/2). mountroot: waiting for device /dev/mirror/gm0a... Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 more seconds exec /sbin/init: error 20 exec /sbin/init.bak: error 20 exec /rescue/init: error 20 init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init panic: no init cpuid = 1 time = 1589225852 KDB: stack backtrace: db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe004df51ba0 vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 panic() at panic+0x43/frame 0xfffffe004df51c50 start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 --- trap 0, rip = 0, rsp = 0, rbp = 0 --- Uptime: 9s acpi0: reset failed - timeout Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. Rebooting... cpu_reset: Restarting BSP cpu_reset_proxy: Stopped CPU 1 Anticipating you might ask if r360941 is the problem. It is not. Reverting this r360944 (not r360941) resolves the boot problem. System is amd64. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Tue May 12 04:27:32 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C9DA2E213F; Tue, 12 May 2020 04:27:32 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ot1-f66.google.com (mail-ot1-f66.google.com [209.85.210.66]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LlC75llBz3C52; Tue, 12 May 2020 04:27:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ot1-f66.google.com with SMTP id j4so9456785otr.11; Mon, 11 May 2020 21:27:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=Y8wmSmT7IzBn/yA6y4+odeva8sHFRlfa0jeKDf4Qfmg=; b=Phbe/CQahev7bSphM/lXoNXVu8qwvoMPyzRw2jreEBDPJPh2nqTyj65GO32kq1TlgU FePWzyQjkb0q/aGj9NPbbSkq5O9OV1Z+WKt9LdUdo3DdJ8y64psKdqrwN3VoFEi2503p cNHT4kL//EFmR8XxXqHbkA9yWAt93tpvO7M/8DcOOOPHYZ8WZKJ9Q7z9UNzZNNSUhLfn Xt4FA/OO0drPBArzzzCN1IAYVL47+GuK+aF1iUkbGuBSuKsiv8HJ1S9Zd+kbFBBrrXF+ BbKRbh6QBHNO5HqvnUVJ/dE0LCXSStr7/eSo067NMifXqyVVkb6U+YhOkmiXPkNo32qA CQKw== X-Gm-Message-State: AGi0PuYjdbSktXo7ul14SWjJBoIVem2UlxC5R5X8mitErhlq+fSD7QKk zVToPphYTI/QQulB/ob5h2kk/QQs X-Google-Smtp-Source: APiQypInXSBG0jkZNpRdlTrgfl6u7arW+JA+/tgWszzfrDKZOjHslWzEvQzqkaxCQDJ9JZ/Esr+y+g== X-Received: by 2002:a9d:7a6:: with SMTP id 35mr13822451oto.201.1589257650038; Mon, 11 May 2020 21:27:30 -0700 (PDT) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com. [209.85.167.170]) by smtp.gmail.com with ESMTPSA id m16sm3333907oop.40.2020.05.11.21.27.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 11 May 2020 21:27:29 -0700 (PDT) Received: by mail-oi1-f170.google.com with SMTP id c12so16152930oic.1; Mon, 11 May 2020 21:27:29 -0700 (PDT) X-Received: by 2002:aca:4ac3:: with SMTP id x186mr13398030oia.81.1589257649452; Mon, 11 May 2020 21:27:29 -0700 (PDT) MIME-Version: 1.0 References: <202005112257.04BMvMx2096445@repo.freebsd.org> <202005120328.04C3SR2X081094@slippy.cwsent.com> In-Reply-To: <202005120328.04C3SR2X081094@slippy.cwsent.com> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Mon, 11 May 2020 21:27:18 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-Rspamd-Queue-Id: 49LlC75llBz3C52 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of csecem@gmail.com designates 209.85.210.66 as permitted sender) smtp.mailfrom=csecem@gmail.com X-Spamd-Result: default: False [-2.18 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; MIME_TRACE(0.00)[0:+,1:+,2:~]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[66.210.85.209.list.dnswl.org : 127.0.5.0]; RWL_MAILSPIKE_GOOD(0.00)[66.210.85.209.rep.mailspike.net : 127.0.0.18]; HAS_REPLYTO(0.00)[cem@freebsd.org]; IP_SCORE(-0.18)[ip: (-0.03), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; FORGED_SENDER(0.30)[cem@freebsd.org,csecem@gmail.com]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; TAGGED_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[cem@freebsd.org,csecem@gmail.com] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 04:27:32 -0000 Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m back at a computer. Best, Conrad On Mon, May 11, 2020 at 20:28 Cy Schubert wrote= : > In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer > writes: > > Author: cem > > Date: Mon May 11 22:57:21 2020 > > New Revision: 360944 > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > Log: > > copystr(9): Move to deprecate [2/2] > > > > Unlike the other copy*() functions, it does not serve to copy from on= e > > address space to another or protect against potential faults. It's > just > > an older incarnation of the now-more-common strlcpy(). > > > > Add a coccinelle script to tools/ which can be used to mechanically > > convert existing instances where replacement with strlcpy is trivial. > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > code was further refactored manually to simplify. > > > > Replace the declaration of copystr() in systm.h with a small macro > > wrapper around strlcpy. > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > entailed inlining the assembler copystr into the only consumer, > > copyinstr, and making the latter a leaf function. > > > > Reviewed by: jhb > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > Added: > > head/tools/coccinelle/ > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > Deleted: > > head/sys/arm64/arm64/copystr.c > > head/sys/powerpc/powerpc/copystr.c > > head/sys/riscv/riscv/copystr.c > > Modified: > > head/sys/amd64/amd64/support.S > > head/sys/arm/arm/copystr.S > > head/sys/fs/fuse/fuse_vfsops.c > > head/sys/fs/unionfs/union_vfsops.c > > head/sys/i386/i386/support.s > > head/sys/kern/subr_csan.c > > head/sys/mips/mips/support.S > > head/sys/sys/systm.h > > > > Hi Conrad, > > This is causing a failure to boot with geom_mirror: > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > mountroot: waiting for device /dev/mirror/gm0a... > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > more > seconds > exec /sbin/init: error 20 > exec /sbin/init.bak: error 20 > exec /rescue/init: error 20 > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/ini= t > panic: no init > cpuid =3D 1 > time =3D 1589225852 > KDB: stack backtrace: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > 0xfffffe004df51ba0 > vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 > panic() at panic+0x43/frame 0xfffffe004df51c50 > start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 > fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > Uptime: 9s > acpi0: reset failed - timeout > Automatic reboot in 15 seconds - press a key on the console to abort > --> Press a key on the console to reboot, > --> or switch off the system now. > Rebooting... > cpu_reset: Restarting BSP > cpu_reset_proxy: Stopped CPU 1 > > > Anticipating you might ask if r360941 is the problem. It is not. Revertin= g > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > -- > Cheers, > Cy Schubert > FreeBSD UNIX: Web: https://FreeBSD.org > NTP: Web: https://nwtime.org > > The need of the many outweighs the greed of the few. > > > From owner-svn-src-all@freebsd.org Tue May 12 04:34:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4732C2E237B; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49LlMB1SzNz3CTS; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D7B22295; Tue, 12 May 2020 04:34:30 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04C4YULn008567; Tue, 12 May 2020 04:34:30 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C4YRMD008553; Tue, 12 May 2020 04:34:27 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005120434.04C4YRMD008553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 12 May 2020 04:34:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360955 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools... X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/conf sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle X-SVN-Commit-Revision: 360955 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 04:34:30 -0000 Author: cem Date: Tue May 12 04:34:26 2020 New Revision: 360955 URL: https://svnweb.freebsd.org/changeset/base/360955 Log: Revert r360944 and r360946 until reported issues can be resolved Reported by: cy Added: head/sys/arm64/arm64/copystr.c - copied unchanged from r360943, head/sys/arm64/arm64/copystr.c head/sys/powerpc/powerpc/copystr.c - copied unchanged from r360943, head/sys/powerpc/powerpc/copystr.c head/sys/riscv/riscv/copystr.c - copied unchanged from r360943, head/sys/riscv/riscv/copystr.c Deleted: head/tools/coccinelle/ Modified: head/sys/amd64/amd64/support.S head/sys/arm/arm/copystr.S head/sys/conf/files.arm64 head/sys/conf/files.powerpc head/sys/conf/files.riscv head/sys/fs/fuse/fuse_vfsops.c head/sys/fs/unionfs/union_vfsops.c head/sys/i386/i386/support.s head/sys/kern/subr_csan.c head/sys/mips/mips/support.S head/sys/sys/systm.h Modified: head/sys/amd64/amd64/support.S ============================================================================== --- head/sys/amd64/amd64/support.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/amd64/amd64/support.S Tue May 12 04:34:26 2020 (r360955) @@ -1417,6 +1417,43 @@ copyinstr_toolong: jmp cpystrflt_x /* + * copystr(from, to, maxlen, int *lencopied) + * %rdi, %rsi, %rdx, %rcx + */ +ENTRY(copystr) + PUSH_FRAME_POINTER + movq %rdx,%r8 /* %r8 = maxlen */ + + incq %rdx +1: + decq %rdx + jz 4f + movb (%rdi),%al + movb %al,(%rsi) + incq %rsi + incq %rdi + testb %al,%al + jnz 1b + + /* Success -- 0 byte reached */ + decq %rdx + xorl %eax,%eax +2: + testq %rcx,%rcx + jz 3f + /* set *lencopied and return %rax */ + subq %rdx,%r8 + movq %r8,(%rcx) +3: + POP_FRAME_POINTER + ret +4: + /* rdx is zero -- return ENAMETOOLONG */ + movl $ENAMETOOLONG,%eax + jmp 2b +END(copystr) + +/* * Handling of special amd64 registers and descriptor tables etc */ /* void lgdt(struct region_descriptor *rdp); */ Modified: head/sys/arm/arm/copystr.S ============================================================================== --- head/sys/arm/arm/copystr.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/arm/arm/copystr.S Tue May 12 04:34:26 2020 (r360955) @@ -60,6 +60,39 @@ __FBSDID("$FreeBSD$"); ldr tmp, .Lpcb #endif +/* + * r0 - from + * r1 - to + * r2 - maxlens + * r3 - lencopied + * + * Copy string from r0 to r1 + */ +ENTRY(copystr) + stmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + teq r2, #0x00000000 + mov r5, #0x00000000 + moveq r0, #ENAMETOOLONG + beq 2f + +1: ldrb r4, [r0], #0x0001 + add r5, r5, #0x00000001 + teq r4, #0x00000000 + strb r4, [r1], #0x0001 + teqne r5, r2 + bne 1b + + teq r4, #0x00000000 + moveq r0, #0x00000000 + movne r0, #ENAMETOOLONG + +2: teq r3, #0x00000000 + strne r5, [r3] + + ldmfd sp!, {r4-r5} /* stack is 8 byte aligned */ + RET +END(copystr) + #define SAVE_REGS stmfd sp!, {r4-r6} #define RESTORE_REGS ldmfd sp!, {r4-r6} Copied: head/sys/arm64/arm64/copystr.c (from r360943, head/sys/arm64/arm64/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/arm64/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/arm64/arm64/copystr.c) @@ -0,0 +1,61 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int +(copystr)(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, + size_t * __restrict lencopied) +{ + const char *src; + size_t pos; + char *dst; + int error; + + error = ENAMETOOLONG; + src = kfaddr; + dst = kdaddr; + for (pos = 0; pos < len; pos++) { + dst[pos] = src[pos]; + if (src[pos] == '\0') { + /* Increment pos to hold the number of bytes copied */ + pos++; + error = 0; + break; + } + } + + if (lencopied != NULL) + *lencopied = pos; + + return (error); +} + Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.arm64 Tue May 12 04:34:26 2020 (r360955) @@ -133,6 +133,7 @@ arm64/arm64/busdma_machdep.c standard arm64/arm64/bzero.S standard arm64/arm64/clock.c standard arm64/arm64/copyinout.S standard +arm64/arm64/copystr.c standard arm64/arm64/cpu_errata.c standard arm64/arm64/cpufunc_asm.S standard arm64/arm64/db_disasm.c optional ddb Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.powerpc Tue May 12 04:34:26 2020 (r360955) @@ -241,6 +241,7 @@ powerpc/powerpc/bus_machdep.c standard powerpc/powerpc/busdma_machdep.c standard powerpc/powerpc/clock.c standard powerpc/powerpc/copyinout.c standard +powerpc/powerpc/copystr.c standard powerpc/powerpc/cpu.c standard powerpc/powerpc/cpu_subr64.S optional powerpc64 powerpc/powerpc/db_disasm.c optional ddb Modified: head/sys/conf/files.riscv ============================================================================== --- head/sys/conf/files.riscv Tue May 12 02:23:11 2020 (r360954) +++ head/sys/conf/files.riscv Tue May 12 04:34:26 2020 (r360955) @@ -37,6 +37,7 @@ riscv/riscv/busdma_bounce.c standard riscv/riscv/busdma_machdep.c standard riscv/riscv/clock.c standard riscv/riscv/copyinout.S standard +riscv/riscv/copystr.c standard riscv/riscv/cpufunc_asm.S standard riscv/riscv/db_disasm.c optional ddb riscv/riscv/db_interface.c optional ddb Modified: head/sys/fs/fuse/fuse_vfsops.c ============================================================================== --- head/sys/fs/fuse/fuse_vfsops.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/fs/fuse/fuse_vfsops.c Tue May 12 04:34:26 2020 (r360955) @@ -303,6 +303,8 @@ fuse_vfsop_mount(struct mount *mp) int daemon_timeout; int fd; + size_t len; + struct cdev *fdev; struct fuse_data *data = NULL; struct thread *td; @@ -430,8 +432,8 @@ fuse_vfsop_mount(struct mount *mp) strlcat(mp->mnt_stat.f_fstypename, ".", MFSNAMELEN); strlcat(mp->mnt_stat.f_fstypename, subtype, MFSNAMELEN); } - memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN); - strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); + copystr(fspec, mp->mnt_stat.f_mntfromname, MNAMELEN - 1, &len); + bzero(mp->mnt_stat.f_mntfromname + len, MNAMELEN - len); mp->mnt_iosize_max = MAXPHYS; /* Now handshaking with daemon */ Modified: head/sys/fs/unionfs/union_vfsops.c ============================================================================== --- head/sys/fs/unionfs/union_vfsops.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/fs/unionfs/union_vfsops.c Tue May 12 04:34:26 2020 (r360955) @@ -83,6 +83,7 @@ unionfs_domount(struct mount *mp) char *tmp; char *ep; int len; + size_t done; int below; uid_t uid; gid_t gid; @@ -303,8 +304,12 @@ unionfs_domount(struct mount *mp) */ vfs_getnewfsid(mp); - snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN, "<%s>:%s", - below ? "below" : "above", target); + len = MNAMELEN - 1; + tmp = mp->mnt_stat.f_mntfromname; + copystr((below ? ":" : ":"), tmp, len, &done); + len -= done - 1; + tmp += done - 1; + copystr(target, tmp, len, NULL); UNIONFSDEBUG("unionfs_mount: from %s, on %s\n", mp->mnt_stat.f_mntfromname, mp->mnt_stat.f_mntonname); Modified: head/sys/i386/i386/support.s ============================================================================== --- head/sys/i386/i386/support.s Tue May 12 02:23:11 2020 (r360954) +++ head/sys/i386/i386/support.s Tue May 12 04:34:26 2020 (r360955) @@ -233,6 +233,47 @@ ENTRY(memcpy) ret END(memcpy) +/* + * copystr(from, to, maxlen, int *lencopied) - MP SAFE + */ +ENTRY(copystr) + pushl %esi + pushl %edi + + movl 12(%esp),%esi /* %esi = from */ + movl 16(%esp),%edi /* %edi = to */ + movl 20(%esp),%edx /* %edx = maxlen */ + incl %edx +1: + decl %edx + jz 4f + lodsb + stosb + orb %al,%al + jnz 1b + + /* Success -- 0 byte reached */ + decl %edx + xorl %eax,%eax + jmp 6f +4: + /* edx is zero -- return ENAMETOOLONG */ + movl $ENAMETOOLONG,%eax + +6: + /* set *lencopied and return %eax */ + movl 20(%esp),%ecx + subl %edx,%ecx + movl 24(%esp),%edx + testl %edx,%edx + jz 7f + movl %ecx,(%edx) +7: + popl %edi + popl %esi + ret +END(copystr) + ENTRY(bcmp) pushl %edi pushl %esi Modified: head/sys/kern/subr_csan.c ============================================================================== --- head/sys/kern/subr_csan.c Tue May 12 02:23:11 2020 (r360954) +++ head/sys/kern/subr_csan.c Tue May 12 04:34:26 2020 (r360955) @@ -350,11 +350,19 @@ kcsan_strlen(const char *str) return (s - str); } +#undef copystr #undef copyin #undef copyin_nofault #undef copyinstr #undef copyout #undef copyout_nofault + +int +kcsan_copystr(const void *kfaddr, void *kdaddr, size_t len, size_t *done) +{ + kcsan_access((uintptr_t)kdaddr, len, true, false, __RET_ADDR); + return copystr(kfaddr, kdaddr, len, done); +} int kcsan_copyin(const void *uaddr, void *kaddr, size_t len) Modified: head/sys/mips/mips/support.S ============================================================================== --- head/sys/mips/mips/support.S Tue May 12 02:23:11 2020 (r360954) +++ head/sys/mips/mips/support.S Tue May 12 04:34:26 2020 (r360955) @@ -105,22 +105,12 @@ .text /* - * Copy a null terminated string from the user address space into - * the kernel address space. - * - * copyinstr(fromaddr, toaddr, maxlength, &lencopied) - * caddr_t fromaddr; - * caddr_t toaddr; - * u_int maxlength; - * u_int *lencopied; + * int copystr(void *kfaddr, void *kdaddr, size_t maxlen, size_t *lencopied) + * Copy a NIL-terminated string, at most maxlen characters long. Return the + * number of characters copied (including the NIL) in *lencopied. If the + * string is too long, return ENAMETOOLONG; else return 0. */ -LEAF(copyinstr) - PTR_LA v0, __copyinstr_err - blt a0, zero, __copyinstr_err # make sure address is in user space - GET_CPU_PCPU(v1) - PTR_L v1, PC_CURPCB(v1) - PTR_S v0, U_PCB_ONFAULT(v1) - +LEAF(copystr) move t0, a2 beq a2, zero, 4f 1: @@ -138,14 +128,37 @@ LEAF(copyinstr) PTR_SUBU a2, t0, a2 # if the 4th arg was non-NULL PTR_S a2, 0(a3) 3: - - PTR_S zero, U_PCB_ONFAULT(v1) - j ra + j ra # v0 is 0 or ENAMETOOLONG nop +END(copystr) -__copyinstr_err: - j ra - li v0, EFAULT + +/* + * Copy a null terminated string from the user address space into + * the kernel address space. + * + * copyinstr(fromaddr, toaddr, maxlength, &lencopied) + * caddr_t fromaddr; + * caddr_t toaddr; + * u_int maxlength; + * u_int *lencopied; + */ +NESTED(copyinstr, CALLFRAME_SIZ, ra) + PTR_SUBU sp, sp, CALLFRAME_SIZ + .mask 0x80000000, (CALLFRAME_RA - CALLFRAME_SIZ) + PTR_LA v0, copyerr + blt a0, zero, _C_LABEL(copyerr) # make sure address is in user space + REG_S ra, CALLFRAME_RA(sp) + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + jal _C_LABEL(copystr) + PTR_S v0, U_PCB_ONFAULT(v1) + REG_L ra, CALLFRAME_RA(sp) + GET_CPU_PCPU(v1) + PTR_L v1, PC_CURPCB(v1) + PTR_S zero, U_PCB_ONFAULT(v1) + j ra + PTR_ADDU sp, sp, CALLFRAME_SIZ END(copyinstr) /* Copied: head/sys/powerpc/powerpc/copystr.c (from r360943, head/sys/powerpc/powerpc/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/powerpc/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/powerpc/powerpc/copystr.c) @@ -0,0 +1,70 @@ +/*- + * SPDX-License-Identifier: BSD-4-Clause + * + * Copyright (C) 1995 Wolfgang Solfrank. + * Copyright (C) 1995 TooLs GmbH. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by TooLs GmbH. + * 4. The name of TooLs GmbH may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY TOOLS GMBH ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $NetBSD: copystr.c,v 1.3 2000/06/08 06:47:17 kleink Exp $ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +/* + * Emulate copyinstr. + */ +int +copystr(kfaddr, kdaddr, len, done) + const void *kfaddr; + void *kdaddr; + size_t len; + size_t *done; +{ + const u_char *kfp = kfaddr; + u_char *kdp = kdaddr; + size_t l; + int rv; + + rv = ENAMETOOLONG; + for (l = 0; len-- > 0; l++) { + if (!(*kdp++ = *kfp++)) { + l++; + rv = 0; + break; + } + } + if (done != NULL) { + *done = l; + } + return rv; +} Copied: head/sys/riscv/riscv/copystr.c (from r360943, head/sys/riscv/riscv/copystr.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/riscv/riscv/copystr.c Tue May 12 04:34:26 2020 (r360955, copy of r360943, head/sys/riscv/riscv/copystr.c) @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2014 Andrew Turner + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +int +copystr(const void * __restrict kfaddr, void * __restrict kdaddr, size_t len, + size_t * __restrict lencopied) +{ + const char *src; + size_t pos; + char *dst; + int error; + + error = ENAMETOOLONG; + src = kfaddr; + dst = kdaddr; + for (pos = 0; pos < len; pos++) { + dst[pos] = src[pos]; + if (src[pos] == '\0') { + /* Increment pos to hold the number of bytes copied */ + pos++; + error = 0; + break; + } + } + + if (lencopied != NULL) + *lencopied = pos; + + return (error); +} Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Tue May 12 02:23:11 2020 (r360954) +++ head/sys/sys/systm.h Tue May 12 04:34:26 2020 (r360955) @@ -362,17 +362,9 @@ void *memcpy_early(void * _Nonnull to, const void * _N void *memmove_early(void * _Nonnull dest, const void * _Nonnull src, size_t n); #define bcopy_early(from, to, len) memmove_early((to), (from), (len)) -#define copystr(src, dst, len, outlen) ({ \ - size_t __r, __len, *__outlen; \ - \ - __len = (len); \ - __outlen = (outlen); \ - __r = strlcpy((dst), (src), __len); \ - if (__outlen != NULL) \ - *__outlen = ((__r >= __len) ? __len : __r); \ - ((__r >= __len) ? ENAMETOOLONG : 0); \ -}) - +int copystr(const void * _Nonnull __restrict kfaddr, + void * _Nonnull __restrict kdaddr, size_t len, + size_t * __restrict lencopied); int copyinstr(const void * __restrict udaddr, void * _Nonnull __restrict kaddr, size_t len, size_t * __restrict lencopied); @@ -386,9 +378,11 @@ int copyout_nofault(const void * _Nonnull __restrict k void * __restrict udaddr, size_t len); #ifdef KCSAN +int kcsan_copystr(const void *, void *, size_t, size_t *); int kcsan_copyin(const void *, void *, size_t); int kcsan_copyinstr(const void *, void *, size_t, size_t *); int kcsan_copyout(const void *, void *, size_t); +#define copystr(kf, k, l, lc) kcsan_copystr((kf), (k), (l), (lc)) #define copyin(u, k, l) kcsan_copyin((u), (k), (l)) #define copyinstr(u, k, l, lc) kcsan_copyinstr((u), (k), (l), (lc)) #define copyout(k, u, l) kcsan_copyout((k), (u), (l)) From owner-svn-src-all@freebsd.org Tue May 12 05:37:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA5E12E31A5; Tue, 12 May 2020 05:37:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-so.shaw.ca (smtp-out-so.shaw.ca [64.59.136.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lmm23M2jz3FlN; Tue, 12 May 2020 05:37:38 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id YNbijTEgUYYpxYNbkjxcIR; Mon, 11 May 2020 23:37:36 -0600 X-Authority-Analysis: v=2.3 cv=OubUNx3t c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=xqWC_Br6kY4A:10 a=kj9zAlcOel0A:10 a=sTwFKg_x9MkA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=SLG1KRGDAAAA:8 a=0FNk9USiAAAA:8 a=Ds8RGfT2AAAA:8 a=1WEEPM5Zuh6txHN7wJAA:9 a=Kw--y-6izCXFQWhw:21 a=CjuIK1q_8ugA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 a=-TBaU1e9WpdkKBzYXnwo:22 a=TF7iPsq83L4KsoDyi5cH:22 a=0afPCejbyZHll-xH3H2j:22 a=Z5ABNNGmrOfJ6cZ5bIyy:22 a=jd6J4Gguk5HxikPWLKER:22 Received: from slippy.cwsent.com (slippy [IPv6:fc00:1:1:1::5b]) by spqr.komquats.com (Postfix) with ESMTPS id F0B3CF1; Mon, 11 May 2020 22:37:33 -0700 (PDT) Received: from slippy.cwsent.com (localhost [127.0.0.1]) by slippy.cwsent.com (8.15.2/8.15.2) with ESMTP id 04C5bXrE008286; Mon, 11 May 2020 22:37:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Received: from slippy (cy@localhost) by slippy.cwsent.com (8.15.2/8.15.2/Submit) with ESMTP id 04C5bX7x008216; Mon, 11 May 2020 22:37:33 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <202005120537.04C5bX7x008216@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: cem@freebsd.org cc: Cy Schubert , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360944 - in head: sys/amd64/amd64 sys/arm/arm sys/arm64/arm64 sys/fs/fuse sys/fs/unionfs sys/i386/i386 sys/kern sys/mips/mips sys/powerpc/powerpc sys/riscv/riscv sys/sys tools/coccinelle In-reply-to: References: <202005112257.04BMvMx2096445@repo.freebsd.org> <202005120328.04C3SR2X081094@slippy.cwsent.com> Comments: In-reply-to Conrad Meyer message dated "Mon, 11 May 2020 21:27:18 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Mon, 11 May 2020 22:37:33 -0700 X-CMAE-Envelope: MS4wfJJ/sxlwDHVMzWnCrVx6DGNBE0Tz6VPYQ248WNTZeTTkq0KX9PJRG7bgb0Vft7eO3dz9xLmiKti3NoOqKmqLcydWRto4gNVptYyZEy98hpSsivqLCSpg FNfL2fVWDXJ3ydxHjtaTiIlPUz4WCZvO1jCv/2z3q74dXp9RFip46K56flBEhj1SciZFSsVldt0fIWpCNWKfELuR+yy9yYAwbgOx5LzhI1zjfy9jFUIYOs+X gRaC9FyMg9StEkyxQWvtlES51DjzTg1WtMFbyR3H220w6TAYiooHb1dvsVJe1N1+ X-Rspamd-Queue-Id: 49Lmm23M2jz3FlN X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 05:37:38 -0000 Thank you Conrad. -- Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org The need of the many outweighs the greed of the few. In message , Conrad Meyer writes: > --000000000000a6fe4405a56be1bb > Content-Type: text/plain; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > > Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m back at a computer. > > Best, > Conrad > > On Mon, May 11, 2020 at 20:28 Cy Schubert wrote= > : > > > In message <202005112257.04BMvMx2096445@repo.freebsd.org>, Conrad Meyer > > writes: > > > Author: cem > > > Date: Mon May 11 22:57:21 2020 > > > New Revision: 360944 > > > URL: https://svnweb.freebsd.org/changeset/base/360944 > > > > > > Log: > > > copystr(9): Move to deprecate [2/2] > > > > > > Unlike the other copy*() functions, it does not serve to copy from on= > e > > > address space to another or protect against potential faults. It's > > just > > > an older incarnation of the now-more-common strlcpy(). > > > > > > Add a coccinelle script to tools/ which can be used to mechanically > > > convert existing instances where replacement with strlcpy is trivial. > > > In the two cases which matched, fuse_vfsops.c and union_vfsops.c, the > > > code was further refactored manually to simplify. > > > > > > Replace the declaration of copystr() in systm.h with a small macro > > > wrapper around strlcpy. > > > > > > Remove N redundant MI implementations of copystr. For MIPS, this > > > entailed inlining the assembler copystr into the only consumer, > > > copyinstr, and making the latter a leaf function. > > > > > > Reviewed by: jhb > > > Differential Revision: https://reviews.freebsd.org/D24672 > > > > > > Added: > > > head/tools/coccinelle/ > > > head/tools/coccinelle/copystr9.cocci (contents, props changed) > > > Deleted: > > > head/sys/arm64/arm64/copystr.c > > > head/sys/powerpc/powerpc/copystr.c > > > head/sys/riscv/riscv/copystr.c > > > Modified: > > > head/sys/amd64/amd64/support.S > > > head/sys/arm/arm/copystr.S > > > head/sys/fs/fuse/fuse_vfsops.c > > > head/sys/fs/unionfs/union_vfsops.c > > > head/sys/i386/i386/support.s > > > head/sys/kern/subr_csan.c > > > head/sys/mips/mips/support.S > > > head/sys/sys/systm.h > > > > > > > Hi Conrad, > > > > This is causing a failure to boot with geom_mirror: > > > > GEOM_MIRROR: Device mirror/gm0 launched (2/2). > > GEOM_MIRROR: Device mirror/gm1 launched (2/2). > > GEOM_MIRROR: Device mirror/gm2 launched (2/2). > > GEOM_MIRROR: Device mirror/gm3 launched (2/2). > > mountroot: waiting for device /dev/mirror/gm0a... > > Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 > > more > > seconds > > exec /sbin/init: error 20 > > exec /sbin/init.bak: error 20 > > exec /rescue/init: error 20 > > init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/ini= > t > > panic: no init > > cpuid =3D 1 > > time =3D 1589225852 > > KDB: stack backtrace: > > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame > > 0xfffffe004df51ba0 > > vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0 > > panic() at panic+0x43/frame 0xfffffe004df51c50 > > start_init() at start_init+0x23c/frame 0xfffffe004df51cf0 > > fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30 > > fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30 > > --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 --- > > Uptime: 9s > > acpi0: reset failed - timeout > > Automatic reboot in 15 seconds - press a key on the console to abort > > --> Press a key on the console to reboot, > > --> or switch off the system now. > > Rebooting... > > cpu_reset: Restarting BSP > > cpu_reset_proxy: Stopped CPU 1 > > > > > > Anticipating you might ask if r360941 is the problem. It is not. Revertin= > g > > this r360944 (not r360941) resolves the boot problem. System is amd64. > > > > > > -- > > Cheers, > > Cy Schubert > > FreeBSD UNIX: Web: https://FreeBSD.org > > NTP: Web: https://nwtime.org > > > > The need of the many outweighs the greed of the few. > > > > > > > > --000000000000a6fe4405a56be1bb > Content-Type: text/html; charset="UTF-8" > Content-Transfer-Encoding: quoted-printable > >
Thanks Cy. I=E2=80=99ll revert it when I=E2=80=99m b= > ack at a computer.

>Best,
Conrad=C2=A0

l_quote">
On Mon, May 11, 2020 at 20:2= > 8 Cy Schubert <Cy.Schubert@= > cschubert.com> wrote:
le=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">In mes= > sage < rget=3D"_blank">202005112257.04BMvMx2096445@repo.freebsd.org>, Conra= > d Meyer
> writes:
> > Author: cem
> > Date: Mon May 11 22:57:21 2020
> > New Revision: 360944
> > URL: =3D"noreferrer" target=3D"_blank">https://svnweb.freebsd.org/changeset/base= > /360944
> >
> > Log:
> >=C2=A0 =C2=A0copystr(9): Move to deprecate [2/2]
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Unlike the other copy*() functions, it does not serve to c= > opy from one
> >=C2=A0 =C2=A0address space to another or protect against potential faul= > ts.=C2=A0 It's just
> >=C2=A0 =C2=A0an older incarnation of the now-more-common strlcpy().
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Add a coccinelle script to tools/ which can be used to mec= > hanically
> >=C2=A0 =C2=A0convert existing instances where replacement with strlcpy = > is trivial.
> >=C2=A0 =C2=A0In the two cases which matched, fuse_vfsops.c and union_vf= > sops.c, the
> >=C2=A0 =C2=A0code was further refactored manually to simplify.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Replace the declaration of copystr() in systm.h with a sma= > ll macro
> >=C2=A0 =C2=A0wrapper around strlcpy.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Remove N redundant MI implementations of copystr.=C2=A0 Fo= > r MIPS, this
> >=C2=A0 =C2=A0entailed inlining the assembler copystr into the only cons= > umer,
> >=C2=A0 =C2=A0copyinstr, and making the latter a leaf function.
> >=C2=A0 =C2=A0
> >=C2=A0 =C2=A0Reviewed by:=C2=A0 =C2=A0 =C2=A0 =C2=A0 jhb
> >=C2=A0 =C2=A0Differential Revision:=C2=A0 =C2=A0 =C2=A0 s://reviews.freebsd.org/D24672" rel=3D"noreferrer" target=3D"_blank">https:= > //reviews.freebsd.org/D24672
> >
> > Added:
> >=C2=A0 =C2=A0head/tools/coccinelle/
> >=C2=A0 =C2=A0head/tools/coccinelle/copystr9.cocci=C2=A0 =C2=A0(contents= > , props changed)
> > Deleted:
> >=C2=A0 =C2=A0head/sys/arm64/arm64/copystr.c
> >=C2=A0 =C2=A0head/sys/powerpc/powerpc/copystr.c
> >=C2=A0 =C2=A0head/sys/riscv/riscv/copystr.c
> > Modified:
> >=C2=A0 =C2=A0head/sys/amd64/amd64/support.S
> >=C2=A0 =C2=A0head/sys/arm/arm/copystr.S
> >=C2=A0 =C2=A0head/sys/fs/fuse/fuse_vfsops.c
> >=C2=A0 =C2=A0head/sys/fs/unionfs/union_vfsops.c
> >=C2=A0 =C2=A0head/sys/i386/i386/support.s
> >=C2=A0 =C2=A0head/sys/kern/subr_csan.c
> >=C2=A0 =C2=A0head/sys/mips/mips/support.S
> >=C2=A0 =C2=A0head/sys/sys/systm.h
> >
>
> Hi Conrad,
>
> This is causing a failure to boot with geom_mirror:
>
> GEOM_MIRROR: Device mirror/gm0 launched (2/2).
> GEOM_MIRROR: Device mirror/gm1 launched (2/2).
> GEOM_MIRROR: Device mirror/gm2 launched (2/2).
> GEOM_MIRROR: Device mirror/gm3 launched (2/2).
> mountroot: waiting for device /dev/mirror/gm0a...
> Mounting from ufs:/dev/mirror/gm0a failed with error 2; retrying for 3 more= >
> seconds
> exec /sbin/init: error 20
> exec /sbin/init.bak: error 20
> exec /rescue/init: error 20
> init: not found in path /sbin/init:/sbin/oinit:/sbin/init.bak:/rescue/init<= > br> > panic: no init
> cpuid =3D 1
> time =3D 1589225852
> KDB: stack backtrace:
> db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
> 0xfffffe004df51ba0
> vpanic() at vpanic+0x182/frame 0xfffffe004df51bf0
> panic() at panic+0x43/frame 0xfffffe004df51c50
> start_init() at start_init+0x23c/frame 0xfffffe004df51cf0
> fork_exit() at fork_exit+0x7e/frame 0xfffffe004df51d30
> fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe004df51d30
> --- trap 0, rip =3D 0, rsp =3D 0, rbp =3D 0 ---
> Uptime: 9s
> acpi0: reset failed - timeout
> Automatic reboot in 15 seconds - press a key on the console to abort
> --> Press a key on the console to reboot,
> --> or switch off the system now.
> Rebooting...
> cpu_reset: Restarting BSP
> cpu_reset_proxy: Stopped CPU 1
>
>
> Anticipating you might ask if r360941 is the problem. It is not. Reverting = >
> this r360944 (not r360941) resolves the boot problem. System is amd64.
>
>
> --
> Cheers,
> Cy Schubert < nk">Cy.Schubert@cschubert.com>
> FreeBSD UNIX:=C2=A0 <cy@FreeBSD.org>=C2=A0 =C2=A0Web:=C2=A0 =3D"https://FreeBSD.org" rel=3D"noreferrer" target=3D"_blank">https://FreeB= > SD.org
> NTP:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0< e.org" target=3D"_blank">cy@nwtime.org>=C2=A0 =C2=A0 Web:=C2=A0 ref=3D"https://nwtime.org" rel=3D"noreferrer" target=3D"_blank">https://nwt= > ime.org
>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 The need of the many outweighs the greed of the= > few.
>
>
>
> > --000000000000a6fe4405a56be1bb-- From owner-svn-src-all@freebsd.org Tue May 12 09:04:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0C0F92E7501; Tue, 12 May 2020 09:04:58 +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 49LsMF6bZNz3wYG; Tue, 12 May 2020 09:04:57 +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 D930A58D8; Tue, 12 May 2020 09:04:57 +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 04C94v78074016; Tue, 12 May 2020 09:04:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C94veg074015; Tue, 12 May 2020 09:04:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005120904.04C94veg074015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 May 2020 09:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360956 - head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/cddl/contrib/opensolaris/cmd/zfs X-SVN-Commit-Revision: 360956 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:04:58 -0000 Author: avg Date: Tue May 12 09:04:57 2020 New Revision: 360956 URL: https://svnweb.freebsd.org/changeset/base/360956 Log: zfs allow/unallow should work with numeric uid/gid And that should work even (especially) if there is no matching user or group name. This change allows to see and modify delegations for deleted groups and users. The change is originally by Xin Li. illumos report: https://www.illumos.org/issues/6037 OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280 Obtained from: delphij MFC after: 2 weeks Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 12 04:34:26 2020 (r360955) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue May 12 09:04:57 2020 (r360956) @@ -4696,6 +4696,14 @@ parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl) (void) strlcpy( node->who_perm.who_ug_name, nice_name, 256); + else { + /* User or group unknown */ + (void) snprintf( + node->who_perm.who_ug_name, + sizeof ( + node->who_perm.who_ug_name), + "(unknown: %d)", rid); + } } uu_avl_insert(avl, node, idx); @@ -5194,9 +5202,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts * if (p != NULL) rid = p->pw_uid; - else { + else if (*endch != '\0') { (void) snprintf(errbuf, 256, gettext( - "invalid user %s"), curr); + "invalid user %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } else if (opts->group) { @@ -5208,9 +5216,9 @@ construct_fsacl_list(boolean_t un, struct allow_opts * if (g != NULL) rid = g->gr_gid; - else { + else if (*endch != '\0') { (void) snprintf(errbuf, 256, gettext( - "invalid group %s"), curr); + "invalid group %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } else { @@ -5236,7 +5244,7 @@ construct_fsacl_list(boolean_t un, struct allow_opts * rid = g->gr_gid; } else { (void) snprintf(errbuf, 256, gettext( - "invalid user/group %s"), curr); + "invalid user/group %s\n"), curr); allow_usage(un, B_TRUE, errbuf); } } From owner-svn-src-all@freebsd.org Tue May 12 09:31:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79BFD2E8089; Tue, 12 May 2020 09:31:49 +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 49LsyF2gGYz3yLY; Tue, 12 May 2020 09:31:49 +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 56D205E43; Tue, 12 May 2020 09:31:49 +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 04C9VnAH090636; Tue, 12 May 2020 09:31:49 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04C9Vn72090635; Tue, 12 May 2020 09:31:49 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005120931.04C9Vn72090635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 12 May 2020 09:31:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360957 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 360957 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:31:49 -0000 Author: avg Date: Tue May 12 09:31:48 2020 New Revision: 360957 URL: https://svnweb.freebsd.org/changeset/base/360957 Log: amd64/pmap: unbreak !NUMA case for fictitious pages A fictitious page can have a physical address beyond the end of the RAM. In the NUMA case there is some special code to handle such pages, but in the other case the pages are handled the same as normal pages. So, we cannot assert that the physical address is within RAM addresses. Suggested by: kib Reviewed by: kib X-MFC note: NUMA support has not been MFC-ed Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Tue May 12 09:04:57 2020 (r360956) +++ head/sys/amd64/amd64/pmap.c Tue May 12 09:31:48 2020 (r360957) @@ -323,12 +323,12 @@ pmap_pku_mask_bit(pmap_t pmap) #endif #undef pa_index +#ifdef NUMA #define pa_index(pa) ({ \ KASSERT((pa) <= vm_phys_segs[vm_phys_nsegs - 1].end, \ ("address %lx beyond the last segment", (pa))); \ (pa) >> PDRSHIFT; \ }) -#ifdef NUMA #define pa_to_pmdp(pa) (&pv_table[pa_index(pa)]) #define pa_to_pvh(pa) (&(pa_to_pmdp(pa)->pv_page)) #define PHYS_TO_PV_LIST_LOCK(pa) ({ \ @@ -340,6 +340,7 @@ pmap_pku_mask_bit(pmap_t pmap) _lock; \ }) #else +#define pa_index(pa) ((pa) >> PDRSHIFT) #define pa_to_pvh(pa) (&pv_table[pa_index(pa)]) #define NPV_LIST_LOCKS MAXCPU From owner-svn-src-all@freebsd.org Tue May 12 09:46:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 183702E8A9A; Tue, 12 May 2020 09:46:16 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49LtGv6H8Fz40b6; Tue, 12 May 2020 09:46:15 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id BC4EF6BE; Tue, 12 May 2020 05:46:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 12 May 2020 05:46:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=c XyCfI5TS/6XSfDDxtgBAuiWs0kvlVt4zCJ6R740SIU=; b=X80SXPf36mNh5ulGo QvBbLchX8+Xgjo/M4deu+WeL3tiAfsi6ugiU9MnAFxRKTz+NCfX1OziLG7iLpn7H a+/9OQjzy6umsIqPdIGB/6y4Dq4KQGXvdYBAsQbqB8pNzRobFgKTPl12I40mgoAj JRJcw94FqNAgHD9cbLOWE0NMB2fZHm59AJ5x7sp+8VMbMNZMsGyR40b2f5L15Nlj eGXcLzJm7kkd9qmW+dH1knCzC4W8wiu0KC+6isdhh9WUl4Ixw9Ga1NRsx9aN60aO kxm8G+93kRmusFT4f4+Ur7RdQS3Voou9AU/dWHhYHoC2kxFcbHjxjWbDHVwxUWLn aI5TQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=cXyCfI5TS/6XSfDDxtgBAuiWs0kvlVt4zCJ6R740S IU=; b=ijTse5/A4wdmOMAiPoklDFR/oWlgn90H7K1yNQcRLd1V104y1+oyHNLOV nuHShrwYZzqDZ7ac5qzhZtNpE/FZpCEoqQNXez0KWm91xV5fjFy1usUTsLyn7OPD 9Uxfichab1IzJraYiN7RNh9uOHxUBd4xmBOIl5b0iKsIRLyJPX7Gru2IhBV7H2Qr ATNCv5TZ+U8slHVu5vUWHSTiteopE9qmfnG+lp+xcnjvnx+J5W8sO8gc2kX+57f/ m5vidc24zeOHLNz+dK/DbWSO3PuaRPZ8L4OOM+bXgfwW4aMUcXZeDXZULU6WqN83 nt2nA36ftzNJH9dQTU6oYOMXDbAsw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrledvgddukecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthejre dttdefjeenucfhrhhomhepjghurhhiucfrrghnkhhovhcuoeihphgrnhhkohhvsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnheptdfgheehudeutdetteefjedvge dtvdelleejgfdvhfeujeejkeetjeeivdevleefnecuffhomhgrihhnpehfrhgvvggsshgu rdhorhhgpdhilhhluhhmohhsrdhorhhgpdhgihhthhhusgdrtghomhenucfkphepudejke drfeegrddutdefrdduhedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhephihprghnkhhovhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from [192.168.1.6] (unknown [178.34.103.151]) by mail.messagingengine.com (Postfix) with ESMTPA id 644BE30662BF; Tue, 12 May 2020 05:46:12 -0400 (EDT) Subject: Re: svn commit: r360956 - head/cddl/contrib/opensolaris/cmd/zfs To: Andriy Gapon , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005120904.04C94veg074015@repo.freebsd.org> From: Yuri Pankov Message-ID: <87ca8d3e-f26f-42bb-e913-3f8e017d0844@fastmail.com> Date: Tue, 12 May 2020 12:46:09 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005120904.04C94veg074015@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 49LtGv6H8Fz40b6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.998,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 09:46:16 -0000 Andriy Gapon wrote: > Author: avg > Date: Tue May 12 09:04:57 2020 > New Revision: 360956 > URL: https://svnweb.freebsd.org/changeset/base/360956 > > Log: > zfs allow/unallow should work with numeric uid/gid > > And that should work even (especially) if there is no matching user or > group name. This change allows to see and modify delegations for > deleted groups and users. > > The change is originally by Xin Li. > illumos report: https://www.illumos.org/issues/6037 > OpenZFS (ZoL) PR: https://github.com/openzfs/zfs/pull/10280 > > Obtained from: delphij > MFC after: 2 weeks Also, PR: 200663. From owner-svn-src-all@freebsd.org Tue May 12 11:18:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BB0352EAD4C; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@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 49LwK34W73z45Dj; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 95F0E71B2; Tue, 12 May 2020 11:18:15 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CBIFk2054573; Tue, 12 May 2020 11:18:15 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CBIFnn054571; Tue, 12 May 2020 11:18:15 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005121118.04CBIFnn054571@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Tue, 12 May 2020 11:18:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360958 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 360958 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 11:18:15 -0000 Author: afedorov Date: Tue May 12 11:18:14 2020 New Revision: 360958 URL: https://svnweb.freebsd.org/changeset/base/360958 Log: Add a new bhyve network backend that allow to connect the VM to the netgraph(4) network. The backend uses the socket API with the PF_NETGRAPH protocol family, which is provided by the ng_socket(4). To use the new backend, provide the following bhyve option: -s X:Y:Z,[virtio-net|e1000],netgraph,socket=[ng_socket name],path=[destination node],hook=[our socket src hook],peerhook=[dst node hook] Reviewed by: vmaffione, lutz_donnerhacke.de Approved by: vmaffione (mentor) Sponsored by: vstack.com Differential Revision: https://reviews.freebsd.org/D24620 Modified: head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/net_backends.c Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Tue May 12 09:31:48 2020 (r360957) +++ head/usr.sbin/bhyve/Makefile Tue May 12 11:18:14 2020 (r360958) @@ -90,6 +90,10 @@ CFLAGS+=-DINET .if ${MK_INET6_SUPPORT} != "no" CFLAGS+=-DINET6 .endif +.if ${MK_NETGRAPH_SUPPORT} != "no" +CFLAGS+=-DNETGRAPH +LIBADD+= netgraph +.endif .if ${MK_OPENSSL} == "no" CFLAGS+=-DNO_OPENSSL .else Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Tue May 12 09:31:48 2020 (r360957) +++ head/usr.sbin/bhyve/net_backends.c Tue May 12 11:18:14 2020 (r360958) @@ -69,6 +69,11 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef NETGRAPH +#include +#include +#include +#endif #include "debug.h" #include "iov.h" @@ -382,6 +387,194 @@ static struct net_backend vmnet_backend = { DATA_SET(net_backend_set, tap_backend); DATA_SET(net_backend_set, vmnet_backend); + +#ifdef NETGRAPH + +/* + * Netgraph backend + */ + +#define NG_SBUF_MAX_SIZE (4 * 1024 * 1024) + +static int +ng_init(struct net_backend *be, const char *devname, + const char *opts, net_be_rxeof_t cb, void *param) +{ + struct tap_priv *p = (struct tap_priv *)be->opaque; + struct ngm_connect ngc; + char *ngopts, *tofree; + char nodename[NG_NODESIZ]; + int sbsz; + int ctrl_sock; + int flags; + int path_provided; + int peerhook_provided; + int socket_provided; + unsigned long maxsbsz; + size_t msbsz; +#ifndef WITHOUT_CAPSICUM + cap_rights_t rights; +#endif + + if (cb == NULL) { + WPRINTF(("Netgraph backend requires non-NULL callback")); + return (-1); + } + + be->fd = -1; + + memset(&ngc, 0, sizeof(ngc)); + + strncpy(ngc.ourhook, "vmlink", NG_HOOKSIZ - 1); + + tofree = ngopts = strdup(opts); + + if (ngopts == NULL) { + WPRINTF(("strdup error")); + return (-1); + } + + socket_provided = 0; + path_provided = 0; + peerhook_provided = 0; + + (void)strsep(&ngopts, ","); + + while (ngopts != NULL) { + char *value = ngopts; + char *key; + + key = strsep(&value, "="); + if (value == NULL) + break; + ngopts = value; + (void) strsep(&ngopts, ","); + + if (strcmp(key, "socket") == 0) { + strncpy(nodename, value, NG_NODESIZ - 1); + socket_provided = 1; + } else if (strcmp(key, "path") == 0) { + strncpy(ngc.path, value, NG_PATHSIZ - 1); + path_provided = 1; + } else if (strcmp(key, "hook") == 0) { + strncpy(ngc.ourhook, value, NG_HOOKSIZ - 1); + } else if (strcmp(key, "peerhook") == 0) { + strncpy(ngc.peerhook, value, NG_HOOKSIZ - 1); + peerhook_provided = 1; + } + } + + free(tofree); + + if (!path_provided) { + WPRINTF(("path must be provided")); + return (-1); + } + + if (!peerhook_provided) { + WPRINTF(("peer hook must be provided")); + return (-1); + } + + if (NgMkSockNode(socket_provided ? nodename : NULL, + &ctrl_sock, &be->fd) < 0) { + WPRINTF(("can't get Netgraph sockets")); + return (-1); + } + + if (NgSendMsg(ctrl_sock, ".", + NGM_GENERIC_COOKIE, + NGM_CONNECT, &ngc, sizeof(ngc)) < 0) { + WPRINTF(("can't connect to node")); + close(ctrl_sock); + goto error; + } + + close(ctrl_sock); + + flags = fcntl(be->fd, F_GETFL); + + if (flags < 0) { + WPRINTF(("can't get socket flags")); + goto error; + } + + if (fcntl(be->fd, F_SETFL, flags | O_NONBLOCK) < 0) { + WPRINTF(("can't set O_NONBLOCK flag")); + goto error; + } + + /* + * The default ng_socket(4) buffer's size is too low. + * Calculate the minimum value between NG_SBUF_MAX_SIZE + * and kern.ipc.maxsockbuf. + */ + msbsz = sizeof(maxsbsz); + if (sysctlbyname("kern.ipc.maxsockbuf", &maxsbsz, &msbsz, + NULL, 0) < 0) { + WPRINTF(("can't get 'kern.ipc.maxsockbuf' value")); + goto error; + } + + /* + * We can't set the socket buffer size to kern.ipc.maxsockbuf value, + * as it takes into account the mbuf(9) overhead. + */ + maxsbsz = maxsbsz * MCLBYTES / (MSIZE + MCLBYTES); + + sbsz = MIN(NG_SBUF_MAX_SIZE, maxsbsz); + + if (setsockopt(be->fd, SOL_SOCKET, SO_SNDBUF, &sbsz, + sizeof(sbsz)) < 0) { + WPRINTF(("can't set TX buffer size")); + goto error; + } + + if (setsockopt(be->fd, SOL_SOCKET, SO_RCVBUF, &sbsz, + sizeof(sbsz)) < 0) { + WPRINTF(("can't set RX buffer size")); + goto error; + } + +#ifndef WITHOUT_CAPSICUM + cap_rights_init(&rights, CAP_EVENT, CAP_READ, CAP_WRITE); + if (caph_rights_limit(be->fd, &rights) == -1) + errx(EX_OSERR, "Unable to apply rights for sandbox"); +#endif + + memset(p->bbuf, 0, sizeof(p->bbuf)); + p->bbuflen = 0; + + p->mevp = mevent_add_disabled(be->fd, EVF_READ, cb, param); + if (p->mevp == NULL) { + WPRINTF(("Could not register event")); + goto error; + } + + return (0); + +error: + tap_cleanup(be); + return (-1); +} + +static struct net_backend ng_backend = { + .prefix = "netgraph", + .priv_size = sizeof(struct tap_priv), + .init = ng_init, + .cleanup = tap_cleanup, + .send = tap_send, + .peek_recvlen = tap_peek_recvlen, + .recv = tap_recv, + .recv_enable = tap_recv_enable, + .recv_disable = tap_recv_disable, + .get_cap = tap_get_cap, + .set_cap = tap_set_cap, +}; + +DATA_SET(net_backend_set, ng_backend); + +#endif /* NETGRAPH */ /* * The netmap backend From owner-svn-src-all@freebsd.org Tue May 12 12:29:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA8B22EDB7F; Tue, 12 May 2020 12:29:39 +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 49LxvR507Hz4C5m; Tue, 12 May 2020 12:29:39 +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 A20D97F17; Tue, 12 May 2020 12:29:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CCTdwF097671; Tue, 12 May 2020 12:29:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CCTdg6097670; Tue, 12 May 2020 12:29:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005121229.04CCTdg6097670@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 May 2020 12:29: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: r360959 - stable/12/share/man/man3 X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/share/man/man3 X-SVN-Commit-Revision: 360959 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 12:29:39 -0000 Author: kib Date: Tue May 12 12:29:39 2020 New Revision: 360959 URL: https://svnweb.freebsd.org/changeset/base/360959 Log: MFC r360844: Document BUS_OOMERR. Modified: stable/12/share/man/man3/siginfo.3 Directory Properties: stable/12/ (props changed) Modified: stable/12/share/man/man3/siginfo.3 ============================================================================== --- stable/12/share/man/man3/siginfo.3 Tue May 12 11:18:14 2020 (r360958) +++ stable/12/share/man/man3/siginfo.3 Tue May 12 12:29:39 2020 (r360959) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 24, 2018 +.Dd May 8, 2020 .Dt SIGINFO 3 .Os .Sh NAME @@ -150,6 +150,8 @@ invalid address alignment nonexistent physical address .It Ta Dv BUS_OBJERR Ta object-specific hardware error +.It Ta Dv BUS_OOMERR Ta +cannot alloc a page to map at fault .It Dv SIGTRAP Ta Dv TRAP_BRKPT Ta process breakpoint .It Ta Dv TRAP_TRACE Ta From owner-svn-src-all@freebsd.org Tue May 12 13:23:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 491512EEF6E; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@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 49Lz5W1ZVNz4FqR; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 30E8B8A31; Tue, 12 May 2020 13:23:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CDNRWv033959; Tue, 12 May 2020 13:23:27 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CDNP5w033951; Tue, 12 May 2020 13:23:25 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005121323.04CDNP5w033951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 12 May 2020 13:23:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360960 - in head/sys/fs: nfs nfsclient nfsserver X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient nfsserver X-SVN-Commit-Revision: 360960 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 13:23:27 -0000 Author: freqlabs Date: Tue May 12 13:23:25 2020 New Revision: 360960 URL: https://svnweb.freebsd.org/changeset/base/360960 Log: nfs: Remove APPLESTATIC macro It is no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) MFC after: 1 week Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24811 Modified: head/sys/fs/nfs/nfs_commonacl.c head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfs/nfsport.h head/sys/fs/nfsclient/nfs_clcomsubs.c head/sys/fs/nfsclient/nfs_clport.c head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c head/sys/fs/nfsserver/nfs_nfsdcache.c head/sys/fs/nfsserver/nfs_nfsdserv.c head/sys/fs/nfsserver/nfs_nfsdsocket.c head/sys/fs/nfsserver/nfs_nfsdstate.c head/sys/fs/nfsserver/nfs_nfsdsubs.c Modified: head/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- head/sys/fs/nfs/nfs_commonacl.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfs_commonacl.c Tue May 12 13:23:25 2020 (r360960) @@ -40,7 +40,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_in /* * Handle xdr for an ace. */ -APPLESTATIC int +int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, int *aceerrp, int *acesizep, NFSPROC_T *p) { @@ -388,7 +388,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name /* * Build an NFSv4 ACL. */ -APPLESTATIC int +int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, NFSPROC_T *p) { @@ -451,7 +451,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ -APPLESTATIC int +int nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) { int i; Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfs_commonsubs.c Tue May 12 13:23:25 2020 (r360960) @@ -314,7 +314,7 @@ static int nfs_bigrequest[NFSV42_NPROCS] = { * Start building a request. Mostly just put the first file handle in * place. */ -APPLESTATIC void +void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep, int vers, int minorvers) @@ -453,7 +453,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, /* * Put a state Id in the mbuf list. */ -APPLESTATIC void +void nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) { nfsv4stateid_t *st; @@ -689,7 +689,7 @@ out: * This is used by the macro NFSM_DISSECT for tough * cases. */ -APPLESTATIC void * +void * nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { struct mbuf *mp2; @@ -755,7 +755,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho * here than check for offs > 0 for all calls to nfsm_advance. * If left == -1, it should be calculated here. */ -APPLESTATIC int +int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { int error = 0; @@ -803,7 +803,7 @@ out: * Copy a string into mbuf(s). * Return the number of bytes output, including XDR overheads. */ -APPLESTATIC int +int nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) { struct mbuf *m2; @@ -860,7 +860,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, /* * Called once to initialize data structures... */ -APPLESTATIC void +void newnfs_init(void) { static int nfs_inited = 0; @@ -890,7 +890,7 @@ newnfs_init(void) * set_true == 1 if there should be an newnfs_true prepended on the file handle. * Return the number of bytes output, including XDR overhead. */ -APPLESTATIC int +int nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) { u_int32_t *tl; @@ -933,7 +933,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ -APPLESTATIC int +int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { #ifdef INET @@ -970,7 +970,7 @@ nfsaddr_match(int family, union nethostaddr *haddr, NF /* * Similar to the above, but takes to NFSSOCKADDR_T args. */ -APPLESTATIC int +int nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) { struct sockaddr_in *addr1, *addr2; @@ -1007,7 +1007,7 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) /* * Trim trailing data off the mbuf list being built. */ -APPLESTATIC void +void newnfs_trimtrailing(nd, mb, bpos) struct nfsrv_descript *nd; struct mbuf *mb; @@ -1026,7 +1026,7 @@ newnfs_trimtrailing(nd, mb, bpos) /* * Dissect a file handle on the client. */ -APPLESTATIC int +int nfsm_getfh(struct nfsrv_descript *nd, struct nfsfh **nfhpp) { u_int32_t *tl; @@ -1061,7 +1061,7 @@ nfsmout: * Break down the nfsv4 acl. * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ -APPLESTATIC int +int nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) { @@ -1127,7 +1127,7 @@ nfsmout: * Returns EBADRPC for a parsing error, 0 otherwise. * If the clearinvalid flag is set, clear the bits not supported. */ -APPLESTATIC int +int nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, int *retnotsupp) { @@ -1173,7 +1173,7 @@ nfsmout: * and 0 otherwise. * Returns EBADRPC if it can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nap, struct nfsfh **nfhpp, fhandle_t *fhp, int fhsize, struct nfsv3_pathconf *pc, struct statfs *sbp, struct nfsstatfs *sfp, @@ -2217,7 +2217,7 @@ nfsmout: * and the mp argument indicates to check for a forced dismount, iff not * NULL. */ -APPLESTATIC int +int nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp, void *mutex, struct mount *mp) { @@ -2264,7 +2264,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i * The second argument is set to 1 to indicate the nfslock_usecnt should be * incremented, as well. */ -APPLESTATIC void +void nfsv4_unlock(struct nfsv4lock *lp, int incref) { @@ -2277,7 +2277,7 @@ nfsv4_unlock(struct nfsv4lock *lp, int incref) /* * Release a reference cnt. */ -APPLESTATIC void +void nfsv4_relref(struct nfsv4lock *lp) { @@ -2297,7 +2297,7 @@ nfsv4_relref(struct nfsv4lock *lp) * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ -APPLESTATIC void +void nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex, struct mount *mp) { @@ -2327,7 +2327,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Get a reference as above, but return failure instead of sleeping if * an exclusive lock is held. */ -APPLESTATIC int +int nfsv4_getref_nonblock(struct nfsv4lock *lp) { @@ -2341,7 +2341,7 @@ nfsv4_getref_nonblock(struct nfsv4lock *lp) /* * Test for a lock. Return 1 if locked, 0 otherwise. */ -APPLESTATIC int +int nfsv4_testlock(struct nfsv4lock *lp) { @@ -2369,7 +2369,7 @@ nfsv4_wanted(struct nfsv4lock *lp) * Return EBADRPC if there is an mbuf error, * 0 otherwise. */ -APPLESTATIC int +int nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz) { char *cp; @@ -2420,7 +2420,7 @@ out: /* * Fill in the attributes as marked by the bitmap (V4). */ -APPLESTATIC int +int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, @@ -3000,7 +3000,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * Put the attribute bits onto an mbuf list. * Return the number of bytes of output generated. */ -APPLESTATIC int +int nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp) { u_int32_t *tl; @@ -3025,7 +3025,7 @@ nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp) { int i; @@ -3182,7 +3182,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp) { int i; @@ -3284,7 +3284,7 @@ out: * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp) { int i; @@ -3396,7 +3396,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp) { int i; @@ -3521,7 +3521,7 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len) /* * Set the port for the nfsuserd. */ -APPLESTATIC int +int nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) { struct nfssockreq *rp; @@ -3604,7 +3604,7 @@ out: /* * Delete the nfsuserd port. */ -APPLESTATIC void +void nfsrv_nfsuserddelport(void) { @@ -3691,7 +3691,7 @@ out: * This function is called from the nfssvc(2) system call, to update the * kernel user/group name list(s) for the V4 owner and ownergroup attributes. */ -APPLESTATIC int +int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; @@ -4084,7 +4084,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * running, since it doesn't do any locking. * This function is meant to be used when the nfscommon module is unloaded. */ -APPLESTATIC void +void nfsrv_cleanusergroup(void) { struct nfsrv_lughash *hp, *hp2; @@ -4131,7 +4131,7 @@ nfsrv_cleanusergroup(void) * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ -APPLESTATIC int +int nfsrv_checkutf8(u_int8_t *cp, int len) { u_int32_t val = 0x0; @@ -4384,7 +4384,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char ** /* * Initialize the reply header data structures. */ -APPLESTATIC void +void nfsrvd_rephead(struct nfsrv_descript *nd) { struct mbuf *mreq; @@ -4449,7 +4449,7 @@ newnfs_sndunlock(int *flagp) NFSUNLOCKSOCK(); } -APPLESTATIC int +int nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_in *sin, struct sockaddr_in6 *sin6, sa_family_t *saf, int *isudp) { @@ -4630,7 +4630,7 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -APPLESTATIC void +void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, struct nfsclsession *sep, int dont_replycache) { @@ -4738,7 +4738,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc /* * Free a session slot. */ -APPLESTATIC void +void nfsv4_freeslot(struct nfsclsession *sep, int slot) { uint64_t bitval; Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfs/nfsport.h Tue May 12 13:23:25 2020 (r360960) @@ -103,11 +103,6 @@ #include #include -/* - * For Darwin, these functions should be "static" when built in a kext. - * (This is always defined as nil otherwise.) - */ -#define APPLESTATIC #include #include #include Modified: head/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 12 13:23:25 2020 (r360960) @@ -55,7 +55,7 @@ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ -APPLESTATIC void +void nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; @@ -206,7 +206,7 @@ nfsm_uiombuflist(struct uio *uiop, int siz, struct mbu * Load vnode attributes from the xdr file attributes. * Returns EBADRPC if they can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvattr *nap) { struct nfs_fattr *fp; @@ -273,7 +273,7 @@ nfsmout: * This function finds the directory cookie that corresponds to the * logical byte offset given. */ -APPLESTATIC nfsuint64 * +nfsuint64 * nfscl_getcookie(struct nfsnode *np, off_t off, int add) { struct nfsdmap *dp, *dp2; @@ -325,7 +325,7 @@ nfscl_getcookie(struct nfsnode *np, off_t off, int add * the file handle and the file's attributes. * For V4, it assumes that Getfh and Getattr Op's results are here. */ -APPLESTATIC int +int nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh **nfhpp, struct nfsvattr *nap, int *attrflagp) { @@ -386,7 +386,7 @@ nfsmout: /* * Initialize the owner/delegation sleep lock. */ -APPLESTATIC void +void nfscl_lockinit(struct nfsv4lock *lckp) { @@ -398,7 +398,7 @@ nfscl_lockinit(struct nfsv4lock *lckp) * Get an exclusive lock. (Not needed for OpenBSD4, since there is only one * thread for each posix process in the kernel.) */ -APPLESTATIC void +void nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) { int igotlock; @@ -411,7 +411,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) /* * Release an exclusive lock. */ -APPLESTATIC void +void nfscl_lockunlock(struct nfsv4lock *lckp) { @@ -421,7 +421,7 @@ nfscl_lockunlock(struct nfsv4lock *lckp) /* * Called to derefernce a lock on a stateid (delegation or open owner). */ -APPLESTATIC void +void nfscl_lockderef(struct nfsv4lock *lckp) { Modified: head/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clport.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clport.c Tue May 12 13:23:25 2020 (r360960) @@ -1108,7 +1108,7 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *n * error should only be returned for the Open, Create and Setattr Ops. * As such, most calls can just pass in 0 for those arguments. */ -APPLESTATIC int +int nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid) { struct proc *p; Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Tue May 12 13:23:25 2020 (r360960) @@ -226,7 +226,7 @@ int nfs_pnfsio(task_fn_t *, void *); /* * nfs null call from vfs. */ -APPLESTATIC int +int nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) { int error; @@ -245,7 +245,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T * For nfs version 3 and 4, use the access rpc to check accessibility. If file * modes are changed on the server, accesses might still fail later. */ -APPLESTATIC int +int nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) { @@ -288,7 +288,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cr /* * The actual rpc, separated out for Darwin. */ -APPLESTATIC int +int nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep, void *stuff) @@ -349,7 +349,7 @@ nfsmout: /* * nfs open rpc */ -APPLESTATIC int +int nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) { struct nfsclopen *op; @@ -481,7 +481,7 @@ else printf(" fhl=0\n"); /* * the actual open rpc */ -APPLESTATIC int +int nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, u_int8_t *newfhp, int newfhlen, u_int32_t mode, struct nfsclopen *op, u_int8_t *name, int namelen, struct nfscldeleg **dpp, @@ -684,7 +684,7 @@ nfsmout: /* * open downgrade rpc */ -APPLESTATIC int +int nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -727,7 +727,7 @@ nfsmout: /* * V4 Close operation. */ -APPLESTATIC int +int nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) { struct nfsclclient *clp; @@ -749,7 +749,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -APPLESTATIC void +void nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; @@ -846,7 +846,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen /* * The actual Close RPC. */ -APPLESTATIC int +int nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p, int syscred) @@ -885,7 +885,7 @@ nfsmout: /* * V4 Open Confirm RPC. */ -APPLESTATIC int +int nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -928,7 +928,7 @@ nfsmout: * Do the setclientid and setclientid confirm RPCs. Called from nfs_statfs() * when a mount has just occurred and when the server replies NFSERR_EXPIRED. */ -APPLESTATIC int +int nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, bool *retokp, struct ucred *cred, NFSPROC_T *p) { @@ -1184,7 +1184,7 @@ nfsmout: /* * nfs getattr call. */ -APPLESTATIC int +int nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, void *stuff) { @@ -1211,7 +1211,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC /* * nfs getattr call with non-vnode arguemnts. */ -APPLESTATIC int +int nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, u_int64_t *xidp, uint32_t *leasep) @@ -1251,7 +1251,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp /* * Do an nfs setattr operation. */ -APPLESTATIC int +int nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp, void *stuff) @@ -1378,7 +1378,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, /* * nfs lookup rpc */ -APPLESTATIC int +int nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *stuff) @@ -1481,7 +1481,7 @@ nfsmout: /* * Do a readlink rpc. */ -APPLESTATIC int +int nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1537,7 +1537,7 @@ nfsmout: /* * Read operation. */ -APPLESTATIC int +int nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1695,7 +1695,7 @@ nfsmout: * the recovery thread could get stuck waiting for the buffer and recovery * will then deadlock. */ -APPLESTATIC int +int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff, int called_from_strategy) @@ -1960,7 +1960,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -APPLESTATIC int +int nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, u_int32_t rdev, enum vtype vtyp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2040,7 +2040,7 @@ nfsmout: * Mostly just call the approriate routine. (I separated out v4, so that * error recovery wouldn't be as difficult.) */ -APPLESTATIC int +int nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, nfsquad_t cverf, int fmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2407,7 +2407,7 @@ nfsmout: /* * Nfs remove rpc */ -APPLESTATIC int +int nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) @@ -2484,7 +2484,7 @@ nfsmout: /* * Do an nfs rename rpc. */ -APPLESTATIC int +int nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, @@ -2642,7 +2642,7 @@ nfsmout: /* * nfs hard link create rpc */ -APPLESTATIC int +int nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, int *attrflagp, int *dattrflagp, void *dstuff) @@ -2705,7 +2705,7 @@ nfsmout: /* * nfs symbolic link create rpc */ -APPLESTATIC int +int nfsrpc_symlink(vnode_t dvp, char *name, int namelen, const char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2766,7 +2766,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c /* * nfs make dir rpc */ -APPLESTATIC int +int nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2848,7 +2848,7 @@ nfsmout: /* * nfs remove directory call */ -APPLESTATIC int +int nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) { @@ -2904,7 +2904,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str * and returns the one for the next entry after this directory block in * there, as well. */ -APPLESTATIC int +int nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3351,7 +3351,7 @@ nfsmout: * (Also used for NFS V4 when mount flag set.) * (ditto above w.r.t. multiple of DIRBLKSIZ, etc.) */ -APPLESTATIC int +int nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3860,7 +3860,7 @@ nfsmout: /* * Nfs commit rpc */ -APPLESTATIC int +int nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -3911,7 +3911,7 @@ nfsmout: * NFS byte range lock rpc. * (Mostly just calls one of the three lower level RPC routines.) */ -APPLESTATIC int +int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -4078,7 +4078,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct /* * The lower level routine for the LockT case. */ -APPLESTATIC int +int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) @@ -4203,7 +4203,7 @@ nfsmout: /* * The actual Lock RPC. */ -APPLESTATIC int +int nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfscllockowner *lp, int newone, int reclaim, u_int64_t off, u_int64_t len, short type, struct ucred *cred, @@ -4292,7 +4292,7 @@ nfsmout: * nfs statfs rpc * (always called with the vp for the mount point) */ -APPLESTATIC int +int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4371,7 +4371,7 @@ nfsmout: /* * nfs pathconf rpc */ -APPLESTATIC int +int nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4432,7 +4432,7 @@ nfsmout: /* * nfs version 3 fsinfo rpc call */ -APPLESTATIC int +int nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -4471,7 +4471,7 @@ nfsmout: /* * This function performs the Renew RPC. */ -APPLESTATIC int +int nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, NFSPROC_T *p) { @@ -4525,7 +4525,7 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * /* * This function performs the Releaselockowner RPC. */ -APPLESTATIC int +int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { @@ -4564,7 +4564,7 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo /* * This function performs the Compound to get the mount pt FH. */ -APPLESTATIC int +int nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, NFSPROC_T *p) { @@ -4633,7 +4633,7 @@ nfsmout: /* * This function performs the Delegreturn RPC. */ -APPLESTATIC int +int nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, struct nfsmount *nmp, NFSPROC_T *p, int syscred) { @@ -4666,7 +4666,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred /* * nfs getacl call. */ -APPLESTATIC int +int nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -4696,7 +4696,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ /* * nfs setacl call. */ -APPLESTATIC int +int nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -6829,7 +6829,7 @@ nfsio_commitds(vnode_t vp, uint64_t offset, int cnt, s /* * NFS Advise rpc */ -APPLESTATIC int +int nfsrpc_advise(vnode_t vp, off_t offset, uint64_t cnt, int advise, struct ucred *cred, NFSPROC_T *p) { @@ -6970,7 +6970,7 @@ nfsio_adviseds(vnode_t vp, uint64_t offset, int cnt, i /* * Do the Allocate operation, retrying for recovery. */ -APPLESTATIC int +int nfsrpc_allocate(vnode_t vp, off_t off, off_t len, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p, void *stuff) { @@ -8077,7 +8077,7 @@ out: /* * nfs copy_file_range operation. */ -APPLESTATIC int +int nfsrpc_copy_file_range(vnode_t invp, off_t *inoffp, vnode_t outvp, off_t *outoffp, size_t *lenp, unsigned int flags, int *inattrflagp, struct nfsvattr *innap, int *outattrflagp, struct nfsvattr *outnap, @@ -8271,7 +8271,7 @@ nfsmout: /* * Seek operation. */ -APPLESTATIC int +int nfsrpc_seek(vnode_t vp, off_t *offp, bool *eofp, int content, struct ucred *cred, struct nfsvattr *nap, int *attrflagp) { @@ -8365,7 +8365,7 @@ nfsmout: /* * The getextattr RPC. */ -APPLESTATIC int +int nfsrpc_getextattr(vnode_t vp, const char *name, struct uio *uiop, ssize_t *lenp, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8436,7 +8436,7 @@ nfsmout: /* * The setextattr RPC. */ -APPLESTATIC int +int nfsrpc_setextattr(vnode_t vp, const char *name, struct uio *uiop, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8484,7 +8484,7 @@ nfsmout: /* * The removeextattr RPC. */ -APPLESTATIC int +int nfsrpc_rmextattr(vnode_t vp, const char *name, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) { @@ -8522,7 +8522,7 @@ nfsmout: /* * The listextattr RPC. */ -APPLESTATIC int +int nfsrpc_listextattr(vnode_t vp, uint64_t *cookiep, struct uio *uiop, size_t *lenp, bool *eofp, struct nfsvattr *nap, int *attrflagp, struct ucred *cred, NFSPROC_T *p) Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue May 12 12:29:39 2020 (r360959) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue May 12 13:23:25 2020 (r360960) @@ -209,7 +209,7 @@ static short *nfscl_cberrmap[] = { * Called for an open operation. * If the nfhp argument is NULL, just get an openowner. */ -APPLESTATIC int +int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, struct nfsclopen **opp, int *newonep, int *retp, int lockit) @@ -425,7 +425,7 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldel /* * Called to find/add a delegation to a client. */ -APPLESTATIC int +int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { @@ -496,7 +496,7 @@ nfscl_finddeleg(struct nfsclclient *clp, u_int8_t *fhp * found, return either a lockowner stateid or the open stateid. * If no Open is found, just return error and the special stateid of all zeros. */ -APPLESTATIC int +int nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, int fords, struct ucred *cred, NFSPROC_T *p, nfsv4stateid_t *stateidp, void **lckpp) @@ -720,7 +720,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nf * Release use of an open owner. Called when open operations are done * with the open owner. */ -APPLESTATIC void +void nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, __unused int error, __unused int candelete, int unlocked) { @@ -741,7 +741,7 @@ nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclo /* * Release use of an open structure under an open owner. */ -APPLESTATIC void +void nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, int candelete) { @@ -775,7 +775,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclop * thread if this creates a new clp. * It always clpp with a reference count on it, unless returning an error. */ -APPLESTATIC int +int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, int start_renewthread, struct nfsclclient **clpp) { @@ -938,7 +938,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP /* * Get a reference to a clientid and return it, if valid. */ -APPLESTATIC struct nfsclclient * +struct nfsclclient * nfscl_findcl(struct nfsmount *nmp) { struct nfsclclient *clp; @@ -965,7 +965,7 @@ nfscl_clrelease(struct nfsclclient *clp) /* * External call for nfscl_clrelease. */ -APPLESTATIC void +void nfscl_clientrelease(struct nfsclclient *clp) { @@ -980,7 +980,7 @@ nfscl_clientrelease(struct nfsclclient *clp) /* * Called when wanting to lock a byte region. */ -APPLESTATIC int +int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, @@ -1180,7 +1180,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Called to unlock a byte range, for LockU. */ -APPLESTATIC int +int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, struct nfsclclient *clp, void *id, int flags, @@ -1292,7 +1292,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Release all lockowners marked in progess for this process and file. */ -APPLESTATIC void +void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { @@ -1330,7 +1330,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t * is required before a LockU. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 12 14:01:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EEFF2F07E8; Tue, 12 May 2020 14:01:13 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Lzx46h7nz4HVj; Tue, 12 May 2020 14:01:12 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C886C915A; Tue, 12 May 2020 14:01:12 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CE1CdZ053554; Tue, 12 May 2020 14:01:12 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CE1CwB053553; Tue, 12 May 2020 14:01:12 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005121401.04CE1CwB053553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 12 May 2020 14:01:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360961 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360961 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 14:01:13 -0000 Author: gallatin Date: Tue May 12 14:01:12 2020 New Revision: 360961 URL: https://svnweb.freebsd.org/changeset/base/360961 Log: IPv6: sync IP_NO_SND_TAG_RL support from IPv4 The IP_NO_SND_TAG_RL flag to ip{,6}_output() means that the packets being sent should bypass hardware rate limiting. This is typically used by modern TCP stacks for rexmits. This support was added to IPv4 in r352657, but never added to IPv6, even though rack and bbr call ip6_output() with this flag. Reviewed by: rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24822 Modified: head/sys/netinet6/ip6_output.c Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Tue May 12 13:23:25 2020 (r360960) +++ head/sys/netinet6/ip6_output.c Tue May 12 14:01:12 2020 (r360961) @@ -322,7 +322,8 @@ ip6_fragment(struct ifnet *ifp, struct mbuf *m0, int h static int ip6_output_send(struct inpcb *inp, struct ifnet *ifp, struct ifnet *origifp, - struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro) + struct mbuf *m, struct sockaddr_in6 *dst, struct route_in6 *ro, + bool stamp_tag) { #ifdef KERN_TLS struct ktls_session *tls = NULL; @@ -353,6 +354,10 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, error = EAGAIN; goto done; } + /* + * Always stamp tags that include NIC ktls. + */ + stamp_tag = true; } #endif #ifdef RATELIMIT @@ -366,7 +371,7 @@ ip6_output_send(struct inpcb *inp, struct ifnet *ifp, mst = inp->inp_snd_tag; } #endif - if (mst != NULL) { + if (stamp_tag && mst != NULL) { KASSERT(m->m_pkthdr.rcvif == NULL, ("trying to add a send tag to a forwarded packet")); if (mst->ifp != ifp) { @@ -1165,7 +1170,8 @@ passout: m->m_pkthdr.len); ifa_free(&ia6->ia_ifa); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + (flags & IP_NO_SND_TAG_RL) ? false : true); goto done; } @@ -1256,7 +1262,8 @@ sendorfree: counter_u64_add(ia->ia_ifa.ifa_obytes, m->m_pkthdr.len); } - error = ip6_output_send(inp, ifp, origifp, m, dst, ro); + error = ip6_output_send(inp, ifp, origifp, m, dst, ro, + true); } else m_freem(m); } From owner-svn-src-all@freebsd.org Tue May 12 14:01:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE0DE2F0804; Tue, 12 May 2020 14:01:14 +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 49Lzx64KD7z4HVn; Tue, 12 May 2020 14:01:14 +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 8F6F3915D; Tue, 12 May 2020 14:01:14 +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 04CE1E1b053601; Tue, 12 May 2020 14:01:14 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CE1EEj053600; Tue, 12 May 2020 14:01:14 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121401.04CE1EEj053600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 14:01: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: r360962 - 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: 360962 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 14:01:14 -0000 Author: markj Date: Tue May 12 14:01:14 2020 New Revision: 360962 URL: https://svnweb.freebsd.org/changeset/base/360962 Log: MFC r360438: Make sendfile(SF_SYNC)'s CV wait interruptible. Modified: stable/12/sys/kern/kern_sendfile.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_sendfile.c ============================================================================== --- stable/12/sys/kern/kern_sendfile.c Tue May 12 14:01:12 2020 (r360961) +++ stable/12/sys/kern/kern_sendfile.c Tue May 12 14:01:14 2020 (r360962) @@ -95,8 +95,36 @@ struct sendfile_sync { struct mtx mtx; struct cv cv; unsigned count; + bool waiting; }; +static void +sendfile_sync_destroy(struct sendfile_sync *sfs) +{ + KASSERT(sfs->count == 0, ("sendfile sync %p still busy", sfs)); + + cv_destroy(&sfs->cv); + mtx_destroy(&sfs->mtx); + free(sfs, M_SENDFILE); +} + +static void +sendfile_sync_signal(struct sendfile_sync *sfs) +{ + mtx_lock(&sfs->mtx); + KASSERT(sfs->count > 0, ("sendfile sync %p not busy", sfs)); + if (--sfs->count == 0) { + if (!sfs->waiting) { + /* The sendfile() waiter was interrupted by a signal. */ + sendfile_sync_destroy(sfs); + return; + } else { + cv_signal(&sfs->cv); + } + } + mtx_unlock(&sfs->mtx); +} + counter_u64_t sfstat[sizeof(struct sfstat) / sizeof(uint64_t)]; static void @@ -140,12 +168,7 @@ sendfile_free_mext(struct mbuf *m) if (m->m_ext.ext_flags & EXT_FLAG_SYNC) { struct sendfile_sync *sfs = m->m_ext.ext_arg2; - - mtx_lock(&sfs->mtx); - KASSERT(sfs->count > 0, ("Sendfile sync botchup count == 0")); - if (--sfs->count == 0) - cv_signal(&sfs->cv); - mtx_unlock(&sfs->mtx); + sendfile_sync_signal(sfs); } } @@ -535,6 +558,7 @@ vn_sendfile(struct file *fp, int sockfd, struct uio *h sfs = malloc(sizeof(*sfs), M_SENDFILE, M_WAITOK | M_ZERO); mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF); cv_init(&sfs->cv, "sendfile"); + sfs->waiting = true; } rem = nbytes ? omin(nbytes, obj_size - offset) : obj_size - offset; @@ -896,11 +920,13 @@ out: if (sfs != NULL) { mtx_lock(&sfs->mtx); if (sfs->count != 0) - cv_wait(&sfs->cv, &sfs->mtx); - KASSERT(sfs->count == 0, ("sendfile sync still busy")); - cv_destroy(&sfs->cv); - mtx_destroy(&sfs->mtx); - free(sfs, M_SENDFILE); + error = cv_wait_sig(&sfs->cv, &sfs->mtx); + if (sfs->count == 0) { + sendfile_sync_destroy(sfs); + } else { + sfs->waiting = false; + mtx_unlock(&sfs->mtx); + } } if (error == ERESTART) From owner-svn-src-all@freebsd.org Tue May 12 14:47:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF6AE2F1868; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M0yf55v6z4KvQ; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5D6899D4; Tue, 12 May 2020 14:47:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CElcIM082977; Tue, 12 May 2020 14:47:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CElcMa082976; Tue, 12 May 2020 14:47:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005121447.04CElcMa082976@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 14:47:38 +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: r360963 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 360963 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 14:47:38 -0000 Author: gjb Date: Tue May 12 14:47:38 2020 New Revision: 360963 URL: https://svnweb.freebsd.org/changeset/base/360963 Log: Bump version numbers in the stable/11 release notes. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/release.ent Modified: stable/11/release/doc/share/xml/release.ent ============================================================================== --- stable/11/release/doc/share/xml/release.ent Tue May 12 14:01:14 2020 (r360962) +++ stable/11/release/doc/share/xml/release.ent Tue May 12 14:47:38 2020 (r360963) @@ -6,7 +6,7 @@ - + - + - + - + From owner-svn-src-all@freebsd.org Tue May 12 15:22:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 82FD82F2298; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@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 49M1lB3CMTz4Mmm; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 690ABA14C; Tue, 12 May 2020 15:22:46 +0000 (UTC) (envelope-from vangyzen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CFMkA7007706; Tue, 12 May 2020 15:22:46 GMT (envelope-from vangyzen@FreeBSD.org) Received: (from vangyzen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CFMfuo007680; Tue, 12 May 2020 15:22:41 GMT (envelope-from vangyzen@FreeBSD.org) Message-Id: <202005121522.04CFMfuo007680@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: vangyzen set sender to vangyzen@FreeBSD.org using -f From: Eric van Gyzen Date: Tue, 12 May 2020 15:22:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... X-SVN-Group: head X-SVN-Commit-Author: vangyzen X-SVN-Commit-Paths: in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 stand/i386/isoboot stand/li... X-SVN-Commit-Revision: 360964 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 15:22:46 -0000 Author: vangyzen Date: Tue May 12 15:22:40 2020 New Revision: 360964 URL: https://svnweb.freebsd.org/changeset/base/360964 Log: Remove tests for obsolete compilers in the build system Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditions for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Modified: head/lib/libclang_rt/Makefile.inc head/lib/libthr/Makefile head/lib/msun/Makefile head/libexec/rtld-elf/Makefile head/libexec/tftpd/tests/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk head/stand/arm/uboot/Makefile head/stand/defs.mk head/stand/efi/Makefile head/stand/efi/boot1/Makefile head/stand/efi/loader/Makefile head/stand/i386/boot2/Makefile head/stand/i386/isoboot/Makefile head/stand/libsa/Makefile head/sys/conf/Makefile.arm head/sys/conf/Makefile.powerpc head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/trpt/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/lib/libclang_rt/Makefile.inc ============================================================================== --- head/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40 2020 (r360964) @@ -32,7 +32,7 @@ CFLAGS+= ${PICFLAG} CFLAGS+= -fno-builtin CFLAGS+= -fno-exceptions CXXFLAGS+= -fno-rtti -.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 30700 +.if ${COMPILER_TYPE} == clang CFLAGS+= -fno-sanitize=safe-stack .endif CFLAGS+= -fno-stack-protector Modified: head/lib/libthr/Makefile ============================================================================== --- head/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -29,10 +29,7 @@ CFLAGS+=-Winline CFLAGS.thr_stack.c+= -Wno-cast-align CFLAGS.rtld_malloc.c+= -Wno-cast-align -.include -.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+= -Wno-missing-variable-declarations -.endif .ifndef NO_THREAD_UNWIND_STACK CFLAGS+=-fexceptions Modified: head/lib/msun/Makefile ============================================================================== --- head/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -108,13 +108,13 @@ COMMON_SRCS+= catrigl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c -# Work around this warning from gcc 6: +# Work around this warning from gcc: # lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds range of # 'long double' [-Werror=overflow] # if( y >= LDBL_MAX ) # See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=130067 .include -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000 +.if ${COMPILER_TYPE} == "gcc" CFLAGS.e_powl.c+= -Wno-error=overflow .endif .endif Modified: head/libexec/rtld-elf/Makefile ============================================================================== --- head/libexec/rtld-elf/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+= -Wno-redundant-decls -.if ${COMPILER_VERSION} < 40300 -# Silence -Wshadow false positives in ancient GCC -CFLAGS+= -Wno-shadow -.endif .endif Modified: head/libexec/tftpd/tests/Makefile ============================================================================== --- head/libexec/tftpd/tests/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -2,11 +2,8 @@ .include -# Skip on GCC 4.2, because it lacks __COUNTER__ -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40300 ATF_TESTS_C= functional TEST_METADATA.functional+= timeout=15 -.endif LIBADD= util WARNS?= 6 Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r360964) @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION= unknown ${X_}COMPILER_RESOURCE_DIR!= ${${cc}:N${CCACHE_BIN}} -print-resource-dir 2>/dev/null || echo unknown .endif -${X_}COMPILER_FEATURES= -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30300) || \ - (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 40800) -${X_}COMPILER_FEATURES+= c++11 -.endif -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 30400) || \ - (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 50000) -${X_}COMPILER_FEATURES+= c++14 -.endif -.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 50000) || \ +${X_}COMPILER_FEATURES= c++11 c++14 +.if ${${X_}COMPILER_TYPE} == "clang" || \ (${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 70000) ${X_}COMPILER_FEATURES+= c++17 .endif -.if ${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 60000 +.if ${${X_}COMPILER_TYPE} == "clang" ${X_}COMPILER_FEATURES+= retpoline .endif Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) @@ -6,8 +6,7 @@ # Enable various levels of compiler warning checks. These may be # overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=no. -# for 4.2.1 GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html -# for current GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html +# for GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # for clang: https://clang.llvm.org/docs/DiagnosticsReference.html .include @@ -29,15 +28,6 @@ CFLAGS+= -std=${CSTD} CXXFLAGS+= -std=${CXXSTD} .endif -# -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path out of the -# system, and any warnings specific to it are no longer relevant as there are -# too many false positives. -# -.if ${COMPILER_VERSION} < 50000 -NO_WERROR.gcc= yes -.endif - # -pedantic is problematic because it also imposes namespace restrictions #CFLAGS+= -pedantic .if defined(WARNS) @@ -81,19 +71,13 @@ CWARNFLAGS+= -Wno-pointer-sign # is set to low values, these have to be disabled explicitly. .if ${WARNS} <= 6 CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30400 CWARNFLAGS.clang+= -Wno-unused-const-variable -.endif .endif # WARNS <= 6 .if ${WARNS} <= 3 CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\ -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 CWARNFLAGS.clang+= -Wno-unused-local-typedef -.endif -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 40000 CWARNFLAGS.clang+= -Wno-address-of-packed-member -.endif .if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 90100 CWARNFLAGS.gcc+= -Wno-address-of-packed-member .endif @@ -113,7 +97,7 @@ CWARNFLAGS.clang+= -Wno-array-bounds .endif # NO_WARRAY_BOUNDS .if defined(NO_WMISLEADING_INDENTATION) && \ ((${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 100000) || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100)) + ${COMPILER_TYPE} == "gcc") CWARNFLAGS+= -Wno-misleading-indentation .endif # NO_WMISLEADING_INDENTATION .endif # WARNS @@ -137,8 +121,10 @@ CWARNFLAGS+= -Werror CWARNFLAGS+= -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} -# GCC 5.2.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200 +# GCC +# We should clean up warnings produced with these flags. +# They were originally added as a quick hack to enable gcc5/6. +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS+= -Wno-error=address \ -Wno-error=array-bounds \ -Wno-error=attributes \ @@ -150,23 +136,18 @@ CWARNFLAGS+= -Wno-error=address \ -Wno-error=extra \ -Wno-error=inline \ -Wno-error=logical-not-parentheses \ + -Wno-error=nonnull-compare \ + -Wno-error=shift-negative-value \ -Wno-error=strict-aliasing \ + -Wno-error=tautological-compare \ -Wno-error=uninitialized \ -Wno-error=unused-but-set-variable \ + -Wno-error=unused-const-variable \ -Wno-error=unused-function \ -Wno-error=unused-value -.endif -# GCC 6.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60100 -CWARNFLAGS+= -Wno-error=nonnull-compare \ - -Wno-error=shift-negative-value \ - -Wno-error=tautological-compare \ - -Wno-error=unused-const-variable -.endif - # GCC 7.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 70100 +.if ${COMPILER_VERSION} >= 70100 CWARNFLAGS+= -Wno-error=bool-operation \ -Wno-error=deprecated \ -Wno-error=expansion-to-defined \ @@ -182,7 +163,7 @@ CWARNFLAGS+= -Wno-error=bool-operation \ .endif # GCC 8.1.0 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100 +.if ${COMPILER_VERSION} >= 80100 CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations \ -Wno-error=cast-function-type \ -Wno-error=catch-value \ @@ -191,9 +172,10 @@ CWARNFLAGS+= -Wno-error=aggressive-loop-optimizations -Wno-error=sizeof-pointer-memaccess \ -Wno-error=stringop-truncation .endif +.endif # gcc # How to handle FreeBSD custom printf format specifiers. -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 +.if ${COMPILER_TYPE} == "clang" FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions @@ -223,11 +205,7 @@ CFLAGS+=-nobuiltininc -idirafter ${COMPILER_RESOURCE_D CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\ -mllvm -simplifycfg-dup-ret -.if ${COMPILER_VERSION} >= 30500 && ${COMPILER_VERSION} < 30700 -CLANG_OPT_SMALL+= -mllvm -enable-gvn=false -.else CLANG_OPT_SMALL+= -mllvm -enable-load-pre=false -.endif CFLAGS.clang+= -Qunused-arguments # The libc++ headers use c++11 extensions. These are normally silenced because # they are treated as system headers, but we explicitly disable that warning @@ -238,14 +216,8 @@ CXXFLAGS.clang+= -Wno-c++11-extensions .if ${MK_SSP} != "no" && \ ${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips" -.if (${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30500) || \ - (${COMPILER_TYPE} == "gcc" && \ - (${COMPILER_VERSION} == 40201 || ${COMPILER_VERSION} >= 40900)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?= -fstack-protector-strong -.else -SSP_CFLAGS?= -fstack-protector -.endif CFLAGS+= ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS Modified: head/stand/arm/uboot/Makefile ============================================================================== --- head/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -24,7 +24,7 @@ UBLDR_LOADADDR?= 0x1000000 # Architecture-specific loader code SRCS= start.S conf.c self_reloc.c vers.c -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized .endif Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) @@ -143,11 +143,7 @@ CFLAGS+= -fPIC -mno-red-zone # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none CFLAGS+= -fPIC .endif Modified: head/stand/efi/Makefile ============================================================================== --- head/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -4,16 +4,10 @@ NO_OBJ=t .include -# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer -# than 4.5 supports it. -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 - SUBDIR.${MK_FDT}+= fdt SUBDIR.yes+= libefi boot1 gptboot SUBDIR.${MK_FORTH}+= loader_4th SUBDIR.${MK_LOADER_LUA}+= loader_lua SUBDIR.yes+= loader_simp - -.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 40500 .include Modified: head/stand/efi/boot1/Makefile ============================================================================== --- head/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -42,10 +42,6 @@ CFLAGS.zfs_module.c+= -I${SYSDIR}/cddl/contrib/opensol CFLAGS+= -DEFI_ZFS_BOOT .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized -.endif - CFLAGS+= -I${EFIINC} CFLAGS+= -I${EFIINCMD} CFLAGS+= -I${SYSDIR}/contrib/dev/acpica/include Modified: head/stand/efi/loader/Makefile ============================================================================== --- head/stand/efi/loader/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -31,10 +31,6 @@ CFLAGS+= -DEFI_ZFS_BOOT HAVE_ZFS= yes .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+= -Wno-error=maybe-uninitialized -.endif - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/stand/i386/boot2/Makefile ============================================================================== --- head/stand/i386/boot2/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -37,9 +37,6 @@ CFLAGS+=-fomit-frame-pointer \ CFLAGS.gcc+= -Os \ -fno-asynchronous-unwind-tables \ --param max-inline-insns-single=100 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 -CFLAGS.gcc+= -mno-align-long-strings -.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} Modified: head/stand/i386/isoboot/Makefile ============================================================================== --- head/stand/i386/isoboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -32,9 +32,6 @@ CFLAGS+=-DBOOTPROG=\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+= --param max-inline-insns-single=100 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} <= 40201 -CFLAGS.gcc+= -Wno-uninitialized -.endif CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=${LD_FLAGS_BIN} Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -46,11 +46,7 @@ SRCS+= subr_boot.c # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ Modified: head/sys/conf/Makefile.arm ============================================================================== --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) @@ -44,10 +44,6 @@ CFLAGS.clang += -mfpu=none .if !empty(DDB_ENABLED) CFLAGS += -funwind-tables -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} < 30500 -# clang < 3.5.0 requires us to tell it to emit assembly with unwind information -CFLAGS += -mllvm -arm-enable-ehabi -.endif .endif # "makeoptions KERNVIRTADDR=" is now optional, supply the default value. Modified: head/sys/conf/Makefile.powerpc ============================================================================== --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40 2020 (r360964) @@ -51,7 +51,7 @@ DPAAWARNFLAGS += \ -Wno-error=incompatible-pointer-types-discards-qualifiers \ -Wno-error=non-literal-null-conversion \ -Wno-error=enum-conversion -.elif "${COMPILER_TYPE}" == "gcc" && ${COMPILER_VERSION} >= 50200 +.elif "${COMPILER_TYPE}" == "gcc" DPAAWARNFLAGS += \ -Wno-error=redundant-decls \ -Wno-error=int-in-bool-context Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-po CWARNEXTRA?= -Wno-error-tautological-compare -Wno-error-empty-body \ -Wno-error-parentheses-equality -Wno-error-unused-function \ -Wno-error-pointer-sign -.if ${COMPILER_VERSION} >= 30700 CWARNEXTRA+= -Wno-error-shift-negative-value -.endif -.if ${COMPILER_VERSION} >= 40000 CWARNEXTRA+= -Wno-address-of-packed-member -.endif .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation .endif -.endif +.endif # clang .if ${COMPILER_TYPE} == "gcc" -.if ${COMPILER_VERSION} >= 40800 # Catch-all for all the things that are in our tree, but for which we're # not yet ready for this compiler. NO_WUNUSED_BUT_SET_VARIABLE = -Wno-unused-but-set-variable @@ -55,15 +50,13 @@ CWARNEXTRA?= -Wno-error=address \ -Wno-error=enum-compare \ -Wno-error=inline \ -Wno-error=maybe-uninitialized \ + -Wno-error=misleading-indentation \ + -Wno-error=nonnull-compare \ -Wno-error=overflow \ -Wno-error=sequence-point \ - -Wno-unused-but-set-variable -.if ${COMPILER_VERSION} >= 60100 -CWARNEXTRA+= -Wno-error=misleading-indentation \ - -Wno-error=nonnull-compare \ -Wno-error=shift-overflow \ - -Wno-error=tautological-compare -.endif + -Wno-error=tautological-compare \ + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >= 70100 CWARNEXTRA+= -Wno-error=stringop-overflow .endif @@ -76,15 +69,7 @@ CWARNEXTRA+= -Wno-error=packed-not-aligned .if ${COMPILER_VERSION} >= 90100 CWARNEXTRA+= -Wno-address-of-packed-member .endif -.else -# For gcc 4.2, eliminate the too-often-wrong warnings about uninitialized vars. -CWARNEXTRA?= -Wno-uninitialized -# GCC 4.2 doesn't have -Wno-error=cast-qual, so just disable the warning for -# the few files that are already known to generate cast-qual warnings. -NO_WCAST_QUAL= -Wno-cast-qual -NO_WNONNULL= -Wno-nonnull -.endif -.endif +.endif # gcc # This warning is utter nonsense CWARNFLAGS+= -Wno-format-zero-length @@ -93,7 +78,7 @@ CWARNFLAGS+= -Wno-format-zero-length # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} == "no" FORMAT_EXTENSIONS= -Wno-format -.elif ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 30600 +.elif ${COMPILER_TYPE} == "clang" FORMAT_EXTENSIONS= -D__printf__=__freebsd_kprintf__ .else FORMAT_EXTENSIONS= -fformat-extensions @@ -201,12 +186,7 @@ CFLAGS.gcc+= -mno-spe # DDB happy. ELFv2, if available, has some other efficiency benefits. # .if ${MACHINE_ARCH} == "powerpc64" -.if ${COMPILER_VERSION} >= 40900 -CFLAGS.gcc+= -mabi=elfv2 -.else -CFLAGS.gcc+= -mcall-aixdesc -.endif -CFLAGS.clang+= -mabi=elfv2 +CFLAGS+= -mabi=elfv2 .endif # Modified: head/sys/conf/kern.post.mk ============================================================================== --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .depend: .PRECIOUS ${SRCS} -.if ${COMPILER_TYPE} == "clang" || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000) _MAP_DEBUG_PREFIX= yes -.endif _ILINKS= machine .if ${MACHINE} != ${MACHINE_CPUARCH} && ${MACHINE} != "arm64" Modified: head/sys/conf/kern.pre.mk ============================================================================== --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) @@ -93,11 +93,7 @@ CFLAGS.gcc+= -fms-extensions .if defined(CFLAGS_ARCH_PARAMS) CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?= -Wno-error -.else WERROR?= -Werror -.endif # The following should be removed no earlier than LLVM11 being imported into the # tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the # default over to -fno-common, making this redundant. Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) @@ -88,11 +88,7 @@ __KLD_SHARED=no .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+= -fno-strict-aliasing .endif -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?= -Wno-error -.else WERROR?= -Werror -.endif LINUXKPI_GENSRCS+= \ bus_if.h \ @@ -160,11 +156,7 @@ CFLAGS+= -fPIC # Temporary workaround for PR 196407, which contains the fascinating details. # Don't allow clang to use fpu instructions or registers in kernel modules. .if ${MACHINE_CPUARCH} == arm -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+= -mllvm -arm-use-movt=0 -.else CFLAGS.clang+= -mno-movt -.endif CFLAGS.clang+= -mfpu=none CFLAGS+= -funwind-tables .endif @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} ${OBJCOPY} --strip-debug ${.TARGET} .endif -.if ${COMPILER_TYPE} == "clang" || \ - (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 60000) _MAP_DEBUG_PREFIX= yes -.endif _ILINKS=machine .if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -620,9 +620,7 @@ _aac= aac _aacraid= aacraid _acpi= acpi .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} > 40201 _aesni= aesni -.endif .endif _amd_ecc_inject=amd_ecc_inject _amdsbwd= amdsbwd Modified: head/usr.sbin/acpi/acpidb/Makefile ============================================================================== --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -87,6 +87,6 @@ LIBADD= pthread # integer to pointer, which is a GNU extension. # # Turn off the warning, because this is in contributed code. -.if ${COMPILER_TYPE} == "clang" && ${COMPILER_VERSION} >= 60000 +.if ${COMPILER_TYPE} == "clang" CWARNFLAGS+= -Wno-null-pointer-arithmetic .endif Modified: head/usr.sbin/trpt/Makefile ============================================================================== --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -8,18 +8,12 @@ MAN= trpt.8 BINGRP= kmem BINMODE= 2555 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} < 50000 -WARNS?= 4 -.endif - .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .include -.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+= -Wno-missing-variable-declarations -.endif Modified: head/usr.sbin/zic/zic/Makefile ============================================================================== --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -15,7 +15,7 @@ CFLAGS+= -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/std WARNS?= 2 -.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50300 +.if ${COMPILER_TYPE} == "gcc" CWARNFLAGS+= -Wno-error=strict-overflow .endif From owner-svn-src-all@freebsd.org Tue May 12 16:05:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A26C12F321D; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M2hK3lT2z4Q3L; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BE44A8DB; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CG5L7g033115; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CG5Lbb033114; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005121605.04CG5Lbb033114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 May 2020 16:05: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: r360965 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 360965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:05:21 -0000 Author: jhb Date: Tue May 12 16:05:21 2020 New Revision: 360965 URL: https://svnweb.freebsd.org/changeset/base/360965 Log: MFC 358394: Use stream_read() to read all 12 bytes of the RFB client version. read() can return a short read, whereas stream_read() waits until the full version string is read. Modified: stable/12/usr.sbin/bhyve/rfb.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/12/usr.sbin/bhyve/rfb.c Tue May 12 15:22:40 2020 (r360964) +++ stable/12/usr.sbin/bhyve/rfb.c Tue May 12 16:05:21 2020 (r360965) @@ -76,6 +76,7 @@ static int rfb_debug = 0; #define DPRINTF(params) if (rfb_debug) PRINTLN params #define WPRINTF(params) PRINTLN params +#define VERSION_LENGTH 12 #define AUTH_LENGTH 16 #define PASSWD_LENGTH 8 @@ -769,7 +770,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) stream_write(cfd, vbuf, strlen(vbuf)); /* 1b. Read client version */ - len = read(cfd, buf, sizeof(buf)); + len = stream_read(cfd, buf, VERSION_LENGTH); /* 2a. Send security type */ buf[0] = 1; From owner-svn-src-all@freebsd.org Tue May 12 16:05:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECE6D2F3229; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M2hK62DRz4Q3M; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA3CCA8DC; Tue, 12 May 2020 16:05:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CG5L9Y033122; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CG5Ll6033121; Tue, 12 May 2020 16:05:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005121605.04CG5Ll6033121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 May 2020 16:05:21 +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: r360965 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 360965 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:05:22 -0000 Author: jhb Date: Tue May 12 16:05:21 2020 New Revision: 360965 URL: https://svnweb.freebsd.org/changeset/base/360965 Log: MFC 358394: Use stream_read() to read all 12 bytes of the RFB client version. read() can return a short read, whereas stream_read() waits until the full version string is read. Modified: stable/11/usr.sbin/bhyve/rfb.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/rfb.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/rfb.c ============================================================================== --- stable/11/usr.sbin/bhyve/rfb.c Tue May 12 15:22:40 2020 (r360964) +++ stable/11/usr.sbin/bhyve/rfb.c Tue May 12 16:05:21 2020 (r360965) @@ -72,6 +72,7 @@ static int rfb_debug = 0; #define DPRINTF(params) if (rfb_debug) printf params #define WPRINTF(params) printf params +#define VERSION_LENGTH 12 #define AUTH_LENGTH 16 #define PASSWD_LENGTH 8 @@ -765,7 +766,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) stream_write(cfd, vbuf, strlen(vbuf)); /* 1b. Read client version */ - len = read(cfd, buf, sizeof(buf)); + len = stream_read(cfd, buf, VERSION_LENGTH); /* 2a. Send security type */ buf[0] = 1; From owner-svn-src-all@freebsd.org Tue May 12 16:10:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ECEE32F34BB; Tue, 12 May 2020 16:10:08 +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 49M2nr62k0z4QX0; Tue, 12 May 2020 16:10: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 CA784A917; Tue, 12 May 2020 16:10: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 04CGA88X033416; Tue, 12 May 2020 16:10:08 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGA8sE033413; Tue, 12 May 2020 16:10:08 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121610.04CGA8sE033413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 16:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360966 - in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 360966 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:10:09 -0000 Author: markj Date: Tue May 12 16:10:07 2020 New Revision: 360966 URL: https://svnweb.freebsd.org/changeset/base/360966 Log: rtwn: Add a USB ID for the TP-Link TL-WN727N. PR: 246417 Submitted by: Viktor G. MFC after: 1 week Modified: head/share/man/man4/rtwn_usb.4 head/sys/dev/rtwn/usb/rtwn_usb_attach.h head/sys/dev/usb/usbdevs Modified: head/share/man/man4/rtwn_usb.4 ============================================================================== --- head/share/man/man4/rtwn_usb.4 Tue May 12 16:05:21 2020 (r360965) +++ head/share/man/man4/rtwn_usb.4 Tue May 12 16:10:07 2020 (r360966) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd May 9, 2020 +.Dd May 12, 2020 .Dt RTWN_USB 4 .Os .Sh NAME @@ -103,6 +103,7 @@ based USB wireless network adapters, including: .It "TP-Link TL-WN722N v2" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN723N v3" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN725N v2" Ta RTL8188EU Ta USB 2.0 +.It "TP-LINK TL-WN727N v5" Ta RTL8188EU Ta USB 2.0 .It "TP-LINK TL-WN821N v4" Ta RTL8192CU Ta USB 2.0 .It "TP-LINK TL-WN821N v5" Ta RTL8192EU Ta USB 2.0 .It "TP-LINK TL-WN822N v4" Ta RTL8192EU Ta USB 2.0 Modified: head/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- head/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 12 16:05:21 2020 (r360965) +++ head/sys/dev/rtwn/usb/rtwn_usb_attach.h Tue May 12 16:10:07 2020 (r360966) @@ -120,6 +120,7 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8188EU_DEV(DLINK, DWA125D1), RTWN_RTL8188EU_DEV(ELECOM, WDC150SU2M), RTWN_RTL8188EU_DEV(TPLINK, WN722NV2), + RTWN_RTL8188EU_DEV(TPLINK, WN727NV5), RTWN_RTL8188EU_DEV(REALTEK, RTL8188ETV), RTWN_RTL8188EU_DEV(REALTEK, RTL8188EU), #undef RTWN_RTL8188EU_DEV Modified: head/sys/dev/usb/usbdevs ============================================================================== --- head/sys/dev/usb/usbdevs Tue May 12 16:05:21 2020 (r360965) +++ head/sys/dev/usb/usbdevs Tue May 12 16:10:07 2020 (r360966) @@ -4664,6 +4664,7 @@ product TPLINK WN821NV5 0x0107 TL-WN821N v5 product TPLINK WN822NV4 0x0108 TL-WN822N v4 product TPLINK WN823NV2 0x0109 TL-WN823N v2 product TPLINK WN722NV2 0x010c TL-WN722N v2 +product TPLINK WN727NV5 0x0111 TL-WN727N v5 product TPLINK T4UV2 0x010d Archer T4U ver 2 product TPLINK T4UHV1 0x0103 Archer T4UH ver 1 product TPLINK T4UHV2 0x010e Archer T4UH ver 2 From owner-svn-src-all@freebsd.org Tue May 12 16:33:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 55BBB2F3C3F; Tue, 12 May 2020 16:33:05 +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 49M3JJ6tg1z4Rk8; Tue, 12 May 2020 16:33:04 +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 E77ECAED1; Tue, 12 May 2020 16:33:04 +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 04CGX41K051217; Tue, 12 May 2020 16:33:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGX4Bf051216; Tue, 12 May 2020 16:33:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121633.04CGX4Bf051216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360967 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 360967 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:33:05 -0000 Author: emaste Date: Tue May 12 16:33:04 2020 New Revision: 360967 URL: https://svnweb.freebsd.org/changeset/base/360967 Log: libalias: validate packet lengths before accessing headers admbugs: 956 Submitted by: ae Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative Reported by: Vishnu working with Trend Micro Zero Day Initiative Security: FreeBSD-SA-20:12.libalias Modified: head/sys/netinet/libalias/alias.c Modified: head/sys/netinet/libalias/alias.c ============================================================================== --- head/sys/netinet/libalias/alias.c Tue May 12 16:10:07 2020 (r360966) +++ head/sys/netinet/libalias/alias.c Tue May 12 16:33:04 2020 (r360967) @@ -442,10 +442,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -464,6 +469,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -732,10 +740,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -824,12 +839,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -922,8 +944,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1042,7 +1069,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1051,6 +1078,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-all@freebsd.org Tue May 12 16:38:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8EF852F3E5C; Tue, 12 May 2020 16:38:29 +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 49M3QY3F6Jz4S0T; Tue, 12 May 2020 16:38:29 +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 69D8FAED6; Tue, 12 May 2020 16:38:29 +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 04CGcTkN051541; Tue, 12 May 2020 16:38:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGcTJ5051540; Tue, 12 May 2020 16:38:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121638.04CGcTJ5051540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:38:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360968 - head/sys/netinet/libalias X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/netinet/libalias X-SVN-Commit-Revision: 360968 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:38:29 -0000 Author: emaste Date: Tue May 12 16:38:28 2020 New Revision: 360968 URL: https://svnweb.freebsd.org/changeset/base/360968 Log: libalias: fix potential memory disclosure from ftp module admbugs: 956 Submitted by: markj Reported by: Vishnu Dev TJ working with Trend Micro Zero Day Initiative Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Security: ZDI-CAN-10849 Modified: head/sys/netinet/libalias/alias_ftp.c Modified: head/sys/netinet/libalias/alias_ftp.c ============================================================================== --- head/sys/netinet/libalias/alias_ftp.c Tue May 12 16:33:04 2020 (r360967) +++ head/sys/netinet/libalias/alias_ftp.c Tue May 12 16:38:28 2020 (r360968) @@ -754,7 +754,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-all@freebsd.org Tue May 12 16:44:17 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2AB942F429D; Tue, 12 May 2020 16:44:17 +0000 (UTC) (envelope-from gordon@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 49M3YF0lMVz4SdQ; Tue, 12 May 2020 16:44:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 14618B0E9; Tue, 12 May 2020 16:44:17 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGiGmn057549; Tue, 12 May 2020 16:44:16 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGiEW1057534; Tue, 12 May 2020 16:44:14 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121644.04CGiEW1057534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:44:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360969 - in releng: 11.3/contrib/tzdata 12.1/contrib/tzdata X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/contrib/tzdata 12.1/contrib/tzdata X-SVN-Commit-Revision: 360969 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:44:17 -0000 Author: gordon Date: Tue May 12 16:44:13 2020 New Revision: 360969 URL: https://svnweb.freebsd.org/changeset/base/360969 Log: Update to tzdata 2020a. Approved by: so Security: EN-20:08.tzdata Modified: releng/11.3/contrib/tzdata/Makefile releng/11.3/contrib/tzdata/NEWS releng/11.3/contrib/tzdata/africa releng/11.3/contrib/tzdata/asia releng/11.3/contrib/tzdata/backward releng/11.3/contrib/tzdata/backzone releng/11.3/contrib/tzdata/europe releng/11.3/contrib/tzdata/leap-seconds.list releng/11.3/contrib/tzdata/leapseconds releng/11.3/contrib/tzdata/leapseconds.awk releng/11.3/contrib/tzdata/northamerica releng/11.3/contrib/tzdata/theory.html releng/11.3/contrib/tzdata/version releng/11.3/contrib/tzdata/zone.tab releng/11.3/contrib/tzdata/zone1970.tab releng/12.1/contrib/tzdata/Makefile releng/12.1/contrib/tzdata/NEWS releng/12.1/contrib/tzdata/africa releng/12.1/contrib/tzdata/asia releng/12.1/contrib/tzdata/backward releng/12.1/contrib/tzdata/backzone releng/12.1/contrib/tzdata/europe releng/12.1/contrib/tzdata/leap-seconds.list releng/12.1/contrib/tzdata/leapseconds releng/12.1/contrib/tzdata/leapseconds.awk releng/12.1/contrib/tzdata/northamerica releng/12.1/contrib/tzdata/theory.html releng/12.1/contrib/tzdata/version releng/12.1/contrib/tzdata/zone.tab releng/12.1/contrib/tzdata/zone1970.tab Modified: releng/11.3/contrib/tzdata/Makefile ============================================================================== --- releng/11.3/contrib/tzdata/Makefile Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/Makefile Tue May 12 16:44:13 2020 (r360969) @@ -150,6 +150,15 @@ TIME_T_ALTERNATIVES_TAIL = int32_t uint32_t uint64_t REDO= posix_right +# Whether to put an "Expires" line in the leapseconds file. +# Use EXPIRES_LINE=1 to put the line in, 0 to omit it. +# The EXPIRES_LINE value matters only if REDO's value contains "right". +# If you change EXPIRES_LINE, remove the leapseconds file before running "make". +# zic's support for the Expires line was introduced in tzdb 2020a, +# and EXPIRES_LINE defaults to 0 for now so that the leapseconds file +# can be given to older zic implementations. +EXPIRES_LINE= 0 + # To install data in text form that has all the information of the TZif data, # (optionally incorporating leap second information), use # TZDATA_TEXT= tzdata.zi leapseconds @@ -295,8 +304,9 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # than TM_GMTOFF and TM_ZONE. However, most of them are standardized. # # # # To omit or support the external variable "tzname", add one of: -# # -DHAVE_TZNAME=0 -# # -DHAVE_TZNAME=1 +# # -DHAVE_TZNAME=0 # do not support "tzname" +# # -DHAVE_TZNAME=1 # support "tzname", which is defined by system library +# # -DHAVE_TZNAME=2 # support and define "tzname" # # to the "CFLAGS=" line. "tzname" is required by POSIX 1988 and later. # # If not defined, the code attempts to guess HAVE_TZNAME from other macros. # # Warning: unless time_tz is also defined, HAVE_TZNAME=1 can cause @@ -304,16 +314,20 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # # presumably due to memory allocation issues. # # # # To omit or support the external variables "timezone" and "daylight", add -# # -DUSG_COMPAT=0 -# # -DUSG_COMPAT=1 +# # -DUSG_COMPAT=0 # do not support +# # -DUSG_COMPAT=1 # support, and variables are defined by system library +# # -DUSG_COMPAT=2 # support and define variables # # to the "CFLAGS=" line; "timezone" and "daylight" are inspired by # # Unix Systems Group code and are required by POSIX 2008 (with XSI) and later. # # If not defined, the code attempts to guess USG_COMPAT from other macros. # # # # To support the external variable "altzone", add -# # -DALTZONE +# # -DALTZONE=0 # do not support +# # -DALTZONE=1 # support "altzone", which is defined by system library +# # -DALTZONE=2 # support and define "altzone" # # to the end of the "CFLAGS=" line; although "altzone" appeared in # # System V Release 3.1 it has not been standardized. +# # If not defined, the code attempts to guess ALTZONE from other macros. # # If you want functions that were inspired by early versions of X3J11's work, # add @@ -321,9 +335,7 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # to the end of the "CFLAGS=" line. This arranges for the functions # "tzsetwall", "offtime", "timelocal", "timegm", "timeoff", # "posix2time", and "time2posix" to be added to the time conversion library. -# "tzsetwall" is like "tzset" except that it arranges for local wall clock -# time (rather than the timezone specified in the TZ environment variable) -# to be used. +# "tzsetwall" is deprecated and is intended to be removed soon; see NEWS. # "offtime" is like "gmtime" except that it accepts a second (long) argument # that gives an offset to add to the time_t when converting it. # "timelocal" is equivalent to "mktime". @@ -333,7 +345,6 @@ GCC_DEBUG_FLAGS = -DGCC_LINT -g3 -O3 -fno-common \ # that gives an offset to use when converting to a time_t. # "posix2time" and "time2posix" are described in an included manual page. # X3J11's work does not describe any of these functions. -# Sun has provided "tzsetwall", "timelocal", and "timegm" in SunOS 4.0. # These functions may well disappear in future releases of the time # conversion package. # @@ -505,11 +516,11 @@ RANLIB= : TZCOBJS= zic.o TZDOBJS= zdump.o localtime.o asctime.o strftime.o DATEOBJS= date.o localtime.o strftime.o asctime.o -LIBSRCS= localtime.c asctime.c difftime.c -LIBOBJS= localtime.o asctime.o difftime.o +LIBSRCS= localtime.c asctime.c difftime.c strftime.c +LIBOBJS= localtime.o asctime.o difftime.o strftime.o HEADERS= tzfile.h private.h NONLIBSRCS= zic.c zdump.c -NEWUCBSRCS= date.c strftime.c +NEWUCBSRCS= date.c SOURCES= $(HEADERS) $(LIBSRCS) $(NONLIBSRCS) $(NEWUCBSRCS) \ tzselect.ksh workman.sh MANS= newctime.3 newstrftime.3 newtzset.3 time2posix.3 \ @@ -651,7 +662,8 @@ yearistype: yearistype.sh chmod +x yearistype leapseconds: $(LEAP_DEPS) - $(AWK) -f leapseconds.awk leap-seconds.list >$@.out + $(AWK) -v EXPIRES_LINE=$(EXPIRES_LINE) \ + -f leapseconds.awk leap-seconds.list >$@.out mv $@.out $@ # Arguments to pass to submakes of install_data. Modified: releng/11.3/contrib/tzdata/NEWS ============================================================================== --- releng/11.3/contrib/tzdata/NEWS Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/NEWS Tue May 12 16:44:13 2020 (r360969) @@ -1,5 +1,87 @@ News for the tz database +Release 2020a - 2020-04-23 16:03:47 -0700 + + Briefly: + Morocco springs forward on 2020-05-31, not 2020-05-24. + Canada's Yukon advanced to -07 year-round on 2020-03-08. + America/Nuuk renamed from America/Godthab. + zic now supports expiration dates for leap second lists. + + Changes to future timestamps + + Morocco's second spring-forward transition in 2020 will be May 31, + not May 24 as predicted earlier. (Thanks to Semlali Naoufal.) + Adjust future-year predictions to use the first Sunday after the + day after Ramadan, not the first Sunday after Ramadan. + + Canada's Yukon, represented by America/Whitehorse and + America/Dawson, advanced to -07 year-round, beginning with its + spring-forward transition on 2020-03-08, and will not fall back on + 2020-11-01. Although a government press release calls this + "permanent Pacific Daylight Saving Time", we prefer MST for + consistency with nearby Dawson Creek, Creston, and Fort Nelson. + (Thanks to Tim Parenti.) + + Changes to past timestamps + + Shanghai observed DST in 1919. (Thanks to Phake Nick.) + + Changes to timezone identifiers + + To reflect current usage in English better, America/Godthab has + been renamed to America/Nuuk. A backwards-compatibility link + remains for the old name. + + Changes to code + + localtime.c no longer mishandles timestamps after the last + transition in a TZif file with leap seconds and with daylight + saving time transitions projected into the indefinite future. + For example, with TZ='America/Los_Angeles' with leap seconds, + zdump formerly reported a DST transition on 2038-03-14 + from 01:59:32.999... to 02:59:33 instead of the correct transition + from 01:59:59.999... to 03:00:00. + + zic -L now supports an Expires line in the leapseconds file, and + truncates the TZif output accordingly. This propagates leap + second expiration information into the TZif file, and avoids the + abovementioned localtime.c bug as well as similar bugs present in + many client implementations. If no Expires line is present, zic + -L instead truncates the TZif output based on the #expires comment + present in leapseconds files distributed by tzdb 2018f and later; + however, this usage is obsolescent. For now, the distributed + leapseconds file has an Expires line that is commented out, so + that the file can be fed to older versions of zic which ignore the + commented-out line. Future tzdb distributions are planned to + contain a leapseconds file with an Expires line. + + The configuration macros HAVE_TZNAME and USG_COMPAT should now be + set to 1 if the system library supports the feature, and 2 if not. + As before, these macros are nonzero if tzcode should support the + feature, zero otherwise. + + The configuration macro ALTZONE now has the same values with the + same meaning as HAVE_TZNAME and USG_COMPAT. + + The code's defense against CRLF in leap-seconds.list is now + portable to POSIX awk. (Problem reported by Deborah Goldsmith.) + + Although the undocumented tzsetwall function is not changed in + this release, it is now deprecated in preparation for removal in + future releases. Due to POSIX requirements, tzsetwall has not + worked for some time. Any code that uses it should instead use + tzalloc(NULL) or, if portability trumps thread-safety, should + unset the TZ environment variable. + + Changes to commentary + + The Îles-de-la-Madeleine and the Listuguj reserve are noted as + following America/Halifax, and comments about Yukon's "south" and + "north" have been corrected to say "east" and "west". (Thanks to + Jeffery Nichols.) + + Release 2019c - 2019-09-11 08:59:48 -0700 Briefly: Modified: releng/11.3/contrib/tzdata/africa ============================================================================== --- releng/11.3/contrib/tzdata/africa Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/africa Tue May 12 16:44:13 2020 (r360969) @@ -867,19 +867,25 @@ Zone Indian/Mauritius 3:50:00 - LMT 1907 # Port Louis # Morocco will be on GMT starting from Sunday, May 5th 2019 at 3am. # The switch to GMT+1 will occur on Sunday, June 9th 2019 at 2am.... # http://fr.le360.ma/societe/voici-la-date-du-retour-a-lheure-legale-au-maroc-188222 + +# From Semlali Naoufal (2020-04-14): +# Following the announcement by the Moroccan government, the switch to +# GMT time will take place on Sunday, April 19, 2020 from 3 a.m. and +# the return to GMT+1 time will take place on Sunday, May 31, 2020 at 2 a.m.... +# https://maroc-diplomatique.net/maroc-le-retour-a-lheure-gmt-est-prevu-dimanche-prochain/ +# http://aujourdhui.ma/actualite/gmt1-retour-a-lheure-normale-dimanche-prochain-1 # -# From Paul Eggert (2019-05-20): -# This agrees with our 2018-11-01 guess that the Moroccan government -# would continue the practice of falling back at 03:00 the last Sunday -# before Ramadan, and of springing forward at 02:00 the first Sunday after -# Ramadan, as this has been the practice since 2012. To implement this, -# transition dates for 2019 through 2087 were determined by running the -# following program under GNU Emacs 26.2. -# (let ((islamic-year 1440)) +# From Paul Eggert (2020-04-14): +# For now, guess that in the future Morocco will fall back at 03:00 +# the last Sunday before Ramadan, and spring forward at 02:00 the +# first Sunday after the day after Ramadan. To implement this, +# transition dates for 2021 through 2087 were determined by running +# the following program under GNU Emacs 26.3. +# (let ((islamic-year 1442)) # (require 'cal-islam) # (while (< islamic-year 1511) # (let ((a (calendar-islamic-to-absolute (list 9 1 islamic-year))) -# (b (calendar-islamic-to-absolute (list 10 1 islamic-year))) +# (b (1+ (calendar-islamic-to-absolute (list 10 1 islamic-year)))) # (sunday 0)) # (while (/= sunday (mod (setq a (1- a)) 7))) # (while (/= sunday (mod b 7)) @@ -939,7 +945,7 @@ Rule Morocco 2018 only - Jun 17 2:00 1:00 - Rule Morocco 2019 only - May 5 3:00 -1:00 - Rule Morocco 2019 only - Jun 9 2:00 0 - Rule Morocco 2020 only - Apr 19 3:00 -1:00 - -Rule Morocco 2020 only - May 24 2:00 0 - +Rule Morocco 2020 only - May 31 2:00 0 - Rule Morocco 2021 only - Apr 11 3:00 -1:00 - Rule Morocco 2021 only - May 16 2:00 0 - Rule Morocco 2022 only - Mar 27 3:00 -1:00 - @@ -955,7 +961,7 @@ Rule Morocco 2026 only - Mar 22 2:00 0 - Rule Morocco 2027 only - Feb 7 3:00 -1:00 - Rule Morocco 2027 only - Mar 14 2:00 0 - Rule Morocco 2028 only - Jan 23 3:00 -1:00 - -Rule Morocco 2028 only - Feb 27 2:00 0 - +Rule Morocco 2028 only - Mar 5 2:00 0 - Rule Morocco 2029 only - Jan 14 3:00 -1:00 - Rule Morocco 2029 only - Feb 18 2:00 0 - Rule Morocco 2029 only - Dec 30 3:00 -1:00 - @@ -971,7 +977,7 @@ Rule Morocco 2033 only - Dec 25 2:00 0 - Rule Morocco 2034 only - Nov 5 3:00 -1:00 - Rule Morocco 2034 only - Dec 17 2:00 0 - Rule Morocco 2035 only - Oct 28 3:00 -1:00 - -Rule Morocco 2035 only - Dec 2 2:00 0 - +Rule Morocco 2035 only - Dec 9 2:00 0 - Rule Morocco 2036 only - Oct 19 3:00 -1:00 - Rule Morocco 2036 only - Nov 23 2:00 0 - Rule Morocco 2037 only - Oct 4 3:00 -1:00 - @@ -987,7 +993,7 @@ Rule Morocco 2041 only - Sep 29 2:00 0 - Rule Morocco 2042 only - Aug 10 3:00 -1:00 - Rule Morocco 2042 only - Sep 21 2:00 0 - Rule Morocco 2043 only - Aug 2 3:00 -1:00 - -Rule Morocco 2043 only - Sep 6 2:00 0 - +Rule Morocco 2043 only - Sep 13 2:00 0 - Rule Morocco 2044 only - Jul 24 3:00 -1:00 - Rule Morocco 2044 only - Aug 28 2:00 0 - Rule Morocco 2045 only - Jul 9 3:00 -1:00 - @@ -1003,7 +1009,7 @@ Rule Morocco 2049 only - Jul 4 2:00 0 - Rule Morocco 2050 only - May 15 3:00 -1:00 - Rule Morocco 2050 only - Jun 26 2:00 0 - Rule Morocco 2051 only - May 7 3:00 -1:00 - -Rule Morocco 2051 only - Jun 11 2:00 0 - +Rule Morocco 2051 only - Jun 18 2:00 0 - Rule Morocco 2052 only - Apr 28 3:00 -1:00 - Rule Morocco 2052 only - Jun 2 2:00 0 - Rule Morocco 2053 only - Apr 13 3:00 -1:00 - @@ -1019,7 +1025,7 @@ Rule Morocco 2057 only - Apr 8 2:00 0 - Rule Morocco 2058 only - Feb 17 3:00 -1:00 - Rule Morocco 2058 only - Mar 31 2:00 0 - Rule Morocco 2059 only - Feb 9 3:00 -1:00 - -Rule Morocco 2059 only - Mar 16 2:00 0 - +Rule Morocco 2059 only - Mar 23 2:00 0 - Rule Morocco 2060 only - Feb 1 3:00 -1:00 - Rule Morocco 2060 only - Mar 7 2:00 0 - Rule Morocco 2061 only - Jan 16 3:00 -1:00 - @@ -1029,13 +1035,13 @@ Rule Morocco 2062 only - Feb 12 2:00 0 - Rule Morocco 2062 only - Dec 31 3:00 -1:00 - Rule Morocco 2063 only - Feb 4 2:00 0 - Rule Morocco 2063 only - Dec 16 3:00 -1:00 - -Rule Morocco 2064 only - Jan 20 2:00 0 - +Rule Morocco 2064 only - Jan 27 2:00 0 - Rule Morocco 2064 only - Dec 7 3:00 -1:00 - Rule Morocco 2065 only - Jan 11 2:00 0 - Rule Morocco 2065 only - Nov 22 3:00 -1:00 - Rule Morocco 2066 only - Jan 3 2:00 0 - Rule Morocco 2066 only - Nov 14 3:00 -1:00 - -Rule Morocco 2066 only - Dec 19 2:00 0 - +Rule Morocco 2066 only - Dec 26 2:00 0 - Rule Morocco 2067 only - Nov 6 3:00 -1:00 - Rule Morocco 2067 only - Dec 11 2:00 0 - Rule Morocco 2068 only - Oct 21 3:00 -1:00 - @@ -1045,13 +1051,13 @@ Rule Morocco 2069 only - Nov 17 2:00 0 - Rule Morocco 2070 only - Oct 5 3:00 -1:00 - Rule Morocco 2070 only - Nov 9 2:00 0 - Rule Morocco 2071 only - Sep 20 3:00 -1:00 - -Rule Morocco 2071 only - Oct 25 2:00 0 - +Rule Morocco 2071 only - Nov 1 2:00 0 - Rule Morocco 2072 only - Sep 11 3:00 -1:00 - Rule Morocco 2072 only - Oct 16 2:00 0 - Rule Morocco 2073 only - Aug 27 3:00 -1:00 - Rule Morocco 2073 only - Oct 8 2:00 0 - Rule Morocco 2074 only - Aug 19 3:00 -1:00 - -Rule Morocco 2074 only - Sep 23 2:00 0 - +Rule Morocco 2074 only - Sep 30 2:00 0 - Rule Morocco 2075 only - Aug 11 3:00 -1:00 - Rule Morocco 2075 only - Sep 15 2:00 0 - Rule Morocco 2076 only - Jul 26 3:00 -1:00 - @@ -1061,7 +1067,7 @@ Rule Morocco 2077 only - Aug 22 2:00 0 - Rule Morocco 2078 only - Jul 10 3:00 -1:00 - Rule Morocco 2078 only - Aug 14 2:00 0 - Rule Morocco 2079 only - Jun 25 3:00 -1:00 - -Rule Morocco 2079 only - Jul 30 2:00 0 - +Rule Morocco 2079 only - Aug 6 2:00 0 - Rule Morocco 2080 only - Jun 16 3:00 -1:00 - Rule Morocco 2080 only - Jul 21 2:00 0 - Rule Morocco 2081 only - Jun 1 3:00 -1:00 - @@ -1077,7 +1083,7 @@ Rule Morocco 2085 only - May 27 2:00 0 - Rule Morocco 2086 only - Apr 14 3:00 -1:00 - Rule Morocco 2086 only - May 19 2:00 0 - Rule Morocco 2087 only - Mar 30 3:00 -1:00 - -Rule Morocco 2087 only - May 4 2:00 0 - +Rule Morocco 2087 only - May 11 2:00 0 - # For dates after the somewhat-arbitrary cutoff of 2087, assume that # Morocco will no longer observe DST. At some point this table will # need to be extended, though quite possibly Morocco will change the @@ -1179,7 +1185,7 @@ Link Africa/Maputo Africa/Lusaka # Zambia Rule Namibia 1994 only - Mar 21 0:00 -1:00 WAT Rule Namibia 1994 2017 - Sep Sun>=1 2:00 0 CAT Rule Namibia 1995 2017 - Apr Sun>=1 2:00 -1:00 WAT -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. #Rule Namibia 1994 only - Mar 21 0:00 0 WAT #Rule Namibia 1994 2017 - Sep Sun>=1 2:00 1:00 CAT #Rule Namibia 1995 2017 - Apr Sun>=1 2:00 0 WAT @@ -1193,7 +1199,7 @@ Zone Africa/Windhoek 1:08:24 - LMT 1892 Feb 8 2:00 - SAST 1990 Mar 21 # independence # Vanguard section, for zic and other parsers that support negative DST. 2:00 Namibia %s -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 2:00 - CAT 1994 Mar 21 0:00 # From Paul Eggert (2017-04-07): # The official date of the 2017 rule change was 2017-10-24. See: Modified: releng/11.3/contrib/tzdata/asia ============================================================================== --- releng/11.3/contrib/tzdata/asia Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/asia Tue May 12 16:44:13 2020 (r360969) @@ -286,6 +286,27 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoo # China +# From Phake Nick (2020-04-15): +# According to this news report: +# http://news.sina.com.cn/c/2004-09-01/19524201403.shtml +# on April 11, 1919, newspaper in Shanghai said clocks in Shanghai will spring +# forward for an hour starting from midnight of that Saturday. The report did +# not mention what happened in Shanghai thereafter, but it mentioned that a +# similar trial in Tianjin which ended at October 1st as citizens are told to +# recede the clock on September 30 from 12:00pm to 11:00pm. The trial at +# Tianjin got terminated in 1920. +# +# From Paul Eggert (2020-04-15): +# The Returns of Trade and Trade Reports, page 711, says "Daylight saving was +# given a trial during the year, and from the 12th April to the 1st October +# the clocks were all set one hour ahead of sun time. Though the scheme was +# generally esteemed a success, it was announced early in 1920 that it would +# not be repeated." +# +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Shang 1919 only - Apr 12 24:00 1:00 D +Rule Shang 1919 only - Sep 30 24:00 0 S + # From Paul Eggert (2018-10-02): # The following comes from Table 1 of: # Li Yu. Research on the daylight saving movement in 1940s Shanghai. @@ -294,7 +315,90 @@ Zone Asia/Yangon 6:24:47 - LMT 1880 # or Rangoo # The table lists dates only; I am guessing 00:00 and 24:00 transition times. # Also, the table lists the planned end of DST in 1949, but the corresponding # zone line cuts this off on May 28, when the Communists took power. + +# From Phake Nick (2020-04-15): # +# For the history of time in Shanghai between 1940-1942, the situation is +# actually slightly more complex than the table [below].... At the time, +# there were three different authorities in Shanghai, including Shanghai +# International Settlement, a settlement established by western countries with +# its own westernized form of government, Shanghai French Concession, similar +# to the international settlement but is controlled by French, and then the +# rest of the city of Shanghai, which have already been controlled by Japanese +# force through a puppet local government (Wang Jingwei regime). It was +# additionally complicated by the circumstances that, according to the 1940s +# Shanghai summer time essay cited in the database, some +# departments/businesses/people in the Shanghai city itself during that time +# period, refused to change their clock and instead only changed their opening +# hours. +# +# For example, as quoted in the article, in 1940, other than the authority +# itself, power, tram, bus companies, cinema, department stores, and other +# public service organizations have all decided to follow the summer time and +# spring forward the clock. On the other hand, the custom office refused to +# spring forward the clock because of worry on mechanical wear to the physical +# clock, postal office refused to spring forward because of disruption to +# business and log-keeping, although they did changed their office hour to +# match rest of the city. So is travel agents, and also weather +# observatory. It is said both time standards had their own supporters in the +# city at the time, those who prefer new time standard would have moved their +# clock while those who prefer the old time standard would keep their clock +# unchange, and there were different clocks that use different time standard +# in the city at the time for people who use different time standard to adjust +# their clock to their preferred time. +# +# a. For the 1940 May 31 spring forward, the essay claim that it was +# coordinared between the international settlement authority and the French +# concession authority and have gathered support from Hong Kong and Xiamen, +# that it would spring forward an hour from May 31 "midnight", and the essay +# claim "Hong Kong government implemented the spring forward in the same time +# on the same date as Shanghai". +# +# b. For the 1940 fall back, it was said that they initially intended to do +# so on September 30 00:59 at night, however they postponed it to October 12 +# after discussion with relevant parties. However schools restored to the +# original schedule ten days earlier. +# +# c. For the 1941 spring forward, it is said to start from March 15 +# "following the previous year's method", and in addition to that the essay +# cited an announcement in 1941 from the Wang regime which said the Special +# City of Shanghai under Wang regime control will follow the DST rule set by +# the Settlements, irrespective of the original DST plan announced by the Wang +# regime for other area under its control(April 1 to September 30). (no idea +# to situation before that announcement) +# +# d. For the 1941 fall back, it was said that the fall back would occurs at +# the end of September (A newspaper headline cited by the essay, published on +# October 1, 1941, have the headlines which said "French Concession would +# rewind to the old clock this morning), but it ultimately didn't happen due +# to disagreement between the international settlement authority and the +# French concession authority, and the fall back ultimately occurred on +# November 1. +# +# e. In 1941 December, Japan have officially started war with the United +# States and the United Kingdom, and in Shanghai they have marched into the +# international settlement, taken over its control +# +# f. For the 1942 spring forward, the essay said that the spring forward +# started on January 31. It said this time the custom office and postal +# department will also change their clocks, unlike before. +# +# g. The essay itself didn't cover any specific changes thereafter until the +# end of the war, it quoted a November 1942 command from the government of the +# Wang regime, which claim the daylight saving time applies year round during +# the war. However, the essay ambiguously said the period is "February 1 to +# September 30", which I don't really understand what is the meaning of such +# period in the context of year round implementation here.. More researches +# might be needed to show exactly what happened during that period of time. + +# From Phake Nick (2020-04-15): +# According to a Japanese tour bus pamphlet in Nanjing area believed to be +# from around year 1941: http://www.tt-museum.jp/tairiku_0280_nan1941.html , +# the schedule listed was in the format of Japanese time. Which indicate some +# use of the Japanese time (instead of syncing by DST) might have occurred in +# the Yangtze river delta area during that period of time although the scope +# of such use will need to be investigated to determine. +# # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Shang 1940 only - Jun 1 0:00 1:00 D Rule Shang 1940 only - Oct 12 24:00 0 S @@ -572,7 +676,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 6:00 - +06 -# Hong Kong (Xianggang) +# Hong Kong # Milne gives 7:36:41.7; round this. @@ -582,9 +686,7 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # it is not [an] observatory, but the official meteorological agency of HK, # and also serves as the official timing agency), there are some missing # and incorrect rules. Although the exact switch over time is missing, I -# think 3:30 is correct. The official DST record for Hong Kong can be -# obtained from -# http://www.hko.gov.hk/gts/time/Summertime.htm +# think 3:30 is correct. # From Phake Nick (2018-10-27): # According to Singaporean newspaper @@ -695,10 +797,10 @@ Zone Asia/Urumqi 5:50:20 - LMT 1928 # Resolution of the Legislative Council passed on 9 May 1979 # https://www.legco.gov.hk/yr78-79/english/lc_sitg/hansard/h790509.pdf#page=39 -# From Paul Eggert (2019-05-31): +# From Paul Eggert (2020-04-15): # Here are the dates given at -# https://www.hko.gov.hk/gts/time/Summertime.htm -# as of 2014-06-19: +# https://www.hko.gov.hk/en/gts/time/Summertime.htm +# as of 2020-02-10: # Year Period # 1941 15 Jun to 30 Sep # 1942 Whole year @@ -1828,6 +1930,47 @@ Zone Asia/Jerusalem 2:20:54 - LMT 1880 # '9:00' and 'JST' is from Guy Harris. +# From Paul Eggert (2020-01-19): +# Starting in the 7th century, Japan generally followed an ancient Chinese +# timekeeping system that divided night and day into six hours each, +# with hour length depending on season. In 1873 the government +# started requiring the use of a Western style 24-hour clock. See: +# Yulia Frumer, "Making Time: Astronomical Time Measurement in Tokugawa Japan" +# . As the tzdb code and +# data support only 24-hour clocks, its tables model timestamps before +# 1873 using Western-style local mean time. + +# From Hideyuki Suzuki (1998-11-09): +# 'Tokyo' usually stands for the former location of Tokyo Astronomical +# Observatory: 139° 44' 40.90" E (9h 18m 58.727s), 35° 39' 16.0" N. +# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' +# edited by National Astronomical Observatory of Japan.... +# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). +# The law is enacted on 1886-07-07. + +# From Hideyuki Suzuki (1998-11-16): +# The ordinance No. 51 (1886) established "standard time" in Japan, +# which stands for the time on 135° E. +# In the ordinance No. 167 (1895), "standard time" was renamed to "central +# standard time". And the same ordinance also established "western standard +# time", which stands for the time on 120° E.... But "western standard +# time" was abolished in the ordinance No. 529 (1937). In the ordinance No. +# 167, there is no mention regarding for what place western standard time is +# standard.... +# +# I wrote "ordinance" above, but I don't know how to translate. +# In Japanese it's "chokurei", which means ordinance from emperor. + +# From Yu-Cheng Chuang (2013-07-12): +# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause +# about standard time" ... The adoption began from Jan 1, 1896. +# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時) +# +# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which +# means the whole Japan territory, including later occupations, adopt Japan +# Central Time (UT+9). The adoption began on Oct 1, 1937. +# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件 + # From Paul Eggert (1995-03-06): # Today's _Asahi Evening News_ (page 4) reports that Japan had # daylight saving between 1948 and 1951, but "the system was discontinued @@ -1876,37 +2019,6 @@ Rule Japan 1948 1951 - Sep Sat>=8 25:00 0 S Rule Japan 1949 only - Apr Sat>=1 24:00 1:00 D Rule Japan 1950 1951 - May Sat>=1 24:00 1:00 D -# From Hideyuki Suzuki (1998-11-09): -# 'Tokyo' usually stands for the former location of Tokyo Astronomical -# Observatory: 139° 44' 40.90" E (9h 18m 58.727s), 35° 39' 16.0" N. -# This data is from 'Rika Nenpyou (Chronological Scientific Tables) 1996' -# edited by National Astronomical Observatory of Japan.... -# JST (Japan Standard Time) has been used since 1888-01-01 00:00 (JST). -# The law is enacted on 1886-07-07. - -# From Hideyuki Suzuki (1998-11-16): -# The ordinance No. 51 (1886) established "standard time" in Japan, -# which stands for the time on 135° E. -# In the ordinance No. 167 (1895), "standard time" was renamed to "central -# standard time". And the same ordinance also established "western standard -# time", which stands for the time on 120° E.... But "western standard -# time" was abolished in the ordinance No. 529 (1937). In the ordinance No. -# 167, there is no mention regarding for what place western standard time is -# standard.... -# -# I wrote "ordinance" above, but I don't know how to translate. -# In Japanese it's "chokurei", which means ordinance from emperor. - -# From Yu-Cheng Chuang (2013-07-12): -# ...the Meiji Emperor announced Ordinance No. 167 of Meiji Year 28 "The clause -# about standard time" ... The adoption began from Jan 1, 1896. -# https://ja.wikisource.org/wiki/標準時ニ關スル件_(公布時) -# -# ...the Showa Emperor announced Ordinance No. 529 of Showa Year 12 ... which -# means the whole Japan territory, including later occupations, adopt Japan -# Central Time (UT+9). The adoption began on Oct 1, 1937. -# https://ja.wikisource.org/wiki/明治二十八年勅令第百六十七號標準時ニ關スル件中改正ノ件 - # Zone NAME STDOFF RULES FORMAT [UNTIL] Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 31 15:00u 9:00 Japan J%sT @@ -3086,22 +3198,9 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # [T]he Palestinian cabinet decision (Mar 8th 2016) published on # http://www.palestinecabinet.gov.ps/WebSite/Upload/Decree/GOV_17/16032016134830.pdf # states that summer time will end on Oct 29th at 01:00. -# -# From Tim Parenti (2016-10-19): -# Predict fall transitions on October's last Saturday at 01:00 from now on. -# This is consistent with the 2016 transition as well as our spring -# predictions. -# -# From Paul Eggert (2016-10-19): -# It's also consistent with predictions in the following URLs today: -# https://www.timeanddate.com/time/change/gaza-strip/gaza -# https://www.timeanddate.com/time/change/west-bank/hebron # From Sharef Mustafa (2018-03-16): -# Palestine summer time will start on Mar 24th 2018 by advancing the -# clock by 60 minutes as per Palestinian cabinet decision published on -# the official website, though the decree did not specify the exact -# time of the time shift. +# Palestine summer time will start on Mar 24th 2018 ... # http://www.palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e7a42ab7-ee23-435a-b9c8-a4f7e81f3817 # From Even Scharning (2019-03-23): @@ -3111,15 +3210,20 @@ Zone Asia/Karachi 4:28:12 - LMT 1907 # From Sharif Mustafa (2019-03-26): # The Palestinian cabinet announced today that the switch to DST will # be on Fri Mar 29th 2019 by advancing the clock by 60 minutes. -# The decree signing date is Mar 12th but it was not published till today. -# The decree does not specify the exact time of switch. # http://palestinecabinet.gov.ps/Website/AR/NDecrees/ViewFile.ashx?ID=e54e9ea1-50ee-4137-84df-0d6c78da259b # # From Even Scharning (2019-04-10): # Our source in Palestine said it happened Friday 29 at 00:00 local time.... + +# From Sharef Mustafa (2019-10-18): +# Palestine summer time will end on midnight Oct 26th 2019 ... +# http://www.palestinecabinet.gov.ps/website/ar/ViewDetails?ID=43948 # # From Paul Eggert (2019-04-10): # For now, guess spring-ahead transitions are March's last Friday at 00:00. +# +# From Tim Parenti (2016-10-19): +# Predict fall transitions on October's last Saturday at 01:00 from now on. # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule EgyptAsia 1957 only - May 10 0:00 1:00 S Modified: releng/11.3/contrib/tzdata/backward ============================================================================== --- releng/11.3/contrib/tzdata/backward Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/backward Tue May 12 16:44:13 2020 (r360969) @@ -17,6 +17,7 @@ Link America/Atikokan America/Coral_Harbour Link America/Argentina/Cordoba America/Cordoba Link America/Tijuana America/Ensenada Link America/Indiana/Indianapolis America/Fort_Wayne +Link America/Nuuk America/Godthab Link America/Indiana/Indianapolis America/Indianapolis Link America/Argentina/Jujuy America/Jujuy Link America/Indiana/Knox America/Knox_IN Modified: releng/11.3/contrib/tzdata/backzone ============================================================================== --- releng/11.3/contrib/tzdata/backzone Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/backzone Tue May 12 16:44:13 2020 (r360969) @@ -33,6 +33,35 @@ # assumes rules from other files. In the tz distribution, use # 'make PACKRATDATA=backzone zones' to compile and install this file. + +# From Paul Eggert (2020-04-15): +# The following remarks should be incorporated into this table sometime. +# Patches in 'git format-patch' format would be welcome. +# +# From Phake Nick (2020-04-15): +# ... the historical timezone data for those China zones seems to be +# incorrect. The transition to GMT+8 date given there for these zones +# were 1980 which also contradict the file description that they do +# not disagree with normal zone after 1970. According to sources that +# have also been cited in the asia file, except Xinjiang and Tibet, +# they should have adopted the Beijing Time from around 1949/1950 +# depends on exactly when each of those cities were taken over by the +# communist army. And they should also follow the DST setting of +# Asia/Shanghai after that point of time. In addition, +# http://gaz.ncl.edu.tw/detail.jsp?sysid=E1091792 the document from +# Chongqing Nationalist government say in year 1945 all of China +# should adopt summer time due to the war (not sure whether it +# continued after WWII ends)(Probably only enforced in area under +# their rule at the time?) The Asia/Harbin's 1932 and 1940 entry +# should also be incorrect. As per sources recorded at +# https://wiki.suikawiki.org/n/%E6%BA%80%E5%B7%9E%E5%9B%BD%E3%81%AE%E6%A8%99%E6%BA%96%E6%99%82 +# , in 1932 Harbin should have adopted UTC+8:00 instead of data +# currently listed in the tz database according to official +# announcement from Manchuko. And they should have adopted GMT+9 in +# 1937 January 1st according to official announcement at the time +# being cited on the webpage. + + # Zones are sorted by zone name. Each zone is preceded by the # name of the country that the zone is in, along with any other # commentary and rules associated with the entry. Modified: releng/11.3/contrib/tzdata/europe ============================================================================== --- releng/11.3/contrib/tzdata/europe Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/europe Tue May 12 16:44:13 2020 (r360969) @@ -549,12 +549,13 @@ Zone Europe/Dublin -0:25:00 - LMT 1880 Aug 2 0:00 1:00 IST 1947 Nov 2 2:00s 0:00 - GMT 1948 Apr 18 2:00s 0:00 GB-Eire GMT/IST 1968 Oct 27 -# The next line is for when negative SAVE values are used. +# Vanguard section, for zic and other parsers that support negative DST. 1:00 Eire IST/GMT -# These three lines are for when SAVE values are always nonnegative. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 1:00 - IST 1971 Oct 31 2:00u # 0:00 GB-Eire GMT/IST 1996 # 0:00 EU GMT/IST +# End of rearguard section. ############################################################################### @@ -1018,7 +1019,7 @@ Zone Europe/Prague 0:57:44 - LMT 1850 1:00 Czech CE%sT 1946 Dec 1 3:00 # Vanguard section, for zic and other parsers that support negative DST. 1:00 -1:00 GMT 1947 Feb 23 2:00 -# Rearguard section, for parsers that do not support negative DST. +# Rearguard section, for parsers lacking negative DST; see ziguard.awk. # 0:00 - GMT 1947 Feb 23 2:00 # End of rearguard section. 1:00 Czech CE%sT 1979 @@ -1175,14 +1176,17 @@ Zone America/Danmarkshavn -1:14:40 - LMT 1916 Jul 28 -3:00 - -03 1980 Apr 6 2:00 -3:00 EU -03/-02 1996 0:00 - GMT +# +# Use the old name Scoresbysund, as the current name Ittoqqortoormiit +# exceeds tzdb's 14-letter limit and has no common English abbreviation. Zone America/Scoresbysund -1:27:52 - LMT 1916 Jul 28 # Ittoqqortoormiit -2:00 - -02 1980 Apr 6 2:00 -2:00 C-Eur -02/-01 1981 Mar 29 -1:00 EU -01/+00 -Zone America/Godthab -3:26:56 - LMT 1916 Jul 28 # Nuuk +Zone America/Nuuk -3:26:56 - LMT 1916 Jul 28 # Godthåb -3:00 - -03 1980 Apr 6 2:00 -3:00 EU -03/-02 -Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik air base +Zone America/Thule -4:35:08 - LMT 1916 Jul 28 # Pituffik -4:00 Thule A%sT # Estonia @@ -1552,7 +1556,7 @@ Zone Europe/Budapest 1:16:20 - LMT 1890 Oct # # From January 1st, 1908 the whole of Iceland was standardised at 1 hour # behind GMT. Previously, local mean solar time was used in different parts -# of Iceland, the almanak had been based on Reykjavik mean solar time which +# of Iceland, the almanak had been based on Reykjavík mean solar time which # was 1 hour and 28 minutes behind GMT. # # "first day of winter" referred to [below] means the first day of the 26 weeks Modified: releng/11.3/contrib/tzdata/leap-seconds.list ============================================================================== --- releng/11.3/contrib/tzdata/leap-seconds.list Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/leap-seconds.list Tue May 12 16:44:13 2020 (r360969) @@ -62,7 +62,7 @@ # Terry Quinn, "The BIPM and the Accurate Measurement # of Time," Proc. of the IEEE, Vol. 79, pp. 894-905, # July, 1991. -# reprinted in: +# reprinted in: # Christine Hackman and Donald B Sullivan (eds.) # Time and Frequency Measurement # American Association of Physics Teachers (1996) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea Modified: releng/11.3/contrib/tzdata/leapseconds ============================================================================== --- releng/11.3/contrib/tzdata/leapseconds Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/leapseconds Tue May 12 16:44:13 2020 (r360969) @@ -64,9 +64,15 @@ Leap 2012 Jun 30 23:59:60 + S Leap 2015 Jun 30 23:59:60 + S Leap 2016 Dec 31 23:59:60 + S +# UTC timestamp when this leap second list expires. +# Any additional leap seconds will come after this. +# This Expires line is commented out for now, +# so that pre-2020a zic implementations do not reject this file. +#Expires 2020 Dec 28 00:00:00 + # POSIX timestamps for the data in this file: #updated 1467936000 (2016-07-08 00:00:00 UTC) -#expires 1593302400 (2020-06-28 00:00:00 UTC) +#expires 1609113600 (2020-12-28 00:00:00 UTC) -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 Modified: releng/11.3/contrib/tzdata/leapseconds.awk ============================================================================== --- releng/11.3/contrib/tzdata/leapseconds.awk Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/leapseconds.awk Tue May 12 16:44:13 2020 (r360969) @@ -68,12 +68,12 @@ BEGIN { monthabbr[11] = "Nov" monthabbr[12] = "Dec" - # Strip trailing CR, in case the input has CRLF form a la NIST. - RS = "\r?\n" - sstamp_init() } +# In case the input has CRLF form a la NIST. +{ sub(/\r$/, "") } + /^#[ \t]*[Uu]pdated through/ || /^#[ \t]*[Ff]ile expires on/ { last_lines = last_lines $0 "\n" } @@ -100,6 +100,17 @@ BEGIN { } END { + sstamp_to_ymdhMs(expires, ss_NTP) + + print "" + print "# UTC timestamp when this leap second list expires." + print "# Any additional leap seconds will come after this." + print "# This Expires line is commented out for now," + print "# so that pre-2020a zic implementations do not reject this file." + printf "%sExpires %.4d\t%s\t%.2d\t%.2d:%.2d:%.2d\n", \ + EXPIRES_LINE ? "" : "#", \ + ss_year, monthabbr[ss_month], ss_mday, ss_hour, ss_min, ss_sec + # The difference between the NTP and POSIX epochs is 70 years # (including 17 leap days), each 24 hours of 60 minutes of 60 # seconds each. Modified: releng/11.3/contrib/tzdata/northamerica ============================================================================== --- releng/11.3/contrib/tzdata/northamerica Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/northamerica Tue May 12 16:44:13 2020 (r360969) @@ -86,7 +86,7 @@ # For more about the first ten years of DST in the United States, see # Robert Garland, Ten years of daylight saving from the Pittsburgh standpoint # (Carnegie Library of Pittsburgh, 1927). -# http://www.clpgh.org/exhibit/dst.html +# https://web.archive.org/web/20160517155308/http://www.clpgh.org/exhibit/dst.html # # Shanks says that DST was called "War Time" in the US in 1918 and 1919. # However, DST was imposed by the Standard Time Act of 1918, which @@ -1470,7 +1470,8 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Val -4:00 Canada A%sT -# west Labrador, Nova Scotia, Prince Edward I +# west Labrador, Nova Scotia, Prince Edward I, +# Îles-de-la-Madeleine, Listuguj reserve # From Brian Inglis (2015-07-20): # From the historical weather station records available at: @@ -1489,6 +1490,13 @@ Zone America/Goose_Bay -4:01:40 - LMT 1884 # Happy Val # in Canada to observe DST in 1971 but not 1970; for now we'll assume # this is a typo. +# From Jeffery Nichols (2020-01-09): +# America/Halifax ... also applies to Îles-de-la-Madeleine and the Listuguj +# reserve in Quebec. Officially, this came into effect on January 1, 2007 +# (Legal Time Act, CQLR c T-5.1), but the legislative debates surrounding that +# bill say that it is "accommodating the customs and practices" of those +# regions, which suggests that they have always been in-line with Halifax. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Halifax 1916 only - Apr 1 0:00 1:00 D Rule Halifax 1916 only - Oct 1 0:00 0 S @@ -1582,19 +1590,20 @@ Zone America/Moncton -4:19:08 - LMT 1883 Dec 9 # Quebec -# From Paul Eggert (2015-03-24): +# From Paul Eggert (2020-01-10): # See America/Toronto for most of Quebec, including Montreal. +# See America/Halifax for the Îles de la Madeleine and the Listuguj reserve. # # Matthews and Vincent (1998) also write that Quebec east of the -63 # meridian is supposed to observe AST, but residents as far east as # Natashquan use EST/EDT, and residents east of Natashquan use AST. # The Quebec department of justice writes in # "The situation in Minganie and Basse-Côte-Nord" -# http://www.justice.gouv.qc.ca/english/publications/generale/temps-minganie-a.htm +# https://www.justice.gouv.qc.ca/en/department/ministre/functions-and-responsabilities/legal-time-in-quebec/the-situation-in-minganie-and-basse-cote-nord/ # that the coastal strip from just east of Natashquan to Blanc-Sablon # observes Atlantic standard time all year round. -# https://www.assnat.qc.ca/Media/Process.aspx?MediaId=ANQ.Vigie.Bll.DocumentGenerique_8845en -# says this common practice was codified into law as of 2007. +# This common practice was codified into law as of 2007; see Legal Time Act, +# CQLR c T-5.1 . # For lack of better info, guess this practice began around 1970, contra to # Shanks & Pottenger who have this region observing AST/ADT. @@ -1613,6 +1622,15 @@ Zone America/Blanc-Sablon -3:48:28 - LMT 1884 # Nipigon (EST) and Rainy River (CST) are the largest that we know of. # Far west Ontario is like Winnipeg; far east Quebec is like Halifax. +# From Jeffery Nichols (2020-02-06): +# According to the [Shanks] atlas, those western Ontario zones are huge, +# covering most of Ontario northwest of Sault Ste Marie and Timmins. +# The zones seem to include towns bigger than the ones they're named after, +# like Dryden in America/Rainy_River and Wawa (and maybe Attawapiskat) in +# America/Nipigon. I assume it's too much trouble to change the name of the +# zone (like when you found out that America/Glace_Bay includes Sydney, Nova +# Scotia).... + # From Mark Brader (2003-07-26): # [According to the Toronto Star] Orillia, Ontario, adopted DST # effective Saturday, 1912-06-22, 22:00; the article mentions that @@ -2419,6 +2437,18 @@ Zone America/Creston -7:46:04 - LMT 1884 # obtained in November 2008 should be ignored... # I apologize for reporting incorrect information in 2008. +# From Tim Parenti (2020-03-05): +# The government of Yukon announced [yesterday] the cessation of seasonal time +# changes. "After clocks are pushed ahead one hour on March 8, the territory +# will remain on [UTC-07]. ... [The government] found 93 per cent of +# respondents wanted to end seasonal time changes and, of that group, 70 per +# cent wanted 'permanent Pacific Daylight Saving Time.'" +# https://www.cbc.ca/news/canada/north/yukon-end-daylight-saving-time-1.5486358 +# +# Although the government press release prefers PDT, we prefer MST for +# consistency with nearby Dawson Creek, Creston, and Fort Nelson. +# https://yukon.ca/en/news/yukon-end-seasonal-time-change + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule NT_YK 1918 only - Apr 14 2:00 1:00 D Rule NT_YK 1918 only - Oct 27 2:00 0 S @@ -2473,11 +2503,13 @@ Zone America/Inuvik 0 - -00 1953 # Inuvik founded Zone America/Whitehorse -9:00:12 - LMT 1900 Aug 20 -9:00 NT_YK Y%sT 1967 May 28 0:00 -8:00 NT_YK P%sT 1980 - -8:00 Canada P%sT + -8:00 Canada P%sT 2020 Mar 8 2:00 + -7:00 - MST Zone America/Dawson -9:17:40 - LMT 1900 Aug 20 -9:00 NT_YK Y%sT 1973 Oct 28 0:00 -8:00 NT_YK P%sT 1980 - -8:00 Canada P%sT + -8:00 Canada P%sT 2020 Mar 8 2:00 + -7:00 - MST ############################################################################### Modified: releng/11.3/contrib/tzdata/theory.html ============================================================================== --- releng/11.3/contrib/tzdata/theory.html Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/theory.html Tue May 12 16:44:13 2020 (r360969) @@ -298,6 +298,10 @@ in decreasing order of importance: If a name is changed, put its old spelling in the 'backward' file. This means old spellings will continue to work. + Ordinarily a name change should occur only in the rare case when + a location's consensus English-language spelling changes; for example, + in 2008 Asia/Calcutta was renamed to Asia/Kolkata + due to long-time widespread use of the new city name instead of the old. @@ -1054,23 +1058,6 @@ an older zic. The functions were inspired by NetBSD.
  • - A function tzsetwall has been added to arrange for the - system's best approximation to local (wall clock) time to be delivered - by subsequent calls to localtime. - Source code for portable applications that "must" run on local - time should call tzsetwall; - if such code is moved to "old" systems that do not - provide tzsetwall, you will not be able to generate an - executable program. - (These functions also arrange for local time to - be used if tzset is called – directly or - indirectly – and there is no TZ environment - variable; portable applications should not, however, rely on this - behavior since it is not the way SVR2 - systems behave.) -
  • -
  • Negative time_t values are supported, on systems where time_t is signed.
  • @@ -1137,7 +1124,7 @@ The vestigial APIs are: may now examine localtime(&clock)->tm_zone (if TM_ZONE is defined) or tzname[localtime(&clock)->tm_isdst] - (if HAVE_TZNAME is defined) to learn the correct time + (if HAVE_TZNAME is nonzero) to learn the correct time zone abbreviation to use.
  • Modified: releng/11.3/contrib/tzdata/version ============================================================================== --- releng/11.3/contrib/tzdata/version Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/version Tue May 12 16:44:13 2020 (r360969) @@ -1 +1 @@ -2019c +2020a Modified: releng/11.3/contrib/tzdata/zone.tab ============================================================================== --- releng/11.3/contrib/tzdata/zone.tab Tue May 12 16:38:28 2020 (r360968) +++ releng/11.3/contrib/tzdata/zone.tab Tue May 12 16:44:13 2020 (r360969) @@ -131,8 +131,8 @@ CA +4906-11631 America/Creston MST - BC (Creston) CA +5946-12014 America/Dawson_Creek MST - BC (Dawson Cr, Ft St John) CA +5848-12242 America/Fort_Nelson MST - BC (Ft Nelson) CA +4916-12307 America/Vancouver Pacific - BC (most areas) -CA +6043-13503 America/Whitehorse Pacific - Yukon (south) -CA +6404-13925 America/Dawson Pacific - Yukon (north) +CA +6043-13503 America/Whitehorse Pacific - Yukon (east) +CA +6404-13925 America/Dawson Pacific - Yukon (west) CC -1210+09655 Indian/Cocos *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Tue May 12 16:46:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44D472F4428; Tue, 12 May 2020 16:46:15 +0000 (UTC) (envelope-from gordon@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 49M3bW17wQz4Spd; Tue, 12 May 2020 16:46:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 224C4B0EE; Tue, 12 May 2020 16:46:15 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGkFaa057690; Tue, 12 May 2020 16:46:15 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGkFYf057689; Tue, 12 May 2020 16:46:15 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121646.04CGkFYf057689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:46:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360970 - releng/12.1/sys/dev/e1000 X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.1/sys/dev/e1000 X-SVN-Commit-Revision: 360970 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:46:15 -0000 Author: gordon Date: Tue May 12 16:46:14 2020 New Revision: 360970 URL: https://svnweb.freebsd.org/changeset/base/360970 Log: Fix igb interfaces failing to switch to inactive state. Approved by: so Security: FreeBSD-EN-20:09.igb Modified: releng/12.1/sys/dev/e1000/if_em.c Modified: releng/12.1/sys/dev/e1000/if_em.c ============================================================================== --- releng/12.1/sys/dev/e1000/if_em.c Tue May 12 16:44:13 2020 (r360969) +++ releng/12.1/sys/dev/e1000/if_em.c Tue May 12 16:46:14 2020 (r360970) @@ -1395,10 +1395,8 @@ em_intr(void *arg) IFDI_INTR_DISABLE(ctx); /* Link status change */ - if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { - adapter->hw.mac.get_link_status = 1; - iflib_admin_intr_deferred(ctx); - } + if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) + em_handle_link(ctx); if (reg_icr & E1000_ICR_RXO) adapter->rx_overruns++; @@ -1481,22 +1479,24 @@ em_msix_link(void *arg) if (reg_icr & (E1000_ICR_RXSEQ | E1000_ICR_LSC)) { em_handle_link(adapter->ctx); - } else { - E1000_WRITE_REG(&adapter->hw, E1000_IMS, - EM_MSIX_LINK | E1000_IMS_LSC); - if (adapter->hw.mac.type >= igb_mac_min) - E1000_WRITE_REG(&adapter->hw, E1000_EIMS, adapter->link_mask); + } else if (adapter->hw.mac.type == e1000_82574) { + /* Only re-arm 82574 if em_if_update_admin_status() won't. */ + E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | + E1000_IMS_LSC); } - /* - * Because we must read the ICR for this interrupt - * it may clear other causes using autoclear, for - * this reason we simply create a soft interrupt - * for all these vectors. - */ - if (reg_icr && adapter->hw.mac.type < igb_mac_min) { - E1000_WRITE_REG(&adapter->hw, - E1000_ICS, adapter->ims); + if (adapter->hw.mac.type == e1000_82574) { + /* + * Because we must read the ICR for this interrupt it may + * clear other causes using autoclear, for this reason we + * simply create a soft interrupt for all these vectors. + */ + if (reg_icr) + E1000_WRITE_REG(&adapter->hw, E1000_ICS, adapter->ims); + } else { + /* Re-arm unconditionally */ + E1000_WRITE_REG(&adapter->hw, E1000_IMS, E1000_IMS_LSC); + E1000_WRITE_REG(&adapter->hw, E1000_EIMS, adapter->link_mask); } return (FILTER_HANDLED); @@ -1512,7 +1512,6 @@ em_handle_link(void *context) iflib_admin_intr_deferred(ctx); } - /********************************************************************* * * Media Ioctl callback @@ -1829,14 +1828,15 @@ em_if_update_admin_status(if_ctx_t ctx) em_update_stats_counters(adapter); /* Reset LAA into RAR[0] on 82571 */ - if ((adapter->hw.mac.type == e1000_82571) && - e1000_get_laa_state_82571(&adapter->hw)) - e1000_rar_set(&adapter->hw, adapter->hw.mac.addr, 0); + if (hw->mac.type == e1000_82571 && e1000_get_laa_state_82571(hw)) + e1000_rar_set(hw, hw->mac.addr, 0); - if (adapter->hw.mac.type < em_mac_min) + if (hw->mac.type < em_mac_min) lem_smartspeed(adapter); - - E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | E1000_IMS_LSC); + else if (hw->mac.type == e1000_82574 && + adapter->intr_type == IFLIB_INTR_MSIX) + E1000_WRITE_REG(&adapter->hw, E1000_IMS, EM_MSIX_LINK | + E1000_IMS_LSC); } static void From owner-svn-src-all@freebsd.org Tue May 12 16:49:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EC072F44D8; Tue, 12 May 2020 16:49:05 +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 49M3fn2q5Wz4Syy; Tue, 12 May 2020 16:49:05 +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 5C060B0F1; Tue, 12 May 2020 16:49:05 +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 04CGn5FH057907; Tue, 12 May 2020 16:49:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGn5Pp057906; Tue, 12 May 2020 16:49:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121649.04CGn5Pp057906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:49: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: r360971 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:49:05 -0000 Author: emaste Date: Tue May 12 16:49:04 2020 New Revision: 360971 URL: https://svnweb.freebsd.org/changeset/base/360971 Log: MFC r360967: libalias: validate packet lengths before accessing headers admbugs: 956 Submitted by: ae Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative Reported by: Vishnu working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:12.libalias Security: CVE-2020-7454 Security: ZDI-CAN-10624, ZDI-CAN-10850 Modified: stable/11/sys/netinet/libalias/alias.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/netinet/libalias/alias.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/netinet/libalias/alias.c ============================================================================== --- stable/11/sys/netinet/libalias/alias.c Tue May 12 16:46:14 2020 (r360970) +++ stable/11/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) @@ -439,10 +439,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -461,6 +466,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -729,10 +737,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -821,12 +836,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -919,8 +941,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1039,7 +1066,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1048,6 +1075,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-all@freebsd.org Tue May 12 16:49:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2DEB12F44D4; Tue, 12 May 2020 16:49:05 +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 49M3fn0RTKz4Syx; Tue, 12 May 2020 16:49:05 +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 0A4FCB0F0; Tue, 12 May 2020 16:49:05 +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 04CGn44e057901; Tue, 12 May 2020 16:49:04 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGn4OM057900; Tue, 12 May 2020 16:49:04 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121649.04CGn4OM057900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:49: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: r360971 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360971 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:49:05 -0000 Author: emaste Date: Tue May 12 16:49:04 2020 New Revision: 360971 URL: https://svnweb.freebsd.org/changeset/base/360971 Log: MFC r360967: libalias: validate packet lengths before accessing headers admbugs: 956 Submitted by: ae Reported by: Lucas Leong (@_wmliang_) of Trend Micro Zero Day Initiative Reported by: Vishnu working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:12.libalias Security: CVE-2020-7454 Security: ZDI-CAN-10624, ZDI-CAN-10850 Modified: stable/12/sys/netinet/libalias/alias.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/netinet/libalias/alias.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/netinet/libalias/alias.c ============================================================================== --- stable/12/sys/netinet/libalias/alias.c Tue May 12 16:46:14 2020 (r360970) +++ stable/12/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) @@ -441,10 +441,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -463,6 +468,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -731,10 +739,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -823,12 +838,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -921,8 +943,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1041,7 +1068,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1050,6 +1077,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-all@freebsd.org Tue May 12 16:51:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4063C2F45E2; Tue, 12 May 2020 16:51:12 +0000 (UTC) (envelope-from gordon@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 49M3jD11t7z4TPf; Tue, 12 May 2020 16:51:12 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1E59AB133; Tue, 12 May 2020 16:51:12 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGpC8v059018; Tue, 12 May 2020 16:51:12 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGpBXT059015; Tue, 12 May 2020 16:51:11 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121651.04CGpBXT059015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:51:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360972 - in releng: 11.3/sys/netinet/libalias 11.4/sys/netinet/libalias 12.1/sys/netinet/libalias X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/netinet/libalias 11.4/sys/netinet/libalias 12.1/sys/netinet/libalias X-SVN-Commit-Revision: 360972 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:51:12 -0000 Author: gordon Date: Tue May 12 16:51:11 2020 New Revision: 360972 URL: https://svnweb.freebsd.org/changeset/base/360972 Log: Fix insufficient packet length validation in libalias. Approved by: so Approved by: re (implicit) Security: FreeBSD-SA-20:12.libalias Security: CVE-2020-7454 Modified: releng/11.3/sys/netinet/libalias/alias.c releng/11.4/sys/netinet/libalias/alias.c releng/12.1/sys/netinet/libalias/alias.c Modified: releng/11.3/sys/netinet/libalias/alias.c ============================================================================== --- releng/11.3/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) +++ releng/11.3/sys/netinet/libalias/alias.c Tue May 12 16:51:11 2020 (r360972) @@ -439,10 +439,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -461,6 +466,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -729,10 +737,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -821,12 +836,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -919,8 +941,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1039,7 +1066,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1048,6 +1075,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) Modified: releng/11.4/sys/netinet/libalias/alias.c ============================================================================== --- releng/11.4/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) +++ releng/11.4/sys/netinet/libalias/alias.c Tue May 12 16:51:11 2020 (r360972) @@ -439,10 +439,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -461,6 +466,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -729,10 +737,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -821,12 +836,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -919,8 +941,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1039,7 +1066,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1048,6 +1075,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) Modified: releng/12.1/sys/netinet/libalias/alias.c ============================================================================== --- releng/12.1/sys/netinet/libalias/alias.c Tue May 12 16:49:04 2020 (r360971) +++ releng/12.1/sys/netinet/libalias/alias.c Tue May 12 16:51:11 2020 (r360972) @@ -441,10 +441,15 @@ fragment contained in ICMP data section */ static int IcmpAliasIn(struct libalias *la, struct ip *pip) { - int iresult; struct icmp *ic; + int dlen, iresult; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < ICMP_MINLEN) + return (PKT_ALIAS_IGNORED); + /* Return if proxy-only mode is enabled */ if (la->packetAliasMode & PKT_ALIAS_PROXY_ONLY) return (PKT_ALIAS_OK); @@ -463,6 +468,9 @@ IcmpAliasIn(struct libalias *la, struct ip *pip) case ICMP_SOURCEQUENCH: case ICMP_TIMXCEED: case ICMP_PARAMPROB: + if (dlen < ICMP_ADVLENMIN || + dlen < ICMP_ADVLEN(ic)) + return (PKT_ALIAS_IGNORED); iresult = IcmpAliasIn2(la, pip); break; case ICMP_ECHO: @@ -731,10 +739,17 @@ UdpAliasIn(struct libalias *la, struct ip *pip) { struct udphdr *ud; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, ud->uh_sport, ud->uh_dport, @@ -823,12 +838,19 @@ UdpAliasOut(struct libalias *la, struct ip *pip, int m u_short dest_port; u_short proxy_server_port; int proxy_type; - int error; + int dlen, error; LIBALIAS_LOCK_ASSERT(la); /* Return if proxy-only mode is enabled and not proxyrule found.*/ + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct udphdr)) + return (PKT_ALIAS_IGNORED); + ud = (struct udphdr *)ip_next(pip); + if (dlen < ntohs(ud->uh_ulen)) + return (PKT_ALIAS_IGNORED); + proxy_type = ProxyCheck(la, &proxy_server_address, &proxy_server_port, pip->ip_src, pip->ip_dst, ud->uh_dport, pip->ip_p); @@ -921,8 +943,13 @@ TcpAliasIn(struct libalias *la, struct ip *pip) { struct tcphdr *tc; struct alias_link *lnk; + int dlen; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); lnk = FindUdpTcpIn(la, pip->ip_src, pip->ip_dst, @@ -1041,7 +1068,7 @@ TcpAliasIn(struct libalias *la, struct ip *pip) static int TcpAliasOut(struct libalias *la, struct ip *pip, int maxpacketsize, int create) { - int proxy_type, error; + int dlen, proxy_type, error; u_short dest_port; u_short proxy_server_port; struct in_addr dest_address; @@ -1050,6 +1077,10 @@ TcpAliasOut(struct libalias *la, struct ip *pip, int m struct alias_link *lnk; LIBALIAS_LOCK_ASSERT(la); + + dlen = ntohs(pip->ip_len) - (pip->ip_hl << 2); + if (dlen < sizeof(struct tcphdr)) + return (PKT_ALIAS_IGNORED); tc = (struct tcphdr *)ip_next(pip); if (create) From owner-svn-src-all@freebsd.org Tue May 12 16:52:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B40A82F477C; Tue, 12 May 2020 16:52:08 +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 49M3kJ4Hcrz4TbB; Tue, 12 May 2020 16:52:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E778B293; Tue, 12 May 2020 16:52:08 +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 04CGq8mi060532; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGq8ZW060531; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121652.04CGq8ZW060531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:52:08 +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: r360973 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:52:08 -0000 Author: emaste Date: Tue May 12 16:52:08 2020 New Revision: 360973 URL: https://svnweb.freebsd.org/changeset/base/360973 Log: MFC r360968: libalias: fix potential memory disclosure from ftp module admbugs: 956 Submitted by: markj Reported by: Vishnu Dev TJ working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Security: ZDI-CAN-10849 Modified: stable/12/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/netinet/libalias/alias_ftp.c ============================================================================== --- stable/12/sys/netinet/libalias/alias_ftp.c Tue May 12 16:51:11 2020 (r360972) +++ stable/12/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) @@ -754,7 +754,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-all@freebsd.org Tue May 12 16:52:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D3F92F4785; Tue, 12 May 2020 16:52:09 +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 49M3kJ6fZdz4TbD; Tue, 12 May 2020 16:52:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DF8E9B294; Tue, 12 May 2020 16:52:08 +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 04CGq8mr060538; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGq8SC060537; Tue, 12 May 2020 16:52:08 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005121652.04CGq8SC060537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 16:52: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: r360973 - in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in stable: 11/sys/netinet/libalias 12/sys/netinet/libalias X-SVN-Commit-Revision: 360973 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:52:09 -0000 Author: emaste Date: Tue May 12 16:52:08 2020 New Revision: 360973 URL: https://svnweb.freebsd.org/changeset/base/360973 Log: MFC r360968: libalias: fix potential memory disclosure from ftp module admbugs: 956 Submitted by: markj Reported by: Vishnu Dev TJ working with Trend Micro Zero Day Initiative Approved by: so Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Security: ZDI-CAN-10849 Modified: stable/11/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/netinet/libalias/alias_ftp.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/netinet/libalias/alias_ftp.c ============================================================================== --- stable/11/sys/netinet/libalias/alias_ftp.c Tue May 12 16:51:11 2020 (r360972) +++ stable/11/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) @@ -752,7 +752,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-all@freebsd.org Tue May 12 16:54:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C4262F4898; Tue, 12 May 2020 16:54:40 +0000 (UTC) (envelope-from gordon@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 49M3nD3DrGz4TsP; Tue, 12 May 2020 16:54:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 51276B2CC; Tue, 12 May 2020 16:54:40 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGseXl063737; Tue, 12 May 2020 16:54:40 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGsdi3063734; Tue, 12 May 2020 16:54:39 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121654.04CGsdi3063734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:54:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360974 - in releng: 11.3/sys/netinet/libalias 11.4/sys/netinet/libalias 12.1/sys/netinet/libalias X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/netinet/libalias 11.4/sys/netinet/libalias 12.1/sys/netinet/libalias X-SVN-Commit-Revision: 360974 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:54:40 -0000 Author: gordon Date: Tue May 12 16:54:39 2020 New Revision: 360974 URL: https://svnweb.freebsd.org/changeset/base/360974 Log: Fix memory disclosure vulnerability in libalias. Approved by: so Approved by: re (implicit) Security: FreeBSD-SA-20:13.libalias Security: CVE-2020-7455 Modified: releng/11.3/sys/netinet/libalias/alias_ftp.c releng/11.4/sys/netinet/libalias/alias_ftp.c releng/12.1/sys/netinet/libalias/alias_ftp.c Modified: releng/11.3/sys/netinet/libalias/alias_ftp.c ============================================================================== --- releng/11.3/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) +++ releng/11.3/sys/netinet/libalias/alias_ftp.c Tue May 12 16:54:39 2020 (r360974) @@ -752,7 +752,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, Modified: releng/11.4/sys/netinet/libalias/alias_ftp.c ============================================================================== --- releng/11.4/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) +++ releng/11.4/sys/netinet/libalias/alias_ftp.c Tue May 12 16:54:39 2020 (r360974) @@ -752,7 +752,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, Modified: releng/12.1/sys/netinet/libalias/alias_ftp.c ============================================================================== --- releng/12.1/sys/netinet/libalias/alias_ftp.c Tue May 12 16:52:08 2020 (r360973) +++ releng/12.1/sys/netinet/libalias/alias_ftp.c Tue May 12 16:54:39 2020 (r360974) @@ -754,7 +754,8 @@ NewFtpMessage(struct libalias *la, struct ip *pip, { u_short new_len; - new_len = htons(hlen + slen); + new_len = htons(hlen + + MIN(slen, maxpacketsize - hlen)); DifferentialChecksum(&pip->ip_sum, &new_len, &pip->ip_len, From owner-svn-src-all@freebsd.org Tue May 12 16:55:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5A8FD2F48F9; Tue, 12 May 2020 16:55:33 +0000 (UTC) (envelope-from gordon@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 49M3pF1jL5z4V0p; Tue, 12 May 2020 16:55:33 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 35BDBB2DB; Tue, 12 May 2020 16:55:33 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGtWMj063860; Tue, 12 May 2020 16:55:32 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGtWYR063859; Tue, 12 May 2020 16:55:32 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121655.04CGtWYR063859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360975 - releng/11.3/sys/netinet X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/11.3/sys/netinet X-SVN-Commit-Revision: 360975 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:55:33 -0000 Author: gordon Date: Tue May 12 16:55:32 2020 New Revision: 360975 URL: https://svnweb.freebsd.org/changeset/base/360975 Log: Fix improper checking in SCTP-AUTH shared key update. Approved by: so Security: FreeBSD-SA-20:14.sctp Security: CVE-2019-15878 Modified: releng/11.3/sys/netinet/sctp_auth.c Modified: releng/11.3/sys/netinet/sctp_auth.c ============================================================================== --- releng/11.3/sys/netinet/sctp_auth.c Tue May 12 16:54:39 2020 (r360974) +++ releng/11.3/sys/netinet/sctp_auth.c Tue May 12 16:55:32 2020 (r360975) @@ -521,7 +521,7 @@ sctp_insert_sharedkey(struct sctp_keyhead *shared_keys } else if (new_skey->keyid == skey->keyid) { /* replace the existing key */ /* verify this key *can* be replaced */ - if ((skey->deactivated) && (skey->refcount > 1)) { + if ((skey->deactivated) || (skey->refcount > 1)) { SCTPDBG(SCTP_DEBUG_AUTH1, "can't replace shared key id %u\n", new_skey->keyid); From owner-svn-src-all@freebsd.org Tue May 12 16:57:48 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 557E82F4A66; Tue, 12 May 2020 16:57:48 +0000 (UTC) (envelope-from gordon@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 49M3rr1Z1wz4VCj; Tue, 12 May 2020 16:57:48 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2C648B2DC; Tue, 12 May 2020 16:57:48 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGvmJK063999; Tue, 12 May 2020 16:57:48 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGvlFH063998; Tue, 12 May 2020 16:57:47 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121657.04CGvlFH063998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:57:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360976 - in releng: 11.3/sys/opencrypto 12.1/sys/opencrypto X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3/sys/opencrypto 12.1/sys/opencrypto X-SVN-Commit-Revision: 360976 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:57:48 -0000 Author: gordon Date: Tue May 12 16:57:47 2020 New Revision: 360976 URL: https://svnweb.freebsd.org/changeset/base/360976 Log: Fix use after free in cryptodev module. Approved by: so Security: FreeBSD-SA-20:15.cryptodev Security: CVE-2019-15879 Modified: releng/11.3/sys/opencrypto/cryptodev.c releng/12.1/sys/opencrypto/cryptodev.c Modified: releng/11.3/sys/opencrypto/cryptodev.c ============================================================================== --- releng/11.3/sys/opencrypto/cryptodev.c Tue May 12 16:55:32 2020 (r360975) +++ releng/11.3/sys/opencrypto/cryptodev.c Tue May 12 16:57:47 2020 (r360976) @@ -268,6 +268,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c struct csession { TAILQ_ENTRY(csession) next; u_int64_t sid; + volatile u_int refs; u_int32_t ses; struct mtx lock; /* for op submission */ @@ -294,6 +295,7 @@ struct cryptop_data { struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; + struct mtx lock; }; static int cryptof_ioctl(struct file *, u_long, void *, @@ -320,8 +322,7 @@ static struct fileops cryptofops = { }; static struct csession *csefind(struct fcrypt *, u_int); -static int csedelete(struct fcrypt *, struct csession *); -static struct csession *cseadd(struct fcrypt *, struct csession *); +static int csedelete(struct fcrypt *, u_int); static struct csession *csecreate(struct fcrypt *, u_int64_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); @@ -612,13 +613,9 @@ bail: break; case CIOCFSESSION: ses = *(u_int32_t *)data; - cse = csefind(fcr, ses); - if (cse == NULL) { + error = csedelete(fcr, ses); + if (error != 0) SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); - return (EINVAL); - } - csedelete(fcr, cse); - error = csefree(cse); break; case CIOCCRYPT: #ifdef COMPAT_FREEBSD32 @@ -635,6 +632,7 @@ bail: return (EINVAL); } error = cryptodev_op(cse, cop, active_cred, td); + (void)csefree(cse); #ifdef COMPAT_FREEBSD32 if (error == 0 && cmd == CIOCCRYPT32) crypt_op_to_32(cop, data); @@ -701,6 +699,7 @@ bail: return (EINVAL); } error = cryptodev_aead(cse, caead, active_cred, td); + (void)csefree(cse); break; default: error = EINVAL; @@ -1275,6 +1274,9 @@ cryptof_close(struct file *fp, struct thread *td) while ((cse = TAILQ_FIRST(&fcr->csessions))) { TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(cse->refs == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + cse->refs)); (void)csefree(cse); } free(fcr, M_XDATA); @@ -1295,34 +1297,35 @@ csefind(struct fcrypt *fcr, u_int ses) { struct csession *cse; - TAILQ_FOREACH(cse, &fcr->csessions, next) - if (cse->ses == ses) + mtx_lock(&fcr->lock); + TAILQ_FOREACH(cse, &fcr->csessions, next) { + if (cse->ses == ses) { + refcount_acquire(&cse->refs); + mtx_unlock(&fcr->lock); return (cse); + } + } + mtx_unlock(&fcr->lock); return (NULL); } static int -csedelete(struct fcrypt *fcr, struct csession *cse_del) +csedelete(struct fcrypt *fcr, u_int ses) { struct csession *cse; + mtx_lock(&fcr->lock); TAILQ_FOREACH(cse, &fcr->csessions, next) { - if (cse == cse_del) { + if (cse->ses == ses) { TAILQ_REMOVE(&fcr->csessions, cse, next); - return (1); + mtx_unlock(&fcr->lock); + return (csefree(cse)); } } - return (0); + mtx_unlock(&fcr->lock); + return (EINVAL); } -static struct csession * -cseadd(struct fcrypt *fcr, struct csession *cse) -{ - TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); - cse->ses = fcr->sesn++; - return (cse); -} - struct csession * csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t key, u_int64_t keylen, caddr_t mackey, u_int64_t mackeylen, u_int32_t cipher, u_int32_t mac, @@ -1334,6 +1337,7 @@ csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t k if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); + refcount_init(&cse->refs, 1); cse->key = key; cse->keylen = keylen/8; cse->mackey = mackey; @@ -1343,7 +1347,10 @@ csecreate(struct fcrypt *fcr, u_int64_t sid, caddr_t k cse->mac = mac; cse->txform = txform; cse->thash = thash; - cseadd(fcr, cse); + mtx_lock(&fcr->lock); + TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); + cse->ses = fcr->sesn++; + mtx_unlock(&fcr->lock); return (cse); } @@ -1352,6 +1359,8 @@ csefree(struct csession *cse) { int error; + if (!refcount_release(&cse->refs)) + return (0); error = crypto_freesession(cse->sid); mtx_destroy(&cse->lock); if (cse->key) @@ -1389,13 +1398,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); - fcr->sesn = 0; + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); error = falloc(td, &f, &fd, 0); if (error) { + mtx_destroy(&fcr->lock); free(fcr, M_XDATA); return (error); } Modified: releng/12.1/sys/opencrypto/cryptodev.c ============================================================================== --- releng/12.1/sys/opencrypto/cryptodev.c Tue May 12 16:55:32 2020 (r360975) +++ releng/12.1/sys/opencrypto/cryptodev.c Tue May 12 16:57:47 2020 (r360976) @@ -266,6 +266,7 @@ crypt_kop_to_32(const struct crypt_kop *from, struct c struct csession { TAILQ_ENTRY(csession) next; crypto_session_t cses; + volatile u_int refs; u_int32_t ses; struct mtx lock; /* for op submission */ @@ -292,6 +293,7 @@ struct cryptop_data { struct fcrypt { TAILQ_HEAD(csessionlist, csession) csessions; int sesn; + struct mtx lock; }; static struct timeval warninterval = { .tv_sec = 60, .tv_usec = 0 }; @@ -323,8 +325,7 @@ static struct fileops cryptofops = { }; static struct csession *csefind(struct fcrypt *, u_int); -static int csedelete(struct fcrypt *, struct csession *); -static struct csession *cseadd(struct fcrypt *, struct csession *); +static bool csedelete(struct fcrypt *, u_int); static struct csession *csecreate(struct fcrypt *, crypto_session_t, caddr_t, u_int64_t, caddr_t, u_int64_t, u_int32_t, u_int32_t, struct enc_xform *, struct auth_hash *); @@ -685,13 +686,10 @@ bail: break; case CIOCFSESSION: ses = *(u_int32_t *)data; - cse = csefind(fcr, ses); - if (cse == NULL) { + if (!csedelete(fcr, ses)) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); return (EINVAL); } - csedelete(fcr, cse); - csefree(cse); break; case CIOCCRYPT: #ifdef COMPAT_FREEBSD32 @@ -708,6 +706,7 @@ bail: return (EINVAL); } error = cryptodev_op(cse, cop, active_cred, td); + csefree(cse); #ifdef COMPAT_FREEBSD32 if (error == 0 && cmd == CIOCCRYPT32) crypt_op_to_32(cop, data); @@ -774,6 +773,7 @@ bail: return (EINVAL); } error = cryptodev_aead(cse, caead, active_cred, td); + csefree(cse); break; default: error = EINVAL; @@ -1349,6 +1349,9 @@ cryptof_close(struct file *fp, struct thread *td) while ((cse = TAILQ_FIRST(&fcr->csessions))) { TAILQ_REMOVE(&fcr->csessions, cse, next); + KASSERT(cse->refs == 1, + ("%s: crypto session %p with %d refs", __func__, cse, + cse->refs)); csefree(cse); } free(fcr, M_XDATA); @@ -1369,34 +1372,36 @@ csefind(struct fcrypt *fcr, u_int ses) { struct csession *cse; - TAILQ_FOREACH(cse, &fcr->csessions, next) - if (cse->ses == ses) + mtx_lock(&fcr->lock); + TAILQ_FOREACH(cse, &fcr->csessions, next) { + if (cse->ses == ses) { + refcount_acquire(&cse->refs); + mtx_unlock(&fcr->lock); return (cse); + } + } + mtx_unlock(&fcr->lock); return (NULL); } -static int -csedelete(struct fcrypt *fcr, struct csession *cse_del) +static bool +csedelete(struct fcrypt *fcr, u_int ses) { struct csession *cse; + mtx_lock(&fcr->lock); TAILQ_FOREACH(cse, &fcr->csessions, next) { - if (cse == cse_del) { + if (cse->ses == ses) { TAILQ_REMOVE(&fcr->csessions, cse, next); - return (1); + mtx_unlock(&fcr->lock); + csefree(cse); + return (true); } } - return (0); + mtx_unlock(&fcr->lock); + return (false); } -static struct csession * -cseadd(struct fcrypt *fcr, struct csession *cse) -{ - TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); - cse->ses = fcr->sesn++; - return (cse); -} - struct csession * csecreate(struct fcrypt *fcr, crypto_session_t cses, caddr_t key, u_int64_t keylen, caddr_t mackey, u_int64_t mackeylen, u_int32_t cipher, u_int32_t mac, @@ -1408,6 +1413,7 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c if (cse == NULL) return NULL; mtx_init(&cse->lock, "cryptodev", "crypto session lock", MTX_DEF); + refcount_init(&cse->refs, 1); cse->key = key; cse->keylen = keylen/8; cse->mackey = mackey; @@ -1417,7 +1423,10 @@ csecreate(struct fcrypt *fcr, crypto_session_t cses, c cse->mac = mac; cse->txform = txform; cse->thash = thash; - cseadd(fcr, cse); + mtx_lock(&fcr->lock); + TAILQ_INSERT_TAIL(&fcr->csessions, cse, next); + cse->ses = fcr->sesn++; + mtx_unlock(&fcr->lock); return (cse); } @@ -1425,6 +1434,8 @@ static void csefree(struct csession *cse) { + if (!refcount_release(&cse->refs)) + return; crypto_freesession(cse->cses); mtx_destroy(&cse->lock); if (cse->key) @@ -1461,13 +1472,14 @@ cryptoioctl(struct cdev *dev, u_long cmd, caddr_t data switch (cmd) { case CRIOGET: - fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK); + fcr = malloc(sizeof(struct fcrypt), M_XDATA, M_WAITOK | M_ZERO); TAILQ_INIT(&fcr->csessions); - fcr->sesn = 0; + mtx_init(&fcr->lock, "fcrypt", NULL, MTX_DEF); error = falloc(td, &f, &fd, 0); if (error) { + mtx_destroy(&fcr->lock); free(fcr, M_XDATA); return (error); } From owner-svn-src-all@freebsd.org Tue May 12 16:59:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0DDF62F4AEC; Tue, 12 May 2020 16:59:10 +0000 (UTC) (envelope-from gordon@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 49M3tP6YNzz4VL0; Tue, 12 May 2020 16:59:09 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 DC135B2E1; Tue, 12 May 2020 16:59:09 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CGx9vn064103; Tue, 12 May 2020 16:59:09 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CGx91N064102; Tue, 12 May 2020 16:59:09 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121659.04CGx91N064102@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 16:59:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360977 - releng/12.1/sys/opencrypto X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/12.1/sys/opencrypto X-SVN-Commit-Revision: 360977 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:59:10 -0000 Author: gordon Date: Tue May 12 16:59:09 2020 New Revision: 360977 URL: https://svnweb.freebsd.org/changeset/base/360977 Log: Fix insufficient cryptodev MAC key length check. Approved by: so Security: FreeBSD-SA-20:16.cryptodev Security: CVE-2019-15880 Modified: releng/12.1/sys/opencrypto/cryptodev.c Modified: releng/12.1/sys/opencrypto/cryptodev.c ============================================================================== --- releng/12.1/sys/opencrypto/cryptodev.c Tue May 12 16:57:47 2020 (r360976) +++ releng/12.1/sys/opencrypto/cryptodev.c Tue May 12 16:59:09 2020 (r360977) @@ -602,8 +602,8 @@ cryptof_ioctl( if (thash) { cria.cri_alg = thash->type; cria.cri_klen = sop->mackeylen * 8; - if (thash->keysize != 0 && - sop->mackeylen > thash->keysize) { + if (sop->mackeylen > thash->keysize || + sop->mackeylen < 0) { CRYPTDEB("invalid mac key length"); error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, From owner-svn-src-all@freebsd.org Tue May 12 17:00:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2510A2F4C5F; Tue, 12 May 2020 17:00:25 +0000 (UTC) (envelope-from gordon@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 49M3vs09clz4VXx; Tue, 12 May 2020 17:00:25 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 0120BB2E9; Tue, 12 May 2020 17:00:25 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CH0OM2064284; Tue, 12 May 2020 17:00:24 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH0NKJ064278; Tue, 12 May 2020 17:00:23 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <202005121700.04CH0NKJ064278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Tue, 12 May 2020 17:00:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360978 - in releng: 11.3 11.3/sys/conf 11.4 11.4/sys/conf 12.1 12.1/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng: 11.3 11.3/sys/conf 11.4 11.4/sys/conf 12.1 12.1/sys/conf X-SVN-Commit-Revision: 360978 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:00:25 -0000 Author: gordon Date: Tue May 12 17:00:23 2020 New Revision: 360978 URL: https://svnweb.freebsd.org/changeset/base/360978 Log: Add UPDATING entries and bump version. Approved by: so Approved by: re (implicit) Modified: releng/11.3/UPDATING releng/11.3/sys/conf/newvers.sh releng/11.4/UPDATING releng/11.4/sys/conf/newvers.sh releng/12.1/UPDATING releng/12.1/sys/conf/newvers.sh Modified: releng/11.3/UPDATING ============================================================================== --- releng/11.3/UPDATING Tue May 12 16:59:09 2020 (r360977) +++ releng/11.3/UPDATING Tue May 12 17:00:23 2020 (r360978) @@ -16,6 +16,25 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200512 p9 FreeBSD-EN-20:08.tzdata + FreeBSD-EN-20:10.build + FreeBSD-SA-20:12.libalias + FreeBSD-SA-20:13.libalias + FreeBSD-SA-20:14.sctp + FreeBSD-SA-20:15.cryptodev + + Import tzdata 2020a. [EN-20:08.tzdata] + + Fix incorrect build host Clang version detection [EN-20:10.build] + + Fix insufficient packet length validation in libalias [SA-20:12.libalias] + + Fix memory disclosure vulnerability in libalias [SA-20:13.libalias] + + Fix improper checking in SCTP-AUTH shared key update [SA-20:14.sctp] + + Fix use after free in cryptodev module [SA-20:15.cryptodev] + 20200421 p8 FreeBSD-EN-20:07.quotad FreeBSD-SA-20:10.ipfw Modified: releng/11.3/sys/conf/newvers.sh ============================================================================== --- releng/11.3/sys/conf/newvers.sh Tue May 12 16:59:09 2020 (r360977) +++ releng/11.3/sys/conf/newvers.sh Tue May 12 17:00:23 2020 (r360978) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.3" -BRANCH="RELEASE-p8" +BRANCH="RELEASE-p9" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.4/UPDATING ============================================================================== --- releng/11.4/UPDATING Tue May 12 16:59:09 2020 (r360977) +++ releng/11.4/UPDATING Tue May 12 17:00:23 2020 (r360978) @@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200512: 11.4-BETA1-p1 FreeBSD-SA-20:12.libalias + FreeBSD-SA-20:13.libalias + + Fix insufficient packet length validation in libalias [SA-20:12.libalias] + + Fix memory disclosure vulnerability in libalias [SA-20:13.libalias] + 20200507: Clang, llvm, lld, lldb, compiler-rt, libc++, libunwind and openmp have been upgraded to 10.0.0. Please see the 20141231 entry below for Modified: releng/11.4/sys/conf/newvers.sh ============================================================================== --- releng/11.4/sys/conf/newvers.sh Tue May 12 16:59:09 2020 (r360977) +++ releng/11.4/sys/conf/newvers.sh Tue May 12 17:00:23 2020 (r360978) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="BETA1" +BRANCH="BETA1-p1" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/12.1/UPDATING ============================================================================== --- releng/12.1/UPDATING Tue May 12 16:59:09 2020 (r360977) +++ releng/12.1/UPDATING Tue May 12 17:00:23 2020 (r360978) @@ -16,6 +16,28 @@ from older versions of FreeBSD, try WITHOUT_CLANG and the tip of head, and then rebuild without this option. The bootstrap process from older version of current across the gcc/clang cutover is a bit fragile. +20200512 p5 FreeBSD-EN-20:08.tzdata + FreeBSD-EN-20:09.igb + FreeBSD-EN-20:10.build + FreeBSD-SA-20:12.libalias + FreeBSD-SA-20:13.libalias + FreeBSD-SA-20:15.cryptodev + FreeBSD-SA-20:16.cryptodev + + Import tzdata 2020a. [EN-20:08.tzdata] + + Fix igb interfaces failing to switch to inactive state [EN-20:09.igb] + + Fix incorrect build host Clang version detection [EN-20:10.build] + + Fix insufficient packet length validation in libalias [SA-20:12.libalias] + + Fix memory disclosure vulnerability in libalias [SA-20:13.libalias] + + Fix use after free in cryptodev module [SA-20:15.cryptodev] + + Fix insufficient cryptodev MAC key length check [SA-20:16.cryptodev] + 20200421 p4 FreeBSD-EN-20:07.quotad FreeBSD-SA-20:10.ipfw FreeBSD-SA-20:11.openssl Modified: releng/12.1/sys/conf/newvers.sh ============================================================================== --- releng/12.1/sys/conf/newvers.sh Tue May 12 16:59:09 2020 (r360977) +++ releng/12.1/sys/conf/newvers.sh Tue May 12 17:00:23 2020 (r360978) @@ -46,7 +46,7 @@ TYPE="FreeBSD" REVISION="12.1" -BRANCH="RELEASE-p4" +BRANCH="RELEASE-p5" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Tue May 12 17:00:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E8FF52F4CC3; Tue, 12 May 2020 17:00: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 49M3wH5pTZz4VgS; Tue, 12 May 2020 17:00:47 +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 C2310B306; Tue, 12 May 2020 17:00:47 +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 04CH0lcP064344; Tue, 12 May 2020 17:00:47 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH0lQC064343; Tue, 12 May 2020 17:00:47 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121700.04CH0lQC064343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 17:00:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360979 - head/lib/librtld_db X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/librtld_db X-SVN-Commit-Revision: 360979 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:00:48 -0000 Author: markj Date: Tue May 12 17:00:47 2020 New Revision: 360979 URL: https://svnweb.freebsd.org/changeset/base/360979 Log: librtld_db: Fix shlib mapping offsets. kve_offset gives the offset into the backing file, which is not what we want since different segments may map the same page. Use the base of the mapping to determine the offset exported by librtld_db instead. PR: 244732 Reported by: Jenkins, Nicolò Mazzucato MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/librtld_db/rtld_db.c Modified: head/lib/librtld_db/rtld_db.c ============================================================================== --- head/lib/librtld_db/rtld_db.c Tue May 12 17:00:23 2020 (r360978) +++ head/lib/librtld_db/rtld_db.c Tue May 12 17:00:47 2020 (r360979) @@ -160,9 +160,12 @@ rd_err_e rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data) { struct kinfo_vmentry *kves, *kve; + const char *path; + uint64_t fileid; rd_loadobj_t rdl; rd_err_e ret; - int cnt, i, lastvn; + uintptr_t base; + int cnt, i; DPRINTF("%s\n", __func__); @@ -171,27 +174,38 @@ rd_loadobj_iter(rd_agent_t *rdap, rl_iter_f *cb, void return (RD_ERR); } + base = 0; + fileid = 0; + path = NULL; ret = RD_OK; - lastvn = 0; for (i = 0; i < cnt; i++) { - kve = kves + i; - if (kve->kve_type == KVME_TYPE_VNODE) - lastvn = i; + kve = &kves[i]; + /* + * Cache the base offset of the file mapping. The kve_offset + * field gives the file offset of a particular mapping into the + * file, but we want the mapping offset relative to the base + * mapping. + */ + if (kve->kve_type == KVME_TYPE_VNODE && + kve->kve_vn_fileid != fileid) { + base = kve->kve_start; + fileid = kve->kve_vn_fileid; + path = kve->kve_path; + } memset(&rdl, 0, sizeof(rdl)); /* * Map the kinfo_vmentry struct to the rd_loadobj structure. */ rdl.rdl_saddr = kve->kve_start; rdl.rdl_eaddr = kve->kve_end; - rdl.rdl_offset = kve->kve_offset; + rdl.rdl_offset = kve->kve_start - base; if (kve->kve_protection & KVME_PROT_READ) rdl.rdl_prot |= RD_RDL_R; if (kve->kve_protection & KVME_PROT_WRITE) rdl.rdl_prot |= RD_RDL_W; if (kve->kve_protection & KVME_PROT_EXEC) rdl.rdl_prot |= RD_RDL_X; - strlcpy(rdl.rdl_path, kves[lastvn].kve_path, - sizeof(rdl.rdl_path)); + strlcpy(rdl.rdl_path, path, sizeof(rdl.rdl_path)); if ((*cb)(&rdl, clnt_data) != 0) { ret = RD_ERR; break; From owner-svn-src-all@freebsd.org Tue May 12 17:05:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 505A62F4F8D; Tue, 12 May 2020 17:05:56 +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 49M42D1RBJz4W70; Tue, 12 May 2020 17:05:56 +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 2C8B7B4BE; Tue, 12 May 2020 17:05:56 +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 04CH5utO070289; Tue, 12 May 2020 17:05:56 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH5u4P070288; Tue, 12 May 2020 17:05:56 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005121705.04CH5u4P070288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Tue, 12 May 2020 17:05:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360980 - head/lib/libproc/tests X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/lib/libproc/tests X-SVN-Commit-Revision: 360980 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:05:56 -0000 Author: markj Date: Tue May 12 17:05:55 2020 New Revision: 360980 URL: https://svnweb.freebsd.org/changeset/base/360980 Log: Re-enable proc_test:symbol_lookup after r360979. PR: 244732 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Modified: head/lib/libproc/tests/proc_test.c Modified: head/lib/libproc/tests/proc_test.c ============================================================================== --- head/lib/libproc/tests/proc_test.c Tue May 12 17:00:47 2020 (r360979) +++ head/lib/libproc/tests/proc_test.c Tue May 12 17:05:55 2020 (r360980) @@ -270,9 +270,6 @@ ATF_TC_BODY(symbol_lookup, tc) u_long saved; int error; - if (atf_tc_get_config_var_as_bool_wd(tc, "ci", false)) - atf_tc_skip("https://bugs.freebsd.org/244732"); - phdl = start_prog(tc, false); error = proc_name2sym(phdl, target_prog_file, "main", &main_sym, NULL); From owner-svn-src-all@freebsd.org Tue May 12 17:07:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 25C3D2F501D; Tue, 12 May 2020 17:07:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M441009Pz4WGs; Tue, 12 May 2020 17:07:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF172B4C8; Tue, 12 May 2020 17:07:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CH7Sbm070428; Tue, 12 May 2020 17:07:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CH7S3h070427; Tue, 12 May 2020 17:07:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005121707.04CH7S3h070427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 12 May 2020 17:07:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360981 - releng/11.4/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: releng/11.4/usr.sbin/bhyve X-SVN-Commit-Revision: 360981 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:07:29 -0000 Author: jhb Date: Tue May 12 17:07:28 2020 New Revision: 360981 URL: https://svnweb.freebsd.org/changeset/base/360981 Log: MF11 360965: Use stream_read() to read all 12 bytes of the RFB client version. read() can return a short read, whereas stream_read() waits until the full version string is read. Approved by: re (gjb) Modified: releng/11.4/usr.sbin/bhyve/rfb.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/usr.sbin/bhyve/rfb.c ============================================================================== --- releng/11.4/usr.sbin/bhyve/rfb.c Tue May 12 17:05:55 2020 (r360980) +++ releng/11.4/usr.sbin/bhyve/rfb.c Tue May 12 17:07:28 2020 (r360981) @@ -72,6 +72,7 @@ static int rfb_debug = 0; #define DPRINTF(params) if (rfb_debug) printf params #define WPRINTF(params) printf params +#define VERSION_LENGTH 12 #define AUTH_LENGTH 16 #define PASSWD_LENGTH 8 @@ -765,7 +766,7 @@ rfb_handle(struct rfb_softc *rc, int cfd) stream_write(cfd, vbuf, strlen(vbuf)); /* 1b. Read client version */ - len = read(cfd, buf, sizeof(buf)); + len = stream_read(cfd, buf, VERSION_LENGTH); /* 2a. Send security type */ buf[0] = 1; From owner-svn-src-all@freebsd.org Tue May 12 17:18:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7E5912F52B5; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M4K12kRlz4Wln; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 58B65B6A5; Tue, 12 May 2020 17:18:45 +0000 (UTC) (envelope-from gallatin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CHIjMB076603; Tue, 12 May 2020 17:18:45 GMT (envelope-from gallatin@FreeBSD.org) Received: (from gallatin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CHIjRh076602; Tue, 12 May 2020 17:18:45 GMT (envelope-from gallatin@FreeBSD.org) Message-Id: <202005121718.04CHIjRh076602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gallatin set sender to gallatin@FreeBSD.org using -f From: Andrew Gallatin Date: Tue, 12 May 2020 17:18:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360982 - head/sys/netinet6 X-SVN-Group: head X-SVN-Commit-Author: gallatin X-SVN-Commit-Paths: head/sys/netinet6 X-SVN-Commit-Revision: 360982 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 17:18:45 -0000 Author: gallatin Date: Tue May 12 17:18:44 2020 New Revision: 360982 URL: https://svnweb.freebsd.org/changeset/base/360982 Log: IPv6: Fix a panic in the nd6 code with unmapped mbufs. If the neighbor entry for an IPv6 TCP session using unmapped mbufs times out, IPv6 will send an icmp6 dest. unreachable message. In doing this, it will try to do a software checksum on the reflected packet. If this is a TCP session using unmapped mbufs, then there will be a kernel panic. To fix this, just free packets with unmapped mbufs, rather than sending the icmp. Reviewed by: np, rrs Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D24821 Modified: head/sys/netinet6/nd6.c Modified: head/sys/netinet6/nd6.c ============================================================================== --- head/sys/netinet6/nd6.c Tue May 12 17:07:28 2020 (r360981) +++ head/sys/netinet6/nd6.c Tue May 12 17:18:44 2020 (r360982) @@ -821,9 +821,27 @@ nd6_llinfo_timer(void *arg) clear_llinfo_pqueue(ln); } nd6_free(&ln, 0); - if (m != NULL) - icmp6_error2(m, ICMP6_DST_UNREACH, - ICMP6_DST_UNREACH_ADDR, 0, ifp); + if (m != NULL) { + struct mbuf *n = m; + + /* + * if there are any ummapped mbufs, we + * must free them, rather than using + * them for an ICMP, as they cannot be + * checksummed. + */ + while ((n = n->m_next) != NULL) { + if (n->m_flags & M_EXTPG) + break; + } + if (n != NULL) { + m_freem(m); + m = NULL; + } else { + icmp6_error2(m, ICMP6_DST_UNREACH, + ICMP6_DST_UNREACH_ADDR, 0, ifp); + } + } } break; case ND6_LLINFO_REACHABLE: From owner-svn-src-all@freebsd.org Tue May 12 18:12:20 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B234F2F6D12; Tue, 12 May 2020 18:12:20 +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 49M5Vr4GGDz4bLx; Tue, 12 May 2020 18:12:20 +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 73EEAC3F9; Tue, 12 May 2020 18:12:20 +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 04CICKiT013441; Tue, 12 May 2020 18:12:20 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CICKdo013440; Tue, 12 May 2020 18:12:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005121812.04CICKdo013440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 May 2020 18:12:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360983 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 360983 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:12:20 -0000 Author: kib Date: Tue May 12 18:12:20 2020 New Revision: 360983 URL: https://svnweb.freebsd.org/changeset/base/360983 Log: Clear namespace pollution in include/malloc_np.h Do not include stdbool.h, it makes the header incompatible with some third-party code that typedefs bool manually. Remove inclusion of strings.h, which typically conflicts with the use of symbol 'index'. Separate inclusion of sys/cdefs.h is not needed because sys/types.h already handles that. Exp-run by: antoine (PR 245366) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24297 Modified: head/include/malloc_np.h Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Tue May 12 17:18:44 2020 (r360982) +++ head/include/malloc_np.h Tue May 12 18:12:20 2020 (r360983) @@ -33,29 +33,33 @@ #ifndef _MALLOC_NP_H_ #define _MALLOC_NP_H_ -#include + #include -#include -#include +#ifdef __cplusplus +#define __MyBool bool +#else +#define __MyBool _Bool +#endif + __BEGIN_DECLS typedef struct extent_hooks_s extent_hooks_t; -typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, - bool *, unsigned); -typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, +typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, + __MyBool *, __MyBool *, unsigned); +typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, +typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, unsigned); -typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - unsigned); -typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, +typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, +typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, + size_t, unsigned); +typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, unsigned); -typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, - bool, unsigned); -typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, - bool, unsigned); +typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, + __MyBool, unsigned); +typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, + __MyBool, unsigned); struct extent_hooks_s { extent_alloc_t *alloc; extent_dalloc_t *dalloc; @@ -119,5 +123,7 @@ void __dallocx(void *ptr, int flags); void __sdallocx(void *ptr, size_t size, int flags); size_t __nallocx(size_t size, int flags); __END_DECLS + +#undef __MyBool #endif /* _MALLOC_NP_H_ */ From owner-svn-src-all@freebsd.org Tue May 12 18:17:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A11322F6FB8; Tue, 12 May 2020 18:17: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 49M5dL3sHQz4brZ; Tue, 12 May 2020 18:17:58 +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 7FCE9C455; Tue, 12 May 2020 18:17:58 +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 04CIHw49013918; Tue, 12 May 2020 18:17:58 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CIHwxa013917; Tue, 12 May 2020 18:17:58 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005121817.04CIHwxa013917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 12 May 2020 18:17:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360984 - head/include X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/include X-SVN-Commit-Revision: 360984 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:17:58 -0000 Author: kib Date: Tue May 12 18:17:57 2020 New Revision: 360984 URL: https://svnweb.freebsd.org/changeset/base/360984 Log: Make include/malloc.h usable again. Lot of third-party Linux code uses #include , expecting to find the malloc extensions there. Instead of trying to fight them, accept that attempt to deprecate the header causes more troubles than solves potential portability issues, and provide our jemalloc extensions. PR: 155429 Reviewed by: imp, jhibbits, dab, hselasky, philip, emaste, jilles Exp-run by: antoine (PR 245366) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24297 Modified: head/include/malloc.h Modified: head/include/malloc.h ============================================================================== --- head/include/malloc.h Tue May 12 18:12:20 2020 (r360983) +++ head/include/malloc.h Tue May 12 18:17:57 2020 (r360984) @@ -1,6 +1,6 @@ -/* $FreeBSD$ */ -#if __STDC__ -#error " has been replaced by " -#else +/*- + * This file is in the public domain. + * $FreeBSD$ + */ #include -#endif +#include From owner-svn-src-all@freebsd.org Tue May 12 18:35:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B27CC2F759C; Tue, 12 May 2020 18:35:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M6144f2kz4crn; Tue, 12 May 2020 18:35:04 +0000 (UTC) (envelope-from rpokala@freebsd.org) Received: from [192.168.1.10] (c-98-207-126-143.hsd1.ca.comcast.net [98.207.126.143]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: rpokala) by smtp.freebsd.org (Postfix) with ESMTPSA id D865B298A2; Tue, 12 May 2020 18:35:03 +0000 (UTC) (envelope-from rpokala@freebsd.org) User-Agent: Microsoft-MacOutlook/16.37.20051002 Date: Tue, 12 May 2020 11:34:59 -0700 Subject: Re: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... From: Ravi Pokala To: Eric van Gyzen , , , Message-ID: Thread-Topic: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... References: <202005121522.04CFMfuo007680@repo.freebsd.org> In-Reply-To: <202005121522.04CFMfuo007680@repo.freebsd.org> Mime-version: 1.0 Content-type: text/plain; charset="UTF-8" Content-transfer-encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:35:04 -0000 This feels like it deserves an UPDATING (and possibly a RELNOTES) entry. -Ravi (rpokala@) =EF=BB=BF-----Original Message----- From: on behalf of Eric van Gyzen Date: 2020-05-12, Tuesday at 08:22 To: , , Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun= libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/e= fi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... Author: vangyzen Date: Tue May 12 15:22:40 2020 New Revision: 360964 URL: https://svnweb.freebsd.org/changeset/base/360964 Log: Remove tests for obsolete compilers in the build system Assume gcc is at least 6.4, the oldest xtoolchain in the ports tree. Assume clang is at least 6, which was in 11.2-RELEASE. Drop conditio= ns for older compilers. Reviewed by: imp (earlier version), emaste, jhb MFC after: 2 weeks Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D24802 Modified: head/lib/libclang_rt/Makefile.inc head/lib/libthr/Makefile head/lib/msun/Makefile head/libexec/rtld-elf/Makefile head/libexec/tftpd/tests/Makefile head/share/mk/bsd.compiler.mk head/share/mk/bsd.sys.mk head/stand/arm/uboot/Makefile head/stand/defs.mk head/stand/efi/Makefile head/stand/efi/boot1/Makefile head/stand/efi/loader/Makefile head/stand/i386/boot2/Makefile head/stand/i386/isoboot/Makefile head/stand/libsa/Makefile head/sys/conf/Makefile.arm head/sys/conf/Makefile.powerpc head/sys/conf/kern.mk head/sys/conf/kern.post.mk head/sys/conf/kern.pre.mk head/sys/conf/kmod.mk head/sys/modules/Makefile head/usr.sbin/acpi/acpidb/Makefile head/usr.sbin/trpt/Makefile head/usr.sbin/zic/zic/Makefile Modified: head/lib/libclang_rt/Makefile.inc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38 2020 (r360963= ) +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40 2020 (r360964= ) @@ -32,7 +32,7 @@ CFLAGS+=3D ${PICFLAG} CFLAGS+=3D -fno-builtin CFLAGS+=3D -fno-exceptions CXXFLAGS+=3D -fno-rtti -.if ${COMPILER_TYPE} =3D=3D clang && ${COMPILER_VERSION} >=3D 30700 +.if ${COMPILER_TYPE} =3D=3D clang CFLAGS+=3D -fno-sanitize=3Dsafe-stack .endif CFLAGS+=3D -fno-stack-protector Modified: head/lib/libthr/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -29,10 +29,7 @@ CFLAGS+=3D-Winline CFLAGS.thr_stack.c+=3D -Wno-cast-align CFLAGS.rtld_malloc.c+=3D -Wno-cast-align -.include -.if !(${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 40300) CFLAGS.thr_symbols.c+=3D -Wno-missing-variable-declarations -.endif .ifndef NO_THREAD_UNWIND_STACK CFLAGS+=3D-fexceptions Modified: head/lib/msun/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -108,13 +108,13 @@ COMMON_SRCS+=3D catrigl.c \ s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \ s_scalbnl.c s_sinl.c s_sincosl.c \ s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c -# Work around this warning from gcc 6: +# Work around this warning from gcc: # lib/msun/ld80/e_powl.c:275:1: error: floating constant exceeds r= ange of # 'long double' [-Werror=3Doverflow] # if( y >=3D LDBL_MAX ) # See also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D130067 .include -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000 +.if ${COMPILER_TYPE} =3D=3D "gcc" CFLAGS.e_powl.c+=3D -Wno-error=3Doverflow .endif .endif Modified: head/libexec/rtld-elf/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/libexec/rtld-elf/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} # GCC warns about redeclarations even though they have __exported # and are therefore not identical to the ones from the system headers. CFLAGS+=3D -Wno-redundant-decls -.if ${COMPILER_VERSION} < 40300 -# Silence -Wshadow false positives in ancient GCC -CFLAGS+=3D -Wno-shadow -.endif .endif Modified: head/libexec/tftpd/tests/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/libexec/tftpd/tests/Makefile Tue May 12 14:47:38 2020 (r360963= ) +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40 2020 (r360964= ) @@ -2,11 +2,8 @@ .include -# Skip on GCC 4.2, because it lacks __COUNTER__ -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40300 ATF_TESTS_C=3D functional TEST_METADATA.functional+=3D timeout=3D15 -.endif LIBADD=3D util WARNS?=3D 6 Modified: head/share/mk/bsd.compiler.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r360964) @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION=3D unknown ${X_}COMPILER_RESOURCE_DIR!=3D ${${cc}:N${CCACHE_BIN}} -print-resource-d= ir 2>/dev/null || echo unknown .endif -${X_}COMPILER_FEATURES=3D -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 3= 0300) || \ - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 40800) -${X_}COMPILER_FEATURES+=3D c++11 -.endif -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 3= 0400) || \ - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 50000) -${X_}COMPILER_FEATURES+=3D c++14 -.endif -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 5= 0000) || \ +${X_}COMPILER_FEATURES=3D c++11 c++14 +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" || \ (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} >=3D 70000) ${X_}COMPILER_FEATURES+=3D c++17 .endif -.if ${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSION} >=3D 60= 000 +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" ${X_}COMPILER_FEATURES+=3D retpoline .endif Modified: head/share/mk/bsd.sys.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) @@ -6,8 +6,7 @@ # Enable various levels of compiler warning checks. These may be # overridden (e.g. if using a non-gcc compiler) by defining MK_WARNS=3Dn= o. -# for 4.2.1 GCC: http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning= -Options.html -# for current GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.= html +# for GCC: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html # for clang: https://clang.llvm.org/docs/DiagnosticsReference.html .include @@ -29,15 +28,6 @@ CFLAGS+=3D -std=3D${CSTD} CXXFLAGS+=3D -std=3D${CXXSTD} .endif -# -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide path ou= t of the -# system, and any warnings specific to it are no longer relevant as th= ere are -# too many false positives. -# -.if ${COMPILER_VERSION} < 50000 -NO_WERROR.gcc=3D yes -.endif - # -pedantic is problematic because it also imposes namespace restricti= ons #CFLAGS+=3D -pedantic .if defined(WARNS) @@ -81,19 +71,13 @@ CWARNFLAGS+=3D -Wno-pointer-sign # is set to low values, these have to be disabled explicitly. .if ${WARNS} <=3D 6 CWARNFLAGS.clang+=3D -Wno-empty-body -Wno-string-plus-int -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30400 CWARNFLAGS.clang+=3D -Wno-unused-const-variable -.endif .endif # WARNS <=3D 6 .if ${WARNS} <=3D 3 CWARNFLAGS.clang+=3D -Wno-tautological-compare -Wno-unused-value\ -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 CWARNFLAGS.clang+=3D -Wno-unused-local-typedef -.endif -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 40000 CWARNFLAGS.clang+=3D -Wno-address-of-packed-member -.endif .if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 90100 CWARNFLAGS.gcc+=3D -Wno-address-of-packed-member .endif @@ -113,7 +97,7 @@ CWARNFLAGS.clang+=3D -Wno-array-bounds .endif # NO_WARRAY_BOUNDS .if defined(NO_WMISLEADING_INDENTATION) && \ ((${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 100000) ||= \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60100)) + ${COMPILER_TYPE} =3D=3D "gcc") CWARNFLAGS+=3D -Wno-misleading-indentation .endif # NO_WMISLEADING_INDENTATION .endif # WARNS @@ -137,8 +121,10 @@ CWARNFLAGS+=3D -Werror CWARNFLAGS+=3D -Wno-format .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} -# GCC 5.2.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50200 +# GCC +# We should clean up warnings produced with these flags. +# They were originally added as a quick hack to enable gcc5/6. +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS+=3D -Wno-error=3Daddress \ -Wno-error=3Darray-bounds \ -Wno-error=3Dattributes \ @@ -150,23 +136,18 @@ CWARNFLAGS+=3D -Wno-error=3Daddress \ -Wno-error=3Dextra \ -Wno-error=3Dinline \ -Wno-error=3Dlogical-not-parentheses \ + -Wno-error=3Dnonnull-compare \ + -Wno-error=3Dshift-negative-value \ -Wno-error=3Dstrict-aliasing \ + -Wno-error=3Dtautological-compare \ -Wno-error=3Duninitialized \ -Wno-error=3Dunused-but-set-variable \ + -Wno-error=3Dunused-const-variable \ -Wno-error=3Dunused-function \ -Wno-error=3Dunused-value -.endif -# GCC 6.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60100 -CWARNFLAGS+=3D -Wno-error=3Dnonnull-compare \ - -Wno-error=3Dshift-negative-value \ - -Wno-error=3Dtautological-compare \ - -Wno-error=3Dunused-const-variable -.endif - # GCC 7.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 70100 +.if ${COMPILER_VERSION} >=3D 70100 CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ -Wno-error=3Ddeprecated \ -Wno-error=3Dexpansion-to-defined \ @@ -182,7 +163,7 @@ CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ .endif # GCC 8.1.0 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 80100 +.if ${COMPILER_VERSION} >=3D 80100 CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizations \ -Wno-error=3Dcast-function-type \ -Wno-error=3Dcatch-value \ @@ -191,9 +172,10 @@ CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizati= ons -Wno-error=3Dsizeof-pointer-memaccess \ -Wno-error=3Dstringop-truncation .endif +.endif # gcc # How to handle FreeBSD custom printf format specifiers. -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 +.if ${COMPILER_TYPE} =3D=3D "clang" FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ .else FORMAT_EXTENSIONS=3D -fformat-extensions @@ -223,11 +205,7 @@ CFLAGS+=3D-nobuiltininc -idirafter ${COMPILER_RESOUR= CE_D CLANG_OPT_SMALL=3D -mstack-alignment=3D8 -mllvm -inline-threshold=3D3\ -mllvm -simplifycfg-dup-ret -.if ${COMPILER_VERSION} >=3D 30500 && ${COMPILER_VERSION} < 30700 -CLANG_OPT_SMALL+=3D -mllvm -enable-gvn=3Dfalse -.else CLANG_OPT_SMALL+=3D -mllvm -enable-load-pre=3Dfalse -.endif CFLAGS.clang+=3D -Qunused-arguments # The libc++ headers use c++11 extensions. These are normally silence= d because # they are treated as system headers, but we explicitly disable that w= arning @@ -238,14 +216,8 @@ CXXFLAGS.clang+=3D -Wno-c++11-extensions .if ${MK_SSP} !=3D "no" && \ ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mips" -.if (${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30500) || \ - (${COMPILER_TYPE} =3D=3D "gcc" && \ - (${COMPILER_VERSION} =3D=3D 40201 || ${COMPILER_VERSION} >=3D 40900)) # Don't use -Wstack-protector as it breaks world with -Werror. SSP_CFLAGS?=3D -fstack-protector-strong -.else -SSP_CFLAGS?=3D -fstack-protector -.endif CFLAGS+=3D ${SSP_CFLAGS} .endif # SSP && !ARM && !MIPS Modified: head/stand/arm/uboot/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -24,7 +24,7 @@ UBLDR_LOADADDR?=3D 0x1000000 # Architecture-specific loader code SRCS=3D start.S conf.c self_reloc.c vers.c -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized .endif Modified: head/stand/defs.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) @@ -143,11 +143,7 @@ CFLAGS+=3D -fPIC -mno-red-zone # Do not generate movt/movw, because the relocation fixup for them doe= s not # translate to the -Bsymbolic -pie format required by self_reloc() in = loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone CFLAGS+=3D -fPIC .endif Modified: head/stand/efi/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -4,16 +4,10 @@ NO_OBJ=3Dt .include -# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer -# than 4.5 supports it. -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500 - SUBDIR.${MK_FDT}+=3D fdt SUBDIR.yes+=3D libefi boot1 gptboot SUBDIR.${MK_FORTH}+=3D loader_4th SUBDIR.${MK_LOADER_LUA}+=3D loader_lua SUBDIR.yes+=3D loader_simp - -.endif # ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500 .include Modified: head/stand/efi/boot1/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -42,10 +42,6 @@ CFLAGS.zfs_module.c+=3D -I${SYSDIR}/cddl/contrib/opens= ol CFLAGS+=3D -DEFI_ZFS_BOOT .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized -.endif - CFLAGS+=3D -I${EFIINC} CFLAGS+=3D -I${EFIINCMD} CFLAGS+=3D -I${SYSDIR}/contrib/dev/acpica/include Modified: head/stand/efi/loader/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/efi/loader/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -31,10 +31,6 @@ CFLAGS+=3D -DEFI_ZFS_BOOT HAVE_ZFS=3D yes .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized -.endif - # We implement a slightly non-standard %S in that it always takes a # CHAR16 that's common in UEFI-land instead of a wchar_t. This only # seems to matter on arm64 where wchar_t defaults to an int instead Modified: head/stand/i386/boot2/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/i386/boot2/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -37,9 +37,6 @@ CFLAGS+=3D-fomit-frame-pointer \ CFLAGS.gcc+=3D -Os \ -fno-asynchronous-unwind-tables \ --param max-inline-insns-single=3D100 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 40201 -CFLAGS.gcc+=3D -mno-align-long-strings -.endif CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} Modified: head/stand/i386/isoboot/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/i386/isoboot/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -32,9 +32,6 @@ CFLAGS+=3D-DBOOTPROG=3D\"isoboot\" \ -Winline -Wno-pointer-sign CFLAGS.gcc+=3D --param max-inline-insns-single=3D100 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 40201 -CFLAGS.gcc+=3D -Wno-uninitialized -.endif CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} LD_FLAGS+=3D${LD_FLAGS_BIN} Modified: head/stand/libsa/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -46,11 +46,7 @@ SRCS+=3D subr_boot.c # Do not generate movt/movw, because the relocation fixup for them doe= s not # translate to the -Bsymbolic -pie format required by self_reloc() in = loader(8). # Also, the fpu is not available in a standalone environment. -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/arm/ Modified: head/sys/conf/Makefile.arm =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) @@ -44,10 +44,6 @@ CFLAGS.clang +=3D -mfpu=3Dnone .if !empty(DDB_ENABLED) CFLAGS +=3D -funwind-tables -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} < 30500 -# clang < 3.5.0 requires us to tell it to emit assembly with unwind in= formation -CFLAGS +=3D -mllvm -arm-enable-ehabi -.endif .endif # "makeoptions KERNVIRTADDR=3D" is now optional, supply the default valu= e. Modified: head/sys/conf/Makefile.powerpc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40 2020 (r360964) @@ -51,7 +51,7 @@ DPAAWARNFLAGS +=3D \ -Wno-error=3Dincompatible-pointer-types-discards-qualifiers \ -Wno-error=3Dnon-literal-null-conversion \ -Wno-error=3Denum-conversion -.elif "${COMPILER_TYPE}" =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50200 +.elif "${COMPILER_TYPE}" =3D=3D "gcc" DPAAWARNFLAGS +=3D \ -Wno-error=3Dredundant-decls \ -Wno-error=3Dint-in-bool-context Modified: head/sys/conf/kern.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE=3D -Wno-tautological= -po CWARNEXTRA?=3D -Wno-error-tautological-compare -Wno-error-empty-body \ -Wno-error-parentheses-equality -Wno-error-unused-function \ -Wno-error-pointer-sign -.if ${COMPILER_VERSION} >=3D 30700 CWARNEXTRA+=3D -Wno-error-shift-negative-value -.endif -.if ${COMPILER_VERSION} >=3D 40000 CWARNEXTRA+=3D -Wno-address-of-packed-member -.endif .if ${COMPILER_VERSION} >=3D 100000 NO_WMISLEADING_INDENTATION=3D -Wno-misleading-indentation .endif -.endif +.endif # clang .if ${COMPILER_TYPE} =3D=3D "gcc" -.if ${COMPILER_VERSION} >=3D 40800 # Catch-all for all the things that are in our tree, but for which we'= re # not yet ready for this compiler. NO_WUNUSED_BUT_SET_VARIABLE =3D -Wno-unused-but-set-variable @@ -55,15 +50,13 @@ CWARNEXTRA?=3D -Wno-error=3Daddress \ -Wno-error=3Denum-compare \ -Wno-error=3Dinline \ -Wno-error=3Dmaybe-uninitialized \ + -Wno-error=3Dmisleading-indentation \ + -Wno-error=3Dnonnull-compare \ -Wno-error=3Doverflow \ -Wno-error=3Dsequence-point \ - -Wno-unused-but-set-variable -.if ${COMPILER_VERSION} >=3D 60100 -CWARNEXTRA+=3D -Wno-error=3Dmisleading-indentation \ - -Wno-error=3Dnonnull-compare \ -Wno-error=3Dshift-overflow \ - -Wno-error=3Dtautological-compare -.endif + -Wno-error=3Dtautological-compare \ + -Wno-unused-but-set-variable .if ${COMPILER_VERSION} >=3D 70100 CWARNEXTRA+=3D -Wno-error=3Dstringop-overflow .endif @@ -76,15 +69,7 @@ CWARNEXTRA+=3D -Wno-error=3Dpacked-not-aligned .if ${COMPILER_VERSION} >=3D 90100 CWARNEXTRA+=3D -Wno-address-of-packed-member .endif -.else -# For gcc 4.2, eliminate the too-often-wrong warnings about uninitiali= zed vars. -CWARNEXTRA?=3D -Wno-uninitialized -# GCC 4.2 doesn't have -Wno-error=3Dcast-qual, so just disable the warni= ng for -# the few files that are already known to generate cast-qual warnings. -NO_WCAST_QUAL=3D -Wno-cast-qual -NO_WNONNULL=3D -Wno-nonnull -.endif -.endif +.endif # gcc # This warning is utter nonsense CWARNFLAGS+=3D -Wno-format-zero-length @@ -93,7 +78,7 @@ CWARNFLAGS+=3D -Wno-format-zero-length # to be disabled. WARNING: format checking is disabled in this case. .if ${MK_FORMAT_EXTENSIONS} =3D=3D "no" FORMAT_EXTENSIONS=3D -Wno-format -.elif ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 30600 +.elif ${COMPILER_TYPE} =3D=3D "clang" FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ .else FORMAT_EXTENSIONS=3D -fformat-extensions @@ -201,12 +186,7 @@ CFLAGS.gcc+=3D -mno-spe # DDB happy. ELFv2, if available, has some other efficiency benefits. # .if ${MACHINE_ARCH} =3D=3D "powerpc64" -.if ${COMPILER_VERSION} >=3D 40900 -CFLAGS.gcc+=3D -mabi=3Delfv2 -.else -CFLAGS.gcc+=3D -mcall-aixdesc -.endif -CFLAGS.clang+=3D -mabi=3Delfv2 +CFLAGS+=3D -mabi=3Delfv2 .endif # Modified: head/sys/conf/kern.post.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} .depend: .PRECIOUS ${SRCS} -.if ${COMPILER_TYPE} =3D=3D "clang" || \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000) _MAP_DEBUG_PREFIX=3D yes -.endif _ILINKS=3D machine .if ${MACHINE} !=3D ${MACHINE_CPUARCH} && ${MACHINE} !=3D "arm64" Modified: head/sys/conf/kern.pre.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) @@ -93,11 +93,7 @@ CFLAGS.gcc+=3D -fms-extensions .if defined(CFLAGS_ARCH_PARAMS) CFLAGS.gcc+=3D${CFLAGS_ARCH_PARAMS} .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?=3D -Wno-error -.else WERROR?=3D -Werror -.endif # The following should be removed no earlier than LLVM11 being importe= d into the # tree, to ensure we don't regress the build. LLVM11 and GCC10 will s= witch the # default over to -fno-common, making this redundant. Modified: head/sys/conf/kmod.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) @@ -88,11 +88,7 @@ __KLD_SHARED=3Dno .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing) CFLAGS+=3D -fno-strict-aliasing .endif -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WERROR?=3D -Wno-error -.else WERROR?=3D -Werror -.endif LINUXKPI_GENSRCS+=3D \ bus_if.h \ @@ -160,11 +156,7 @@ CFLAGS+=3D -fPIC # Temporary workaround for PR 196407, which contains the fascinating d= etails. # Don't allow clang to use fpu instructions or registers in kernel mod= ules. .if ${MACHINE_CPUARCH} =3D=3D arm -.if ${COMPILER_VERSION} < 30800 -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 -.else CFLAGS.clang+=3D -mno-movt -.endif CFLAGS.clang+=3D -mfpu=3Dnone CFLAGS+=3D -funwind-tables .endif @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} ${OBJCOPY} --strip-debug ${.TARGET} .endif -.if ${COMPILER_TYPE} =3D=3D "clang" || \ - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60000) _MAP_DEBUG_PREFIX=3D yes -.endif _ILINKS=3Dmachine .if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D "amd64" Modified: head/sys/modules/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -620,9 +620,7 @@ _aac=3D aac _aacraid=3D aacraid _acpi=3D acpi .if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES) -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} > 40201 _aesni=3D aesni -.endif .endif _amd_ecc_inject=3Damd_ecc_inject _amdsbwd=3D amdsbwd Modified: head/usr.sbin/acpi/acpidb/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38 2020 (r36096= 3) +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40 2020 (r36096= 4) @@ -87,6 +87,6 @@ LIBADD=3D pthread # integer to pointer, which is a GNU extension. # # Turn off the warning, because this is in contributed code. -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 60000 +.if ${COMPILER_TYPE} =3D=3D "clang" CWARNFLAGS+=3D -Wno-null-pointer-arithmetic .endif Modified: head/usr.sbin/trpt/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -8,18 +8,12 @@ MAN=3D trpt.8 BINGRP=3D kmem BINMODE=3D 2555 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 -WARNS?=3D 4 -.endif - .if ${MK_INET6_SUPPORT} !=3D "no" CFLAGS+=3D -DINET6 .endif .include -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 50000 # Several included system headers tickle this warning in ways that are # difficult to work around in this program. CFLAGS+=3D -Wno-missing-variable-declarations -.endif Modified: head/usr.sbin/zic/zic/Makefile =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38 2020 (r360963) +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40 2020 (r360964) @@ -15,7 +15,7 @@ CFLAGS+=3D -I${.CURDIR:H} -I${SRCTOP}/contrib/tzcode/st= d WARNS?=3D 2 -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 50300 +.if ${COMPILER_TYPE} =3D=3D "gcc" CWARNFLAGS+=3D -Wno-error=3Dstrict-overflow .endif From owner-svn-src-all@freebsd.org Tue May 12 18:39:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EBD422F76CD; Tue, 12 May 2020 18:39:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-oi1-f174.google.com (mail-oi1-f174.google.com [209.85.167.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M66B5LjSz4dBx; Tue, 12 May 2020 18:39:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-oi1-f174.google.com with SMTP id c12so18136362oic.1; Tue, 12 May 2020 11:39:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=voC8zsRwwPTD/XFCEk2l/IZWi9YPkIXrh1QpTg+AqN0=; b=RSv/0PwHZ8fdxLAbeEEdcBAncrTpO5c0YoWSm90Jj7By1rG00xTRkvkBHbv0B2dc1t LsNKYfiVv/IrTAhG0mHhheFoCYYhlSLpuybiYRciTgEOGrpncpf1FBaLaytbkW1UKyH7 kMPr+HV3093PYKFEHIG0pUaE3/AcojhLXSDoyNucj8RgCKVwDceN9HobKgI5WzLxF2xf mpjnpHxtm5CthyhK6HXO7q1V8lr9llIOudMCyUYTyWbDcxOx656iF92MlU47FcztnQg3 42EsalXTk9iGkkDEblDhVEXGKU1oj5YKauWeNu+O7r4aWIN5FJY1jIJYFkQ9bblHIZzx VBKg== X-Gm-Message-State: AGi0PuaNYQIBxj43rPKaMBuy7L68SoqVN1NDBKO8X5n3s8Ht5wbEQAKt 9tX4kA0lcCIcyYzCPc72wUEGpKKn X-Google-Smtp-Source: APiQypIwPmW5K4bs0eU12+gj4vJglY2Z8q6JuFAGJ3Jdrmr8MkJZ2jIYSO9ehvTNbG14YIlnLnTIHg== X-Received: by 2002:aca:b5d5:: with SMTP id e204mr24819250oif.108.1589308768896; Tue, 12 May 2020 11:39:28 -0700 (PDT) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com. [209.85.167.182]) by smtp.gmail.com with ESMTPSA id g94sm3626183otg.74.2020.05.12.11.39.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 May 2020 11:39:28 -0700 (PDT) Received: by mail-oi1-f182.google.com with SMTP id i13so19132184oie.9; Tue, 12 May 2020 11:39:28 -0700 (PDT) X-Received: by 2002:aca:4ac3:: with SMTP id x186mr15767812oia.81.1589308768349; Tue, 12 May 2020 11:39:28 -0700 (PDT) MIME-Version: 1.0 References: <202005121812.04CICKdo013440@repo.freebsd.org> In-Reply-To: <202005121812.04CICKdo013440@repo.freebsd.org> Reply-To: cem@freebsd.org From: Conrad Meyer Date: Tue, 12 May 2020 11:39:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360983 - head/include To: Konstantin Belousov Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49M66B5LjSz4dBx X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:39:31 -0000 Why not just use _Bool and leave the compatibility definition only for C++ (#define _Bool bool)? On Tue, May 12, 2020 at 11:12 AM Konstantin Belousov wrote: > > Author: kib > Date: Tue May 12 18:12:20 2020 > New Revision: 360983 > URL: https://svnweb.freebsd.org/changeset/base/360983 > > Log: > Clear namespace pollution in include/malloc_np.h > > Do not include stdbool.h, it makes the header incompatible with some > third-party code that typedefs bool manually. > Remove inclusion of strings.h, which typically conflicts with the use > of symbol 'index'. > Separate inclusion of sys/cdefs.h is not needed because sys/types.h > already handles that. > > Exp-run by: antoine (PR 245366) > Sponsored by: The FreeBSD Foundation > MFC after: 1 week > Differential revision: https://reviews.freebsd.org/D24297 > > Modified: > head/include/malloc_np.h > > Modified: head/include/malloc_np.h > ============================================================================== > --- head/include/malloc_np.h Tue May 12 17:18:44 2020 (r360982) > +++ head/include/malloc_np.h Tue May 12 18:12:20 2020 (r360983) > @@ -33,29 +33,33 @@ > > #ifndef _MALLOC_NP_H_ > #define _MALLOC_NP_H_ > -#include > + > #include > -#include > -#include > > +#ifdef __cplusplus > +#define __MyBool bool > +#else > +#define __MyBool _Bool > +#endif > + > __BEGIN_DECLS > typedef struct extent_hooks_s extent_hooks_t; > -typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, bool *, > - bool *, unsigned); > -typedef bool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, bool, > +typedef void *(extent_alloc_t)(extent_hooks_t *, void *, size_t, size_t, > + __MyBool *, __MyBool *, unsigned); > +typedef __MyBool (extent_dalloc_t)(extent_hooks_t *, void *, size_t, __MyBool, > unsigned); > -typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, bool, > +typedef void (extent_destroy_t)(extent_hooks_t *, void *, size_t, __MyBool, > unsigned); > -typedef bool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > - unsigned); > -typedef bool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, > +typedef __MyBool (extent_commit_t)(extent_hooks_t *, void *, size_t, size_t, > size_t, unsigned); > -typedef bool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > +typedef __MyBool (extent_decommit_t)(extent_hooks_t *, void *, size_t, size_t, > + size_t, unsigned); > +typedef __MyBool (extent_purge_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > unsigned); > -typedef bool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > - bool, unsigned); > -typedef bool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, > - bool, unsigned); > +typedef __MyBool (extent_split_t)(extent_hooks_t *, void *, size_t, size_t, size_t, > + __MyBool, unsigned); > +typedef __MyBool (extent_merge_t)(extent_hooks_t *, void *, size_t, void *, size_t, > + __MyBool, unsigned); > struct extent_hooks_s { > extent_alloc_t *alloc; > extent_dalloc_t *dalloc; > @@ -119,5 +123,7 @@ void __dallocx(void *ptr, int flags); > void __sdallocx(void *ptr, size_t size, int flags); > size_t __nallocx(size_t size, int flags); > __END_DECLS > + > +#undef __MyBool > > #endif /* _MALLOC_NP_H_ */ From owner-svn-src-all@freebsd.org Tue May 12 18:44:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C50362F78E4; Tue, 12 May 2020 18:44:41 +0000 (UTC) (envelope-from mw@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 49M6D94tyPz4dcQ; Tue, 12 May 2020 18:44:41 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A31F5CA83; Tue, 12 May 2020 18:44:41 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CIifoh032407; Tue, 12 May 2020 18:44:41 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CIiftV032406; Tue, 12 May 2020 18:44:41 GMT (envelope-from mw@FreeBSD.org) Message-Id: <202005121844.04CIiftV032406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Tue, 12 May 2020 18:44: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: r360985 - stable/12/sys/dev/ena X-SVN-Group: stable-12 X-SVN-Commit-Author: mw X-SVN-Commit-Paths: stable/12/sys/dev/ena X-SVN-Commit-Revision: 360985 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:44:41 -0000 Author: mw Date: Tue May 12 18:44:41 2020 New Revision: 360985 URL: https://svnweb.freebsd.org/changeset/base/360985 Log: MFC r360777: Optimize ENA Rx refill for low memory conditions Sometimes, especially when there is not much memory in the system left, allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of time and it is not guaranteed that it'll succeed. In that situation, the fallback will work, but if the refill needs to take a place for a lot of descriptors at once, the time spent in m_getjcl looking for memory can cause system unresponsiveness due to high priority of the Rx task. This can also lead to driver reset, because Tx cleanup routine is being blocked and timer service could detect that Tx packets aren't cleaned up. The reset routine can further create another unresponsiveness - Rx rings are being refilled there, so m_getjcl will again burn the CPU. This was causing NVMe driver timeouts and resets, because network driver is having higher priority. Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are enough - ENA MTU is being set to 9K anyway, so it's very unlikely that more space than 9KB will be needed. However, 9KB jumbo clusters can still cause issues, so by default the page size mbuf cluster will be used for the Rx descriptors. This can have a small (~2%) impact on the throughput of the device, so to restore original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to "1" in "/boot/loader.conf" file. As a part of this patch (important fix), the version of the driver was updated to v2.1.2. Submitted by: cperciva PR: 225791, 234838, 235856, 236989, 243531 Modified: stable/12/sys/dev/ena/ena.c stable/12/sys/dev/ena/ena.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/ena/ena.c ============================================================================== --- stable/12/sys/dev/ena/ena.c Tue May 12 18:17:57 2020 (r360984) +++ stable/12/sys/dev/ena/ena.c Tue May 12 18:44:41 2020 (r360985) @@ -200,6 +200,19 @@ int ena_log_level = ENA_ALERT | ENA_WARNING; SYSCTL_INT(_hw_ena, OID_AUTO, log_level, CTLFLAG_RWTUN, &ena_log_level, 0, "Logging level indicating verbosity of the logs"); +/* + * Use 9k mbufs for the Rx buffers. Default to 0 (use page size mbufs instead). + * Using 9k mbufs in low memory conditions might cause allocation to take a lot + * of time and lead to the OS instability as it needs to look for the contiguous + * pages. + * However, page size mbufs has a bit smaller throughput than 9k mbufs, so if + * the network performance is the priority, the 9k mbufs can be used. + */ +int ena_enable_9k_mbufs = 0; +SYSCTL_INT(_hw_ena, OID_AUTO, enable_9k_mbufs, CTLFLAG_RDTUN, + &ena_enable_9k_mbufs, 0, "Use 9 kB mbufs for Rx descriptors"); +#define ena_mbuf_sz (ena_enable_9k_mbufs ? MJUM9BYTES : MJUMPAGESIZE) + static ena_vendor_info_t ena_vendor_info_array[] = { { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_PF, 0}, { PCI_VENDOR_ID_AMAZON, PCI_DEV_ID_ENA_LLQ_PF, 0}, @@ -470,6 +483,7 @@ ena_init_io_rings(struct ena_adapter *adapter) rxr->que = que; rxr->empty_rx_queue = 0; + rxr->rx_mbuf_sz = ena_mbuf_sz; } } @@ -548,9 +562,9 @@ ena_setup_rx_dma_tag(struct ena_adapter *adapter) ENA_DMA_BIT_MASK(adapter->dma_width), /* lowaddr of excl window */ BUS_SPACE_MAXADDR, /* highaddr of excl window */ NULL, NULL, /* filter, filterarg */ - MJUM16BYTES, /* maxsize */ + ena_mbuf_sz, /* maxsize */ adapter->max_rx_sgl_size, /* nsegments */ - MJUM16BYTES, /* maxsegsize */ + ena_mbuf_sz, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ @@ -957,7 +971,8 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, return (0); /* Get mbuf using UMA allocator */ - rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); + rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, + rx_ring->rx_mbuf_sz); if (unlikely(rx_info->mbuf == NULL)) { counter_u64_add(rx_ring->rx_stats.mjum_alloc_fail, 1); @@ -968,7 +983,7 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter, } mlen = MCLBYTES; } else { - mlen = MJUM16BYTES; + mlen = rx_ring->rx_mbuf_sz; } /* Set mbuf length*/ rx_info->mbuf->m_pkthdr.len = rx_info->mbuf->m_len = mlen; Modified: stable/12/sys/dev/ena/ena.h ============================================================================== --- stable/12/sys/dev/ena/ena.h Tue May 12 18:17:57 2020 (r360984) +++ stable/12/sys/dev/ena/ena.h Tue May 12 18:44:41 2020 (r360985) @@ -41,7 +41,7 @@ #define DRV_MODULE_VER_MAJOR 0 #define DRV_MODULE_VER_MINOR 8 -#define DRV_MODULE_VER_SUBMINOR 4 +#define DRV_MODULE_VER_SUBMINOR 5 #define DRV_MODULE_NAME "ena" @@ -238,8 +238,12 @@ struct ena_ring { /* Determines if device will use LLQ or normal mode for TX */ enum ena_admin_placement_policy_type tx_mem_queue_type; - /* The maximum length the driver can push to the device (For LLQ) */ - uint8_t tx_max_header_size; + union { + /* The maximum length the driver can push to the device (For LLQ) */ + uint8_t tx_max_header_size; + /* The maximum (and default) mbuf size for the Rx descriptor. */ + uint16_t rx_mbuf_sz; + }; struct ena_com_rx_buf_info ena_bufs[ENA_PKT_MAX_BUFS]; From owner-svn-src-all@freebsd.org Tue May 12 18:48:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 11CC82F7B2A for ; Tue, 12 May 2020 18:48:10 +0000 (UTC) (envelope-from mw@semihalf.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M6J822wCz4f1j for ; Tue, 12 May 2020 18:48:07 +0000 (UTC) (envelope-from mw@semihalf.com) Received: by mail-qk1-x736.google.com with SMTP id g185so14744741qke.7 for ; Tue, 12 May 2020 11:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=VqSOR7xir5DlzTE/w2zqvXBf1w0EvUeSqL6on8GbBWc=; b=0ON7CwaIyfmuI3Eaa8EclC+SxPcYQVH6s006WWmj2Y4a0Y2HFjrjvhg+W7yJnOyZBn iOh5YsdIM8ZonVWTU1SQVGda1FssWaK8YYh7rKbowXhyljkp9CtXPRIWZdkBCeM0CTSH V6HSxZuZzpu4aPeBB3zW7huybkVA8zFYkyZsJn8KHKWmXcE2kYdDeBCmNIPuqsnKS31E /hevbidEeYkU0M9gNkcQFrPpFDREvTLHMDENks5tD0Mz2QRvwxRTSir7FNnVW4DXg147 3ueaypfIE7+eAiSkKkMtWuGzF6L9hCxxlru4PRMTx4EBQ72H6Or0YQ/EicUsduRuOes1 eTcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=VqSOR7xir5DlzTE/w2zqvXBf1w0EvUeSqL6on8GbBWc=; b=SIgZY9c8LNOobliWT/HZD9MJXvRuag2SWyHaEiAmeeJeax6udtGrh5osrk0FFX6DfJ GrwND9ISFfEbMcBNQM2QiyWOA9JdLxWpyvTpDFtzaZPEjW2O03XimQc4C8TcsQaXvMuh IRHuCGafx/GNhQrRyfqw0Q+2SFEAUbND24arAUin+PhJNt7Go6CgNegUDx4avpggKKoX rjrqQP6WzAASB4mK51sI+/fG3jahlMNTfVBM6rwYMd8ubv7gPZ/Nuf0BfuJ8fwLPbJUI 6VaqTVB41hP4gVp6z0qibgw0dvB3epRcFy1E6tfEdSFroB7olLEFzXF0jhRHxw7b0KPF hDHQ== X-Gm-Message-State: AGi0Pub4Y6TGkWrX11RlPMFglolL9bVqCMfAOBvgHii7vP6DKcb4n13o zMr57mwgr7hl9fmit4G9Ak4HdxBi6qctS+QM8AfA6w== X-Google-Smtp-Source: APiQypInoIHT71/2EE/BYwdOsDJDJlLQ06RpTGllW1TQz2aQsM54Jj9UgY/IJjs19+cgP55rVH+eYTYqm8lbhgcdIno= X-Received: by 2002:a37:a0d5:: with SMTP id j204mr22603596qke.128.1589309287030; Tue, 12 May 2020 11:48:07 -0700 (PDT) MIME-Version: 1.0 References: <202005121844.04CIiftV032406@repo.freebsd.org> In-Reply-To: <202005121844.04CIiftV032406@repo.freebsd.org> From: Marcin Wojtas Date: Tue, 12 May 2020 20:47:56 +0200 Message-ID: Subject: Re: svn commit: r360985 - stable/12/sys/dev/ena To: Marcin Wojtas Cc: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49M6J822wCz4f1j X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=semihalf-com.20150623.gappssmtp.com header.s=20150623 header.b=0ON7CwaI; dmarc=none; spf=none (mx1.freebsd.org: domain of mw@semihalf.com has no SPF policy when checking 2607:f8b0:4864:20::736) smtp.mailfrom=mw@semihalf.com X-Spamd-Result: default: False [-4.30 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[semihalf-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[svn-src-all@freebsd.org]; DMARC_NA(0.00)[semihalf.com]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[semihalf-com.20150623.gappssmtp.com:+]; RCVD_IN_DNSWL_NONE(0.00)[6.3.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; R_SPF_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-2.00)[ip: (-9.22), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.42), country: US(-0.05)]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:48:10 -0000 wt., 12 maj 2020 o 20:44 Marcin Wojtas napisa=C5=82(a): > > Author: mw > Date: Tue May 12 18:44:41 2020 > New Revision: 360985 > URL: https://svnweb.freebsd.org/changeset/base/360985 > > Log: > MFC r360777: Optimize ENA Rx refill for low memory conditions > > Sometimes, especially when there is not much memory in the system left, > allocating mbuf jumbo clusters (like 9KB or 16KB) can take a lot of tim= e > and it is not guaranteed that it'll succeed. In that situation, the > fallback will work, but if the refill needs to take a place for a lot o= f > descriptors at once, the time spent in m_getjcl looking for memory can > cause system unresponsiveness due to high priority of the Rx task. This > can also lead to driver reset, because Tx cleanup routine is being > blocked and timer service could detect that Tx packets aren't cleaned > up. The reset routine can further create another unresponsiveness - Rx > rings are being refilled there, so m_getjcl will again burn the CPU. > This was causing NVMe driver timeouts and resets, because network drive= r > is having higher priority. > > Instead of 16KB jumbo clusters for the Rx buffers, 9KB clusters are > enough - ENA MTU is being set to 9K anyway, so it's very unlikely that > more space than 9KB will be needed. > > However, 9KB jumbo clusters can still cause issues, so by default the > page size mbuf cluster will be used for the Rx descriptors. This can ha= ve a > small (~2%) impact on the throughput of the device, so to restore > original behavior, one must change sysctl "hw.ena.enable_9k_mbufs" to > "1" in "/boot/loader.conf" file. > > As a part of this patch (important fix), the version of the driver > was updated to v2.1.2. > For the record - on stable/12 the version was bumped to 0.8.5 with this com= mit. Marcin From owner-svn-src-all@freebsd.org Tue May 12 18:58:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9C0522F7E50; Tue, 12 May 2020 18:58:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49M6WZ2NTPz4fb6; Tue, 12 May 2020 18:58:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04CIvs0O079571 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Tue, 12 May 2020 21:57:57 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04CIvs0O079571 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04CIvsxM079570; Tue, 12 May 2020 21:57:54 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 12 May 2020 21:57:54 +0300 From: Konstantin Belousov To: Conrad Meyer Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360983 - head/include Message-ID: <20200512185754.GL68906@kib.kiev.ua> References: <202005121812.04CICKdo013440@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49M6WZ2NTPz4fb6 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 18:58:02 -0000 On Tue, May 12, 2020 at 11:39:17AM -0700, Conrad Meyer wrote: > Why not just use _Bool and leave the compatibility definition only for > C++ (#define _Bool bool)? There was such version in interim, see https://reviews.freebsd.org/D24297?vs=on&id=70906#toc Exp-run reported issues with this variant, please look at the bug trail yourself. From owner-svn-src-all@freebsd.org Tue May 12 20:02:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4C0672FEDC2; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M7xQ1MrHz3Njj; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A232D91C; Tue, 12 May 2020 20:02:02 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CK21nF079952; Tue, 12 May 2020 20:02:01 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CK21a1079950; Tue, 12 May 2020 20:02:01 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005122002.04CK21a1079950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 20:02:01 +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: r360986 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 360986 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 20:02:02 -0000 Author: gjb Date: Tue May 12 20:02:01 2020 New Revision: 360986 URL: https://svnweb.freebsd.org/changeset/base/360986 Log: Document EN-20:08 through EN-20:09, and SA-20:12 through SA-20:16. Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Tue May 12 18:44:41 2020 (r360985) +++ stable/11/release/doc/share/xml/errata.xml Tue May 12 20:02:01 2020 (r360986) @@ -91,6 +91,21 @@ Regression with certain NFS servers + + + FreeBSD-EN-20:08.tzdata + 12 May 2020 + Timezone database update + + + + FreeBSD-EN-20:10.build + 12 May 2020 + Incorrect build host clang version + detection + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Tue May 12 18:44:41 2020 (r360985) +++ stable/11/release/doc/share/xml/security.xml Tue May 12 20:02:01 2020 (r360986) @@ -185,6 +185,36 @@ 21 April 2020 Invalid &man.mbuf.9; handling + + + FreeBSD-SA-20:12.libalias + 12 May 2020 + Insufficient packet length + validation + + + + FreeBSD-SA-20:13.libalias + 12 May 2020 + Memory disclosure vulnerability + + + + FreeBSD-SA-20:14.sctp + 12 May 2020 + Improper checking in shared key + update + + + + FreeBSD-SA-20:14.cryptodev + 12 May 2020 + Use-after-free condition + From owner-svn-src-all@freebsd.org Tue May 12 20:02:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 46CD32FEF6E; Tue, 12 May 2020 20:02:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M7xl1CK3z3NrR; Tue, 12 May 2020 20:02:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2434ED930; Tue, 12 May 2020 20:02:19 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CK2Jq2081533; Tue, 12 May 2020 20:02:19 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CK2JnO081532; Tue, 12 May 2020 20:02:19 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005122002.04CK2JnO081532@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 20:02:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360987 - releng/11.4/release/doc/share/xml X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/share/xml X-SVN-Commit-Revision: 360987 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 20:02:19 -0000 Author: gjb Date: Tue May 12 20:02:18 2020 New Revision: 360987 URL: https://svnweb.freebsd.org/changeset/base/360987 Log: Document EN-20:08 through EN-20:09, and SA-20:12 through SA-20:16. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/share/xml/security.xml Modified: releng/11.4/release/doc/share/xml/security.xml ============================================================================== --- releng/11.4/release/doc/share/xml/security.xml Tue May 12 20:02:01 2020 (r360986) +++ releng/11.4/release/doc/share/xml/security.xml Tue May 12 20:02:18 2020 (r360987) @@ -185,6 +185,21 @@ 21 April 2020 Invalid &man.mbuf.9; handling + + + FreeBSD-SA-20:12.libalias + 12 May 2020 + Insufficient packet length + validation + + + + FreeBSD-SA-20:13.libalias + 12 May 2020 + Memory disclosure vulnerability + From owner-svn-src-all@freebsd.org Tue May 12 20:05:33 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F280D2FFE76; Tue, 12 May 2020 20:05:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M81T6Dznz3Pb0; Tue, 12 May 2020 20:05:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C160CDA5D; Tue, 12 May 2020 20:05:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CK5XG9081776; Tue, 12 May 2020 20:05:33 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CK5X8Y081775; Tue, 12 May 2020 20:05:33 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005122005.04CK5X8Y081775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 20:05:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360988 - releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 360988 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 20:05:34 -0000 Author: gjb Date: Tue May 12 20:05:33 2020 New Revision: 360988 URL: https://svnweb.freebsd.org/changeset/base/360988 Log: Release notes documentation: - r351007: bzip2(1) 1.0.8. - r351611: WPA 2.9. - r354195: tcsh(1) 6.21.0. - r355504: less(1) 551. - r355604: libbsdxml(3) 2.2.9. - r356341: pcap(3) 1.9.1. - r356341: tcpdump(1) 4.9.3. - r356345: unbound 1.9.6. - r356533: mtree(8) various fixes. - r358088: libarchive(3) 3.4.2. - r358659: ntpd(8) 4.2.8p14. - r360362: tzdata 2020a. - r360521: file(1) 5.38. - r360523: xz(1) 5.2.5. - r360822: clang (and friends) 10.0.0. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 12 20:02:18 2020 (r360987) +++ releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 12 20:05:33 2020 (r360988) @@ -171,7 +171,57 @@ Contributed Software -   + The &man.bzip2.1; utility has been + updated to version 1.0.8. + + The WPA + utilities have been updated to version 2.9. + + The &man.tcsh.1; utility has been + updated to version 6.21.0. + + The &man.less.1; utility has been + updated to version 551. + + The &man.libbsdxml.3; library has + been updated to version 2.2.9. + + The &man.pcap.3; library has been + updated to version 1.9.1. + + The &man.tcpdump.1; utility has been + updated to version 4.9.3. + + The &man.unbound.8; utility has been + updated to version 1.9.6. + + The &man.mtree.8; utility has been + updated to include several bug fixes. + + The &man.archive.3; library has been + updated to version 3.4.2. + + The &man.ntpd.8; utilities have been + updated to version 4.2.8p14. + + The timezone database files have been + updated to version 2020a. + + The &man.file.1; utility has been + updated to version 5.38. + + The &man.xz.1; utility has been updated + to version 5.2.5. + + The clang, + llvm, + lld, + lldb, + libunwind, + openmp, + compiler-rt utilities and + libc++ have been updated to version + 10.0.0. From owner-svn-src-all@freebsd.org Tue May 12 20:05:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 68C382FFEC0; Tue, 12 May 2020 20:05:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49M81W1gkXz3PbM; Tue, 12 May 2020 20:05:35 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EB97DDA5E; Tue, 12 May 2020 20:05:34 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CK5YJW081819; Tue, 12 May 2020 20:05:34 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CK5Y9B081818; Tue, 12 May 2020 20:05:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005122005.04CK5Y9B081818@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 12 May 2020 20:05:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r360989 - releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/release/doc/en_US.ISO8859-1/relnotes X-SVN-Commit-Revision: 360989 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 20:05:35 -0000 Author: gjb Date: Tue May 12 20:05:34 2020 New Revision: 360989 URL: https://svnweb.freebsd.org/changeset/base/360989 Log: Release notes documentation: - r350801: camcontrol(8) AMA support. - r351582: camcontrol(8) 'modepage' block descriptor support. - r351843: usbconfig(8) detach_kernel_driver command. - r351873: jot(1) '-r 0 start end' fix. - r352758: freebsd-update(8) 'updatesready' and 'showconfig' commands. - r353134: crontab(5)/cron(8) '-n' and '-q' flags. - r353759: zfs(8) bookmark renaming support. - r356290: OpenSSL 1.0.2u. - r356401: usbconfig(8) dump_stats command. - r356905: fsck_ffs(8) recovery information fix with 64k sectors. - r357082: certctl(8) added. - r357791: env(1) -L/-U user/class options. - r359554: ZFS ZIL max block size tunable. - r359696: libalias(3)/ipfw(4) RFC-6598 support. - r359740: syslogd(8) property-based filters. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 12 20:05:33 2020 (r360988) +++ releng/11.4/release/doc/en_US.ISO8859-1/relnotes/article.xml Tue May 12 20:05:34 2020 (r360989) @@ -165,7 +165,56 @@ Userland Application Changes -   + The + &man.camcontrol.8; utility has been updated to include support + for Accessible Max Address Configuration + (AMA). + + The &man.camcontrol.8; utility has been + updated to support block descriptors with the + modepage subcommand. + + The &man.usbconfig.8; utility has been + updated to include the detach_kernel_driver + command. + + The &man.jot.1; utility has been updated + to allow an endless stream of random data within the specified + bounds. + + The &man.freebsd-update.8; utility has + been updated to include two new commands, + updatesready and + showconfig. + + The &man.cron.8; utility has been + updated to support two new flags in &man.crontab.5;, + -n and -q, which + suppress mail on successful runs and suppress logging of + command execution, respectively. + + The &man.zfs.8; utility has been updated + to support renaming bookmarks. + + The &man.usbconfig.8; utility has been + updated to include the dump_stats + command. + + The &man.fsck.ffs.8; and &man.newfs.8; + utilities has been updated to fix recovery information with + sector sizes up to 64k. + + The &man.certctl.8; utility has been + added. + + The &man.env.1; utility has been updated + to include the -L and -U + options, which are used to set the environment of the + specified user from login.conf and + ~/.login_conf, respectively. + + The &man.syslogd.8; utility has been + updated to add property-based filters. @@ -186,6 +235,9 @@ The &man.libbsdxml.3; library has been updated to version 2.2.9. + OpenSSL has + been update to version 1.0.2u. + The &man.pcap.3; library has been updated to version 1.9.1. @@ -374,7 +426,9 @@ ZFS -   + The ZFS + ZIL (ZFS intent log) + maximum block size is now tunable. @@ -418,7 +472,10 @@ Network Protocols -   + The &man.libalias.3; library and + &man.ipfw.4; packet filter have been updated to add support + for RFC 6598/Carrier Grade + NAT subnets. From owner-svn-src-all@freebsd.org Tue May 12 21:00:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3BD192DBFA8; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@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 49M9DZ0t1nz3yNL; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1936BE3FE; Tue, 12 May 2020 21:00:14 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CL0DMA013051; Tue, 12 May 2020 21:00:13 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CL0D4i013050; Tue, 12 May 2020 21:00:13 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005122100.04CL0D4i013050@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 12 May 2020 21:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360990 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 360990 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:00:14 -0000 Author: andrew Date: Tue May 12 21:00:13 2020 New Revision: 360990 URL: https://svnweb.freebsd.org/changeset/base/360990 Log: Fix the name reported when the core supports a 64-bit CCIDX Modified: head/sys/arm64/arm64/identcpu.c Modified: head/sys/arm64/arm64/identcpu.c ============================================================================== --- head/sys/arm64/arm64/identcpu.c Tue May 12 20:05:34 2020 (r360989) +++ head/sys/arm64/arm64/identcpu.c Tue May 12 21:00:13 2020 (r360990) @@ -601,7 +601,7 @@ static struct mrs_field_value id_aa64mmfr2_nv[] = { static struct mrs_field_value id_aa64mmfr2_ccidx[] = { MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_32, "32bit CCIDX"), - MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_64, "32bit CCIDX"), + MRS_FIELD_VALUE(ID_AA64MMFR2_CCIDX_64, "64bit CCIDX"), MRS_FIELD_VALUE_END, }; From owner-svn-src-all@freebsd.org Tue May 12 21:51:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CBCE02DD2C6; Tue, 12 May 2020 21:51:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MBNF37Hgz426h; Tue, 12 May 2020 21:51:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66982EFB8; Tue, 12 May 2020 21:51:57 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CLpv4H045671; Tue, 12 May 2020 21:51:57 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CLpu71045669; Tue, 12 May 2020 21:51:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005122151.04CLpu71045669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Tue, 12 May 2020 21:51:56 +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: r360991 - stable/12/sys/mips/cavium/octe X-SVN-Group: stable-12 X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: stable/12/sys/mips/cavium/octe X-SVN-Commit-Revision: 360991 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:51:57 -0000 Author: jhibbits Date: Tue May 12 21:51:56 2020 New Revision: 360991 URL: https://svnweb.freebsd.org/changeset/base/360991 Log: MFC r343969 by nwhitehorn: Performance improvements for octe(4): - Distribute RX load across multiple cores, if present. This reverts r217212, which is no longer relevant (I think because of the newer SDK). - Use newer APIs for pinning taskqueue entries to specific cores. - Deepen RX buffers. This more than doubles NAT forwarding throughput on an EdgeRouter Lite from, with typical packet mixture, 90 Mbps to over 200 Mbps. The result matches forwarding throughput in Linux without the UBNT hardware offload on the same hardware, and thus likely reflects hardware limits. Modified: stable/12/sys/mips/cavium/octe/ethernet-defines.h stable/12/sys/mips/cavium/octe/ethernet-rx.c stable/12/sys/mips/cavium/octe/ethernet.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/mips/cavium/octe/ethernet-defines.h ============================================================================== --- stable/12/sys/mips/cavium/octe/ethernet-defines.h Tue May 12 21:00:13 2020 (r360990) +++ stable/12/sys/mips/cavium/octe/ethernet-defines.h Tue May 12 21:51:56 2020 (r360991) @@ -38,14 +38,14 @@ AND WITH ALL FAULTS AND CAVIUM NETWORKS MAKES NO PROM * the driver uses the default from below. */ -#define INTERRUPT_LIMIT 10000 /* Max interrupts per second per core */ +#define INTERRUPT_LIMIT 1000 /* Max interrupts per second per core */ /*#define INTERRUPT_LIMIT 0 *//* Don't limit the number of interrupts */ #define USE_RED 1 /* Enable Random Early Dropping under load */ #define USE_10MBPS_PREAMBLE_WORKAROUND 1 /* Allow SW based preamble removal at 10Mbps to workaround PHYs giving us bad preambles */ #define DONT_WRITEBACK(x) (x) /* Use this to have all FPA frees also tell the L2 not to write data to memory */ /*#define DONT_WRITEBACK(x) 0 *//* Use this to not have FPA frees control L2 */ -#define MAX_RX_PACKETS 120 /* Maximum number of packets to process per interrupt. */ +#define MAX_RX_PACKETS 1024 /* Maximum number of packets to process per interrupt. */ #define MAX_OUT_QUEUE_DEPTH 1000 #define FAU_NUM_PACKET_BUFFERS_TO_FREE (CVMX_FAU_REG_END - sizeof(uint32_t)) Modified: stable/12/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- stable/12/sys/mips/cavium/octe/ethernet-rx.c Tue May 12 21:00:13 2020 (r360990) +++ stable/12/sys/mips/cavium/octe/ethernet-rx.c Tue May 12 21:51:56 2020 (r360991) @@ -57,8 +57,6 @@ extern struct ifnet *cvm_oct_device[]; static struct task cvm_oct_task; static struct taskqueue *cvm_oct_taskq; -static int cvm_oct_rx_active; - /** * Interrupt handler. The interrupt occurs whenever the POW * transitions from 0->1 packets in our group. @@ -77,10 +75,9 @@ int cvm_oct_do_interrupt(void *dev_id) cvmx_write_csr(CVMX_POW_WQ_INT, 0x10001< Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 48AFA2DD489; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MBXq1FKLz42NN; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21985EFFF; Tue, 12 May 2020 21:59:23 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CLxMow049214; Tue, 12 May 2020 21:59:22 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CLxMZZ049210; Tue, 12 May 2020 21:59:22 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005122159.04CLxMZZ049210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 12 May 2020 21:59:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360992 - head/bin/sh/tests/parser X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/parser X-SVN-Commit-Revision: 360992 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 21:59:23 -0000 Author: jilles Date: Tue May 12 21:59:21 2020 New Revision: 360992 URL: https://svnweb.freebsd.org/changeset/base/360992 Log: sh/tests: Test some obscure cases with aliasing keywords Added: head/bin/sh/tests/parser/alias19.0 (contents, props changed) head/bin/sh/tests/parser/alias19.0.stdout (contents, props changed) head/bin/sh/tests/parser/alias20.0 (contents, props changed) head/bin/sh/tests/parser/alias20.0.stdout (contents, props changed) Modified: head/bin/sh/tests/parser/Makefile Modified: head/bin/sh/tests/parser/Makefile ============================================================================== --- head/bin/sh/tests/parser/Makefile Tue May 12 21:51:56 2020 (r360991) +++ head/bin/sh/tests/parser/Makefile Tue May 12 21:59:21 2020 (r360992) @@ -25,6 +25,8 @@ ${PACKAGE}FILES+= alias15.0 alias15.0.stdout ${PACKAGE}FILES+= alias16.0 ${PACKAGE}FILES+= alias17.0 ${PACKAGE}FILES+= alias18.0 +${PACKAGE}FILES+= alias19.0 alias19.0.stdout +${PACKAGE}FILES+= alias20.0 alias20.0.stdout ${PACKAGE}FILES+= and-pipe-not.0 ${PACKAGE}FILES+= case1.0 ${PACKAGE}FILES+= case2.0 Added: head/bin/sh/tests/parser/alias19.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/parser/alias19.0 Tue May 12 21:59:21 2020 (r360992) @@ -0,0 +1,8 @@ +# $FreeBSD$ + +alias begin={ end=} +begin +cat < Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B174F2DE6C4; Tue, 12 May 2020 22:16:10 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49MBw95W5rz43jv; Tue, 12 May 2020 22:16:09 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 8AA773C0199; Tue, 12 May 2020 22:16:03 +0000 (UTC) Date: Tue, 12 May 2020 22:16:03 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200512221603.GB60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vGgW1X5XWziG23Ko" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49MBw95W5rz43jv X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; IP_SCORE(-3.63)[ip: (-9.55), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.79), country: US(-0.05)]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 22:16:10 -0000 --vGgW1X5XWziG23Ko Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > Author: kevans > > > Date: Sat May 9 02:01:29 2020 > > > New Revision: 360833 > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > Log: > > > installworld: attempt a certctl rehash at the tail end > > > > > > This can be run as root or normal user with no problem; if they had= n't > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host cert= ctl to > > > rehash the DESTDIR. This would allow one to build systems WITHOUT_O= PENSSL + > > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > > appropriate *ssl from somewhere else. > > > > > > Cross-builds are fine because this will always use the host certctl= , or just > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > MFC after: 1 week > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > Modified: > > > head/Makefile.inc1 > > > > > > Modified: head/Makefile.inc1 > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r36083= 2) > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r36083= 3) > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _inst= allcheck > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > .endfor > > > .endif > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > + # We could make certctl a bootstrap tool, but it requires OpenS= SL and > > > + # friends, which we likely don't want. We'll rehash on a best-= effort > > > + # basis, otherwise we'll just mention that we're not doing it t= o raise > > > + # awareness. > > > + @if which certctl>/dev/null; then \ > > > + certctl rehash \ > > > > Does this update METALOG with the added links? > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > In general I'm not enthusiastic about additions to installworld that do > > anything other than copying files, creating links, etc in simple ways. >=20 > I will happily back this out if I can get some qualified eyes to > review/improve it. It does not update METALOG, and it probably should. > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > `certctl rehash` all over the tree in various points that may need it; > the release(7) scripts will need to be done if we don't do it here at > a minimum, and I haven't put much thought into it beyond that. I'm not in a rush to back this out given that it's solving a real problem, but lets talk about improvements. I kind of feel like this belongs in distribution (which I think would deal with release scripts) or in etcupdate/mergemaster, but I'm not sure either of those are correct. I'd be happy to review changes to update the METALOG (I guess we'd extend certctl with an option to do that?) I think that's the most important things because we really should be routinely validating that DESTDIR only contains things in the METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding "env DESTDIR=3D${DESTDIR}" so it's explicit. > The close-to-infuriating part of the caroot project has been that it's > incredibly hard to get almost anyone else (with some obvious > exceptions) to do more than informal discussion on the matter; actual > review, in particular, is difficult to obtain. Thanks for doing all this work! I'm afraid the whole thing gives me third-rail vibes (not the idea or the implementation, but the potential for things to go wrong) so I've veered away from the larger reviews. :( -- Brooks --vGgW1X5XWziG23Ko Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJeuyAiAAoJEKzQXbSebgfAg4gH/0IcLmkOGVKkuwDyKYJs3cs2 M6NCZQBX2WGXy2+/pJzS9DhxXIT1c5IAKUbUZT9MADF5PmWSastgVI07iBj9JIgP 1JdQv7cJi2+f00a+dFWejmaJVvLrHAgwPbY1AXnbMBckb1UGn3CIxSccbs8LiuQ7 oYAKzO0Gr5l9kcqtCET90uJAEESk1Li8QE4SlvPQbO2weIXJYqDAeC6wVJt2kkAq 6M6dmHcF20BpmteCq1Lg17aGtk6AEAGl2GZ/xR0Gx0UgEP89/ydhL5w/tl7qFpl0 lDEUMcS0YlNJUQuf45Em+i+NbRoday9dnT9jc0NRyzDnlSb4FlKY6FQL/NuaRaQ= =Opt9 -----END PGP SIGNATURE----- --vGgW1X5XWziG23Ko-- From owner-svn-src-all@freebsd.org Tue May 12 22:44:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E2C2DFD03; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MCYH4sCcz4BYT; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A1C36F9AE; Tue, 12 May 2020 22:44:51 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CMipZX086959; Tue, 12 May 2020 22:44:51 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CMipP3086958; Tue, 12 May 2020 22:44:51 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005122244.04CMipP3086958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 May 2020 22:44:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360993 - head/usr.bin/uname X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/usr.bin/uname X-SVN-Commit-Revision: 360993 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 22:44:51 -0000 Author: imp Date: Tue May 12 22:44:51 2020 New Revision: 360993 URL: https://svnweb.freebsd.org/changeset/base/360993 Log: Refine the history of uname. It appeared in 4.4BSD. It was not in v7 unix. It was one of the additions in PWB, and appeared in System III and later commercial versions of Unix. The different args to uname weren't aded until System III. Add a quick note to note the late entry into the BSD fork of Unix since PWB otherwise implies a pre-fork date. Modified: head/usr.bin/uname/uname.1 Modified: head/usr.bin/uname/uname.1 ============================================================================== --- head/usr.bin/uname/uname.1 Tue May 12 21:59:21 2020 (r360992) +++ head/usr.bin/uname/uname.1 Tue May 12 22:44:51 2020 (r360993) @@ -146,7 +146,11 @@ specification. .Sh HISTORY The .Nm -command appeared in PWB UNIX. +command appeared in PWB UNIX 1.0, however +.Bx 4.4 +was the first Berkeley release with the +.Nm +command. .Pp The .Fl K From owner-svn-src-all@freebsd.org Tue May 12 23:46:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BAF32E113F; Tue, 12 May 2020 23:46:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MDws28Z9z4FL3; Tue, 12 May 2020 23:46:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4010B18508; Tue, 12 May 2020 23:46:53 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04CNkrJo024073; Tue, 12 May 2020 23:46:53 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CNkr6c024072; Tue, 12 May 2020 23:46:53 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005122346.04CNkr6c024072@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 12 May 2020 23:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360995 - head/sys/net/route X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/net/route X-SVN-Commit-Revision: 360995 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 23:46:53 -0000 Author: imp Date: Tue May 12 23:46:52 2020 New Revision: 360995 URL: https://svnweb.freebsd.org/changeset/base/360995 Log: Kill trailing newline while I'm here... Modified: head/sys/net/route/route_ddb.c Modified: head/sys/net/route/route_ddb.c ============================================================================== --- head/sys/net/route/route_ddb.c Tue May 12 23:33:03 2020 (r360994) +++ head/sys/net/route/route_ddb.c Tue May 12 23:46:52 2020 (r360995) @@ -268,4 +268,3 @@ usage: " Currently accepts only IPv4 and IPv6 addresses\n"); db_skip_to_eol(); } - From owner-svn-src-all@freebsd.org Tue May 12 23:51:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 72F3C2E11DF; Tue, 12 May 2020 23:51:05 +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 49MF1j2THQz4FVT; Tue, 12 May 2020 23:51:05 +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 5034818541; Tue, 12 May 2020 23:51:05 +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 04CNp5Sx026962; Tue, 12 May 2020 23:51:05 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04CNp5js026961; Tue, 12 May 2020 23:51:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005122351.04CNp5js026961@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 12 May 2020 23:51: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: r360996 - stable/12/contrib/elftoolchain/elfcopy X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/contrib/elftoolchain/elfcopy X-SVN-Commit-Revision: 360996 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 23:51:05 -0000 Author: emaste Date: Tue May 12 23:51:04 2020 New Revision: 360996 URL: https://svnweb.freebsd.org/changeset/base/360996 Log: MFC r359166: objcopy: add new sections also when there is no .shstrtab Previously objcopy (elfcopy) --add-sections inserted new sections before .shstrtab, but omitted them if there was no .shstrtab. Now, after processing existing sections add new sections if they were not yet added. PR: 241437 Reported by: arrowd Submitted by: Tiger Gao Sponsored by: The FreeBSD Foundation Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c Directory Properties: stable/12/ (props changed) Modified: stable/12/contrib/elftoolchain/elfcopy/sections.c ============================================================================== --- stable/12/contrib/elftoolchain/elfcopy/sections.c Tue May 12 23:46:52 2020 (r360995) +++ stable/12/contrib/elftoolchain/elfcopy/sections.c Tue May 12 23:51:04 2020 (r360996) @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -341,6 +342,7 @@ create_scn(struct elfcopy *ecp) size_t indx; uint64_t oldndx, newndx; int elferr, sec_flags, reorder; + bool sections_added; /* * Insert a pseudo section that contains the ELF header @@ -364,6 +366,7 @@ create_scn(struct elfcopy *ecp) errx(EXIT_FAILURE, "elf_getshstrndx failed: %s", elf_errmsg(-1)); + sections_added = false; reorder = 0; is = NULL; while ((is = elf_nextscn(ecp->ein, is)) != NULL) { @@ -438,12 +441,14 @@ create_scn(struct elfcopy *ecp) oldndx = newndx = SHN_UNDEF; if (strcmp(name, ".symtab") != 0 && strcmp(name, ".strtab") != 0) { + /* Add new sections before .shstrtab if we have one. */ if (!strcmp(name, ".shstrtab")) { /* * Add sections specified by --add-section and * gnu debuglink. we want these sections have * smaller index than .shstrtab section. */ + sections_added = true; if (ecp->debuglink != NULL) add_gnu_debuglink(ecp); if (ecp->flags & SEC_ADD) @@ -504,6 +509,12 @@ create_scn(struct elfcopy *ecp) ecp->strtab = s; insert_to_sec_list(ecp, s, 0); + } + if (!sections_added) { + if (ecp->debuglink != NULL) + add_gnu_debuglink(ecp); + if (ecp->flags & SEC_ADD) + insert_sections(ecp); } elferr = elf_errno(); if (elferr != 0) From owner-svn-src-all@freebsd.org Wed May 13 00:05:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6428E2E190D; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@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 49MFL11ymGz4GHF; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3EB3A188E3; Wed, 13 May 2020 00:05:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D05D5i036474; Wed, 13 May 2020 00:05:13 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D05CO8036468; Wed, 13 May 2020 00:05:12 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005130005.04D05CO8036468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 13 May 2020 00:05:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360998 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 360998 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 00:05:13 -0000 Author: adrian Date: Wed May 13 00:05:11 2020 New Revision: 360998 URL: https://svnweb.freebsd.org/changeset/base/360998 Log: [ath] [ath_rate] Add some extra data into the rate control lookup. Right now (well, since I did this in 2011/2012) the rate control code makes some super bad choices for 11n aggregates/rates, and it tracks statistics even more questionably. It's been long enough and I'm now trying to use it again daily, so let's start by: * telling the rate control code if it's an aggregate or not; * being clearer about the TID - yes it can be extracted from the ath_buf but this way it can be overridden by the caller without changing the TID itself. (This is for doing experiments with voice/video QoS at some point..) * Return an optional field to limit how long the aggregate is in microseconds. Right now the rate control code supplies a rate table and the ath aggr form code will look at the rate table and limit the aggregate size to 4ms at the slowest rate. Yeah, this is pretty terrible. * Add some more TODO comments around handling txpower, rate and handling filtered frames status so if I continue to have spoons for this I can go poke at it. Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Wed May 13 00:05:11 2020 (r360998) @@ -104,8 +104,8 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) { struct amrr_node *amn = ATH_NODE_AMRR(an); @@ -115,6 +115,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod *txrate = amn->amn_tx_rate0sp; else *txrate = amn->amn_tx_rate0; + maxdur = -1; } /* Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Wed May 13 00:05:11 2020 (r360998) @@ -112,8 +112,8 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) { struct onoe_node *on = ATH_NODE_ONOE(an); @@ -123,6 +123,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod *txrate = on->on_tx_rate0sp; else *txrate = on->on_tx_rate0; + *maxdur = -1; } /* Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed May 13 00:05:11 2020 (r360998) @@ -482,8 +482,9 @@ ath_rate_pick_seed_rate_ht(struct ath_softc *sc, struc void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, - u_int8_t *rix0, int *try0, u_int8_t *txrate) + int shortPreamble, size_t frameLen, int tid, + bool is_aggr, u_int8_t *rix0, int *try0, + u_int8_t *txrate, int *maxdur) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) @@ -497,6 +498,10 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod unsigned average_tx_time; ath_rate_update_static_rix(sc, &an->an_node); + + /* For now don't take TID, is_aggr into account */ + /* Also for now don't calculate a max duration; that'll come later */ + *maxdur = -1; if (sn->currates != sc->sc_currates) { device_printf(sc->sc_dev, "%s: currates != sc_currates!\n", Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_ath.c Wed May 13 00:05:11 2020 (r360998) @@ -4312,6 +4312,11 @@ ath_tx_update_ratectrl(struct ath_softc *sc, struct ie an = ATH_NODE(ni); ATH_NODE_UNLOCK_ASSERT(an); + /* + * XXX TODO: teach the rate control about TXERR_FILT and + * see about handling it (eg see how many attempts were + * made before it got filtered and account for that.) + */ if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); ath_rate_tx_complete(sc, an, rc, ts, frmlen, nframes, nbad); @@ -4355,6 +4360,9 @@ ath_tx_process_buf_completion(struct ath_softc *sc, st /* * XXX assume this isn't an aggregate * frame. + * + * XXX TODO: also do this for filtered frames? + * Once rate control knows about them? */ ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, ts, Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_ath_tx.c Wed May 13 00:05:11 2020 (r360998) @@ -1376,10 +1376,12 @@ ath_tx_setds(struct ath_softc *sc, struct ath_buf *bf) * as they may depend upon the rate chosen. */ static void -ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf) +ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf, int tid, + bool is_aggr) { uint8_t rate, rix; int try0; + int maxdur; // Note: Unused for now if (! bf->bf_state.bfs_doratelookup) return; @@ -1389,7 +1391,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ ATH_NODE_LOCK(ATH_NODE(bf->bf_node)); ath_rate_findrate(sc, ATH_NODE(bf->bf_node), bf->bf_state.bfs_shpream, - bf->bf_state.bfs_pktlen, &rix, &try0, &rate); + bf->bf_state.bfs_pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur); /* In case MRR is disabled, make sure rc[0] is setup correctly */ bf->bf_state.bfs_rc[0].rix = rix; @@ -1519,7 +1521,7 @@ ath_tx_xmit_normal(struct ath_softc *sc, struct ath_tx bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; /* Setup the descriptor before handoff */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -3094,7 +3096,7 @@ ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node ath_tx_update_clrdmask(sc, tid, bf); /* Direct dispatch to hardware */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -4689,6 +4691,8 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct at * * XXX use the length in the first frame in the series; * XXX just so things are consistent for now. + * + * XXX TODO: need to signal this is a large frame no matter what... */ ath_tx_update_ratectrl(sc, ni, bf_first->bf_state.bfs_rc, &bf_first->bf_status.ds_txstat, @@ -5088,9 +5092,11 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * Now we know how many frames were bad, call the rate * control code. */ - if (fail == 0) + if (fail == 0) { + /* XXX TODO: what's pktlen here? */ ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, nbad); + } /* * send bar if we dropped any frames @@ -5429,7 +5435,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct /* Update CLRDMASK just before this frame is queued */ ath_tx_update_clrdmask(sc, tid, bf); - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -5453,7 +5459,7 @@ ath_tx_tid_hw_queue_aggr(struct ath_softc *sc, struct * really "do" aggregate lookups, so it only considers * the size of the first frame. */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, true); bf->bf_state.bfs_rc[3].rix = 0; bf->bf_state.bfs_rc[3].tries = 0; @@ -5644,7 +5650,7 @@ ath_tx_tid_hw_queue_norm(struct ath_softc *sc, struct ath_tx_update_clrdmask(sc, tid, bf); /* Program descriptors + rate control */ - ath_tx_do_ratelookup(sc, bf); + ath_tx_do_ratelookup(sc, bf, tid->tid, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Wed May 13 00:03:39 2020 (r360997) +++ head/sys/dev/ath/if_athrate.h Wed May 13 00:05:11 2020 (r360998) @@ -132,10 +132,15 @@ void ath_rate_getxtxrates(struct ath_softc *sc, struct * is to be setup then try0 should contain a value other than ATH_TXMATRY * and ath_rate_setupxtxdesc will be called after deciding if the frame * can be transmitted with multi-rate retry. + * + * maxdur is an optional return value (or -1 if not set) that defines + * the maximum frame duration in microseconds. This allows the rate + * control selection to override the maximum duration (normally 4ms) + * that the packet aggregation logic makes. */ void ath_rate_findrate(struct ath_softc *, struct ath_node *, - int shortPreamble, size_t frameLen, - u_int8_t *rix, int *try0, u_int8_t *txrate); + int shortPreamble, size_t frameLen, int tid, bool is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur); /* * Setup any extended (multi-rate) descriptor state for a data packet. * The rate index returned by ath_rate_findrate is passed back in. From owner-svn-src-all@freebsd.org Wed May 13 00:18:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D32422E1E9F; Wed, 13 May 2020 00:18:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MFdc5GG8z4H2F; Wed, 13 May 2020 00:18:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AFEE118B39; Wed, 13 May 2020 00:18:44 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D0IiXh043026; Wed, 13 May 2020 00:18:44 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D0Iipa043025; Wed, 13 May 2020 00:18:44 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005130018.04D0Iipa043025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 00:18:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360999 - head/sys/cam/ata X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/ata X-SVN-Commit-Revision: 360999 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 00:18:44 -0000 Author: imp Date: Wed May 13 00:18:44 2020 New Revision: 360999 URL: https://svnweb.freebsd.org/changeset/base/360999 Log: Make the ata probe* and xpt* routines aprobe* and axpt* respectively. Often, in traiging core files, one only has a traceback of where a panic occurred. We have probe* and xpt* routines that live in both the scsi and ata layers with identical names. To make one or the other stand out, prefix all the probe and xpt routines in ata with an 'a'. I've left the scsi ones alone since they were there first and are more numerous. I also rejected using #define to do this as being too confusing. I chose this method because the CAM name for the probe device was already 'aprobe'. Normally, this doesn't matter because file scope protects one from interfering with the other. However, due to the indirect nature of CAM's state machine, you don't know if the following traceback is SCSI or ATA: xpt_done probedone xpt_done_process xpt_done_td fork_exit nvme and mmc already have unique names. MFC: 1 week Differential revision: https://reviews.freebsd.org/D24825 Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed May 13 00:05:11 2020 (r360998) +++ head/sys/cam/ata/ata_xpt.c Wed May 13 00:18:44 2020 (r360999) @@ -71,16 +71,16 @@ struct ata_quirk_entry { u_int maxtags; }; -static periph_init_t probe_periph_init; +static periph_init_t aprobe_periph_init; -static struct periph_driver probe_driver = +static struct periph_driver aprobe_driver = { - probe_periph_init, "aprobe", - TAILQ_HEAD_INITIALIZER(probe_driver.units), /* generation */ 0, + aprobe_periph_init, "aprobe", + TAILQ_HEAD_INITIALIZER(aprobe_driver.units), /* generation */ 0, CAM_PERIPH_DRV_EARLY }; -PERIPHDRIVER_DECLARE(aprobe, probe_driver); +PERIPHDRIVER_DECLARE(aprobe, aprobe_driver); typedef enum { PROBE_RESET, @@ -100,7 +100,7 @@ typedef enum { PROBE_IDENTIFY_SAFTE, PROBE_DONE, PROBE_INVALID -} probe_action; +} aprobe_action; static char *probe_action_text[] = { "PROBE_RESET", @@ -134,13 +134,13 @@ do { \ typedef enum { PROBE_NO_ANNOUNCE = 0x04 -} probe_flags; +} aprobe_flags; typedef struct { TAILQ_HEAD(, ccb_hdr) request_ccbs; struct ata_params ident_data; - probe_action action; - probe_flags flags; + aprobe_action action; + aprobe_flags flags; uint32_t pm_pid; uint32_t pm_prv; int restart; @@ -162,19 +162,18 @@ static struct ata_quirk_entry ata_quirk_table[] = }, }; -static cam_status proberegister(struct cam_periph *periph, - void *arg); -static void probeschedule(struct cam_periph *probe_periph); -static void probestart(struct cam_periph *periph, union ccb *start_ccb); -static void proberequestdefaultnegotiation(struct cam_periph *periph); -static void probedone(struct cam_periph *periph, union ccb *done_ccb); -static void probecleanup(struct cam_periph *periph); +static cam_status aproberegister(struct cam_periph *periph, void *arg); +static void aprobeschedule(struct cam_periph *probe_periph); +static void aprobestart(struct cam_periph *periph, union ccb *start_ccb); +static void aproberequestdefaultnegotiation(struct cam_periph *periph); +static void aprobedone(struct cam_periph *periph, union ccb *done_ccb); +static void aprobecleanup(struct cam_periph *periph); static void ata_find_quirk(struct cam_ed *device); static void ata_scan_bus(struct cam_periph *periph, union ccb *ccb); static void ata_scan_lun(struct cam_periph *periph, struct cam_path *path, cam_flags flags, union ccb *ccb); -static void xptscandone(struct cam_periph *periph, union ccb *done_ccb); +static void axptscandone(struct cam_periph *periph, union ccb *done_ccb); static struct cam_ed * ata_alloc_device(struct cam_eb *bus, struct cam_et *target, lun_id_t lun_id); @@ -271,12 +270,12 @@ CAM_XPT_PROTO(ata_proto_satapm); CAM_XPT_PROTO(ata_proto_semb); static void -probe_periph_init() +aprobe_periph_init() { } static cam_status -proberegister(struct cam_periph *periph, void *arg) +aproberegister(struct cam_periph *periph, void *arg) { union ccb *request_ccb; /* CCB representing the probe request */ probe_softc *softc; @@ -307,12 +306,12 @@ proberegister(struct cam_periph *periph, void *arg) CAM_DEBUG(periph->path, CAM_DEBUG_PROBE, ("Probe started\n")); ata_device_transport(periph->path); - probeschedule(periph); + aprobeschedule(periph); return(CAM_REQ_CMP); } static void -probeschedule(struct cam_periph *periph) +aprobeschedule(struct cam_periph *periph) { union ccb *ccb; probe_softc *softc; @@ -336,7 +335,7 @@ probeschedule(struct cam_periph *periph) } static void -probestart(struct cam_periph *periph, union ccb *start_ccb) +aprobestart(struct cam_periph *periph, union ccb *start_ccb) { struct ccb_trans_settings cts; struct ccb_ataio *ataio; @@ -346,7 +345,7 @@ probestart(struct cam_periph *periph, union ccb *start struct ata_params *ident_buf; u_int oif; - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probestart\n")); + CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("aprobestart\n")); softc = (probe_softc *)periph->softc; path = start_ccb->ccb_h.path; @@ -367,7 +366,7 @@ probestart(struct cam_periph *periph, union ccb *start case PROBE_RESET: cam_fill_ataio(ataio, 0, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -378,7 +377,7 @@ probestart(struct cam_periph *periph, union ccb *start case PROBE_IDENTIFY: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -394,7 +393,7 @@ probestart(struct cam_periph *periph, union ccb *start xpt_print(path, "Spinning up device\n"); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE | CAM_HIGH_POWER, 0, /*data_ptr*/NULL, @@ -469,7 +468,7 @@ negotiate: xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -481,7 +480,7 @@ negotiate: case PROBE_SETPM: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -494,7 +493,7 @@ negotiate: case PROBE_SETAPST: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -507,7 +506,7 @@ negotiate: case PROBE_SETDMAAA: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -528,7 +527,7 @@ negotiate: xpt_async(AC_GETDEV_CHANGED, path, NULL); cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -591,7 +590,7 @@ negotiate: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, CAM_DIR_NONE, 0, NULL, @@ -659,7 +658,7 @@ negotiate: inquiry_len = roundup2(inquiry_len, 2); scsi_inquiry(csio, /*retries*/1, - probedone, + aprobedone, MSG_SIMPLE_Q_TAG, (u_int8_t *)inq_buf, inquiry_len, @@ -672,7 +671,7 @@ negotiate: case PROBE_PM_PID: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -683,7 +682,7 @@ negotiate: case PROBE_PM_PRV: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_NONE, 0, /*data_ptr*/NULL, @@ -694,7 +693,7 @@ negotiate: case PROBE_IDENTIFY_SES: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -706,7 +705,7 @@ negotiate: case PROBE_IDENTIFY_SAFTE: cam_fill_ataio(ataio, 1, - probedone, + aprobedone, /*flags*/CAM_DIR_IN, 0, /*data_ptr*/(u_int8_t *)&softc->ident_data, @@ -716,14 +715,14 @@ negotiate: sizeof(softc->ident_data) / 4); break; default: - panic("probestart: invalid action state 0x%x\n", softc->action); + panic("aprobestart: invalid action state 0x%x\n", softc->action); } start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE; xpt_action(start_ccb); } static void -proberequestdefaultnegotiation(struct cam_periph *periph) +aproberequestdefaultnegotiation(struct cam_periph *periph) { struct ccb_trans_settings cts; @@ -740,7 +739,7 @@ proberequestdefaultnegotiation(struct cam_periph *peri } static void -probedone(struct cam_periph *periph, union ccb *done_ccb) +aprobedone(struct cam_periph *periph, union ccb *done_ccb) { struct ccb_trans_settings cts; struct ata_params *ident_buf; @@ -755,7 +754,7 @@ probedone(struct cam_periph *periph, union ccb *done_c {0, SVPD_DEVICE_ID, 0, 12, SVPD_ID_CODESET_BINARY, SVPD_ID_TYPE_NAA, 0, 8}; - CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("probedone\n")); + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("aprobedone\n")); softc = (probe_softc *)periph->softc; path = done_ccb->ccb_h.path; @@ -1017,7 +1016,7 @@ noerror: } ata_device_transport(path); if (changed == 2) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); PROBE_SET_ACTION(softc, PROBE_SETMODE); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1228,7 +1227,7 @@ notsata: path->device->flags |= CAM_DEV_IDENTIFY_DATA_VALID; ata_device_transport(path); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1317,7 +1316,7 @@ notsata: } ata_device_transport(path); if (changed) - proberequestdefaultnegotiation(periph); + aproberequestdefaultnegotiation(periph); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -1329,13 +1328,13 @@ notsata: PROBE_SET_ACTION(softc, PROBE_DONE); break; default: - panic("probedone: invalid action state 0x%x\n", softc->action); + panic("aprobedone: invalid action state 0x%x\n", softc->action); } done: if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - probeschedule(periph); + aprobeschedule(periph); goto out; } xpt_release_ccb(done_ccb); @@ -1353,7 +1352,7 @@ done: } static void -probecleanup(struct cam_periph *periph) +aprobecleanup(struct cam_periph *periph) { free(periph->softc, M_CAMXPT); } @@ -1594,7 +1593,7 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat return; } xpt_setup_ccb(&request_ccb->ccb_h, new_path, CAM_PRIORITY_XPT); - request_ccb->ccb_h.cbfcnp = xptscandone; + request_ccb->ccb_h.cbfcnp = axptscandone; request_ccb->ccb_h.flags |= CAM_UNLOCKED; request_ccb->ccb_h.func_code = XPT_SCAN_LUN; request_ccb->crcn.flags = flags; @@ -1616,8 +1615,8 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat xpt_done(request_ccb); } } else { - status = cam_periph_alloc(proberegister, NULL, probecleanup, - probestart, "aprobe", + status = cam_periph_alloc(aproberegister, NULL, aprobecleanup, + aprobestart, "aprobe", CAM_PERIPH_BIO, request_ccb->ccb_h.path, NULL, 0, request_ccb); @@ -1634,7 +1633,7 @@ ata_scan_lun(struct cam_periph *periph, struct cam_pat } static void -xptscandone(struct cam_periph *periph, union ccb *done_ccb) +axptscandone(struct cam_periph *periph, union ccb *done_ccb) { xpt_free_path(done_ccb->ccb_h.path); From owner-svn-src-all@freebsd.org Wed May 13 02:01:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 701EE2E42E2; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MHwT2KJrz4MKN; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qk1-f181.google.com (mail-qk1-f181.google.com [209.85.222.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 3EE9B2CD97; Wed, 13 May 2020 02:01:45 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qk1-f181.google.com with SMTP id s186so14030912qkd.4; Tue, 12 May 2020 19:01:45 -0700 (PDT) X-Gm-Message-State: AGi0PuY4Q8PnFfceu8I/0M1BwYg0ZTRqeXA/tzoFDCquAIkC9zsEOm67 eh0aC2fFBsZO1Pt8wLtQCrDqthkYAtyZammq1Sk= X-Google-Smtp-Source: APiQypIWhNvpyOSpd+c2OiSLNe2+pxjbNJxX+nShO6w9swqF5gQ0oqG+US9PczP9in9JmwG0v7ZGEQ56cioxvpTcFYI= X-Received: by 2002:a37:6658:: with SMTP id a85mr23655178qkc.493.1589335304304; Tue, 12 May 2020 19:01:44 -0700 (PDT) MIME-Version: 1.0 References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> In-Reply-To: <20200512221603.GB60902@spindle.one-eyed-alien.net> From: Kyle Evans Date: Tue, 12 May 2020 21:01:33 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r360833 - head To: Brooks Davis Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 02:01:45 -0000 On Tue, May 12, 2020 at 5:16 PM Brooks Davis wrote: > > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wrote: > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > Author: kevans > > > > Date: Sat May 9 02:01:29 2020 > > > > New Revision: 360833 > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > Log: > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > This can be run as root or normal user with no problem; if they hadn't > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host certctl to > > > > rehash the DESTDIR. This would allow one to build systems WITHOUT_OPENSSL + > > > > WITH_CAROOT with a populated /etc/ssl that they can then use with an > > > > appropriate *ssl from somewhere else. > > > > > > > > Cross-builds are fine because this will always use the host certctl, or just > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > MFC after: 1 week > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > Modified: > > > > head/Makefile.inc1 > > > > > > > > Modified: head/Makefile.inc1 > > > > ============================================================================== > > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r360832) > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r360833) > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _installcheck > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > .endfor > > > > .endif > > > > +.elif make(installworld) && ${MK_CAROOT} != "no" > > > > + # We could make certctl a bootstrap tool, but it requires OpenSSL and > > > > + # friends, which we likely don't want. We'll rehash on a best-effort > > > > + # basis, otherwise we'll just mention that we're not doing it to raise > > > > + # awareness. > > > > + @if which certctl>/dev/null; then \ > > > > + certctl rehash \ > > > > > > Does this update METALOG with the added links? > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > In general I'm not enthusiastic about additions to installworld that do > > > anything other than copying files, creating links, etc in simple ways. > > > > I will happily back this out if I can get some qualified eyes to > > review/improve it. It does not update METALOG, and it probably should. > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > `certctl rehash` all over the tree in various points that may need it; > > the release(7) scripts will need to be done if we don't do it here at > > a minimum, and I haven't put much thought into it beyond that. > > I'm not in a rush to back this out given that it's solving a real > problem, but lets talk about improvements. > > I kind of feel like this belongs in distribution (which I think would > deal with release scripts) or in etcupdate/mergemaster, but I'm not > sure either of those are correct. I'd be happy to review changes to > update the METALOG (I guess we'd extend certctl with an option to do > that?) I think that's the most important things because we really > should be routinely validating that DESTDIR only contains things in the > METALOG. A quick and dirty fix for the DESTDIR weirdness might be adding > "env DESTDIR=${DESTDIR}" so it's explicit. > Got it- not an egregious enough violation to promptly back out, but we will work towards a better solution. For the larger picture, distribution is probably the correct spot for this; we currently rehash at the following points: - mergemaster/etcupdate - freebsd-update - post-install of the caroot pkg (pkgbase) This leaves two primary final blind spots, which this commit was attempting to resolve: 1.) Install media (including VM images) 2.) Initial installs (e.g. from bsdinstall) #1 could be solved by directly adding it to the release(7) scripts and #2 could be solved by having bsdinstall do it at config time, but there seem to be multiple potential points that could instead hit both (with a single stone) while also making covering the array of other images that re@ produces (e.g. AWS images) and perhaps other points that we've not immediately considered. To this end, distribution or installworld are probably equally sufficient, but I'm incredibly unfamiliar with the former. My understanding from glancing at it over the years is that it may be executed into a tempdir and merged with mergemaster/etcupdate, or directly into the new root if we're looking at a new install that doesn't have potential local changes to merge in. Part of the problem that I see in my head is probably solved by just having a var that mergemaster/etcupdate can pass in to distribution to not bother with the rehash. We want to keep the mergemaster/etcupdate rehash because if they're running then the target's certainly not been rehashed. OTOH, we probably don't want to rehash multiple times in that pipeline- from a certctl standpoint, it's completely harmless, but it's not the most effective use of system resources and probably looks a bit bad. > > The close-to-infuriating part of the caroot project has been that it's > > incredibly hard to get almost anyone else (with some obvious > > exceptions) to do more than informal discussion on the matter; actual > > review, in particular, is difficult to obtain. > > Thanks for doing all this work! I'm afraid the whole thing gives me > third-rail vibes (not the idea or the implementation, but the potential > for things to go wrong) so I've veered away from the larger reviews. :( > Thanks! I'm effectively diffused now... apologies for the suboptimal tone of my previous message, I do want to work towards a solution that we can all be happy with. Thanks, Kyle Evans From owner-svn-src-all@freebsd.org Wed May 13 02:17:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E31362E48CB; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MJGb5WqZz4N74; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B8C931A23F; Wed, 13 May 2020 02:17:27 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D2HR3S016241; Wed, 13 May 2020 02:17:27 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D2HRvV016240; Wed, 13 May 2020 02:17:27 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005130217.04D2HRvV016240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 13 May 2020 02:17:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361000 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 361000 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 02:17:27 -0000 Author: kevans Date: Wed May 13 02:17:27 2020 New Revision: 361000 URL: https://svnweb.freebsd.org/changeset/base/361000 Log: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. Submitted by: debdrup MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24800 Modified: head/usr.sbin/inetd/inetd.8 Modified: head/usr.sbin/inetd/inetd.8 ============================================================================== --- head/usr.sbin/inetd/inetd.8 Wed May 13 00:18:44 2020 (r360999) +++ head/usr.sbin/inetd/inetd.8 Wed May 13 02:17:27 2020 (r361000) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 12, 2020 .Dt INETD 8 .Os .Sh NAME @@ -800,6 +800,8 @@ shell stream tcp46 nowait root /usr/libexec/ tcpmux/+date stream tcp nowait guest /bin/date date tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 /var/run/echo stream unix nowait root internal #@ ipsec ah/require chargen stream tcp nowait root internal @@ -914,6 +916,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , From owner-svn-src-all@freebsd.org Wed May 13 04:41:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 667EA2E6BE8; Wed, 13 May 2020 04:41:08 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49MMSN1zS8z4TbJ; Wed, 13 May 2020 04:41:08 +0000 (UTC) (envelope-from freebsd@bdragon.rtk0.net) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 79DB85C0134; Wed, 13 May 2020 00:41:07 -0400 (EDT) Received: from imap1 ([10.202.2.51]) by compute1.internal (MEProxy); Wed, 13 May 2020 00:41:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=BPTcqfk3EzWdYQPbD2MF97z0lhhio83hs7iAS7rDk q8=; b=N4faSzJQ7xNZRpZqEAvK9Nbkn47g/pqfIVlZL8JFSdoN615l6potugnqN Pjwn6ZBVUP4kBCElX+aKky1+q+jZLE+ii6ZkokU/TTjdT5TYcqUdQV3dN4DSEMYe tYCHSPvkYJbwVmBPoOeQJ5bwJcnN3FWLcReIVt5QXIAHXxbA3J2yahVj7/dAG7q/ gxX4eGUtD5d/ICgnsnRm766outuElt1F7/zsQ+tfVQAkZSCtHazrXRjrP+syov+V NjtlzB9DpIhGr7FU9oOC9rGcQvVKUduuV+gBTw4oSwB9+cclg8WzAuEEaixFjtuO 7R0qGrI/zP774Bmb5o6fGCNfI9++A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrleefgdekgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdeurhgr nhguohhnuceuvghrghhrvghnfdcuoehfrhgvvggsshgusegsughrrghgohhnrdhrthhktd drnhgvtheqnecuggftrfgrthhtvghrnhepudejudejgeehgfdvteeijeffteeugffhjedu udeugfefleelffehgeffudejtdfhnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgpd gtohhmphhilhgvrhdrmhhkpdhshihsrdhmkhdpphhrvgdrmhhkpdhofihnrdhmkhdpghhn uhdrohhrghdplhhlvhhmrdhorhhgpdhinhhithdrmhhkpdhsuhgsughirhdrmhhkpdhprh hoghdrmhhknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho mhepfhhrvggvsghsugessggurhgrghhonhdrrhhtkhdtrdhnvght X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id C0E87C200A4; Wed, 13 May 2020 00:41:06 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-413-g750b809-fmstable-20200507v1 Mime-Version: 1.0 Message-Id: In-Reply-To: References: <202005121522.04CFMfuo007680@repo.freebsd.org> Date: Tue, 12 May 2020 23:40:46 -0500 From: "Brandon Bergren" To: "Ravi Pokala" , "Eric van Gyzen" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: =?UTF-8?Q?Re:_svn_commit:_r360964_-_in_head:_lib/libclang=5Frt_lib/libth?= =?UTF-8?Q?r_lib/msun_libexec/rtld-elf_libexec/tftpd/tests_share/mk_stan?= =?UTF-8?Q?d_stand/arm/uboot_stand/efi_stand/efi/boot1_stand/efi/loader_?= =?UTF-8?Q?stand/i386/boot2_st...?= Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 49MMSN1zS8z4TbJ X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.00 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.997,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 04:41:08 -0000 Why is this marked for MFC? FreeBSD 12 uses base GCC 4.2.1 on some platf= orms. On Tue, May 12, 2020, at 1:34 PM, Ravi Pokala wrote: > This feels like it deserves an UPDATING (and possibly a RELNOTES) entr= y. >=20 > -Ravi (rpokala@) >=20 > =EF=BB=BF-----Original Message----- > From: on behalf of Eric van Gyzen=20= > > Date: 2020-05-12, Tuesday at 08:22 > To: , ,=20 > > Subject: svn commit: r360964 - in head: lib/libclang_rt lib/libthr=20 > lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand=20 > stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader=20 > stand/i386/boot2 st... >=20 > Author: vangyzen > Date: Tue May 12 15:22:40 2020 > New Revision: 360964 > URL: https://svnweb.freebsd.org/changeset/base/360964 >=20 > Log: > Remove tests for obsolete compilers in the build system >=20 > Assume gcc is at least 6.4, the oldest xtoolchain in the ports t= ree. > Assume clang is at least 6, which was in 11.2-RELEASE. Drop con= ditions > for older compilers. >=20 > Reviewed by: imp (earlier version), emaste, jhb > MFC after: 2 weeks > Sponsored by: Dell EMC Isilon > Differential Revision: https://reviews.freebsd.org/D24802 >=20 > Modified: > head/lib/libclang_rt/Makefile.inc > head/lib/libthr/Makefile > head/lib/msun/Makefile > head/libexec/rtld-elf/Makefile > head/libexec/tftpd/tests/Makefile > head/share/mk/bsd.compiler.mk > head/share/mk/bsd.sys.mk > head/stand/arm/uboot/Makefile > head/stand/defs.mk > head/stand/efi/Makefile > head/stand/efi/boot1/Makefile > head/stand/efi/loader/Makefile > head/stand/i386/boot2/Makefile > head/stand/i386/isoboot/Makefile > head/stand/libsa/Makefile > head/sys/conf/Makefile.arm > head/sys/conf/Makefile.powerpc > head/sys/conf/kern.mk > head/sys/conf/kern.post.mk > head/sys/conf/kern.pre.mk > head/sys/conf/kmod.mk > head/sys/modules/Makefile > head/usr.sbin/acpi/acpidb/Makefile > head/usr.sbin/trpt/Makefile > head/usr.sbin/zic/zic/Makefile >=20 > Modified: head/lib/libclang_rt/Makefile.inc > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/libclang_rt/Makefile.inc Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/lib/libclang_rt/Makefile.inc Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -32,7 +32,7 @@ CFLAGS+=3D ${PICFLAG} > CFLAGS+=3D -fno-builtin > CFLAGS+=3D -fno-exceptions > CXXFLAGS+=3D -fno-rtti > -.if ${COMPILER_TYPE} =3D=3D clang && ${COMPILER_VERSION} >=3D 307= 00 > +.if ${COMPILER_TYPE} =3D=3D clang > CFLAGS+=3D -fno-sanitize=3Dsafe-stack > .endif > CFLAGS+=3D -fno-stack-protector >=20 > Modified: head/lib/libthr/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/libthr/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/lib/libthr/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -29,10 +29,7 @@ CFLAGS+=3D-Winline >=20 > CFLAGS.thr_stack.c+=3D -Wno-cast-align > CFLAGS.rtld_malloc.c+=3D -Wno-cast-align > -.include > -.if !(${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 4030= 0) > CFLAGS.thr_symbols.c+=3D -Wno-missing-variable-declarations > -.endif >=20 > .ifndef NO_THREAD_UNWIND_STACK > CFLAGS+=3D-fexceptions >=20 > Modified: head/lib/msun/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/lib/msun/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/lib/msun/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -108,13 +108,13 @@ COMMON_SRCS+=3D catrigl.c \ > s_nextafterl.c s_nexttoward.c s_remquol.c s_rintl.c s_roundl.c \= > s_scalbnl.c s_sinl.c s_sincosl.c \ > s_tanhl.c s_tanl.c s_truncl.c w_cabsl.c > -# Work around this warning from gcc 6: > +# Work around this warning from gcc: > # lib/msun/ld80/e_powl.c:275:1: error: floating constant=20 > exceeds range of > # 'long double' [-Werror=3Doverflow] > # if( y >=3D LDBL_MAX ) > # See also:=20 > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D130067 > .include > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 600= 00 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CFLAGS.e_powl.c+=3D -Wno-error=3Doverflow > .endif > .endif >=20 > Modified: head/libexec/rtld-elf/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/libexec/rtld-elf/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/libexec/rtld-elf/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -90,8 +90,4 @@ ${PROG_FULL}: ${VERSION_MAP} > # GCC warns about redeclarations even though they have __exported= > # and are therefore not identical to the ones from the system=20 > headers. > CFLAGS+=3D -Wno-redundant-decls > -.if ${COMPILER_VERSION} < 40300 > -# Silence -Wshadow false positives in ancient GCC > -CFLAGS+=3D -Wno-shadow > -.endif > .endif >=20 > Modified: head/libexec/tftpd/tests/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/libexec/tftpd/tests/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/libexec/tftpd/tests/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -2,11 +2,8 @@ >=20 > .include >=20 > -# Skip on GCC 4.2, because it lacks __COUNTER__ > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40300= > ATF_TESTS_C=3D functional > TEST_METADATA.functional+=3D timeout=3D15 > -.endif >=20 > LIBADD=3D util > WARNS?=3D 6 >=20 > Modified: head/share/mk/bsd.compiler.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/share/mk/bsd.compiler.mk Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/share/mk/bsd.compiler.mk Tue May 12 15:22:40 2020 (r36096= 4) > @@ -205,20 +205,12 @@ ${X_}COMPILER_FREEBSD_VERSION=3D unknown > ${X_}COMPILER_RESOURCE_DIR!=3D ${${cc}:N${CCACHE_BIN}}=20 > -print-resource-dir 2>/dev/null || echo unknown > .endif >=20 > -${X_}COMPILER_FEATURES=3D > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 30300) || \ > - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 40800) > -${X_}COMPILER_FEATURES+=3D c++11 > -.endif > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 30400) || \ > - (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 50000) > -${X_}COMPILER_FEATURES+=3D c++14 > -.endif > -.if (${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERS= ION}=20 > >=3D 50000) || \ > +${X_}COMPILER_FEATURES=3D c++11 c++14 > +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" || \ > (${${X_}COMPILER_TYPE} =3D=3D "gcc" && ${${X_}COMPILER_VERSION} = >=3D=20 > 70000) > ${X_}COMPILER_FEATURES+=3D c++17 > .endif > -.if ${${X_}COMPILER_TYPE} =3D=3D "clang" && ${${X_}COMPILER_VERSI= ON}=20 > >=3D 60000 > +.if ${${X_}COMPILER_TYPE} =3D=3D "clang" > ${X_}COMPILER_FEATURES+=3D retpoline > .endif >=20 >=20 > Modified: head/share/mk/bsd.sys.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/share/mk/bsd.sys.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/share/mk/bsd.sys.mk Tue May 12 15:22:40 2020 (r360964) > @@ -6,8 +6,7 @@ > # Enable various levels of compiler warning checks. These may be= > # overridden (e.g. if using a non-gcc compiler) by defining=20 > MK_WARNS=3Dno. >=20 > -# for 4.2.1 GCC: =20 > http://gcc.gnu.org/onlinedocs/gcc-4.2.1/gcc/Warning-Options.html > -# for current GCC:=20 > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html > +# for GCC: =20 > https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html > # for clang: https://clang.llvm.org/docs/DiagnosticsReference.htm= l >=20 > .include > @@ -29,15 +28,6 @@ CFLAGS+=3D -std=3D${CSTD} > CXXFLAGS+=3D -std=3D${CXXSTD} > .endif >=20 > -# > -# Turn off -Werror for gcc 4.2.1. The compiler is on the glide=20= > path out of the > -# system, and any warnings specific to it are no longer relevant=20= > as there are > -# too many false positives. > -# > -.if ${COMPILER_VERSION} < 50000 > -NO_WERROR.gcc=3D yes > -.endif > - > # -pedantic is problematic because it also imposes namespace=20 > restrictions > #CFLAGS+=3D -pedantic > .if defined(WARNS) > @@ -81,19 +71,13 @@ CWARNFLAGS+=3D -Wno-pointer-sign > # is set to low values, these have to be disabled explicitly. > .if ${WARNS} <=3D 6 > CWARNFLAGS.clang+=3D -Wno-empty-body -Wno-string-plus-int > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0400 > CWARNFLAGS.clang+=3D -Wno-unused-const-variable > -.endif > .endif # WARNS <=3D 6 > .if ${WARNS} <=3D 3 > CWARNFLAGS.clang+=3D -Wno-tautological-compare -Wno-unused-value\= > -Wno-parentheses-equality -Wno-unused-function=20 > -Wno-enum-conversion > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0600 > CWARNFLAGS.clang+=3D -Wno-unused-local-typedef > -.endif > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 4= 0000 > CWARNFLAGS.clang+=3D -Wno-address-of-packed-member > -.endif > .if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 901= 00 > CWARNFLAGS.gcc+=3D -Wno-address-of-packed-member > .endif > @@ -113,7 +97,7 @@ CWARNFLAGS.clang+=3D -Wno-array-bounds > .endif # NO_WARRAY_BOUNDS > .if defined(NO_WMISLEADING_INDENTATION) && \ > ((${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D= =20 > 100000) || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 6= 0100)) > + ${COMPILER_TYPE} =3D=3D "gcc") > CWARNFLAGS+=3D -Wno-misleading-indentation > .endif # NO_WMISLEADING_INDENTATION > .endif # WARNS > @@ -137,8 +121,10 @@ CWARNFLAGS+=3D -Werror > CWARNFLAGS+=3D -Wno-format > .endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE} >=20 > -# GCC 5.2.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 502= 00 > +# GCC > +# We should clean up warnings produced with these flags. > +# They were originally added as a quick hack to enable gcc5/6. > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS+=3D -Wno-error=3Daddress \ > -Wno-error=3Darray-bounds \ > -Wno-error=3Dattributes \ > @@ -150,23 +136,18 @@ CWARNFLAGS+=3D -Wno-error=3Daddress \ > -Wno-error=3Dextra \ > -Wno-error=3Dinline \ > -Wno-error=3Dlogical-not-parentheses \ > + -Wno-error=3Dnonnull-compare \ > + -Wno-error=3Dshift-negative-value \ > -Wno-error=3Dstrict-aliasing \ > + -Wno-error=3Dtautological-compare \ > -Wno-error=3Duninitialized \ > -Wno-error=3Dunused-but-set-variable \ > + -Wno-error=3Dunused-const-variable \ > -Wno-error=3Dunused-function \ > -Wno-error=3Dunused-value > -.endif >=20 > -# GCC 6.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 601= 00 > -CWARNFLAGS+=3D -Wno-error=3Dnonnull-compare \ > - -Wno-error=3Dshift-negative-value \ > - -Wno-error=3Dtautological-compare \ > - -Wno-error=3Dunused-const-variable > -.endif > - > # GCC 7.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 701= 00 > +.if ${COMPILER_VERSION} >=3D 70100 > CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ > -Wno-error=3Ddeprecated \ > -Wno-error=3Dexpansion-to-defined \ > @@ -182,7 +163,7 @@ CWARNFLAGS+=3D -Wno-error=3Dbool-operation \ > .endif >=20 > # GCC 8.1.0 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 801= 00 > +.if ${COMPILER_VERSION} >=3D 80100 > CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-optimizations \ > -Wno-error=3Dcast-function-type \ > -Wno-error=3Dcatch-value \ > @@ -191,9 +172,10 @@ CWARNFLAGS+=3D -Wno-error=3Daggressive-loop-o= ptimizations > -Wno-error=3Dsizeof-pointer-memaccess \ > -Wno-error=3Dstringop-truncation > .endif > +.endif # gcc >=20 > # How to handle FreeBSD custom printf format specifiers. > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 3= 0600 > +.if ${COMPILER_TYPE} =3D=3D "clang" > FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ > .else > FORMAT_EXTENSIONS=3D -fformat-extensions > @@ -223,11 +205,7 @@ CFLAGS+=3D-nobuiltininc -idirafter ${COMPILER= _RESOURCE_D >=20 > CLANG_OPT_SMALL=3D -mstack-alignment=3D8 -mllvm -inline-threshold= =3D3\ > -mllvm -simplifycfg-dup-ret > -.if ${COMPILER_VERSION} >=3D 30500 && ${COMPILER_VERSION} < 30700= > -CLANG_OPT_SMALL+=3D -mllvm -enable-gvn=3Dfalse > -.else > CLANG_OPT_SMALL+=3D -mllvm -enable-load-pre=3Dfalse > -.endif > CFLAGS.clang+=3D -Qunused-arguments > # The libc++ headers use c++11 extensions. These are normally=20= > silenced because > # they are treated as system headers, but we explicitly disable=20= > that warning > @@ -238,14 +216,8 @@ CXXFLAGS.clang+=3D -Wno-c++11-extensions >=20 > .if ${MK_SSP} !=3D "no" && \ > ${MACHINE_CPUARCH} !=3D "arm" && ${MACHINE_CPUARCH} !=3D "mip= s" > -.if (${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D = 30500) || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && \ > - (${COMPILER_VERSION} =3D=3D 40201 || ${COMPILER_VERSION} >=3D= 40900)) > # Don't use -Wstack-protector as it breaks world with -Werror. > SSP_CFLAGS?=3D -fstack-protector-strong > -.else > -SSP_CFLAGS?=3D -fstack-protector > -.endif > CFLAGS+=3D ${SSP_CFLAGS} > .endif # SSP && !ARM && !MIPS >=20 >=20 > Modified: head/stand/arm/uboot/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/arm/uboot/Makefile Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/stand/arm/uboot/Makefile Tue May 12 15:22:40 2020 (r36096= 4) > @@ -24,7 +24,7 @@ UBLDR_LOADADDR?=3D 0x1000000 > # Architecture-specific loader code > SRCS=3D start.S conf.c self_reloc.c vers.c >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > .endif >=20 >=20 > Modified: head/stand/defs.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/defs.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/defs.mk Tue May 12 15:22:40 2020 (r360964) > @@ -143,11 +143,7 @@ CFLAGS+=3D -fPIC -mno-red-zone > # Do not generate movt/movw, because the relocation fixup for the= m=20 > does not > # translate to the -Bsymbolic -pie format required by self_reloc(= )=20 > in loader(8). > # Also, the fpu is not available in a standalone environment. > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone > CFLAGS+=3D -fPIC > .endif >=20 > Modified: head/stand/efi/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/efi/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -4,16 +4,10 @@ NO_OBJ=3Dt >=20 > .include >=20 > -# In-tree GCC does not support __attribute__((ms_abi)), but gcc n= ewer > -# than 4.5 supports it. > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 40500= > - > SUBDIR.${MK_FDT}+=3D fdt > SUBDIR.yes+=3D libefi boot1 gptboot > SUBDIR.${MK_FORTH}+=3D loader_4th > SUBDIR.${MK_LOADER_LUA}+=3D loader_lua > SUBDIR.yes+=3D loader_simp > - > -.endif # ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D = 40500 >=20 > .include >=20 > Modified: head/stand/efi/boot1/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/boot1/Makefile Tue May 12 14:47:38 2020 (r36096= 3) > +++ head/stand/efi/boot1/Makefile Tue May 12 15:22:40 2020 (r36096= 4) > @@ -42,10 +42,6 @@=20 > CFLAGS.zfs_module.c+=3D -I${SYSDIR}/cddl/contrib/opensol > CFLAGS+=3D -DEFI_ZFS_BOOT > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > -.endif > - > CFLAGS+=3D -I${EFIINC} > CFLAGS+=3D -I${EFIINCMD} > CFLAGS+=3D -I${SYSDIR}/contrib/dev/acpica/include >=20 > Modified: head/stand/efi/loader/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/efi/loader/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/efi/loader/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -31,10 +31,6 @@ CFLAGS+=3D -DEFI_ZFS_BOOT > HAVE_ZFS=3D yes > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} > 40201 > -CWARNFLAGS.self_reloc.c+=3D -Wno-error=3Dmaybe-uninitialized > -.endif > - > # We implement a slightly non-standard %S in that it always takes= a > # CHAR16 that's common in UEFI-land instead of a wchar_t. This on= ly > # seems to matter on arm64 where wchar_t defaults to an int inste= ad >=20 > Modified: head/stand/i386/boot2/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/i386/boot2/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/i386/boot2/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -37,9 +37,6 @@ CFLAGS+=3D-fomit-frame-pointer \ > CFLAGS.gcc+=3D -Os \ > -fno-asynchronous-unwind-tables \ > --param max-inline-insns-single=3D100 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 402= 01 > -CFLAGS.gcc+=3D -mno-align-long-strings > -.endif >=20 > CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} >=20 >=20 > Modified: head/stand/i386/isoboot/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/i386/isoboot/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/stand/i386/isoboot/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -32,9 +32,6 @@ CFLAGS+=3D-DBOOTPROG=3D\"isoboot\" \ > -Winline -Wno-pointer-sign >=20 > CFLAGS.gcc+=3D --param max-inline-insns-single=3D100 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} <=3D 402= 01 > -CFLAGS.gcc+=3D -Wno-uninitialized > -.endif > CFLAGS.clang+=3D -Oz ${CLANG_OPT_SMALL} >=20 > LD_FLAGS+=3D${LD_FLAGS_BIN} >=20 > Modified: head/stand/libsa/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/stand/libsa/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/stand/libsa/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -46,11 +46,7 @@ SRCS+=3D subr_boot.c > # Do not generate movt/movw, because the relocation fixup for the= m=20 > does not > # translate to the -Bsymbolic -pie format required by self_reloc(= )=20 > in loader(8). > # Also, the fpu is not available in a standalone environment. > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone >=20 > .PATH: ${SRCTOP}/contrib/llvm-project/compiler-rt/lib/builtins/ar= m/ >=20 > Modified: head/sys/conf/Makefile.arm > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/Makefile.arm Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/Makefile.arm Tue May 12 15:22:40 2020 (r360964) > @@ -44,10 +44,6 @@ CFLAGS.clang +=3D -mfpu=3Dnone >=20 > .if !empty(DDB_ENABLED) > CFLAGS +=3D -funwind-tables > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} < 3050= 0 > -# clang < 3.5.0 requires us to tell it to emit assembly with=20 > unwind information > -CFLAGS +=3D -mllvm -arm-enable-ehabi > -.endif > .endif >=20 > # "makeoptions KERNVIRTADDR=3D" is now optional, supply the defau= lt value. >=20 > Modified: head/sys/conf/Makefile.powerpc > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/Makefile.powerpc Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/sys/conf/Makefile.powerpc Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -51,7 +51,7 @@ DPAAWARNFLAGS +=3D \ > -Wno-error=3Dincompatible-pointer-types-discards-qualifie= rs \ > -Wno-error=3Dnon-literal-null-conversion \ > -Wno-error=3Denum-conversion > -.elif "${COMPILER_TYPE}" =3D=3D "gcc" && ${COMPILER_VERSION} >=3D= 50200 > +.elif "${COMPILER_TYPE}" =3D=3D "gcc" > DPAAWARNFLAGS +=3D \ > -Wno-error=3Dredundant-decls \ > -Wno-error=3Dint-in-bool-context >=20 > Modified: head/sys/conf/kern.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.mk Tue May 12 15:22:40 2020 (r360964) > @@ -31,19 +31,14 @@ NO_WTAUTOLOGICAL_POINTER_COMPARE=3D=20 > -Wno-tautological-po > CWARNEXTRA?=3D -Wno-error-tautological-compare -Wno-error-empty-b= ody=20 > \ > -Wno-error-parentheses-equality -Wno-error-unused-function \ > -Wno-error-pointer-sign > -.if ${COMPILER_VERSION} >=3D 30700 > CWARNEXTRA+=3D -Wno-error-shift-negative-value > -.endif > -.if ${COMPILER_VERSION} >=3D 40000 > CWARNEXTRA+=3D -Wno-address-of-packed-member > -.endif > .if ${COMPILER_VERSION} >=3D 100000 > NO_WMISLEADING_INDENTATION=3D -Wno-misleading-indentation > .endif > -.endif > +.endif # clang >=20 > .if ${COMPILER_TYPE} =3D=3D "gcc" > -.if ${COMPILER_VERSION} >=3D 40800 > # Catch-all for all the things that are in our tree, but for whic= h=20 > we're > # not yet ready for this compiler. > NO_WUNUSED_BUT_SET_VARIABLE =3D -Wno-unused-but-set-variable > @@ -55,15 +50,13 @@ CWARNEXTRA?=3D -Wno-error=3Daddress \ > -Wno-error=3Denum-compare \ > -Wno-error=3Dinline \ > -Wno-error=3Dmaybe-uninitialized \ > + -Wno-error=3Dmisleading-indentation \ > + -Wno-error=3Dnonnull-compare \ > -Wno-error=3Doverflow \ > -Wno-error=3Dsequence-point \ > - -Wno-unused-but-set-variable > -.if ${COMPILER_VERSION} >=3D 60100 > -CWARNEXTRA+=3D -Wno-error=3Dmisleading-indentation \ > - -Wno-error=3Dnonnull-compare \ > -Wno-error=3Dshift-overflow \ > - -Wno-error=3Dtautological-compare > -.endif > + -Wno-error=3Dtautological-compare \ > + -Wno-unused-but-set-variable > .if ${COMPILER_VERSION} >=3D 70100 > CWARNEXTRA+=3D -Wno-error=3Dstringop-overflow > .endif > @@ -76,15 +69,7 @@ CWARNEXTRA+=3D -Wno-error=3Dpacked-not-aligned > .if ${COMPILER_VERSION} >=3D 90100 > CWARNEXTRA+=3D -Wno-address-of-packed-member > .endif > -.else > -# For gcc 4.2, eliminate the too-often-wrong warnings about=20 > uninitialized vars. > -CWARNEXTRA?=3D -Wno-uninitialized > -# GCC 4.2 doesn't have -Wno-error=3Dcast-qual, so just disable th= e=20 > warning for > -# the few files that are already known to generate cast-qual=20 > warnings. > -NO_WCAST_QUAL=3D -Wno-cast-qual > -NO_WNONNULL=3D -Wno-nonnull > -.endif > -.endif > +.endif # gcc >=20 > # This warning is utter nonsense > CWARNFLAGS+=3D -Wno-format-zero-length > @@ -93,7 +78,7 @@ CWARNFLAGS+=3D -Wno-format-zero-length > # to be disabled. WARNING: format checking is disabled in this c= ase. > .if ${MK_FORMAT_EXTENSIONS} =3D=3D "no" > FORMAT_EXTENSIONS=3D -Wno-format > -.elif ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D= 30600 > +.elif ${COMPILER_TYPE} =3D=3D "clang" > FORMAT_EXTENSIONS=3D -D__printf__=3D__freebsd_kprintf__ > .else > FORMAT_EXTENSIONS=3D -fformat-extensions > @@ -201,12 +186,7 @@ CFLAGS.gcc+=3D -mno-spe > # DDB happy. ELFv2, if available, has some other efficiency benef= its. > # > .if ${MACHINE_ARCH} =3D=3D "powerpc64" > -.if ${COMPILER_VERSION} >=3D 40900 > -CFLAGS.gcc+=3D -mabi=3Delfv2 > -.else > -CFLAGS.gcc+=3D -mcall-aixdesc > -.endif > -CFLAGS.clang+=3D -mabi=3Delfv2 > +CFLAGS+=3D -mabi=3Delfv2 > .endif >=20 > # >=20 > Modified: head/sys/conf/kern.post.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.post.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.post.mk Tue May 12 15:22:40 2020 (r360964) > @@ -345,10 +345,7 @@ ${__obj}: ${OBJS_DEPEND_GUESS.${__obj}} >=20 > .depend: .PRECIOUS ${SRCS} >=20 > -.if ${COMPILER_TYPE} =3D=3D "clang" || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60= 000) > _MAP_DEBUG_PREFIX=3D yes > -.endif >=20 > _ILINKS=3D machine > .if ${MACHINE} !=3D ${MACHINE_CPUARCH} && ${MACHINE} !=3D "arm64"= >=20 > Modified: head/sys/conf/kern.pre.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kern.pre.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kern.pre.mk Tue May 12 15:22:40 2020 (r360964) > @@ -93,11 +93,7 @@ CFLAGS.gcc+=3D -fms-extensions > .if defined(CFLAGS_ARCH_PARAMS) > CFLAGS.gcc+=3D${CFLAGS_ARCH_PARAMS} > .endif > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WERROR?=3D -Wno-error > -.else > WERROR?=3D -Werror > -.endif > # The following should be removed no earlier than LLVM11 being=20= > imported into the > # tree, to ensure we don't regress the build. LLVM11 and GCC10=20= > will switch the > # default over to -fno-common, making this redundant. >=20 > Modified: head/sys/conf/kmod.mk > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/conf/kmod.mk Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/conf/kmod.mk Tue May 12 15:22:40 2020 (r360964) > @@ -88,11 +88,7 @@ __KLD_SHARED=3Dno > .if !empty(CFLAGS:M-O[23s]) && empty(CFLAGS:M-fno-strict-aliasing= ) > CFLAGS+=3D -fno-strict-aliasing > .endif > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WERROR?=3D -Wno-error > -.else > WERROR?=3D -Werror > -.endif >=20 > LINUXKPI_GENSRCS+=3D \ > bus_if.h \ > @@ -160,11 +156,7 @@ CFLAGS+=3D -fPIC > # Temporary workaround for PR 196407, which contains the=20 > fascinating details. > # Don't allow clang to use fpu instructions or registers in kerne= l=20 > modules. > .if ${MACHINE_CPUARCH} =3D=3D arm > -.if ${COMPILER_VERSION} < 30800 > -CFLAGS.clang+=3D -mllvm -arm-use-movt=3D0 > -.else > CFLAGS.clang+=3D -mno-movt > -.endif > CFLAGS.clang+=3D -mfpu=3Dnone > CFLAGS+=3D -funwind-tables > .endif > @@ -283,10 +275,7 @@ ${FULLPROG}: ${OBJS} > ${OBJCOPY} --strip-debug ${.TARGET} > .endif >=20 > -.if ${COMPILER_TYPE} =3D=3D "clang" || \ > - (${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 60= 000) > _MAP_DEBUG_PREFIX=3D yes > -.endif >=20 > _ILINKS=3Dmachine > .if ${MACHINE_CPUARCH} =3D=3D "i386" || ${MACHINE_CPUARCH} =3D=3D= "amd64" >=20 > Modified: head/sys/modules/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/sys/modules/Makefile Tue May 12 14:47:38 2020 (r360963) > +++ head/sys/modules/Makefile Tue May 12 15:22:40 2020 (r360964) > @@ -620,9 +620,7 @@ _aac=3D aac > _aacraid=3D aacraid > _acpi=3D acpi > .if ${MK_CRYPT} !=3D "no" || defined(ALL_MODULES) > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} > 40201 > _aesni=3D aesni > -.endif > .endif > _amd_ecc_inject=3Damd_ecc_inject > _amdsbwd=3D amdsbwd >=20 > Modified: head/usr.sbin/acpi/acpidb/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/acpi/acpidb/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/usr.sbin/acpi/acpidb/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -87,6 +87,6 @@ LIBADD=3D pthread > # integer to pointer, which is a GNU extension. > # > # Turn off the warning, because this is in contributed code. > -.if ${COMPILER_TYPE} =3D=3D "clang" && ${COMPILER_VERSION} >=3D 6= 0000 > +.if ${COMPILER_TYPE} =3D=3D "clang" > CWARNFLAGS+=3D -Wno-null-pointer-arithmetic > .endif >=20 > Modified: head/usr.sbin/trpt/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/trpt/Makefile Tue May 12 14:47:38 2020 (r360963)= > +++ head/usr.sbin/trpt/Makefile Tue May 12 15:22:40 2020 (r360964)= > @@ -8,18 +8,12 @@ MAN=3D trpt.8 > BINGRP=3D kmem > BINMODE=3D 2555 >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} < 50000 > -WARNS?=3D 4 > -.endif > - > .if ${MK_INET6_SUPPORT} !=3D "no" > CFLAGS+=3D -DINET6 > .endif >=20 > .include >=20 > -.if ${COMPILER_TYPE} !=3D "gcc" || ${COMPILER_VERSION} >=3D 50000= > # Several included system headers tickle this warning in ways tha= t are > # difficult to work around in this program. > CFLAGS+=3D -Wno-missing-variable-declarations > -.endif >=20 > Modified: head/usr.sbin/zic/zic/Makefile > =20 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D > --- head/usr.sbin/zic/zic/Makefile Tue May 12 14:47:38=20 > 2020 (r360963) > +++ head/usr.sbin/zic/zic/Makefile Tue May 12 15:22:40=20 > 2020 (r360964) > @@ -15,7 +15,7 @@ CFLAGS+=3D -I${.CURDIR:H}=20 > -I${SRCTOP}/contrib/tzcode/std >=20 > WARNS?=3D 2 >=20 > -.if ${COMPILER_TYPE} =3D=3D "gcc" && ${COMPILER_VERSION} >=3D 503= 00 > +.if ${COMPILER_TYPE} =3D=3D "gcc" > CWARNFLAGS+=3D -Wno-error=3Dstrict-overflow > .endif >=20 >=20 >=20 > --=20 Brandon Bergren Technical Generalist From owner-svn-src-all@freebsd.org Wed May 13 06:24:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7B952EAD7E; Wed, 13 May 2020 06:24:54 +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 49MPm65NLtz4ZZ5; Wed, 13 May 2020 06:24:54 +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 AF73A1D1B5; Wed, 13 May 2020 06:24:54 +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 04D6OsMo069192; Wed, 13 May 2020 06:24:54 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6OsLF069191; Wed, 13 May 2020 06:24:54 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130624.04D6OsLF069191@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 06:24:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361001 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361001 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:24:54 -0000 Author: avg Date: Wed May 13 06:24:54 2020 New Revision: 361001 URL: https://svnweb.freebsd.org/changeset/base/361001 Log: sound/hda: newer AMD devices still require the same PCIe snoop So, replicate the ATI vendor snoop configuration for the AMD vendor. I think that this should fix a number of cases where users currently have to resort to polling or disabling MSI. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 13 02:17:27 2020 (r361000) +++ head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:24:54 2020 (r361001) @@ -197,6 +197,7 @@ static const struct { } hdac_pcie_snoop[] = { { INTEL_VENDORID, 0x00, 0x00, 0x00 }, { ATI_VENDORID, 0x42, 0xf8, 0x02 }, + { AMD_VENDORID, 0x42, 0xf8, 0x02 }, { NVIDIA_VENDORID, 0x4e, 0xf0, 0x0f }, }; From owner-svn-src-all@freebsd.org Wed May 13 06:26:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 659E32EAE0E; Wed, 13 May 2020 06:26:31 +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 49MPnz24Svz4Zhw; Wed, 13 May 2020 06:26:31 +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 423EB1D1B6; Wed, 13 May 2020 06:26:31 +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 04D6QVTS069316; Wed, 13 May 2020 06:26:31 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D6QVWh069315; Wed, 13 May 2020 06:26:31 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130626.04D6QVWh069315@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 06:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361002 - head/sys/dev/sound/pci/hda X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/dev/sound/pci/hda X-SVN-Commit-Revision: 361002 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 06:26:31 -0000 Author: avg Date: Wed May 13 06:26:30 2020 New Revision: 361002 URL: https://svnweb.freebsd.org/changeset/base/361002 Log: snd_hda: fix typos related to quirks set via 'config' tunable One wrong quirk bit, one wrong variable name. MFC after: 1 week Modified: head/sys/dev/sound/pci/hda/hdac.c Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:24:54 2020 (r361001) +++ head/sys/dev/sound/pci/hda/hdac.c Wed May 13 06:26:30 2020 (r361002) @@ -65,7 +65,7 @@ static const struct { const char *key; uint32_t value; } hdac_quirks_tab[] = { - { "64bit", HDAC_QUIRK_DMAPOS }, + { "64bit", HDAC_QUIRK_64BIT }, { "dmapos", HDAC_QUIRK_DMAPOS }, { "msi", HDAC_QUIRK_MSI }, }; @@ -279,10 +279,10 @@ hdac_config_fetch(struct hdac_softc *sc, uint32_t *on, ); if (inv == 0) { *on |= hdac_quirks_tab[k].value; - *on &= ~hdac_quirks_tab[k].value; + *off &= ~hdac_quirks_tab[k].value; } else if (inv != 0) { *off |= hdac_quirks_tab[k].value; - *off &= ~hdac_quirks_tab[k].value; + *on &= ~hdac_quirks_tab[k].value; } break; } From owner-svn-src-all@freebsd.org Wed May 13 07:47:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 57FD72EDB69; Wed, 13 May 2020 07:47:57 +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 49MRbx1hSPz3D8b; Wed, 13 May 2020 07:47:57 +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 30CDA1E175; Wed, 13 May 2020 07:47:57 +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 04D7lvKL018761; Wed, 13 May 2020 07:47:57 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D7lv67018760; Wed, 13 May 2020 07:47:57 GMT (envelope-from avg@FreeBSD.org) Message-Id: <202005130747.04D7lv67018760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Wed, 13 May 2020 07:47:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361006 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: avg X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361006 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 07:47:57 -0000 Author: avg Date: Wed May 13 07:47:56 2020 New Revision: 361006 URL: https://svnweb.freebsd.org/changeset/base/361006 Log: linuxkpi: print stack trace in WARN_ON macros Reviewed by: hselasky, kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24779 Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h Modified: head/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 13 06:47:54 2020 (r361005) +++ head/sys/compat/linuxkpi/common/include/linux/kernel.h Wed May 13 07:47:56 2020 (r361006) @@ -107,6 +107,7 @@ if (__ret) { \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) @@ -120,6 +121,7 @@ __warn_on_once = 1; \ printf("WARNING %s failed at %s:%d\n", \ __stringify(cond), __FILE__, __LINE__); \ + linux_dump_stack(); \ } \ unlikely(__ret); \ }) From owner-svn-src-all@freebsd.org Wed May 13 07:49:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 174542EDBE7; Wed, 13 May 2020 07:49:13 +0000 (UTC) (envelope-from manu@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 49MRdN6sS0z3DJj; Wed, 13 May 2020 07:49:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E68361E176; Wed, 13 May 2020 07:49:12 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04D7nCbD018865; Wed, 13 May 2020 07:49:12 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04D7nCss018864; Wed, 13 May 2020 07:49:12 GMT (envelope-from manu@FreeBSD.org) Message-Id: <202005130749.04D7nCss018864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 13 May 2020 07:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361007 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361007 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 07:49:13 -0000 Author: manu Date: Wed May 13 07:49:12 2020 New Revision: 361007 URL: https://svnweb.freebsd.org/changeset/base/361007 Log: linuxkpi: Add EBADRQC to errno.h This is used in the amdgpu driver from Linux 5.2 Sponsored-by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24807 Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h Modified: head/sys/compat/linuxkpi/common/include/linux/errno.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/errno.h Wed May 13 07:47:56 2020 (r361006) +++ head/sys/compat/linuxkpi/common/include/linux/errno.h Wed May 13 07:49:12 2020 (r361007) @@ -33,6 +33,8 @@ #include +#define EBADRQC 56 /* Bad request code */ + #define ECHRNG EDOM #define ETIME ETIMEDOUT #define ECOMM ESTALE From owner-svn-src-all@freebsd.org Wed May 13 12:33:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B4672F5D76; Wed, 13 May 2020 12:33:52 +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 49MYxr1msMz41XQ; Wed, 13 May 2020 12:33:52 +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 3845921837; Wed, 13 May 2020 12:33:52 +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 04DCXq2d097093; Wed, 13 May 2020 12:33:52 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DCXqJg097092; Wed, 13 May 2020 12:33:52 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005131233.04DCXqJg097092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Wed, 13 May 2020 12:33: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: r361008 - stable/12/sys/arm/arm X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sys/arm/arm X-SVN-Commit-Revision: 361008 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 12:33:52 -0000 Author: markj Date: Wed May 13 12:33:51 2020 New Revision: 361008 URL: https://svnweb.freebsd.org/changeset/base/361008 Log: MFC r360691: arm: Don't enable interrupts in init_secondary(). Modified: stable/12/sys/arm/arm/mp_machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/arm/arm/mp_machdep.c ============================================================================== --- stable/12/sys/arm/arm/mp_machdep.c Wed May 13 07:49:12 2020 (r361007) +++ stable/12/sys/arm/arm/mp_machdep.c Wed May 13 12:33:51 2020 (r361008) @@ -138,7 +138,6 @@ cpu_mp_announce(void) } -extern vm_paddr_t pmap_pa; void init_secondary(int cpu) { @@ -202,8 +201,6 @@ init_secondary(int cpu) } mtx_unlock_spin(&ap_boot_mtx); - - enable_interrupts(PSR_I); loop_counter = 0; while (smp_started == 0) { From owner-svn-src-all@freebsd.org Wed May 13 14:36:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6BD882F7D1E; Wed, 13 May 2020 14:36:45 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from smtp.vangyzen.net (hotblack.vangyzen.net [199.48.133.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mcgc1spqz47FM; Wed, 13 May 2020 14:36:43 +0000 (UTC) (envelope-from eric@vangyzen.net) Received: from [IPv6:2600:380:6868:efb0:fcf9:9563:f260:7e53] (unknown [IPv6:2600:380:6868:efb0:fcf9:9563:f260:7e53]) by smtp.vangyzen.net (Postfix) with ESMTPSA id 2B50B564A6; Wed, 13 May 2020 09:36:37 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Eric van Gyzen Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r360964 - in head: lib/libclang_rt lib/libthr lib/msun libexec/rtld-elf libexec/tftpd/tests share/mk stand stand/arm/uboot stand/efi stand/efi/boot1 stand/efi/loader stand/i386/boot2 st... Date: Wed, 13 May 2020 09:36:34 -0500 Message-Id: <07A37747-B865-4487-8D20-ED1B03ECCDF9@vangyzen.net> References: Cc: Ravi Pokala , Eric van Gyzen , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: To: Brandon Bergren X-Mailer: iPhone Mail (17E262) X-Rspamd-Queue-Id: 49Mcgc1spqz47FM X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of eric@vangyzen.net designates 199.48.133.146 as permitted sender) smtp.mailfrom=eric@vangyzen.net X-Spamd-Result: default: False [-4.87 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[vangyzen.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCPT_COUNT_FIVE(0.00)[6]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_SCORE(-3.07)[ip: (-7.91), ipnet: 199.48.132.0/22(-3.60), asn: 36236(-3.79), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:36236, ipnet:199.48.132.0/22, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 14:36:45 -0000 > =EF=BB=BFWhy is this marked for MFC? FreeBSD 12 uses base GCC 4.2.1 on som= e platforms. You=E2=80=99re right, this won=E2=80=99t be MFC=E2=80=99d. My client is con= figured to add the MFC by default, and I failed to remove it. Eric= From owner-svn-src-all@freebsd.org Wed May 13 16:36:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0EBA32FA783; Wed, 13 May 2020 16:36:43 +0000 (UTC) (envelope-from adrian@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 49MgL26cHxz4G09; Wed, 13 May 2020 16:36:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D979E244E3; Wed, 13 May 2020 16:36:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DGag1T043344; Wed, 13 May 2020 16:36:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DGag7V043343; Wed, 13 May 2020 16:36:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005131636.04DGag7V043343@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 13 May 2020 16:36:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361009 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361009 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 16:36:43 -0000 Author: adrian Date: Wed May 13 16:36:42 2020 New Revision: 361009 URL: https://svnweb.freebsd.org/changeset/base/361009 Log: [ath] Prepare for .. more sample rate control entries This is in preparation for me bumping how many size buckets are used for ath_rate_sample statistics. * Bump buffer size to 64k * Don't waste 4 lines per bucket size, condense it to two * Alternate colours; my logic made everything after the first two just be black. Oops. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Wed May 13 12:33:51 2020 (r361008) +++ head/tools/tools/ath/athratestats/main.c Wed May 13 16:36:42 2020 (r361009) @@ -64,7 +64,7 @@ static int do_loop = 0; * This needs to be big enough to fit the two TLVs, the rate table * and the rate statistics table for a single node. */ -#define STATS_BUF_SIZE 8192 +#define STATS_BUF_SIZE 65536 #define PRINTMSG(...) do { \ if (do_loop == 0) \ @@ -122,24 +122,23 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r (long long) sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(4 + (y % 2)) | A_BOLD); PRINTMSG("[%4u] cur rate %d %s since switch: " - "packets %d ticks %u\n", + "packets %d ticks %u ", bin_to_size(y), dot11rate(rt, sn->current_rix[y]), dot11str(rt, sn->current_rix[y]), sn->packets_since_switch[y], sn->ticks_since_switch[y]); - PRINTMSG("[%4u] last sample (%d %s) cur sample (%d %s) " + PRINTMSG("last sample (%d %s) cur sample (%d %s) " "packets sent %d\n", - bin_to_size(y), dot11rate(rt, sn->last_sample_rix[y]), dot11str(rt, sn->last_sample_rix[y]), dot11rate(rt, sn->current_sample_rix[y]), dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); - PRINTATTR_OFF(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(4 + (y % 2)) | A_BOLD); PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); PRINTMSG("[%4u] packets since sample %d sample tt %u\n", @@ -147,7 +146,6 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->packets_since_sample[y], sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); - PRINTMSG("\n"); } PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); From owner-svn-src-all@freebsd.org Wed May 13 17:20:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F022A2FB400; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@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 49MhJz67j3z4J4F; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 CDF2424C80; Wed, 13 May 2020 17:20:51 +0000 (UTC) (envelope-from jrtc27@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DHKpSb067876; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Received: (from jrtc27@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DHKpZ0067875; Wed, 13 May 2020 17:20:51 GMT (envelope-from jrtc27@FreeBSD.org) Message-Id: <202005131720.04DHKpZ0067875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jrtc27 set sender to jrtc27@FreeBSD.org using -f From: Jessica Clarke Date: Wed, 13 May 2020 17:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361010 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: jrtc27 X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 361010 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 17:20:52 -0000 Author: jrtc27 Date: Wed May 13 17:20:51 2020 New Revision: 361010 URL: https://svnweb.freebsd.org/changeset/base/361010 Log: riscv: Fix pmap_protect for superpages When protecting a superpage, we would previously fall through to the non-superpage case and read the contents of the superpage as PTEs, potentially modifying them and trying to look up underlying VM pages that don't exist if they happen to look like PTEs we would care about. This led to nginx causing an unexpected page fault in pmap_protect that panic'ed the kernel. Instead, if we see a superpage, we are done for this range and should continue to the next. Reviewed by: markj, jhb (mentor) Approved by: markj, jhb (mentor) Differential Revision: https://reviews.freebsd.org/D24827 Modified: head/sys/riscv/riscv/pmap.c Modified: head/sys/riscv/riscv/pmap.c ============================================================================== --- head/sys/riscv/riscv/pmap.c Wed May 13 16:36:42 2020 (r361009) +++ head/sys/riscv/riscv/pmap.c Wed May 13 17:20:51 2020 (r361010) @@ -2329,6 +2329,7 @@ retryl2: if (!atomic_fcmpset_long(l2, &l2e, l2e & ~mask)) goto retryl2; anychanged = true; + continue; } else { if (!pv_lists_locked) { pv_lists_locked = true; From owner-svn-src-all@freebsd.org Wed May 13 18:07:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 593AC2FBFCE; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MjLz1XPSz4MCk; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B65F255F0; Wed, 13 May 2020 18:07:39 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DI7dJD000444; Wed, 13 May 2020 18:07:39 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DI7bHG000437; Wed, 13 May 2020 18:07:37 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005131807.04DI7bHG000437@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 13 May 2020 18:07:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361011 - in head/sys: ddb dev/amdtemp dev/nvdimm dev/ow net sys vm X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/sys: ddb dev/amdtemp dev/nvdimm dev/ow net sys vm X-SVN-Commit-Revision: 361011 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:07:39 -0000 Author: kevans Date: Wed May 13 18:07:37 2020 New Revision: 361011 URL: https://svnweb.freebsd.org/changeset/base/361011 Log: kernel: provide panicky version of __unreachable __builtin_unreachable doesn't raise any compile-time warnings/errors on its own, so problems with its usage can't be easily detected. While it would be nice for this situation to change and compilers to at least add a warning for trivial cases where local state means the instruction can't be reached, this isn't the case at the moment and likely will not happen. This commit adds an __assert_unreachable, whose intent is incredibly clear: it asserts that this instruction is unreachable. On INVARIANTS builds, it's a panic(), and on non-INVARIANTS it expands to __unreachable(). Existing users of __unreachable() are converted to __assert_unreachable, to improve debuggability if this assumption is violated. Reviewed by: mjg Differential Revision: https://reviews.freebsd.org/D23793 Modified: head/sys/ddb/db_expr.c head/sys/dev/amdtemp/amdtemp.c head/sys/dev/nvdimm/nvdimm.c head/sys/dev/ow/ow.c head/sys/net/mppcc.c head/sys/sys/systm.h head/sys/vm/vm_radix.c Modified: head/sys/ddb/db_expr.c ============================================================================== --- head/sys/ddb/db_expr.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/ddb/db_expr.c Wed May 13 18:07:37 2020 (r361011) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -229,7 +230,7 @@ db_add_expr(db_expr_t *valuep) lhs |= rhs; break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } @@ -313,7 +314,7 @@ db_logical_relation_expr( lhs = (lhs <= rhs); break; default: - __unreachable(); + __assert_unreachable(); } t = db_read_token(); } Modified: head/sys/dev/amdtemp/amdtemp.c ============================================================================== --- head/sys/dev/amdtemp/amdtemp.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/amdtemp/amdtemp.c Wed May 13 18:07:37 2020 (r361011) @@ -666,7 +666,7 @@ amdtemp_gettemp0f(device_t dev, amdsensor_t sensor) temp |= AMDTEMP_TTSR_SELCORE; break; default: - __unreachable(); + __assert_unreachable(); } pci_write_config(dev, AMDTEMP_THERMTP_STAT, temp, 1); @@ -766,7 +766,7 @@ amdtemp_gettemp17h(device_t dev, amdsensor_t sensor) ("sensor %d: not valid", (int)sensor)); return (amdtemp_decode_fam10h_to_17h(sc->sc_offset, val, true)); default: - __unreachable(); + __assert_unreachable(); } } Modified: head/sys/dev/nvdimm/nvdimm.c ============================================================================== --- head/sys/dev/nvdimm/nvdimm.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/nvdimm/nvdimm.c Wed May 13 18:07:37 2020 (r361011) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ddb.h" #include +#include #include #include #include @@ -236,7 +237,7 @@ read_label(struct nvdimm_dev *nv, int num) return (0); } } - __unreachable(); + __assert_unreachable(); } static int Modified: head/sys/dev/ow/ow.c ============================================================================== --- head/sys/dev/ow/ow.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/dev/ow/ow.c Wed May 13 18:07:37 2020 (r361011) @@ -507,7 +507,7 @@ again: return (EIO); goto again; default: /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); } if (dir) { OWLL_WRITE_ONE(lldev, &timing_regular); Modified: head/sys/net/mppcc.c ============================================================================== --- head/sys/net/mppcc.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/net/mppcc.c Wed May 13 18:07:37 2020 (r361011) @@ -232,7 +232,7 @@ int MPPC_Compress(u_char **src, u_char **dst, u_long * } else if (off < 8192) { /* 16-bit offset; 320 <= offset < 8192 */ putbits16(*dst, 0xc000|(off-320), 16, &olen, &l); } else { /* NOTREACHED */ - __unreachable(); + __assert_unreachable(); rtn &= ~MPPC_OK; return (rtn); } Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed May 13 17:20:51 2020 (r361010) +++ head/sys/sys/systm.h Wed May 13 18:07:37 2020 (r361011) @@ -117,6 +117,9 @@ void kassert_panic(const char *fmt, ...) __printflike VNASSERT(exp, vp, ("condition %s not met at %s:%d (%s)", \ _exp, __FILE__, __LINE__, __func__)); \ } while (0) +#define __assert_unreachable() \ + panic("executing segment marked as unreachable at %s:%d (%s)\n", \ + __FILE__, __LINE__, __func__) #else #define KASSERT(exp,msg) do { \ } while (0) @@ -125,6 +128,7 @@ void kassert_panic(const char *fmt, ...) __printflike } while (0) #define VNPASS(exp, vp) do { \ } while (0) +#define __assert_unreachable() __unreachable() #endif #ifndef CTASSERT /* Allow lint to override */ Modified: head/sys/vm/vm_radix.c ============================================================================== --- head/sys/vm/vm_radix.c Wed May 13 17:20:51 2020 (r361010) +++ head/sys/vm/vm_radix.c Wed May 13 18:07:37 2020 (r361011) @@ -209,7 +209,7 @@ vm_radix_node_load(smrnode_t *p, enum vm_radix_access case SMR: return (smr_entered_load(p, vm_radix_smr)); } - __unreachable(); + __assert_unreachable(); } static __inline void From owner-svn-src-all@freebsd.org Wed May 13 18:09:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0B6902FC07F; Wed, 13 May 2020 18:09:05 +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 49MjNc6cdbz4MN2; Wed, 13 May 2020 18:09:04 +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 DE4BB255FD; Wed, 13 May 2020 18:09:04 +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 04DI94QR000583; Wed, 13 May 2020 18:09:04 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DI94V4000579; Wed, 13 May 2020 18:09:04 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005131809.04DI94V4000579@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Wed, 13 May 2020 18:09: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: r361012 - in stable/11/sys: conf modules/drm2/i915kms modules/ipfilter X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11/sys: conf modules/drm2/i915kms modules/ipfilter X-SVN-Commit-Revision: 361012 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:09:05 -0000 Author: dim Date: Wed May 13 18:09:03 2020 New Revision: 361012 URL: https://svnweb.freebsd.org/changeset/base/361012 Log: MFC r305392: For kernel builds, instead of suppressing certain clang warnings, make them non-fatal, so there is some incentive to fix them eventually. MFC r333819 (by mmacy): Silence non-actionable warnings in vendor code We can't modify vendor code so there's no signal in warnings from it. Similarly -Waddress-of-packed-member is not useful on networking code as access to packed structures is fundamental to its operation. Modified: stable/11/sys/conf/files stable/11/sys/conf/kern.mk stable/11/sys/modules/drm2/i915kms/Makefile stable/11/sys/modules/ipfilter/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/conf/files Wed May 13 18:09:03 2020 (r361012) @@ -564,7 +564,7 @@ contrib/ipfilter/netinet/ip_lookup.c optional ipfilter contrib/ipfilter/netinet/ip_pool.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/ip_htable.c optional ipfilter inet \ - compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" + compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter ${NO_WTAUTOLOGICAL_POINTER_COMPARE}" contrib/ipfilter/netinet/ip_sync.c optional ipfilter inet \ compile-with "${NORMAL_C} -Wno-unused -I$S/contrib/ipfilter" contrib/ipfilter/netinet/mlfk_ipl.c optional ipfilter inet \ Modified: stable/11/sys/conf/kern.mk ============================================================================== --- stable/11/sys/conf/kern.mk Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/conf/kern.mk Wed May 13 18:09:03 2020 (r361012) @@ -17,13 +17,14 @@ CWARNFLAGS?= -Wall -Wredundant-decls -Wnested-externs # kernel where fixing them is more trouble than it is worth, or where there is # a false positive. .if ${COMPILER_TYPE} == "clang" -NO_WCONSTANT_CONVERSION= -Wno-constant-conversion +NO_WCONSTANT_CONVERSION= -Wno-error-constant-conversion NO_WSHIFT_COUNT_NEGATIVE= -Wno-shift-count-negative NO_WSHIFT_COUNT_OVERFLOW= -Wno-shift-count-overflow NO_WSELF_ASSIGN= -Wno-self-assign -NO_WUNNEEDED_INTERNAL_DECL= -Wno-unneeded-internal-declaration +NO_WUNNEEDED_INTERNAL_DECL= -Wno-error-unneeded-internal-declaration NO_WSOMETIMES_UNINITIALIZED= -Wno-error-sometimes-uninitialized -NO_WCAST_QUAL= -Wno-cast-qual +NO_WCAST_QUAL= -Wno-error-cast-qual +NO_WTAUTOLOGICAL_POINTER_COMPARE= -Wno-tautological-pointer-compare # Several other warnings which might be useful in some cases, but not severe # enough to error out the whole kernel build. Display them anyway, so there is # some incentive to fix them eventually. @@ -34,7 +35,7 @@ CWARNEXTRA?= -Wno-error-tautological-compare -Wno-erro CWARNEXTRA+= -Wno-error-shift-negative-value .endif .if ${COMPILER_VERSION} >= 40000 -CWARNEXTRA+= -Wno-error-address-of-packed-member +CWARNEXTRA+= -Wno-address-of-packed-member .endif .if ${COMPILER_VERSION} >= 100000 NO_WMISLEADING_INDENTATION= -Wno-misleading-indentation Modified: stable/11/sys/modules/drm2/i915kms/Makefile ============================================================================== --- stable/11/sys/modules/drm2/i915kms/Makefile Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/modules/drm2/i915kms/Makefile Wed May 13 18:09:03 2020 (r361012) @@ -64,3 +64,8 @@ SRCS += \ CWARNFLAGS.i915_debug.c= -Wno-unused-function CWARNFLAGS.intel_lvds.c= -Wno-unused CWARNFLAGS.intel_tv.c= -Wno-unused +CWARNFLAGS.i915_gem.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_tiling.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.i915_gem_execbuffer.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_display.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} +CWARNFLAGS.intel_overlay.c= ${NO_WTAUTOLOGICAL_POINTER_COMPARE} Modified: stable/11/sys/modules/ipfilter/Makefile ============================================================================== --- stable/11/sys/modules/ipfilter/Makefile Wed May 13 18:07:37 2020 (r361011) +++ stable/11/sys/modules/ipfilter/Makefile Wed May 13 18:09:03 2020 (r361012) @@ -21,7 +21,7 @@ CWARNFLAGS.fil.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_auth.c= -Wno-unused CWARNFLAGS.ip_fil_freebsd.c= -Wno-unused CWARNFLAGS.ip_frag.c= -Wno-unused -CWARNFLAGS.ip_htable.c= -Wno-unused +CWARNFLAGS.ip_htable.c= -Wno-unused ${NO_WTAUTOLOGICAL_POINTER_COMPARE} CWARNFLAGS.ip_dstlist.c= -Wno-unused CWARNFLAGS.ip_lookup.c= ${NO_WSELF_ASSIGN} -Wno-unused CWARNFLAGS.ip_nat.c= -Wno-unused From owner-svn-src-all@freebsd.org Wed May 13 18:35:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7F1B82FCBFE; Wed, 13 May 2020 18:35:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mjyb2qLGz4P9N; Wed, 13 May 2020 18:35:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C29125BA4; Wed, 13 May 2020 18:35:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DIZ3iS018937; Wed, 13 May 2020 18:35:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DIZ3ST018936; Wed, 13 May 2020 18:35:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005131835.04DIZ3ST018936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 18:35:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361013 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 361013 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:35:03 -0000 Author: jhb Date: Wed May 13 18:35:02 2020 New Revision: 361013 URL: https://svnweb.freebsd.org/changeset/base/361013 Log: Remove unused header for DES. The NFS port doesn't use any of the DES functions. Modified: head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Wed May 13 18:09:03 2020 (r361012) +++ head/sys/fs/nfs/nfsport.h Wed May 13 18:35:02 2020 (r361013) @@ -98,7 +98,6 @@ #include #include #include -#include #include #include #include From owner-svn-src-all@freebsd.org Wed May 13 18:36:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F6342FCC69; Wed, 13 May 2020 18:36:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mjzk3lCHz4PHm; Wed, 13 May 2020 18:36:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BC2025BA7; Wed, 13 May 2020 18:36:02 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DIa2jX019023; Wed, 13 May 2020 18:36:02 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DIa2YL019022; Wed, 13 May 2020 18:36:02 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005131836.04DIa2YL019022@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 18:36:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361014 - head/sys/opencrypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/sys/opencrypto X-SVN-Commit-Revision: 361014 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 18:36:02 -0000 Author: jhb Date: Wed May 13 18:36:02 2020 New Revision: 361014 URL: https://svnweb.freebsd.org/changeset/base/361014 Log: Trim a few more things I missed from xform_enc.h. An extern declaration for the now-removed Blowfish encryption transform, and an include of the DES header. Modified: head/sys/opencrypto/xform_enc.h Modified: head/sys/opencrypto/xform_enc.h ============================================================================== --- head/sys/opencrypto/xform_enc.h Wed May 13 18:35:02 2020 (r361013) +++ head/sys/opencrypto/xform_enc.h Wed May 13 18:36:02 2020 (r361014) @@ -33,7 +33,6 @@ #include #include -#include #include #include #include @@ -68,7 +67,6 @@ struct enc_xform { extern struct enc_xform enc_xform_null; -extern struct enc_xform enc_xform_blf; extern struct enc_xform enc_xform_rijndael128; extern struct enc_xform enc_xform_aes_icm; extern struct enc_xform enc_xform_aes_nist_gcm; From owner-svn-src-all@freebsd.org Wed May 13 19:17:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4F3832FD50A; Wed, 13 May 2020 19:17:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mkvb1lxSz4R48; Wed, 13 May 2020 19:17:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 32EA726374; Wed, 13 May 2020 19:17:31 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DJHVbf043639; Wed, 13 May 2020 19:17:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJHTok043628; Wed, 13 May 2020 19:17:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005131917.04DJHTok043628@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 19:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361015 - in head/sys/geom: . eli mountver nop part uzip X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/sys/geom: . eli mountver nop part uzip X-SVN-Commit-Revision: 361015 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:17:31 -0000 Author: imp Date: Wed May 13 19:17:28 2020 New Revision: 361015 URL: https://svnweb.freebsd.org/changeset/base/361015 Log: Reimplement aliases in geom The alias needs to be part of the provider instead of the geom to work properly. To bind the DEV geom, we need to look at the provider's names and aliases and create the dev entries from there. If this lives in the GEOM, then it won't propigate down the tree properly. Remove it from geom, add it provider. Update geli, gmountver, gnop, gpart, and guzip to use it, which handles the bulk of the uses in FreeBSD. I think this is all the providers that create a new name based on their parent's name. Modified: head/sys/geom/eli/g_eli.c head/sys/geom/geom.h head/sys/geom/geom_dev.c head/sys/geom/geom_disk.c head/sys/geom/geom_dump.c head/sys/geom/geom_subr.c head/sys/geom/mountver/g_mountver.c head/sys/geom/nop/g_nop.c head/sys/geom/part/g_part.c head/sys/geom/uzip/g_uzip.c Modified: head/sys/geom/eli/g_eli.c ============================================================================== --- head/sys/geom/eli/g_eli.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/eli/g_eli.c Wed May 13 19:17:28 2020 (r361015) @@ -843,6 +843,7 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, struct g_geom *gp; struct g_provider *pp; struct g_consumer *cp; + struct g_geom_alias *gap; u_int i, threads; int dcw, error; @@ -971,6 +972,8 @@ g_eli_create(struct gctl_req *req, struct g_class *mp, pp = g_new_providerf(gp, "%s%s", bpp->name, G_ELI_SUFFIX); pp->mediasize = sc->sc_mediasize; pp->sectorsize = sc->sc_sectorsize; + LIST_FOREACH(gap, &bpp->aliases, ga_next) + g_provider_add_alias(pp, "%s%s", gap->ga_alias, G_ELI_SUFFIX); g_error_provider(pp, 0); Modified: head/sys/geom/geom.h ============================================================================== --- head/sys/geom/geom.h Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom.h Wed May 13 19:17:28 2020 (r361015) @@ -122,15 +122,6 @@ struct g_class { LIST_HEAD(,g_geom) geom; }; -/* - * The g_geom_alias is a list node for aliases for the geom name - * for device node creation. - */ -struct g_geom_alias { - LIST_ENTRY(g_geom_alias) ga_next; - const char *ga_alias; -}; - #define G_VERSION_00 0x19950323 #define G_VERSION_01 0x20041207 /* add fflag to g_ioctl_t */ #define G_VERSION G_VERSION_01 @@ -163,7 +154,6 @@ struct g_geom { #define G_GEOM_VOLATILE_BIO 0x02 #define G_GEOM_IN_ACCESS 0x04 #define G_GEOM_ACCESS_WAIT 0x08 - LIST_HEAD(,g_geom_alias) aliases; }; /* @@ -203,6 +193,15 @@ struct g_consumer { }; /* + * The g_geom_alias is a list node for aliases for the provider name for device + * node creation. + */ +struct g_geom_alias { + LIST_ENTRY(g_geom_alias) ga_next; + const char *ga_alias; +}; + +/* * A g_provider is a "logical disk". */ struct g_provider { @@ -226,6 +225,7 @@ struct g_provider { #define G_PF_ACCEPT_UNMAPPED 0x8 #define G_PF_DIRECT_SEND 0x10 #define G_PF_DIRECT_RECEIVE 0x20 + LIST_HEAD(,g_geom_alias) aliases; /* Two fields for the implementing class to use */ void *private; @@ -280,7 +280,6 @@ void g_destroy_provider(struct g_provider *pp); void g_detach(struct g_consumer *cp); void g_error_provider(struct g_provider *pp, int error); struct g_provider *g_provider_by_name(char const *arg); -void g_geom_add_alias(struct g_geom *gp, const char *alias); int g_getattr__(const char *attr, struct g_consumer *cp, void *var, int len); #define g_getattr(a, c, v) g_getattr__((a), (c), (v), sizeof *(v)) int g_handleattr(struct bio *bp, const char *attribute, const void *val, @@ -293,6 +292,8 @@ struct g_consumer * g_new_consumer(struct g_geom *gp); struct g_geom * g_new_geomf(struct g_class *mp, const char *fmt, ...) __printflike(2, 3); struct g_provider * g_new_providerf(struct g_geom *gp, const char *fmt, ...) + __printflike(2, 3); +void g_provider_add_alias(struct g_provider *pp, const char *fmt, ...) __printflike(2, 3); void g_resize_provider(struct g_provider *pp, off_t size); int g_retaste(struct g_class *mp); Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_dev.c Wed May 13 19:17:28 2020 (r361015) @@ -383,7 +383,7 @@ g_dev_taste(struct g_class *mp, struct g_provider *pp, /* * Now add all the aliases for this drive */ - LIST_FOREACH(gap, &pp->geom->aliases, ga_next) { + LIST_FOREACH(gap, &pp->aliases, ga_next) { error = make_dev_alias_p(MAKEDEV_CHECKNAME | MAKEDEV_WAITOK, &adev, dev, "%s", gap->ga_alias); if (error) { Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_disk.c Wed May 13 19:17:28 2020 (r361015) @@ -718,11 +718,9 @@ g_disk_create(void *arg, int flag) sc->d_devstat = dp->d_devstat; gp = g_new_geomf(&g_disk_class, "%s%d", dp->d_name, dp->d_unit); gp->softc = sc; - LIST_FOREACH(dap, &dp->d_aliases, da_next) { - snprintf(tmpstr, sizeof(tmpstr), "%s%d", dap->da_alias, dp->d_unit); - g_geom_add_alias(gp, tmpstr); - } pp = g_new_providerf(gp, "%s", gp->name); + LIST_FOREACH(dap, &dp->d_aliases, da_next) + g_provider_add_alias(pp, "%s%d", dap->da_alias, dp->d_unit); devstat_remove_entry(pp->stat); pp->stat = NULL; dp->d_devstat->id = pp; Modified: head/sys/geom/geom_dump.c ============================================================================== --- head/sys/geom/geom_dump.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_dump.c Wed May 13 19:17:28 2020 (r361015) @@ -211,6 +211,7 @@ g_conf_consumer(struct sbuf *sb, struct g_consumer *cp static void g_conf_provider(struct sbuf *sb, struct g_provider *pp) { + struct g_geom_alias *gap; sbuf_printf(sb, "\t\n", pp); sbuf_printf(sb, "\t \n", pp->geom); @@ -219,6 +220,11 @@ g_conf_provider(struct sbuf *sb, struct g_provider *pp sbuf_cat(sb, "\t "); g_conf_cat_escaped(sb, pp->name); sbuf_cat(sb, "\n"); + LIST_FOREACH(gap, &pp->aliases, ga_next) { + sbuf_cat(sb, "\t "); + g_conf_cat_escaped(sb, gap->ga_alias); + sbuf_cat(sb, "\n"); + } sbuf_printf(sb, "\t %jd\n", (intmax_t)pp->mediasize); sbuf_printf(sb, "\t %u\n", pp->sectorsize); @@ -242,7 +248,6 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct { struct g_consumer *cp2; struct g_provider *pp2; - struct g_geom_alias *gap; sbuf_printf(sb, " \n", gp); sbuf_printf(sb, " \n", gp->class); @@ -267,11 +272,6 @@ g_conf_geom(struct sbuf *sb, struct g_geom *gp, struct if (pp != NULL && pp != pp2) continue; g_conf_provider(sb, pp2); - } - LIST_FOREACH(gap, &gp->aliases, ga_next) { - sbuf_cat(sb, " \n"); - g_conf_cat_escaped(sb, gap->ga_alias); - sbuf_cat(sb, " \n"); } sbuf_cat(sb, " \n"); } Modified: head/sys/geom/geom_subr.c ============================================================================== --- head/sys/geom/geom_subr.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/geom_subr.c Wed May 13 19:17:28 2020 (r361015) @@ -391,7 +391,6 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) gp->rank = 1; LIST_INIT(&gp->consumer); LIST_INIT(&gp->provider); - LIST_INIT(&gp->aliases); LIST_INSERT_HEAD(&mp->geom, gp, geom); TAILQ_INSERT_HEAD(&geoms, gp, geoms); strcpy(gp->name, sbuf_data(sb)); @@ -412,7 +411,6 @@ g_new_geomf(struct g_class *mp, const char *fmt, ...) void g_destroy_geom(struct g_geom *gp) { - struct g_geom_alias *gap, *gaptmp; g_topology_assert(); G_VALID_GEOM(gp); @@ -426,8 +424,6 @@ g_destroy_geom(struct g_geom *gp) g_cancel_event(gp); LIST_REMOVE(gp, geom); TAILQ_REMOVE(&geoms, gp, geoms); - LIST_FOREACH_SAFE(gap, &gp->aliases, ga_next, gaptmp) - g_free(gap); g_free(gp->name); g_free(gp); } @@ -631,6 +627,7 @@ g_new_providerf(struct g_geom *gp, const char *fmt, .. strcpy(pp->name, sbuf_data(sb)); sbuf_delete(sb); LIST_INIT(&pp->consumers); + LIST_INIT(&pp->aliases); pp->error = ENXIO; pp->geom = gp; pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED, @@ -641,6 +638,28 @@ g_new_providerf(struct g_geom *gp, const char *fmt, .. } void +g_provider_add_alias(struct g_provider *pp, const char *fmt, ...) +{ + struct sbuf *sb; + struct g_geom_alias *gap; + va_list ap; + + /* + * Generate the alias string and save it in the list. + */ + sb = sbuf_new_auto(); + va_start(ap, fmt); + sbuf_vprintf(sb, fmt, ap); + va_end(ap); + sbuf_finish(sb); + gap = g_malloc(sizeof(*gap) + sbuf_len(sb) + 1, M_WAITOK | M_ZERO); + memcpy((char *)(gap + 1), sbuf_data(sb), sbuf_len(sb)); + sbuf_delete(sb); + gap->ga_alias = (const char *)(gap + 1); + LIST_INSERT_HEAD(&pp->aliases, gap, ga_next); +} + +void g_error_provider(struct g_provider *pp, int error) { @@ -768,6 +787,7 @@ void g_destroy_provider(struct g_provider *pp) { struct g_geom *gp; + struct g_geom_alias *gap, *gaptmp; g_topology_assert(); G_VALID_PROVIDER(pp); @@ -786,7 +806,8 @@ g_destroy_provider(struct g_provider *pp) */ if (gp->providergone != NULL) gp->providergone(pp); - + LIST_FOREACH_SAFE(gap, &pp->aliases, ga_next, gaptmp) + g_free(gap); g_free(pp); if ((gp->flags & G_GEOM_WITHER)) g_do_wither(); @@ -1314,18 +1335,6 @@ g_compare_names(const char *namea, const char *nameb) if (strcmp(namea + deva, nameb + devb) == 0) return (1); return (0); -} - -void -g_geom_add_alias(struct g_geom *gp, const char *alias) -{ - struct g_geom_alias *gap; - - gap = (struct g_geom_alias *)g_malloc( - sizeof(struct g_geom_alias) + strlen(alias) + 1, M_WAITOK); - strcpy((char *)(gap + 1), alias); - gap->ga_alias = (const char *)(gap + 1); - LIST_INSERT_HEAD(&gp->aliases, gap, ga_next); } #if defined(DIAGNOSTIC) || defined(DDB) Modified: head/sys/geom/mountver/g_mountver.c ============================================================================== --- head/sys/geom/mountver/g_mountver.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/mountver/g_mountver.c Wed May 13 19:17:28 2020 (r361015) @@ -276,6 +276,7 @@ g_mountver_create(struct gctl_req *req, struct g_class struct g_geom *gp; struct g_provider *newpp; struct g_consumer *cp; + struct g_geom_alias *gap; char name[64]; int error; int identsize = DISK_IDENT_SIZE; @@ -309,6 +310,8 @@ g_mountver_create(struct gctl_req *req, struct g_class newpp->mediasize = pp->mediasize; newpp->sectorsize = pp->sectorsize; newpp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(newpp, "%s%s", gap->ga_alias, G_MOUNTVER_SUFFIX); if ((pp->flags & G_PF_ACCEPT_UNMAPPED) != 0) { G_MOUNTVER_DEBUG(0, "Unmapped supported for %s.", gp->name); Modified: head/sys/geom/nop/g_nop.c ============================================================================== --- head/sys/geom/nop/g_nop.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/nop/g_nop.c Wed May 13 19:17:28 2020 (r361015) @@ -346,6 +346,7 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, struct g_geom *gp; struct g_provider *newpp; struct g_consumer *cp; + struct g_geom_alias *gap; char name[64]; int error, n; off_t explicitsize; @@ -458,6 +459,8 @@ g_nop_create(struct gctl_req *req, struct g_class *mp, newpp->sectorsize = secsize; newpp->stripesize = stripesize; newpp->stripeoffset = stripeoffset; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(newpp, "%s%s", gap->ga_alias, G_NOP_SUFFIX); cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/part/g_part.c Wed May 13 19:17:28 2020 (r361015) @@ -481,24 +481,25 @@ g_part_new_provider(struct g_geom *gp, struct g_part_t entry->gpe_offset = offset; if (entry->gpe_pp == NULL) { + sb = sbuf_new_auto(); + G_PART_FULLNAME(table, entry, sb, gp->name); + sbuf_finish(sb); + entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb)); + sbuf_delete(sb); /* - * Add aliases to the geom before we create the provider so that - * geom_dev can taste it with all the aliases in place so all - * the aliased dev_t instances get created for each partition - * (eg foo5p7 gets created for bar5p7 when foo is an alias of bar). + * If our parent provider had any aliases, then copy them to our + * provider so when geom DEV tastes things later, they will be + * there for it to create the aliases with those name used in + * place of the geom's name we use to create the provider. The + * kobj interface that generates names makes this awkward. */ - LIST_FOREACH(gap, &table->gpt_gp->aliases, ga_next) { + LIST_FOREACH(gap, &pp->aliases, ga_next) { sb = sbuf_new_auto(); G_PART_FULLNAME(table, entry, sb, gap->ga_alias); sbuf_finish(sb); - g_geom_add_alias(gp, sbuf_data(sb)); + g_provider_add_alias(entry->gpe_pp, "%s", sbuf_data(sb)); sbuf_delete(sb); } - sb = sbuf_new_auto(); - G_PART_FULLNAME(table, entry, sb, gp->name); - sbuf_finish(sb); - entry->gpe_pp = g_new_providerf(gp, "%s", sbuf_data(sb)); - sbuf_delete(sb); entry->gpe_pp->flags |= G_PF_DIRECT_SEND | G_PF_DIRECT_RECEIVE; entry->gpe_pp->private = entry; /* Close the circle. */ } @@ -1968,7 +1969,6 @@ g_part_taste(struct g_class *mp, struct g_provider *pp struct g_part_entry *entry; struct g_part_table *table; struct root_hold_token *rht; - struct g_geom_alias *gap; int attr, depth; int error; @@ -1985,8 +1985,6 @@ g_part_taste(struct g_class *mp, struct g_provider *pp * to the provider. */ gp = g_new_geomf(mp, "%s", pp->name); - LIST_FOREACH(gap, &pp->geom->aliases, ga_next) - g_geom_add_alias(gp, gap->ga_alias); cp = g_new_consumer(gp); cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE; error = g_attach(cp, pp); Modified: head/sys/geom/uzip/g_uzip.c ============================================================================== --- head/sys/geom/uzip/g_uzip.c Wed May 13 18:36:02 2020 (r361014) +++ head/sys/geom/uzip/g_uzip.c Wed May 13 19:17:28 2020 (r361015) @@ -677,6 +677,7 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp struct g_geom *gp; struct g_provider *pp2; struct g_uzip_softc *sc; + struct g_geom_alias *gap; enum { G_UZIP = 1, G_ULZMA, @@ -910,6 +911,8 @@ g_uzip_taste(struct g_class *mp, struct g_provider *pp pp2->mediasize = (off_t)sc->nblocks * sc->blksz; pp2->stripesize = pp->stripesize; pp2->stripeoffset = pp->stripeoffset; + LIST_FOREACH(gap, &pp->aliases, ga_next) + g_provider_add_alias(pp2, GUZ_DEV_NAME("%s"), gap->ga_alias); g_error_provider(pp2, 0); g_access(cp, -1, 0, 0); From owner-svn-src-all@freebsd.org Wed May 13 19:17:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B18E72FD525; Wed, 13 May 2020 19:17:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mkvh1qYMz4R6P; Wed, 13 May 2020 19:17:36 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CB85A26375; Wed, 13 May 2020 19:17:35 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DJHZ5F043692; Wed, 13 May 2020 19:17:35 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJHZGP043691; Wed, 13 May 2020 19:17:35 GMT (envelope-from imp@FreeBSD.org) Message-Id: <202005131917.04DJHZGP043691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 13 May 2020 19:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361016 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 361016 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:17:36 -0000 Author: imp Date: Wed May 13 19:17:35 2020 New Revision: 361016 URL: https://svnweb.freebsd.org/changeset/base/361016 Log: Add nvd alias back to nda now that it actually works. Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed May 13 19:17:28 2020 (r361015) +++ head/sys/cam/nvme/nvme_da.c Wed May 13 19:17:35 2020 (r361016) @@ -950,7 +950,7 @@ ndaregister(struct cam_periph *periph, void *arg) /* * Add alias for older nvd drives to ease transition. */ - /* disk_add_alias(disk, "nvd"); Have reports of this causing problems */ + disk_add_alias(disk, "nvd"); /* * Acquire a reference to the periph before we register with GEOM. From owner-svn-src-all@freebsd.org Wed May 13 19:29:15 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9066B2FDBE4; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@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 49Ml9721RNz4S5K; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 404D326554; Wed, 13 May 2020 19:29:15 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DJTFuA049605; Wed, 13 May 2020 19:29:15 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DJTFPF049604; Wed, 13 May 2020 19:29:15 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005131929.04DJTFPF049604@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 19:29:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361017 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361017 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 19:29:15 -0000 Author: lwhsu Date: Wed May 13 19:29:14 2020 New Revision: 361017 URL: https://svnweb.freebsd.org/changeset/base/361017 Log: Temporarily skip sys.net.if_clone_test.epair_stress This case timed out so often PR: 246443 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_clone_test.sh Modified: head/tests/sys/net/if_clone_test.sh ============================================================================== --- head/tests/sys/net/if_clone_test.sh Wed May 13 19:17:35 2020 (r361016) +++ head/tests/sys/net/if_clone_test.sh Wed May 13 19:29:14 2020 (r361017) @@ -47,6 +47,7 @@ epair_stress_head() } epair_stress_body() { + atf_skip "https://bugs.freebsd.org/246443" do_stress "epair" } epair_stress_cleanup() From owner-svn-src-all@freebsd.org Wed May 13 20:36:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 75A9C2FF058; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@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 49Mmfv2bDVz4X3N; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 52D63272A7; Wed, 13 May 2020 20:36:39 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DKadV3093538; Wed, 13 May 2020 20:36:39 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DKadt8093537; Wed, 13 May 2020 20:36:39 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005132036.04DKadt8093537@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 20:36:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361018 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361018 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:36:39 -0000 Author: lwhsu Date: Wed May 13 20:36:38 2020 New Revision: 361018 URL: https://svnweb.freebsd.org/changeset/base/361018 Log: Temporarily skip sys.net.if_bridge_test.stp in CI as it always times out PR: 244229 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_bridge_test.sh Modified: head/tests/sys/net/if_bridge_test.sh ============================================================================== --- head/tests/sys/net/if_bridge_test.sh Wed May 13 19:29:14 2020 (r361017) +++ head/tests/sys/net/if_bridge_test.sh Wed May 13 20:36:38 2020 (r361018) @@ -77,6 +77,10 @@ stp_head() stp_body() { + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/246448" + fi + vnet_init epair_one=$(vnet_mkepair) From owner-svn-src-all@freebsd.org Wed May 13 20:37:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E40962FF147; Wed, 13 May 2020 20:37:49 +0000 (UTC) (envelope-from lwhsu@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 49MmhD3y84z4XRg; Wed, 13 May 2020 20:37:48 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED91C272AF; Wed, 13 May 2020 20:37:46 +0000 (UTC) (envelope-from lwhsu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DKbkha093999; Wed, 13 May 2020 20:37:46 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DKbkv6093998; Wed, 13 May 2020 20:37:46 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <202005132037.04DKbkv6093998@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Wed, 13 May 2020 20:37:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361019 - head/tests/sys/net X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/tests/sys/net X-SVN-Commit-Revision: 361019 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:37:50 -0000 Author: lwhsu Date: Wed May 13 20:37:46 2020 New Revision: 361019 URL: https://svnweb.freebsd.org/changeset/base/361019 Log: Only skip sys.net.if_clone_test.epair_stress in CI env PR: 246443 Sponsored by: The FreeBSD Foundation Modified: head/tests/sys/net/if_clone_test.sh Modified: head/tests/sys/net/if_clone_test.sh ============================================================================== --- head/tests/sys/net/if_clone_test.sh Wed May 13 20:36:38 2020 (r361018) +++ head/tests/sys/net/if_clone_test.sh Wed May 13 20:37:46 2020 (r361019) @@ -47,7 +47,9 @@ epair_stress_head() } epair_stress_body() { - atf_skip "https://bugs.freebsd.org/246443" + if [ "$(atf_config_get ci false)" = "true" ]; then + atf_skip "https://bugs.freebsd.org/246443" + fi do_stress "epair" } epair_stress_cleanup() From owner-svn-src-all@freebsd.org Wed May 13 20:42:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4AAF62FF667; Wed, 13 May 2020 20:42:12 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: from mail-yb1-f180.google.com (mail-yb1-f180.google.com [209.85.219.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Mmn663Pmz4ZHq; Wed, 13 May 2020 20:42:01 +0000 (UTC) (envelope-from lwhsu.freebsd@gmail.com) Received: by mail-yb1-f180.google.com with SMTP id i16so380523ybq.9; Wed, 13 May 2020 13:42:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=XGG5QNRGx7MPa8SXBu2cyV4FJqkMyeSAEANLTNIXTZw=; b=Lk3ovF8bjNb0bsX2QEebcp+UhqHtiscfBUS0Kti3SNwpX6JUvQNpkGXzqEAYYuhyeS /ANoklRVh2Xm7Vo9EuCRmTpkFgwz+/xPLquttssOO0khbkmno+j1ynB6v/HS9MK4jTKY bbz9CGJg36jsVbvh9Q9j7kUwtQ0BuBDvW26BjkfWZveT0a4JGuW1Z+QGoFn8Ic79FNtt 3aCn9+or7is0BfZ5xGd0fky8f/whmnBZlodVQrj2T4GUVH5uOvKpP5tham7vzKJnUTbI ZksHgW08Om+oGkzr3Lc6AbjQtREGmsa0dNRaVB2cXOa1dS0zg8YnZu39V1jWuel4Yf/E 4xZA== X-Gm-Message-State: AOAM530/EGQL20TQtQmCTAvZAqRhO9Lv7OMDQLJ1O+ksaBtxg4nz4mRK 4FnL6LVQ3tcOZwua0rKYhH9ff0kJG0ub9POUOayeOeb0 X-Google-Smtp-Source: ABdhPJzQUQKdXZYN6pA51sEUKCvlKQAMP4+HIiBbhdUslap4h1tTZpgVagMPinlLITBlRqbH/ZL4KnaRF+C5DLD+Agw= X-Received: by 2002:a25:b841:: with SMTP id b1mr1544267ybm.492.1589402517281; Wed, 13 May 2020 13:41:57 -0700 (PDT) MIME-Version: 1.0 References: <202005132036.04DKadt8093537@repo.freebsd.org> In-Reply-To: <202005132036.04DKadt8093537@repo.freebsd.org> From: Li-Wen Hsu Date: Thu, 14 May 2020 04:41:46 +0800 Message-ID: Subject: Re: svn commit: r361018 - head/tests/sys/net To: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49Mmn663Pmz4ZHq X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of lwhsufreebsd@gmail.com designates 209.85.219.180 as permitted sender) smtp.mailfrom=lwhsufreebsd@gmail.com X-Spamd-Result: default: False [-4.03 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; TAGGED_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[freebsd.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_TLS_ALL(0.00)[]; IP_SCORE(-2.03)[ip: (-9.29), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[180.219.85.209.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[180.219.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[lwhsu@freebsd.org,lwhsufreebsd@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 20:42:12 -0000 On Thu, May 14, 2020 at 4:36 AM Li-Wen Hsu wrote: > > Author: lwhsu > Date: Wed May 13 20:36:38 2020 > New Revision: 361018 > URL: https://svnweb.freebsd.org/changeset/base/361018 > > Log: > Temporarily skip sys.net.if_bridge_test.stp in CI as it always times out > > PR: 244229 The correct PR should be https://bugs.freebsd.org/246448 From owner-svn-src-all@freebsd.org Wed May 13 21:16:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C49442D8B5A; Wed, 13 May 2020 21:16:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MnXM4vgFz4dtp; Wed, 13 May 2020 21:16:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3A8327A7D; Wed, 13 May 2020 21:16:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DLG3aL023367; Wed, 13 May 2020 21:16:03 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DLG3Ig023365; Wed, 13 May 2020 21:16:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005132116.04DLG3Ig023365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 21:16: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: r361020 - in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Commit-Revision: 361020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 21:16:03 -0000 Author: jhb Date: Wed May 13 21:16:02 2020 New Revision: 361020 URL: https://svnweb.freebsd.org/changeset/base/361020 Log: MFC 359047,359054: Deprecate procfs-based process debugging. 359047: Mark procfs-based process debugging as deprecated for FreeBSD 13. Attempting to use ioctls on /proc//mem to control a process will trigger warnings on the console. The include file will also now emit a compile-time warning when used from userland. 359054: Fix the workaround to ignore the #warning for GCC. clang and gcc use different warning flags for #warning preprocessor directives. For both 12 and 11, adjust the GCC warning flags to only be added in 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the needed warning suppression to procctl's build. procctl was removed in 12.0. Modified: stable/12/lib/libsysdecode/Makefile stable/12/sys/fs/procfs/procfs_ioctl.c stable/12/sys/sys/pioctl.h Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/lib/libsysdecode/Makefile stable/11/sys/fs/procfs/procfs_ioctl.c stable/11/sys/sys/pioctl.h stable/11/usr.sbin/procctl/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/12/lib/libsysdecode/Makefile ============================================================================== --- stable/12/lib/libsysdecode/Makefile Wed May 13 20:37:46 2020 (r361019) +++ stable/12/lib/libsysdecode/Makefile Wed May 13 21:16:02 2020 (r361020) @@ -120,6 +120,13 @@ CFLAGS+=-DPF # Workaround duplicate declarations in CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls +# Ignore deprecation warning in +CFLAGS.clang.ioctl.c+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc.ioctl.c+= -Wno-cpp +.endif + +CFLAGS.clang+= ${CFLAGS.clang.${.IMPSRC}} CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h Modified: stable/12/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- stable/12/sys/fs/procfs/procfs_ioctl.c Wed May 13 20:37:46 2020 (r361019) +++ stable/12/sys/fs/procfs/procfs_ioctl.c Wed May 13 21:16:02 2020 (r361020) @@ -69,10 +69,53 @@ procfs_ioctl(PFS_IOCTL_ARGS) #ifdef COMPAT_FREEBSD6 int ival; #endif + static struct timeval lasttime; + static struct timeval interval = { .tv_sec = 1, .tv_usec = 0 }; KASSERT(p != NULL, ("%s() called without a process", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); + + switch (cmd) { +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 1, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): +#endif + case PIOCBIS: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 2, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): +#endif + case PIOCBIC: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 3, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): +#endif + case PIOCSFL: + case PIOCGFL: + case PIOCWAIT: + case PIOCSTATUS: +#ifdef COMPAT_FREEBSD32 + case PIOCWAIT32: + case PIOCSTATUS32: +#endif +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 5, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): +#endif + case PIOCCONT: + if (ratecheck(&lasttime, &interval) != 0) + gone_in(13, "procfs-based process debugging"); + break; + } error = 0; switch (cmd) { Modified: stable/12/sys/sys/pioctl.h ============================================================================== --- stable/12/sys/sys/pioctl.h Wed May 13 20:37:46 2020 (r361019) +++ stable/12/sys/sys/pioctl.h Wed May 13 21:16:02 2020 (r361020) @@ -41,6 +41,10 @@ #ifndef _SYS_PIOCTL_H # define _SYS_PIOCTL_H +#ifndef _KERNEL +#warning " is deprecated, ptrace() should be used instead" +#endif + # include struct procfs_status { From owner-svn-src-all@freebsd.org Wed May 13 21:16:04 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CA0A32D8B76; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MnXN53hnz4dtx; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A899A27A7E; Wed, 13 May 2020 21:16:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04DLG4aL023377; Wed, 13 May 2020 21:16:04 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04DLG3Ro023372; Wed, 13 May 2020 21:16:03 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005132116.04DLG3Ro023372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 13 May 2020 21:16:03 +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: r361020 - in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/lib/libsysdecode 11/sys/fs/procfs 11/sys/sys 11/usr.sbin/procctl 12/lib/libsysdecode 12/sys/fs/procfs 12/sys/sys X-SVN-Commit-Revision: 361020 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 May 2020 21:16:05 -0000 Author: jhb Date: Wed May 13 21:16:02 2020 New Revision: 361020 URL: https://svnweb.freebsd.org/changeset/base/361020 Log: MFC 359047,359054: Deprecate procfs-based process debugging. 359047: Mark procfs-based process debugging as deprecated for FreeBSD 13. Attempting to use ioctls on /proc//mem to control a process will trigger warnings on the console. The include file will also now emit a compile-time warning when used from userland. 359054: Fix the workaround to ignore the #warning for GCC. clang and gcc use different warning flags for #warning preprocessor directives. For both 12 and 11, adjust the GCC warning flags to only be added in 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the needed warning suppression to procctl's build. procctl was removed in 12.0. Modified: stable/11/lib/libsysdecode/Makefile stable/11/sys/fs/procfs/procfs_ioctl.c stable/11/sys/sys/pioctl.h stable/11/usr.sbin/procctl/Makefile Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libsysdecode/Makefile stable/12/sys/fs/procfs/procfs_ioctl.c stable/12/sys/sys/pioctl.h Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libsysdecode/Makefile ============================================================================== --- stable/11/lib/libsysdecode/Makefile Wed May 13 20:37:46 2020 (r361019) +++ stable/11/lib/libsysdecode/Makefile Wed May 13 21:16:02 2020 (r361020) @@ -123,6 +123,13 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls # Workaround warning for unused ssi_cables[] in CFLAGS.gcc.ioctl.c+= -Wno-unused +# Ignore deprecation warning in +CFLAGS.clang.ioctl.c+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc.ioctl.c+= -Wno-cpp +.endif + +CFLAGS.clang+= ${CFLAGS.clang.${.IMPSRC}} CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h Modified: stable/11/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- stable/11/sys/fs/procfs/procfs_ioctl.c Wed May 13 20:37:46 2020 (r361019) +++ stable/11/sys/fs/procfs/procfs_ioctl.c Wed May 13 21:16:02 2020 (r361020) @@ -69,10 +69,53 @@ procfs_ioctl(PFS_IOCTL_ARGS) #ifdef COMPAT_FREEBSD6 int ival; #endif + static struct timeval lasttime; + static struct timeval interval = { .tv_sec = 1, .tv_usec = 0 }; KASSERT(p != NULL, ("%s() called without a process", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); + + switch (cmd) { +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 1, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): +#endif + case PIOCBIS: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 2, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): +#endif + case PIOCBIC: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 3, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): +#endif + case PIOCSFL: + case PIOCGFL: + case PIOCWAIT: + case PIOCSTATUS: +#ifdef COMPAT_FREEBSD32 + case PIOCWAIT32: + case PIOCSTATUS32: +#endif +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 5, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): +#endif + case PIOCCONT: + if (ratecheck(&lasttime, &interval) != 0) + gone_in(13, "procfs-based process debugging"); + break; + } error = 0; switch (cmd) { Modified: stable/11/sys/sys/pioctl.h ============================================================================== --- stable/11/sys/sys/pioctl.h Wed May 13 20:37:46 2020 (r361019) +++ stable/11/sys/sys/pioctl.h Wed May 13 21:16:02 2020 (r361020) @@ -39,6 +39,10 @@ #ifndef _SYS_PIOCTL_H # define _SYS_PIOCTL_H +#ifndef _KERNEL +#warning " is deprecated, ptrace() should be used instead" +#endif + # include struct procfs_status { Modified: stable/11/usr.sbin/procctl/Makefile ============================================================================== --- stable/11/usr.sbin/procctl/Makefile Wed May 13 20:37:46 2020 (r361019) +++ stable/11/usr.sbin/procctl/Makefile Wed May 13 21:16:02 2020 (r361020) @@ -1,6 +1,14 @@ # $FreeBSD$ +.include + PROG= procctl MAN= procctl.8 + +# Ignore deprecation warning in +CFLAGS.clang+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc+= -Wno-cpp +.endif .include From owner-svn-src-all@freebsd.org Thu May 14 03:01:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8B2AE2E2A9D; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxBr30kHz3G37; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6240D4145; Thu, 14 May 2020 03:01:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E31OLU035456; Thu, 14 May 2020 03:01:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E31Oh6035455; Thu, 14 May 2020 03:01:24 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005140301.04E31Oh6035455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 14 May 2020 03:01:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361021 - in head: sys/kern usr.sbin/extattr/tests X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: sys/kern usr.sbin/extattr/tests X-SVN-Commit-Revision: 361021 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:01:24 -0000 Author: cem Date: Thu May 14 03:01:23 2020 New Revision: 361021 URL: https://svnweb.freebsd.org/changeset/base/361021 Log: vfs_extattr: Allow extattr names up to the full max Extattr names are allowed to be 255 bytes -- not 254 bytes plus trailing NUL. Provide a 256 buffer so that copyinstr() has room for the trailing NUL. Re-enable test for maximal name lengths. PR: 208965 Reported by: asomers Reviewed by: asomers Differential Revision: https://reviews.freebsd.org/D24584 Modified: head/sys/kern/vfs_extattr.c head/usr.sbin/extattr/tests/extattr_test.sh Modified: head/sys/kern/vfs_extattr.c ============================================================================== --- head/sys/kern/vfs_extattr.c Wed May 13 21:16:02 2020 (r361020) +++ head/sys/kern/vfs_extattr.c Thu May 14 03:01:23 2020 (r361021) @@ -82,7 +82,7 @@ sys_extattrctl(struct thread *td, struct extattrctl_ar struct vnode *filename_vp; struct nameidata nd; struct mount *mp, *mp_writable; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_CMD(uap->cmd); @@ -92,7 +92,7 @@ sys_extattrctl(struct thread *td, struct extattrctl_ar * invoke the VFS call so as to pass in NULL there if needed. */ if (uap->attrname != NULL) { - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); @@ -231,13 +231,13 @@ int sys_extattr_set_fd(struct thread *td, struct extattr_set_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -293,11 +293,11 @@ kern_extattr_set_path(struct thread *td, const char *p const char *uattrname, void *data, size_t nbytes, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -398,13 +398,13 @@ int sys_extattr_get_fd(struct thread *td, struct extattr_get_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -458,11 +458,11 @@ kern_extattr_get_path(struct thread *td, const char *p const char *uattrname, void *data, size_t nbytes, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -533,13 +533,13 @@ int sys_extattr_delete_fd(struct thread *td, struct extattr_delete_fd_args *uap) { struct file *fp; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; cap_rights_t rights; int error; AUDIT_ARG_FD(uap->fd); AUDIT_ARG_VALUE(uap->attrnamespace); - error = copyinstr(uap->attrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uap->attrname, attrname, sizeof(attrname), NULL); if (error) return (error); AUDIT_ARG_TEXT(attrname); @@ -590,11 +590,11 @@ kern_extattr_delete_path(struct thread *td, const char const char *uattrname, int follow) { struct nameidata nd; - char attrname[EXTATTR_MAXNAMELEN]; + char attrname[EXTATTR_MAXNAMELEN + 1]; int error; AUDIT_ARG_VALUE(attrnamespace); - error = copyinstr(uattrname, attrname, EXTATTR_MAXNAMELEN, NULL); + error = copyinstr(uattrname, attrname, sizeof(attrname), NULL); if (error) return(error); AUDIT_ARG_TEXT(attrname); Modified: head/usr.sbin/extattr/tests/extattr_test.sh ============================================================================== --- head/usr.sbin/extattr/tests/extattr_test.sh Wed May 13 21:16:02 2020 (r361020) +++ head/usr.sbin/extattr/tests/extattr_test.sh Thu May 14 03:01:23 2020 (r361021) @@ -75,9 +75,6 @@ long_name_body() { atf_skip "Filesystem not reporting NAME_MAX; skipping testcase" fi - # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208965 - atf_expect_fail "BUG 208965 extattr(2) doesn't allow maxlen attr names" - ATTRNAME=`jot -b X -s "" $NAME_MAX 0` touch foo atf_check -s exit:0 -o empty setextattr user $ATTRNAME myvalue foo From owner-svn-src-all@freebsd.org Thu May 14 03:25:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2DEA2E375F; Thu, 14 May 2020 03:25:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxkJ5FjSz3HQd; Thu, 14 May 2020 03:25:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AF89845D1; Thu, 14 May 2020 03:25:12 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E3PCTV050251; Thu, 14 May 2020 03:25:12 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E3PCwA050250; Thu, 14 May 2020 03:25:12 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005140325.04E3PCwA050250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 03:25:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361022 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361022 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:25:12 -0000 Author: kevans Date: Thu May 14 03:25:12 2020 New Revision: 361022 URL: https://svnweb.freebsd.org/changeset/base/361022 Log: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. Reported by: cem's dovecot server MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu May 14 03:01:23 2020 (r361021) +++ head/usr.sbin/certctl/certctl.sh Thu May 14 03:25:12 2020 (r361022) @@ -142,9 +142,11 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + [ -e "$CERTDESTDIR" ] && find "$CERTDESTDIR" -type link -delete + mkdir -p "$CERTDESTDIR" + mkdir -p "$BLACKLISTDESTDIR" + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-all@freebsd.org Thu May 14 03:30:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8A98F2E3817; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49MxrN37YFz3HZF; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66DE845DD; Thu, 14 May 2020 03:30:28 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E3USPr050539; Thu, 14 May 2020 03:30:28 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E3USMB050538; Thu, 14 May 2020 03:30:28 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005140330.04E3USMB050538@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 03:30:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361023 - head/usr.sbin/certctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/certctl X-SVN-Commit-Revision: 361023 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 03:30:28 -0000 Author: kevans Date: Thu May 14 03:30:27 2020 New Revision: 361023 URL: https://svnweb.freebsd.org/changeset/base/361023 Log: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. MFC after: 3 days Modified: head/usr.sbin/certctl/certctl.sh Modified: head/usr.sbin/certctl/certctl.sh ============================================================================== --- head/usr.sbin/certctl/certctl.sh Thu May 14 03:25:12 2020 (r361022) +++ head/usr.sbin/certctl/certctl.sh Thu May 14 03:30:27 2020 (r361023) @@ -143,9 +143,16 @@ cmd_rehash() { if [ $NOOP -eq 0 ]; then - [ -e "$CERTDESTDIR" ] && find "$CERTDESTDIR" -type link -delete - mkdir -p "$CERTDESTDIR" - mkdir -p "$BLACKLISTDESTDIR" + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi fi do_scan create_blacklisted "$BLACKLISTPATH" From owner-svn-src-all@freebsd.org Thu May 14 04:00:36 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 226222E415B; Thu, 14 May 2020 04:00:36 +0000 (UTC) (envelope-from bdragon@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 49MyW76z0Vz3K07; Thu, 14 May 2020 04:00:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EA6E14B9D; Thu, 14 May 2020 04:00:35 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E40Zh4071153; Thu, 14 May 2020 04:00:35 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E40Zeb071152; Thu, 14 May 2020 04:00:35 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <202005140400.04E40Zeb071152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 14 May 2020 04:00:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361024 - head/lib/csu/powerpc X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/lib/csu/powerpc X-SVN-Commit-Revision: 361024 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 04:00:36 -0000 Author: bdragon Date: Thu May 14 04:00:35 2020 New Revision: 361024 URL: https://svnweb.freebsd.org/changeset/base/361024 Log: [PowerPC] Fix wrong instructions in _savegpr_X. We were accidentally using stfd instead of stw in our SAVEGPR macro. This has almost certainly been causing crashes when compiling with -Os. Reviewed by: jhibbits (in irc) MFC after: 3 days Sponsored by: Tag1 Consulting, Inc. Modified: head/lib/csu/powerpc/crtsavres.S Modified: head/lib/csu/powerpc/crtsavres.S ============================================================================== --- head/lib/csu/powerpc/crtsavres.S Thu May 14 03:30:27 2020 (r361023) +++ head/lib/csu/powerpc/crtsavres.S Thu May 14 04:00:35 2020 (r361024) @@ -93,7 +93,7 @@ RESTFPR(31) blr #define SAVEGPR(r) _CRTENTRY(__CONCAT(_savegpr_,r)) \ - stfd r,(-128 + r*4)(11) + stw r,(-128 + r * 4)(11) SAVEGPR(14) SAVEGPR(15) @@ -165,7 +165,7 @@ RESTFPR_X(31) blr #define RESTGPR_X(r) _CRTENTRY(__CONCAT(__CONCAT(_restgpr_,r),_x)) \ - lwz r,(-128 + r*4)(11) + lwz r,(-128 + r * 4)(11) RESTGPR_X(14) RESTGPR_X(15) From owner-svn-src-all@freebsd.org Thu May 14 05:01:19 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6F8E42E55CE; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@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 49MzsC2L2Yz3MS4; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 314A656E3; Thu, 14 May 2020 05:01:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E51JbX005384; Thu, 14 May 2020 05:01:19 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E51Jn1005383; Thu, 14 May 2020 05:01:19 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005140501.04E51Jn1005383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 14 May 2020 05:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361025 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361025 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 05:01:19 -0000 Author: adrian Date: Thu May 14 05:01:18 2020 New Revision: 361025 URL: https://svnweb.freebsd.org/changeset/base/361025 Log: [ath] Extend the colours to 4, not 2. There's 8 bins in the upcoming changeset to ath/ath_rate, so I need more colours. Yeah, I know. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Thu May 14 04:00:35 2020 (r361024) +++ head/tools/tools/ath/athratestats/main.c Thu May 14 05:01:18 2020 (r361025) @@ -122,7 +122,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r (long long) sn->ratemask); for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { - PRINTATTR_ON(COLOR_PAIR(4 + (y % 2)) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(2 + (y % 4)) | A_BOLD); PRINTMSG("[%4u] cur rate %d %s since switch: " "packets %d ticks %u ", bin_to_size(y), @@ -132,17 +132,16 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->ticks_since_switch[y]); PRINTMSG("last sample (%d %s) cur sample (%d %s) " - "packets sent %d\n", + "packets sent %d ", dot11rate(rt, sn->last_sample_rix[y]), dot11str(rt, sn->last_sample_rix[y]), dot11rate(rt, sn->current_sample_rix[y]), dot11str(rt, sn->current_sample_rix[y]), sn->packets_sent[y]); - PRINTATTR_OFF(COLOR_PAIR(4 + (y % 2)) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(2 + (y % 4)) | A_BOLD); - PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); - PRINTMSG("[%4u] packets since sample %d sample tt %u\n", - bin_to_size(y), + PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); + PRINTMSG("packets since sample %d sample tt %u\n", sn->packets_since_sample[y], sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); @@ -156,9 +155,9 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r if (sn->stats[y][rix].total_packets == 0) continue; if (rix == sn->current_rix[y]) - PRINTATTR_ON(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(2 + (y % 4)) | A_BOLD); else if (rix == sn->last_sample_rix[y]) - PRINTATTR_ON(COLOR_PAIR(3) | A_BOLD); + PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #if 0 else if (sn->stats[y][rix].ewma_pct / 10 < 50) PRINTATTR_ON(COLOR_PAIR(2) | A_BOLD); @@ -179,9 +178,9 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->stats[y][rix].average_tx_time, sn->stats[y][rix].last_tx); if (rix == sn->current_rix[y]) - PRINTATTR_OFF(COLOR_PAIR(y+4) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(2 + (y % 4)) | A_BOLD); else if (rix == sn->last_sample_rix[y]) - PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); + PRINTATTR_OFF(COLOR_PAIR(1) | A_BOLD); #if 0 else if (sn->stats[y][rix].ewma_pct / 10 < 50) PRINTATTR_OFF(COLOR_PAIR(2) | A_BOLD); From owner-svn-src-all@freebsd.org Thu May 14 06:05:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D45BF2E6293; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@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 49N1H85Hxdz3PxN; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 B0DBD6404; Thu, 14 May 2020 06:05:24 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E65OxP047893; Thu, 14 May 2020 06:05:24 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E65One047892; Thu, 14 May 2020 06:05:24 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005140605.04E65One047892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 14 May 2020 06:05:24 +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: r361026 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 361026 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 06:05:24 -0000 Author: pstef Date: Thu May 14 06:05:24 2020 New Revision: 361026 URL: https://svnweb.freebsd.org/changeset/base/361026 Log: MFC r360786: ps: extend the non-standard option -d (tree view) to work with -p Modified: stable/11/bin/ps/ps.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/ps.c ============================================================================== --- stable/11/bin/ps/ps.c Thu May 14 05:01:18 2020 (r361025) +++ stable/11/bin/ps/ps.c Thu May 14 06:05:24 2020 (r361026) @@ -490,7 +490,7 @@ main(int argc, char *argv[]) what = KERN_PROC_PGRP | showthreads; flag = *pgrplist.l.pids; nselectors = 0; - } else if (pidlist.count == 1) { + } else if (pidlist.count == 1 && !descendancy) { what = KERN_PROC_PID | showthreads; flag = *pidlist.l.pids; nselectors = 0; @@ -528,6 +528,14 @@ main(int argc, char *argv[]) if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; + if (descendancy) + for (elem = 0; elem < pidlist.count; elem++) + for (i = 0; i < nentries; i++) + if (kp[i].ki_ppid == pidlist.l.pids[elem]) { + if (pidlist.count >= pidlist.maxcount) + expand_list(&pidlist); + pidlist.l.pids[pidlist.count++] = kp[i].ki_pid; + } if (nentries > 0) { if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL) xo_errx(1, "malloc failed"); From owner-svn-src-all@freebsd.org Thu May 14 06:07:23 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ADD172E63D0; Thu, 14 May 2020 06:07:23 +0000 (UTC) (envelope-from pstef@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 49N1KR48bgz3QL7; Thu, 14 May 2020 06:07:23 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 89C4F6419; Thu, 14 May 2020 06:07:23 +0000 (UTC) (envelope-from pstef@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E67N88048400; Thu, 14 May 2020 06:07:23 GMT (envelope-from pstef@FreeBSD.org) Received: (from pstef@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E67NP9048399; Thu, 14 May 2020 06:07:23 GMT (envelope-from pstef@FreeBSD.org) Message-Id: <202005140607.04E67NP9048399@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pstef set sender to pstef@FreeBSD.org using -f From: Piotr Pawel Stefaniak Date: Thu, 14 May 2020 06:07: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: r361027 - stable/12/bin/ps X-SVN-Group: stable-12 X-SVN-Commit-Author: pstef X-SVN-Commit-Paths: stable/12/bin/ps X-SVN-Commit-Revision: 361027 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 06:07:23 -0000 Author: pstef Date: Thu May 14 06:07:23 2020 New Revision: 361027 URL: https://svnweb.freebsd.org/changeset/base/361027 Log: MFC r360786: ps: extend the non-standard option -d (tree view) to work with -p Modified: stable/12/bin/ps/ps.c Directory Properties: stable/12/ (props changed) Modified: stable/12/bin/ps/ps.c ============================================================================== --- stable/12/bin/ps/ps.c Thu May 14 06:05:24 2020 (r361026) +++ stable/12/bin/ps/ps.c Thu May 14 06:07:23 2020 (r361027) @@ -506,7 +506,7 @@ main(int argc, char *argv[]) what = KERN_PROC_PGRP | showthreads; flag = *pgrplist.l.pids; nselectors = 0; - } else if (pidlist.count == 1) { + } else if (pidlist.count == 1 && !descendancy) { what = KERN_PROC_PID | showthreads; flag = *pidlist.l.pids; nselectors = 0; @@ -544,6 +544,14 @@ main(int argc, char *argv[]) if ((kp == NULL && errno != ESRCH) || (kp != NULL && nentries < 0)) xo_errx(1, "%s", kvm_geterr(kd)); nkept = 0; + if (descendancy) + for (elem = 0; elem < pidlist.count; elem++) + for (i = 0; i < nentries; i++) + if (kp[i].ki_ppid == pidlist.l.pids[elem]) { + if (pidlist.count >= pidlist.maxcount) + expand_list(&pidlist); + pidlist.l.pids[pidlist.count++] = kp[i].ki_pid; + } if (nentries > 0) { if ((kinfo = malloc(nentries * sizeof(*kinfo))) == NULL) xo_errx(1, "malloc failed"); From owner-svn-src-all@freebsd.org Thu May 14 09:18:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 838142EA592; Thu, 14 May 2020 09:18:51 +0000 (UTC) (envelope-from bcr@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 49N5ZM2vf5z45YZ; Thu, 14 May 2020 09:18:51 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 5EE4C8892; Thu, 14 May 2020 09:18:51 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E9IpCL065285; Thu, 14 May 2020 09:18:51 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E9Ip5B065283; Thu, 14 May 2020 09:18:51 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005140918.04E9Ip5B065283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Thu, 14 May 2020 09:18:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361028 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 361028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 09:18:51 -0000 Author: bcr (doc committer) Date: Thu May 14 09:18:50 2020 New Revision: 361028 URL: https://svnweb.freebsd.org/changeset/base/361028 Log: Add new stats(7) man page and hook it up to the build. This man page contains stat utilities that are available in the base system. This is a better approach than looking them up via "apropos stat" or similar commands. Thanks to Daniel Ebdrup Jensen for writing the original page and incorporating the feedback given. Submitted by: Daniel Ebdrup Jensen Reviewed by: 0mp, allanjude, brueffer, bcr Approved by: bcr MFC after: 3 days Relnotes: yes (new stats(7) man page) Differential Revision: https://reviews.freebsd.org/D24417 Added: head/share/man/man7/stats.7 (contents, props changed) Modified: head/share/man/man7/Makefile Modified: head/share/man/man7/Makefile ============================================================================== --- head/share/man/man7/Makefile Thu May 14 06:07:23 2020 (r361027) +++ head/share/man/man7/Makefile Thu May 14 09:18:50 2020 (r361028) @@ -26,6 +26,7 @@ MAN= arch.7 \ sdoc.7 \ security.7 \ sprog.7 \ + stats.7 \ stdint.7 \ sticky.7 \ tests.7 \ Added: head/share/man/man7/stats.7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man7/stats.7 Thu May 14 09:18:50 2020 (r361028) @@ -0,0 +1,120 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2020 Daniel Ebdrup Jensen +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 14, 2020 +.Dt STATS 7 +.Os +.Sh NAME +.Nm stats +.Nd information about various and sundry statistics utilities +.Sh DESCRIPTION +The +.Fx +userland in part contains a series of utilities which can be used +to ascertain system state at runtime and optionally from core files. +.Sh COMMANDS +The following commands +.Pq sorted alphabetically +are currently included in the base system, with more appearing periodically. +.Bl -tag -width "zpool iostat" +.It Nm btsockstat +Show Bluetooth socket information +.It Nm ctlstat +CAM Target Layer statistics utility +.It Nm fstat +Identify active files +.It Nm gstat +Print statistics about GEOM disks +.It Nm ibstat +Display information from the InfiniBand driver +.It Nm ifmcstat +Dump multicast group management statistics per interface +.It Nm iostat +Report kernel subsystem I/O statistics +.It Nm ipfstat +Display IPF packet filter statistics and filter list +.It Nm kldstat +Display status of dynamic kernel linker +.It Nm lockstat +Report kernel lock and profiling statistics +.It Nm mailstats +Display mail statistics +.It Nm netstat +Show network status and statistics +.It Nm nfsstat +Display NFS statistics +.It Nm plockstat +Trace pthread lock statistics using DTrace +.It Nm pmcstat +Performance measurement with performance monitoring hardware +.It Nm procstat +Get detailed process information +.It Nm pstat +Display system data structures +.It Nm sockstat +List open sockets +.It Nm stat +Display file status +.It Nm systat +Display system statistics +.It Nm vmstat +Report virtual memory statistics +.It Nm zpool iostat +Report ZFS I/O statistics +.Sh SEE ALSO +.Xr intro 1 , +.Xr intro 7 , +.Xr intro 8 , +.Xr btsockstat 1 , +.Xr ctlstat 8 , +.Xr fstat 1 , +.Xr gstat 8 , +.Xr ibstat 8 , +.Xr ifmcstat 8 , +.Xr iostat 8 , +.Xr ipfstat 8 , +.Xr kldstat 8 , +.Xr lockstat 1 , +.Xr mailstats 8 , +.Xr netstat 1 , +.Xr plockstat 1 , +.Xr pmcstat 8 , +.Xr procstat 1 , +.Xr pstat 8 , +.Xr sockstat 1, +.Xr stat 1 , +.Xr systat 1 , +.Xr vmstat 8 , +.Xr zpool-iostat 8 , +.Sh HISTORY +The +.Nm +manual page first appeared in +.Fx 13.0 . +.Sh AUTHORS +.An Daniel Ebdrup Jensen Aq Mt debdrup@FreeBSD.org From owner-svn-src-all@freebsd.org Thu May 14 09:55:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8DAE22EAE5C; Thu, 14 May 2020 09:55:41 +0000 (UTC) (envelope-from rscheff@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 49N6Ns3J1Rz47Kj; Thu, 14 May 2020 09:55:41 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6C70E902D; Thu, 14 May 2020 09:55:41 +0000 (UTC) (envelope-from rscheff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04E9tfwS089482; Thu, 14 May 2020 09:55:41 GMT (envelope-from rscheff@FreeBSD.org) Received: (from rscheff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04E9tf9Z089481; Thu, 14 May 2020 09:55:41 GMT (envelope-from rscheff@FreeBSD.org) Message-Id: <202005140955.04E9tf9Z089481@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rscheff set sender to rscheff@FreeBSD.org using -f From: Richard Scheffenegger Date: Thu, 14 May 2020 09: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: r361029 - stable/12/sys/netinet/cc X-SVN-Group: stable-12 X-SVN-Commit-Author: rscheff X-SVN-Commit-Paths: stable/12/sys/netinet/cc X-SVN-Commit-Revision: 361029 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 09:55:41 -0000 Author: rscheff Date: Thu May 14 09:55:41 2020 New Revision: 361029 URL: https://svnweb.freebsd.org/changeset/base/361029 Log: MFC r360491: Introduce a lower bound of 2 MSS to TCP Cubic. Running TCP Cubic together with ECN could end up reducing cwnd down to 1 byte, if the receiver continously sets the ECE flag, resulting in very poor transmission speeds. In line with RFC6582 App. B, a lower bound of 2 MSS is introduced, as well as a typecast to prevent any potential integer overflows during intermediate calculation steps of the adjusted cwnd. Reported by: Cheng Cui Reviewed by: tuexen (mentor) Approved by: tuexen (mentor) Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D23353 Modified: stable/12/sys/netinet/cc/cc_cubic.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netinet/cc/cc_cubic.c ============================================================================== --- stable/12/sys/netinet/cc/cc_cubic.c Thu May 14 09:18:50 2020 (r361028) +++ stable/12/sys/netinet/cc/cc_cubic.c Thu May 14 09:55:41 2020 (r361029) @@ -332,8 +332,9 @@ cubic_post_recovery(struct cc_var *ccv) CCV(ccv, t_maxseg); else /* Update cwnd based on beta and adjusted max_cwnd. */ - CCV(ccv, snd_cwnd) = max(1, ((CUBIC_BETA * - cubic_data->max_cwnd) >> CUBIC_SHIFT)); + CCV(ccv, snd_cwnd) = max(((uint64_t)cubic_data->max_cwnd * + CUBIC_BETA) >> CUBIC_SHIFT, + 2 * CCV(ccv, t_maxseg)); } cubic_data->t_last_cong = ticks; @@ -399,6 +400,7 @@ static void cubic_ssthresh_update(struct cc_var *ccv) { struct cubic *cubic_data; + uint32_t ssthresh; cubic_data = ccv->cc_data; @@ -407,10 +409,11 @@ cubic_ssthresh_update(struct cc_var *ccv) * subsequent congestion events, set it to cwnd * beta. */ if (cubic_data->num_cong_events == 0) - CCV(ccv, snd_ssthresh) = CCV(ccv, snd_cwnd) >> 1; + ssthresh = CCV(ccv, snd_cwnd) >> 1; else - CCV(ccv, snd_ssthresh) = ((u_long)CCV(ccv, snd_cwnd) * + ssthresh = ((uint64_t)CCV(ccv, snd_cwnd) * CUBIC_BETA) >> CUBIC_SHIFT; + CCV(ccv, snd_ssthresh) = max(ssthresh, 2 * CCV(ccv, t_maxseg)); } From owner-svn-src-all@freebsd.org Thu May 14 12:52:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 496FC2F1720; Thu, 14 May 2020 12:52:10 +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 49NBJV1HmTz4JHJ; Thu, 14 May 2020 12:52:10 +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 2780AB27F; Thu, 14 May 2020 12:52:10 +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 04ECqAXg098318; Thu, 14 May 2020 12:52:10 GMT (envelope-from dab@FreeBSD.org) Received: (from dab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ECq8Sd098310; Thu, 14 May 2020 12:52:08 GMT (envelope-from dab@FreeBSD.org) Message-Id: <202005141252.04ECq8Sd098310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dab set sender to dab@FreeBSD.org using -f From: David Bright Date: Thu, 14 May 2020 12:52:08 +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: r361030 - stable/12/sys/dev/nvme X-SVN-Group: stable-12 X-SVN-Commit-Author: dab X-SVN-Commit-Paths: stable/12/sys/dev/nvme X-SVN-Commit-Revision: 361030 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 12:52:10 -0000 Author: dab Date: Thu May 14 12:52:08 2020 New Revision: 361030 URL: https://svnweb.freebsd.org/changeset/base/361030 Log: MFC r360568: Fix various Coverity-detected errors in nvme driver This fixes several Coverity-detected errors in the nvme driver. CIDs addressed: 1008344, 1009377, 1009380, 1193740, 1305470, 1403975, 1403980 Sponsored by: Dell EMC Isilon Modified: stable/12/sys/dev/nvme/nvme.c stable/12/sys/dev/nvme/nvme_ctrlr.c stable/12/sys/dev/nvme/nvme_ns.c stable/12/sys/dev/nvme/nvme_pci.c stable/12/sys/dev/nvme/nvme_qpair.c stable/12/sys/dev/nvme/nvme_sysctl.c stable/12/sys/dev/nvme/nvme_test.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/nvme/nvme.c ============================================================================== --- stable/12/sys/dev/nvme/nvme.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme.c Thu May 14 12:52:08 2020 (r361030) @@ -138,7 +138,8 @@ nvme_attach(device_t dev) ctrlr->config_hook.ich_func = nvme_ctrlr_start_config_hook; ctrlr->config_hook.ich_arg = ctrlr; - config_intrhook_establish(&ctrlr->config_hook); + if (config_intrhook_establish(&ctrlr->config_hook) != 0) + return (ENOMEM); return (0); } Modified: stable/12/sys/dev/nvme/nvme_ctrlr.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ctrlr.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_ctrlr.c Thu May 14 12:52:08 2020 (r361030) @@ -1299,6 +1299,7 @@ nvme_ctrlr_ioctl(struct cdev *cdev, u_long cmd, caddr_ struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg; strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), sizeof(gnsid->cdev)); + gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = 0; break; } @@ -1583,12 +1584,12 @@ nvme_ctrlr_resume(struct nvme_controller *ctrlr) goto fail; /* - * Now that we're reset the hardware, we can restart the controller. Any + * Now that we've reset the hardware, we can restart the controller. Any * I/O that was pending is requeued. Any admin commands are aborted with * an error. Once we've restarted, take the controller out of reset. */ nvme_ctrlr_start(ctrlr, true); - atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); + (void)atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); return (0); fail: @@ -1599,6 +1600,6 @@ fail: */ nvme_printf(ctrlr, "Failed to reset on resume, failing.\n"); nvme_ctrlr_fail(ctrlr); - atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); + (void)atomic_cmpset_32(&ctrlr->is_resetting, 1, 0); return (0); } Modified: stable/12/sys/dev/nvme/nvme_ns.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_ns.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_ns.c Thu May 14 12:52:08 2020 (r361030) @@ -87,6 +87,7 @@ nvme_ns_ioctl(struct cdev *cdev, u_long cmd, caddr_t a struct nvme_get_nsid *gnsid = (struct nvme_get_nsid *)arg; strncpy(gnsid->cdev, device_get_nameunit(ctrlr->dev), sizeof(gnsid->cdev)); + gnsid->cdev[sizeof(gnsid->cdev) - 1] = '\0'; gnsid->nsid = ns->id; break; } Modified: stable/12/sys/dev/nvme/nvme_pci.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_pci.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_pci.c Thu May 14 12:52:08 2020 (r361030) @@ -243,11 +243,9 @@ nvme_ctrlr_configure_intx(struct nvme_controller *ctrl return (ENOMEM); } - bus_setup_intr(ctrlr->dev, ctrlr->res, + if (bus_setup_intr(ctrlr->dev, ctrlr->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, nvme_ctrlr_intx_handler, - ctrlr, &ctrlr->tag); - - if (ctrlr->tag == NULL) { + ctrlr, &ctrlr->tag) != 0) { nvme_printf(ctrlr, "unable to setup intx handler\n"); return (ENOMEM); } Modified: stable/12/sys/dev/nvme/nvme_qpair.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_qpair.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_qpair.c Thu May 14 12:52:08 2020 (r361030) @@ -671,9 +671,12 @@ nvme_qpair_construct(struct nvme_qpair *qpair, qpair->res = bus_alloc_resource_any(ctrlr->dev, SYS_RES_IRQ, &qpair->rid, RF_ACTIVE); - bus_setup_intr(ctrlr->dev, qpair->res, + if (bus_setup_intr(ctrlr->dev, qpair->res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, - nvme_qpair_msix_handler, qpair, &qpair->tag); + nvme_qpair_msix_handler, qpair, &qpair->tag) != 0) { + nvme_printf(ctrlr, "unable to setup intx handler\n"); + goto out; + } if (qpair->id == 0) { bus_describe_intr(ctrlr->dev, qpair->res, qpair->tag, "admin"); Modified: stable/12/sys/dev/nvme/nvme_sysctl.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_sysctl.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_sysctl.c Thu May 14 12:52:08 2020 (r361030) @@ -145,16 +145,17 @@ static int nvme_sysctl_timeout_period(SYSCTL_HANDLER_ARGS) { struct nvme_controller *ctrlr = arg1; - uint32_t oldval = ctrlr->timeout_period; - int error = sysctl_handle_int(oidp, &ctrlr->timeout_period, 0, req); + uint32_t newval = ctrlr->timeout_period; + int error = sysctl_handle_int(oidp, &newval, 0, req); - if (error) + if (error || (req->newptr == NULL)) return (error); - if (ctrlr->timeout_period > NVME_MAX_TIMEOUT_PERIOD || - ctrlr->timeout_period < NVME_MIN_TIMEOUT_PERIOD) { - ctrlr->timeout_period = oldval; + if (newval > NVME_MAX_TIMEOUT_PERIOD || + newval < NVME_MIN_TIMEOUT_PERIOD) { return (EINVAL); + } else { + ctrlr->timeout_period = newval; } return (0); Modified: stable/12/sys/dev/nvme/nvme_test.c ============================================================================== --- stable/12/sys/dev/nvme/nvme_test.c Thu May 14 09:55:41 2020 (r361029) +++ stable/12/sys/dev/nvme/nvme_test.c Thu May 14 12:52:08 2020 (r361030) @@ -100,7 +100,7 @@ nvme_ns_bio_test(void *arg) idx = atomic_fetchadd_int(&io_test->td_idx, 1); dev = io_test->ns->cdev; - offset = idx * 2048 * nvme_ns_get_sector_size(io_test->ns); + offset = idx * 2048ULL * nvme_ns_get_sector_size(io_test->ns); while (1) { @@ -120,6 +120,8 @@ nvme_ns_bio_test(void *arg) } else csw = dev->si_devsw; + if (csw == NULL) + panic("Unable to retrieve device switch"); mtx = mtx_pool_find(mtxpool_sleep, bio); mtx_lock(mtx); (*csw->d_strategy)(bio); From owner-svn-src-all@freebsd.org Thu May 14 15:49:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A512F530D; Thu, 14 May 2020 15:49: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 49NGFF6vtzz4Tbs; Thu, 14 May 2020 15:49:37 +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 E84ECD614; Thu, 14 May 2020 15:49:37 +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 04EFnbQb005366; Thu, 14 May 2020 15:49:37 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EFnb1b005365; Thu, 14 May 2020 15:49:37 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141549.04EFnb1b005365@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 15:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361031 - head/sys/amd64/amd64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/amd64/amd64 X-SVN-Commit-Revision: 361031 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 15:49:38 -0000 Author: markj Date: Thu May 14 15:49:37 2020 New Revision: 361031 URL: https://svnweb.freebsd.org/changeset/base/361031 Log: Assert that page table traversal functions don't operate on superpages. Reviewed by: kib MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24828 Modified: head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu May 14 12:52:08 2020 (r361030) +++ head/sys/amd64/amd64/pmap.c Thu May 14 15:49:37 2020 (r361031) @@ -1317,6 +1317,8 @@ pmap_pdpe_to_pde(pdp_entry_t *pdpe, vm_offset_t va) { pd_entry_t *pde; + KASSERT((*pdpe & PG_PS) == 0, + ("%s: pdpe %#lx is a leaf", __func__, *pdpe)); pde = (pd_entry_t *)PHYS_TO_DMAP(*pdpe & PG_FRAME); return (&pde[pmap_pde_index(va)]); } @@ -1341,6 +1343,8 @@ pmap_pde_to_pte(pd_entry_t *pde, vm_offset_t va) { pt_entry_t *pte; + KASSERT((*pde & PG_PS) == 0, + ("%s: pde %#lx is a leaf", __func__, *pde)); pte = (pt_entry_t *)PHYS_TO_DMAP(*pde & PG_FRAME); return (&pte[pmap_pte_index(va)]); } From owner-svn-src-all@freebsd.org Thu May 14 16:06:54 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C5E5D2F5C0E; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NGdB4ssVz4VgW; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B52D9D5; Thu, 14 May 2020 16:06:54 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EG6s5P017231; Thu, 14 May 2020 16:06:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EG6sMi017229; Thu, 14 May 2020 16:06:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141606.04EG6sMi017229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 16:06:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361032 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 361032 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 16:06:54 -0000 Author: markj Date: Thu May 14 16:06:54 2020 New Revision: 361032 URL: https://svnweb.freebsd.org/changeset/base/361032 Log: Allocate UMA per-CPU counters earlier. Otherwise anything counted before SI_SUB_VM_CONF is discarded. However, it is useful to be able to see stats from allocations done early during boot. Reviewed by: kib Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24756 Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu May 14 15:49:37 2020 (r361031) +++ head/sys/vm/uma_core.c Thu May 14 16:06:54 2020 (r361032) @@ -192,6 +192,7 @@ SYSCTL_ULONG(_vm, OID_AUTO, uma_kmem_total, CTLFLAG_RD static enum { BOOT_COLD, BOOT_KVA, + BOOT_PCPU, BOOT_RUNNING, BOOT_SHUTDOWN, } booted = BOOT_COLD; @@ -304,7 +305,6 @@ static int hash_alloc(struct uma_hash *, u_int); static int hash_expand(struct uma_hash *, struct uma_hash *); static void hash_free(struct uma_hash *hash); static void uma_timeout(void *); -static void uma_startup3(void); static void uma_shutdown(void); static void *zone_alloc_item(uma_zone_t, void *, int, int); static void zone_free_item(uma_zone_t, void *, void *, enum zfreeskip); @@ -360,8 +360,6 @@ SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFL &uma_skip_cnt, "memory items skipped, not debugged"); #endif -SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); - SYSCTL_NODE(_vm, OID_AUTO, uma, CTLFLAG_RW | CTLFLAG_MPSAFE, 0, "Universal Memory Allocator"); @@ -2658,9 +2656,10 @@ zone_ctor(void *mem, int size, void *udata, int flags) (UMA_ZONE_INHERIT | UMA_ZFLAG_INHERIT)); out: - if (__predict_true(booted >= BOOT_RUNNING)) { + if (booted >= BOOT_PCPU) { zone_alloc_counters(zone, NULL); - zone_alloc_sysctl(zone, NULL); + if (booted >= BOOT_RUNNING) + zone_alloc_sysctl(zone, NULL); } else { zone->uz_allocs = EARLY_COUNTER; zone->uz_frees = EARLY_COUNTER; @@ -2904,10 +2903,23 @@ uma_startup2(void) } /* + * Allocate counters as early as possible so that boot-time allocations are + * accounted more precisely. + */ +static void +uma_startup_pcpu(void *arg __unused) +{ + + zone_foreach_unlocked(zone_alloc_counters, NULL); + booted = BOOT_PCPU; +} +SYSINIT(uma_startup_pcpu, SI_SUB_COUNTER, SI_ORDER_ANY, uma_startup_pcpu, NULL); + +/* * Finish our initialization steps. */ static void -uma_startup3(void) +uma_startup3(void *arg __unused) { #ifdef INVARIANTS @@ -2915,7 +2927,6 @@ uma_startup3(void) uma_dbg_cnt = counter_u64_alloc(M_WAITOK); uma_skip_cnt = counter_u64_alloc(M_WAITOK); #endif - zone_foreach_unlocked(zone_alloc_counters, NULL); zone_foreach_unlocked(zone_alloc_sysctl, NULL); callout_init(&uma_callout, 1); callout_reset(&uma_callout, UMA_TIMEOUT * hz, uma_timeout, NULL); @@ -2924,6 +2935,7 @@ uma_startup3(void) EVENTHANDLER_REGISTER(shutdown_post_sync, uma_shutdown, NULL, EVENTHANDLER_PRI_FIRST); } +SYSINIT(uma_startup3, SI_SUB_VM_CONF, SI_ORDER_SECOND, uma_startup3, NULL); static void uma_shutdown(void) From owner-svn-src-all@freebsd.org Thu May 14 16:07:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C12762F5C70; Thu, 14 May 2020 16:07:28 +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 49NGdr4jMCz4VpK; Thu, 14 May 2020 16:07:28 +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 9C57CD9DA; Thu, 14 May 2020 16:07:28 +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 04EG7Sme017312; Thu, 14 May 2020 16:07:28 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EG7RnJ017305; Thu, 14 May 2020 16:07:27 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141607.04EG7RnJ017305@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 16:07:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361033 - in head/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 dev/acpica i386/i386 x86/acpica X-SVN-Commit-Revision: 361033 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 16:07:28 -0000 Author: markj Date: Thu May 14 16:07:27 2020 New Revision: 361033 URL: https://svnweb.freebsd.org/changeset/base/361033 Log: Call acpi_pxm_set_proximity_info() slightly earlier on x86. This function is responsible for setting pc_domain in each pcpu structure. Call it from the main function that starts APs, rather than a separate SYSINIT. This makes it easier to close the window where UMA's per-CPU slab allocator may be called while pc_domain is uninitialized. In particular, the allocator uses pc_domain to allocate domain-local pages, so allocations before this point end up using domain 0 for everything. Reviewed by: kib MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24757 Modified: head/sys/amd64/amd64/mp_machdep.c head/sys/arm64/arm64/mp_machdep.c head/sys/dev/acpica/acpi_pxm.c head/sys/dev/acpica/acpivar.h head/sys/i386/i386/mp_machdep.c head/sys/x86/acpica/srat.c Modified: head/sys/amd64/amd64/mp_machdep.c ============================================================================== --- head/sys/amd64/amd64/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/amd64/amd64/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -264,8 +264,9 @@ cpu_mp_start(void) init_ops.start_all_aps(); set_interrupt_apic_ids(); -} + acpi_pxm_set_cpu_locality(); +} /* * AP CPU's call this to initialize themselves. Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/arm64/arm64/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -535,9 +535,7 @@ cpu_init_acpi(void) acpi_unmap_table(madt); #if MAXMEMDOM > 1 - /* set proximity info */ acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); #endif } #endif Modified: head/sys/dev/acpica/acpi_pxm.c ============================================================================== --- head/sys/dev/acpica/acpi_pxm.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/dev/acpica/acpi_pxm.c Thu May 14 16:07:27 2020 (r361033) @@ -628,7 +628,8 @@ srat_walk_table(acpi_subtable_handler *handler, void * } /* - * Setup per-CPU domain IDs from information saved in 'cpus'. + * Set up per-CPU domain IDs from information saved in 'cpus' and tear down data + * structures allocated by acpi_pxm_init(). */ void acpi_pxm_set_cpu_locality(void) @@ -651,6 +652,10 @@ acpi_pxm_set_cpu_locality(void) printf("SRAT: CPU %u has memory domain %d\n", i, pc->pc_domain); } + /* XXXMJ the page is leaked. */ + pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); + srat_physaddr = 0; + cpus = NULL; } int @@ -662,20 +667,6 @@ acpi_pxm_get_cpu_locality(int apic_id) if (cpu == NULL) panic("SRAT: CPU with ID %u is not known", apic_id); return (cpu->domain); -} - -/* - * Free data structures allocated during acpi_pxm_init. - */ -void -acpi_pxm_free(void) -{ - - if (srat_physaddr == 0) - return; - pmap_unmapbios((vm_offset_t)cpus, sizeof(*cpus) * max_cpus); - srat_physaddr = 0; - cpus = NULL; } /* Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Thu May 14 16:06:54 2020 (r361032) +++ head/sys/dev/acpica/acpivar.h Thu May 14 16:07:27 2020 (r361033) @@ -540,7 +540,6 @@ void acpi_pxm_parse_tables(void); void acpi_pxm_set_mem_locality(void); void acpi_pxm_set_cpu_locality(void); int acpi_pxm_get_cpu_locality(int apic_id); -void acpi_pxm_free(void); /* * Map a PXM to a VM domain. Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/i386/i386/mp_machdep.c Thu May 14 16:07:27 2020 (r361033) @@ -198,6 +198,8 @@ cpu_mp_start(void) start_all_aps(); set_interrupt_apic_ids(); + + acpi_pxm_set_cpu_locality(); } /* Modified: head/sys/x86/acpica/srat.c ============================================================================== --- head/sys/x86/acpica/srat.c Thu May 14 16:06:54 2020 (r361032) +++ head/sys/x86/acpica/srat.c Thu May 14 16:07:27 2020 (r361033) @@ -56,13 +56,4 @@ parse_acpi_tables(void *dummy) SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables, NULL); -static void -srat_set_cpus(void *dummy) -{ - - acpi_pxm_set_cpu_locality(); - acpi_pxm_free(); -} -SYSINIT(srat_set_cpus, SI_SUB_CPU, SI_ORDER_ANY, srat_set_cpus, NULL); - #endif /* MAXMEMDOM > 1 */ From owner-svn-src-all@freebsd.org Thu May 14 17:19:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 24C2A2F73C8; Thu, 14 May 2020 17:19:08 +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 49NJDX08x1z4ZKv; Thu, 14 May 2020 17:19:08 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 009AFE76E; Thu, 14 May 2020 17:19:08 +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 04EHJ7cq060766; Thu, 14 May 2020 17:19:07 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHJ7JF060765; Thu, 14 May 2020 17:19:07 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005141719.04EHJ7JF060765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 14 May 2020 17:19:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361034 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361034 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:19:08 -0000 Author: emaste Date: Thu May 14 17:19:07 2020 New Revision: 361034 URL: https://svnweb.freebsd.org/changeset/base/361034 Log: ObsoleteFiles.inc: use date (not xxxx) for ubsec removal Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Thu May 14 16:07:27 2020 (r361033) +++ head/ObsoleteFiles.inc Thu May 14 17:19:07 2020 (r361034) @@ -36,7 +36,7 @@ # xargs -n1 | sort | uniq -d; # done -# 2020xxxx: Remove ubsec(4) +# 20200511: Remove ubsec(4) OLD_FILES+=usr/share/man/man4/ubsec.4.gz # 20200506: GNU objdump 2.17.50 retired From owner-svn-src-all@freebsd.org Thu May 14 17:47:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807492F7C8B; Thu, 14 May 2020 17:47:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJsm2sScz4bpS; Thu, 14 May 2020 17:47:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5CAADED47; Thu, 14 May 2020 17:47:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EHlujG078767; Thu, 14 May 2020 17:47:56 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHltN1078763; Thu, 14 May 2020 17:47:55 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141747.04EHltN1078763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 17:47:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361035 - in releng/11.4: lib/libsysdecode sys/fs/procfs sys/sys usr.sbin/procctl X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in releng/11.4: lib/libsysdecode sys/fs/procfs sys/sys usr.sbin/procctl X-SVN-Commit-Revision: 361035 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:47:56 -0000 Author: jhb Date: Thu May 14 17:47:55 2020 New Revision: 361035 URL: https://svnweb.freebsd.org/changeset/base/361035 Log: MF11 361020: Deprecate procfs-based process debugging. 359047: Mark procfs-based process debugging as deprecated for FreeBSD 13. Attempting to use ioctls on /proc//mem to control a process will trigger warnings on the console. The include file will also now emit a compile-time warning when used from userland. 359054: Fix the workaround to ignore the #warning for GCC. clang and gcc use different warning flags for #warning preprocessor directives. For both 12 and 11, adjust the GCC warning flags to only be added in 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the needed warning suppression to procctl's build. procctl was removed in 12.0. Approved by: re (gjb, kib) Modified: releng/11.4/lib/libsysdecode/Makefile releng/11.4/sys/fs/procfs/procfs_ioctl.c releng/11.4/sys/sys/pioctl.h releng/11.4/usr.sbin/procctl/Makefile Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/lib/libsysdecode/Makefile ============================================================================== --- releng/11.4/lib/libsysdecode/Makefile Thu May 14 17:19:07 2020 (r361034) +++ releng/11.4/lib/libsysdecode/Makefile Thu May 14 17:47:55 2020 (r361035) @@ -123,6 +123,13 @@ CFLAGS.gcc.ioctl.c+= -Wno-redundant-decls # Workaround warning for unused ssi_cables[] in CFLAGS.gcc.ioctl.c+= -Wno-unused +# Ignore deprecation warning in +CFLAGS.clang.ioctl.c+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc.ioctl.c+= -Wno-cpp +.endif + +CFLAGS.clang+= ${CFLAGS.clang.${.IMPSRC}} CFLAGS.gcc+= ${CFLAGS.gcc.${.IMPSRC}} DEPENDOBJS+= tables.h Modified: releng/11.4/sys/fs/procfs/procfs_ioctl.c ============================================================================== --- releng/11.4/sys/fs/procfs/procfs_ioctl.c Thu May 14 17:19:07 2020 (r361034) +++ releng/11.4/sys/fs/procfs/procfs_ioctl.c Thu May 14 17:47:55 2020 (r361035) @@ -69,10 +69,53 @@ procfs_ioctl(PFS_IOCTL_ARGS) #ifdef COMPAT_FREEBSD6 int ival; #endif + static struct timeval lasttime; + static struct timeval interval = { .tv_sec = 1, .tv_usec = 0 }; KASSERT(p != NULL, ("%s() called without a process", __func__)); PROC_LOCK_ASSERT(p, MA_OWNED); + + switch (cmd) { +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 1, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 1): +#endif + case PIOCBIS: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 2, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 2): +#endif + case PIOCBIC: +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 3, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 3): +#endif + case PIOCSFL: + case PIOCGFL: + case PIOCWAIT: + case PIOCSTATUS: +#ifdef COMPAT_FREEBSD32 + case PIOCWAIT32: + case PIOCSTATUS32: +#endif +#if defined(COMPAT_FREEBSD5) || defined(COMPAT_FREEBSD4) || defined(COMPAT_43) + case _IOC(IOC_IN, 'p', 5, 0): +#endif +#ifdef COMPAT_FREEBSD6 + case _IO('p', 5): +#endif + case PIOCCONT: + if (ratecheck(&lasttime, &interval) != 0) + gone_in(13, "procfs-based process debugging"); + break; + } error = 0; switch (cmd) { Modified: releng/11.4/sys/sys/pioctl.h ============================================================================== --- releng/11.4/sys/sys/pioctl.h Thu May 14 17:19:07 2020 (r361034) +++ releng/11.4/sys/sys/pioctl.h Thu May 14 17:47:55 2020 (r361035) @@ -39,6 +39,10 @@ #ifndef _SYS_PIOCTL_H # define _SYS_PIOCTL_H +#ifndef _KERNEL +#warning " is deprecated, ptrace() should be used instead" +#endif + # include struct procfs_status { Modified: releng/11.4/usr.sbin/procctl/Makefile ============================================================================== --- releng/11.4/usr.sbin/procctl/Makefile Thu May 14 17:19:07 2020 (r361034) +++ releng/11.4/usr.sbin/procctl/Makefile Thu May 14 17:47:55 2020 (r361035) @@ -1,6 +1,14 @@ # $FreeBSD$ +.include + PROG= procctl MAN= procctl.8 + +# Ignore deprecation warning in +CFLAGS.clang+= -Wno-\#warnings +.if ${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 40700 +CFLAGS.gcc+= -Wno-cpp +.endif .include From owner-svn-src-all@freebsd.org Thu May 14 17:49:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E05192F7D4D; Thu, 14 May 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJv75cNjz4c1p; Thu, 14 May 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:59ea:1632:b928:42c4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4D548FF01; Thu, 14 May 2020 17:49:07 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361034 - head To: Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005141719.04EHJ7JF060765@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> Date: Thu, 14 May 2020 10:49:05 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <202005141719.04EHJ7JF060765@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:49:07 -0000 On 5/14/20 10:19 AM, Ed Maste wrote: > Author: emaste > Date: Thu May 14 17:19:07 2020 > New Revision: 361034 > URL: https://svnweb.freebsd.org/changeset/base/361034 > > Log: > ObsoleteFiles.inc: use date (not xxxx) for ubsec removal > > Modified: > head/ObsoleteFiles.inc Oops, sorry. I meant to fix that up before commit. :-/ (I use xxxx as the date while it is in the branch) -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 14 17:52:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 807B12F7FE1; Thu, 14 May 2020 17:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NJz22p3Nz4cZ4; Thu, 14 May 2020 17:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B211EF6B; Thu, 14 May 2020 17:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EHqU9Q084822; Thu, 14 May 2020 17:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHqUVB084821; Thu, 14 May 2020 17:52:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005141752.04EHqUVB084821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 17:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361036 - head/usr.sbin/inetd X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.sbin/inetd X-SVN-Commit-Revision: 361036 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:52:30 -0000 Author: kevans Date: Thu May 14 17:52:29 2020 New Revision: 361036 URL: https://svnweb.freebsd.org/changeset/base/361036 Log: inetd(8): Add comments to all examples Submitted by: debdrup (with some minor changes by kevans) Reviewed by: bcr (manpages) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24818 Modified: head/usr.sbin/inetd/inetd.8 Modified: head/usr.sbin/inetd/inetd.8 ============================================================================== --- head/usr.sbin/inetd/inetd.8 Thu May 14 17:47:55 2020 (r361035) +++ head/usr.sbin/inetd/inetd.8 Thu May 14 17:52:29 2020 (r361036) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd May 12, 2020 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,16 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/date date + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd + # Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 -/var/run/echo stream unix nowait root internal + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ From owner-svn-src-all@freebsd.org Thu May 14 17:54:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 37E662D8C4C; Thu, 14 May 2020 17:54:09 +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 49NK0x0pJsz4ctW; Thu, 14 May 2020 17:54:09 +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 16928EF8C; Thu, 14 May 2020 17:54:09 +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 04EHs8bv085120; Thu, 14 May 2020 17:54:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHs842085119; Thu, 14 May 2020 17:54:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005141754.04EHs842085119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 17:54:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361037 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361037 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:54:09 -0000 Author: kib Date: Thu May 14 17:54:08 2020 New Revision: 361037 URL: https://svnweb.freebsd.org/changeset/base/361037 Log: Fix spurious ENOTCONN from closed unix domain socket other' side. Sometimes, when doing read(2) over unix domain socket, for which the other side socket was closed, read(2) returns -1/ENOTCONN instead of EOF AKA zero-size read. This is because soreceive_generic() does not lock socket when testing the so_state SS_ISCONNECTED|SS_ISCONNECTING flags. It could end up that we do not observe so->so_rcv.sb_state bit SBS_CANTRCVMORE, and then miss SS_ flags. Change the test to check that the socket was never connected before returning ENOTCONN, by adding all state bits for connected. Reported and tested by: pho In collaboration with: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24819 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 14 17:52:29 2020 (r361036) +++ head/sys/kern/uipc_socket.c Thu May 14 17:54:08 2020 (r361037) @@ -1969,8 +1969,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; From owner-svn-src-all@freebsd.org Thu May 14 17:56:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B57E42D9189; Thu, 14 May 2020 17:56:07 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (hz.grosbein.net [IPv6:2a01:4f8:c2c:26d8::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hz.grosbein.net", Issuer "hz.grosbein.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NK3B3C5qz4d3L; Thu, 14 May 2020 17:56:06 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (eg.sd.rdtc.ru [IPv6:2a03:3100:c:13:0:0:0:5]) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id 04EHtrut082145 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 May 2020 17:55:53 GMT (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: jhb@FreeBSD.org Received: from [10.58.0.10] (dadv@dadvw [10.58.0.10]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id 04EHtopu033829 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Fri, 15 May 2020 00:55:50 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r361035 - in releng/11.4: lib/libsysdecode sys/fs/procfs sys/sys usr.sbin/procctl To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org References: <202005141747.04EHltN1078763@repo.freebsd.org> From: Eugene Grosbein Message-ID: Date: Fri, 15 May 2020 00:55:47 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <202005141747.04EHltN1078763@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_00,LOCAL_FROM, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-Report: * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record * -0.0 SPF_PASS SPF: sender matches SPF record * 2.6 LOCAL_FROM From my domains X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on hz.grosbein.net X-Rspamd-Queue-Id: 49NK3B3C5qz4d3L X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=permerror (mx1.freebsd.org: domain of eugen@grosbein.net uses mechanism not recognized by this client) smtp.mailfrom=eugen@grosbein.net X-Spamd-Result: default: False [-3.99 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[grosbein.net]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.89)[ip: (-5.31), ipnet: 2a01:4f8::/29(-2.66), asn: 24940(-1.48), country: DE(-0.02)]; R_SPF_PERMFAIL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:24940, ipnet:2a01:4f8::/29, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:56:07 -0000 15.05.2020 0:47, John Baldwin wrote: > Author: jhb > Date: Thu May 14 17:47:55 2020 > New Revision: 361035 > URL: https://svnweb.freebsd.org/changeset/base/361035 > > Log: > MF11 361020: Deprecate procfs-based process debugging. > > 359047: > Mark procfs-based process debugging as deprecated for FreeBSD 13. > > Attempting to use ioctls on /proc//mem to control a process will > trigger warnings on the console. The include file will > also now emit a compile-time warning when used from userland. > > 359054: > Fix the workaround to ignore the #warning for GCC. > > clang and gcc use different warning flags for #warning preprocessor > directives. > > For both 12 and 11, adjust the GCC warning flags to only be added in > 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the > needed warning suppression to procctl's build. procctl was removed in > 12.0. > > Approved by: re (gjb, kib) Please consider adding a sysctl or another way to disable such extra warnings for jailed process, so it would be possible running old versions of FreeBSD in a jail seamless. From owner-svn-src-all@freebsd.org Thu May 14 17:56:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 393C92D91EE; Thu, 14 May 2020 17:56: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 49NK3x0pBnz4d94; Thu, 14 May 2020 17:56: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 15662EF90; Thu, 14 May 2020 17:56: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 04EHuiWi085353; Thu, 14 May 2020 17:56:44 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHui2j085352; Thu, 14 May 2020 17:56:44 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005141756.04EHui2j085352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 14 May 2020 17:56:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361039 - head/sys/i386/i386 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: head/sys/i386/i386 X-SVN-Commit-Revision: 361039 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:56:45 -0000 Author: markj Date: Thu May 14 17:56:44 2020 New Revision: 361039 URL: https://svnweb.freebsd.org/changeset/base/361039 Log: Fix the i386 build after r361033. Reported by: Jenkins Modified: head/sys/i386/i386/mp_machdep.c Modified: head/sys/i386/i386/mp_machdep.c ============================================================================== --- head/sys/i386/i386/mp_machdep.c Thu May 14 17:56:43 2020 (r361038) +++ head/sys/i386/i386/mp_machdep.c Thu May 14 17:56:44 2020 (r361039) @@ -83,6 +83,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include + #define WARMBOOT_TARGET 0 #define WARMBOOT_OFF (PMAP_MAP_LOW + 0x0467) #define WARMBOOT_SEG (PMAP_MAP_LOW + 0x0469) @@ -199,7 +202,9 @@ cpu_mp_start(void) set_interrupt_apic_ids(); +#if MAXMEMDOM > 1 acpi_pxm_set_cpu_locality(); +#endif } /* From owner-svn-src-all@freebsd.org Thu May 14 17:56:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1337D2D91EA; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NK3w6p9Gz4d93; Thu, 14 May 2020 17:56:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E466FEF8F; Thu, 14 May 2020 17:56:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EHuiTN085347; Thu, 14 May 2020 17:56:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHuiMe085309; Thu, 14 May 2020 17:56:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141756.04EHuiMe085309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 17:56: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: r361038 - in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Commit-Revision: 361038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:56:45 -0000 Author: jhb Date: Thu May 14 17:56:43 2020 New Revision: 361038 URL: https://svnweb.freebsd.org/changeset/base/361038 Log: MFC 360171,360179,360285,360388: Don't dereference various user pointers. 360171: Don't access a user buffer directly from the kernel. The handle_string callback for the ENCIOC_SETSTRING ioctl was passing a user pointer to memcpy(). Fix by using copyin() instead. For ENCIOC_GETSTRING ioctls, the handler was storing the user pointer in a CCB's data_ptr field where it was indirected by other code. Fix this by allocating a temporary buffer (which ENCIOC_SETSTRING already did) and copying the result out to the user buffer after the CCB has been processed. 360179: Don't pass a user buffer pointer as the data pointer in a CCB. Allocate a temporary buffer in the kernel to serve as the CCB data pointer for a pass-through transaction and use copyin/copyout to shuffle the data to/from the user buffer. 360285: Don't indirect user pointers directly in two 802.11s ioctls. IEEE80211_MESH_RTCMD_ADD was invoking memcmp() to validate the supplied address directly on the user pointer rather than first doing a copyin() and validating the copied value. IEEE80211_MESH_RTCMD_DELETE was passing the user pointer directly to ieee80211_mesh_rt_del() rather than copying the user buffer into a temporary kernel buffer. 360388: Don't run strcmp() against strings stored in user memory. Instead, copy the strings into a temporary buffer on the stack and run strcmp on the copies. Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c stable/12/sys/cam/scsi/scsi_sg.c stable/12/sys/dev/iscsi_initiator/isc_subr.c stable/12/sys/net80211/ieee80211_mesh.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c stable/11/sys/cam/scsi/scsi_sg.c stable/11/sys/dev/iscsi_initiator/isc_subr.c stable/11/sys/net80211/ieee80211_mesh.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:54:08 2020 (r361037) +++ stable/12/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:43 2020 (r361038) @@ -2904,13 +2904,19 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s buf[1] = 0; buf[2] = sstr->bufsiz >> 8; buf[3] = sstr->bufsiz & 0xff; - memcpy(&buf[4], sstr->buf, sstr->bufsiz); + ret = copyin(sstr->buf, &buf[4], sstr->bufsiz); + if (ret != 0) { + ENC_FREE(buf); + return (ret); + } break; case ENCIOC_GETSTRING: payload = sstr->bufsiz; amt = payload; + buf = ENC_MALLOC(payload); + if (buf == NULL) + return (ENOMEM); ses_page_cdb(cdb, payload, SesStringIn, CAM_DIR_IN); - buf = sstr->buf; break; case ENCIOC_GETENCNAME: if (ses_cache->ses_nsubencs < 1) @@ -2950,6 +2956,8 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s return (EINVAL); } ret = enc_runcmd(enc, cdb, 6, buf, &amt); + if (ret == 0 && ioc == ENCIOC_GETSTRING) + ret = copyout(buf, sstr->buf, sstr->bufsiz); if (ioc == ENCIOC_SETSTRING) ENC_FREE(buf); return (ret); Modified: stable/12/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_sg.c Thu May 14 17:54:08 2020 (r361037) +++ stable/12/sys/cam/scsi/scsi_sg.c Thu May 14 17:56:43 2020 (r361038) @@ -508,6 +508,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; + void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -552,12 +553,20 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (req->dxfer_len > MAXPHYS) { + error = EINVAL; + break; + } + + data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -570,7 +579,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int dir = CAM_DIR_IN; break; case SG_DXFER_TO_FROM_DEV: - dir = CAM_DIR_IN | CAM_DIR_OUT; + dir = CAM_DIR_BOTH; break; case SG_DXFER_NONE: default: @@ -578,12 +587,21 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { + error = copyin(req->dxferp, data_ptr, req->dxfer_len); + if (error) { + free(data_ptr, M_DEVBUF); + xpt_release_ccb(ccb); + break; + } + } + cam_fill_csio(csio, /*retries*/1, /*cbfcnp*/NULL, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req->dxferp, + data_ptr, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -593,6 +611,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -611,6 +630,10 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } + if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) + error = copyout(data_ptr, req->dxferp, req->dxfer_len); + + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; Modified: stable/12/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- stable/12/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:54:08 2020 (r361037) +++ stable/12/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:56:43 2020 (r361038) @@ -194,6 +194,9 @@ i_crc32c(const void *buf, size_t size, uint32_t crc) int i_setopt(isc_session_t *sp, isc_opt_t *opt) { + char buf[16]; + int error; + if(opt->maxRecvDataSegmentLength > 0) { sp->opt.maxRecvDataSegmentLength = opt->maxRecvDataSegmentLength; sdebug(2, "maxRecvDataSegmentLength=%d", sp->opt.maxRecvDataSegmentLength); @@ -235,15 +238,21 @@ i_setopt(isc_session_t *sp, isc_opt_t *opt) } if(opt->headerDigest != NULL) { - sdebug(2, "opt.headerDigest='%s'", opt->headerDigest); - if(strcmp(opt->headerDigest, "CRC32C") == 0) { + error = copyinstr(opt->headerDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.headerDigest='%s'", buf); + if(strcmp(buf, "CRC32C") == 0) { sp->hdrDigest = (digest_t *)i_crc32c; sdebug(2, "opt.headerDigest set"); } } if(opt->dataDigest != NULL) { - sdebug(2, "opt.dataDigest='%s'", opt->headerDigest); - if(strcmp(opt->dataDigest, "CRC32C") == 0) { + error = copyinstr(opt->dataDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.dataDigest='%s'", opt->dataDigest); + if(strcmp(buf, "CRC32C") == 0) { sp->dataDigest = (digest_t *)i_crc32c; sdebug(2, "opt.dataDigest set"); } Modified: stable/12/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/12/sys/net80211/ieee80211_mesh.c Thu May 14 17:54:08 2020 (r361037) +++ stable/12/sys/net80211/ieee80211_mesh.c Thu May 14 17:56:43 2020 (r361038) @@ -3569,16 +3569,21 @@ mesh_ioctl_set80211(struct ieee80211vap *vap, struct i ieee80211_mesh_rt_flush(vap); break; case IEEE80211_MESH_RTCMD_ADD: - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data) || - IEEE80211_ADDR_EQ(broadcastaddr, ireq->i_data)) - return EINVAL; - error = copyin(ireq->i_data, &tmpaddr, + error = copyin(ireq->i_data, tmpaddr, IEEE80211_ADDR_LEN); - if (error == 0) - ieee80211_mesh_discover(vap, tmpaddr, NULL); + if (error != 0) + break; + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, tmpaddr) || + IEEE80211_ADDR_EQ(broadcastaddr, tmpaddr)) + return EINVAL; + ieee80211_mesh_discover(vap, tmpaddr, NULL); break; case IEEE80211_MESH_RTCMD_DELETE: - ieee80211_mesh_rt_del(vap, ireq->i_data); + error = copyin(ireq->i_data, tmpaddr, + IEEE80211_ADDR_LEN); + if (error != 0) + break; + ieee80211_mesh_rt_del(vap, tmpaddr); break; default: return ENOSYS; From owner-svn-src-all@freebsd.org Thu May 14 17:56:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 195092D9205; Thu, 14 May 2020 17:56:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NK3x6tFlz4d99; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E7593EF91; Thu, 14 May 2020 17:56:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EHujEo085366; Thu, 14 May 2020 17:56:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EHujD4085362; Thu, 14 May 2020 17:56:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141756.04EHujD4085362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 17:56:45 +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: r361038 - in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 11/sys/dev/iscsi_initiator 11/sys/net80211 12/sys/cam/scsi 12/sys/dev/iscsi_initiator 12/sys/net80211 X-SVN-Commit-Revision: 361038 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 17:56:46 -0000 Author: jhb Date: Thu May 14 17:56:43 2020 New Revision: 361038 URL: https://svnweb.freebsd.org/changeset/base/361038 Log: MFC 360171,360179,360285,360388: Don't dereference various user pointers. 360171: Don't access a user buffer directly from the kernel. The handle_string callback for the ENCIOC_SETSTRING ioctl was passing a user pointer to memcpy(). Fix by using copyin() instead. For ENCIOC_GETSTRING ioctls, the handler was storing the user pointer in a CCB's data_ptr field where it was indirected by other code. Fix this by allocating a temporary buffer (which ENCIOC_SETSTRING already did) and copying the result out to the user buffer after the CCB has been processed. 360179: Don't pass a user buffer pointer as the data pointer in a CCB. Allocate a temporary buffer in the kernel to serve as the CCB data pointer for a pass-through transaction and use copyin/copyout to shuffle the data to/from the user buffer. 360285: Don't indirect user pointers directly in two 802.11s ioctls. IEEE80211_MESH_RTCMD_ADD was invoking memcmp() to validate the supplied address directly on the user pointer rather than first doing a copyin() and validating the copied value. IEEE80211_MESH_RTCMD_DELETE was passing the user pointer directly to ieee80211_mesh_rt_del() rather than copying the user buffer into a temporary kernel buffer. 360388: Don't run strcmp() against strings stored in user memory. Instead, copy the strings into a temporary buffer on the stack and run strcmp on the copies. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c stable/11/sys/cam/scsi/scsi_sg.c stable/11/sys/dev/iscsi_initiator/isc_subr.c stable/11/sys/net80211/ieee80211_mesh.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c stable/12/sys/cam/scsi/scsi_sg.c stable/12/sys/dev/iscsi_initiator/isc_subr.c stable/12/sys/net80211/ieee80211_mesh.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:43 2020 (r361038) @@ -2902,13 +2902,19 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s buf[1] = 0; buf[2] = sstr->bufsiz >> 8; buf[3] = sstr->bufsiz & 0xff; - memcpy(&buf[4], sstr->buf, sstr->bufsiz); + ret = copyin(sstr->buf, &buf[4], sstr->bufsiz); + if (ret != 0) { + ENC_FREE(buf); + return (ret); + } break; case ENCIOC_GETSTRING: payload = sstr->bufsiz; amt = payload; + buf = ENC_MALLOC(payload); + if (buf == NULL) + return (ENOMEM); ses_page_cdb(cdb, payload, SesStringIn, CAM_DIR_IN); - buf = sstr->buf; break; case ENCIOC_GETENCNAME: if (ses_cache->ses_nsubencs < 1) @@ -2948,6 +2954,8 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s return (EINVAL); } ret = enc_runcmd(enc, cdb, 6, buf, &amt); + if (ret == 0 && ioc == ENCIOC_GETSTRING) + ret = copyout(buf, sstr->buf, sstr->bufsiz); if (ioc == ENCIOC_SETSTRING) ENC_FREE(buf); return (ret); Modified: stable/11/sys/cam/scsi/scsi_sg.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_sg.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/cam/scsi/scsi_sg.c Thu May 14 17:56:43 2020 (r361038) @@ -506,6 +506,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; + void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -550,12 +551,20 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (req->dxfer_len > MAXPHYS) { + error = EINVAL; + break; + } + + data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -568,7 +577,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int dir = CAM_DIR_IN; break; case SG_DXFER_TO_FROM_DEV: - dir = CAM_DIR_IN | CAM_DIR_OUT; + dir = CAM_DIR_BOTH; break; case SG_DXFER_NONE: default: @@ -576,12 +585,21 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { + error = copyin(req->dxferp, data_ptr, req->dxfer_len); + if (error) { + free(data_ptr, M_DEVBUF); + xpt_release_ccb(ccb); + break; + } + } + cam_fill_csio(csio, /*retries*/1, sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req->dxferp, + data_ptr, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -591,6 +609,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -609,6 +628,10 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } + if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) + error = copyout(data_ptr, req->dxferp, req->dxfer_len); + + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; Modified: stable/11/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- stable/11/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 17:56:43 2020 (r361038) @@ -192,6 +192,9 @@ i_crc32c(const void *buf, size_t size, uint32_t crc) int i_setopt(isc_session_t *sp, isc_opt_t *opt) { + char buf[16]; + int error; + if(opt->maxRecvDataSegmentLength > 0) { sp->opt.maxRecvDataSegmentLength = opt->maxRecvDataSegmentLength; sdebug(2, "maxRecvDataSegmentLength=%d", sp->opt.maxRecvDataSegmentLength); @@ -233,15 +236,21 @@ i_setopt(isc_session_t *sp, isc_opt_t *opt) } if(opt->headerDigest != NULL) { - sdebug(2, "opt.headerDigest='%s'", opt->headerDigest); - if(strcmp(opt->headerDigest, "CRC32C") == 0) { + error = copyinstr(opt->headerDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.headerDigest='%s'", buf); + if(strcmp(buf, "CRC32C") == 0) { sp->hdrDigest = (digest_t *)i_crc32c; sdebug(2, "opt.headerDigest set"); } } if(opt->dataDigest != NULL) { - sdebug(2, "opt.dataDigest='%s'", opt->headerDigest); - if(strcmp(opt->dataDigest, "CRC32C") == 0) { + error = copyinstr(opt->dataDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.dataDigest='%s'", opt->dataDigest); + if(strcmp(buf, "CRC32C") == 0) { sp->dataDigest = (digest_t *)i_crc32c; sdebug(2, "opt.dataDigest set"); } Modified: stable/11/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/11/sys/net80211/ieee80211_mesh.c Thu May 14 17:54:08 2020 (r361037) +++ stable/11/sys/net80211/ieee80211_mesh.c Thu May 14 17:56:43 2020 (r361038) @@ -3567,16 +3567,21 @@ mesh_ioctl_set80211(struct ieee80211vap *vap, struct i ieee80211_mesh_rt_flush(vap); break; case IEEE80211_MESH_RTCMD_ADD: - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data) || - IEEE80211_ADDR_EQ(broadcastaddr, ireq->i_data)) - return EINVAL; - error = copyin(ireq->i_data, &tmpaddr, + error = copyin(ireq->i_data, tmpaddr, IEEE80211_ADDR_LEN); - if (error == 0) - ieee80211_mesh_discover(vap, tmpaddr, NULL); + if (error != 0) + break; + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, tmpaddr) || + IEEE80211_ADDR_EQ(broadcastaddr, tmpaddr)) + return EINVAL; + ieee80211_mesh_discover(vap, tmpaddr, NULL); break; case IEEE80211_MESH_RTCMD_DELETE: - ieee80211_mesh_rt_del(vap, ireq->i_data); + error = copyin(ireq->i_data, tmpaddr, + IEEE80211_ADDR_LEN); + if (error != 0) + break; + ieee80211_mesh_rt_del(vap, tmpaddr); break; default: return ENOSYS; From owner-svn-src-all@freebsd.org Thu May 14 18:19:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BF6302D9C5A; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NKZ947JDz4fSg; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 84918F38B; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIJTK8097606; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIJTYX097605; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141819.04EIJTYX097605@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:19:29 +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: r361040 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 361040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:19:29 -0000 Author: jhb Date: Thu May 14 18:19:28 2020 New Revision: 361040 URL: https://svnweb.freebsd.org/changeset/base/361040 Log: MFC 360818: Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171. Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/12/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:44 2020 (r361039) +++ stable/12/sys/cam/scsi/scsi_enc_ses.c Thu May 14 18:19:28 2020 (r361040) @@ -2958,7 +2958,7 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s ret = enc_runcmd(enc, cdb, 6, buf, &amt); if (ret == 0 && ioc == ENCIOC_GETSTRING) ret = copyout(buf, sstr->buf, sstr->bufsiz); - if (ioc == ENCIOC_SETSTRING) + if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING) ENC_FREE(buf); return (ret); } From owner-svn-src-all@freebsd.org Thu May 14 18:19:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE6202D9C62; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NKZ965jwz4fSh; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAC9FF38C; Thu, 14 May 2020 18:19:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIJT1Q097612; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIJTPc097611; Thu, 14 May 2020 18:19:29 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141819.04EIJTPc097611@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:19:29 +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: r361040 - in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sys/cam/scsi 12/sys/cam/scsi X-SVN-Commit-Revision: 361040 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:19:30 -0000 Author: jhb Date: Thu May 14 18:19:28 2020 New Revision: 361040 URL: https://svnweb.freebsd.org/changeset/base/361040 Log: MFC 360818: Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171. Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 17:56:44 2020 (r361039) +++ stable/11/sys/cam/scsi/scsi_enc_ses.c Thu May 14 18:19:28 2020 (r361040) @@ -2956,7 +2956,7 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s ret = enc_runcmd(enc, cdb, 6, buf, &amt); if (ret == 0 && ioc == ENCIOC_GETSTRING) ret = copyout(buf, sstr->buf, sstr->bufsiz); - if (ioc == ENCIOC_SETSTRING) + if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING) ENC_FREE(buf); return (ret); } From owner-svn-src-all@freebsd.org Thu May 14 18:28:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2C6AF2DA155; Thu, 14 May 2020 18:28:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NKm603lcz4gBd; Thu, 14 May 2020 18:28:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:59ea:1632:b928:42c4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 59426103CC; Thu, 14 May 2020 18:28:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r361035 - in releng/11.4: lib/libsysdecode sys/fs/procfs sys/sys usr.sbin/procctl To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org References: <202005141747.04EHltN1078763@repo.freebsd.org> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: Date: Thu, 14 May 2020 11:28:03 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:28:06 -0000 On 5/14/20 10:55 AM, Eugene Grosbein wrote: > 15.05.2020 0:47, John Baldwin wrote: > >> Author: jhb >> Date: Thu May 14 17:47:55 2020 >> New Revision: 361035 >> URL: https://svnweb.freebsd.org/changeset/base/361035 >> >> Log: >> MF11 361020: Deprecate procfs-based process debugging. >> >> 359047: >> Mark procfs-based process debugging as deprecated for FreeBSD 13. >> >> Attempting to use ioctls on /proc//mem to control a process will >> trigger warnings on the console. The include file will >> also now emit a compile-time warning when used from userland. >> >> 359054: >> Fix the workaround to ignore the #warning for GCC. >> >> clang and gcc use different warning flags for #warning preprocessor >> directives. >> >> For both 12 and 11, adjust the GCC warning flags to only be added in >> 4.7 and later since 4.2.1 does not support -Wno-cpp. For 11, add the >> needed warning suppression to procctl's build. procctl was removed in >> 12.0. >> >> Approved by: re (gjb, kib) > > Please consider adding a sysctl or another way to disable such extra warnings for jailed process, > so it would be possible running old versions of FreeBSD in a jail seamless. They are rate limited now, but you also probably have no existing processes that are using this. strace on i386 from ports (for which truss is a more functional replacement) is the only binary still built in ports that uses this. truss itself was the last base system binary (aside from procctl which is only there as a helper, not an actual util) and the last version of truss to use procfs was 6.x. -- John Baldwin From owner-svn-src-all@freebsd.org Thu May 14 18:49:43 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CFA7F2DA8C6; Thu, 14 May 2020 18:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLF355Gvz3Cm5; Thu, 14 May 2020 18:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A57BDF935; Thu, 14 May 2020 18:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EInhX1016203; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EInh3S016202; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141849.04EInh3S016202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:49: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: r361041 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 361041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:49:43 -0000 Author: jhb Date: Thu May 14 18:49:43 2020 New Revision: 361041 URL: https://svnweb.freebsd.org/changeset/base/361041 Log: MFC 360399: Update the cached MSI state when any MSI capability register is written. bhyve uses cached copies of the MSI capability registers to generate MSI interrupts for device models. Previously, these cached fields were only set when the MSI capability control register was updated. The Linux kernel recently adopted a change to deal with races in MSI interrupt delivery that writes to the MSI capability address and data registers to alter the destination of MSI interrupts without writing to the MSI capability control register. bhyve was not updating its cached registers for these writes and continued to send interrupts with the old data value to the old address. Fix this by recomputing the cached values for every write to any MSI capability register. Modified: stable/12/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/11/ (props changed) Modified: stable/12/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/12/usr.sbin/bhyve/pci_emul.c Thu May 14 18:19:28 2020 (r361040) +++ stable/12/usr.sbin/bhyve/pci_emul.c Thu May 14 18:49:43 2020 (r361041) @@ -915,26 +915,26 @@ msicap_cfgwrite(struct pci_devinst *pi, int capoff, in msgctrl &= ~rwmask; msgctrl |= val & rwmask; val = msgctrl; + } + CFGWRITE(pi, offset, val, bytes); - addrlo = pci_get_cfgdata32(pi, capoff + 4); - if (msgctrl & PCIM_MSICTRL_64BIT) - msgdata = pci_get_cfgdata16(pi, capoff + 12); - else - msgdata = pci_get_cfgdata16(pi, capoff + 8); + msgctrl = pci_get_cfgdata16(pi, capoff + 2); + addrlo = pci_get_cfgdata32(pi, capoff + 4); + if (msgctrl & PCIM_MSICTRL_64BIT) + msgdata = pci_get_cfgdata16(pi, capoff + 12); + else + msgdata = pci_get_cfgdata16(pi, capoff + 8); - mme = msgctrl & PCIM_MSICTRL_MME_MASK; - pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; - if (pi->pi_msi.enabled) { - pi->pi_msi.addr = addrlo; - pi->pi_msi.msg_data = msgdata; - pi->pi_msi.maxmsgnum = 1 << (mme >> 4); - } else { - pi->pi_msi.maxmsgnum = 0; - } - pci_lintr_update(pi); + mme = msgctrl & PCIM_MSICTRL_MME_MASK; + pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; + if (pi->pi_msi.enabled) { + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); + } else { + pi->pi_msi.maxmsgnum = 0; } - - CFGWRITE(pi, offset, val, bytes); + pci_lintr_update(pi); } void From owner-svn-src-all@freebsd.org Thu May 14 18:49:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1E6702DA8CA; Thu, 14 May 2020 18:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLF400wsz3Cm6; Thu, 14 May 2020 18:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EF9FDF936; Thu, 14 May 2020 18:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EInhS4016209; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EInhca016208; Thu, 14 May 2020 18:49:43 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141849.04EInhca016208@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:49:43 +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: r361041 - in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/usr.sbin/bhyve 12/usr.sbin/bhyve X-SVN-Commit-Revision: 361041 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:49:44 -0000 Author: jhb Date: Thu May 14 18:49:43 2020 New Revision: 361041 URL: https://svnweb.freebsd.org/changeset/base/361041 Log: MFC 360399: Update the cached MSI state when any MSI capability register is written. bhyve uses cached copies of the MSI capability registers to generate MSI interrupts for device models. Previously, these cached fields were only set when the MSI capability control register was updated. The Linux kernel recently adopted a change to deal with races in MSI interrupt delivery that writes to the MSI capability address and data registers to alter the destination of MSI interrupts without writing to the MSI capability control register. bhyve was not updating its cached registers for these writes and continued to send interrupts with the old data value to the old address. Fix this by recomputing the cached values for every write to any MSI capability register. Modified: stable/11/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/bhyve/pci_emul.c Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/bhyve/pci_emul.c ============================================================================== --- stable/11/usr.sbin/bhyve/pci_emul.c Thu May 14 18:19:28 2020 (r361040) +++ stable/11/usr.sbin/bhyve/pci_emul.c Thu May 14 18:49:43 2020 (r361041) @@ -898,26 +898,26 @@ msicap_cfgwrite(struct pci_devinst *pi, int capoff, in msgctrl &= ~rwmask; msgctrl |= val & rwmask; val = msgctrl; + } + CFGWRITE(pi, offset, val, bytes); - addrlo = pci_get_cfgdata32(pi, capoff + 4); - if (msgctrl & PCIM_MSICTRL_64BIT) - msgdata = pci_get_cfgdata16(pi, capoff + 12); - else - msgdata = pci_get_cfgdata16(pi, capoff + 8); + msgctrl = pci_get_cfgdata16(pi, capoff + 2); + addrlo = pci_get_cfgdata32(pi, capoff + 4); + if (msgctrl & PCIM_MSICTRL_64BIT) + msgdata = pci_get_cfgdata16(pi, capoff + 12); + else + msgdata = pci_get_cfgdata16(pi, capoff + 8); - mme = msgctrl & PCIM_MSICTRL_MME_MASK; - pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; - if (pi->pi_msi.enabled) { - pi->pi_msi.addr = addrlo; - pi->pi_msi.msg_data = msgdata; - pi->pi_msi.maxmsgnum = 1 << (mme >> 4); - } else { - pi->pi_msi.maxmsgnum = 0; - } - pci_lintr_update(pi); + mme = msgctrl & PCIM_MSICTRL_MME_MASK; + pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; + if (pi->pi_msi.enabled) { + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); + } else { + pi->pi_msi.maxmsgnum = 0; } - - CFGWRITE(pi, offset, val, bytes); + pci_lintr_update(pi); } void From owner-svn-src-all@freebsd.org Thu May 14 18:50:45 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 209012DA9A1; Thu, 14 May 2020 18:50:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLGF06j1z3D4d; Thu, 14 May 2020 18:50:45 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F36BDF953; Thu, 14 May 2020 18:50:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIoiEE017182; Thu, 14 May 2020 18:50:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIoieU017178; Thu, 14 May 2020 18:50:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141850.04EIoieU017178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361042 - in releng/11.4/sys: cam/scsi dev/iscsi_initiator net80211 X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in releng/11.4/sys: cam/scsi dev/iscsi_initiator net80211 X-SVN-Commit-Revision: 361042 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:50:45 -0000 Author: jhb Date: Thu May 14 18:50:43 2020 New Revision: 361042 URL: https://svnweb.freebsd.org/changeset/base/361042 Log: MF11 361038,361040: Don't dereference various user pointers. 360171: Don't access a user buffer directly from the kernel. The handle_string callback for the ENCIOC_SETSTRING ioctl was passing a user pointer to memcpy(). Fix by using copyin() instead. For ENCIOC_GETSTRING ioctls, the handler was storing the user pointer in a CCB's data_ptr field where it was indirected by other code. Fix this by allocating a temporary buffer (which ENCIOC_SETSTRING already did) and copying the result out to the user buffer after the CCB has been processed. 360179: Don't pass a user buffer pointer as the data pointer in a CCB. Allocate a temporary buffer in the kernel to serve as the CCB data pointer for a pass-through transaction and use copyin/copyout to shuffle the data to/from the user buffer. 360285: Don't indirect user pointers directly in two 802.11s ioctls. IEEE80211_MESH_RTCMD_ADD was invoking memcmp() to validate the supplied address directly on the user pointer rather than first doing a copyin() and validating the copied value. IEEE80211_MESH_RTCMD_DELETE was passing the user pointer directly to ieee80211_mesh_rt_del() rather than copying the user buffer into a temporary kernel buffer. 360388: Don't run strcmp() against strings stored in user memory. Instead, copy the strings into a temporary buffer on the stack and run strcmp on the copies. 360818: Fix a memory leak for ENCIOC_GETSTRING I introduced in r360171. Approved by: re (gjb) Modified: releng/11.4/sys/cam/scsi/scsi_enc_ses.c releng/11.4/sys/cam/scsi/scsi_sg.c releng/11.4/sys/dev/iscsi_initiator/isc_subr.c releng/11.4/sys/net80211/ieee80211_mesh.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- releng/11.4/sys/cam/scsi/scsi_enc_ses.c Thu May 14 18:49:43 2020 (r361041) +++ releng/11.4/sys/cam/scsi/scsi_enc_ses.c Thu May 14 18:50:43 2020 (r361042) @@ -2902,13 +2902,19 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s buf[1] = 0; buf[2] = sstr->bufsiz >> 8; buf[3] = sstr->bufsiz & 0xff; - memcpy(&buf[4], sstr->buf, sstr->bufsiz); + ret = copyin(sstr->buf, &buf[4], sstr->bufsiz); + if (ret != 0) { + ENC_FREE(buf); + return (ret); + } break; case ENCIOC_GETSTRING: payload = sstr->bufsiz; amt = payload; + buf = ENC_MALLOC(payload); + if (buf == NULL) + return (ENOMEM); ses_page_cdb(cdb, payload, SesStringIn, CAM_DIR_IN); - buf = sstr->buf; break; case ENCIOC_GETENCNAME: if (ses_cache->ses_nsubencs < 1) @@ -2948,7 +2954,9 @@ ses_handle_string(enc_softc_t *enc, encioc_string_t *s return (EINVAL); } ret = enc_runcmd(enc, cdb, 6, buf, &amt); - if (ioc == ENCIOC_SETSTRING) + if (ret == 0 && ioc == ENCIOC_GETSTRING) + ret = copyout(buf, sstr->buf, sstr->bufsiz); + if (ioc == ENCIOC_SETSTRING || ioc == ENCIOC_GETSTRING) ENC_FREE(buf); return (ret); } Modified: releng/11.4/sys/cam/scsi/scsi_sg.c ============================================================================== --- releng/11.4/sys/cam/scsi/scsi_sg.c Thu May 14 18:49:43 2020 (r361041) +++ releng/11.4/sys/cam/scsi/scsi_sg.c Thu May 14 18:50:43 2020 (r361042) @@ -506,6 +506,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int struct cam_periph *periph; struct sg_softc *softc; struct sg_io_hdr *req; + void *data_ptr; int dir, error; periph = (struct cam_periph *)dev->si_drv1; @@ -550,12 +551,20 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (req->dxfer_len > MAXPHYS) { + error = EINVAL; + break; + } + + data_ptr = malloc(req->dxfer_len, M_DEVBUF, M_WAITOK); + ccb = cam_periph_getccb(periph, CAM_PRIORITY_NORMAL); csio = &ccb->csio; error = copyin(req->cmdp, &csio->cdb_io.cdb_bytes, req->cmd_len); if (error) { + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -568,7 +577,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int dir = CAM_DIR_IN; break; case SG_DXFER_TO_FROM_DEV: - dir = CAM_DIR_IN | CAM_DIR_OUT; + dir = CAM_DIR_BOTH; break; case SG_DXFER_NONE: default: @@ -576,12 +585,21 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int break; } + if (dir == CAM_DIR_IN || dir == CAM_DIR_BOTH) { + error = copyin(req->dxferp, data_ptr, req->dxfer_len); + if (error) { + free(data_ptr, M_DEVBUF); + xpt_release_ccb(ccb); + break; + } + } + cam_fill_csio(csio, /*retries*/1, sgdone, dir|CAM_DEV_QFRZDIS, MSG_SIMPLE_Q_TAG, - req->dxferp, + data_ptr, req->dxfer_len, req->mx_sb_len, req->cmd_len, @@ -591,6 +609,7 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int if (error) { req->host_status = DID_ERROR; req->driver_status = DRIVER_INVALID; + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; } @@ -609,6 +628,10 @@ sgioctl(struct cdev *dev, u_long cmd, caddr_t arg, int req->sb_len_wr); } + if ((dir == CAM_DIR_OUT || dir == CAM_DIR_BOTH) && error == 0) + error = copyout(data_ptr, req->dxferp, req->dxfer_len); + + free(data_ptr, M_DEVBUF); xpt_release_ccb(ccb); break; Modified: releng/11.4/sys/dev/iscsi_initiator/isc_subr.c ============================================================================== --- releng/11.4/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 18:49:43 2020 (r361041) +++ releng/11.4/sys/dev/iscsi_initiator/isc_subr.c Thu May 14 18:50:43 2020 (r361042) @@ -192,6 +192,9 @@ i_crc32c(const void *buf, size_t size, uint32_t crc) int i_setopt(isc_session_t *sp, isc_opt_t *opt) { + char buf[16]; + int error; + if(opt->maxRecvDataSegmentLength > 0) { sp->opt.maxRecvDataSegmentLength = opt->maxRecvDataSegmentLength; sdebug(2, "maxRecvDataSegmentLength=%d", sp->opt.maxRecvDataSegmentLength); @@ -233,15 +236,21 @@ i_setopt(isc_session_t *sp, isc_opt_t *opt) } if(opt->headerDigest != NULL) { - sdebug(2, "opt.headerDigest='%s'", opt->headerDigest); - if(strcmp(opt->headerDigest, "CRC32C") == 0) { + error = copyinstr(opt->headerDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.headerDigest='%s'", buf); + if(strcmp(buf, "CRC32C") == 0) { sp->hdrDigest = (digest_t *)i_crc32c; sdebug(2, "opt.headerDigest set"); } } if(opt->dataDigest != NULL) { - sdebug(2, "opt.dataDigest='%s'", opt->headerDigest); - if(strcmp(opt->dataDigest, "CRC32C") == 0) { + error = copyinstr(opt->dataDigest, buf, sizeof(buf), NULL); + if (error != 0) + return (error); + sdebug(2, "opt.dataDigest='%s'", opt->dataDigest); + if(strcmp(buf, "CRC32C") == 0) { sp->dataDigest = (digest_t *)i_crc32c; sdebug(2, "opt.dataDigest set"); } Modified: releng/11.4/sys/net80211/ieee80211_mesh.c ============================================================================== --- releng/11.4/sys/net80211/ieee80211_mesh.c Thu May 14 18:49:43 2020 (r361041) +++ releng/11.4/sys/net80211/ieee80211_mesh.c Thu May 14 18:50:43 2020 (r361042) @@ -3567,16 +3567,21 @@ mesh_ioctl_set80211(struct ieee80211vap *vap, struct i ieee80211_mesh_rt_flush(vap); break; case IEEE80211_MESH_RTCMD_ADD: - if (IEEE80211_ADDR_EQ(vap->iv_myaddr, ireq->i_data) || - IEEE80211_ADDR_EQ(broadcastaddr, ireq->i_data)) - return EINVAL; - error = copyin(ireq->i_data, &tmpaddr, + error = copyin(ireq->i_data, tmpaddr, IEEE80211_ADDR_LEN); - if (error == 0) - ieee80211_mesh_discover(vap, tmpaddr, NULL); + if (error != 0) + break; + if (IEEE80211_ADDR_EQ(vap->iv_myaddr, tmpaddr) || + IEEE80211_ADDR_EQ(broadcastaddr, tmpaddr)) + return EINVAL; + ieee80211_mesh_discover(vap, tmpaddr, NULL); break; case IEEE80211_MESH_RTCMD_DELETE: - ieee80211_mesh_rt_del(vap, ireq->i_data); + error = copyin(ireq->i_data, tmpaddr, + IEEE80211_ADDR_LEN); + if (error != 0) + break; + ieee80211_mesh_rt_del(vap, tmpaddr); break; default: return ENOSYS; From owner-svn-src-all@freebsd.org Thu May 14 18:55:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 23B592DAC58; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLN208rCz3DZ8; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 00A96FB0B; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EItjYG021987; Thu, 14 May 2020 18:55:45 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EItjKg021986; Thu, 14 May 2020 18:55:45 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141855.04EItjKg021986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:55: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: r361043 - in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Commit-Revision: 361043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:55:46 -0000 Author: jhb Date: Thu May 14 18:55:45 2020 New Revision: 361043 URL: https://svnweb.freebsd.org/changeset/base/361043 Log: MFC 360634: Add RFC reference for AES-CTR with IPsec. Modified: stable/12/sbin/setkey/setkey.8 Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sbin/setkey/setkey.8 Directory Properties: stable/11/ (props changed) Modified: stable/12/sbin/setkey/setkey.8 ============================================================================== --- stable/12/sbin/setkey/setkey.8 Thu May 14 18:50:43 2020 (r361042) +++ stable/12/sbin/setkey/setkey.8 Thu May 14 18:55:45 2020 (r361043) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2017 +.Dd May 04, 2020 .Dt SETKEY 8 .Os .\" @@ -626,7 +626,7 @@ blowfish-cbc 40 to 448 rfc2451 cast128-cbc 40 to 128 rfc2451 des-deriv 64 ipsec-ciph-des-derived-01 rijndael-cbc 128/192/256 rfc3602 -aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 +aes-ctr 160/224/288 rfc3686 aes-gcm-16 160/224/288 rfc4106 camellia-cbc 128/192/256 rfc4312 .Ed From owner-svn-src-all@freebsd.org Thu May 14 18:55:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79A9A2DAC5C; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLN22cTYz3DZ9; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 54F0BFB0C; Thu, 14 May 2020 18:55:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EItk3P021993; Thu, 14 May 2020 18:55:46 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EItkpo021992; Thu, 14 May 2020 18:55:46 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141855.04EItkpo021992@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:55:46 +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: r361043 - in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/sbin/setkey 12/sbin/setkey X-SVN-Commit-Revision: 361043 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:55:46 -0000 Author: jhb Date: Thu May 14 18:55:45 2020 New Revision: 361043 URL: https://svnweb.freebsd.org/changeset/base/361043 Log: MFC 360634: Add RFC reference for AES-CTR with IPsec. Modified: stable/11/sbin/setkey/setkey.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sbin/setkey/setkey.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/sbin/setkey/setkey.8 ============================================================================== --- stable/11/sbin/setkey/setkey.8 Thu May 14 18:50:43 2020 (r361042) +++ stable/11/sbin/setkey/setkey.8 Thu May 14 18:55:45 2020 (r361043) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2017 +.Dd May 04, 2020 .Dt SETKEY 8 .Os .\" @@ -626,7 +626,7 @@ blowfish-cbc 40 to 448 rfc2451 cast128-cbc 40 to 128 rfc2451 des-deriv 64 ipsec-ciph-des-derived-01 rijndael-cbc 128/192/256 rfc3602 -aes-ctr 160/224/288 draft-ietf-ipsec-ciph-aes-ctr-03 +aes-ctr 160/224/288 rfc3686 aes-gcm-16 160/224/288 rfc4106 camellia-cbc 128/192/256 rfc4312 .Ed From owner-svn-src-all@freebsd.org Thu May 14 18:59:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5CC672DADFD; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLSR1ltJz3Dwx; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 33074FB10; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIxYwm022212; Thu, 14 May 2020 18:59:34 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIxY9S022210; Thu, 14 May 2020 18:59:34 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141859.04EIxY9S022210@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:59: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: r361044 - in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Commit-Revision: 361044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:59:35 -0000 Author: jhb Date: Thu May 14 18:59:34 2020 New Revision: 361044 URL: https://svnweb.freebsd.org/changeset/base/361044 Log: MFC 360710: Deprecate ubsec(4) for FreeBSD 13.0. With the removal of in-tree consumers of DES, Triple DES, and MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC. This is not very useful as a standalone algorithm (IPsec AH-only with SHA1 would be the only user). This driver has also not been kept up to date with the original driver in OpenBSD which supports a few more cards and AES-CBC on newer cards. The newest card currently supported by this driver was released in 2005. Relnotes: yes Modified: stable/12/share/man/man4/ubsec.4 stable/12/sys/dev/ubsec/ubsec.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/share/man/man4/ubsec.4 stable/11/sys/dev/ubsec/ubsec.c Directory Properties: stable/11/ (props changed) Modified: stable/12/share/man/man4/ubsec.4 ============================================================================== --- stable/12/share/man/man4/ubsec.4 Thu May 14 18:55:45 2020 (r361043) +++ stable/12/share/man/man4/ubsec.4 Thu May 14 18:59:34 2020 (r361044) @@ -48,6 +48,15 @@ module at boot time, place the following line in .Bd -literal -offset indent ubsec_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +The majority of crypto algorithms supported by this driver are no longer +used by the kernel in +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: stable/12/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/12/sys/dev/ubsec/ubsec.c Thu May 14 18:55:45 2020 (r361043) +++ stable/12/sys/dev/ubsec/ubsec.c Thu May 14 18:59:34 2020 (r361044) @@ -475,6 +475,7 @@ skip_rng: crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0); #endif } + gone_in_dev(dev, 13, "Does not support modern crypto algorithms"); return (0); bad4: crypto_unregister_all(sc->sc_cid); From owner-svn-src-all@freebsd.org Thu May 14 18:59:35 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B71FA2DAE01; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLSR4S2fz3Dwy; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 93E68FB11; Thu, 14 May 2020 18:59:35 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EIxZQI022220; Thu, 14 May 2020 18:59:35 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EIxZtx022218; Thu, 14 May 2020 18:59:35 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141859.04EIxZtx022218@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 18:59:35 +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: r361044 - in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 11/sys/dev/ubsec 12/share/man/man4 12/sys/dev/ubsec X-SVN-Commit-Revision: 361044 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 18:59:35 -0000 Author: jhb Date: Thu May 14 18:59:34 2020 New Revision: 361044 URL: https://svnweb.freebsd.org/changeset/base/361044 Log: MFC 360710: Deprecate ubsec(4) for FreeBSD 13.0. With the removal of in-tree consumers of DES, Triple DES, and MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC. This is not very useful as a standalone algorithm (IPsec AH-only with SHA1 would be the only user). This driver has also not been kept up to date with the original driver in OpenBSD which supports a few more cards and AES-CBC on newer cards. The newest card currently supported by this driver was released in 2005. Relnotes: yes Modified: stable/11/share/man/man4/ubsec.4 stable/11/sys/dev/ubsec/ubsec.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/share/man/man4/ubsec.4 stable/12/sys/dev/ubsec/ubsec.c Directory Properties: stable/12/ (props changed) Modified: stable/11/share/man/man4/ubsec.4 ============================================================================== --- stable/11/share/man/man4/ubsec.4 Thu May 14 18:55:45 2020 (r361043) +++ stable/11/share/man/man4/ubsec.4 Thu May 14 18:59:34 2020 (r361044) @@ -48,6 +48,15 @@ module at boot time, place the following line in .Bd -literal -offset indent ubsec_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +The majority of crypto algorithms supported by this driver are no longer +used by the kernel in +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: stable/11/sys/dev/ubsec/ubsec.c ============================================================================== --- stable/11/sys/dev/ubsec/ubsec.c Thu May 14 18:55:45 2020 (r361043) +++ stable/11/sys/dev/ubsec/ubsec.c Thu May 14 18:59:34 2020 (r361044) @@ -474,6 +474,7 @@ skip_rng: crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0); #endif } + gone_in_dev(dev, 13, "Does not support modern crypto algorithms"); return (0); bad4: crypto_unregister_all(sc->sc_cid); From owner-svn-src-all@freebsd.org Thu May 14 19:09:00 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CE3F22DB267; Thu, 14 May 2020 19:09:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLgJ590bz3FxT; Thu, 14 May 2020 19:09:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ABB9EFCF4; Thu, 14 May 2020 19:09:00 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJ90Th028847; Thu, 14 May 2020 19:09:00 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJ90An028846; Thu, 14 May 2020 19:09:00 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141909.04EJ90An028846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 19:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361045 - releng/11.4/usr.sbin/bhyve X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: releng/11.4/usr.sbin/bhyve X-SVN-Commit-Revision: 361045 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:09:00 -0000 Author: jhb Date: Thu May 14 19:09:00 2020 New Revision: 361045 URL: https://svnweb.freebsd.org/changeset/base/361045 Log: MF11 361041: Update the cached MSI state when any MSI capability register is written. bhyve uses cached copies of the MSI capability registers to generate MSI interrupts for device models. Previously, these cached fields were only set when the MSI capability control register was updated. The Linux kernel recently adopted a change to deal with races in MSI interrupt delivery that writes to the MSI capability address and data registers to alter the destination of MSI interrupts without writing to the MSI capability control register. bhyve was not updating its cached registers for these writes and continued to send interrupts with the old data value to the old address. Fix this by recomputing the cached values for every write to any MSI capability register. Approved by: re (gjb) Modified: releng/11.4/usr.sbin/bhyve/pci_emul.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/usr.sbin/bhyve/pci_emul.c ============================================================================== --- releng/11.4/usr.sbin/bhyve/pci_emul.c Thu May 14 18:59:34 2020 (r361044) +++ releng/11.4/usr.sbin/bhyve/pci_emul.c Thu May 14 19:09:00 2020 (r361045) @@ -898,26 +898,26 @@ msicap_cfgwrite(struct pci_devinst *pi, int capoff, in msgctrl &= ~rwmask; msgctrl |= val & rwmask; val = msgctrl; + } + CFGWRITE(pi, offset, val, bytes); - addrlo = pci_get_cfgdata32(pi, capoff + 4); - if (msgctrl & PCIM_MSICTRL_64BIT) - msgdata = pci_get_cfgdata16(pi, capoff + 12); - else - msgdata = pci_get_cfgdata16(pi, capoff + 8); + msgctrl = pci_get_cfgdata16(pi, capoff + 2); + addrlo = pci_get_cfgdata32(pi, capoff + 4); + if (msgctrl & PCIM_MSICTRL_64BIT) + msgdata = pci_get_cfgdata16(pi, capoff + 12); + else + msgdata = pci_get_cfgdata16(pi, capoff + 8); - mme = msgctrl & PCIM_MSICTRL_MME_MASK; - pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; - if (pi->pi_msi.enabled) { - pi->pi_msi.addr = addrlo; - pi->pi_msi.msg_data = msgdata; - pi->pi_msi.maxmsgnum = 1 << (mme >> 4); - } else { - pi->pi_msi.maxmsgnum = 0; - } - pci_lintr_update(pi); + mme = msgctrl & PCIM_MSICTRL_MME_MASK; + pi->pi_msi.enabled = msgctrl & PCIM_MSICTRL_MSI_ENABLE ? 1 : 0; + if (pi->pi_msi.enabled) { + pi->pi_msi.addr = addrlo; + pi->pi_msi.msg_data = msgdata; + pi->pi_msi.maxmsgnum = 1 << (mme >> 4); + } else { + pi->pi_msi.maxmsgnum = 0; } - - CFGWRITE(pi, offset, val, bytes); + pci_lintr_update(pi); } void From owner-svn-src-all@freebsd.org Thu May 14 19:09:14 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26EE52DB2B7; Thu, 14 May 2020 19:09:14 +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 49NLgZ0HWSz3G4p; Thu, 14 May 2020 19:09:14 +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 0504AFCF5; Thu, 14 May 2020 19:09:14 +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 04EJ9DAo028908; Thu, 14 May 2020 19:09:13 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJ9DF0028907; Thu, 14 May 2020 19:09:13 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141909.04EJ9DF0028907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:09: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: r361046 - stable/12/lib/csu X-SVN-Group: stable-12 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/12/lib/csu X-SVN-Commit-Revision: 361046 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:09:14 -0000 Author: dim Date: Thu May 14 19:09:13 2020 New Revision: 361046 URL: https://svnweb.freebsd.org/changeset/base/361046 Log: MFC r360915: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 Differential Revision: https://reviews.freebsd.org/D24797 Modified: stable/12/lib/csu/Makefile.inc Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/csu/Makefile.inc ============================================================================== --- stable/12/lib/csu/Makefile.inc Thu May 14 19:09:00 2020 (r361045) +++ stable/12/lib/csu/Makefile.inc Thu May 14 19:09:13 2020 (r361046) @@ -13,6 +13,9 @@ NO_WMISSING_VARIABLE_DECLARATIONS= OBJS+= crtbegin.o crtbeginS.o crtbeginT.o OBJS+= crtend.o crtendS.o +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + CFLAGS_CRTS= -DSHARED ${PICFLAG} crtbegin.o: crtbegin.c From owner-svn-src-all@freebsd.org Thu May 14 19:09:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D2C882DB30D; Thu, 14 May 2020 19:09:26 +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 49NLgp5K0nz3GCD; Thu, 14 May 2020 19:09:26 +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 B1A9BFCFD; Thu, 14 May 2020 19:09:26 +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 04EJ9Q71028984; Thu, 14 May 2020 19:09:26 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJ9QLj028983; Thu, 14 May 2020 19:09:26 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141909.04EJ9QLj028983@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:09:26 +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: r361047 - stable/11/lib/csu X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/lib/csu X-SVN-Commit-Revision: 361047 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:09:26 -0000 Author: dim Date: Thu May 14 19:09:26 2020 New Revision: 361047 URL: https://svnweb.freebsd.org/changeset/base/361047 Log: MFC r360915: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. PR: 246322 Differential Revision: https://reviews.freebsd.org/D24797 Modified: stable/11/lib/csu/Makefile.inc Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/csu/Makefile.inc ============================================================================== --- stable/11/lib/csu/Makefile.inc Thu May 14 19:09:13 2020 (r361046) +++ stable/11/lib/csu/Makefile.inc Thu May 14 19:09:26 2020 (r361047) @@ -6,4 +6,7 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/ NO_WMISSING_VARIABLE_DECLARATIONS= +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Thu May 14 19:15:21 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E764A2DB737; Thu, 14 May 2020 19:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLpd5sMdz3Gpd; Thu, 14 May 2020 19:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C450BFEF7; Thu, 14 May 2020 19:15:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJFL2J034980; Thu, 14 May 2020 19:15:21 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJFL3h034979; Thu, 14 May 2020 19:15:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141915.04EJFL3h034979@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 19:15: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: r361048 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-12 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 361048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:15:22 -0000 Author: jhb Date: Thu May 14 19:15:21 2020 New Revision: 361048 URL: https://svnweb.freebsd.org/changeset/base/361048 Log: Bump Dd for r361044. This is a direct commit to stable/{11,12} as I missed the bump in the commit to head, but the file has already been removed from head. Modified: stable/12/share/man/man4/ubsec.4 Changes in other areas also in this revision: Modified: stable/11/share/man/man4/ubsec.4 Modified: stable/12/share/man/man4/ubsec.4 ============================================================================== --- stable/12/share/man/man4/ubsec.4 Thu May 14 19:09:26 2020 (r361047) +++ stable/12/share/man/man4/ubsec.4 Thu May 14 19:15:21 2020 (r361048) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2009 +.Dd May 14, 2020 .Dt UBSEC 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu May 14 19:15:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3F70D2DB73B; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NLpf0zS3z3Gpf; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1CD86FEF8; Thu, 14 May 2020 19:15:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJFMs2034986; Thu, 14 May 2020 19:15:22 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJFLnV034985; Thu, 14 May 2020 19:15:21 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141915.04EJFLnV034985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 19:15:21 +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: r361048 - in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 11/share/man/man4 12/share/man/man4 X-SVN-Commit-Revision: 361048 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:15:22 -0000 Author: jhb Date: Thu May 14 19:15:21 2020 New Revision: 361048 URL: https://svnweb.freebsd.org/changeset/base/361048 Log: Bump Dd for r361044. This is a direct commit to stable/{11,12} as I missed the bump in the commit to head, but the file has already been removed from head. Modified: stable/11/share/man/man4/ubsec.4 Changes in other areas also in this revision: Modified: stable/12/share/man/man4/ubsec.4 Modified: stable/11/share/man/man4/ubsec.4 ============================================================================== --- stable/11/share/man/man4/ubsec.4 Thu May 14 19:09:26 2020 (r361047) +++ stable/11/share/man/man4/ubsec.4 Thu May 14 19:15:21 2020 (r361048) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2009 +.Dd May 14, 2020 .Dt UBSEC 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Thu May 14 19:29:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DFA022DBE47; Thu, 14 May 2020 19:29:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NM6X5hC3z3HW2; Thu, 14 May 2020 19:29:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC821180EE; Thu, 14 May 2020 19:29:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJT8HY041110; Thu, 14 May 2020 19:29:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJT8eR041108; Thu, 14 May 2020 19:29:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005141929.04EJT8eR041108@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Thu, 14 May 2020 19:29:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361049 - in releng/11.4: share/man/man4 sys/dev/ubsec X-SVN-Group: releng X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in releng/11.4: share/man/man4 sys/dev/ubsec X-SVN-Commit-Revision: 361049 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:29:09 -0000 Author: jhb Date: Thu May 14 19:29:08 2020 New Revision: 361049 URL: https://svnweb.freebsd.org/changeset/base/361049 Log: MF11 361044,361048: Deprecate ubsec(4) for FreeBSD 13.0. With the removal of in-tree consumers of DES, Triple DES, and MD5-HMAC, the only algorithm this driver still supports is SHA1-HMAC. This is not very useful as a standalone algorithm (IPsec AH-only with SHA1 would be the only user). This driver has also not been kept up to date with the original driver in OpenBSD which supports a few more cards and AES-CBC on newer cards. The newest card currently supported by this driver was released in 2005. Approved by: re (gjb) Relnotes: yes Modified: releng/11.4/share/man/man4/ubsec.4 releng/11.4/sys/dev/ubsec/ubsec.c Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/share/man/man4/ubsec.4 ============================================================================== --- releng/11.4/share/man/man4/ubsec.4 Thu May 14 19:15:21 2020 (r361048) +++ releng/11.4/share/man/man4/ubsec.4 Thu May 14 19:29:08 2020 (r361049) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 16, 2009 +.Dd May 14, 2020 .Dt UBSEC 4 .Os .Sh NAME @@ -48,6 +48,15 @@ module at boot time, place the following line in .Bd -literal -offset indent ubsec_load="YES" .Ed +.Sh DEPRECATION NOTICE +The +.Nm +driver is not present in +.Fx 13.0 +and later. +The majority of crypto algorithms supported by this driver are no longer +used by the kernel in +.Fx 13.0 . .Sh DESCRIPTION The .Nm Modified: releng/11.4/sys/dev/ubsec/ubsec.c ============================================================================== --- releng/11.4/sys/dev/ubsec/ubsec.c Thu May 14 19:15:21 2020 (r361048) +++ releng/11.4/sys/dev/ubsec/ubsec.c Thu May 14 19:29:08 2020 (r361049) @@ -474,6 +474,7 @@ skip_rng: crypto_kregister(sc->sc_cid, CRK_MOD_EXP_CRT, 0); #endif } + gone_in_dev(dev, 13, "Does not support modern crypto algorithms"); return (0); bad4: crypto_unregister_all(sc->sc_cid); From owner-svn-src-all@freebsd.org Thu May 14 19:32:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 30EEB2DC0B1; Thu, 14 May 2020 19:32:42 +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 49NMBf0V2cz3HwJ; Thu, 14 May 2020 19:32:42 +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 08E97182C0; Thu, 14 May 2020 19:32:42 +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 04EJWfR1046675; Thu, 14 May 2020 19:32:41 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJWfTQ046674; Thu, 14 May 2020 19:32:41 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141932.04EJWfTQ046674@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:32:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361050 - releng/11.4/lib/csu X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: releng/11.4/lib/csu X-SVN-Commit-Revision: 361050 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:32:42 -0000 Author: dim Date: Thu May 14 19:32:41 2020 New Revision: 361050 URL: https://svnweb.freebsd.org/changeset/base/361050 Log: MF11 r361047: MFC r360915: Use -fno-asynchronous-unwind-tables to compile lib/csu Summary: In r209294 kib added -fno-asynchronous-unwind-tables to the compile flags for the GNU C startup components. This was done to work around a BFD ld assertion, "no .eh_frame_hdr table will be created", which is produced because of the layout of the startup objects. Add the same flag to lib/csu too, for the same reason. And similarly to r209294, also add -fno-omit-frame-pointer. This is primarily meant to quickly MFC to stable/11, so it can end up in the 11.4 release, as a fix for https://bugs.freebsd.org/246322. Approved by: re (gjb) PR: 246322 Differential Revision: https://reviews.freebsd.org/D24797 Modified: releng/11.4/lib/csu/Makefile.inc Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/lib/csu/Makefile.inc ============================================================================== --- releng/11.4/lib/csu/Makefile.inc Thu May 14 19:29:08 2020 (r361049) +++ releng/11.4/lib/csu/Makefile.inc Thu May 14 19:32:41 2020 (r361050) @@ -6,4 +6,7 @@ SED_FIX_NOTE = -i "" -e '/\.note\.tag/s/progbits/note/ NO_WMISSING_VARIABLE_DECLARATIONS= +CFLAGS+= -fno-asynchronous-unwind-tables +CFLAGS+= -fno-omit-frame-pointer + .include "../Makefile.inc" From owner-svn-src-all@freebsd.org Thu May 14 19:41:46 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 18F302DC38C; Thu, 14 May 2020 19:41:46 +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 49NMP56zQ4z3JQy; Thu, 14 May 2020 19:41:45 +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 EABD018470; Thu, 14 May 2020 19:41:45 +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 04EJfjs5048879; Thu, 14 May 2020 19:41:45 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJfjAw048878; Thu, 14 May 2020 19:41:45 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141941.04EJfjAw048878@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:41:45 +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: r361051 - stable/11/etc/mtree X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/etc/mtree X-SVN-Commit-Revision: 361051 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:41:46 -0000 Author: dim Date: Thu May 14 19:41:45 2020 New Revision: 361051 URL: https://svnweb.freebsd.org/changeset/base/361051 Log: MFC r357929: Remove /usr/include/ssp from BSD.include.dist after r356356 This avoids having to delete it every time with "make delete-old". PR: 242950 Modified: stable/11/etc/mtree/BSD.include.dist Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/mtree/BSD.include.dist ============================================================================== --- stable/11/etc/mtree/BSD.include.dist Thu May 14 19:32:41 2020 (r361050) +++ stable/11/etc/mtree/BSD.include.dist Thu May 14 19:41:45 2020 (r361051) @@ -339,8 +339,6 @@ mac_partition .. .. - ssp - .. sys .. teken From owner-svn-src-all@freebsd.org Thu May 14 19:56:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAD8B2DCF54; Thu, 14 May 2020 19:56:16 +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 49NMjr54gPz3Kq5; Thu, 14 May 2020 19:56:16 +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 A98A018734; Thu, 14 May 2020 19:56:16 +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 04EJuGaa059792; Thu, 14 May 2020 19:56:16 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJuG9w059791; Thu, 14 May 2020 19:56:16 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005141956.04EJuG9w059791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 14 May 2020 19:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361052 - releng/11.4/etc/mtree X-SVN-Group: releng X-SVN-Commit-Author: dim X-SVN-Commit-Paths: releng/11.4/etc/mtree X-SVN-Commit-Revision: 361052 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:56:16 -0000 Author: dim Date: Thu May 14 19:56:16 2020 New Revision: 361052 URL: https://svnweb.freebsd.org/changeset/base/361052 Log: MF11 r361051: MFC r357929: Remove /usr/include/ssp from BSD.include.dist after r356356 This avoids having to delete it every time with "make delete-old". Approved by: re (gjb) PR: 242950 Modified: releng/11.4/etc/mtree/BSD.include.dist Directory Properties: releng/11.4/ (props changed) Modified: releng/11.4/etc/mtree/BSD.include.dist ============================================================================== --- releng/11.4/etc/mtree/BSD.include.dist Thu May 14 19:41:45 2020 (r361051) +++ releng/11.4/etc/mtree/BSD.include.dist Thu May 14 19:56:16 2020 (r361052) @@ -339,8 +339,6 @@ mac_partition .. .. - ssp - .. sys .. teken From owner-svn-src-all@freebsd.org Thu May 14 19:56:56 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 88D982DD005; Thu, 14 May 2020 19:56:56 +0000 (UTC) (envelope-from erj@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 49NMkc34NVz3L0N; Thu, 14 May 2020 19:56:56 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6467A18740; Thu, 14 May 2020 19:56:56 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJuu3F059881; Thu, 14 May 2020 19:56:56 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJusW2059872; Thu, 14 May 2020 19:56:54 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005141956.04EJusW2059872@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 19:56: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: r361053 - in stable/12/sys: dev/e1000 dev/ixgbe dev/ixl net X-SVN-Group: stable-12 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in stable/12/sys: dev/e1000 dev/ixgbe dev/ixl net X-SVN-Commit-Revision: 361053 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:56:56 -0000 Author: erj Date: Thu May 14 19:56:54 2020 New Revision: 361053 URL: https://svnweb.freebsd.org/changeset/base/361053 Log: MFC r360398 and r360902 These commits introduce a new iflib device-dependent method and implements that method in the Intel ethernet network drivers; this method tells iflib if the network interface needs to be restarted when certain events happen. This fixes several issues that occur when VLANs are registered or unregistered with the network interface. PR: 240818, 241785 Sponsored by: Intel Corporation Modified: stable/12/sys/dev/e1000/if_em.c stable/12/sys/dev/ixgbe/if_ix.c stable/12/sys/dev/ixgbe/if_ixv.c stable/12/sys/dev/ixl/if_iavf.c stable/12/sys/dev/ixl/if_ixl.c stable/12/sys/net/ifdi_if.m stable/12/sys/net/iflib.c stable/12/sys/net/iflib.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/e1000/if_em.c ============================================================================== --- stable/12/sys/dev/e1000/if_em.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/dev/e1000/if_em.c Thu May 14 19:56:54 2020 (r361053) @@ -251,6 +251,7 @@ static void em_if_timer(if_ctx_t ctx, uint16_t qid); static void em_if_vlan_register(if_ctx_t ctx, u16 vtag); static void em_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static void em_if_watchdog_reset(if_ctx_t ctx); +static bool em_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static void em_identify_hardware(if_ctx_t ctx); static int em_allocate_pci_resources(if_ctx_t ctx); @@ -400,6 +401,7 @@ static device_method_t em_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, em_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, em_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -437,6 +439,7 @@ static device_method_t igb_if_methods[] = { DEVMETHOD(ifdi_rx_queue_intr_enable, igb_if_rx_queue_intr_enable), DEVMETHOD(ifdi_tx_queue_intr_enable, igb_if_tx_queue_intr_enable), DEVMETHOD(ifdi_debug, em_if_debug), + DEVMETHOD(ifdi_needs_restart, em_if_needs_restart), DEVMETHOD_END }; @@ -4018,6 +4021,25 @@ em_if_get_counter(if_ctx_t ctx, ift_counter cnt) adapter->watchdog_events); default: return (if_get_counter_default(ifp, cnt)); + } +} + +/* em_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +em_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); } } Modified: stable/12/sys/dev/ixgbe/if_ix.c ============================================================================== --- stable/12/sys/dev/ixgbe/if_ix.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/dev/ixgbe/if_ix.c Thu May 14 19:56:54 2020 (r361053) @@ -139,6 +139,7 @@ static void ixgbe_if_update_admin_status(if_ctx_t ctx) static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag); static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); +static bool ixgbe_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); int ixgbe_intr(void *arg); /************************************************************************ @@ -273,6 +274,7 @@ static device_method_t ixgbe_if_methods[] = { DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req), + DEVMETHOD(ifdi_needs_restart, ixgbe_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit), @@ -1232,6 +1234,25 @@ ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req) req->dev_addr, &req->data[i]); return (0); } /* ixgbe_if_i2c_req */ + +/* ixgbe_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for unknown events. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixgbe_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + return (false); + default: + return (true); + } +} /************************************************************************ * ixgbe_add_media_types Modified: stable/12/sys/dev/ixgbe/if_ixv.c ============================================================================== --- stable/12/sys/dev/ixgbe/if_ixv.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/dev/ixgbe/if_ixv.c Thu May 14 19:56:54 2020 (r361053) @@ -110,6 +110,7 @@ static void ixv_if_register_vlan(if_ctx_t, u16); static void ixv_if_unregister_vlan(if_ctx_t, u16); static uint64_t ixv_if_get_counter(if_ctx_t, ift_counter); +static bool ixv_if_needs_restart(if_ctx_t, enum iflib_restart_event); static void ixv_save_stats(struct adapter *); static void ixv_init_stats(struct adapter *); @@ -172,6 +173,7 @@ static device_method_t ixv_if_methods[] = { DEVMETHOD(ifdi_vlan_register, ixv_if_register_vlan), DEVMETHOD(ifdi_vlan_unregister, ixv_if_unregister_vlan), DEVMETHOD(ifdi_get_counter, ixv_if_get_counter), + DEVMETHOD(ifdi_needs_restart, ixv_if_needs_restart), DEVMETHOD_END }; @@ -1189,6 +1191,25 @@ ixv_if_get_counter(if_ctx_t ctx, ift_counter cnt) return (if_get_counter_default(ifp, cnt)); } } /* ixv_if_get_counter */ + +/* ixv_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +ixv_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* XXX: This may not need to return true */ + default: + return (true); + } +} /************************************************************************ * ixv_initialize_transmit_units - Enable transmit unit. Modified: stable/12/sys/dev/ixl/if_iavf.c ============================================================================== --- stable/12/sys/dev/ixl/if_iavf.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/dev/ixl/if_iavf.c Thu May 14 19:56:54 2020 (r361053) @@ -92,6 +92,7 @@ static void iavf_if_vlan_register(if_ctx_t ctx, u16 v static void iavf_if_vlan_unregister(if_ctx_t ctx, u16 vtag); static uint64_t iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt); static void iavf_if_stop(if_ctx_t ctx); +static bool iavf_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); static int iavf_allocate_pci_resources(struct iavf_sc *); static int iavf_reset_complete(struct i40e_hw *); @@ -190,6 +191,7 @@ static device_method_t iavf_if_methods[] = { DEVMETHOD(ifdi_vlan_register, iavf_if_vlan_register), DEVMETHOD(ifdi_vlan_unregister, iavf_if_vlan_unregister), DEVMETHOD(ifdi_get_counter, iavf_if_get_counter), + DEVMETHOD(ifdi_needs_restart, iavf_if_needs_restart), DEVMETHOD_END }; @@ -1474,7 +1476,27 @@ iavf_if_get_counter(if_ctx_t ctx, ift_counter cnt) } } - +/* iavf_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning true for every event. + * + * @returns true if iflib needs to reinit the interface + */ +static bool +iavf_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + /* This case must return true if VLAN anti-spoof checks are + * enabled by the PF driver for the VF. + */ + default: + return (true); + } +} + static void iavf_free_pci_resources(struct iavf_sc *sc) { Modified: stable/12/sys/dev/ixl/if_ixl.c ============================================================================== --- stable/12/sys/dev/ixl/if_ixl.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/dev/ixl/if_ixl.c Thu May 14 19:56:54 2020 (r361053) @@ -117,6 +117,7 @@ static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); static int ixl_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req); static int ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_t data); +static bool ixl_if_needs_restart(if_ctx_t ctx, enum iflib_restart_event event); #ifdef PCI_IOV static void ixl_if_vflr_handle(if_ctx_t ctx); #endif @@ -187,6 +188,7 @@ static device_method_t ixl_if_methods[] = { DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), + DEVMETHOD(ifdi_needs_restart, ixl_if_needs_restart), #ifdef PCI_IOV DEVMETHOD(ifdi_iov_init, ixl_if_iov_init), DEVMETHOD(ifdi_iov_uninit, ixl_if_iov_uninit), @@ -1650,6 +1652,24 @@ ixl_if_priv_ioctl(if_ctx_t ctx, u_long command, caddr_ } return (error); +} + +/* ixl_if_needs_restart - Tell iflib when the driver needs to be reinitialized + * @ctx: iflib context + * @event: event code to check + * + * Defaults to returning false for every event. + * + * @returns true if iflib needs to reinit the interface, false otherwise + */ +static bool +ixl_if_needs_restart(if_ctx_t ctx __unused, enum iflib_restart_event event) +{ + switch (event) { + case IFLIB_RESTART_VLAN_CONFIG: + default: + return (false); + } } static int Modified: stable/12/sys/net/ifdi_if.m ============================================================================== --- stable/12/sys/net/ifdi_if.m Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/net/ifdi_if.m Thu May 14 19:56:54 2020 (r361053) @@ -169,6 +169,12 @@ CODE { } return (0); } + + static bool + null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) + { + return (true); + } }; # @@ -456,3 +462,8 @@ METHOD int sysctl_int_delay { METHOD void debug { if_ctx_t _ctx; } DEFAULT null_void_op; + +METHOD bool needs_restart { + if_ctx_t _ctx; + enum iflib_restart_event _event; +} DEFAULT null_needs_restart; Modified: stable/12/sys/net/iflib.c ============================================================================== --- stable/12/sys/net/iflib.c Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/net/iflib.c Thu May 14 19:56:54 2020 (r361053) @@ -4297,10 +4297,13 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag return; CTX_LOCK(ctx); + /* Driver may need all untagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_REGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } @@ -4316,10 +4319,13 @@ iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vt return; CTX_LOCK(ctx); + /* Driver may need all tagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_UNREGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } Modified: stable/12/sys/net/iflib.h ============================================================================== --- stable/12/sys/net/iflib.h Thu May 14 19:56:16 2020 (r361052) +++ stable/12/sys/net/iflib.h Thu May 14 19:56:54 2020 (r361053) @@ -369,6 +369,15 @@ typedef enum { /* + * These enum values are used in iflib_needs_restart to indicate to iflib + * functions whether or not the interface needs restarting when certain events + * happen. + */ +enum iflib_restart_event { + IFLIB_RESTART_VLAN_CONFIG, +}; + +/* * field accessors */ void *iflib_get_softc(if_ctx_t ctx); From owner-svn-src-all@freebsd.org Thu May 14 19:57:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 615852DD0CC; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@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 49NMlj21Nhz3L9T; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 27D1118756; Thu, 14 May 2020 19:57:53 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EJvrqX059991; Thu, 14 May 2020 19:57:53 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EJvrdP059990; Thu, 14 May 2020 19:57:53 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <202005141957.04EJvrdP059990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Thu, 14 May 2020 19:57:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361054 - head/contrib/lib9p X-SVN-Group: head X-SVN-Commit-Author: jceel X-SVN-Commit-Paths: head/contrib/lib9p X-SVN-Commit-Revision: 361054 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 19:57:53 -0000 Author: jceel Date: Thu May 14 19:57:52 2020 New Revision: 361054 URL: https://svnweb.freebsd.org/changeset/base/361054 Log: Import lib9p 7ddb1164407da19b9b1afb83df83ae65a71a9a66. Approved by: trasz MFC after: 1 month Sponsored by: Conclusive Engineering (development), vStack.com (funding) Added: head/contrib/lib9p/ - copied from r361050, vendor/lib9p/dist/ From owner-svn-src-all@freebsd.org Thu May 14 20:07:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4BF6C2DD6E3; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@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 49NMyH1JJfz3Lth; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 27CBF18933; Thu, 14 May 2020 20:07:03 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EK732F065846; Thu, 14 May 2020 20:07:03 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EK72Ow065844; Thu, 14 May 2020 20:07:02 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142007.04EK72Ow065844@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:07:02 +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: r361055 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361055 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:07:03 -0000 Author: erj Date: Thu May 14 20:07:02 2020 New Revision: 361055 URL: https://svnweb.freebsd.org/changeset/base/361055 Log: MFC r360398: iflib: Stop interface before (un)registering VLAN This is now misleadingly named for stable/11; this was meant to fix an issue in an out-of-tree iavf(4) driver that uses iflib. This commit actually introduces a new driver-dependent function that iflib-using drivers can implement in order to tell iflib whether an interface restart is needed for certain events. For this commit, this function is only used for VLAN register/unregister events. Sponsored by: Intel Corporation Modified: stable/11/sys/net/ifdi_if.m stable/11/sys/net/iflib.c stable/11/sys/net/iflib.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ifdi_if.m ============================================================================== --- stable/11/sys/net/ifdi_if.m Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/ifdi_if.m Thu May 14 20:07:02 2020 (r361055) @@ -111,6 +111,12 @@ CODE { { return (ENOTSUP); } + + static bool + null_needs_restart(if_ctx_t _ctx __unused, enum iflib_restart_event _event __unused) + { + return (true); + } }; # @@ -341,3 +347,8 @@ METHOD int sysctl_int_delay { METHOD void debug { if_ctx_t _ctx; } DEFAULT null_void_op; + +METHOD bool needs_restart { + if_ctx_t _ctx; + enum iflib_restart_event _event; +} DEFAULT null_needs_restart; Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/iflib.c Thu May 14 20:07:02 2020 (r361055) @@ -4159,10 +4159,13 @@ iflib_vlan_register(void *arg, if_t ifp, uint16_t vtag return; CTX_LOCK(ctx); + /* Driver may need all untagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_REGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } @@ -4178,10 +4181,13 @@ iflib_vlan_unregister(void *arg, if_t ifp, uint16_t vt return; CTX_LOCK(ctx); + /* Driver may need all tagged packets to be flushed */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_stop(ctx); IFDI_VLAN_UNREGISTER(ctx, vtag); - /* Re-init to load the changes */ - if (if_getcapenable(ifp) & IFCAP_VLAN_HWFILTER) - iflib_if_init_locked(ctx); + /* Re-init to load the changes, if required */ + if (IFDI_NEEDS_RESTART(ctx, IFLIB_RESTART_VLAN_CONFIG)) + iflib_init_locked(ctx); CTX_UNLOCK(ctx); } Modified: stable/11/sys/net/iflib.h ============================================================================== --- stable/11/sys/net/iflib.h Thu May 14 19:57:52 2020 (r361054) +++ stable/11/sys/net/iflib.h Thu May 14 20:07:02 2020 (r361055) @@ -328,6 +328,15 @@ typedef enum { /* + * These enum values are used in iflib_needs_restart to indicate to iflib + * functions whether or not the interface needs restarting when certain events + * happen. + */ +enum iflib_restart_event { + IFLIB_RESTART_VLAN_CONFIG, +}; + +/* * field accessors */ void *iflib_get_softc(if_ctx_t ctx); From owner-svn-src-all@freebsd.org Thu May 14 20:17:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 017902DDB85; Thu, 14 May 2020 20:17: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 49NN9x6CLHz3MXk; Thu, 14 May 2020 20:17:09 +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 D04EC18B35; Thu, 14 May 2020 20:17:09 +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 04EKH9aZ071967; Thu, 14 May 2020 20:17:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKH9pQ071966; Thu, 14 May 2020 20:17:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005142017.04EKH9pQ071966@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 20:17:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361056 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361056 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:17:10 -0000 Author: kib Date: Thu May 14 20:17:09 2020 New Revision: 361056 URL: https://svnweb.freebsd.org/changeset/base/361056 Log: Fix r361037. Reorder flag manipulations and use barrier to ensure that the program order is followed by compiler and CPU, for unlocked reader of so_state. In collaboration with: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24842 Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Thu May 14 20:07:02 2020 (r361055) +++ head/sys/kern/uipc_socket.c Thu May 14 20:17:09 2020 (r361056) @@ -4016,8 +4016,17 @@ soisdisconnected(struct socket *so) { SOCK_LOCK(so); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); if (!SOLISTENING(so)) { SOCK_UNLOCK(so); From owner-svn-src-all@freebsd.org Thu May 14 20:23:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E30F2DE4BE; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@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 49NNKB1wfTz3NjS; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C92518D17; Thu, 14 May 2020 20:23:26 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EKNQww078242; Thu, 14 May 2020 20:23:26 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKNQpL078241; Thu, 14 May 2020 20:23:26 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142023.04EKNQpL078241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:23:26 +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: r361057 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361057 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:23:26 -0000 Author: erj Date: Thu May 14 20:23:25 2020 New Revision: 361057 URL: https://svnweb.freebsd.org/changeset/base/361057 Log: Partially MFC r353967: iflib: call ether_ifdetach and netmap_detach before stop This MFCs most of the patch except for the parts where the new iflib_unregister_vlan_handlers() function is called in the pseudo device register/deregister functions since those functions don't exist in FreeBSD 11. This re-ordering can fix a potential panic. Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 20:17:09 2020 (r361056) +++ stable/11/sys/net/iflib.c Thu May 14 20:23:25 2020 (r361057) @@ -731,6 +731,8 @@ static int iflib_legacy_setup(if_ctx_t ctx, driver_fil static void iflib_txq_check_drain(iflib_txq_t txq, int budget); static uint32_t iflib_txq_can_drain(struct ifmp_ring *); static int iflib_register(if_ctx_t); +static void iflib_deregister(if_ctx_t); +static void iflib_unregister_vlan_handlers(if_ctx_t ctx); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); static void iflib_add_device_sysctl_post(if_ctx_t ctx); @@ -4546,18 +4548,16 @@ iflib_device_deregister(if_ctx_t ctx) ctx->ifc_flags |= IFC_IN_DETACH; STATE_UNLOCK(ctx); + /* Unregister VLAN handlers before calling iflib_stop() */ + iflib_unregister_vlan_handlers(ctx); + + iflib_netmap_detach(ifp); + ether_ifdetach(ifp); + CTX_LOCK(ctx); iflib_stop(ctx); CTX_UNLOCK(ctx); - /* Unregister VLAN events */ - if (ctx->ifc_vlan_attach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); - if (ctx->ifc_vlan_detach_event != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); - - iflib_netmap_detach(ifp); - ether_ifdetach(ifp); if (ctx->ifc_led_dev != NULL) led_destroy(ctx->ifc_led_dev); /* XXX drain any dependent tasks */ @@ -4825,6 +4825,43 @@ iflib_register(if_ctx_t ctx) return (0); } +static void +iflib_unregister_vlan_handlers(if_ctx_t ctx) +{ + /* Unregister VLAN events */ + if (ctx->ifc_vlan_attach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_config, ctx->ifc_vlan_attach_event); + ctx->ifc_vlan_attach_event = NULL; + } + if (ctx->ifc_vlan_detach_event != NULL) { + EVENTHANDLER_DEREGISTER(vlan_unconfig, ctx->ifc_vlan_detach_event); + ctx->ifc_vlan_detach_event = NULL; + } + +} + +static void +iflib_deregister(if_ctx_t ctx) +{ + if_t ifp = ctx->ifc_ifp; + + /* Remove all media */ + ifmedia_removeall(&ctx->ifc_media); + + /* Ensure that VLAN event handlers are unregistered */ + iflib_unregister_vlan_handlers(ctx); + + /* Release kobject reference */ + kobj_delete((kobj_t) ctx, NULL); + + /* Free the ifnet structure */ + if_free(ifp); + + STATE_LOCK_DESTROY(ctx); + + /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ + CTX_LOCK_DESTROY(ctx); +} static int iflib_queues_alloc(if_ctx_t ctx) From owner-svn-src-all@freebsd.org Thu May 14 20:43:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6C2A2DF161; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@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 49NNmc5jl1z3Q5r; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BF7D5190C7; Thu, 14 May 2020 20:43:44 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EKhipp090013; Thu, 14 May 2020 20:43:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKhivo090012; Thu, 14 May 2020 20:43:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142043.04EKhivo090012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 20:43:44 +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: r361058 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361058 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:43:45 -0000 Author: erj Date: Thu May 14 20:43:44 2020 New Revision: 361058 URL: https://svnweb.freebsd.org/changeset/base/361058 Log: MFC r354207: iflib: cleanup memory leaks on driver detach Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 20:23:25 2020 (r361057) +++ stable/11/sys/net/iflib.c Thu May 14 20:43:44 2020 (r361058) @@ -1613,6 +1613,14 @@ iflib_txq_destroy(iflib_txq_t txq) for (int i = 0; i < txq->ift_size; i++) iflib_txsd_destroy(ctx, txq, i); + + if (txq->ift_br != NULL) { + ifmp_ring_free(txq->ift_br); + txq->ift_br = NULL; + } + + mtx_destroy(&txq->ift_mtx); + if (txq->ift_sds.ifsd_map != NULL) { free(txq->ift_sds.ifsd_map, M_IFLIB); txq->ift_sds.ifsd_map = NULL; @@ -1633,6 +1641,9 @@ iflib_txq_destroy(iflib_txq_t txq) bus_dma_tag_destroy(txq->ift_tso_desc_tag); txq->ift_tso_desc_tag = NULL; } + if (txq->ift_ifdi != NULL) { + free(txq->ift_ifdi, M_IFLIB); + } } static void @@ -2104,6 +2115,8 @@ iflib_rx_sds_free(iflib_rxq_t rxq) free(rxq->ifr_fl, M_IFLIB); rxq->ifr_fl = NULL; rxq->ifr_cq_gen = rxq->ifr_cq_cidx = rxq->ifr_cq_pidx = 0; + free(rxq->ifr_ifdi, M_IFLIB); + rxq->ifr_ifdi = NULL; } } @@ -5095,9 +5108,9 @@ iflib_tx_structures_free(if_ctx_t ctx) int i, j; for (i = 0; i < NTXQSETS(ctx); i++, txq++) { - iflib_txq_destroy(txq); for (j = 0; j < ctx->ifc_nhwtxqs; j++) iflib_dma_free(&txq->ift_ifdi[j]); + iflib_txq_destroy(txq); } free(ctx->ifc_txqs, M_IFLIB); ctx->ifc_txqs = NULL; From owner-svn-src-all@freebsd.org Thu May 14 20:43:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A41ED2DF1B8; Thu, 14 May 2020 20:43:59 +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 49NNmv3np5z3QCM; Thu, 14 May 2020 20:43: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 7D7A0190C8; Thu, 14 May 2020 20:43: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 04EKhxFF090066; Thu, 14 May 2020 20:43:59 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EKhx0A090065; Thu, 14 May 2020 20:43:59 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005142043.04EKhx0A090065@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 14 May 2020 20:43: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: r361059 - stable/12/sys/netpfil/ipfw X-SVN-Group: stable-12 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/12/sys/netpfil/ipfw X-SVN-Commit-Revision: 361059 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 20:43:59 -0000 Author: emaste Date: Thu May 14 20:43:59 2020 New Revision: 361059 URL: https://svnweb.freebsd.org/changeset/base/361059 Log: MFC r360594: ipfw: whitespace fix in SCTP_ABORT_ASSOCIATION case statement comment PR: Neel Chauhan Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- stable/12/sys/netpfil/ipfw/ip_fw2.c Thu May 14 20:43:44 2020 (r361058) +++ stable/12/sys/netpfil/ipfw/ip_fw2.c Thu May 14 20:43:59 2020 (r361059) @@ -936,7 +936,7 @@ send_reject6(struct ip_fw_args *args, int code, u_int * If the packet contains an ABORT chunk, don't * reply. * XXX: We should search through all chunks, - * but don't do to avoid attacks. + * but do not do that to avoid attacks. */ v_tag = 0; break; @@ -1054,7 +1054,7 @@ send_reject(struct ip_fw_args *args, int code, int ipl * If the packet contains an ABORT chunk, don't * reply. * XXX: We should search through all chunks, - * but don't do to avoid attacks. + * but do not do that to avoid attacks. */ v_tag = 0; break; From owner-svn-src-all@freebsd.org Thu May 14 21:02:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A0B5E2DFB46; Thu, 14 May 2020 21:02:25 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: from spindle.one-eyed-alien.net (spindle.one-eyed-alien.net [199.48.129.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49NPB870ffz3wZG; Thu, 14 May 2020 21:02:24 +0000 (UTC) (envelope-from brooks@spindle.one-eyed-alien.net) Received: by spindle.one-eyed-alien.net (Postfix, from userid 3001) id 767513C0199; Thu, 14 May 2020 21:02:24 +0000 (UTC) Date: Thu, 14 May 2020 21:02:24 +0000 From: Brooks Davis To: Kyle Evans Cc: src-committers , svn-src-all , svn-src-head Subject: Re: svn commit: r360833 - head Message-ID: <20200514210224.GE60902@spindle.one-eyed-alien.net> References: <202005090201.04921Tpf028388@repo.freebsd.org> <20200511181027.GA60902@spindle.one-eyed-alien.net> <20200512221603.GB60902@spindle.one-eyed-alien.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="VUDLurXRWRKrGuMn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Rspamd-Queue-Id: 49NPB870ffz3wZG X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of brooks@spindle.one-eyed-alien.net has no SPF policy when checking 199.48.129.229) smtp.mailfrom=brooks@spindle.one-eyed-alien.net X-Spamd-Result: default: False [-6.53 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; DMARC_NA(0.00)[freebsd.org]; AUTH_NA(1.00)[]; IP_SCORE(-3.63)[ip: (-9.56), ipnet: 199.48.128.0/22(-4.77), asn: 36236(-3.79), country: US(-0.05)]; TO_DN_ALL(0.00)[]; R_SPF_NA(0.00)[]; SIGNED_PGP(-2.00)[]; FORGED_SENDER(0.30)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net]; RCVD_COUNT_ZERO(0.00)[0]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:36236, ipnet:199.48.128.0/22, country:US]; FROM_NEQ_ENVFROM(0.00)[brooks@freebsd.org,brooks@spindle.one-eyed-alien.net] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:02:25 -0000 --VUDLurXRWRKrGuMn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, May 12, 2020 at 09:01:33PM -0500, Kyle Evans wrote: > On Tue, May 12, 2020 at 5:16 PM Brooks Davis wrote: > > > > On Mon, May 11, 2020 at 01:45:14PM -0500, Kyle Evans wrote: > > > On Mon, May 11, 2020 at 1:10 PM Brooks Davis wro= te: > > > > > > > > On Sat, May 09, 2020 at 02:01:29AM +0000, Kyle Evans wrote: > > > > > Author: kevans > > > > > Date: Sat May 9 02:01:29 2020 > > > > > New Revision: 360833 > > > > > URL: https://svnweb.freebsd.org/changeset/base/360833 > > > > > > > > > > Log: > > > > > installworld: attempt a certctl rehash at the tail end > > > > > > > > > > This can be run as root or normal user with no problem; if they= hadn't > > > > > twisted the WITHOUT_CAROOT knob, we'll attempt to use the host = certctl to > > > > > rehash the DESTDIR. This would allow one to build systems WITHO= UT_OPENSSL + > > > > > WITH_CAROOT with a populated /etc/ssl that they can then use wi= th an > > > > > appropriate *ssl from somewhere else. > > > > > > > > > > Cross-builds are fine because this will always use the host cer= tctl, or just > > > > > nag if it's missing and it wasn't a WITHOUT_CAROOT build. > > > > > > > > > > MFC after: 1 week > > > > > Differential Revision: https://reviews.freebsd.org/D24641 > > > > > > > > > > Modified: > > > > > head/Makefile.inc1 > > > > > > > > > > Modified: head/Makefile.inc1 > > > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > > > > > --- head/Makefile.inc1 Sat May 9 01:48:08 2020 (r3= 60832) > > > > > +++ head/Makefile.inc1 Sat May 9 02:01:29 2020 (r3= 60833) > > > > > @@ -1403,6 +1403,16 @@ distributeworld installworld stageworld: _= installcheck > > > > > ${DESTDIR}/${DISTDIR}/${dist}.debug.meta > > > > > .endfor > > > > > .endif > > > > > +.elif make(installworld) && ${MK_CAROOT} !=3D "no" > > > > > + # We could make certctl a bootstrap tool, but it requires O= penSSL and > > > > > + # friends, which we likely don't want. We'll rehash on a b= est-effort > > > > > + # basis, otherwise we'll just mention that we're not doing = it to raise > > > > > + # awareness. > > > > > + @if which certctl>/dev/null; then \ > > > > > + certctl rehash \ > > > > > > > > Does this update METALOG with the added links? > > > > > > > > It seems a little weird to rely on DESTDIR from the environment. > > > > > > > > In general I'm not enthusiastic about additions to installworld tha= t do > > > > anything other than copying files, creating links, etc in simple wa= ys. > > > > > > I will happily back this out if I can get some qualified eyes to > > > review/improve it. It does not update METALOG, and it probably should. > > > Agreed on DESTDIR. As for point #3, I guess we can continue spreading > > > `certctl rehash` all over the tree in various points that may need it; > > > the release(7) scripts will need to be done if we don't do it here at > > > a minimum, and I haven't put much thought into it beyond that. > > > > I'm not in a rush to back this out given that it's solving a real > > problem, but lets talk about improvements. > > > > I kind of feel like this belongs in distribution (which I think would > > deal with release scripts) or in etcupdate/mergemaster, but I'm not > > sure either of those are correct. I'd be happy to review changes to > > update the METALOG (I guess we'd extend certctl with an option to do > > that?) I think that's the most important things because we really > > should be routinely validating that DESTDIR only contains things in the > > METALOG. A quick and dirty fix for the DESTDIR weirdness might be addi= ng > > "env DESTDIR=3D${DESTDIR}" so it's explicit. > > >=20 > Got it- not an egregious enough violation to promptly back out, but we > will work towards a better solution. >=20 > For the larger picture, distribution is probably the correct spot for > this; we currently rehash at the following points: >=20 > - mergemaster/etcupdate > - freebsd-update > - post-install of the caroot pkg (pkgbase) >=20 > This leaves two primary final blind spots, which this commit was > attempting to resolve: >=20 > 1.) Install media (including VM images) > 2.) Initial installs (e.g. from bsdinstall) >=20 > #1 could be solved by directly adding it to the release(7) scripts and > #2 could be solved by having bsdinstall do it at config time, but > there seem to be multiple potential points that could instead hit both > (with a single stone) while also making covering the array of other > images that re@ produces (e.g. AWS images) and perhaps other points > that we've not immediately considered. >=20 > To this end, distribution or installworld are probably equally > sufficient, but I'm incredibly unfamiliar with the former. My > understanding from glancing at it over the years is that it may be > executed into a tempdir and merged with mergemaster/etcupdate, or > directly into the new root if we're looking at a new install that > doesn't have potential local changes to merge in. My understanding of distribution is that it's the things that don't make sense to update automatically (e.g. config files that have to be merged. For #1 above distribution clearly solves the problem. For #2 I kind of think this is the installers job. > Part of the problem that I see in my head is probably solved by just > having a var that mergemaster/etcupdate can pass in to distribution to > not bother with the rehash. We want to keep the mergemaster/etcupdate > rehash because if they're running then the target's certainly not been > rehashed. OTOH, we probably don't want to rehash multiple times in > that pipeline- from a certctl standpoint, it's completely harmless, > but it's not the most effective use of system resources and probably > looks a bit bad. In some ways I wonder if we actually want a three phase split: installworld (programs, fixed data, etc), distribution (config bits), and regen (generate files based on the -- possibly altered -- contents of config files, etc. If we could split out the regen into (e.g.) an installed shell script or set of scripts then we could call that from the installer, etc. That might provide a generic solution. So far this isn't a well thought out idea, but maybe there's something here? Presumably we'd need to bolt a compatibility shim onto distribution to start out given how much blowback I got for breaking some nonsensical orderings of the top-level targets when adding METALOG support. -- Brooks --VUDLurXRWRKrGuMn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJevbHfAAoJEKzQXbSebgfAXz4IAKJe/GUr4dMARu12mHKUuHmG bM4tktcHFy3McgwyHlHg6nZluFKx33USbA6jrK8kAu+hLOzyULmL9UgfmAIi7Wf8 VGJRJJcK99kfsPxFzEKFOpJvcOhN6pTOdJbisfXEvgFtRXJAhdLtqcM8pWk9Nwow J9O5N3Zy8BStmKiXuCXLBMdxWJSXkVHVRqH3KiouIAVEowlVua1+oySg4V3E6unL mCQBpXLc/nA6Dkv4FDtaYfOfUdZssY0IVXtOFZ+mPCS7GUkJTAxlz6GRuALYm6He 1iHAdg6qSB80X0pJxfn8syN5Ysco+vX3i7cLU95r6AUpLliwrzB/3BjMFylpWM0= =QAcX -----END PGP SIGNATURE----- --VUDLurXRWRKrGuMn-- From owner-svn-src-all@freebsd.org Thu May 14 21:12:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A65842DFFD4; Thu, 14 May 2020 21:12:09 +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 49NPPP3lxzz3xBS; Thu, 14 May 2020 21:12:09 +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 7C0C519650; Thu, 14 May 2020 21:12:09 +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 04ELC9HP008509; Thu, 14 May 2020 21:12:09 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELC85X008504; Thu, 14 May 2020 21:12:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005142112.04ELC85X008504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 14 May 2020 21:12:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361060 - in head: include lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/gen X-SVN-Commit-Revision: 361060 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:12:09 -0000 Author: kib Date: Thu May 14 21:12:08 2020 New Revision: 361060 URL: https://svnweb.freebsd.org/changeset/base/361060 Log: Add memalign(3), mostly for glibc compatibility. Reviewed by: emaste, imp (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D24307 Added: head/lib/libc/gen/memalign.c (contents, props changed) Modified: head/include/malloc_np.h head/lib/libc/gen/Makefile.inc head/lib/libc/gen/Symbol.map Modified: head/include/malloc_np.h ============================================================================== --- head/include/malloc_np.h Thu May 14 20:43:59 2020 (r361059) +++ head/include/malloc_np.h Thu May 14 21:12:08 2020 (r361060) @@ -122,6 +122,9 @@ size_t __sallocx(const void *ptr, int flags); void __dallocx(void *ptr, int flags); void __sdallocx(void *ptr, size_t size, int flags); size_t __nallocx(size_t size, int flags); + +void *memalign(size_t, size_t) __malloc_like __alloc_align(1) + __alloc_size(2); __END_DECLS #undef __MyBool Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Thu May 14 20:43:59 2020 (r361059) +++ head/lib/libc/gen/Makefile.inc Thu May 14 21:12:08 2020 (r361060) @@ -98,6 +98,7 @@ SRCS+= __getosreldate.c \ libc_dlopen.c \ lockf.c \ lrand48.c \ + memalign.c \ mrand48.c \ nftw.c \ nftw-compat11.c \ Modified: head/lib/libc/gen/Symbol.map ============================================================================== --- head/lib/libc/gen/Symbol.map Thu May 14 20:43:59 2020 (r361059) +++ head/lib/libc/gen/Symbol.map Thu May 14 21:12:08 2020 (r361060) @@ -423,6 +423,7 @@ FBSD_1.5 { }; FBSD_1.6 { + memalign; sigandset; sigisemptyset; sigorset; Added: head/lib/libc/gen/memalign.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libc/gen/memalign.c Thu May 14 21:12:08 2020 (r361060) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2020 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed by Konstantin Belousov + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +void * +memalign(size_t align, size_t size) +{ + return (aligned_alloc(align, roundup(size, align))); +} From owner-svn-src-all@freebsd.org Thu May 14 21:36:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A4AC62E0953; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@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 49NPy33yG1z3yNF; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8276E19A53; Thu, 14 May 2020 21:36:59 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ELaxv4021147; Thu, 14 May 2020 21:36:59 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELax9a021145; Thu, 14 May 2020 21:36:59 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142136.04ELax9a021145@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 21:36:59 +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: r361061 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361061 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:36:59 -0000 Author: erj Date: Thu May 14 21:36:59 2020 New Revision: 361061 URL: https://svnweb.freebsd.org/changeset/base/361061 Log: MFC r356310: iflib: Prevent watchdog from resetting idle queues Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 21:12:08 2020 (r361060) +++ stable/11/sys/net/iflib.c Thu May 14 21:36:59 2020 (r361061) @@ -2144,8 +2144,11 @@ iflib_timer(void *arg) (sctx->isc_pause_frames == 0))) goto hung; - if (ifmp_ring_is_stalled(txq->ift_br)) + if (txq->ift_qstatus != IFLIB_QUEUE_IDLE && + ifmp_ring_is_stalled(txq->ift_br)) { + KASSERT(ctx->ifc_link_state == LINK_STATE_UP, ("queue can't be marked as hung if interface is down")); txq->ift_qstatus = IFLIB_QUEUE_HUNG; + } txq->ift_cleaned_prev = txq->ift_cleaned; /* handle any laggards */ if (txq->ift_db_pending) From owner-svn-src-all@freebsd.org Thu May 14 21:59:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 259D32E18BE; Thu, 14 May 2020 21:59:24 +0000 (UTC) (envelope-from erj@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 49NQRw09L6z40rT; Thu, 14 May 2020 21:59:24 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F082019E31; Thu, 14 May 2020 21:59:23 +0000 (UTC) (envelope-from erj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ELxNQ4033157; Thu, 14 May 2020 21:59:23 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ELxNnA033156; Thu, 14 May 2020 21:59:23 GMT (envelope-from erj@FreeBSD.org) Message-Id: <202005142159.04ELxNnA033156@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Thu, 14 May 2020 21:59: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: r361063 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: erj X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 361063 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 21:59:24 -0000 Author: erj Date: Thu May 14 21:59:23 2020 New Revision: 361063 URL: https://svnweb.freebsd.org/changeset/base/361063 Log: Partially MFC r354344: iflib: properly release memory allocated for DMA This also removes the unused function iflib_deregister(); accidentally introduced in a previous MFC. Sponsored by: Intel Corporation Modified: stable/11/sys/net/iflib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/iflib.c ============================================================================== --- stable/11/sys/net/iflib.c Thu May 14 21:46:12 2020 (r361062) +++ stable/11/sys/net/iflib.c Thu May 14 21:59:23 2020 (r361063) @@ -731,7 +731,6 @@ static int iflib_legacy_setup(if_ctx_t ctx, driver_fil static void iflib_txq_check_drain(iflib_txq_t txq, int budget); static uint32_t iflib_txq_can_drain(struct ifmp_ring *); static int iflib_register(if_ctx_t); -static void iflib_deregister(if_ctx_t); static void iflib_unregister_vlan_handlers(if_ctx_t ctx); static void iflib_init_locked(if_ctx_t ctx); static void iflib_add_device_sysctl_pre(if_ctx_t ctx); @@ -1596,10 +1595,8 @@ iflib_txsd_destroy(if_ctx_t ctx, iflib_txq_t txq, int { bus_dmamap_t map; - map = NULL; - if (txq->ift_sds.ifsd_map != NULL) + if (txq->ift_sds.ifsd_map != NULL) { map = txq->ift_sds.ifsd_map[i]; - if (map != NULL) { bus_dmamap_unload(txq->ift_desc_tag, map); bus_dmamap_destroy(txq->ift_desc_tag, map); txq->ift_sds.ifsd_map[i] = NULL; @@ -2008,9 +2005,6 @@ iflib_fl_bufs_free(iflib_fl_t fl) if (fl->ifl_sds.ifsd_map != NULL) { bus_dmamap_t sd_map = fl->ifl_sds.ifsd_map[i]; bus_dmamap_unload(fl->ifl_desc_tag, sd_map); - // XXX: Should this get moved out? - if (iflib_in_detach(fl->ifl_rxq->ifr_ctx)) - bus_dmamap_destroy(fl->ifl_desc_tag, sd_map); } if (*sd_m != NULL) { m_init(*sd_m, M_NOWAIT, MT_DATA, 0); @@ -4856,29 +4850,6 @@ iflib_unregister_vlan_handlers(if_ctx_t ctx) } -static void -iflib_deregister(if_ctx_t ctx) -{ - if_t ifp = ctx->ifc_ifp; - - /* Remove all media */ - ifmedia_removeall(&ctx->ifc_media); - - /* Ensure that VLAN event handlers are unregistered */ - iflib_unregister_vlan_handlers(ctx); - - /* Release kobject reference */ - kobj_delete((kobj_t) ctx, NULL); - - /* Free the ifnet structure */ - if_free(ifp); - - STATE_LOCK_DESTROY(ctx); - - /* ether_ifdetach calls if_qflush - lock must be destroy afterwards*/ - CTX_LOCK_DESTROY(ctx); -} - static int iflib_queues_alloc(if_ctx_t ctx) { @@ -5173,8 +5144,12 @@ static void iflib_rx_structures_free(if_ctx_t ctx) { iflib_rxq_t rxq = ctx->ifc_rxqs; + if_shared_ctx_t sctx = ctx->ifc_sctx; + int i, j; - for (int i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (i = 0; i < ctx->ifc_softc_ctx.isc_nrxqsets; i++, rxq++) { + for (j = 0; j < sctx->isc_nrxqs; j++) + iflib_dma_free(&rxq->ifr_ifdi[j]); iflib_rx_sds_free(rxq); } free(ctx->ifc_rxqs, M_IFLIB); From owner-svn-src-all@freebsd.org Thu May 14 22:18:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EE5DC2E1F29; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@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 49NQsc608pz41gS; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AEDEB1A1F0; Thu, 14 May 2020 22:18:12 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04EMIC0v045507; Thu, 14 May 2020 22:18:12 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04EMICgT045505; Thu, 14 May 2020 22:18:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005142218.04EMICgT045505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Thu, 14 May 2020 22:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361064 - head/sys/amd64/vmm X-SVN-Group: head X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: head/sys/amd64/vmm X-SVN-Commit-Revision: 361064 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:18:13 -0000 Author: grehan Date: Thu May 14 22:18:12 2020 New Revision: 361064 URL: https://svnweb.freebsd.org/changeset/base/361064 Log: Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that support CPUID 0x15, the local APIC frequency is determined directly from the reported crystal clock to avoid calibration against the 8254 timer. However, the local APIC frequency implemented by bhyve is 128MHz, where most h/w systems report frequencies around 25MHz. This shows up on OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard when using VNC, since the kernel's timers are now much shorter. Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall back to using the 8254 to calibrate the local APIC frequency. Future work could be to compute values returned for 0x15 that would match the host TSC and bhyve local APIC frequency, though all dependencies on this would need to be examined (for example, Linux will start using 0x16 for some hosts). PR: 246321 Reported by: Jason Tubnor (and tested) Reviewed by: jhb Approved by: jhb, bz (mentor) MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D24837 Modified: head/sys/amd64/vmm/x86.c head/sys/amd64/vmm/x86.h Modified: head/sys/amd64/vmm/x86.c ============================================================================== --- head/sys/amd64/vmm/x86.c Thu May 14 21:59:23 2020 (r361063) +++ head/sys/amd64/vmm/x86.c Thu May 14 22:18:12 2020 (r361064) @@ -560,6 +560,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: head/sys/amd64/vmm/x86.h ============================================================================== --- head/sys/amd64/vmm/x86.h Thu May 14 21:59:23 2020 (r361063) +++ head/sys/amd64/vmm/x86.h Thu May 14 22:18:12 2020 (r361064) @@ -41,6 +41,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-all@freebsd.org Thu May 14 22:20:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58D922E21B9; Thu, 14 May 2020 22:20:05 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-il1-f180.google.com (mail-il1-f180.google.com [209.85.166.180]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NQvn1VX4z421m; Thu, 14 May 2020 22:20:04 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-il1-f180.google.com with SMTP id b15so441164ilq.12; Thu, 14 May 2020 15:20:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qw5qxaMeg4bbS/7V5LrYkLbTbDspHbz1opxAllIMvfA=; b=kCy3mRkxkNiRN2DE/pI3zpzRaIxkcZlUAGPaKoE+JjjHaHcwg5s+t+85li6IXeOLsa ZimCwB1YZhb7eA095SHzCnaFwp+ZFvux7kuO8xW0wPEZWwJtdrEydm8ATUqJkwXccjvO DOPOplI4KjVBZVFpXcxr85aUNx1jPt02rk8oCcr5QGBRTbScyP41Qhu9IdAs2b/6yQpF 1wn9q5R0j+wMm7Ssqm2mp15oXuWoxejZfMq1G1jD1pZK8lUuW+yk9Ro0ZgxrrQIW98Zp izq69i+mDo/+DrnevOwPpeHaOrqLzrSViukwg7npGWzr/bnjxHCF5Bvyl93RYK8qaxSx cvwA== X-Gm-Message-State: AOAM531pTR1ZIpGeox7rQmkJ3FGc+ru0imB7sofvG+6WXilT9kSr0boB a5HQxilao08cJotwdTAQa0lWeWmxJlk3U3/2PXPaCJzZpjY= X-Google-Smtp-Source: ABdhPJyMLBzs41wZWtgzpIxhnZytYw4a1GnK+mbZax821OKxl0GqvZlXMLY+MjrhGA26iZ5zGLC/8OR5PEzB9tqw10I= X-Received: by 2002:a92:cd01:: with SMTP id z1mr382910iln.182.1589494803570; Thu, 14 May 2020 15:20:03 -0700 (PDT) MIME-Version: 1.0 References: <202005141719.04EHJ7JF060765@repo.freebsd.org> <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> In-Reply-To: <67e768d9-f2a5-cfa5-d674-4c33e3fb7696@FreeBSD.org> From: Ed Maste Date: Thu, 14 May 2020 18:19:51 -0400 Message-ID: Subject: Re: svn commit: r361034 - head To: John Baldwin Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 49NQvn1VX4z421m X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.98 / 15.00]; NEURAL_HAM_MEDIUM(-0.98)[-0.985,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:20:05 -0000 On Thu, 14 May 2020 at 13:49, John Baldwin wrote: > > Oops, sorry. I meant to fix that up before commit. :-/ No worries. > (I use xxxx as the date while it is in the branch) I usually do too; I spotted this due to a merge conflict with my WIP that touches ObsoleteFiles.inc (D24790, retiring cuseeme from libalias). From owner-svn-src-all@freebsd.org Thu May 14 22:32:37 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E54AC2E26D8; Thu, 14 May 2020 22:32:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49NRBF3rtnz42l1; Thu, 14 May 2020 22:32:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id 04EMWTZj007272 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Fri, 15 May 2020 01:32:32 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 04EMWTZj007272 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id 04EMWTMP007271; Fri, 15 May 2020 01:32:29 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 15 May 2020 01:32:29 +0300 From: Konstantin Belousov To: Peter Grehan Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r361064 - head/sys/amd64/vmm Message-ID: <20200514223229.GA46537@kib.kiev.ua> References: <202005142218.04EMICgT045505@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005142218.04EMICgT045505@repo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on tom.home X-Rspamd-Queue-Id: 49NRBF3rtnz42l1 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.93 / 15.00]; NEURAL_HAM_MEDIUM(-0.93)[-0.931,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 22:32:38 -0000 On Thu, May 14, 2020 at 10:18:12PM +0000, Peter Grehan wrote: > Author: grehan > Date: Thu May 14 22:18:12 2020 > New Revision: 361064 > URL: https://svnweb.freebsd.org/changeset/base/361064 > > Log: > Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest > > In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that > support CPUID 0x15, the local APIC frequency is determined directly > from the reported crystal clock to avoid calibration against the 8254 > timer. > > However, the local APIC frequency implemented by bhyve is 128MHz, where > most h/w systems report frequencies around 25MHz. This shows up on > OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard > when using VNC, since the kernel's timers are now much shorter. > > Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall > back to using the 8254 to calibrate the local APIC frequency. > > Future work could be to compute values returned for 0x15 that would > match the host TSC and bhyve local APIC frequency, though all dependencies > on this would need to be examined (for example, Linux will start using > 0x16 for some hosts). FreeBSD uses 0x15 (and 0x16 if there is no 0x15) as well. We recheck against 8254 and decide that there is no ISA timer if calibration differs too much from CPUID numbers. From owner-svn-src-all@freebsd.org Thu May 14 23:20:58 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D16082E3B14; Thu, 14 May 2020 23:20:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NSG23Hglz44r5; Thu, 14 May 2020 23:20:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6C1E31AD98; Thu, 14 May 2020 23:20:58 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ENKw82082662; Thu, 14 May 2020 23:20:58 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ENKw7u082661; Thu, 14 May 2020 23:20:58 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005142320.04ENKw7u082661@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 14 May 2020 23:20:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361065 - head/tests/sys/netpfil/pf/ioctl X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tests/sys/netpfil/pf/ioctl X-SVN-Commit-Revision: 361065 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 23:20:58 -0000 Author: kevans Date: Thu May 14 23:20:58 2020 New Revision: 361065 URL: https://svnweb.freebsd.org/changeset/base/361065 Log: pf tests: fix up a couple WARNS= 6 nits common_init_tbl is only used within this single CU, so it should be marked static. WARNS=6 also complained about the var defined by `ATF_TC_WITH_CLEANUP(getastats);` being unused, which turns out to be because it's not been hooked up in ATF_TP_ADD_TCS. kp@ did not immediately recall any reason for this, and the case passes on my local system, so hook it up. Note that I've not yet set WARNS= 6 here. Investigation is underway to see if we can feasibly default WARNS to 6 for src builds to catch directories too deep to inherit a WARNS from the top-level subdirectories' Makefile.inc. Those particular WARNS settings will be subsequently removed as they become redundant with a more-global default. MFC after: 1 week Modified: head/tests/sys/netpfil/pf/ioctl/validation.c Modified: head/tests/sys/netpfil/pf/ioctl/validation.c ============================================================================== --- head/tests/sys/netpfil/pf/ioctl/validation.c Thu May 14 22:18:12 2020 (r361064) +++ head/tests/sys/netpfil/pf/ioctl/validation.c Thu May 14 23:20:58 2020 (r361065) @@ -51,7 +51,7 @@ static int dev; #define COMMON_CLEANUP() \ close(dev); -void +static void common_init_tbl(struct pfr_table *tbl) { bzero(tbl, sizeof(struct pfr_table)); @@ -795,6 +795,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, addtables); ATF_TP_ADD_TC(tp, deltables); ATF_TP_ADD_TC(tp, gettables); + ATF_TP_ADD_TC(tp, getastats); ATF_TP_ADD_TC(tp, gettstats); ATF_TP_ADD_TC(tp, clrtstats); ATF_TP_ADD_TC(tp, settflags); From owner-svn-src-all@freebsd.org Thu May 14 23:38:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5465F2E3F34; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@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 49NSdx1XJSz45ZH; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 15F681B13B; Thu, 14 May 2020 23:38:13 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04ENcCOu094164; Thu, 14 May 2020 23:38:12 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04ENcCN5094159; Thu, 14 May 2020 23:38:12 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005142338.04ENcCN5094159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Thu, 14 May 2020 23:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361066 - head/usr.sbin/jail X-SVN-Group: head X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: head/usr.sbin/jail X-SVN-Commit-Revision: 361066 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 23:38:13 -0000 Author: freqlabs Date: Thu May 14 23:38:11 2020 New Revision: 361066 URL: https://svnweb.freebsd.org/changeset/base/361066 Log: jail: Add exec.prepare and exec.release command hooks This change introduces new jail command hooks that run before and after any other actions. The exec.prepare hook can be used for example to invoke a script that checks if the jail's root exists, creating it if it does not. Since arbitrary variables in jail.conf can be passed to the command, it can be pretty useful for templating jails. An example use case for exec.release would be to remove the filesystem of an ephemeral jail. The names "prepare" and "release" are borrowed from the names of similar hooks in libvirt. Reviewed by: jamie, manpages, mmacy Approved by: mmacy (mentor) MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D24829 Modified: head/usr.sbin/jail/command.c head/usr.sbin/jail/config.c head/usr.sbin/jail/jail.8 head/usr.sbin/jail/jail.c head/usr.sbin/jail/jailp.h Modified: head/usr.sbin/jail/command.c ============================================================================== --- head/usr.sbin/jail/command.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/command.c Thu May 14 23:38:11 2020 (r361066) @@ -148,7 +148,8 @@ next_command(struct cfjail *j) if (j->comstring == NULL || j->comstring->len == 0 || (create_failed && (comparam == IP_EXEC_PRESTART || comparam == IP_EXEC_CREATED || comparam == IP_EXEC_START || - comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART))) + comparam == IP_COMMAND || comparam == IP_EXEC_POSTSTART || + comparam == IP_EXEC_PREPARE))) continue; switch (run_command(j)) { case -1: Modified: head/usr.sbin/jail/config.c ============================================================================== --- head/usr.sbin/jail/config.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/config.c Thu May 14 23:38:11 2020 (r361066) @@ -71,8 +71,10 @@ static const struct ipspec intparams[] = { [IP_EXEC_JAIL_USER] = {"exec.jail_user", PF_INTERNAL}, [IP_EXEC_POSTSTART] = {"exec.poststart", PF_INTERNAL}, [IP_EXEC_POSTSTOP] = {"exec.poststop", PF_INTERNAL}, + [IP_EXEC_PREPARE] = {"exec.prepare", PF_INTERNAL}, [IP_EXEC_PRESTART] = {"exec.prestart", PF_INTERNAL}, [IP_EXEC_PRESTOP] = {"exec.prestop", PF_INTERNAL}, + [IP_EXEC_RELEASE] = {"exec.release", PF_INTERNAL}, [IP_EXEC_CREATED] = {"exec.created", PF_INTERNAL}, [IP_EXEC_START] = {"exec.start", PF_INTERNAL}, [IP_EXEC_STOP] = {"exec.stop", PF_INTERNAL}, Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jail.8 Thu May 14 23:38:11 2020 (r361066) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 17, 2020 +.Dd May 14, 2020 .Dt JAIL 8 .Os .Sh NAME @@ -726,6 +726,11 @@ not be created or removed, as appropriate. .Pp The pseudo-parameters are: .Bl -tag -width indent +.It Va exec.prepare +Command(s) to run in the system environment to prepare a jail for creation. +These commands are executed before assigning IP addresses and mounting +filesystems, so they may be used to create a new jail filesystem if it does +not already exist. .It Va exec.prestart Command(s) to run in the system environment before a jail is created. .It Va exec.created @@ -760,6 +765,11 @@ A typical command to run is .Dq sh /etc/rc.shutdown jail . .It Va exec.poststop Command(s) to run in the system environment after a jail is removed. +.It Va exec.release +Command(s) to run in the system environment after all other actions are done. +These commands are executed after unmounting filesystems and removing IP +addresses, so they may be used to remove a jail filesystem if it is no longer +needed. .It Va exec.clean Run commands in a clean environment. The environment is discarded except for Modified: head/usr.sbin/jail/jail.c ============================================================================== --- head/usr.sbin/jail/jail.c Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jail.c Thu May 14 23:38:11 2020 (r361066) @@ -87,6 +87,7 @@ static struct permspec perm_sysctl[] = { static const enum intparam startcommands[] = { IP__NULL, + IP_EXEC_PREPARE, #ifdef INET IP__IP4_IFADDR, #endif @@ -126,6 +127,7 @@ static const enum intparam stopcommands[] = { #ifdef INET IP__IP4_IFADDR, #endif + IP_EXEC_RELEASE, IP__NULL }; Modified: head/usr.sbin/jail/jailp.h ============================================================================== --- head/usr.sbin/jail/jailp.h Thu May 14 23:20:58 2020 (r361065) +++ head/usr.sbin/jail/jailp.h Thu May 14 23:38:11 2020 (r361066) @@ -87,8 +87,10 @@ enum intparam { IP_EXEC_JAIL_USER, /* Run jailed commands as this user */ IP_EXEC_POSTSTART, /* Commands run outside jail after creating */ IP_EXEC_POSTSTOP, /* Commands run outside jail after removing */ + IP_EXEC_PREPARE, /* Commands run outside jail before addrs and mounting */ IP_EXEC_PRESTART, /* Commands run outside jail before creating */ IP_EXEC_PRESTOP, /* Commands run outside jail before removing */ + IP_EXEC_RELEASE, /* Commands run outside jail after addrs and unmounted */ IP_EXEC_CREATED, /* Commands run outside jail right after it was started */ IP_EXEC_START, /* Commands run inside jail on creation */ IP_EXEC_STOP, /* Commands run inside jail on removal */ From owner-svn-src-all@freebsd.org Fri May 15 00:02:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 44BF72E4AAE; Fri, 15 May 2020 00:02:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NT9s140tz474B; Fri, 15 May 2020 00:02:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1FE041B6D9; Fri, 15 May 2020 00:02:25 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F02PYR012115; Fri, 15 May 2020 00:02:25 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F02O8C012114; Fri, 15 May 2020 00:02:24 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <202005150002.04F02O8C012114@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 15 May 2020 00:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r361067 - releng/11.4/sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: releng/11.4/sys/conf X-SVN-Commit-Revision: 361067 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 00:02:25 -0000 Author: gjb Date: Fri May 15 00:02:24 2020 New Revision: 361067 URL: https://svnweb.freebsd.org/changeset/base/361067 Log: Update releng/11.4 to BETA2 as part of the 11.4-RELEASE cycle. Approved by: re (implicit) Sponsored by: Rubicon Communications, LLC (netgate.com) Modified: releng/11.4/sys/conf/newvers.sh Modified: releng/11.4/sys/conf/newvers.sh ============================================================================== --- releng/11.4/sys/conf/newvers.sh Thu May 14 23:38:11 2020 (r361066) +++ releng/11.4/sys/conf/newvers.sh Fri May 15 00:02:24 2020 (r361067) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.4" -BRANCH="BETA1-p1" +BRANCH="BETA2" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri May 15 00:50:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 41D402E580A; Fri, 15 May 2020 00:50:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NVFn14yfz48nC; Fri, 15 May 2020 00:50:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2069D1BE90; Fri, 15 May 2020 00:50:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F0oqhX037828; Fri, 15 May 2020 00:50:52 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F0oqqW037827; Fri, 15 May 2020 00:50:52 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005150050.04F0oqqW037827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 15 May 2020 00:50: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: r361068 - stable/12/lib/libz X-SVN-Group: stable-12 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/12/lib/libz X-SVN-Commit-Revision: 361068 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 00:50:53 -0000 Author: delphij Date: Fri May 15 00:50:52 2020 New Revision: 361068 URL: https://svnweb.freebsd.org/changeset/base/361068 Log: MFC r360952: Generate zlib.pc from source. Deleted: stable/12/lib/libz/zlib.pc Modified: stable/12/lib/libz/Makefile Directory Properties: stable/12/ (props changed) Modified: stable/12/lib/libz/Makefile ============================================================================== --- stable/12/lib/libz/Makefile Fri May 15 00:02:24 2020 (r361067) +++ stable/12/lib/libz/Makefile Fri May 15 00:50:52 2020 (r361068) @@ -52,6 +52,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-all@freebsd.org Fri May 15 00:51:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 356A82E59F0; Fri, 15 May 2020 00:51:31 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NVGV6StLz48xC; Fri, 15 May 2020 00:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D7AB21BECD; Fri, 15 May 2020 00:51:30 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F0pU9o038642; Fri, 15 May 2020 00:51:30 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F0pU3r038641; Fri, 15 May 2020 00:51:30 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005150051.04F0pU3r038641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 15 May 2020 00:51:30 +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: r361069 - stable/11/lib/libz X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/lib/libz X-SVN-Commit-Revision: 361069 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 00:51:31 -0000 Author: delphij Date: Fri May 15 00:51:30 2020 New Revision: 361069 URL: https://svnweb.freebsd.org/changeset/base/361069 Log: MFC r360952: Generate zlib.pc from source. Deleted: stable/11/lib/libz/zlib.pc Modified: stable/11/lib/libz/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libz/Makefile ============================================================================== --- stable/11/lib/libz/Makefile Fri May 15 00:50:52 2020 (r361068) +++ stable/11/lib/libz/Makefile Fri May 15 00:51:30 2020 (r361069) @@ -52,6 +52,17 @@ INCS= zconf.h zlib.h .PATH: ${ZLIBSRC}/test +ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h + +zlib.pc: zlib.pc.in + sed -e 's,@prefix@,/usr,g ; \ + s,@exec_prefix@,$${prefix},g ; \ + s,@libdir@,$${exec_prefix}/lib,g ; \ + s,@sharedlibdir@,$${libdir},g ; \ + s,@includedir@,$${prefix}/include,g ; \ + s,@VERSION@,${ZLIB_VERSION},g ;' \ + ${.ALLSRC} > ${.TARGET} + minigzip: all minigzip.o $(CC) -o minigzip minigzip.o -L. -lz From owner-svn-src-all@freebsd.org Fri May 15 01:01:05 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0F5CE2E5CD0; Fri, 15 May 2020 01:01:05 +0000 (UTC) (envelope-from freqlabs@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 49NVTX6l7Nz49Mc; Fri, 15 May 2020 01:01:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E29D11C08B; Fri, 15 May 2020 01:01:04 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F114tT044244; Fri, 15 May 2020 01:01:04 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F113IY044235; Fri, 15 May 2020 01:01:03 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005150101.04F113IY044235@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 15 May 2020 01:01:03 +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: r361070 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 01:01:05 -0000 Author: freqlabs Date: Fri May 15 01:01:02 2020 New Revision: 361070 URL: https://svnweb.freebsd.org/changeset/base/361070 Log: MFC r360813: Remove APPLEKEXT ifndefs They are no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24752 Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonacl.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfs/nfs_commonacl.c Fri May 15 01:01:02 2020 (r361070) @@ -28,11 +28,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT #include extern int nfsrv_useacl; -#endif static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, enum vtype type, acl_perm_t *permp); Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include "opt_inet.h" #include "opt_inet6.h" @@ -160,7 +159,6 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */ }; -#endif /* !APPLEKEXT */ static int ncl_mbuf_mhlen = MHLEN; static int nfsrv_usercnt = 0; Modified: stable/11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -39,7 +39,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -49,7 +48,6 @@ extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; extern int nfs_bigreply[NFSV41_NPROCS]; NFSCLSTATEMUTEX; -#endif /* !APPLEKEXT */ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; static struct { Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 01:01:02 2020 (r361070) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); * arguments are all at the end, after the NFSPROC_T *p one. */ -#ifndef APPLEKEXT #include "opt_inet6.h" #include @@ -70,7 +69,6 @@ int nfscl_assumeposixlocks = 1; int nfscl_enablecallb = 0; short nfsv4_cbport = NFSV4_CBPORT; int nfstest_openallsetattr = 0; -#endif /* !APPLEKEXT */ #define DIRHDSIZ (sizeof (struct dirent) - (MAXNAMLEN + 1)) Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Fri May 15 01:01:02 2020 (r361070) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); * (Since we are done with them, they do not need to be recovered.) */ -#ifndef APPLEKEXT #include /* @@ -96,7 +95,6 @@ int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; -#endif /* !APPLEKEXT */ static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; Modified: stable/11/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 01:01:02 2020 (r361070) @@ -156,7 +156,6 @@ __FBSDID("$FreeBSD$"); * that case. This level should be set high enough that this almost * never happens. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -164,7 +163,6 @@ extern struct mtx nfsrc_udpmtx; extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; int nfsrc_floodlevel = NFSRVCACHE_FLOODLEVEL, nfsrc_tcpsavedreplies = 0; -#endif /* !APPLEKEXT */ SYSCTL_DECL(_vfs_nfsd); Modified: stable/11/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 01:01:02 2020 (r361070) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); * For nfsv4, these functions are called for each Op within the Compound RPC. */ -#ifndef APPLEKEXT #include /* Global vars */ @@ -56,7 +55,6 @@ extern struct timeval nfsboottime; extern int nfs_rootfhset; extern int nfsrv_enable_crossmntpt; extern int nfsrv_statehashsize; -#endif /* !APPLEKEXT */ static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 01:01:02 2020 (r361070) @@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by the nfs server. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -323,7 +322,6 @@ int (*nfsrv4_ops2[NFSV41_NOPS])(struct nfsrv_descript (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, }; -#endif /* !APPLEKEXT */ /* * Static array that defines which nfs rpc's are nonidempotent Modified: stable/11/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 01:01:02 2020 (r361070) @@ -30,7 +30,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#ifndef APPLEKEXT #include struct nfsrv_stablefirst nfsrv_stablefirst; @@ -89,7 +88,6 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, allowreadforwriteopen, struct nfsclienthashhead *nfsclienthash; struct nfslockhashhead *nfslockhash; struct nfssessionhash *nfssessionhash; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0; static time_t nfsrvboottime; Modified: stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -34,7 +34,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT /* * These functions support the macros and help fiddle mbuf chains for * the nfs op functions. They do things like create the rpc header and @@ -58,7 +57,6 @@ char nfs_v2pubfh[NFSX_V2FH]; static nfstype newnfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON, NFCHR, NFNON }; extern nfstype nfsv34_type[9]; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_isannfserr(u_int32_t); From owner-svn-src-all@freebsd.org Fri May 15 01:01:07 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 27E2A2E5CFF; Fri, 15 May 2020 01:01:07 +0000 (UTC) (envelope-from freqlabs@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 49NVTb0M7kz49Mw; Fri, 15 May 2020 01:01:07 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 079621C08D; Fri, 15 May 2020 01:01:07 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F116Gi044259; Fri, 15 May 2020 01:01:06 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F115D5044250; Fri, 15 May 2020 01:01:05 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005150101.04F115D5044250@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Fri, 15 May 2020 01:01: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: r361070 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-12 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361070 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 01:01:07 -0000 Author: freqlabs Date: Fri May 15 01:01:02 2020 New Revision: 361070 URL: https://svnweb.freebsd.org/changeset/base/361070 Log: MFC r360813: Remove APPLEKEXT ifndefs They are no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24752 Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Modified: stable/12/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonacl.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfs/nfs_commonacl.c Fri May 15 01:01:02 2020 (r361070) @@ -30,11 +30,9 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT #include extern int nfsrv_useacl; -#endif static int nfsrv_acemasktoperm(u_int32_t acetype, u_int32_t mask, int owner, enum vtype type, acl_perm_t *permp); Modified: stable/12/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfs/nfs_commonsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include "opt_inet.h" #include "opt_inet6.h" @@ -169,7 +168,6 @@ struct nfsv4_opflag nfsv4_opflag[NFSV41_NOPS] = { { 0, 0, 0, 0, LK_EXCLUSIVE, 0, 0 }, /* Destroy ClientID */ { 0, 0, 0, 0, LK_EXCLUSIVE, 1, 0 }, /* Reclaim Complete */ }; -#endif /* !APPLEKEXT */ static int ncl_mbuf_mhlen = MHLEN; static int nfsrv_usercnt = 0; Modified: stable/12/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsclient/nfs_clcomsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$"); * the nfs op functions. They do things like create the rpc header and * copy data between mbuf chains and uio lists. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -49,7 +48,6 @@ extern int ncl_mbuf_mlen; extern enum vtype newnv2tov_type[8]; extern enum vtype nv34tov_type[8]; NFSCLSTATEMUTEX; -#endif /* !APPLEKEXT */ static nfsuint64 nfs_nullcookie = {{ 0, 0 }}; Modified: stable/12/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsclient/nfs_clrpcops.c Fri May 15 01:01:02 2020 (r361070) @@ -44,7 +44,6 @@ __FBSDID("$FreeBSD$"); * arguments are all at the end, after the NFSPROC_T *p one. */ -#ifndef APPLEKEXT #include "opt_inet6.h" #include @@ -78,7 +77,6 @@ int nfscl_assumeposixlocks = 1; int nfscl_enablecallb = 0; short nfsv4_cbport = NFSV4_CBPORT; int nfstest_openallsetattr = 0; -#endif /* !APPLEKEXT */ #define DIRHDSIZ offsetof(struct dirent, d_name) Modified: stable/12/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/12/sys/fs/nfsclient/nfs_clstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsclient/nfs_clstate.c Fri May 15 01:01:02 2020 (r361070) @@ -80,7 +80,6 @@ __FBSDID("$FreeBSD$"); * (Since we are done with them, they do not need to be recovered.) */ -#ifndef APPLEKEXT #include /* @@ -98,7 +97,6 @@ int nfscl_inited = 0; struct nfsclhead nfsclhead; /* Head of clientid list */ int nfscl_deleghighwater = NFSCLDELEGHIGHWATER; int nfscl_layouthighwater = NFSCLLAYOUTHIGHWATER; -#endif /* !APPLEKEXT */ static int nfscl_delegcnt = 0; static int nfscl_layoutcnt = 0; Modified: stable/12/sys/fs/nfsserver/nfs_nfsdcache.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsserver/nfs_nfsdcache.c Fri May 15 01:01:02 2020 (r361070) @@ -158,7 +158,6 @@ __FBSDID("$FreeBSD$"); * that case. This level should be set high enough that this almost * never happens. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -166,7 +165,6 @@ extern struct mtx nfsrc_udpmtx; extern struct nfsrchash_bucket nfsrchash_table[NFSRVCACHE_HASHSIZE]; extern struct nfsrchash_bucket nfsrcahash_table[NFSRVCACHE_HASHSIZE]; int nfsrc_floodlevel = NFSRVCACHE_FLOODLEVEL, nfsrc_tcpsavedreplies = 0; -#endif /* !APPLEKEXT */ SYSCTL_DECL(_vfs_nfsd); Modified: stable/12/sys/fs/nfsserver/nfs_nfsdserv.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsserver/nfs_nfsdserv.c Fri May 15 01:01:02 2020 (r361070) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); * For nfsv4, these functions are called for each Op within the Compound RPC. */ -#ifndef APPLEKEXT #include /* Global vars */ @@ -65,7 +64,6 @@ extern int nfsd_debuglevel; extern u_long sb_max_adj; extern int nfsrv_pnfsatime; extern int nfsrv_maxpnfsmirror; -#endif /* !APPLEKEXT */ static int nfs_async = 0; SYSCTL_DECL(_vfs_nfsd); Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c Fri May 15 01:01:02 2020 (r361070) @@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$"); * Socket operations for use by the nfs server. */ -#ifndef APPLEKEXT #include extern struct nfsstatsv1 nfsstatsv1; @@ -327,7 +326,6 @@ int (*nfsrv4_ops2[NFSV41_NOPS])(struct nfsrv_descript (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, (int (*)(struct nfsrv_descript *, int, vnode_t , vnode_t , NFSPROC_T *, struct nfsexstuff *, struct nfsexstuff *))0, }; -#endif /* !APPLEKEXT */ /* * Static array that defines which nfs rpc's are nonidempotent Modified: stable/12/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsserver/nfs_nfsdstate.c Fri May 15 01:01:02 2020 (r361070) @@ -32,7 +32,6 @@ __FBSDID("$FreeBSD$"); #include "opt_inet.h" #include "opt_inet6.h" -#ifndef APPLEKEXT #include #include @@ -123,7 +122,6 @@ struct nfslockhashhead *nfslockhash; struct nfssessionhash *nfssessionhash; struct nfslayouthash *nfslayouthash; volatile int nfsrv_dontlistlen = 0; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_openpluslock = 0, nfsrv_delegatecnt = 0; static time_t nfsrvboottime; Modified: stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c ============================================================================== --- stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 00:51:30 2020 (r361069) +++ stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Fri May 15 01:01:02 2020 (r361070) @@ -36,7 +36,6 @@ #include __FBSDID("$FreeBSD$"); -#ifndef APPLEKEXT /* * These functions support the macros and help fiddle mbuf chains for * the nfs op functions. They do things like create the rpc header and @@ -62,7 +61,6 @@ struct nfslayouthead nfsrv_recalllisthead; static nfstype newnfsv2_type[9] = { NFNON, NFREG, NFDIR, NFBLK, NFCHR, NFLNK, NFNON, NFCHR, NFNON }; extern nfstype nfsv34_type[9]; -#endif /* !APPLEKEXT */ static u_int32_t nfsrv_isannfserr(u_int32_t); From owner-svn-src-all@freebsd.org Fri May 15 03:54:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1431B2E90B8; Fri, 15 May 2020 03:54:26 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NZKY6S7fz4Jfn; Fri, 15 May 2020 03:54:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D8A2A1E294; Fri, 15 May 2020 03:54:25 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04F3sPi3054994; Fri, 15 May 2020 03:54:25 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04F3sPs3054993; Fri, 15 May 2020 03:54:25 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005150354.04F3sPs3054993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 May 2020 03:54:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361071 - head X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 361071 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 03:54:26 -0000 Author: cem Date: Fri May 15 03:54:25 2020 New Revision: 361071 URL: https://svnweb.freebsd.org/changeset/base/361071 Log: ObsoleteFiles: pdwait4.2.gz A belated follow-up to r320058. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri May 15 01:01:02 2020 (r361070) +++ head/ObsoleteFiles.inc Fri May 15 03:54:25 2020 (r361071) @@ -3174,6 +3174,8 @@ OLD_DIRS+=usr/lib/clang/4.0.0/lib/freebsd OLD_DIRS+=usr/lib/clang/4.0.0/lib OLD_DIRS+=usr/lib/clang/4.0.0 OLD_FILES+=usr/bin/llvm-pdbdump +# 20170717: Remove documentation of vaporware +OLD_FILES+=usr/share/man/man2/pdwait4.2.gz # 20170610: chown-f_test replaced by chown_test OLD_FILES+=usr/tests/usr.sbin/chown/chown-f_test # 20170609: drop obsolete manpage link (if_rtwn.ko -> rtwn.ko) From owner-svn-src-all@freebsd.org Fri May 15 10:17:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 529DB2F117F; Fri, 15 May 2020 10:17:59 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nkr50HKLz4d15; Fri, 15 May 2020 10:17:56 +0000 (UTC) (envelope-from mpp302@gmail.com) Received: by mail-wr1-f47.google.com with SMTP id l17so2893413wrr.4; Fri, 15 May 2020 03:17:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=RuYqFJr1KEFdgAzVkAXhe4fZe/TfXGDRm6UtCGk4/mc=; b=Eer7OBc9mRPZ1akMnKt+z+OfLaC/S5ifD0J8Ab47yxWRA/op5KpUvfiGxBpWbeBe23 QTO/pzAE/MYSGgelC5RCXL3aQii/k/3zFQ0h8CW3xCZMrG7Laottl1njQ6sZ8cEmoTFE TYTZhvZNTE9YtKPQJHschTCcFnmlbONxDxCXMC39FRUK7WJYNaRlEiRhn3jdTgmTBsST IMeMXargehNYvHlhlFNoZjxHREC6anwNh4suIQiEtPbU4KbcVIds1d0GHfe4zkX24Bvg rM2okdQ09k1rcD0rhcjCs/4unjvY5TGNyhn+1ZLw7lONLqFpXliiDXpQjgYLDSD4dA5e Es2Q== X-Gm-Message-State: AOAM532nuAurdOuNtbleQK5yvh/Ainl4fAYOm6lrt7FFTRamFgA9f/yb RCESlXAJXOJ4NVy/eqvNopJ53mCY X-Google-Smtp-Source: ABdhPJwWStjT7kFJkN0OM0l59DGZBp9IuY6mU7oaVjtY/ycfb5u0sDp2lR0kjP+zdbkugtpfrk61fA== X-Received: by 2002:adf:ec85:: with SMTP id z5mr3759467wrn.153.1589537875136; Fri, 15 May 2020 03:17:55 -0700 (PDT) Received: from ?IPv6:2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8? ([2a02:8109:98c0:1bc0:5e5f:67ff:fef4:ffd8]) by smtp.gmail.com with ESMTPSA id a15sm2857651wrw.56.2020.05.15.03.17.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 03:17:54 -0700 (PDT) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: Ryan Moeller , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005142338.04ENcCN5094159@repo.freebsd.org> From: Mateusz Piotrowski <0mp@FreeBSD.org> Message-ID: Date: Fri, 15 May 2020 12:18:23 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005142338.04ENcCN5094159@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Rspamd-Queue-Id: 49Nkr50HKLz4d15 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of mpp302@gmail.com designates 209.85.221.47 as permitted sender) smtp.mailfrom=mpp302@gmail.com X-Spamd-Result: default: False [-2.23 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[FreeBSD.org]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.25)[ip: (-0.41), ipnet: 209.85.128.0/17(-0.39), asn: 15169(-0.42), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[47.221.85.209.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_MEDIUM(-0.98)[-0.981,0]; FORGED_SENDER(0.30)[0mp@FreeBSD.org,mpp302@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[47.221.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[0mp@FreeBSD.org,mpp302@gmail.com] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 10:17:59 -0000 On 5/15/20 1:38 AM, Ryan Moeller wrote: > Author: freqlabs > Date: Thu May 14 23:38:11 2020 > New Revision: 361066 > URL: https://svnweb.freebsd.org/changeset/base/361066 > > Log: > jail: Add exec.prepare and exec.release command hooks > > This change introduces new jail command hooks that run before and after any > other actions. Should it go into RELNOTES? From owner-svn-src-all@freebsd.org Fri May 15 11:03:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E64932F1FCE; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@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 49Nlrb5bQwz4gLD; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 BB34823332; Fri, 15 May 2020 11:03:27 +0000 (UTC) (envelope-from afedorov@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FB3RtB018330; Fri, 15 May 2020 11:03:27 GMT (envelope-from afedorov@FreeBSD.org) Received: (from afedorov@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FB3R9s018329; Fri, 15 May 2020 11:03:27 GMT (envelope-from afedorov@FreeBSD.org) Message-Id: <202005151103.04FB3R9s018329@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: afedorov set sender to afedorov@FreeBSD.org using -f From: Aleksandr Fedorov Date: Fri, 15 May 2020 11:03:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361072 - head/usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: afedorov X-SVN-Commit-Paths: head/usr.sbin/bhyve X-SVN-Commit-Revision: 361072 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 11:03:28 -0000 Author: afedorov Date: Fri May 15 11:03:27 2020 New Revision: 361072 URL: https://svnweb.freebsd.org/changeset/base/361072 Log: bhyve: Fix processing of netgraph backend options. After r360820, additional parameters are passed through the argument 'opts', and the name of the backend through the argument 'devname'. So, there is no need to skip the backend name from the 'opts' argument. Modified: head/usr.sbin/bhyve/net_backends.c Modified: head/usr.sbin/bhyve/net_backends.c ============================================================================== --- head/usr.sbin/bhyve/net_backends.c Fri May 15 03:54:25 2020 (r361071) +++ head/usr.sbin/bhyve/net_backends.c Fri May 15 11:03:27 2020 (r361072) @@ -438,8 +438,6 @@ ng_init(struct net_backend *be, const char *devname, path_provided = 0; peerhook_provided = 0; - (void)strsep(&ngopts, ","); - while (ngopts != NULL) { char *value = ngopts; char *key; From owner-svn-src-all@freebsd.org Fri May 15 11:58:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96AA42F315C; Fri, 15 May 2020 11:58:02 +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 49Nn3Z3WW1z3FG4; Fri, 15 May 2020 11:58:02 +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 7419823C8F; Fri, 15 May 2020 11:58:02 +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 04FBw2Cg048486; Fri, 15 May 2020 11:58:02 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FBw1vw048483; Fri, 15 May 2020 11:58:01 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151158.04FBw1vw048483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 11:58:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361073 - in head: include lib/libc/gen libexec/rtld-elf X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 361073 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 11:58:02 -0000 Author: kib Date: Fri May 15 11:58:01 2020 New Revision: 361073 URL: https://svnweb.freebsd.org/changeset/base/361073 Log: Implement RTLD_DEEPBIND. PR: 246462 Tested by: Martin Birgmeier Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Modified: head/include/dlfcn.h head/lib/libc/gen/dlopen.3 head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/rtld.h Modified: head/include/dlfcn.h ============================================================================== --- head/include/dlfcn.h Fri May 15 11:03:27 2020 (r361072) +++ head/include/dlfcn.h Fri May 15 11:58:01 2020 (r361073) @@ -47,6 +47,8 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ #define RTLD_NODELETE 0x01000 /* Do not remove members. */ #define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */ +#define RTLD_DEEPBIND 0x04000 /* Put symbols from the dso ahead of + the global list */ /* * Request arguments for dlinfo(). Modified: head/lib/libc/gen/dlopen.3 ============================================================================== --- head/lib/libc/gen/dlopen.3 Fri May 15 11:03:27 2020 (r361072) +++ head/lib/libc/gen/dlopen.3 Fri May 15 11:58:01 2020 (r361073) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd May 14, 2020 .Dt DLOPEN 3 .Os .Sh NAME @@ -162,6 +162,9 @@ the process address space, otherwise is returned. Other mode flags may be specified, which will be applied for promotion for the found object. +.It Dv RTLD_DEEPBIND +Symbols from the loaded library are put before global symbols when +resolving symbolic references originated from the library. .El .Pp If Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri May 15 11:03:27 2020 (r361072) +++ head/libexec/rtld-elf/rtld.c Fri May 15 11:58:01 2020 (r361073) @@ -3366,6 +3366,8 @@ rtld_dlopen(const char *name, int fd, int mode) lo_flags |= RTLD_LO_NODELETE; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (mode & RTLD_DEEPBIND) + lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE | RTLD_LO_IGNSTLS; @@ -3417,6 +3419,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if (globallist_next(old_obj_tail) != NULL) { /* We loaded something new. */ assert(globallist_next(old_obj_tail) == obj); + if ((lo_flags & RTLD_LO_DEEPBIND) != 0) + obj->symbolic = true; result = 0; if ((lo_flags & (RTLD_LO_EARLY | RTLD_LO_IGNSTLS)) == 0 && obj->static_tls && !allocate_tls_offset(obj)) { Modified: head/libexec/rtld-elf/rtld.h ============================================================================== --- head/libexec/rtld-elf/rtld.h Fri May 15 11:03:27 2020 (r361072) +++ head/libexec/rtld-elf/rtld.h Fri May 15 11:58:01 2020 (r361073) @@ -309,6 +309,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ #define RTLD_LO_IGNSTLS 0x40 /* Do not allocate static TLS */ +#define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-all@freebsd.org Fri May 15 12:04:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6E3BD2F40DB; Fri, 15 May 2020 12:04:40 +0000 (UTC) (envelope-from bcr@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 49NnCD2KMXz3GF1; Fri, 15 May 2020 12:04:40 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 4AF5723E92; Fri, 15 May 2020 12:04:40 +0000 (UTC) (envelope-from bcr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FC4eXx054437; Fri, 15 May 2020 12:04:40 GMT (envelope-from bcr@FreeBSD.org) Received: (from bcr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FC4e0X054436; Fri, 15 May 2020 12:04:40 GMT (envelope-from bcr@FreeBSD.org) Message-Id: <202005151204.04FC4e0X054436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bcr set sender to bcr@FreeBSD.org using -f From: Benedict Reuschling Date: Fri, 15 May 2020 12:04:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361074 - head/lib/libnetgraph X-SVN-Group: head X-SVN-Commit-Author: bcr X-SVN-Commit-Paths: head/lib/libnetgraph X-SVN-Commit-Revision: 361074 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 12:04:40 -0000 Author: bcr (doc committer) Date: Fri May 15 12:04:39 2020 New Revision: 361074 URL: https://svnweb.freebsd.org/changeset/base/361074 Log: Fix SYNPOSIS section to point to the proper include directive. netgraph(3) points to #include , which is kernel only. The man page refers to the user-space part of the netgraph module, which is located in . Submitted by: lutz_donnerhacke.de Approved by: bcr Differential Revision: https://reviews.freebsd.org/D23814 Modified: head/lib/libnetgraph/netgraph.3 Modified: head/lib/libnetgraph/netgraph.3 ============================================================================== --- head/lib/libnetgraph/netgraph.3 Fri May 15 11:58:01 2020 (r361073) +++ head/lib/libnetgraph/netgraph.3 Fri May 15 12:04:39 2020 (r361074) @@ -35,7 +35,7 @@ .\" $FreeBSD$ .\" $Whistle: netgraph.3,v 1.7 1999/01/25 07:14:06 archie Exp $ .\" -.Dd November 25, 2013 +.Dd May 15, 2020 .Dt NETGRAPH 3 .Os .Sh NAME @@ -57,7 +57,7 @@ .Sh LIBRARY .Lb libnetgraph .Sh SYNOPSIS -.In netgraph/netgraph.h +.In netgraph.h .Ft int .Fn NgMkSockNode "const char *name" "int *csp" "int *dsp" .Ft int From owner-svn-src-all@freebsd.org Fri May 15 12:47:39 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D73E52F4B02; Fri, 15 May 2020 12:47:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Np8q5LdPz3J6W; Fri, 15 May 2020 12:47:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE725246A8; Fri, 15 May 2020 12:47:39 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FCldRs079422; Fri, 15 May 2020 12:47:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FCldp6079421; Fri, 15 May 2020 12:47:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005151247.04FCldp6079421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 15 May 2020 12:47:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361075 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 12:47:39 -0000 Author: hselasky Date: Fri May 15 12:47:39 2020 New Revision: 361075 URL: https://svnweb.freebsd.org/changeset/base/361075 Log: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri May 15 12:04:39 2020 (r361074) +++ head/sys/kern/tty.c Fri May 15 12:47:39 2020 (r361075) @@ -1818,7 +1818,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1826,6 +1825,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-all@freebsd.org Fri May 15 13:33:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C80402F5F64; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@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 49NqB53x3Bz3M7L; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8202E25006; Fri, 15 May 2020 13:33:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDXnTO010139; Fri, 15 May 2020 13:33:49 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDXnYo010138; Fri, 15 May 2020 13:33:49 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <202005151333.04FDXnYo010138@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 15 May 2020 13:33:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361076 - in head/sys/arm64: arm64 include X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys/arm64: arm64 include X-SVN-Commit-Revision: 361076 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:33:49 -0000 Author: andrew Date: Fri May 15 13:33:48 2020 New Revision: 361076 URL: https://svnweb.freebsd.org/changeset/base/361076 Log: Remove arm64_idcache_wbinv_range as it's unused. Sponsored by: Innovate UK Modified: head/sys/arm64/arm64/cpufunc_asm.S head/sys/arm64/include/cpufunc.h Modified: head/sys/arm64/arm64/cpufunc_asm.S ============================================================================== --- head/sys/arm64/arm64/cpufunc_asm.S Fri May 15 12:47:39 2020 (r361075) +++ head/sys/arm64/arm64/cpufunc_asm.S Fri May 15 13:33:48 2020 (r361076) @@ -133,14 +133,6 @@ ENTRY(arm64_dcache_inv_range) END(arm64_dcache_inv_range) /* - * void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t) - */ -ENTRY(arm64_idcache_wbinv_range) - cache_handle_range dcop = civac, ic = 1, icop = ivau - ret -END(arm64_idcache_wbinv_range) - -/* * void arm64_icache_sync_range(vm_offset_t, vm_size_t) */ ENTRY(arm64_icache_sync_range) Modified: head/sys/arm64/include/cpufunc.h ============================================================================== --- head/sys/arm64/include/cpufunc.h Fri May 15 12:47:39 2020 (r361075) +++ head/sys/arm64/include/cpufunc.h Fri May 15 13:33:48 2020 (r361076) @@ -216,7 +216,6 @@ extern int64_t dczva_line_size; #define cpu_dcache_inv_range(a, s) arm64_dcache_inv_range((a), (s)) #define cpu_dcache_wb_range(a, s) arm64_dcache_wb_range((a), (s)) -#define cpu_idcache_wbinv_range(a, s) arm64_idcache_wbinv_range((a), (s)) #define cpu_icache_sync_range(a, s) arm64_icache_sync_range((a), (s)) #define cpu_icache_sync_range_checked(a, s) arm64_icache_sync_range_checked((a), (s)) @@ -224,7 +223,6 @@ void arm64_nullop(void); void arm64_tlb_flushID(void); void arm64_icache_sync_range(vm_offset_t, vm_size_t); int arm64_icache_sync_range_checked(vm_offset_t, vm_size_t); -void arm64_idcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_wbinv_range(vm_offset_t, vm_size_t); void arm64_dcache_inv_range(vm_offset_t, vm_size_t); void arm64_dcache_wb_range(vm_offset_t, vm_size_t); From owner-svn-src-all@freebsd.org Fri May 15 13:50:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E1502F624A; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NqXw3jMzz3Mgc; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7A7D12521B; Fri, 15 May 2020 13:50:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDo80E016322; Fri, 15 May 2020 13:50:08 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDo82Y016321; Fri, 15 May 2020 13:50:08 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151350.04FDo82Y016321@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:50:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361077 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361077 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:50:08 -0000 Author: kib Date: Fri May 15 13:50:08 2020 New Revision: 361077 URL: https://svnweb.freebsd.org/changeset/base/361077 Log: Implement RTLD_DEEPBIND. PR: 246462 Tested by: Martin Birgmeier Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D24841 Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:33:48 2020 (r361076) +++ head/sys/kern/kern_mib.c Fri May 15 13:50:08 2020 (r361077) @@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-all@freebsd.org Fri May 15 13:52:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0424D2F6499; Fri, 15 May 2020 13:52:40 +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 49Nqbq6L0Bz3N5g; Fri, 15 May 2020 13:52:39 +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 D4AF3253FC; Fri, 15 May 2020 13:52:39 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDqdVC022464; Fri, 15 May 2020 13:52:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDqd0G022463; Fri, 15 May 2020 13:52:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151352.04FDqd0G022463@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:52:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361078 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361078 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:52:40 -0000 Author: kib Date: Fri May 15 13:52:39 2020 New Revision: 361078 URL: https://svnweb.freebsd.org/changeset/base/361078 Log: Revert r361077 to recommit with proper message. Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:50:08 2020 (r361077) +++ head/sys/kern/kern_mib.c Fri May 15 13:52:39 2020 (r361078) @@ -238,9 +238,8 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. - * Truncate any page size greater than UINT32_MAX to zero, - * which assumes that page sizes are powers of two. + * Recreate the "pagesizes" array with 32-bit elements. Truncate + * any page size greater than UINT32_MAX to zero. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-all@freebsd.org Fri May 15 13:53:11 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 869332F64F8; Fri, 15 May 2020 13:53:11 +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 49NqcR2z7xz3ND0; Fri, 15 May 2020 13:53:11 +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 61332253FD; Fri, 15 May 2020 13:53:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FDrBTK022534; Fri, 15 May 2020 13:53:11 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FDrBst022533; Fri, 15 May 2020 13:53:11 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005151353.04FDrBst022533@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 15 May 2020 13:53:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361079 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 361079 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 13:53:11 -0000 Author: kib Date: Fri May 15 13:53:10 2020 New Revision: 361079 URL: https://svnweb.freebsd.org/changeset/base/361079 Log: Improve comment for compat32 handling of sysctl hw.pagesizes. Explain why truncation works as intended. Reformat. Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/kern/kern_mib.c Modified: head/sys/kern/kern_mib.c ============================================================================== --- head/sys/kern/kern_mib.c Fri May 15 13:52:39 2020 (r361078) +++ head/sys/kern/kern_mib.c Fri May 15 13:53:10 2020 (r361079) @@ -238,8 +238,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-all@freebsd.org Fri May 15 14:00:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1BED2F6607; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@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 49NqmY668cz3NQB; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 C88482541C; Fri, 15 May 2020 14:00:13 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FE0DLa022992; Fri, 15 May 2020 14:00:13 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FE0DKe022989; Fri, 15 May 2020 14:00:13 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <202005151400.04FE0DKe022989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Fri, 15 May 2020 14:00:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361080 - head/sys/netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet/tcp_stacks X-SVN-Commit-Revision: 361080 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:00:14 -0000 Author: rrs Date: Fri May 15 14:00:12 2020 New Revision: 361080 URL: https://svnweb.freebsd.org/changeset/base/361080 Log: This fixes several skyzaller issues found with the help of Michael Tuexen. There was some accounting errors with TCPFO for bbr and also for both rack and bbr there was a FO case where we should be jumping to the just_return_nolock label to exit instead of returning 0. This of course caused no timer to be running and thus the stuck sessions. Reported by: Michael Tuexen and Skyzaller Sponsored by: Netflix Inc. Differential Revision: https://reviews.freebsd.org/D24852 Modified: head/sys/netinet/tcp_stacks/bbr.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_stacks/rack_bbr_common.c Modified: head/sys/netinet/tcp_stacks/bbr.c ============================================================================== --- head/sys/netinet/tcp_stacks/bbr.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/bbr.c Fri May 15 14:00:12 2020 (r361080) @@ -4975,6 +4975,15 @@ bbr_remxt_tmr(struct tcpcb *tp) rsm->r_flags &= ~(BBR_ACKED | BBR_SACK_PASSED | BBR_WAS_SACKPASS); bbr_log_type_rsmclear(bbr, cts, rsm, old_flags, __LINE__); } else { + if ((tp->t_state < TCPS_ESTABLISHED) && + (rsm->r_start == tp->snd_una)) { + /* + * Special case for TCP FO. Where + * we sent more data beyond the snd_max. + * We don't mark that as lost and stop here. + */ + break; + } if ((rsm->r_flags & BBR_MARKED_LOST) == 0) { bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start; bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start; @@ -12315,7 +12324,8 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeva (tp->t_state == TCPS_SYN_SENT)) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ (tp->t_rxtshift == 0)) { /* not a retransmit */ - return (0); + len = 0; + goto just_return_nolock; } /* * Before sending anything check for a state update. For hpts @@ -14286,6 +14296,7 @@ nomore: (hw_tls == 0) && (len > 0) && ((flags & TH_RST) == 0) && + ((flags & TH_SYN) == 0) && (IN_RECOVERY(tp->t_flags) == 0) && (bbr->rc_in_persist == 0) && (tot_len < bbr->r_ctl.rc_pace_max_segs)) { Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/rack.c Fri May 15 14:00:12 2020 (r361080) @@ -3873,6 +3873,7 @@ skip_measurement: * the next send will trigger us picking up the missing data. */ if (rack->r_ctl.rc_first_appl && + TCPS_HAVEESTABLISHED(tp->t_state) && rack->r_ctl.rc_app_limited_cnt && (SEQ_GT(rack->r_ctl.rc_first_appl->r_start, th_ack)) && ((rack->r_ctl.rc_first_appl->r_start - th_ack) > @@ -11741,6 +11742,13 @@ rack_start_gp_measurement(struct tcpcb *tp, struct tcp struct rack_sendmap *my_rsm = NULL; struct rack_sendmap fe; + if (tp->t_state < TCPS_ESTABLISHED) { + /* + * We don't start any measurements if we are + * not at least established. + */ + return; + } tp->t_flags |= TF_GPUTINPROG; rack->r_ctl.rc_gp_lowrtt = 0xffffffff; rack->r_ctl.rc_gp_high_rwnd = rack->rc_tp->snd_wnd; @@ -12109,8 +12117,10 @@ rack_output(struct tcpcb *tp) ((tp->t_state == TCPS_SYN_RECEIVED) || (tp->t_state == TCPS_SYN_SENT)) && SEQ_GT(tp->snd_max, tp->snd_una) && /* initial SYN or SYN|ACK sent */ - (tp->t_rxtshift == 0)) /* not a retransmit */ - return (0); + (tp->t_rxtshift == 0)) { /* not a retransmit */ + cwnd_to_use = rack->r_ctl.cwnd_to_use = tp->snd_cwnd; + goto just_return_nolock; + } /* * Determine length of data that should be transmitted, and flags * that will be used. If there is some data or critical controls Modified: head/sys/netinet/tcp_stacks/rack_bbr_common.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri May 15 13:53:10 2020 (r361079) +++ head/sys/netinet/tcp_stacks/rack_bbr_common.c Fri May 15 14:00:12 2020 (r361080) @@ -466,7 +466,14 @@ ctf_do_queued_segments(struct socket *so, struct tcpcb uint32_t ctf_outstanding(struct tcpcb *tp) { - return(tp->snd_max - tp->snd_una); + uint32_t bytes_out; + + bytes_out = tp->snd_max - tp->snd_una; + if (tp->t_state < TCPS_ESTABLISHED) + bytes_out++; + if (tp->t_flags & TF_SENTFIN) + bytes_out++; + return (bytes_out); } uint32_t From owner-svn-src-all@freebsd.org Fri May 15 14:06:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0AB742F67DF; Fri, 15 May 2020 14:06:38 +0000 (UTC) (envelope-from tuexen@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 49Nqvx6FzQz3P4D; Fri, 15 May 2020 14:06:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 D20E32561A; Fri, 15 May 2020 14:06:37 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FE6bth028618; Fri, 15 May 2020 14:06:37 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FE6bmZ028617; Fri, 15 May 2020 14:06:37 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005151406.04FE6bmZ028617@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Fri, 15 May 2020 14:06:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361081 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361081 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:06:38 -0000 Author: tuexen Date: Fri May 15 14:06:37 2020 New Revision: 361081 URL: https://svnweb.freebsd.org/changeset/base/361081 Log: Allow only IPv4 addresses in sendto() for TCP on AF_INET sockets. This problem was found by looking at syzkaller reproducers for some other problems. Reviewed by: rrs Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D24831 Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Fri May 15 14:00:12 2020 (r361080) +++ head/sys/netinet/tcp_usrreq.c Fri May 15 14:06:37 2020 (r361081) @@ -1037,6 +1037,12 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf error = EINVAL; goto out; } + if ((inp->inp_vflag & INP_IPV6PROTO) == 0) { + if (m != NULL) + m_freem(m); + error = EAFNOSUPPORT; + goto out; + } if (IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr)) { if (m) m_freem(m); From owner-svn-src-all@freebsd.org Fri May 15 14:21:41 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26C042F6B4B; Fri, 15 May 2020 14:21:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk1-x744.google.com (mail-qk1-x744.google.com [IPv6:2607:f8b0:4864:20::744]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NrFH32gFz3Psk; Fri, 15 May 2020 14:21:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk1-x744.google.com with SMTP id i5so2622697qkl.12; Fri, 15 May 2020 07:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=YvNwUr4qNxmPVFMz3uTeKdGgV0OhdbkZ81zs3yq3Scc=; b=iCSkGIiHD3vwfwGu848l5g5t7LIvlygIVwn0yZtm3JPYkIKJ/o/wDs89HVBN+7s2v4 d2QVgtxIJKnlxL1j6aIi6652e/ZyIvMeGUx8RDj4ujhsj0CGxkVjm1GL9QJdtzPuvX/S STXg3uGS1IhuhohAHoJEBoiYD/rokcef0RzZRhBzS58r+y5u8Nk+6s+k+EZzmREh4kHA +hl7ddS/+AsadwWobAI8PTABYwE23o+F4km49VGzgJm2aYNz2ieex3i+E6fALY2tSHHi v13elYUeWVmangFJcJlT1QFJMuYqHBxYVIJHe5WOyYUTcVKoea31y+BOj450xjZSuPk0 NfAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=YvNwUr4qNxmPVFMz3uTeKdGgV0OhdbkZ81zs3yq3Scc=; b=BYYGWFcPWxrg8SO9j5IwXB7W0AkCPEN6y5pV7qeYHy9m+tgK+yJ6pXTabqh9Q5t9wj TpDIqHJlJr2s75KCmMs6GdlwcOZTO8ZVHvv4Laoyr4lKoij+ERxonHE6nKyxofD/awVl 3pLyn8K2l3AOJ1vM+6wYK5e0j3YWanMJA1N7FoyhQT24XJOWwwAWFpHHnnM5jkDAm7YH +QNmP1jZyRtCBH3vwnfe/UbR1izzmtPTjofVJ6jDj5+TPG+vW7mpXf5gm8U4j5uVOsrq Q9QprOu4XmNf00MwzhUUpINnr9Jo7wKkizfLwE8jplVYJy9XH8kIEs5Px95tMUGKVyr9 9iBQ== X-Gm-Message-State: AOAM531oGN1H0bbirobDLANpD5Jof+Q16n7yOnKmJj/wpD239cQtFM9x VkPRyArO5xG3s3d5KvKmmhX0F5pm X-Google-Smtp-Source: ABdhPJwumQeycvuXRGUiycoHx/X6zapNggho1qYz6pVYnlT6Sfs1u4QarOtofFHJa6IrIRYDw8zDcg== X-Received: by 2002:a37:8187:: with SMTP id c129mr3548213qkd.211.1589552494781; Fri, 15 May 2020 07:21:34 -0700 (PDT) Received: from raichu (toroon0560w-lp130-15-184-144-87-103.dsl.bell.ca. [184.144.87.103]) by smtp.gmail.com with ESMTPSA id n206sm1684103qke.20.2020.05.15.07.21.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 07:21:34 -0700 (PDT) Sender: Mark Johnston Date: Fri, 15 May 2020 10:21:29 -0400 From: Mark Johnston To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys Message-ID: <20200515142129.GA24650@raichu> References: <202005112030.04BKUTBt004140@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202005112030.04BKUTBt004140@repo.freebsd.org> X-Rspamd-Queue-Id: 49NrFH32gFz3Psk X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=iCSkGIiH; dmarc=none; spf=pass (mx1.freebsd.org: domain of markjdb@gmail.com designates 2607:f8b0:4864:20::744 as permitted sender) smtp.mailfrom=markjdb@gmail.com X-Spamd-Result: default: False [-1.83 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-0.98)[-0.976,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-0.16)[ip: (0.01), ipnet: 2607:f8b0::/32(-0.33), asn: 15169(-0.42), country: US(-0.05)]; DKIM_TRACE(0.00)[gmail.com:+]; RCVD_IN_DNSWL_NONE(0.00)[4.4.7.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.b.8.f.7.0.6.2.list.dnswl.org : 127.0.5.0]; FORGED_SENDER(0.30)[markj@freebsd.org,markjdb@gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[103.87.144.184.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11]; MID_RHS_NOT_FQDN(0.50)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FROM_NEQ_ENVFROM(0.00)[markj@freebsd.org,markjdb@gmail.com]; RCVD_TLS_ALL(0.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:21:41 -0000 On Mon, May 11, 2020 at 08:30:29PM +0000, John Baldwin wrote: > Author: jhb > Date: Mon May 11 20:30:28 2020 > New Revision: 360918 > URL: https://svnweb.freebsd.org/changeset/base/360918 > > Log: > Remove ubsec(4). > > This driver was previously marked for deprecation in r360710. We still have tools/tools/crypto/ubsecstats.c. Is there a reason to keep it, or was it an oversight? > > Approved by: csprng (cem, gordon, delphij) > Relnotes: yes > Sponsored by: Chelsio Communications > Differential Revision: https://reviews.freebsd.org/D24766 > > Deleted: > head/share/man/man4/ubsec.4 > head/sys/dev/ubsec/ubsec.c > head/sys/dev/ubsec/ubsecreg.h > head/sys/dev/ubsec/ubsecvar.h > head/sys/modules/ubsec/Makefile > Modified: > head/ObsoleteFiles.inc > head/share/man/man4/Makefile > head/share/man/man4/crypto.4 > head/share/man/man4/rndtest.4 > head/sys/conf/NOTES > head/sys/conf/files > head/sys/conf/options > head/sys/dev/random/random_harvestq.c > head/sys/modules/Makefile > head/sys/sys/random.h From owner-svn-src-all@freebsd.org Fri May 15 14:51:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E98AE2F7693; Fri, 15 May 2020 14:51:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NrvS5xhJz3wkY; Fri, 15 May 2020 14:51:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-164.local (unknown [IPv6:2601:648:8203:2990:6cc8:51a1:64e1:939f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 5E9C91B3D6; Fri, 15 May 2020 14:51:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: svn commit: r360918 - in head: . share/man/man4 sys/conf sys/dev/random sys/dev/ubsec sys/modules sys/modules/ubsec sys/sys To: Mark Johnston Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005112030.04BKUTBt004140@repo.freebsd.org> <20200515142129.GA24650@raichu> From: John Baldwin Autocrypt: addr=jhb@FreeBSD.org; keydata= mQGiBETQ+XcRBADMFybiq69u+fJRy/0wzqTNS8jFfWaBTs5/OfcV7wWezVmf9sgwn8TW0Dk0 c9MBl0pz+H01dA2ZSGZ5fXlmFIsee1WEzqeJzpiwd/pejPgSzXB9ijbLHZ2/E0jhGBcVy5Yo /Tw5+U/+laeYKu2xb0XPvM0zMNls1ah5OnP9a6Ql6wCgupaoMySb7DXm2LHD1Z9jTsHcAQMD /1jzh2BoHriy/Q2s4KzzjVp/mQO5DSm2z14BvbQRcXU48oAosHA1u3Wrov6LfPY+0U1tG47X 1BGfnQH+rNAaH0livoSBQ0IPI/8WfIW7ub4qV6HYwWKVqkDkqwcpmGNDbz3gfaDht6nsie5Z pcuCcul4M9CW7Md6zzyvktjnbz61BADGDCopfZC4of0Z3Ka0u8Wik6UJOuqShBt1WcFS8ya1 oB4rc4tXfSHyMF63aPUBMxHR5DXeH+EO2edoSwViDMqWk1jTnYza51rbGY+pebLQOVOxAY7k do5Ordl3wklBPMVEPWoZ61SdbcjhHVwaC5zfiskcxj5wwXd2E9qYlBqRg7QeSm9obiBCYWxk d2luIDxqaGJARnJlZUJTRC5vcmc+iGAEExECACAFAkTQ+awCGwMGCwkIBwMCBBUCCAMEFgID AQIeAQIXgAAKCRBy3lIGd+N/BI6RAJ9S97fvbME+3hxzE3JUyUZ6vTewDACdE1stFuSfqMvM jomvZdYxIYyTUpC5Ag0ERND5ghAIAPwsO0B7BL+bz8sLlLoQktGxXwXQfS5cInvL17Dsgnr3 1AKa94j9EnXQyPEj7u0d+LmEe6CGEGDh1OcGFTMVrof2ZzkSy4+FkZwMKJpTiqeaShMh+Goj XlwIMDxyADYvBIg3eN5YdFKaPQpfgSqhT+7El7w+wSZZD8pPQuLAnie5iz9C8iKy4/cMSOrH YUK/tO+Nhw8Jjlw94Ik0T80iEhI2t+XBVjwdfjbq3HrJ0ehqdBwukyeJRYKmbn298KOFQVHO EVbHA4rF/37jzaMadK43FgJ0SAhPPF5l4l89z5oPu0b/+5e2inA3b8J3iGZxywjM+Csq1tqz hltEc7Q+E08AAwUIAL+15XH8bPbjNJdVyg2CMl10JNW2wWg2Q6qdljeaRqeR6zFus7EZTwtX sNzs5bP8y51PSUDJbeiy2RNCNKWFMndM22TZnk3GNG45nQd4OwYK0RZVrikalmJY5Q6m7Z16 4yrZgIXFdKj2t8F+x613/SJW1lIr9/bDp4U9tw0V1g3l2dFtD3p3ZrQ3hpoDtoK70ioIAjjH aIXIAcm3FGZFXy503DOA0KaTWwvOVdYCFLm3zWuSOmrX/GsEc7ovasOWwjPn878qVjbUKWwx Q4QkF4OhUV9zPtf9tDSAZ3x7QSwoKbCoRCZ/xbyTUPyQ1VvNy/mYrBcYlzHodsaqUDjHuW+I SQQYEQIACQUCRND5ggIbDAAKCRBy3lIGd+N/BCO8AJ9j1dWVQWxw/YdTbEyrRKOY8YZNwwCf afMAg8QvmOWnHx3wl8WslCaXaE8= Message-ID: <55c533a9-0ceb-d880-b543-7b709fede496@FreeBSD.org> Date: Fri, 15 May 2020 07:51:14 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 In-Reply-To: <20200515142129.GA24650@raichu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 14:51:17 -0000 On 5/15/20 7:21 AM, Mark Johnston wrote: > On Mon, May 11, 2020 at 08:30:29PM +0000, John Baldwin wrote: >> Author: jhb >> Date: Mon May 11 20:30:28 2020 >> New Revision: 360918 >> URL: https://svnweb.freebsd.org/changeset/base/360918 >> >> Log: >> Remove ubsec(4). >> >> This driver was previously marked for deprecation in r360710. > > We still have tools/tools/crypto/ubsecstats.c. Is there a reason to > keep it, or was it an oversight? Ah, oversight. (Did not cast a wide-enough grep) -- John Baldwin From owner-svn-src-all@freebsd.org Fri May 15 15:54:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F13612F8E2E; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NtJJ5nCnz427J; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A80B826C87; Fri, 15 May 2020 15:54:24 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FFsOX7096943; Fri, 15 May 2020 15:54:24 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FFsMvb096933; Fri, 15 May 2020 15:54:22 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005151554.04FFsMvb096933@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Fri, 15 May 2020 15:54:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361082 - in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: lib/libvmmapi sys/amd64/include sys/amd64/vmm usr.sbin/bhyve X-SVN-Commit-Revision: 361082 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 15:54:25 -0000 Author: cem Date: Fri May 15 15:54:22 2020 New Revision: 361082 URL: https://svnweb.freebsd.org/changeset/base/361082 Log: vmm(4), bhyve(8): Expose kernel-emulated special devices to userspace Expose the special kernel LAPIC, IOAPIC, and HPET devices to userspace for use in, e.g., fallback instruction emulation (when userspace has a newer instruction decode/emulation layer than the kernel vmm(4)). Plumb the ioctl through libvmmapi and register the memory ranges in bhyve(8). Reviewed by: grehan Differential Revision: https://reviews.freebsd.org/D24525 Added: head/usr.sbin/bhyve/kernemu_dev.c (contents, props changed) head/usr.sbin/bhyve/kernemu_dev.h (contents, props changed) Modified: head/lib/libvmmapi/vmmapi.c head/lib/libvmmapi/vmmapi.h head/sys/amd64/include/vmm_dev.h head/sys/amd64/vmm/vmm_dev.c head/usr.sbin/bhyve/Makefile head/usr.sbin/bhyve/bhyverun.c Modified: head/lib/libvmmapi/vmmapi.c ============================================================================== --- head/lib/libvmmapi/vmmapi.c Fri May 15 14:06:37 2020 (r361081) +++ head/lib/libvmmapi/vmmapi.c Fri May 15 15:54:22 2020 (r361082) @@ -799,6 +799,25 @@ vm_ioapic_pincount(struct vmctx *ctx, int *pincount) } int +vm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu, vm_paddr_t gpa, + bool write, int size, uint64_t *value) +{ + struct vm_readwrite_kernemu_device irp = { + .vcpuid = vcpu, + .access_width = fls(size) - 1, + .gpa = gpa, + .value = write ? *value : ~0ul, + }; + long cmd = (write ? VM_SET_KERNEMU_DEV : VM_GET_KERNEMU_DEV); + int rc; + + rc = ioctl(ctx->fd, cmd, &irp); + if (rc == 0 && !write) + *value = irp.value; + return (rc); +} + +int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq) { struct vm_isa_irq isa_irq; @@ -1615,6 +1634,7 @@ vm_get_ioctls(size_t *len) VM_MMAP_GETNEXT, VM_SET_REGISTER, VM_GET_REGISTER, VM_SET_SEGMENT_DESCRIPTOR, VM_GET_SEGMENT_DESCRIPTOR, VM_SET_REGISTER_SET, VM_GET_REGISTER_SET, + VM_SET_KERNEMU_DEV, VM_GET_KERNEMU_DEV, VM_INJECT_EXCEPTION, VM_LAPIC_IRQ, VM_LAPIC_LOCAL_IRQ, VM_LAPIC_MSI, VM_IOAPIC_ASSERT_IRQ, VM_IOAPIC_DEASSERT_IRQ, VM_IOAPIC_PULSE_IRQ, VM_IOAPIC_PINCOUNT, VM_ISA_ASSERT_IRQ, Modified: head/lib/libvmmapi/vmmapi.h ============================================================================== --- head/lib/libvmmapi/vmmapi.h Fri May 15 14:06:37 2020 (r361081) +++ head/lib/libvmmapi/vmmapi.h Fri May 15 15:54:22 2020 (r361082) @@ -35,6 +35,8 @@ #include #include +#include + /* * API version for out-of-tree consumers like grub-bhyve for making compile * time decisions. @@ -156,6 +158,8 @@ int vm_ioapic_assert_irq(struct vmctx *ctx, int irq); int vm_ioapic_deassert_irq(struct vmctx *ctx, int irq); int vm_ioapic_pulse_irq(struct vmctx *ctx, int irq); int vm_ioapic_pincount(struct vmctx *ctx, int *pincount); +int vm_readwrite_kernemu_device(struct vmctx *ctx, int vcpu, + vm_paddr_t gpa, bool write, int size, uint64_t *value); int vm_isa_assert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_deassert_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); int vm_isa_pulse_irq(struct vmctx *ctx, int atpic_irq, int ioapic_irq); Modified: head/sys/amd64/include/vmm_dev.h ============================================================================== --- head/sys/amd64/include/vmm_dev.h Fri May 15 14:06:37 2020 (r361081) +++ head/sys/amd64/include/vmm_dev.h Fri May 15 15:54:22 2020 (r361082) @@ -235,6 +235,15 @@ struct vm_cpu_topology { uint16_t maxcpus; }; +struct vm_readwrite_kernemu_device { + int vcpuid; + unsigned access_width : 3; + unsigned _unused : 29; + uint64_t gpa; + uint64_t value; +}; +_Static_assert(sizeof(struct vm_readwrite_kernemu_device) == 24, "ABI"); + enum { /* general routines */ IOCNUM_ABIVERS = 0, @@ -262,6 +271,8 @@ enum { IOCNUM_GET_SEGMENT_DESCRIPTOR = 23, IOCNUM_SET_REGISTER_SET = 24, IOCNUM_GET_REGISTER_SET = 25, + IOCNUM_GET_KERNEMU_DEV = 26, + IOCNUM_SET_KERNEMU_DEV = 27, /* interrupt injection */ IOCNUM_GET_INTINFO = 28, @@ -347,6 +358,12 @@ enum { _IOW('v', IOCNUM_SET_REGISTER_SET, struct vm_register_set) #define VM_GET_REGISTER_SET \ _IOWR('v', IOCNUM_GET_REGISTER_SET, struct vm_register_set) +#define VM_SET_KERNEMU_DEV \ + _IOW('v', IOCNUM_SET_KERNEMU_DEV, \ + struct vm_readwrite_kernemu_device) +#define VM_GET_KERNEMU_DEV \ + _IOWR('v', IOCNUM_GET_KERNEMU_DEV, \ + struct vm_readwrite_kernemu_device) #define VM_INJECT_EXCEPTION \ _IOW('v', IOCNUM_INJECT_EXCEPTION, struct vm_exception) #define VM_LAPIC_IRQ \ Modified: head/sys/amd64/vmm/vmm_dev.c ============================================================================== --- head/sys/amd64/vmm/vmm_dev.c Fri May 15 14:06:37 2020 (r361081) +++ head/sys/amd64/vmm/vmm_dev.c Fri May 15 15:54:22 2020 (r361082) @@ -58,6 +58,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "vmm_lapic.h" #include "vmm_stat.h" @@ -382,6 +383,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da struct vm_rtc_data *rtcdata; struct vm_memmap *mm; struct vm_cpu_topology *topology; + struct vm_readwrite_kernemu_device *kernemu; uint64_t *regvals; int *regnums; #ifdef BHYVE_SNAPSHOT @@ -561,6 +563,41 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t da case VM_IOAPIC_PINCOUNT: *(int *)data = vioapic_pincount(sc->vm); break; + case VM_SET_KERNEMU_DEV: + case VM_GET_KERNEMU_DEV: { + mem_region_write_t mwrite; + mem_region_read_t mread; + bool arg; + + kernemu = (void *)data; + + if (kernemu->access_width > 0) + size = (1u << kernemu->access_width); + else + size = 1; + + if (kernemu->gpa >= DEFAULT_APIC_BASE && kernemu->gpa < DEFAULT_APIC_BASE + PAGE_SIZE) { + mread = lapic_mmio_read; + mwrite = lapic_mmio_write; + } else if (kernemu->gpa >= VIOAPIC_BASE && kernemu->gpa < VIOAPIC_BASE + VIOAPIC_SIZE) { + mread = vioapic_mmio_read; + mwrite = vioapic_mmio_write; + } else if (kernemu->gpa >= VHPET_BASE && kernemu->gpa < VHPET_BASE + VHPET_SIZE) { + mread = vhpet_mmio_read; + mwrite = vhpet_mmio_write; + } else { + error = EINVAL; + break; + } + + if (cmd == VM_SET_KERNEMU_DEV) + error = mwrite(sc->vm, kernemu->vcpuid, kernemu->gpa, + kernemu->value, size, &arg); + else + error = mread(sc->vm, kernemu->vcpuid, kernemu->gpa, + &kernemu->value, size, &arg); + break; + } case VM_ISA_ASSERT_IRQ: isa_irq = (struct vm_isa_irq *)data; error = vatpic_assert_irq(sc->vm, isa_irq->atpic_irq); Modified: head/usr.sbin/bhyve/Makefile ============================================================================== --- head/usr.sbin/bhyve/Makefile Fri May 15 14:06:37 2020 (r361081) +++ head/usr.sbin/bhyve/Makefile Fri May 15 15:54:22 2020 (r361082) @@ -31,6 +31,7 @@ SRCS= \ hda_codec.c \ inout.c \ ioapic.c \ + kernemu_dev.c \ mem.c \ mevent.c \ mptbl.c \ @@ -75,6 +76,8 @@ SRCS= \ .if ${MK_BHYVE_SNAPSHOT} != "no" SRCS+= snapshot.c .endif + +CFLAGS.kernemu_dev.c+= -I${SRCTOP}/sys/amd64 .PATH: ${BHYVE_SYSDIR}/sys/amd64/vmm SRCS+= vmm_instruction_emul.c Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Fri May 15 14:06:37 2020 (r361081) +++ head/usr.sbin/bhyve/bhyverun.c Fri May 15 15:54:22 2020 (r361082) @@ -92,6 +92,7 @@ __FBSDID("$FreeBSD$"); #include "fwctl.h" #include "gdb.h" #include "ioapic.h" +#include "kernemu_dev.h" #include "mem.h" #include "mevent.h" #include "mptbl.h" @@ -1268,6 +1269,7 @@ main(int argc, char *argv[]) init_mem(); init_inout(); + kernemu_dev_init(); init_bootrom(ctx); atkbdc_init(ctx); pci_irq_init(ctx); Added: head/usr.sbin/bhyve/kernemu_dev.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/kernemu_dev.c Fri May 15 15:54:22 2020 (r361082) @@ -0,0 +1,98 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2020 Conrad Meyer . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include + +#include +#include +struct vm; +struct vm_hpet_cap; +#include +#include + +#include +#include +#include + +#include "kernemu_dev.h" +#include "mem.h" + +static int +apic_handler(struct vmctx *ctx, int vcpu, int dir, uint64_t addr, int size, + uint64_t *val, void *arg1 __unused, long arg2 __unused) +{ + if (vm_readwrite_kernemu_device(ctx, vcpu, addr, (dir == MEM_F_WRITE), + size, val) != 0) + return (errno); + return (0); +} + +static struct mem_range lapic_mmio = { + .name = "kern-lapic-mmio", + .base = DEFAULT_APIC_BASE, + .size = PAGE_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, + +}; +static struct mem_range ioapic_mmio = { + .name = "kern-ioapic-mmio", + .base = VIOAPIC_BASE, + .size = VIOAPIC_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, +}; +static struct mem_range hpet_mmio = { + .name = "kern-hpet-mmio", + .base = VHPET_BASE, + .size = VHPET_SIZE, + .flags = MEM_F_RW | MEM_F_IMMUTABLE, + .handler = apic_handler, +}; + +void +kernemu_dev_init(void) +{ + int rc; + + rc = register_mem(&lapic_mmio); + if (rc != 0) + errc(4, rc, "register_mem: LAPIC (0x%08x)", + (unsigned)lapic_mmio.base); + rc = register_mem(&ioapic_mmio); + if (rc != 0) + errc(4, rc, "register_mem: IOAPIC (0x%08x)", + (unsigned)ioapic_mmio.base); + rc = register_mem(&hpet_mmio); + if (rc != 0) + errc(4, rc, "register_mem: HPET (0x%08x)", + (unsigned)hpet_mmio.base); +} Added: head/usr.sbin/bhyve/kernemu_dev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/bhyve/kernemu_dev.h Fri May 15 15:54:22 2020 (r361082) @@ -0,0 +1,32 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright 2020 Conrad Meyer . All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#pragma once + +void kernemu_dev_init(void); From owner-svn-src-all@freebsd.org Fri May 15 15:55:03 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 79EB22F8E8B; Fri, 15 May 2020 15:55:03 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49NtK32M2Nz42Gg; Fri, 15 May 2020 15:55:03 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 16F3A1C0E2; Fri, 15 May 2020 15:55:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: Mateusz Piotrowski <0mp@FreeBSD.org>, Ryan Moeller , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005142338.04ENcCN5094159@repo.freebsd.org> From: Ryan Moeller Message-ID: <0c6939cc-7f8a-d2fd-9da1-63eb641815e3@FreeBSD.org> Date: Fri, 15 May 2020 11:55:02 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 15:55:03 -0000 On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > On 5/15/20 1:38 AM, Ryan Moeller wrote: >> Author: freqlabs >> Date: Thu May 14 23:38:11 2020 >> New Revision: 361066 >> URL: https://svnweb.freebsd.org/changeset/base/361066 >> >> Log: >> jail: Add exec.prepare and exec.release command hooks >> >> This change introduces new jail command hooks that run before and after any >> other actions. > Should it go into RELNOTES? I'm not sure what all the criteria are for relnotes. The committer's guide makes it seem like relnotes is for breaking changes, which this is not. -Ryan From owner-svn-src-all@freebsd.org Fri May 15 17:37:09 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D717F2FB7B2; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@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 49NwZs5Qk8z4B7H; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 AF8FD27FD9; Fri, 15 May 2020 17:37:09 +0000 (UTC) (envelope-from mr@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FHb9v1063656; Fri, 15 May 2020 17:37:09 GMT (envelope-from mr@FreeBSD.org) Received: (from mr@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FHb81Q063652; Fri, 15 May 2020 17:37:08 GMT (envelope-from mr@FreeBSD.org) Message-Id: <202005151737.04FHb81Q063652@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mr set sender to mr@FreeBSD.org using -f From: Michael Reifenberger Date: Fri, 15 May 2020 17:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361084 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: mr X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 361084 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 17:37:10 -0000 Author: mr Date: Fri May 15 17:37:08 2020 New Revision: 361084 URL: https://svnweb.freebsd.org/changeset/base/361084 Log: Introduce sysputpage() to display large page size with human readable format. Using UI units allows to fit larger numbers in columns. Stop calling v_page_size - this is a value that doesn't change at runtime. Renamed WINDOW *wnd to *wd to avoid conflict with global *wnd variable. Use bit-shift to convert page size to byte. PR: 246458 Submitted by: ota@j.email.ne.jp MFC after: 2 weeks Differential Revision: D24834 Modified: head/usr.bin/systat/extern.h head/usr.bin/systat/fetch.c head/usr.bin/systat/sysput.c head/usr.bin/systat/vmstat.c Modified: head/usr.bin/systat/extern.h ============================================================================== --- head/usr.bin/systat/extern.h Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/extern.h Fri May 15 17:37:08 2020 (r361084) @@ -165,8 +165,11 @@ void showtcp(void); void status(void); void suspend(int); char *sysctl_dynread(const char *, size_t *); +void sysputpage(WINDOW* , int, int, int, uint64_t, int); +void sysputspaces(WINDOW* , int, int, int); void sysputstrs(WINDOW* , int, int, int); void sysputuint64(WINDOW* , int, int, int, uint64_t, int); +void sysputwuint64(WINDOW* , int, int, int, uint64_t, int); #define SYSTAT_CMD(name) \ void close ## name(WINDOW *); \ Modified: head/usr.bin/systat/fetch.c ============================================================================== --- head/usr.bin/systat/fetch.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/fetch.c Fri May 15 17:37:08 2020 (r361084) @@ -60,9 +60,11 @@ kvm_ckread(void *a, void *b, int l) return (1); } -void getsysctl(const char *name, void *ptr, size_t len) +void +getsysctl(const char *name, void *ptr, size_t len) { size_t nlen = len; + if (sysctlbyname(name, ptr, &nlen, NULL, 0) != 0) { error("sysctl(%s...) failed: %s", name, strerror(errno)); Modified: head/usr.bin/systat/sysput.c ============================================================================== --- head/usr.bin/systat/sysput.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/sysput.c Fri May 15 17:37:08 2020 (r361084) @@ -41,15 +41,23 @@ __FBSDID("$FreeBSD$"); #include "extern.h" void -sysputstrs(WINDOW *wnd, int row, int col, int width) +sysputspaces(WINDOW *wd, int row, int col, int width) { + static char str40[] = " "; + + mvwaddstr(wd, row, col, str40 + sizeof(str40) - width - 1); +} + +void +sysputstrs(WINDOW *wd, int row, int col, int width) +{ static char str40[] = "****************************************"; mvwaddstr(wnd, row, col, str40 + sizeof(str40) - width - 1); } void -sysputuint64(WINDOW *wnd, int row, int col, int width, uint64_t val, int flags) +sysputuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) { char unit, *ptr, *start, wrtbuf[width + width + 1]; int len; @@ -69,9 +77,42 @@ sysputuint64(WINDOW *wnd, int row, int col, int width, memset(wrtbuf + len, ' ', width - len); start += len; - mvwaddstr(wnd, row, col, start); + mvwaddstr(wd, row, col, start); return; error: - sysputstrs(wnd, row, col, width); + sysputstrs(wd, row, col, width); +} + +void +sysputwuint64(WINDOW *wd, int row, int col, int width, uint64_t val, int flags) +{ + if(val == 0) + sysputspaces(wd, row, col, width); + else + sysputuint64(wd, row, col, width, val, flags); +} + +static int +calc_page_shift() +{ + u_int page_size; + int shifts; + + shifts = 0; + GETSYSCTL("vm.stats.vm.v_page_size", page_size); + for(; page_size > 1; page_size >>= 1) + shifts++; + return shifts; +} + +void +sysputpage(WINDOW *wd, int row, int col, int width, uint64_t pages, int flags) +{ + static int shifts = 0; + + if (shifts == 0) + shifts = calc_page_shift(); + pages <<= shifts; + sysputuint64(wd, row, col, width, pages, flags); } Modified: head/usr.bin/systat/vmstat.c ============================================================================== --- head/usr.bin/systat/vmstat.c Fri May 15 16:14:50 2020 (r361083) +++ head/usr.bin/systat/vmstat.c Fri May 15 17:37:08 2020 (r361084) @@ -104,7 +104,6 @@ static struct Info { /* * Distribution of page usages. */ - u_int v_page_size; /* page size in bytes */ u_int v_free_count; /* number of pages free */ u_int v_wire_count; /* number of pages wired down */ u_int v_active_count; /* number of pages active */ @@ -173,15 +172,15 @@ closekre(WINDOW *w) #define STATCOL 0 #define MEMROW 2 /* uses 4 rows and 45 cols */ #define MEMCOL 0 -#define PAGEROW 2 /* uses 4 rows and 30 cols */ +#define PAGEROW 1 /* uses 4 rows and 30 cols */ #define PAGECOL 47 -#define INTSROW 6 /* uses all rows to bottom and 16 cols */ +#define INTSROW 5 /* uses all rows to bottom and 16 cols */ #define INTSCOL 64 #define PROCSROW 6 /* uses 3 rows and 19 cols */ #define PROCSCOL 0 #define GENSTATROW 7 /* uses 2 rows and 29 cols */ #define GENSTATCOL 21 -#define VMSTATROW 7 /* uses 17 rows and 12-14 cols */ +#define VMSTATROW 5 /* uses 17 rows and 12-14 cols */ #define VMSTATCOL 49 /* actually 50-51 for some fields */ #define GRAPHROW 10 /* uses 3 rows and 49-51 cols */ #define GRAPHCOL 0 @@ -304,7 +303,7 @@ labelkre(void) clear(); mvprintw(STATROW, STATCOL + 6, "users Load"); mvprintw(STATROW + 1, STATCOL + 3, "Mem usage: %%Phy %%Kmem"); - mvprintw(MEMROW, MEMCOL, "Mem: KB REAL VIRTUAL"); + mvprintw(MEMROW, MEMCOL, "Mem: REAL VIRTUAL"); mvprintw(MEMROW + 1, MEMCOL, " Tot Share Tot Share"); mvprintw(MEMROW + 2, MEMCOL, "Act"); mvprintw(MEMROW + 3, MEMCOL, "All"); @@ -373,7 +372,7 @@ labelkre(void) #define PUTRATE(fld, l, c, w) \ do { \ Y(fld); \ - putint((int)((float)s.fld/etime + 0.5), l, c, w); \ + sysputwuint64(wnd, l, c, w, (s.fld/etime + 0.5), 0); \ } while (0) #define MAXFAIL 5 @@ -454,21 +453,20 @@ showkre(void) putfloat(avenrun[1], STATROW, STATCOL + 26, 5, 2, 0); putfloat(avenrun[2], STATROW, STATCOL + 32, 5, 2, 0); mvaddstr(STATROW, STATCOL + 55, buf); -#define pgtokb(pg) ((pg) * (s.v_page_size / 1024)) putfloat(100.0 * (v_page_count - total.t_free) / v_page_count, STATROW + 1, STATCOL + 15, 2, 0, 1); putfloat(100.0 * s.v_kmem_map_size / kmem_size, STATROW + 1, STATCOL + 22, 2, 0, 1); - putuint64(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_avmshr), MEMROW + 2, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_rm), MEMROW + 3, MEMCOL + 4, 7); - putuint64(pgtokb(total.t_rmshr), MEMROW + 3, MEMCOL + 12, 7); - putuint64(pgtokb(total.t_vm), MEMROW + 3, MEMCOL + 20, 8); - putuint64(pgtokb(total.t_vmshr), MEMROW + 3, MEMCOL + 29, 8); - putuint64(pgtokb(total.t_free), MEMROW + 2, MEMCOL + 38, 7); + sysputpage(wnd, MEMROW + 2, MEMCOL + 4, 7, total.t_arm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 12, 7, total.t_armshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 20, 8, total.t_avm, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 29, 8, total.t_avmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 4, 7, total.t_rm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 12, 7, total.t_rmshr, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 20, 8, total.t_vm, 0); + sysputpage(wnd, MEMROW + 3, MEMCOL + 29, 8, total.t_vmshr, 0); + sysputpage(wnd, MEMROW + 2, MEMCOL + 38, 7, total.t_free, 0); putint(total.t_rq - 1, PROCSROW + 2, PROCSCOL, 3); putint(total.t_pw, PROCSROW + 2, PROCSCOL + 4, 3); putint(total.t_dw, PROCSROW + 2, PROCSCOL + 8, 3); @@ -487,13 +485,13 @@ showkre(void) PUTRATE(v_pdwakeups, VMSTATROW + 9, VMSTATCOL, 8); PUTRATE(v_pdpages, VMSTATROW + 10, VMSTATCOL, 8); PUTRATE(v_intrans, VMSTATROW + 11, VMSTATCOL, 8); - putuint64(pgtokb(s.v_wire_count), VMSTATROW + 12, VMSTATCOL, 8); - putuint64(pgtokb(s.v_active_count), VMSTATROW + 13, VMSTATCOL, 8); - putuint64(pgtokb(s.v_inactive_count), VMSTATROW + 14, VMSTATCOL, 8); - putuint64(pgtokb(s.v_laundry_count), VMSTATROW + 15, VMSTATCOL, 8); - putuint64(pgtokb(s.v_free_count), VMSTATROW + 16, VMSTATCOL, 8); + sysputpage(wnd, VMSTATROW + 12, VMSTATCOL + 2, 8 - 2, s.v_wire_count, 0); + sysputpage(wnd, VMSTATROW + 13, VMSTATCOL + 2, 8 - 2, s.v_active_count, 0); + sysputpage(wnd, VMSTATROW + 14, VMSTATCOL + 2, 8 - 2, s.v_inactive_count, 0); + sysputpage(wnd, VMSTATROW + 15, VMSTATCOL + 2, 8 - 2, s.v_laundry_count, 0); + sysputpage(wnd, VMSTATROW + 16, VMSTATCOL + 2, 8 - 2, s.v_free_count, 0); if (LINES - 1 > VMSTATROW + 17) - putuint64(s.bufspace / 1024, VMSTATROW + 17, VMSTATCOL, 8); + sysputuint64(wnd, VMSTATROW + 17, VMSTATCOL + 2, 8 - 2, s.bufspace, 0); PUTRATE(v_vnodein, PAGEROW + 2, PAGECOL + 6, 5); PUTRATE(v_vnodeout, PAGEROW + 2, PAGECOL + 12, 5); PUTRATE(v_swapin, PAGEROW + 2, PAGECOL + 19, 5); @@ -773,7 +771,6 @@ getinfo(struct Info *ls) GETSYSCTL("vm.stats.vm.v_dfree", ls->v_dfree); GETSYSCTL("vm.stats.vm.v_pfree", ls->v_pfree); GETSYSCTL("vm.stats.vm.v_tfree", ls->v_tfree); - GETSYSCTL("vm.stats.vm.v_page_size", ls->v_page_size); GETSYSCTL("vm.stats.vm.v_free_count", ls->v_free_count); GETSYSCTL("vm.stats.vm.v_wire_count", ls->v_wire_count); GETSYSCTL("vm.stats.vm.v_active_count", ls->v_active_count); From owner-svn-src-all@freebsd.org Fri May 15 18:51:22 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0D4A12FD655; Fri, 15 May 2020 18:51:22 +0000 (UTC) (envelope-from adrian@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 49NyDT6zc0z4HLw; Fri, 15 May 2020 18:51:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 EA926F1C; Fri, 15 May 2020 18:51:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FIpL1r010433; Fri, 15 May 2020 18:51:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FIpKgJ010425; Fri, 15 May 2020 18:51:20 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005151851.04FIpKgJ010425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 15 May 2020 18:51:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361085 - in head/sys/dev/ath: . ath_hal/ar5416 ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_hal/ar5416 ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 361085 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 18:51:22 -0000 Author: adrian Date: Fri May 15 18:51:20 2020 New Revision: 361085 URL: https://svnweb.freebsd.org/changeset/base/361085 Log: [ath] [ath_rate] Extend ath_rate_sample to better handle 11n rates and aggregates. My initial rate control code was .. suboptimal. I wanted to at least get MCS rates sent, but it didn't do anywhere near enough to handle low signal level links or remotely keep accurate statistics. So, 8 years later, here's what I should've done back then. * Firstly, I wasn't at all tracking packet sizes other than the two buckets (250 and 1600 bytes.) So, extend it to include 4096, 8192, 16384, 32768 and 65536. I may go add 2048 at some point if I find it's useful. This is important for a few reasons. First, when forming A-MPDU or AMSDU aggregates the frame sizes are larger, and thus the TX time calculation is woefully, increasingly wrong. Secondly, the behaviour of 802.11 channels isn't some fixed thing, both due to channel conditions and radios themselves. Notably, there was some observations done a few years ago on 11n chipsets which noticed longer aggregates showed an increase in failed A-MPDU sub-frame reception as you got further along in the transmit time. It could be due to a variety of things - transmitter linearity, channel conditions changing, frequency/phase drift, etc - but the observation was to potentially form shorter aggregates to improve BER. * .. and then modify the ath TX path to report the length of the aggregate sent, so as the statistics kept would line up with the correct bucket. * Then on the rate control look-up side - i was also only using the first frame length for an A-MPDU rate control lookup which isn't good enough here. So, add a new method that walks the TID software queue for that node to find out what the likely length of data available is. It isn't ALL of the data in the queue because we'll only ever send enough data to fit inside the block-ack window, so limit how many bytes we return to roughly what ath_tx_form_aggr() would do. * .. and cache that in the first ath_buf in the aggregate so it and the eventual AMPDU length can be returned to the rate control code. * THEN, modify the rate control code to look at them both when deciding which bucket to attribute the sent frame on. I'm erring on the side of caution and using the size bucket that the lookup is based on. Ok, so now the rate lookups and statistics are "more correct". However, MCS rates are not the same as 11abg rates in that they're not a monotonically incrementing set of faster rates and you can't assume that just because a given MCS rate fails, the next higher one wouldn't work better or be a lower average tx time. So, I had to do a bunch of surgery to the best rate and sample rate math. This is the bit that's a WIP. * First, simplify the statistics updates (update_stats()) to do a single pass on all rates. * Next, make sure that each rate average tx time is updated based on /its/ failure/success. Eg if you sent a frame with { MCS15, MCS12, MCS8 } and MCS8 succeeded, MCS15 and MCS 12 would have their average tx time updated for /their/ part of the transmission, not the whole transmission. * Next, EWMA wasn't being fully calculated based on the /failures/ in each of the rate attempts. So, if MCS15, MCS12 failed above but MCS8 didn't, then ensure that the statistics noted that /all/ subframes failed at those rates, rather than the eventual set of transmitted/sent frames. This ensures the EWMA /and/ average TX time are updated correctly. * When picking a sample rate and initial rate, probe rates aroud the current MCS but limit it to MCS0..7 /for all spatial streams/, rather than doing crazy things like hitting MCS7 and then probing MCS8 - MCS8 is basically MCS0 but two spatial streams. It's a /lot/ slower than MCS7. Also, the reverse is true - if we're at MCS8 then don't probe MCS7 as part of it, it's not likely to succeed. * Fix bugs in pick_best_rate() where I was /immediately/ choosing the highest MCS rate if there weren't any frames yet transmitted. I was defaulting to 25% EWMA and .. then each comparison would accept the higher rate. Just skip those; sampling will fill in the details. So, this seems to work a lot better. It's not perfect; I'm still seeing a lot of instability around higher MCS rates because there are bursts of loss/retransmissions that aren't /too/ bad. But i'll keep iterating over this and tidying up my hacks. Ok, so why this still something I'm poking at? rather than porting minstrel_ht? ath_rate_sample tries to minimise airtime, not maximise throughput. I have extended it with an EWMA based on sub-frame success/failures - high MCS rates that have partially successful receptions still show super short average frame times, but a /lot/ of retransmits have to happen for that to work. So for MCS rates I also track this EWMA and ensure that the rates I'm choosing don't have super crappy packet failures. I don't mind not getting lower peak throughput versus minstrel_ht; instead I want to see if I can make "minimise airtime" work well. Tested: * AR9380, STA mode * AR9344, STA mode * AR9580, STA/AP mode Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/ath_rate/sample/sample.h head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx_ht.c head/sys/dev/ath/if_athrate.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Fri May 15 18:51:20 2020 (r361085) @@ -419,6 +419,7 @@ ar2133GetChannelMaxMinPower(struct ath_hal *ah, return(AH_FALSE); } #else + // XXX TODO: actually go implement for 11n chips! *maxPow = *minPow = 0; return AH_FALSE; #endif Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Fri May 15 18:51:20 2020 (r361085) @@ -104,8 +104,9 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, int tid, bool is_aggr, - u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) + int shortPreamble, size_t frameLen, int tid, int is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur, + int *maxpktlen) { struct amrr_node *amn = ATH_NODE_AMRR(an); @@ -116,6 +117,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod else *txrate = amn->amn_tx_rate0; maxdur = -1; + maxpktlen = -1; } /* @@ -160,7 +162,7 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct amrr_node *amn = ATH_NODE_AMRR(an); int sr = ts->ts_shortretry; Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Fri May 15 18:51:20 2020 (r361085) @@ -112,8 +112,9 @@ ath_rate_node_cleanup(struct ath_softc *sc, struct ath void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, - int shortPreamble, size_t frameLen, int tid, bool is_aggr, - u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur) + int shortPreamble, size_t frameLen, int tid, int is_aggr, + u_int8_t *rix, int *try0, u_int8_t *txrate, int *maxdur, + int *maxpktlen) { struct onoe_node *on = ATH_NODE_ONOE(an); @@ -124,6 +125,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod else *txrate = on->on_tx_rate0; *maxdur = -1; + *maxpktlen = -1; } /* @@ -167,7 +169,7 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct onoe_node *on = ATH_NODE_ONOE(an); Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 18:51:20 2020 (r361085) @@ -107,6 +107,117 @@ __FBSDID("$FreeBSD$"); * a few different packet sizes independently for each link. */ +/* XXX TODO: move this into ath_hal/net80211 so it can be shared */ + +#define MCS_HT20 0 +#define MCS_HT20_SGI 1 +#define MCS_HT40 2 +#define MCS_HT40_SGI 3 + +/* + * This is currently a copy/paste from the 11n tx code. + * + * It's used to determine the maximum frame length allowed for the + * given rate. For now this ignores SGI/LGI and will assume long-GI. + * This only matters for lower rates that can't fill a full 64k A-MPDU. + * + * (But it's also important because right now rate control doesn't set + * flags like SGI/LGI, STBC, LDPC, TX power, etc.) + * + * When selecting a set of rates the rate control code will iterate + * over the HT20/HT40 max frame length and tell the caller the maximum + * length (@ LGI.) It will also choose a bucket that's the minimum + * of this value and the provided aggregate length. That way the + * rate selection will closely match what the eventual formed aggregate + * will be rather than "not at all". + */ + +static int ath_rate_sample_max_4ms_framelen[4][32] = { + [MCS_HT20] = { + 3212, 6432, 9648, 12864, 19300, 25736, 28952, 32172, + 6424, 12852, 19280, 25708, 38568, 51424, 57852, 64280, + 9628, 19260, 28896, 38528, 57792, 65532, 65532, 65532, + 12828, 25656, 38488, 51320, 65532, 65532, 65532, 65532, + }, + [MCS_HT20_SGI] = { + 3572, 7144, 10720, 14296, 21444, 28596, 32172, 35744, + 7140, 14284, 21428, 28568, 42856, 57144, 64288, 65532, + 10700, 21408, 32112, 42816, 64228, 65532, 65532, 65532, + 14256, 28516, 42780, 57040, 65532, 65532, 65532, 65532, + }, + [MCS_HT40] = { + 6680, 13360, 20044, 26724, 40092, 53456, 60140, 65532, + 13348, 26700, 40052, 53400, 65532, 65532, 65532, 65532, + 20004, 40008, 60016, 65532, 65532, 65532, 65532, 65532, + 26644, 53292, 65532, 65532, 65532, 65532, 65532, 65532, + }, + [MCS_HT40_SGI] = { + 7420, 14844, 22272, 29696, 44544, 59396, 65532, 65532, + 14832, 29668, 44504, 59340, 65532, 65532, 65532, 65532, + 22232, 44464, 65532, 65532, 65532, 65532, 65532, 65532, + 29616, 59232, 65532, 65532, 65532, 65532, 65532, 65532, + } +}; + +/* + * Given the (potentially MRR) transmit schedule, calculate the maximum + * allowed packet size for forming aggregates based on the lowest + * MCS rate in the transmit schedule. + * + * Returns -1 if it's a legacy rate or no MRR. + */ +static int +ath_rate_sample_find_min_pktlength(struct ath_softc *sc, + struct ath_node *an, uint8_t rix0) +{ +#define MCS_IDX(ix) (rt->info[ix].dot11Rate) + const HAL_RATE_TABLE *rt = sc->sc_currates; + struct sample_node *sn = ATH_NODE_SAMPLE(an); + const struct txschedule *sched = &sn->sched[rix0]; + int max_pkt_length = 65530; // ATH_AGGR_MAXSIZE + // Note: this may not be true in all cases; need to check? + int is_ht40 = (an->an_node.ni_chw == 40); + // Note: not great, but good enough.. + int idx = is_ht40 ? MCS_HT40 : MCS_HT20; + + if (rt->info[rix0].phy != IEEE80211_T_HT) { + return -1; + } + + if (! sc->sc_mrretry) { + return -1; + } + + KASSERT(rix0 == sched->r0, ("rix0 (%x) != sched->r0 (%x)!\n", + rix0, sched->r0)); + + /* + * Update based on sched->r{0,1,2,3} if sched->t{0,1,2,3} + * is not zero. + * + * Note: assuming all four PHYs are HT! + */ + if (sched->t0 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r0)]); + } + if (sched->t1 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r1)]); + } + if (sched->t2 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r2)]); + } + if (sched->t3 != 0) { + max_pkt_length = MIN(max_pkt_length, + ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r3)]); + } + + return max_pkt_length; +#undef MCS +} + static void ath_rate_ctl_reset(struct ath_softc *, struct ieee80211_node *); static __inline int @@ -125,6 +236,22 @@ size_to_bin(int size) return 2; #endif #if NUM_PACKET_SIZE_BINS > 4 + if (size <= packet_size_bins[3]) + return 3; +#endif +#if NUM_PACKET_SIZE_BINS > 5 + if (size <= packet_size_bins[4]) + return 4; +#endif +#if NUM_PACKET_SIZE_BINS > 6 + if (size <= packet_size_bins[5]) + return 5; +#endif +#if NUM_PACKET_SIZE_BINS > 7 + if (size <= packet_size_bins[6]) + return 6; +#endif +#if NUM_PACKET_SIZE_BINS > 8 #error "add support for more packet sizes" #endif return NUM_PACKET_SIZE_BINS-1; @@ -167,12 +294,12 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB int size_bin, int require_acked_before) { struct sample_node *sn = ATH_NODE_SAMPLE(an); - int best_rate_rix, best_rate_tt, best_rate_pct; + int best_rate_rix, best_rate_tt, best_rate_pct; uint64_t mask; int rix, tt, pct; - best_rate_rix = 0; - best_rate_tt = 0; + best_rate_rix = 0; + best_rate_tt = 0; best_rate_pct = 0; for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) /* not a supported rate */ @@ -194,8 +321,7 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB if (sn->stats[size_bin][rix].total_packets > 0) { pct = sn->stats[size_bin][rix].ewma_pct; } else { - /* XXX for now, assume 95% ok */ - pct = 95; + pct = -1; /* No percent yet to compare against! */ } /* don't use a bit-rate that has been failing */ @@ -203,18 +329,36 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB continue; /* - * For HT, Don't use a bit rate that is much more - * lossy than the best. + * For HT, Don't use a bit rate that is more + * lossy than the best. Give a bit of leeway. * - * XXX this isn't optimal; it's just designed to - * eliminate rates that are going to be obviously - * worse. + * Don't consider best rates that we haven't seen + * packets for yet; let sampling start inflence that. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { + if (pct == -1) + continue; +#if 0 + IEEE80211_NOTE(an->an_node.ni_vap, + IEEE80211_MSG_RATECTL, + &an->an_node, + "%s: size %d comparing best rate 0x%x pkts/ewma/tt (%ju/%d/%d) " + "to 0x%x pkts/ewma/tt (%ju/%d/%d)", + __func__, + bin_to_size(size_bin), + rt->info[best_rate_rix].dot11Rate, + sn->stats[size_bin][best_rate_rix].total_packets, + best_rate_pct, + best_rate_tt, + rt->info[rix].dot11Rate, + sn->stats[size_bin][rix].total_packets, + pct, + tt); +#endif if (best_rate_pct > (pct + 50)) continue; } - +#if 1 /* * For non-MCS rates, use the current average txtime for * comparison. @@ -228,19 +372,19 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB } /* - * Since 2 stream rates have slightly higher TX times, + * Since 2 and 3 stream rates have slightly higher TX times, * allow a little bit of leeway. This should later * be abstracted out and properly handled. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if (best_rate_tt == 0 || (tt * 8 <= best_rate_tt * 10)) { + if (best_rate_tt == 0 || ((tt * 10) <= (best_rate_tt * 10))) { best_rate_tt = tt; best_rate_rix = rix; best_rate_pct = pct; } } - } - return (best_rate_tt ? best_rate_rix : -1); + } + return (best_rate_tt ? best_rate_rix : -1); } /* @@ -260,7 +404,7 @@ pick_sample_rate(struct sample_softc *ssc , struct ath current_rix = sn->current_rix[size_bin]; if (current_rix < 0) { /* no successes yet, send at the lowest bit-rate */ - /* XXX should return MCS0 if HT */ + /* XXX TODO should return MCS0 if HT */ return 0; } @@ -316,10 +460,22 @@ pick_sample_rate(struct sample_softc *ssc , struct ath /* * For HT, only sample a few rates on either side of the * current rix; there's quite likely a lot of them. + * + * This is limited to testing rate indexes on either side of + * this MCS, but for all spatial streams. + * + * Otherwise we'll (a) never really sample higher MCS + * rates if we're stuck low, and we'll make weird moves + * like sample MCS8 if we're using MCS7. */ if (an->an_node.ni_flags & IEEE80211_NODE_HT) { - if (rix < (current_rix - 3) || - rix > (current_rix + 3)) { + uint8_t current_mcs, rix_mcs; + + current_mcs = MCS(current_rix) & 0x7; + rix_mcs = MCS(rix) & 0x7; + + if (rix_mcs < (current_mcs - 2) || + rix_mcs > (current_mcs + 2)) { mask &= ~((uint64_t) 1<stats[size_bin][rix].successive_failures == 0) { break; } @@ -483,8 +639,8 @@ ath_rate_pick_seed_rate_ht(struct ath_softc *sc, struc void ath_rate_findrate(struct ath_softc *sc, struct ath_node *an, int shortPreamble, size_t frameLen, int tid, - bool is_aggr, u_int8_t *rix0, int *try0, - u_int8_t *txrate, int *maxdur) + int is_aggr, u_int8_t *rix0, int *try0, + u_int8_t *txrate, int *maxdur, int *maxpktlen) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) #define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) @@ -493,9 +649,10 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); struct ieee80211com *ic = &sc->sc_ic; const HAL_RATE_TABLE *rt = sc->sc_currates; - const int size_bin = size_to_bin(frameLen); + int size_bin = size_to_bin(frameLen); int rix, mrr, best_rix, change_rates; unsigned average_tx_time; + int max_pkt_len; ath_rate_update_static_rix(sc, &an->an_node); @@ -503,6 +660,11 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod /* Also for now don't calculate a max duration; that'll come later */ *maxdur = -1; + /* + * For now just set it to the frame length; we'll optimise it later. + */ + *maxpktlen = frameLen; + if (sn->currates != sc->sc_currates) { device_printf(sc->sc_dev, "%s: currates != sc_currates!\n", __func__); @@ -519,15 +681,34 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod mrr = sc->sc_mrretry; /* XXX check HT protmode too */ + /* XXX turn into a cap; 11n MACs support MRR+RTSCTS */ if (mrr && (ic->ic_flags & IEEE80211_F_USEPROT && !sc->sc_mrrprot)) mrr = 0; best_rix = pick_best_rate(an, rt, size_bin, !mrr); + + /* + * At this point we've chosen the best rix, so now we + * need to potentially update our maximum packet length + * and size_bin if we're doing 11n rates. + */ + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix); + if (max_pkt_len > 0) { +#if 0 + device_printf(sc->sc_dev, + "Limiting maxpktlen from %d to %d bytes\n", + (int) frameLen, max_pkt_len); +#endif + *maxpktlen = frameLen = MIN(frameLen, max_pkt_len); + size_bin = size_to_bin(frameLen); + } + if (best_rix >= 0) { average_tx_time = sn->stats[size_bin][best_rix].average_tx_time; } else { average_tx_time = 0; } + /* * Limit the time measuring the performance of other tx * rates to sample_rate% of the total transmission time. @@ -586,9 +767,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod int cur_rix = sn->current_rix[size_bin]; int cur_att = sn->stats[size_bin][cur_rix].average_tx_time; /* - * If the node is HT, upgrade it if the MCS rate is - * higher and the average tx time is within 20% of - * the current rate. It can fail a little. + * If the node is HT, upgrade it if the MCS rate without + * the stream is higher and the average tx time is + * within 10% of the current rate. It can fail a little. * * This is likely not optimal! */ @@ -596,13 +777,20 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod printf("cur rix/att %x/%d, best rix/att %x/%d\n", MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif - if ((MCS(best_rix) > MCS(cur_rix)) && - (average_tx_time * 8) <= (cur_att * 10)) { +#if 0 + if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) && + (average_tx_time * 10) <= (cur_att * 10)) { +#else + if ((average_tx_time * 10) <= (cur_att * 10)) { +#endif IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, - "%s: HT: best_rix 0x%d > cur_rix 0x%x, average_tx_time %d, cur_att %d", - __func__, - MCS(best_rix), MCS(cur_rix), average_tx_time, cur_att); + "%s: HT: size %d best_rix 0x%x > " + " cur_rix 0x%x, average_tx_time %d," + " cur_att %d", + __func__, bin_to_size(size_bin), + MCS(best_rix), MCS(cur_rix), + average_tx_time, cur_att); change_rates = 1; } } @@ -614,15 +802,19 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, -"%s: size %d switch rate %d (%d/%d) -> %d (%d/%d) after %d packets mrr %d", +"%s: size %d switch rate %d %s (%d/%d) EWMA %d -> %d %s (%d/%d) EWMA %d after %d packets mrr %d", __func__, bin_to_size(size_bin), - RATE(sn->current_rix[size_bin]), + dot11rate(rt, sn->current_rix[size_bin]), + dot11rate_label(rt, sn->current_rix[size_bin]), sn->stats[size_bin][sn->current_rix[size_bin]].average_tx_time, sn->stats[size_bin][sn->current_rix[size_bin]].perfect_tx_time, - RATE(best_rix), + sn->stats[size_bin][sn->current_rix[size_bin]].ewma_pct, + dot11rate(rt, best_rix), + dot11rate_label(rt, best_rix), sn->stats[size_bin][best_rix].average_tx_time, sn->stats[size_bin][best_rix].perfect_tx_time, + sn->stats[size_bin][best_rix].ewma_pct, sn->packets_since_switch[size_bin], mrr); } @@ -659,6 +851,7 @@ done: *txrate = rt->info[rix].rateCode | (shortPreamble ? rt->info[rix].shortPreamble : 0); sn->packets_sent[size_bin]++; + #undef DOT11RATE #undef MCS #undef RATE @@ -720,9 +913,6 @@ static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, int rix0, int tries0, - int rix1, int tries1, - int rix2, int tries2, - int rix3, int tries3, int short_tries, int tries, int status, int nframes, int nbad) { @@ -739,33 +929,20 @@ update_stats(struct ath_softc *sc, struct ath_node *an if (!IS_RATE_DEFINED(sn, rix0)) return; + + /* + * If status is FAIL then we treat all frames as bad. + * This better accurately tracks EWMA and average TX time + * because even if the eventual transmission succeeded, + * transmission at this rate did not. + */ + if (status != 0) + nbad = nframes; + tt = calc_usecs_unicast_packet(sc, size, rix0, short_tries, MIN(tries0, tries) - 1, is_ht40); tries_so_far = tries0; - if (tries1 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix1)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix1, short_tries, - MIN(tries1 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - tries_so_far += tries1; - } - - if (tries2 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix2)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix2, short_tries, - MIN(tries2 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - tries_so_far += tries2; - } - - if (tries3 && tries_so_far < tries) { - if (!IS_RATE_DEFINED(sn, rix3)) - return; - tt += calc_usecs_unicast_packet(sc, size, rix3, short_tries, - MIN(tries3 + tries_so_far, tries) - tries_so_far - 1, is_ht40); - } - if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { /* just average the first few packets */ int avg_tx = sn->stats[size_bin][rix0].average_tx_time; @@ -777,34 +954,9 @@ update_stats(struct ath_softc *sc, struct ath_node *an ((sn->stats[size_bin][rix0].average_tx_time * ssc->smoothing_rate) + (tt * (100 - ssc->smoothing_rate))) / 100; } - - /* - * XXX Don't mark the higher bit rates as also having failed; as this - * unfortunately stops those rates from being tasted when trying to - * TX. This happens with 11n aggregation. - * - * This is valid for higher CCK rates, higher OFDM rates, and higher - * HT rates within the current number of streams (eg MCS0..7, 8..15, - * etc.) - */ + if (nframes == nbad) { -#if 0 - int y; -#endif sn->stats[size_bin][rix0].successive_failures += nbad; -#if 0 - for (y = size_bin+1; y < NUM_PACKET_SIZE_BINS; y++) { - /* - * Also say larger packets failed since we - * assume if a small packet fails at a - * bit-rate then a larger one will also. - */ - sn->stats[y][rix0].successive_failures += nbad; - sn->stats[y][rix0].last_tx = ticks; - sn->stats[y][rix0].tries += tries; - sn->stats[y][rix0].total_packets += nframes; - } -#endif } else { sn->stats[size_bin][rix0].packets_acked += (nframes - nbad); sn->stats[size_bin][rix0].successive_failures = 0; @@ -833,20 +985,31 @@ update_stats(struct ath_softc *sc, struct ath_node *an (pct * (100 - ssc->smoothing_rate))) / 100; } + /* + * Only update the sample time for the initial sample rix. + * We've updated the statistics on each of the other retries + * fine, but we should only update the sample_tt with what + * was actually sampled. + * + * However, to aide in debugging, log all the failures for + * each of the buckets + */ + IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, + &an->an_node, + "%s: size %d %s %s rate %d %s tries (%d/%d) tt %d " + "avg_tt (%d/%d) nfrm %d nbad %d", + __func__, + size, + status ? "FAIL" : "OK", + rix0 == sn->current_sample_rix[size_bin] ? "sample" : "mrr", + dot11rate(rt, rix0), + dot11rate_label(rt, rix0), + short_tries, tries, tt, + sn->stats[size_bin][rix0].average_tx_time, + sn->stats[size_bin][rix0].perfect_tx_time, + nframes, nbad); if (rix0 == sn->current_sample_rix[size_bin]) { - IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, -"%s: size %d %s sample rate %d %s tries (%d/%d) tt %d avg_tt (%d/%d) nfrm %d nbad %d", - __func__, - size, - status ? "FAIL" : "OK", - dot11rate(rt, rix0), - dot11rate_label(rt, rix0), - short_tries, tries, tt, - sn->stats[size_bin][rix0].average_tx_time, - sn->stats[size_bin][rix0].perfect_tx_time, - nframes, nbad); sn->sample_tt[size_bin] = tt; sn->current_sample_rix[size_bin] = -1; } @@ -864,7 +1027,7 @@ badrate(struct ath_softc *sc, int series, int hwrate, void ath_rate_tx_complete(struct ath_softc *sc, struct ath_node *an, const struct ath_rc_series *rc, const struct ath_tx_status *ts, - int frame_size, int nframes, int nbad) + int frame_size, int rc_framesize, int nframes, int nbad) { struct ieee80211com *ic = &sc->sc_ic; struct sample_node *sn = ATH_NODE_SAMPLE(an); @@ -884,7 +1047,41 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (frame_size == 0) /* NB: should not happen */ frame_size = 1500; + if (rc_framesize == 0) /* NB: should not happen */ + rc_framesize = 1500; + /* + * There are still some places where what rate control set as + * a limit but the hardware decided, for some reason, to transmit + * at a smaller size that fell into a different bucket. + * + * The eternal question here is - which size_bin should it go in? + * The one that was requested, or the one that was transmitted? + * + * Here's the problem - if we use the one that was transmitted, + * we may continue to hit corner cases where we make a rate + * selection using a higher bin but only update the smaller bin; + * thus never really "adapting". + * + * If however we update the larger bin, we're not accurately + * representing the channel state at that frame/aggregate size. + * However if we keep hitting the larger request but completing + * a smaller size, we at least updates based on what the + * request was /for/. + * + * I'm going to err on the side of caution and choose the + * latter. + */ + if (size_to_bin(frame_size) != size_to_bin(rc_framesize)) { +#if 0 + device_printf(sc->sc_dev, + "%s: completed but frame size buckets mismatch " + "(completed %d tx'ed %d)\n", + __func__, frame_size, rc_framesize); +#endif + frame_size = rc_framesize; + } + if (sn->ratemask == 0) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -921,9 +1118,6 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ short_tries, long_tries, nframes, nbad); update_stats(sc, an, frame_size, final_rix, long_tries, - 0, 0, - 0, 0, - 0, 0, short_tries, long_tries, status, nframes, nbad); @@ -962,18 +1156,13 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ } /* - * NB: series > 0 are not penalized for failure - * based on the try counts under the assumption - * that losses are often bursty and since we - * sample higher rates 1 try at a time doing so - * may unfairly penalize them. + * This used to not penalise other tries because loss + * can be bursty, but it's then not accurately keeping + * the avg TX time and EWMA updated. */ if (rc[0].tries) { update_stats(sc, an, frame_size, rc[0].rix, rc[0].tries, - rc[1].rix, rc[1].tries, - rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, short_tries, long_tries, long_tries > rc[0].tries, nframes, nbad); @@ -983,11 +1172,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[1].tries && finalTSIdx > 0) { update_stats(sc, an, frame_size, rc[1].rix, rc[1].tries, - rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[1].tries, nframes, nbad); long_tries -= rc[1].tries; } @@ -995,11 +1181,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[2].tries && finalTSIdx > 1) { update_stats(sc, an, frame_size, rc[2].rix, rc[2].tries, - rc[3].rix, rc[3].tries, - 0, 0, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[2].tries, nframes, nbad); long_tries -= rc[2].tries; } @@ -1007,11 +1190,8 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ if (rc[3].tries && finalTSIdx > 2) { update_stats(sc, an, frame_size, rc[3].rix, rc[3].tries, - 0, 0, - 0, 0, - 0, 0, short_tries, long_tries, - status, + long_tries > rc[3].tries, nframes, nbad); } } Modified: head/sys/dev/ath/ath_rate/sample/sample.h ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.h Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/ath_rate/sample/sample.h Fri May 15 18:51:20 2020 (r361085) @@ -76,12 +76,11 @@ struct txschedule { }; /* - * for now, we track performance for three different packet - * size buckets + * We track performance for eight different packet size buckets. */ -#define NUM_PACKET_SIZE_BINS 2 +#define NUM_PACKET_SIZE_BINS 7 -static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600 }; +static const int packet_size_bins[NUM_PACKET_SIZE_BINS] = { 250, 1600, 4096, 8192, 16384, 32768, 65536 }; static inline int bin_to_size(int index) Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath.c Fri May 15 18:51:20 2020 (r361085) @@ -4301,7 +4301,7 @@ ath_tx_default_comp(struct ath_softc *sc, struct ath_b void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, struct ath_tx_status *ts, int frmlen, - int nframes, int nbad) + int rc_framelen, int nframes, int nbad) { struct ath_node *an; @@ -4317,9 +4317,11 @@ ath_tx_update_ratectrl(struct ath_softc *sc, struct ie * see about handling it (eg see how many attempts were * made before it got filtered and account for that.) */ + if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); - ath_rate_tx_complete(sc, an, rc, ts, frmlen, nframes, nbad); + ath_rate_tx_complete(sc, an, rc, ts, frmlen, rc_framelen, + nframes, nbad); ATH_NODE_UNLOCK(an); } } @@ -4366,7 +4368,9 @@ ath_tx_process_buf_completion(struct ath_softc *sc, st */ ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, ts, - bf->bf_state.bfs_pktlen, 1, + bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, + 1, (ts->ts_status == 0 ? 0 : 1)); } ath_tx_default_comp(sc, bf, 0); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath_misc.h Fri May 15 18:51:20 2020 (r361085) @@ -63,7 +63,8 @@ extern void ath_tx_default_comp(struct ath_softc *sc, int fail); extern void ath_tx_update_ratectrl(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_rc_series *rc, - struct ath_tx_status *ts, int frmlen, int nframes, int nbad); + struct ath_tx_status *ts, int frmlen, int rc_framelen, + int nframes, int nbad); extern int ath_hal_gethangstate(struct ath_hal *ah, uint32_t mask, uint32_t *hangs); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Fri May 15 17:37:08 2020 (r361084) +++ head/sys/dev/ath/if_ath_tx.c Fri May 15 18:51:20 2020 (r361085) @@ -363,7 +363,7 @@ ath_tx_dmasetup(struct ath_softc *sc, struct ath_buf * */ static void ath_tx_chaindesclist(struct ath_softc *sc, struct ath_desc *ds0, - struct ath_buf *bf, int is_aggr, int is_first_subframe, + struct ath_buf *bf, bool is_aggr, int is_first_subframe, int is_last_subframe) { struct ath_hal *ah = sc->sc_ah; @@ -1377,11 +1377,12 @@ ath_tx_setds(struct ath_softc *sc, struct ath_buf *bf) */ static void ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_buf *bf, int tid, - bool is_aggr) + int pktlen, int is_aggr) { uint8_t rate, rix; int try0; int maxdur; // Note: Unused for now + int maxpktlen; if (! bf->bf_state.bfs_doratelookup) return; @@ -1391,7 +1392,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ ATH_NODE_LOCK(ATH_NODE(bf->bf_node)); ath_rate_findrate(sc, ATH_NODE(bf->bf_node), bf->bf_state.bfs_shpream, - bf->bf_state.bfs_pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur); + pktlen, tid, is_aggr, &rix, &try0, &rate, &maxdur, &maxpktlen); /* In case MRR is disabled, make sure rc[0] is setup correctly */ bf->bf_state.bfs_rc[0].rix = rix; @@ -1407,6 +1408,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ sc->sc_lastdatarix = rix; /* for fast frames */ bf->bf_state.bfs_try0 = try0; bf->bf_state.bfs_txrate0 = rate; + bf->bf_state.bfs_rc_maxpktlen = maxpktlen; } /* @@ -1521,7 +1523,7 @@ ath_tx_xmit_normal(struct ath_softc *sc, struct ath_tx bf->bf_state.bfs_txflags |= HAL_TXDESC_CLRDMASK; /* Setup the descriptor before handoff */ - ath_tx_do_ratelookup(sc, bf, tid->tid, false); + ath_tx_do_ratelookup(sc, bf, tid->tid, bf->bf_state.bfs_pktlen, false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -3096,7 +3098,8 @@ ath_tx_xmit_aggr(struct ath_softc *sc, struct ath_node ath_tx_update_clrdmask(sc, tid, bf); /* Direct dispatch to hardware */ - ath_tx_do_ratelookup(sc, bf, tid->tid, false); + ath_tx_do_ratelookup(sc, bf, tid->tid, bf->bf_state.bfs_pktlen, + false); ath_tx_calc_duration(sc, bf); ath_tx_calc_protection(sc, bf); ath_tx_set_rtscts(sc, bf); @@ -4259,7 +4262,9 @@ ath_tx_normal_comp(struct ath_softc *sc, struct ath_bu */ if (fail == 0 && ((bf->bf_state.bfs_txflags & HAL_TXDESC_NOACK) == 0)) ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, - ts, bf->bf_state.bfs_pktlen, + ts, + bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, 1, (ts->ts_status == 0) ? 0 : 1); ath_tx_default_comp(sc, bf, fail); @@ -4688,15 +4693,11 @@ ath_tx_comp_aggr_error(struct ath_softc *sc, struct at /* * Update rate control - all frames have failed. - * - * XXX use the length in the first frame in the series; - * XXX just so things are consistent for now. - * - * XXX TODO: need to signal this is a large frame no matter what... */ ath_tx_update_ratectrl(sc, ni, bf_first->bf_state.bfs_rc, &bf_first->bf_status.ds_txstat, - bf_first->bf_state.bfs_pktlen, + bf_first->bf_state.bfs_al, + bf_first->bf_state.bfs_rc_maxpktlen, bf_first->bf_state.bfs_nframes, bf_first->bf_state.bfs_nframes); ATH_TX_LOCK(sc); @@ -4845,6 +4846,7 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath int drops = 0; int nframes = 0, nbad = 0, nf; int pktlen; + int agglen, rc_agglen; /* XXX there's too much on the stack? */ struct ath_rc_series rc[ATH_RC_NUM]; int txseq; @@ -4857,6 +4859,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * has been completed and freed. */ ts = bf_first->bf_status.ds_txstat; + agglen = bf_first->bf_state.bfs_al; + rc_agglen = bf_first->bf_state.bfs_rc_maxpktlen; TAILQ_INIT(&bf_q); TAILQ_INIT(&bf_cq); @@ -5093,9 +5097,8 @@ ath_tx_aggr_comp_aggr(struct ath_softc *sc, struct ath * control code. */ if (fail == 0) { - /* XXX TODO: what's pktlen here? */ - ath_tx_update_ratectrl(sc, ni, rc, &ts, pktlen, nframes, - nbad); + ath_tx_update_ratectrl(sc, ni, rc, &ts, agglen, rc_agglen, + nframes, nbad); } /* @@ -5187,6 +5190,7 @@ ath_tx_aggr_comp_unaggr(struct ath_softc *sc, struct a ath_tx_update_ratectrl(sc, ni, bf->bf_state.bfs_rc, &bf->bf_status.ds_txstat, bf->bf_state.bfs_pktlen, + bf->bf_state.bfs_pktlen, 1, (ts.ts_status == 0) ? 0 : 1); /* @@ -5359,6 +5363,66 @@ ath_tx_aggr_comp(struct ath_softc *sc, struct ath_buf } /* + * Grab the software queue depth that we COULD transmit. + * + * This includes checks if it's in the BAW, whether it's a frame + * that is supposed to be in the BAW. Other checks could be done; + * but for now let's try and avoid doing the whole of ath_tx_form_aggr() + * here. + */ +static int +ath_tx_tid_swq_depth_bytes(struct ath_softc *sc, struct ath_node *an, + struct ath_tid *tid) +{ + struct ath_buf *bf; + struct ieee80211_tx_ampdu *tap; + int nbytes = 0; + + ATH_TX_LOCK_ASSERT(sc); + + tap = ath_tx_get_tx_tid(an, tid->tid); + + /* + * Iterate over each buffer and sum the pkt_len. + * Bail if we exceed ATH_AGGR_MAXSIZE bytes; we won't + * ever queue more than that in a single frame. + */ + TAILQ_FOREACH(bf, &tid->tid_q, bf_list) { + + /* + * TODO: I'm not sure if we're going to hit cases where + * no frames get sent because the list is empty. + */ + + /* Check if it's in the BAW */ + if (tap != NULL && (! BAW_WITHIN(tap->txa_start, tap->txa_wnd, + SEQNO(bf->bf_state.bfs_seqno)))) { + break; + } + + /* Check if it's even supposed to be in the BAW */ + if (! bf->bf_state.bfs_dobaw) { + break; + } + + nbytes += bf->bf_state.bfs_pktlen; + if (nbytes >= ATH_AGGR_MAXSIZE) + break; + + /* + * Check if we're likely going to leak a frame + * as part of a PSPOLL. Break out at this point; + * we're only going to send a single frame anyway. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri May 15 19:24:52 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3C522FE464; Fri, 15 May 2020 19:24:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49Nyz82qgTz4Kc3; Fri, 15 May 2020 19:24:52 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FJOoKR087850; Fri, 15 May 2020 12:24:50 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FJOoQM087849; Fri, 15 May 2020 12:24:50 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: <0c6939cc-7f8a-d2fd-9da1-63eb641815e3@FreeBSD.org> To: Ryan Moeller Date: Fri, 15 May 2020 12:24:50 -0700 (PDT) CC: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49Nyz82qgTz4Kc3 X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.97 / 15.00]; NEURAL_HAM_MEDIUM(-0.97)[-0.969,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 19:24:52 -0000 > On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > > > On 5/15/20 1:38 AM, Ryan Moeller wrote: > >> Author: freqlabs > >> Date: Thu May 14 23:38:11 2020 > >> New Revision: 361066 > >> URL: https://svnweb.freebsd.org/changeset/base/361066 > >> > >> Log: > >> jail: Add exec.prepare and exec.release command hooks > >> > >> This change introduces new jail command hooks that run before and after any > >> other actions. > > Should it go into RELNOTES? > I'm not sure what all the criteria are for relnotes. > The committer's guide makes it seem like relnotes is for breaking > changes, which this is not. Please could you point at which specific language in the commiters guide makes you believe that the RELNOTES are for breaking changes? RELNOTES should be for all changes that have user visible impact of any type. > -Ryan -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 15 20:01:31 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA55C2FF403; Fri, 15 May 2020 20:01:31 +0000 (UTC) (envelope-from mhorne@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 49NznR3Vrqz4NnY; Fri, 15 May 2020 20:01:31 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 718B61D4C; Fri, 15 May 2020 20:01:31 +0000 (UTC) (envelope-from mhorne@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FK1V8w055793; Fri, 15 May 2020 20:01:31 GMT (envelope-from mhorne@FreeBSD.org) Received: (from mhorne@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FK1UXW055788; Fri, 15 May 2020 20:01:30 GMT (envelope-from mhorne@FreeBSD.org) Message-Id: <202005152001.04FK1UXW055788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mhorne set sender to mhorne@FreeBSD.org using -f From: Mitchell Horne Date: Fri, 15 May 2020 20:01: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: r361086 - in stable/12/sys/riscv: include riscv X-SVN-Group: stable-12 X-SVN-Commit-Author: mhorne X-SVN-Commit-Paths: in stable/12/sys/riscv: include riscv X-SVN-Commit-Revision: 361086 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:01:31 -0000 Author: mhorne Date: Fri May 15 20:01:30 2020 New Revision: 361086 URL: https://svnweb.freebsd.org/changeset/base/361086 Log: MFC r360551-r360554 This set of changes allows booting with OpenSBI v0.7. r360551: Make mpentry independent of _start r360552: Add support for HSM SBI extension r360553: Use the HSM SBI extension to start APs r360554: Use the HSM SBI extension to halt CPUs Modified: stable/12/sys/riscv/include/sbi.h stable/12/sys/riscv/riscv/locore.S stable/12/sys/riscv/riscv/machdep.c stable/12/sys/riscv/riscv/mp_machdep.c stable/12/sys/riscv/riscv/sbi.c Modified: stable/12/sys/riscv/include/sbi.h ============================================================================== --- stable/12/sys/riscv/include/sbi.h Fri May 15 18:51:20 2020 (r361085) +++ stable/12/sys/riscv/include/sbi.h Fri May 15 20:01:30 2020 (r361086) @@ -55,6 +55,7 @@ #define SBI_ERR_INVALID_PARAM -3 #define SBI_ERR_DENIED -4 #define SBI_ERR_INVALID_ADDRESS -5 +#define SBI_ERR_ALREADY_AVAILABLE -6 /* SBI Base Extension */ #define SBI_EXT_ID_BASE 0x10 @@ -66,6 +67,16 @@ #define SBI_BASE_GET_MARCHID 5 #define SBI_BASE_GET_MIMPID 6 +/* Hart State Management (HSM) Extension */ +#define SBI_EXT_ID_HSM 0x48534D +#define SBI_HSM_HART_START 0 +#define SBI_HSM_HART_STOP 1 +#define SBI_HSM_HART_STATUS 2 +#define SBI_HSM_STATUS_STARTED 0 +#define SBI_HSM_STATUS_STOPPED 1 +#define SBI_HSM_STATUS_START_PENDING 2 +#define SBI_HSM_STATUS_STOP_PENDING 3 + /* Legacy Extensions */ #define SBI_SET_TIMER 0 #define SBI_CONSOLE_PUTCHAR 1 @@ -127,6 +138,30 @@ sbi_probe_extension(long id) { return (SBI_CALL1(SBI_EXT_ID_BASE, SBI_BASE_PROBE_EXTENSION, id).value); } + +/* Hart State Management extension functions. */ + +/* + * Start execution on the specified hart at physical address start_addr. The + * register a0 will contain the hart's ID, and a1 will contain the value of + * priv. + */ +int sbi_hsm_hart_start(u_long hart, u_long start_addr, u_long priv); + +/* + * Stop execution on the current hart. Interrupts should be disabled, or this + * function may return. + */ +void sbi_hsm_hart_stop(void); + +/* + * Get the execution status of the specified hart. The status will be one of: + * - SBI_HSM_STATUS_STARTED + * - SBI_HSM_STATUS_STOPPED + * - SBI_HSM_STATUS_START_PENDING + * - SBI_HSM_STATUS_STOP_PENDING + */ +int sbi_hsm_hart_status(u_long hart); /* Legacy extension functions. */ static __inline void Modified: stable/12/sys/riscv/riscv/locore.S ============================================================================== --- stable/12/sys/riscv/riscv/locore.S Fri May 15 18:51:20 2020 (r361085) +++ stable/12/sys/riscv/riscv/locore.S Fri May 15 20:01:30 2020 (r361086) @@ -53,13 +53,6 @@ .text .globl _start _start: - /* Get the physical address kernel loaded to */ - lla t0, virt_map - ld t1, 0(t0) - sub t1, t1, t0 - li t2, KERNBASE - sub s9, t2, t1 /* s9 = physmem base */ - /* * a0 = hart id * a1 = dtbp @@ -81,6 +74,9 @@ _start: * Page tables */ 1: + /* Get the kernel's load address */ + jal get_physmem + /* Add L1 entry for kernel */ lla s1, pagetable_l1 lla s2, pagetable_l2 /* Link to next level PN */ @@ -220,6 +216,17 @@ va: call _C_LABEL(initriscv) /* Off we go */ call _C_LABEL(mi_startup) +/* + * Get the physical address the kernel is loaded to. Returned in s9. + */ +get_physmem: + lla t0, virt_map /* physical address of virt_map */ + ld t1, 0(t0) /* virtual address of virt_map */ + sub t1, t1, t0 /* calculate phys->virt delta */ + li t2, KERNBASE + sub s9, t2, t1 /* s9 = physmem base */ + ret + .align 4 initstack: .space (PAGE_SIZE * KSTACK_PAGES) @@ -298,6 +305,9 @@ ENTRY(mpentry) /* Setup stack pointer */ lla t0, bootstack ld sp, 0(t0) + + /* Get the kernel's load address */ + jal get_physmem /* Setup supervisor trap vector */ lla t0, mpva Modified: stable/12/sys/riscv/riscv/machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/machdep.c Fri May 15 18:51:20 2020 (r361085) +++ stable/12/sys/riscv/riscv/machdep.c Fri May 15 20:01:30 2020 (r361086) @@ -471,9 +471,16 @@ void cpu_halt(void) { + /* + * Try to power down using the HSM SBI extension and fall back to a + * simple wfi loop. + */ intr_disable(); + if (sbi_probe_extension(SBI_EXT_ID_HSM) != 0) + sbi_hsm_hart_stop(); for (;;) __asm __volatile("wfi"); + /* NOTREACHED */ } /* Modified: stable/12/sys/riscv/riscv/mp_machdep.c ============================================================================== --- stable/12/sys/riscv/riscv/mp_machdep.c Fri May 15 18:51:20 2020 (r361085) +++ stable/12/sys/riscv/riscv/mp_machdep.c Fri May 15 20:01:30 2020 (r361086) @@ -96,6 +96,7 @@ static uint32_t cpu_reg[MAXCPU][2]; #endif static device_t cpu_list[MAXCPU]; +void mpentry(u_long hartid); void init_secondary(uint64_t); static struct mtx ap_boot_mtx; @@ -301,7 +302,7 @@ smp_after_idle_runnable(void *arg __unused) struct pcpu *pc; int cpu; - for (cpu = 1; cpu < mp_ncpus; cpu++) { + for (cpu = 1; cpu <= mp_maxid; cpu++) { if (bootstacks[cpu] != NULL) { pc = pcpu_find(cpu); while ((void *)atomic_load_ptr(&pc->pc_curpcb) == NULL) @@ -403,9 +404,11 @@ static boolean_t cpu_init_fdt(u_int id, phandle_t node, u_int addr_size, pcell_t *reg) { struct pcpu *pcpup; + vm_paddr_t start_addr; uint64_t hart; u_int cpuid; int naps; + int error; /* Check if this hart supports MMU. */ if (OF_getproplen(node, "mmu-type") < 0) @@ -444,6 +447,23 @@ cpu_init_fdt(u_int id, phandle_t node, u_int addr_size /* Check if we are able to start this cpu */ if (cpuid > mp_maxid) return (0); + + /* + * Depending on the SBI implementation, APs are waiting either in + * locore.S or to be activated explicitly, via SBI call. + */ + if (sbi_probe_extension(SBI_EXT_ID_HSM) != 0) { + start_addr = pmap_kextract((vm_offset_t)mpentry); + error = sbi_hsm_hart_start(hart, start_addr, 0); + if (error != 0) { + mp_ncpus--; + + /* Send a warning to the user and continue. */ + printf("AP %u (hart %lu) failed to start, error %d\n", + cpuid, hart, error); + return (0); + } + } pcpup = &__pcpu[cpuid]; pcpu_init(pcpup, cpuid, sizeof(struct pcpu)); Modified: stable/12/sys/riscv/riscv/sbi.c ============================================================================== --- stable/12/sys/riscv/riscv/sbi.c Fri May 15 18:51:20 2020 (r361085) +++ stable/12/sys/riscv/riscv/sbi.c Fri May 15 20:01:30 2020 (r361086) @@ -113,6 +113,31 @@ sbi_print_version(void) printf("SBI Specification Version: %u.%u\n", major, minor); } +int +sbi_hsm_hart_start(u_long hart, u_long start_addr, u_long priv) +{ + struct sbi_ret ret; + + ret = SBI_CALL3(SBI_EXT_ID_HSM, SBI_HSM_HART_START, hart, start_addr, priv); + return (ret.error != 0 ? (int)ret.error : 0); +} + +void +sbi_hsm_hart_stop(void) +{ + (void)SBI_CALL0(SBI_EXT_ID_HSM, SBI_HSM_HART_STOP); +} + +int +sbi_hsm_hart_status(u_long hart) +{ + struct sbi_ret ret; + + ret = SBI_CALL1(SBI_EXT_ID_HSM, SBI_HSM_HART_STATUS, hart); + + return (ret.error != 0 ? (int)ret.error : (int)ret.value); +} + void sbi_init(void) { From owner-svn-src-all@freebsd.org Fri May 15 20:03:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8CFB22FF606; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@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 49Nzr93Hzgz4P5f; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 6C53C1ECA; Fri, 15 May 2020 20:03:53 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FK3rJm059932; Fri, 15 May 2020 20:03:53 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FK3rGT059931; Fri, 15 May 2020 20:03:53 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005152003.04FK3rGT059931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 15 May 2020 20:03:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361087 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361087 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:03:53 -0000 Author: adrian Date: Fri May 15 20:03:53 2020 New Revision: 361087 URL: https://svnweb.freebsd.org/changeset/base/361087 Log: [ath] [ath_rate_sample] le oops, trim out an #if 1 that I didn't fully delete. Cool, so now I know it's about 3 weeks between starting on freebsd coding and breaking the build again. Queue dunce cap. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 20:01:30 2020 (r361086) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri May 15 20:03:53 2020 (r361087) @@ -358,7 +358,6 @@ pick_best_rate(struct ath_node *an, const HAL_RATE_TAB if (best_rate_pct > (pct + 50)) continue; } -#if 1 /* * For non-MCS rates, use the current average txtime for * comparison. From owner-svn-src-all@freebsd.org Fri May 15 20:04:02 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 193F62FF634; Fri, 15 May 2020 20:04:02 +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 49NzrJ4WNNz4P9k; Fri, 15 May 2020 20:04:00 +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 B55261ECB; Fri, 15 May 2020 20:03:59 +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 04FK3xDG059987; Fri, 15 May 2020 20:03:59 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FK3wXa059980; Fri, 15 May 2020 20:03:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <202005152003.04FK3wXa059980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 15 May 2020 20:03:58 +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: r361088 - in stable/11: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable/11: cddl/contrib/opensolaris/lib/libdtrace/common sys/cddl/contrib/opensolaris/uts/common/dtrace sys/cddl/contrib/opensolaris/uts/common/sys sys/cddl/dev/dtrace X-SVN-Commit-Revision: 361088 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:04:02 -0000 Author: dim Date: Fri May 15 20:03:57 2020 New Revision: 361088 URL: https://svnweb.freebsd.org/changeset/base/361088 Log: Merge changes that enable DTrace-using ports to link correctly with lld 10, avoiding "unknown relocation 8" and other errors. MFC r312658 (by markj): Remove the DTRACEHIOC_ADD ioctl. This ioctl has been considered legacy by upstream since the DTrace code was first imported, and is unused. The removal also allows some simplification of dtrace_helper_slurp(). Also remove a bogus copyout in the DTRACEHIOC_ADDDOF handler. Due to a bug, it would overwrite an in-memory copy of the DOF header rather than the passed-in DOF helper. Moreover, DTRACEHIOC_ADDDOF already copies the helper back out automatically since its argument has the IOC_OUT attribute. MFC r313262 (by markj): Use PC-relative relocations for USDT probe sites on i386 and amd64. When recording probe site addresses in the output DOF file, dtrace -G needs to emit relocations for the .SUNW_dof section in order to obtain the addresses of functions containing probe sites. DTrace expects the addresses to be relative to the base address of the final ELF file, and the amd64 USDT implementation was relying on some unspecified and incorrect behaviour in the base system GNU ld to achieve this. This change reimplements the probe site relocation handling to allow USDT to be used with lld and newer GNU binutils. Specifically, it makes use of R_X86_64_PC64/R_386_PC32 relocations to obtain the probe site address relative to the DOF file address, and adds and uses a new DOF relocation type which computes the final probe site address using these relative offsets. Reported by and discussed with: Rafael Esp?ndola Differential Revision: https://reviews.freebsd.org/D9374 Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_dof.c Fri May 15 20:03:57 2020 (r361088) @@ -462,18 +462,8 @@ dof_add_probe(dt_idhash_t *dhp, dt_ident_t *idp, void dt_buf_write(dtp, &ddo->ddo_enoffs, pip->pi_enoffs, pip->pi_nenoffs * sizeof (uint32_t), sizeof (uint32_t)); - /* - * If pi_rname isn't set, the relocation will be against the - * function name. If it is, the relocation will be against - * pi_rname. This will be used if the function is scoped - * locally so an alternate symbol is added for the purpose - * of this relocation. - */ - if (pip->pi_rname == NULL) - dofr.dofr_name = dofpr.dofpr_func; - else - dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); - dofr.dofr_type = DOF_RELO_SETX; + dofr.dofr_name = dof_add_string(ddo, pip->pi_rname); + dofr.dofr_type = DOF_RELO_DOFREL; dofr.dofr_offset = dt_buf_len(&ddo->ddo_probes); dofr.dofr_data = 0; Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_link.c Fri May 15 20:03:57 2020 (r361088) @@ -239,7 +239,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_386_32); + R_386_PC32); #elif defined(__mips__) /* XXX */ printf("%s:%s(%d): MIPS not implemented\n", @@ -257,15 +257,6 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, /* XXX */ printf("%s:%s(%d): RISC-V not implemented\n", __FUNCTION__, __FILE__, __LINE__); -#elif defined(__sparc) - /* - * Add 4 bytes to hit the low half of this 64-bit - * big-endian address. - */ - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset + 4; - rel->r_info = ELF32_R_INFO(count + dep->de_global, - R_SPARC_32); #else #error unknown ISA #endif @@ -274,7 +265,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -291,11 +282,7 @@ prepare_elf32(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = ELF32_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF32_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -452,19 +439,9 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, #elif defined(__i386) || defined(__amd64) rel->r_offset = s->dofs_offset + dofr[j].dofr_offset; -#ifdef illumos rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_AMD64_64); + R_X86_64_PC64); #else - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_X86_64_RELATIVE); -#endif -#elif defined(__sparc) - rel->r_offset = s->dofs_offset + - dofr[j].dofr_offset; - rel->r_info = ELF64_R_INFO(count + dep->de_global, - R_SPARC_64); -#else #error unknown ISA #endif @@ -472,7 +449,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = 0; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_FUNC); - sym->st_other = 0; + sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); sym->st_shndx = SHN_UNDEF; rel++; @@ -489,11 +466,7 @@ prepare_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, sym->st_value = 0; sym->st_size = dof->dofh_filesz; sym->st_info = GELF_ST_INFO(STB_GLOBAL, STT_OBJECT); -#ifdef illumos - sym->st_other = 0; -#else sym->st_other = ELF64_ST_VISIBILITY(STV_HIDDEN); -#endif sym->st_shndx = ESHDR_DOF; sym++; @@ -801,16 +774,15 @@ dump_elf64(dtrace_hdl_t *dtp, const dof_hdr_t *dof, in } static int -dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr_t addr, uint_t shn, - GElf_Sym *sym, int uses_funcdesc, Elf *elf) +dt_symtab_lookup(Elf_Data *data_sym, int start, int end, uintptr_t addr, + uint_t shn, GElf_Sym *sym, int uses_funcdesc, Elf *elf) { - int i, ret = -1; Elf64_Addr symval; Elf_Scn *opd_scn; Elf_Data *opd_desc; - GElf_Sym s; + int i; - for (i = 0; i < nsym && gelf_getsym(data_sym, i, sym) != NULL; i++) { + for (i = start; i < end && gelf_getsym(data_sym, i, sym) != NULL; i++) { if (GELF_ST_TYPE(sym->st_info) == STT_FUNC) { symval = sym->st_value; if (uses_funcdesc) { @@ -820,20 +792,12 @@ dt_symtab_lookup(Elf_Data *data_sym, int nsym, uintptr *(uint64_t*)((char *)opd_desc->d_buf + symval); } if ((uses_funcdesc || shn == sym->st_shndx) && - symval <= addr && - addr < symval + sym->st_size) { - if (GELF_ST_BIND(sym->st_info) == STB_GLOBAL) - return (0); - - ret = 0; - s = *sym; - } + symval <= addr && addr < symval + sym->st_size) + return (0); } } - if (ret == 0) - *sym = s; - return (ret); + return (-1); } #if defined(__aarch64__) @@ -1245,7 +1209,7 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e dt_provider_t *pvp; dt_probe_t *prp; uint32_t off, eclass, emachine1, emachine2; - size_t symsize, nsym, isym, istr, len; + size_t symsize, osym, nsym, isym, istr, len; key_t objkey; dt_link_pair_t *pair, *bufs = NULL; dt_strtab_t *strtab; @@ -1382,12 +1346,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e * target (text) section to replace the call instruction with * one or more nops. * - * If the function containing the probe is locally scoped - * (static), we create an alias used by the relocation in the - * generated object. The alias, a new symbol, will be global - * (so that the relocation from the generated object can be - * resolved), and hidden (so that it is converted to a local - * symbol at link time). Such aliases have this form: + * To avoid runtime overhead, the relocations added to the + * generated object should be resolved at static link time. We + * therefore create aliases for the functions that contain + * probes. An alias is global (so that the relocation from the + * generated object can be resolved), and hidden (so that its + * address is known at static link time). Such aliases have this + * form: * * $dtrace. * @@ -1425,16 +1390,13 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e if (strncmp(s, dt_prefix, sizeof (dt_prefix) - 1) != 0) continue; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, - (emachine1 == EM_PPC64), elf) != 0) { + if (dt_symtab_lookup(data_sym, 0, isym, rela.r_offset, + shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), + elf) != 0) { dt_strtab_destroy(strtab); goto err; } - if (GELF_ST_BIND(fsym.st_info) != STB_LOCAL) - continue; - if (fsym.st_name > data_str->d_size) { dt_strtab_destroy(strtab); goto err; @@ -1470,12 +1432,12 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e } /* - * If needed, allocate the additional space for the symbol - * table and string table copying the old data into the new - * buffers, and marking the buffers as dirty. We inject those - * newly allocated buffers into the libelf data structures, but - * are still responsible for freeing them once we're done with - * the elf handle. + * If any probes were found, allocate the additional space for + * the symbol table and string table, copying the old data into + * the new buffers, and marking the buffers as dirty. We inject + * those newly allocated buffers into the libelf data + * structures, but are still responsible for freeing them once + * we're done with the elf handle. */ if (nsym > 0) { /* @@ -1524,9 +1486,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e shdr_sym.sh_size += nsym * symsize; (void) gelf_update_shdr(scn_sym, &shdr_sym); + osym = isym; nsym += isym; } else { dt_strtab_destroy(strtab); + continue; } /* @@ -1585,8 +1549,11 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e bcopy(s, pname, p - s); pname[p - s] = '\0'; - if (dt_symtab_lookup(data_sym, isym, rela.r_offset, - shdr_rel.sh_info, &fsym, + if (dt_symtab_lookup(data_sym, osym, isym, + rela.r_offset, shdr_rel.sh_info, &fsym, + (emachine1 == EM_PPC64), elf) != 0 && + dt_symtab_lookup(data_sym, 0, osym, + rela.r_offset, shdr_rel.sh_info, &fsym, (emachine1 == EM_PPC64), elf) != 0) goto err; @@ -1596,37 +1563,30 @@ process_obj(dtrace_hdl_t *dtp, const char *obj, int *e assert(GELF_ST_TYPE(fsym.st_info) == STT_FUNC); /* - * If a NULL relocation name is passed to - * dt_probe_define(), the function name is used for the - * relocation. The relocation needs to use a mangled - * name if the symbol is locally scoped; the function - * name may need to change if we've found the global - * alias for the locally scoped symbol (we prefer - * global symbols to locals in dt_symtab_lookup()). + * If this is our first time encountering this symbol, + * emit an alias. */ s = (char *)data_str->d_buf + fsym.st_name; - r = NULL; - if (GELF_ST_BIND(fsym.st_info) == STB_LOCAL) { + if (strncmp(s, dt_symprefix, + sizeof (dt_symprefix) - 1) != 0) { + u_int bind = GELF_ST_BIND(fsym.st_info); + dsym = fsym; dsym.st_name = istr; - dsym.st_info = GELF_ST_INFO(STB_GLOBAL, - STT_FUNC); - dsym.st_other = - ELF64_ST_VISIBILITY(STV_ELIMINATE); + dsym.st_info = GELF_ST_INFO(bind == STB_LOCAL ? + STB_GLOBAL : bind, STT_FUNC); + dsym.st_other = GELF_ST_VISIBILITY(STV_HIDDEN); (void) gelf_update_sym(data_sym, isym, &dsym); - - r = (char *)data_str->d_buf + istr; - istr += 1 + sprintf(r, dt_symfmt, - dt_symprefix, objkey, s); + r = (char *) data_str->d_buf + istr; + istr += 1 + sprintf(r, dt_symfmt, dt_symprefix, objkey, + s); isym++; assert(isym <= nsym); - - } else if (strncmp(s, dt_symprefix, - strlen(dt_symprefix)) == 0) { + } else { r = s; - if ((s = strchr(s, '.')) == NULL) - goto err; + s = strchr(s, '.'); + assert(s != NULL); s++; } Modified: stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c ============================================================================== --- stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/cddl/contrib/opensolaris/lib/libdtrace/common/dt_provider.c Fri May 15 20:03:57 2020 (r361088) @@ -545,9 +545,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, for (pip = prp->pr_inst; pip != NULL; pip = pip->pi_next) { if (strcmp(pip->pi_fname, fname) == 0 && - ((rname == NULL && pip->pi_rname == NULL) || - (rname != NULL && pip->pi_rname != NULL && - strcmp(pip->pi_rname, rname) == 0))) + strcmp(pip->pi_rname, rname) == 0) break; } @@ -565,7 +563,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, if ((pip->pi_fname = strdup(fname)) == NULL) goto nomem; - if (rname != NULL && (pip->pi_rname = strdup(rname)) == NULL) + if ((pip->pi_rname = strdup(rname)) == NULL) goto nomem; pip->pi_noffs = 0; @@ -605,7 +603,7 @@ dt_probe_define(dt_provider_t *pvp, dt_probe_t *prp, dt_dprintf("defined probe %s %s:%s %s() +0x%x (%s)\n", isenabled ? "(is-enabled)" : "", pvp->pv_desc.dtvd_name, prp->pr_ident->di_name, fname, offset, - rname != NULL ? rname : fname); + rname); assert(*noffs < *maxoffs); (*offs)[(*noffs)++] = offset; Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Fri May 15 20:03:57 2020 (r361088) @@ -13886,12 +13886,13 @@ err: /* * Apply the relocations from the specified 'sec' (a DOF_SECT_URELHDR) to the - * specified DOF. At present, this amounts to simply adding 'ubase' to the - * site of any user SETX relocations to account for load object base address. - * In the future, if we need other relocations, this function can be extended. + * specified DOF. SETX relocations are computed using 'ubase', the base load + * address of the object containing the DOF, and DOFREL relocations are relative + * to the relocation offset within the DOF. */ static int -dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase) +dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, uint64_t ubase, + uint64_t udaddr) { uintptr_t daddr = (uintptr_t)dof; uintptr_t ts_end; @@ -13931,6 +13932,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui case DOF_RELO_NONE: break; case DOF_RELO_SETX: + case DOF_RELO_DOFREL: if (r->dofr_offset >= ts->dofs_size || r->dofr_offset + sizeof (uint64_t) > ts->dofs_size) { dtrace_dof_error(dof, "bad relocation offset"); @@ -13947,7 +13949,11 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui return (-1); } - *(uint64_t *)taddr += ubase; + if (r->dofr_type == DOF_RELO_SETX) + *(uint64_t *)taddr += ubase; + else + *(uint64_t *)taddr += + udaddr + ts->dofs_offset + r->dofr_offset; break; default: dtrace_dof_error(dof, "invalid relocation type"); @@ -13968,7 +13974,7 @@ dtrace_dof_relocate(dof_hdr_t *dof, dof_sec_t *sec, ui */ static int dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vstate, cred_t *cr, - dtrace_enabling_t **enabp, uint64_t ubase, int noprobes) + dtrace_enabling_t **enabp, uint64_t ubase, uint64_t udaddr, int noprobes) { uint64_t len = dof->dofh_loadsz, seclen; uintptr_t daddr = (uintptr_t)dof; @@ -14130,7 +14136,7 @@ dtrace_dof_slurp(dof_hdr_t *dof, dtrace_vstate_t *vsta switch (sec->dofs_type) { case DOF_SECT_URELHDR: - if (dtrace_dof_relocate(dof, sec, ubase) != 0) + if (dtrace_dof_relocate(dof, sec, ubase, udaddr) != 0) return (-1); break; } @@ -15495,7 +15501,7 @@ dtrace_anon_property(void) } rv = dtrace_dof_slurp(dof, &state->dts_vstate, CRED(), - &dtrace_anon.dta_enabling, 0, B_TRUE); + &dtrace_anon.dta_enabling, 0, 0, B_TRUE); if (rv == 0) rv = dtrace_dof_options(dof, state); @@ -16250,18 +16256,11 @@ dtrace_helper_provider_validate(dof_hdr_t *dof, dof_se } static int -#ifdef __FreeBSD__ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp, struct proc *p) -#else -dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) -#endif { dtrace_helpers_t *help; dtrace_vstate_t *vstate; dtrace_enabling_t *enab = NULL; -#ifndef __FreeBSD__ - proc_t *p = curproc; -#endif int i, gen, rv, nhelpers = 0, nprovs = 0, destroy = 1; uintptr_t daddr = (uintptr_t)dof; @@ -16272,8 +16271,8 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) vstate = &help->dthps_vstate; - if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, - dhp != NULL ? dhp->dofhp_addr : 0, B_FALSE)) != 0) { + if ((rv = dtrace_dof_slurp(dof, vstate, NULL, &enab, dhp->dofhp_addr, + dhp->dofhp_dof, B_FALSE)) != 0) { dtrace_dof_destroy(dof); return (rv); } @@ -16281,22 +16280,20 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) /* * Look for helper providers and validate their descriptions. */ - if (dhp != NULL) { - for (i = 0; i < dof->dofh_secnum; i++) { - dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + - dof->dofh_secoff + i * dof->dofh_secsize); + for (i = 0; i < dof->dofh_secnum; i++) { + dof_sec_t *sec = (dof_sec_t *)(uintptr_t)(daddr + + dof->dofh_secoff + i * dof->dofh_secsize); - if (sec->dofs_type != DOF_SECT_PROVIDER) - continue; + if (sec->dofs_type != DOF_SECT_PROVIDER) + continue; - if (dtrace_helper_provider_validate(dof, sec) != 0) { - dtrace_enabling_destroy(enab); - dtrace_dof_destroy(dof); - return (-1); - } - - nprovs++; + if (dtrace_helper_provider_validate(dof, sec) != 0) { + dtrace_enabling_destroy(enab); + dtrace_dof_destroy(dof); + return (-1); } + + nprovs++; } /* @@ -16337,7 +16334,7 @@ dtrace_helper_slurp(dof_hdr_t *dof, dof_helper_t *dhp) gen = help->dthps_generation++; dtrace_enabling_destroy(enab); - if (dhp != NULL && nprovs > 0) { + if (nprovs > 0) { /* * Now that this is in-kernel, we change the sense of the * members: dofhp_dof denotes the in-kernel copy of the DOF Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/sys/dtrace.h Fri May 15 20:03:57 2020 (r361088) @@ -788,6 +788,7 @@ typedef struct dof_relodesc { #define DOF_RELO_NONE 0 /* empty relocation entry */ #define DOF_RELO_SETX 1 /* relocate setx value */ +#define DOF_RELO_DOFREL 2 /* relocate DOF-relative value */ typedef struct dof_optdesc { uint32_t dofo_option; /* option identifier */ @@ -1414,7 +1415,6 @@ typedef struct { #define DTRACEHIOC_REMOVE (DTRACEHIOC | 2) /* remove helper */ #define DTRACEHIOC_ADDDOF (DTRACEHIOC | 3) /* add helper DOF */ #else -#define DTRACEHIOC_ADD _IOWR('z', 1, dof_hdr_t)/* add helper */ #define DTRACEHIOC_REMOVE _IOW('z', 2, int) /* remove helper */ #define DTRACEHIOC_ADDDOF _IOWR('z', 3, dof_helper_t)/* add helper DOF */ #endif Modified: stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri May 15 20:03:53 2020 (r361087) +++ stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri May 15 20:03:57 2020 (r361088) @@ -44,10 +44,8 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd case DTRACEHIOC_ADDDOF: dhp = (dof_helper_t *)addr; addr = (caddr_t)(uintptr_t)dhp->dofhp_dof; - /* FALLTHROUGH */ - case DTRACEHIOC_ADD: - p = curproc; - if (dhp == NULL || p->p_pid == dhp->dofhp_pid) { + if (p->p_pid == dhp->dofhp_pid) { + p = curproc; dof = dtrace_dof_copyin((uintptr_t)addr, &rval); } else { p = pfind(dhp->dofhp_pid); @@ -72,10 +70,7 @@ dtrace_ioctl_helper(struct cdev *dev, u_long cmd, cadd mutex_enter(&dtrace_lock); if ((rval = dtrace_helper_slurp(dof, dhp, p)) != -1) { - if (dhp != NULL) { - dhp->dofhp_gen = rval; - copyout(dhp, addr, sizeof(*dhp)); - } + dhp->dofhp_gen = rval; rval = 0; } else { rval = EINVAL; @@ -432,7 +427,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add return (EBUSY); } - if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, B_TRUE) != 0) { + if (dtrace_dof_slurp(dof, vstate, td->td_ucred, &enab, 0, 0, + B_TRUE) != 0) { mutex_exit(&dtrace_lock); mutex_exit(&cpu_lock); dtrace_dof_destroy(dof); From owner-svn-src-all@freebsd.org Fri May 15 20:12:27 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BC3DB2FFA5A; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0234cjbz4PqB; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 561C61DFF2; Fri, 15 May 2020 20:12:27 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: rgrimes@freebsd.org, Ryan Moeller Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> From: Ryan Moeller Message-ID: Date: Fri, 15 May 2020 16:12:26 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005151924.04FJOoQM087849@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:12:27 -0000 On 5/15/20 3:24 PM, Rodney W. Grimes wrote: >> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: >> >>> On 5/15/20 1:38 AM, Ryan Moeller wrote: >>>> Author: freqlabs >>>> Date: Thu May 14 23:38:11 2020 >>>> New Revision: 361066 >>>> URL: https://svnweb.freebsd.org/changeset/base/361066 >>>> >>>> Log: >>>> jail: Add exec.prepare and exec.release command hooks >>>> >>>> This change introduces new jail command hooks that run before and after any >>>> other actions. >>> Should it go into RELNOTES? >> I'm not sure what all the criteria are for relnotes. >> The committer's guide makes it seem like relnotes is for breaking >> changes, which this is not. > Please could you point at which specific language in the commiters > guide makes you believe that the RELNOTES are for breaking changes? Every mention of "release notes" in the document is in the context of deprecating, removing, or breaking things, with one exception: > Relnotes:    If the change is a candidate for inclusion in the release notes for the next release from the branch, set to yes. > > RELNOTES should be for all changes that have user visible impact > of any type. > >> -Ryan From owner-svn-src-all@freebsd.org Fri May 15 20:17:26 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8F5D72FFC2F; Fri, 15 May 2020 20:17:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49P07p2PGyz4Q7n; Fri, 15 May 2020 20:17:26 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FKHOoH088161; Fri, 15 May 2020 13:17:24 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FKHOcg088160; Fri, 15 May 2020 13:17:24 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: To: Ryan Moeller Date: Fri, 15 May 2020 13:17:24 -0700 (PDT) CC: rgrimes@freebsd.org, Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49P07p2PGyz4Q7n X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:17:26 -0000 > On 5/15/20 3:24 PM, Rodney W. Grimes wrote: > > >> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > >> > >>> On 5/15/20 1:38 AM, Ryan Moeller wrote: > >>>> Author: freqlabs > >>>> Date: Thu May 14 23:38:11 2020 > >>>> New Revision: 361066 > >>>> URL: https://svnweb.freebsd.org/changeset/base/361066 > >>>> > >>>> Log: > >>>> jail: Add exec.prepare and exec.release command hooks > >>>> > >>>> This change introduces new jail command hooks that run before and after any > >>>> other actions. > >>> Should it go into RELNOTES? > >> I'm not sure what all the criteria are for relnotes. > >> The committer's guide makes it seem like relnotes is for breaking > >> changes, which this is not. > > Please could you point at which specific language in the commiters > > guide makes you believe that the RELNOTES are for breaking changes? > > Every mention of "release notes" in the document is in the context of > deprecating, removing, > or breaking things, with one exception: Fair, there should be a section on "new features and enhnacements" which is laking. However if one reads a release notes from a shipping version it becomes clear that the actual majority of the text in it is "new stuff." > > Relnotes:??? If the change is a candidate for inclusion in the > release notes for the next release from the branch, set to yes. > > > > RELNOTES should be for all changes that have user visible impact > > of any type. > > > >> -Ryan > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 15 20:24:08 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6BA32FFEBD; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@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 49P0HX4LxJz4QXb; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 907F122A5; Fri, 15 May 2020 20:24:08 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FKO8Xg072456; Fri, 15 May 2020 20:24:08 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FKO80W072455; Fri, 15 May 2020 20:24:08 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152024.04FKO80W072455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 20:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361089 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361089 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:24:08 -0000 Author: csjp Date: Fri May 15 20:24:08 2020 New Revision: 361089 URL: https://svnweb.freebsd.org/changeset/base/361089 Log: Remove references to pdwait4(2). This syscall was never implemented and its presence just creates confusion. Discussed with: cem MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 20:03:57 2020 (r361088) +++ head/share/man/man4/procdesc.4 Fri May 15 20:24:08 2020 (r361089) @@ -1,3 +1,4 @@ +W .\" .\" Copyright (c) 2013 Robert N. M. Watson .\" All rights reserved. @@ -40,16 +41,14 @@ is a file-descriptor-oriented interface to process signalling and control, which supplements historic .Ux -.Xr fork 2 , -.Xr kill 2 , +.Xr fork 2 and -.Xr wait4 2 +.Xr kill 2 , primitives with new system calls such as -.Xr pdfork 2 , -.Xr pdkill 2 , +.Xr pdfork 2 and -.Xr pdwait4 2 . +.Xr pdkill 2 , .Nm is designed for use with .Xr capsicum 4 , @@ -65,7 +64,6 @@ Given a process descriptor, it is possible to query it .Xr pdfork 2 , .Xr pdgetpid 2 , .Xr pdkill 2 , -.Xr pdwait4 2 , .Xr kqueue 2 , .Xr wait4 2 , .Xr capsicum 4 From owner-svn-src-all@freebsd.org Fri May 15 20:26:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CF3642D806C; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P0L94qPGz4QpG; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from Ryans-MBP.attlocal.net (unknown [IPv6:2600:1700:358a:c660:904d:8f18:1bde:14ec]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: freqlabs/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 587321E122; Fri, 15 May 2020 20:26:25 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Subject: Re: svn commit: r361066 - head/usr.sbin/jail To: rgrimes@freebsd.org, Ryan Moeller Cc: Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> From: Ryan Moeller Message-ID: Date: Fri, 15 May 2020 16:26:24 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <202005152017.04FKHOcg088160@gndrsh.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:26:25 -0000 On 5/15/20 4:17 PM, Rodney W. Grimes wrote: >> On 5/15/20 3:24 PM, Rodney W. Grimes wrote: >> >>>> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: >>>> >>>>> On 5/15/20 1:38 AM, Ryan Moeller wrote: >>>>>> Author: freqlabs >>>>>> Date: Thu May 14 23:38:11 2020 >>>>>> New Revision: 361066 >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361066 >>>>>> >>>>>> Log: >>>>>> jail: Add exec.prepare and exec.release command hooks >>>>>> >>>>>> This change introduces new jail command hooks that run before and after any >>>>>> other actions. >>>>> Should it go into RELNOTES? >>>> I'm not sure what all the criteria are for relnotes. >>>> The committer's guide makes it seem like relnotes is for breaking >>>> changes, which this is not. >>> Please could you point at which specific language in the commiters >>> guide makes you believe that the RELNOTES are for breaking changes? >> Every mention of "release notes" in the document is in the context of >> deprecating, removing, >> or breaking things, with one exception: > Fair, there should be a section on "new features and enhnacements" > which is laking. However if one reads a release notes from a shipping > version it becomes clear that the actual majority of the text in it is > "new stuff." Now that I know better, how do I retcon this and other potentially relnoteworthy enhancements I've made? :) >> > Relnotes:??? If the change is a candidate for inclusion in the >> release notes for the next release from the branch, set to yes. >>> RELNOTES should be for all changes that have user visible impact >>> of any type. >>> >>>> -Ryan From owner-svn-src-all@freebsd.org Fri May 15 20:29:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58DCF2D8BBB; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@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 49P0Py1SWzz4Qyr; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 2D63722C2; Fri, 15 May 2020 20:29:42 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FKTgna072738; Fri, 15 May 2020 20:29:42 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FKTg2I072737; Fri, 15 May 2020 20:29:42 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152029.04FKTg2I072737@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 20:29:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361090 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361090 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 20:29:42 -0000 Author: csjp Date: Fri May 15 20:29:41 2020 New Revision: 361090 URL: https://svnweb.freebsd.org/changeset/base/361090 Log: Bump revision date to today. MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 20:24:08 2020 (r361089) +++ head/share/man/man4/procdesc.4 Fri May 15 20:29:41 2020 (r361090) @@ -30,7 +30,7 @@ W .\" .\" $FreeBSD$ .\" -.Dd October 14, 2018 +.Dd May 15, 2020 .Dt PROCDESC 4 .Os .Sh NAME From owner-svn-src-all@freebsd.org Fri May 15 21:42:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A2FCC2DAEC4; Fri, 15 May 2020 21:42:28 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49P21w24mlz4Vrn; Fri, 15 May 2020 21:42:27 +0000 (UTC) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: from gndrsh.dnsmgr.net (localhost [127.0.0.1]) by gndrsh.dnsmgr.net (8.13.3/8.13.3) with ESMTP id 04FLgP0g088518; Fri, 15 May 2020 14:42:25 -0700 (PDT) (envelope-from freebsd@gndrsh.dnsmgr.net) Received: (from freebsd@localhost) by gndrsh.dnsmgr.net (8.13.3/8.13.3/Submit) id 04FLgPA2088517; Fri, 15 May 2020 14:42:25 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <202005152142.04FLgPA2088517@gndrsh.dnsmgr.net> Subject: Re: svn commit: r361066 - head/usr.sbin/jail In-Reply-To: To: Ryan Moeller Date: Fri, 15 May 2020 14:42:25 -0700 (PDT) CC: rgrimes@freebsd.org, Mateusz Piotrowski <0mp@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: 49P21w24mlz4Vrn X-Spamd-Bar: ----- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-5.96 / 15.00]; NEURAL_HAM_MEDIUM(-0.96)[-0.964,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 21:42:28 -0000 > > On 5/15/20 4:17 PM, Rodney W. Grimes wrote: > >> On 5/15/20 3:24 PM, Rodney W. Grimes wrote: > >> > >>>> On 5/15/20 6:18 AM, Mateusz Piotrowski wrote: > >>>> > >>>>> On 5/15/20 1:38 AM, Ryan Moeller wrote: > >>>>>> Author: freqlabs > >>>>>> Date: Thu May 14 23:38:11 2020 > >>>>>> New Revision: 361066 > >>>>>> URL: https://svnweb.freebsd.org/changeset/base/361066 > >>>>>> > >>>>>> Log: > >>>>>> jail: Add exec.prepare and exec.release command hooks > >>>>>> > >>>>>> This change introduces new jail command hooks that run before and after any > >>>>>> other actions. > >>>>> Should it go into RELNOTES? > >>>> I'm not sure what all the criteria are for relnotes. > >>>> The committer's guide makes it seem like relnotes is for breaking > >>>> changes, which this is not. > >>> Please could you point at which specific language in the commiters > >>> guide makes you believe that the RELNOTES are for breaking changes? > >> Every mention of "release notes" in the document is in the context of > >> deprecating, removing, > >> or breaking things, with one exception: > > Fair, there should be a section on "new features and enhnacements" > > which is laking. However if one reads a release notes from a shipping > > version it becomes clear that the actual majority of the text in it is > > "new stuff." > > Now that I know better, how do I retcon this and other potentially > relnoteworthy enhancements I've made? :) There is a top level file in the src tree called RELNOTES that you can use to ad an entry to describing the change and the revision number. > >> > Relnotes:??? If the change is a candidate for inclusion in the > >> release notes for the next release from the branch, set to yes. > >>> RELNOTES should be for all changes that have user visible impact > >>> of any type. > >>> > >>>> -Ryan > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Fri May 15 22:55:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1D0D2DC8C3; Fri, 15 May 2020 22:55:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3f85fpdz4ZM3; Fri, 15 May 2020 22:55:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD671417E; Fri, 15 May 2020 22:55:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FMtSO2064174; Fri, 15 May 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMtSEc064173; Fri, 15 May 2020 22:55:28 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152255.04FMtSEc064173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:55:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361091 - head/tools/tools/crypto X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/tools/crypto X-SVN-Commit-Revision: 361091 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:55:28 -0000 Author: jhb Date: Fri May 15 22:55:28 2020 New Revision: 361091 URL: https://svnweb.freebsd.org/changeset/base/361091 Log: Remove the ubsecstats tool since ubsec(4) has been removed. Reported by: markj Deleted: head/tools/tools/crypto/ubsecstats.c Modified: head/tools/tools/crypto/Makefile Modified: head/tools/tools/crypto/Makefile ============================================================================== --- head/tools/tools/crypto/Makefile Fri May 15 20:29:41 2020 (r361090) +++ head/tools/tools/crypto/Makefile Fri May 15 22:55:28 2020 (r361091) @@ -27,7 +27,7 @@ # PROGS= cryptocheck cryptotest cryptokeytest cryptostats \ - ubsecstats hifnstats ipsecstats safestats + hifnstats ipsecstats safestats MAN= BINDIR?= /usr/local/bin @@ -38,7 +38,6 @@ LIBADD.cryptocheck+= crypto util LIBADD.cryptokeytest+= crypto # cryptostats: dump statistics kept by the core crypto code -# ubsecstats: print statistics kept by the Broadcom driver # hifnstats: print statistics kept by the HIFN driver # safestats: statistics kept by the SafeNet driver # ipsecstats: print statistics kept by fast ipsec From owner-svn-src-all@freebsd.org Fri May 15 22:55:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C6E12DC923; Fri, 15 May 2020 22:55:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3fZ1mJ7z4ZT3; Fri, 15 May 2020 22:55:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1F507417F; Fri, 15 May 2020 22:55:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FMtoaB064233; Fri, 15 May 2020 22:55:50 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMtoJQ064232; Fri, 15 May 2020 22:55:50 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152255.04FMtoJQ064232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:55:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361092 - head/tools/kerneldoc/subsys X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/kerneldoc/subsys X-SVN-Commit-Revision: 361092 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:55:50 -0000 Author: jhb Date: Fri May 15 22:55:49 2020 New Revision: 361092 URL: https://svnweb.freebsd.org/changeset/base/361092 Log: Remove Doxyfile for sys/dev/ubsec since it has been removed. Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_ubsec From owner-svn-src-all@freebsd.org Fri May 15 22:56:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98CBB2DC9AB; Fri, 15 May 2020 22:56:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P3gv3ZCYz4Zbg; Fri, 15 May 2020 22:56:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 75CEB4180; Fri, 15 May 2020 22:56:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FMuxQp064327; Fri, 15 May 2020 22:56:59 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FMuxMw064326; Fri, 15 May 2020 22:56:59 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <202005152256.04FMuxMw064326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 15 May 2020 22:56:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361093 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 361093 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 22:56:59 -0000 Author: jhb Date: Fri May 15 22:56:59 2020 New Revision: 361093 URL: https://svnweb.freebsd.org/changeset/base/361093 Log: Don't remove ubsec(4) manual page for WITHOUT_USB=yes. In head this manpage has been removed entirely, but ubsec(4) is a PCI device and not a USB device. MFC after: 1 week Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Fri May 15 22:55:49 2020 (r361092) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Fri May 15 22:56:59 2020 (r361093) @@ -9648,7 +9648,6 @@ OLD_FILES+=usr/share/man/man4/uark.4.gz OLD_FILES+=usr/share/man/man4/uart.4.gz OLD_FILES+=usr/share/man/man4/uath.4.gz OLD_FILES+=usr/share/man/man4/ubsa.4.gz -OLD_FILES+=usr/share/man/man4/ubsec.4.gz OLD_FILES+=usr/share/man/man4/ubser.4.gz OLD_FILES+=usr/share/man/man4/ubtbcmfw.4.gz OLD_FILES+=usr/share/man/man4/uchcom.4.gz From owner-svn-src-all@freebsd.org Fri May 15 23:44:53 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D3E82DDA4A; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@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 49P4l939rXz4cn7; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 63A194AB2; Fri, 15 May 2020 23:44:53 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04FNirTf094472; Fri, 15 May 2020 23:44:53 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04FNir8F094471; Fri, 15 May 2020 23:44:53 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005152344.04FNir8F094471@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Fri, 15 May 2020 23:44:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361094 - head/share/man/man4 X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: head/share/man/man4 X-SVN-Commit-Revision: 361094 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 May 2020 23:44:53 -0000 Author: csjp Date: Fri May 15 23:44:52 2020 New Revision: 361094 URL: https://svnweb.freebsd.org/changeset/base/361094 Log: Fix typo that snuck in Reported by: Jose Luis Duran MFC after: 1 week Modified: head/share/man/man4/procdesc.4 Modified: head/share/man/man4/procdesc.4 ============================================================================== --- head/share/man/man4/procdesc.4 Fri May 15 22:56:59 2020 (r361093) +++ head/share/man/man4/procdesc.4 Fri May 15 23:44:52 2020 (r361094) @@ -1,4 +1,3 @@ -W .\" .\" Copyright (c) 2013 Robert N. M. Watson .\" All rights reserved. From owner-svn-src-all@freebsd.org Sat May 16 00:28:13 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 523FE2DE6E1; Sat, 16 May 2020 00:28:13 +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 49P5j91XCRz4fmQ; Sat, 16 May 2020 00:28:13 +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 2F60F5241; Sat, 16 May 2020 00:28:13 +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 04G0SDF7020157; Sat, 16 May 2020 00:28:13 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G0SChO020155; Sat, 16 May 2020 00:28:12 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005160028.04G0SChO020155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 16 May 2020 00:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361095 - in head/sys: net netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: net netpfil/pf X-SVN-Commit-Revision: 361095 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 00:28:13 -0000 Author: markj Date: Sat May 16 00:28:12 2020 New Revision: 361095 URL: https://svnweb.freebsd.org/changeset/base/361095 Log: pf: Add a new zone for per-table entry counters. Right now we optionally allocate 8 counters per table entry, so in addition to memory consumed by counters, we require 8 pointers worth of space in each entry even when counters are not allocated (the default). Instead, define a UMA zone that returns contiguous per-CPU counter arrays for use in table entries. On amd64 this reduces sizeof(struct pfr_kentry) from 216 to 160. The smaller size also results in better slab efficiency, so memory usage for large tables is reduced by about 28%. Reviewed by: kp MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D24843 Modified: head/sys/net/pfvar.h head/sys/netpfil/pf/pf_table.c Modified: head/sys/net/pfvar.h ============================================================================== --- head/sys/net/pfvar.h Fri May 15 23:44:52 2020 (r361094) +++ head/sys/net/pfvar.h Sat May 16 00:28:12 2020 (r361095) @@ -1000,6 +1000,8 @@ struct pfr_addr { enum { PFR_DIR_IN, PFR_DIR_OUT, PFR_DIR_MAX }; enum { PFR_OP_BLOCK, PFR_OP_PASS, PFR_OP_ADDR_MAX, PFR_OP_TABLE_MAX }; +enum { PFR_TYPE_PACKETS, PFR_TYPE_BYTES, PFR_TYPE_MAX }; +#define PFR_NUM_COUNTERS (PFR_DIR_MAX * PFR_OP_ADDR_MAX * PFR_TYPE_MAX) #define PFR_OP_XPASS PFR_OP_ADDR_MAX struct pfr_astats { @@ -1045,10 +1047,12 @@ union sockaddr_union { #endif /* _SOCKADDR_UNION_DEFINED */ struct pfr_kcounters { - counter_u64_t pfrkc_packets[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; - counter_u64_t pfrkc_bytes[PFR_DIR_MAX][PFR_OP_ADDR_MAX]; + counter_u64_t pfrkc_counters; long pfrkc_tzero; }; +#define pfr_kentry_counter(kc, dir, op, t) \ + ((kc)->pfrkc_counters + \ + (dir) * PFR_OP_ADDR_MAX * PFR_TYPE_MAX + (op) * PFR_TYPE_MAX + (t)) SLIST_HEAD(pfr_kentryworkq, pfr_kentry); struct pfr_kentry { Modified: head/sys/netpfil/pf/pf_table.c ============================================================================== --- head/sys/netpfil/pf/pf_table.c Fri May 15 23:44:52 2020 (r361094) +++ head/sys/netpfil/pf/pf_table.c Sat May 16 00:28:12 2020 (r361095) @@ -127,6 +127,8 @@ struct pfr_walktree { static MALLOC_DEFINE(M_PFTABLE, "pf_table", "pf(4) tables structures"); VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_z); #define V_pfr_kentry_z VNET(pfr_kentry_z) +VNET_DEFINE_STATIC(uma_zone_t, pfr_kentry_counter_z); +#define V_pfr_kentry_counter_z VNET(pfr_kentry_counter_z) static struct pf_addr pfr_ffaddr = { .addr32 = { 0xffffffff, 0xffffffff, 0xffffffff, 0xffffffff } @@ -144,12 +146,8 @@ static void pfr_mark_addrs(struct pfr_ktable *); static struct pfr_kentry *pfr_lookup_addr(struct pfr_ktable *, struct pfr_addr *, int); -static bool pfr_create_kentry_counter(struct pfr_kentry *, int, - int); static struct pfr_kentry *pfr_create_kentry(struct pfr_addr *, bool); static void pfr_destroy_kentries(struct pfr_kentryworkq *); -static void pfr_destroy_kentry_counter(struct pfr_kcounters *, - int, int); static void pfr_destroy_kentry(struct pfr_kentry *); static void pfr_insert_kentries(struct pfr_ktable *, struct pfr_kentryworkq *, long); @@ -205,6 +203,9 @@ void pfr_initialize(void) { + V_pfr_kentry_counter_z = uma_zcreate("pf table entry counters", + PFR_NUM_COUNTERS * sizeof(uint64_t), NULL, NULL, NULL, NULL, + UMA_ALIGN_PTR, UMA_ZONE_PCPU); V_pfr_kentry_z = uma_zcreate("pf table entries", sizeof(struct pfr_kentry), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); @@ -217,6 +218,7 @@ pfr_cleanup(void) { uma_zdestroy(V_pfr_kentry_z); + uma_zdestroy(V_pfr_kentry_counter_z); } int @@ -785,27 +787,11 @@ pfr_lookup_addr(struct pfr_ktable *kt, struct pfr_addr return (ke); } -static bool -pfr_create_kentry_counter(struct pfr_kentry *ke, int pfr_dir, int pfr_op) -{ - counter_u64_t c; - - c = counter_u64_alloc(M_NOWAIT); - if (c == NULL) - return (false); - ke->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op] = c; - c = counter_u64_alloc(M_NOWAIT); - if (c == NULL) - return (false); - ke->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op] = c; - return (true); -} - static struct pfr_kentry * pfr_create_kentry(struct pfr_addr *ad, bool counters) { struct pfr_kentry *ke; - int pfr_dir, pfr_op; + counter_u64_t c; ke = uma_zalloc(V_pfr_kentry_z, M_NOWAIT | M_ZERO); if (ke == NULL) @@ -819,15 +805,14 @@ pfr_create_kentry(struct pfr_addr *ad, bool counters) ke->pfrke_net = ad->pfra_net; ke->pfrke_not = ad->pfra_not; ke->pfrke_counters.pfrkc_tzero = 0; - if (counters) - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op++) { - if (!pfr_create_kentry_counter(ke, pfr_dir, - pfr_op)) { - pfr_destroy_kentry(ke); - return (NULL); - } - } + if (counters) { + c = uma_zalloc_pcpu(V_pfr_kentry_counter_z, M_NOWAIT | M_ZERO); + if (c == NULL) { + pfr_destroy_kentry(ke); + return (NULL); + } + ke->pfrke_counters.pfrkc_counters = c; + } return (ke); } @@ -843,26 +828,12 @@ pfr_destroy_kentries(struct pfr_kentryworkq *workq) } static void -pfr_destroy_kentry_counter(struct pfr_kcounters *kc, int pfr_dir, int pfr_op) +pfr_destroy_kentry(struct pfr_kentry *ke) { counter_u64_t c; - if ((c = kc->pfrkc_packets[pfr_dir][pfr_op]) != NULL) - counter_u64_free(c); - if ((c = kc->pfrkc_bytes[pfr_dir][pfr_op]) != NULL) - counter_u64_free(c); -} - -static void -pfr_destroy_kentry(struct pfr_kentry *ke) -{ - int pfr_dir, pfr_op; - - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir ++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; pfr_op ++) - pfr_destroy_kentry_counter(&ke->pfrke_counters, - pfr_dir, pfr_op); - + if ((c = ke->pfrke_counters.pfrkc_counters) != NULL) + uma_zfree_pcpu(V_pfr_kentry_counter_z, c); uma_zfree(V_pfr_kentry_z, ke); } @@ -935,28 +906,19 @@ pfr_clean_node_mask(struct pfr_ktable *kt, } static void -pfr_clear_kentry_counters(struct pfr_kentry *p, int pfr_dir, int pfr_op) -{ - counter_u64_zero(p->pfrke_counters.pfrkc_packets[pfr_dir][pfr_op]); - counter_u64_zero(p->pfrke_counters.pfrkc_bytes[pfr_dir][pfr_op]); -} - -static void pfr_clstats_kentries(struct pfr_ktable *kt, struct pfr_kentryworkq *workq, long tzero, int negchange) { struct pfr_kentry *p; - int pfr_dir, pfr_op; + int i; SLIST_FOREACH(p, workq, pfrke_workq) { if (negchange) p->pfrke_not = !p->pfrke_not; if ((kt->pfrkt_flags & PFR_TFLAG_COUNTERS) != 0) - for (pfr_dir = 0; pfr_dir < PFR_DIR_MAX; pfr_dir++) - for (pfr_op = 0; pfr_op < PFR_OP_ADDR_MAX; - pfr_op++) - pfr_clear_kentry_counters(p, pfr_dir, - pfr_op); + for (i = 0; i < PFR_NUM_COUNTERS; i++) + counter_u64_zero( + p->pfrke_counters.pfrkc_counters + i); p->pfrke_counters.pfrkc_tzero = tzero; } } @@ -1077,12 +1039,12 @@ pfr_copyout_astats(struct pfr_astats *as, const struct return; } - for (dir = 0; dir < PFR_DIR_MAX; dir ++) { + for (dir = 0; dir < PFR_DIR_MAX; dir++) { for (op = 0; op < PFR_OP_ADDR_MAX; op ++) { - as->pfras_packets[dir][op] = - counter_u64_fetch(kc->pfrkc_packets[dir][op]); - as->pfras_bytes[dir][op] = - counter_u64_fetch(kc->pfrkc_bytes[dir][op]); + as->pfras_packets[dir][op] = counter_u64_fetch( + pfr_kentry_counter(kc, dir, op, PFR_TYPE_PACKETS)); + as->pfras_bytes[dir][op] = counter_u64_fetch( + pfr_kentry_counter(kc, dir, op, PFR_TYPE_BYTES)); } } } @@ -2147,10 +2109,10 @@ pfr_update_stats(struct pfr_ktable *kt, struct pf_addr counter_u64_add(kt->pfrkt_bytes[dir_out][op_pass], len); if (ke != NULL && op_pass != PFR_OP_XPASS && (kt->pfrkt_flags & PFR_TFLAG_COUNTERS)) { - counter_u64_add(ke->pfrke_counters. - pfrkc_packets[dir_out][op_pass], 1); - counter_u64_add(ke->pfrke_counters. - pfrkc_bytes[dir_out][op_pass], len); + counter_u64_add(pfr_kentry_counter(&ke->pfrke_counters, + dir_out, op_pass, PFR_TYPE_PACKETS), 1); + counter_u64_add(pfr_kentry_counter(&ke->pfrke_counters, + dir_out, op_pass, PFR_TYPE_BYTES), len); } } From owner-svn-src-all@freebsd.org Sat May 16 00:28:50 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9F4892DE76E; Sat, 16 May 2020 00:28:50 +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 49P5jt3pBhz4fv4; Sat, 16 May 2020 00:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7D8345248; Sat, 16 May 2020 00:28:50 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G0SonY020233; Sat, 16 May 2020 00:28:50 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G0Sn6V020231; Sat, 16 May 2020 00:28:49 GMT (envelope-from markj@FreeBSD.org) Message-Id: <202005160028.04G0Sn6V020231@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 16 May 2020 00:28: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: r361096 - in stable/12: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in stable/12: share/man/man4 sys/dev/rtwn/usb sys/dev/usb X-SVN-Commit-Revision: 361096 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 00:28:50 -0000 Author: markj Date: Sat May 16 00:28:49 2020 New Revision: 361096 URL: https://svnweb.freebsd.org/changeset/base/361096 Log: MFC r360848: rtwn: Add a new USB ID. PR: 246315 Modified: stable/12/share/man/man4/rtwn_usb.4 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/share/man/man4/rtwn_usb.4 ============================================================================== --- stable/12/share/man/man4/rtwn_usb.4 Sat May 16 00:28:12 2020 (r361095) +++ stable/12/share/man/man4/rtwn_usb.4 Sat May 16 00:28:49 2020 (r361096) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\"/ -.Dd September 1, 2019 +.Dd May 9, 2020 .Dt RTWN_USB 4 .Os .Sh NAME @@ -83,6 +83,7 @@ based USB wireless network adapters, including: .It "EDUP EP-AC1620" Ta RTL8821AU Ta USB 2.0 .It "Elecom WDC-150SU2M" Ta RTL8188EU Ta USB 2.0 .It "EnGenius EUB1200AC" Ta RTL8812AU Ta USB 3.0 +.It "Foxconn WFUR6" Ta RTL8812AU Ta USB 2.0 .It "Hawking HD65U" Ta RTL8821AU Ta USB 2.0 .It "Hercules Wireless N USB Pico" Ta RTL8188CUS Ta USB 2.0 .It "I-O Data WN-AC867U" Ta RTL8812AU Ta USB 3.0 Modified: stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h ============================================================================== --- stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Sat May 16 00:28:12 2020 (r361095) +++ stable/12/sys/dev/rtwn/usb/rtwn_usb_attach.h Sat May 16 00:28:49 2020 (r361096) @@ -136,7 +136,8 @@ static const STRUCT_USB_HOST_ID rtwn_devs[] = { RTWN_RTL8812AU_DEV(MELCO, WIU3866D), RTWN_RTL8812AU_DEV(NEC, WL900U), RTWN_RTL8812AU_DEV(PLANEX2, GW900D), - RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU), + RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU_1), + RTWN_RTL8812AU_DEV(REALTEK, RTL8812AU_2), RTWN_RTL8812AU_DEV(SENAO, EUB1200AC), RTWN_RTL8812AU_DEV(SITECOMEU, WLA7100), RTWN_RTL8812AU_DEV(TPLINK, T4U), Modified: stable/12/sys/dev/usb/usbdevs ============================================================================== --- stable/12/sys/dev/usb/usbdevs Sat May 16 00:28:12 2020 (r361095) +++ stable/12/sys/dev/usb/usbdevs Sat May 16 00:28:49 2020 (r361096) @@ -3995,7 +3995,8 @@ product REALTEK RTL8188CU_COMBO 0x8754 RTL8188CU product REALTEK RTL8821AU_1 0xa811 RTL8821AU product REALTEK RTL8723BU 0xb720 RTL8723BU product REALTEK RTL8192SU 0xc512 RTL8192SU -product REALTEK RTL8812AU 0x8812 RTL8812AU Wireless Adapter +product REALTEK RTL8812AU_1 0x8812 RTL8812AU Wireless Adapter +product REALTEK RTL8812AU_2 0x881a RTL8812AU Wireless Adapter /* RedOctane products */ product REDOCTANE DUMMY 0x0000 Dummy product From owner-svn-src-all@freebsd.org Sat May 16 01:50:28 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BE4BC2DFD7F; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@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 49P7X44RR8z3FLP; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 8F18860F9; Sat, 16 May 2020 01:50:28 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G1oSBf069144; Sat, 16 May 2020 01:50:28 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G1oS3J069143; Sat, 16 May 2020 01:50:28 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005160150.04G1oS3J069143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 16 May 2020 01:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361097 - head/sys/dev/acpica X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/dev/acpica X-SVN-Commit-Revision: 361097 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 01:50:28 -0000 Author: cperciva Date: Sat May 16 01:50:28 2020 New Revision: 361097 URL: https://svnweb.freebsd.org/changeset/base/361097 Log: Send Lid status notification via devd from acpi_lid_status_update. Some laptops don't send ACPI "lid status changed" notifications upon opening the lid if the system was currently suspended. In r358219 this was partially fixed, updating the "lid_status" variable upon resume even if there is no "status changed" notification from ACPI. Unfortunately the fix in r358219 did not include notifying userland via devd; this causes problems on systems using upowerd (e.g. KDE), since upowerd remembers the most recent devd notification about the lid status rather than querying the sysctl to get the current status. This showed up as two symptoms when KDE's "When laptop lid closed: Sleep" option is set: 1. 50% of the time, closing the lid would not trigger S3 sleep. 2. 50% of the time, plugging/unplugging AC power would trigger S3 sleep. PR: 246477 MFC after: 3 days Modified: head/sys/dev/acpica/acpi_lid.c Modified: head/sys/dev/acpica/acpi_lid.c ============================================================================== --- head/sys/dev/acpica/acpi_lid.c Sat May 16 00:28:49 2020 (r361096) +++ head/sys/dev/acpica/acpi_lid.c Sat May 16 01:50:28 2020 (r361097) @@ -114,6 +114,9 @@ acpi_lid_status_update(struct acpi_lid_softc *sc) /* range check value */ sc->lid_status = lid_status ? 1 : 0; + /* Send notification via devd */ + acpi_UserNotify("Lid", sc->lid_handle, sc->lid_status); + #ifdef EVDEV_SUPPORT /* Notify evdev about lid status */ evdev_push_sw(sc->lid_evdev, SW_LID, lid_status ? 0 : 1); From owner-svn-src-all@freebsd.org Sat May 16 01:56:06 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D75C72DFFD5; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@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 49P7fZ54VHz3FlW; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 A50B062C9; Sat, 16 May 2020 01:56:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G1u6jt074864; Sat, 16 May 2020 01:56:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G1u6DB074863; Sat, 16 May 2020 01:56:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160156.04G1u6DB074863@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 01:56:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361098 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361098 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 01:56:06 -0000 Author: adrian Date: Sat May 16 01:56:06 2020 New Revision: 361098 URL: https://svnweb.freebsd.org/changeset/base/361098 Log: [ath_rate_sample] Fix logic for determining whether to bump up an MCS rate. * Fix formatting, cause reasons; * Put back the "and the chosen rate is within 90% of the current rate" logic; * Ensure the best rate and the current rate aren't the same; this ... * ... fixes the packets_since_switch[] tracking to actually conut how many frames since the rate switched, so now I know how stable stuff is; and * Ensure that MCS can go up to a higher MCS at this or any other spatial stream. My previous quick hack attempt was doing > rather than >= so you had to go to both a higher root MCS rate (0..7) and spatial stream. Eg, you couldn't go from MCS0 (1ss) to MCS8 (2ss) this way. The best rate and switching rate logic still have a bunch more work to do because they're still quite touchy when it comes to average tx time but at least now it's choosing higher rates correctly when it wants to try a higher rate. Tested: * AR9380, STA mode Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 01:50:28 2020 (r361097) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 01:56:06 2020 (r361098) @@ -712,10 +712,13 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod * Limit the time measuring the performance of other tx * rates to sample_rate% of the total transmission time. */ - if (sn->sample_tt[size_bin] < average_tx_time * (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { + if (sn->sample_tt[size_bin] < + average_tx_time * + (sn->packets_since_sample[size_bin]*ssc->sample_rate/100)) { rix = pick_sample_rate(ssc, an, rt, size_bin); IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, - &an->an_node, "att %d sample_tt %d size %u sample rate %d %s current rate %d %s", + &an->an_node, "att %d sample_tt %d size %u " + "sample rate %d %s current rate %d %s", average_tx_time, sn->sample_tt[size_bin], bin_to_size(size_bin), @@ -776,12 +779,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod printf("cur rix/att %x/%d, best rix/att %x/%d\n", MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif -#if 0 - if (((MCS(best_rix) & 0x7) > (MCS(cur_rix) & 0x7)) && - (average_tx_time * 10) <= (cur_att * 10)) { -#else - if ((average_tx_time * 10) <= (cur_att * 10)) { -#endif + if ((best_rix != cur_rix) && + ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) && + (average_tx_time * 9) <= (cur_att * 10)) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, "%s: HT: size %d best_rix 0x%x > " @@ -823,7 +823,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod /* * Set the visible txrate for this node. */ - an->an_node.ni_txrate = (rt->info[best_rix].phy == IEEE80211_T_HT) ? MCS(best_rix) : DOT11RATE(best_rix); + an->an_node.ni_txrate = + (rt->info[best_rix].phy == IEEE80211_T_HT) ? + MCS(best_rix) : DOT11RATE(best_rix); } rix = sn->current_rix[size_bin]; sn->packets_since_switch[size_bin]++; From owner-svn-src-all@freebsd.org Sat May 16 02:29:12 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7D2362E0DD0; Sat, 16 May 2020 02:29:12 +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 49P8Nm2gglz3HGk; Sat, 16 May 2020 02:29:12 +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 56FBC6894; Sat, 16 May 2020 02:29:12 +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 04G2TCGp093673; Sat, 16 May 2020 02:29:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G2TBSd093667; Sat, 16 May 2020 02:29:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <202005160229.04G2TBSd093667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sat, 16 May 2020 02:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361099 - in head: . lib/libalias/libalias lib/libalias/modules/cuseeme sys/modules/libalias/modules sys/modules/libalias/modules/cuseeme sys/netinet/libalias targets/pseudo/userland/li... X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . lib/libalias/libalias lib/libalias/modules/cuseeme sys/modules/libalias/modules sys/modules/libalias/modules/cuseeme sys/netinet/libalias targets/pseudo/userland/lib tools/build/mk X-SVN-Commit-Revision: 361099 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 02:29:12 -0000 Author: emaste Date: Sat May 16 02:29:10 2020 New Revision: 361099 URL: https://svnweb.freebsd.org/changeset/base/361099 Log: libalias: retire cuseeme support The CU-SeeMe videoconferencing client and associated protocol is at this point a historical artifact; there is no need to retain support for this protocol today. Reviewed by: philip, markj, allanjude Relnotes: Yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D24790 Deleted: head/lib/libalias/modules/cuseeme/ head/sys/modules/libalias/modules/cuseeme/ head/sys/netinet/libalias/alias_cuseeme.c Modified: head/ObsoleteFiles.inc head/lib/libalias/libalias/libalias.conf head/sys/modules/libalias/modules/modules.inc head/sys/netinet/libalias/libalias.3 head/targets/pseudo/userland/lib/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Sat May 16 01:56:06 2020 (r361098) +++ head/ObsoleteFiles.inc Sat May 16 02:29:10 2020 (r361099) @@ -36,6 +36,11 @@ # xargs -n1 | sort | uniq -d; # done +# 20200515: libalias cuseeme protocol support retired +OLD_LIBS+=lib/libalias_cuseeme.so +OLD_FILES+=usr/lib/libalias_cuseeme.a +OLD_FILES+=usr/lib/libalias_cuseeme_p.a + # 20200511: Remove ubsec(4) OLD_FILES+=usr/share/man/man4/ubsec.4.gz Modified: head/lib/libalias/libalias/libalias.conf ============================================================================== --- head/lib/libalias/libalias/libalias.conf Sat May 16 01:56:06 2020 (r361098) +++ head/lib/libalias/libalias/libalias.conf Sat May 16 02:29:10 2020 (r361099) @@ -1,5 +1,4 @@ # $FreeBSD$ -/lib/libalias_cuseeme.so /lib/libalias_ftp.so /lib/libalias_irc.so /lib/libalias_nbt.so Modified: head/sys/modules/libalias/modules/modules.inc ============================================================================== --- head/sys/modules/libalias/modules/modules.inc Sat May 16 01:56:06 2020 (r361098) +++ head/sys/modules/libalias/modules/modules.inc Sat May 16 02:29:10 2020 (r361099) @@ -1,7 +1,6 @@ # $FreeBSD$ MODULES = -MODULES += cuseeme MODULES += dummy MODULES += ftp MODULES += irc Modified: head/sys/netinet/libalias/libalias.3 ============================================================================== --- head/sys/netinet/libalias/libalias.3 Sat May 16 01:56:06 2020 (r361098) +++ head/sys/netinet/libalias/libalias.3 Sat May 16 02:29:10 2020 (r361099) @@ -1051,7 +1051,6 @@ There is a configuration file, .Pa /etc/libalias.conf , with the following contents (by default): .Bd -literal -offset indent -/usr/lib/libalias_cuseeme.so /usr/lib/libalias_ftp.so /usr/lib/libalias_irc.so /usr/lib/libalias_nbt.so Modified: head/targets/pseudo/userland/lib/Makefile.depend ============================================================================== --- head/targets/pseudo/userland/lib/Makefile.depend Sat May 16 01:56:06 2020 (r361098) +++ head/targets/pseudo/userland/lib/Makefile.depend Sat May 16 02:29:10 2020 (r361099) @@ -26,7 +26,6 @@ DIRDEPS = \ lib/geom/virstor \ lib/lib80211 \ lib/libalias/libalias \ - lib/libalias/modules/cuseeme \ lib/libalias/modules/dummy \ lib/libalias/modules/ftp \ lib/libalias/modules/irc \ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 16 01:56:06 2020 (r361098) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat May 16 02:29:10 2020 (r361099) @@ -7531,7 +7531,6 @@ OLD_FILES+=usr/share/man/man8/pppctl.8.gz .if ${MK_PROFILE} == no OLD_FILES+=usr/lib/lib80211_p.a OLD_FILES+=usr/lib/libBlocksRuntime_p.a -OLD_FILES+=usr/lib/libalias_cuseeme_p.a OLD_FILES+=usr/lib/libalias_dummy_p.a OLD_FILES+=usr/lib/libalias_ftp_p.a OLD_FILES+=usr/lib/libalias_irc_p.a From owner-svn-src-all@freebsd.org Sat May 16 03:33:29 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6713D2E3021; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49P9px29sLz3LmK; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4601A767C; Sat, 16 May 2020 03:33:29 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G3XT3P037709; Sat, 16 May 2020 03:33:29 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3XTht037708; Sat, 16 May 2020 03:33:29 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005160333.04G3XTht037708@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 16 May 2020 03:33:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361102 - head/sys/powerpc/conf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/conf X-SVN-Commit-Revision: 361102 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:33:29 -0000 Author: jhibbits Date: Sat May 16 03:33:28 2020 New Revision: 361102 URL: https://svnweb.freebsd.org/changeset/base/361102 Log: powerpc/qoriq: Add more devices to config for desktop usage The most likely users of the QORIQ64 config nowadays are users of AmigaOne X5000 systems, which are desktops. They need a framebuffer and keyboard/mouse, so add these to the config so it works by default once drm-current-kmod is installed. Modified: head/sys/powerpc/conf/QORIQ64 Modified: head/sys/powerpc/conf/QORIQ64 ============================================================================== --- head/sys/powerpc/conf/QORIQ64 Sat May 16 02:43:27 2020 (r361101) +++ head/sys/powerpc/conf/QORIQ64 Sat May 16 03:33:28 2020 (r361102) @@ -113,3 +113,10 @@ device ehci device umass device usb device vlan + +# Desktop related +device vt +device fbd +options KBD_INSTALL_CDEV +device ukbd +device ums From owner-svn-src-all@freebsd.org Sat May 16 03:45:16 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 96B672E34EE; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@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 49PB4X3XhXz3MJb; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 74D207875; Sat, 16 May 2020 03:45:16 +0000 (UTC) (envelope-from csjp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G3jGX0044103; Sat, 16 May 2020 03:45:16 GMT (envelope-from csjp@FreeBSD.org) Received: (from csjp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3jGgj044101; Sat, 16 May 2020 03:45:16 GMT (envelope-from csjp@FreeBSD.org) Message-Id: <202005160345.04G3jGgj044101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: csjp set sender to csjp@FreeBSD.org using -f From: "Christian S.J. Peron" Date: Sat, 16 May 2020 03:45:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361103 - in head/sys: kern security/audit X-SVN-Group: head X-SVN-Commit-Author: csjp X-SVN-Commit-Paths: in head/sys: kern security/audit X-SVN-Commit-Revision: 361103 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:45:16 -0000 Author: csjp Date: Sat May 16 03:45:15 2020 New Revision: 361103 URL: https://svnweb.freebsd.org/changeset/base/361103 Log: Add BSM record conversion for a number of syscalls: - thr_kill(2) and thr_exit(2) generally (no argument auditing here. - A set of syscalls for the process descriptor family, specifically: pdfork(2), pdgetpid(2) and pdkill(2) For these syscalls, audit the file descriptor. In the case of pdfork(2) a pointer to an integer (file descriptor) is passed in as an argument. We audit the post initialized file descriptor (not the random garbage that would have been passed in). We will also audit the child process which was created from the fork operation (similar to what is done for the fork(2) syscall). pdkill(2) we audit the signal value and fd, and finally pdgetpid(2) just the file descriptor: - Following is a sample of the produced audit trails: header,111,11,pdfork(2),0,Sat May 16 03:07:50 2020, + 394 msec argument,0,0x39d,child PID argument,2,0x2,flags argument,1,0x8,fd subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,925 header,79,11,pdgetpid(2),0,Sat May 16 03:07:50 2020, + 394 msec argument,1,0x8,fd subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,0 trailer,79 header,135,11,pdkill(2),0,Sat May 16 03:07:50 2020, + 395 msec argument,1,0x8,fd argument,2,0xf,signal process_ex,root,root,0,root,0,925,0,0,0.0.0.0 subject,root,root,0,root,0,924,0,0,0.0.0.0 return,success,0 trailer,135 MFC after: 1 week Modified: head/sys/kern/kern_fork.c head/sys/security/audit/audit_bsm.c Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Sat May 16 03:33:28 2020 (r361102) +++ head/sys/kern/kern_fork.c Sat May 16 03:45:15 2020 (r361103) @@ -128,6 +128,7 @@ sys_pdfork(struct thread *td, struct pdfork_args *uap) fr.fr_pidp = &pid; fr.fr_pd_fd = &fd; fr.fr_pd_flags = uap->flags; + AUDIT_ARG_FFLAGS(uap->flags); /* * It is necessary to return fd by reference because 0 is a valid file * descriptor number, and the child needs to be able to distinguish @@ -909,6 +910,7 @@ fork1(struct thread *td, struct fork_req *fr) fr->fr_pd_flags, fr->fr_pd_fcaps); if (error != 0) goto fail2; + AUDIT_ARG_FD(*fr->fr_pd_fd); } mem_charged = 0; Modified: head/sys/security/audit/audit_bsm.c ============================================================================== --- head/sys/security/audit/audit_bsm.c Sat May 16 03:33:28 2020 (r361102) +++ head/sys/security/audit/audit_bsm.c Sat May 16 03:45:15 2020 (r361103) @@ -1317,6 +1317,38 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec UPATH1_VNODE1_TOKENS; break; + case AUE_PDKILL: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_SIGNUM)) { + tok = au_to_arg32(2, "signal", ar->ar_arg_signum); + kau_write(rec, tok); + } + PROCESS_PID_TOKENS(1); + break; + case AUE_PDFORK: + if (ARG_IS_VALID(kar, ARG_PID)) { + tok = au_to_arg32(0, "child PID", ar->ar_arg_pid); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_FFLAGS)) { + tok = au_to_arg32(2, "flags", ar->ar_arg_fflags); + kau_write(rec, tok); + } + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + break; + case AUE_PDGETPID: + if (ARG_IS_VALID(kar, ARG_FD)) { + tok = au_to_arg32(1, "fd", ar->ar_arg_fd); + kau_write(rec, tok); + } + break; + case AUE_PROCCTL: if (ARG_IS_VALID(kar, ARG_VALUE)) { tok = au_to_arg32(1, "idtype", ar->ar_arg_value); @@ -1747,6 +1779,8 @@ kaudit_to_bsm(struct kaudit_record *kar, struct au_rec break; case AUE_THR_NEW: + case AUE_THR_KILL: + case AUE_THR_EXIT: break; case AUE_NULL: From owner-svn-src-all@freebsd.org Sat May 16 03:52:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9E70E2E381B; Sat, 16 May 2020 03:52:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PBDt3nYrz3Mkt; Sat, 16 May 2020 03:52:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BE3C7A50; Sat, 16 May 2020 03:52:30 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G3qUtL050083; Sat, 16 May 2020 03:52:30 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G3qUSx050082; Sat, 16 May 2020 03:52:30 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <202005160352.04G3qUSx050082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 16 May 2020 03:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361104 - head/contrib/elftoolchain/libelf X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/contrib/elftoolchain/libelf X-SVN-Commit-Revision: 361104 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 03:52:30 -0000 Author: jhibbits Date: Sat May 16 03:52:30 2020 New Revision: 361104 URL: https://svnweb.freebsd.org/changeset/base/361104 Log: elftoolchain: Add powerpc64 definition to elftoolchain config powerpc is already in place, but powerpc64 is needed separately. Modified: head/contrib/elftoolchain/libelf/_libelf_config.h Modified: head/contrib/elftoolchain/libelf/_libelf_config.h ============================================================================== --- head/contrib/elftoolchain/libelf/_libelf_config.h Sat May 16 03:45:15 2020 (r361103) +++ head/contrib/elftoolchain/libelf/_libelf_config.h Sat May 16 03:52:30 2020 (r361104) @@ -91,6 +91,12 @@ #endif #define LIBELF_CLASS ELFCLASS32 +#elif defined(__powerpc64__) + +#define LIBELF_ARCH EM_PPC64 +#define LIBELF_BYTEORDER ELFDATA2MSB +#define LIBELF_CLASS ELFCLASS64 + #elif defined(__powerpc__) #define LIBELF_ARCH EM_PPC From owner-svn-src-all@freebsd.org Sat May 16 04:52:30 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 84C782E5044; Sat, 16 May 2020 04:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PCZ62tbDz3Qpm; Sat, 16 May 2020 04:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5E50F8676; Sat, 16 May 2020 04:52:30 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G4qU1t088210; Sat, 16 May 2020 04:52:30 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G4qUoN088209; Sat, 16 May 2020 04:52:30 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005160452.04G4qUoN088209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 16 May 2020 04:52:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361105 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 361105 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 04:52:30 -0000 Author: kevans Date: Sat May 16 04:52:29 2020 New Revision: 361105 URL: https://svnweb.freebsd.org/changeset/base/361105 Log: procctl(2): correct a minor cut-n-pasto This is clearly describing PROC_PROTMAX_FORCE_DISABLE, rather than PROC_ASL_FORCE_DISABLE. Submitted by: sigsys@gmail.com Modified: head/lib/libc/sys/procctl.2 Modified: head/lib/libc/sys/procctl.2 ============================================================================== --- head/lib/libc/sys/procctl.2 Sat May 16 03:52:30 2020 (r361104) +++ head/lib/libc/sys/procctl.2 Sat May 16 04:52:29 2020 (r361105) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 25, 2020 +.Dd May 16, 2020 .Dt PROCCTL 2 .Os .Sh NAME @@ -128,7 +128,7 @@ Enables implicit PROT_MAX application, even if it is disabled system-wide by the sysctl .Va vm.imply_prot_max . The image flag might still prevent the enablement. -.It Dv PROC_ASLR_FORCE_DISABLE +.It Dv PROC_PROTMAX_FORCE_DISABLE Request that implicit application of PROT_MAX be disabled. Same notes as for .Dv PROC_PROTMAX_FORCE_ENABLE From owner-svn-src-all@freebsd.org Sat May 16 05:07:47 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1DFCC2E556D; Sat, 16 May 2020 05:07:47 +0000 (UTC) (envelope-from adrian@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 49PCvk6xx5z3wjX; Sat, 16 May 2020 05:07:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E9D31887E; Sat, 16 May 2020 05:07:46 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G57kic094404; Sat, 16 May 2020 05:07:46 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G57k31094400; Sat, 16 May 2020 05:07:46 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160507.04G57k31094400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 05:07:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361106 - in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: in head/sys/dev/ath: . ath_rate/amrr ath_rate/onoe ath_rate/sample X-SVN-Commit-Revision: 361106 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 05:07:47 -0000 Author: adrian Date: Sat May 16 05:07:45 2020 New Revision: 361106 URL: https://svnweb.freebsd.org/changeset/base/361106 Log: [ath_rate_sample] Limit the tx schedules for A-MPDU ; don't take short retries into account and remove the requirement that the MCS rate is "higher" if we're considering a new rate. Ok, another fun one. * In order for reliable non-software retried higher MCS rates, the TX schedules (inconsistently!) use hard-coded lower rates at the end of the schedule. Now, hard-coded is a problem because (a) it means that aggregate formation is limited by the SLOWEST rate, so I never formed large AMDU frames for 3 stream rates, and (b) if the AP disables lower rates as base rates, it complains about "unknown rix" every frame you transmit at that rate. So, for now just disable the third and fourth schedule entry for AMPDUs. Now I'm forming 32k and 64k aggregates for the higher density MCS rates much more reliably. It would be much nicer if the rate schedule stuff wasn't fixed but instead I'd just populate ath_rc_series[] when I fetch the rates. This is all a holdover of ye olde pre-11n stuff and I really just need to nuke it. But for now, ye hack. * The check for "is this MCS rate better" based on MCS itself is just garbage. It meant things like going MCS0->7 would be fine, and say 0->8->16 is fine, (as they're equivalent encoding but 1,2,3 spatial streams), BUT it meant going something like MCS7->11 would fail even though it's likely that MCS11 would just be better, both for EWMA/BER and throughput. So for now just use the average tx time. The "right" way for this comparison would be to compare PHY bitrates rather than MCS / rate indexes, but I'm not yet there. The bit rates ARE available in the PHY index, but honestly I have a lot of other cleaning up to here before I think about that. * Don't include the RTS/CTS retry count (and thus time) into the average tx time caluation. It just makes temporarily failures make the rate look bad by QUITE A LOT, as RTS/CTS exchanges are (a) long, and (b) mostly irrelevant to the actual rate being tried. If we keep hitting RTS/CTS failures then there's something ELSE wrong on the channel, not our selected rate. Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c head/sys/dev/ath/ath_rate/onoe/onoe.c head/sys/dev/ath/ath_rate/sample/sample.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athrate.h Modified: head/sys/dev/ath/ath_rate/amrr/amrr.c ============================================================================== --- head/sys/dev/ath/ath_rate/amrr/amrr.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/amrr/amrr.c Sat May 16 05:07:45 2020 (r361106) @@ -128,7 +128,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct amrr_node *amn = ATH_NODE_AMRR(an); Modified: head/sys/dev/ath/ath_rate/onoe/onoe.c ============================================================================== --- head/sys/dev/ath/ath_rate/onoe/onoe.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/onoe/onoe.c Sat May 16 05:07:45 2020 (r361106) @@ -136,7 +136,7 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct onoe_node *on = ATH_NODE_ONOE(an); Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 05:07:45 2020 (r361106) @@ -168,7 +168,7 @@ static int ath_rate_sample_max_4ms_framelen[4][32] = { */ static int ath_rate_sample_find_min_pktlength(struct ath_softc *sc, - struct ath_node *an, uint8_t rix0) + struct ath_node *an, uint8_t rix0, int is_aggr) { #define MCS_IDX(ix) (rt->info[ix].dot11Rate) const HAL_RATE_TABLE *rt = sc->sc_currates; @@ -196,6 +196,24 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *s * is not zero. * * Note: assuming all four PHYs are HT! + * + * XXX TODO: right now I hardcode here and in getxtxrates() that + * rates 2 and 3 in the tx schedule are ignored. This is important + * for forming larger aggregates because right now (a) the tx schedule + * per rate is fixed, and (b) reliable packet transmission at those + * higher rates kinda needs a lower MCS rate in there somewhere. + * However, this means we can only form shorter aggregates. + * If we've negotiated aggregation then we can actually just + * rely on software retransmit rather than having things fall + * back to like MCS0/1 in hardware, and rate control will hopefully + * do the right thing. + * + * Once the whole rate schedule is passed into ath_rate_findrate(), + * the ath_rc_series is populated ,the fixed tx schedule stuff + * is removed AND getxtxrates() is removed then we can remove this + * check as it can just NOT populate t2/t3. It also means + * probing can actually use rix0 for probeing and rix1 for the + * current best rate.. */ if (sched->t0 != 0) { max_pkt_length = MIN(max_pkt_length, @@ -205,11 +223,11 @@ ath_rate_sample_find_min_pktlength(struct ath_softc *s max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r1)]); } - if (sched->t2 != 0) { + if (sched->t2 != 0 && (! is_aggr)) { max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r2)]); } - if (sched->t3 != 0) { + if (sched->t3 != 0 && (! is_aggr)) { max_pkt_length = MIN(max_pkt_length, ath_rate_sample_max_4ms_framelen[idx][MCS_IDX(sched->r3)]); } @@ -691,7 +709,8 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod * need to potentially update our maximum packet length * and size_bin if we're doing 11n rates. */ - max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix); + max_pkt_len = ath_rate_sample_find_min_pktlength(sc, an, best_rix, + is_aggr); if (max_pkt_len > 0) { #if 0 device_printf(sc->sc_dev, @@ -769,9 +788,9 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod int cur_rix = sn->current_rix[size_bin]; int cur_att = sn->stats[size_bin][cur_rix].average_tx_time; /* - * If the node is HT, upgrade it if the MCS rate without - * the stream is higher and the average tx time is - * within 10% of the current rate. It can fail a little. + * If the node is HT, it if the rate isn't the + * same and the average tx time is within 10% + * of the current rate. It can fail a little. * * This is likely not optimal! */ @@ -780,7 +799,6 @@ ath_rate_findrate(struct ath_softc *sc, struct ath_nod MCS(cur_rix), cur_att, MCS(best_rix), average_tx_time); #endif if ((best_rix != cur_rix) && - ((MCS(best_rix) & 0x7) >= (MCS(cur_rix) & 0x7)) && (average_tx_time * 9) <= (cur_att * 10)) { IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -864,7 +882,7 @@ done: */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc) + uint8_t rix0, int is_aggr, struct ath_rc_series *rc) { struct sample_node *sn = ATH_NODE_SAMPLE(an); const struct txschedule *sched = &sn->sched[rix0]; @@ -881,8 +899,13 @@ ath_rate_getxtxrates(struct ath_softc *sc, struct ath_ rc[0].tries = sched->t0; rc[1].tries = sched->t1; - rc[2].tries = sched->t2; - rc[3].tries = sched->t3; + + if (is_aggr) { + rc[2].tries = rc[3].tries = 0; + } else { + rc[2].tries = sched->t2; + rc[3].tries = sched->t3; + } } void @@ -940,8 +963,14 @@ update_stats(struct ath_softc *sc, struct ath_node *an if (status != 0) nbad = nframes; - tt = calc_usecs_unicast_packet(sc, size, rix0, short_tries, - MIN(tries0, tries) - 1, is_ht40); + /* + * Ignore short tries count as contributing to failure. + * Right now there's no way to know if it's part of any + * given rate attempt, and outside of the RTS/CTS management + * rate, it doesn't /really/ help. + */ + tt = calc_usecs_unicast_packet(sc, size, rix0, + 0 /* short_tries */, MIN(tries0, tries) - 1, is_ht40); tries_so_far = tries0; if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/if_ath_tx.c Sat May 16 05:07:45 2020 (r361106) @@ -1401,7 +1401,7 @@ ath_tx_do_ratelookup(struct ath_softc *sc, struct ath_ if (bf->bf_state.bfs_ismrr && try0 != ATH_TXMAXTRY) ath_rate_getxtxrates(sc, ATH_NODE(bf->bf_node), rix, - bf->bf_state.bfs_rc); + is_aggr, bf->bf_state.bfs_rc); ATH_NODE_UNLOCK(ATH_NODE(bf->bf_node)); sc->sc_txrix = rix; /* for LED blinking */ Modified: head/sys/dev/ath/if_athrate.h ============================================================================== --- head/sys/dev/ath/if_athrate.h Sat May 16 04:52:29 2020 (r361105) +++ head/sys/dev/ath/if_athrate.h Sat May 16 05:07:45 2020 (r361106) @@ -125,7 +125,7 @@ void ath_rate_newassoc(struct ath_softc *, struct ath_ * Return the four TX rate index and try counts for the current data packet. */ void ath_rate_getxtxrates(struct ath_softc *sc, struct ath_node *an, - uint8_t rix0, struct ath_rc_series *rc); + uint8_t rix0, int is_aggr, struct ath_rc_series *rc); /* * Return the transmit info for a data packet. If multi-rate state From owner-svn-src-all@freebsd.org Sat May 16 06:09:25 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E1402E6C72; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@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 49PFGs1sJVz40Ht; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 3B2D29421; Sat, 16 May 2020 06:09:25 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G69P6r033044; Sat, 16 May 2020 06:09:25 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G69PIW033043; Sat, 16 May 2020 06:09:25 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005160609.04G69PIW033043@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 06:09:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361107 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361107 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 06:09:25 -0000 Author: adrian Date: Sat May 16 06:09:24 2020 New Revision: 361107 URL: https://svnweb.freebsd.org/changeset/base/361107 Log: [ath] ok ok, fix the indenting now that I have 5 column packet sizes. Now things line up nicely again. There's a lot of them, and I don't have a long enough screen right now, but they at least line up right. Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Sat May 16 05:07:45 2020 (r361106) +++ head/tools/tools/ath/athratestats/main.c Sat May 16 06:09:24 2020 (r361107) @@ -146,7 +146,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r sn->sample_tt[y]); PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); } - PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" + PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) @@ -164,7 +164,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r else if (sn->stats[y][rix].ewma_pct / 10 < 75) PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #endif - PRINTMSG("[%2u %s:%4u] %8ju:%-8ju " + PRINTMSG("[%2u %s:%5u] %8ju:%-8ju " "(%3d.%1d%%) %8ju/%4d %5uuS %u\n", dot11rate(rt, rix), dot11str(rt, rix), From owner-svn-src-all@freebsd.org Sat May 16 09:03:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 944BE2EAB8B; Sat, 16 May 2020 09:03:18 +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 49PK7V3Pk0z48HZ; Sat, 16 May 2020 09:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7004CB5E4; Sat, 16 May 2020 09:03:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G93In6043535; Sat, 16 May 2020 09:03:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G93Ixu043534; Sat, 16 May 2020 09:03:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005160903.04G93Ixu043534@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 May 2020 09: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: r361108 - stable/12/sys/kern X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/kern X-SVN-Commit-Revision: 361108 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 09:03:18 -0000 Author: kib Date: Sat May 16 09:03:18 2020 New Revision: 361108 URL: https://svnweb.freebsd.org/changeset/base/361108 Log: MFC r360845: Avoid spurious ENOMEMs from sysctl hw.pagesizes. PR: 246215 Modified: stable/12/sys/kern/kern_mib.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/kern/kern_mib.c ============================================================================== --- stable/12/sys/kern/kern_mib.c Sat May 16 06:09:24 2020 (r361107) +++ stable/12/sys/kern/kern_mib.c Sat May 16 09:03:18 2020 (r361108) @@ -233,6 +233,7 @@ static int sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) { int error; + size_t len; #ifdef SCTL_MASK32 int i; uint32_t pagesizes32[MAXPAGESIZES]; @@ -245,10 +246,18 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + len = sizeof(pagesizes32); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes32, len); } else #endif - error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + { + len = sizeof(pagesizes); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes, len); + } return (error); } SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, From owner-svn-src-all@freebsd.org Sat May 16 09:40:18 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 83BF22EB8AB; Sat, 16 May 2020 09:40:18 +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 49PKyB2vzBz4BMH; Sat, 16 May 2020 09:40:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F323BD48; Sat, 16 May 2020 09:40:18 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04G9eIj3063427; Sat, 16 May 2020 09:40:18 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04G9eIkf063426; Sat, 16 May 2020 09:40:18 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005160940.04G9eIkf063426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 16 May 2020 09:40:18 +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: r361109 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 361109 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 09:40:18 -0000 Author: kib Date: Sat May 16 09:40:17 2020 New Revision: 361109 URL: https://svnweb.freebsd.org/changeset/base/361109 Log: MFC r360845: Avoid spurious ENOMEMs from sysctl hw.pagesizes. PR: 246215 Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Sat May 16 09:03:18 2020 (r361108) +++ stable/11/sys/kern/kern_mib.c Sat May 16 09:40:17 2020 (r361109) @@ -228,6 +228,7 @@ static int sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) { int error; + size_t len; #ifdef SCTL_MASK32 int i; uint32_t pagesizes32[MAXPAGESIZES]; @@ -240,10 +241,18 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; - error = SYSCTL_OUT(req, pagesizes32, sizeof(pagesizes32)); + len = sizeof(pagesizes32); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes32, len); } else #endif - error = SYSCTL_OUT(req, pagesizes, sizeof(pagesizes)); + { + len = sizeof(pagesizes); + if (len > req->oldlen) + len = req->oldlen; + error = SYSCTL_OUT(req, pagesizes, len); + } return (error); } SYSCTL_PROC(_hw, OID_AUTO, pagesizes, CTLTYPE_ULONG | CTLFLAG_RD, From owner-svn-src-all@freebsd.org Sat May 16 14:27:51 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3D4F42F3E47; Sat, 16 May 2020 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PSKz0dP6z4YyB; Sat, 16 May 2020 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0BF2CF49F; Sat, 16 May 2020 14:27:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GERo0c051746; Sat, 16 May 2020 14:27:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GERoM1051745; Sat, 16 May 2020 14:27:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005161427.04GERoM1051745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 16 May 2020 14:27:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361110 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: head/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361110 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 14:27:51 -0000 Author: hselasky Date: Sat May 16 14:27:50 2020 New Revision: 361110 URL: https://svnweb.freebsd.org/changeset/base/361110 Log: Implement synchronize_srcu_expedited() in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24798 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/compat/linuxkpi/common/include/linux/srcu.h Modified: head/sys/compat/linuxkpi/common/include/linux/srcu.h ============================================================================== --- head/sys/compat/linuxkpi/common/include/linux/srcu.h Sat May 16 09:40:17 2020 (r361109) +++ head/sys/compat/linuxkpi/common/include/linux/srcu.h Sat May 16 14:27:50 2020 (r361110) @@ -49,4 +49,8 @@ extern void srcu_barrier(struct srcu_struct *); extern int init_srcu_struct(struct srcu_struct *); extern void cleanup_srcu_struct(struct srcu_struct *); +#define synchronize_srcu_expedited(srcu) do { \ + synchronize_srcu(srcu); \ +} while (0) + #endif /* _LINUX_SRCU_H_ */ From owner-svn-src-all@freebsd.org Sat May 16 14:33:10 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 970FE2F4027; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PSS63Vs0z4ZL0; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 73993F66B; Sat, 16 May 2020 14:33:10 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GEXAdQ057418; Sat, 16 May 2020 14:33:10 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GEX9dU057412; Sat, 16 May 2020 14:33:09 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202005161433.04GEX9dU057412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 16 May 2020 14:33:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361111 - in head/sys/cam: . ata mmc nvme scsi X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head/sys/cam: . ata mmc nvme scsi X-SVN-Commit-Revision: 361111 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 14:33:10 -0000 Author: cem Date: Sat May 16 14:33:08 2020 New Revision: 361111 URL: https://svnweb.freebsd.org/changeset/base/361111 Log: cam: ANSIfy 0-argument function definitions No functional change. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D24854 Modified: head/sys/cam/ata/ata_xpt.c head/sys/cam/cam_xpt.c head/sys/cam/mmc/mmc_xpt.c head/sys/cam/nvme/nvme_xpt.c head/sys/cam/scsi/scsi_targ_bh.c head/sys/cam/scsi/scsi_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/ata/ata_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -270,7 +270,7 @@ CAM_XPT_PROTO(ata_proto_satapm); CAM_XPT_PROTO(ata_proto_semb); static void -aprobe_periph_init() +aprobe_periph_init(void) { } Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/cam_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -354,7 +354,7 @@ device_is_queued(struct cam_ed *device) } static void -xpt_periph_init() +xpt_periph_init(void) { make_dev(&xpt_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "xpt0"); } @@ -4669,7 +4669,7 @@ xpt_done_direct(union ccb *done_ccb) } union ccb * -xpt_alloc_ccb() +xpt_alloc_ccb(void) { union ccb *new_ccb; @@ -4678,7 +4678,7 @@ xpt_alloc_ccb() } union ccb * -xpt_alloc_ccb_nowait() +xpt_alloc_ccb_nowait(void) { union ccb *new_ccb; Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/mmc/mmc_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -467,7 +467,7 @@ PERIPHDRIVER_DECLARE(mmcprobe, probe_driver); #define CARD_ID_FREQUENCY 400000 /* Spec requires 400kHz max during ID phase. */ static void -probe_periph_init() +probe_periph_init(void) { } Modified: head/sys/cam/nvme/nvme_xpt.c ============================================================================== --- head/sys/cam/nvme/nvme_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/nvme/nvme_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -192,9 +192,8 @@ static struct xpt_proto nvme_proto = { CAM_XPT_PROTO(nvme_proto); static void -nvme_probe_periph_init() +nvme_probe_periph_init(void) { - } static cam_status Modified: head/sys/cam/scsi/scsi_targ_bh.c ============================================================================== --- head/sys/cam/scsi/scsi_targ_bh.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/scsi/scsi_targ_bh.c Sat May 16 14:33:08 2020 (r361111) @@ -737,7 +737,7 @@ targbherror(union ccb *ccb, u_int32_t cam_flags, u_int #endif static struct targbh_cmd_desc* -targbhallocdescr() +targbhallocdescr(void) { struct targbh_cmd_desc* descr; Modified: head/sys/cam/scsi/scsi_xpt.c ============================================================================== --- head/sys/cam/scsi/scsi_xpt.c Sat May 16 14:27:50 2020 (r361110) +++ head/sys/cam/scsi/scsi_xpt.c Sat May 16 14:33:08 2020 (r361111) @@ -649,7 +649,7 @@ static struct xpt_proto scsi_proto = { CAM_XPT_PROTO(scsi_proto); static void -probe_periph_init() +probe_periph_init(void) { } From owner-svn-src-all@freebsd.org Sat May 16 16:29:24 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 483B32F68E9; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PW2D19T4z3DCs; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0AC9A18B38; Sat, 16 May 2020 16:29:24 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GGTNME029037; Sat, 16 May 2020 16:29:23 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GGTN3r029034; Sat, 16 May 2020 16:29:23 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005161629.04GGTN3r029034@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 16 May 2020 16:29:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361112 - in head/bin/sh: . tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: in head/bin/sh: . tests/execution X-SVN-Commit-Revision: 361112 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 16:29:24 -0000 Author: jilles Date: Sat May 16 16:29:23 2020 New Revision: 361112 URL: https://svnweb.freebsd.org/changeset/base/361112 Log: sh: Fix double INTON with vfork The shell maintains a count of the number of times SIGINT processing has been disabled via INTOFF, so SIGINT processing resumes when all disables have enabled again (INTON). If an error occurs in a vfork() child, the processing of the error enables SIGINT processing again, and the INTON in vforkexecshell() causes the count to become negative. As a result, a later INTOFF may not actually disable SIGINT processing. This might cause memory corruption if a SIGINT arrives at an inopportune time. As of r360452, it causes the shell to abort when it would unsafely allocate or free memory in certain ways. Note that various places such as errors in non-special builtins unconditionally reset the count to 0, so the problem might still not always be visible. PR: 246497 Reported by: jbeich MFC after: 2 weeks Added: head/bin/sh/tests/execution/unknown2.0 (contents, props changed) Modified: head/bin/sh/jobs.c head/bin/sh/tests/execution/Makefile Modified: head/bin/sh/jobs.c ============================================================================== --- head/bin/sh/jobs.c Sat May 16 14:33:08 2020 (r361111) +++ head/bin/sh/jobs.c Sat May 16 16:29:23 2020 (r361112) @@ -1008,9 +1008,11 @@ vforkexecshell(struct job *jp, char **argv, char **env pid_t pid; struct jmploc jmploc; struct jmploc *savehandler; + int inton; TRACE(("vforkexecshell(%%%td, %s, %p) called\n", jp - jobtab, argv[0], (void *)pip)); + inton = is_int_on(); INTOFF; flushall(); savehandler = handler; @@ -1045,7 +1047,7 @@ vforkexecshell(struct job *jp, char **argv, char **env setcurjob(jp); #endif } - INTON; + SETINTON(inton); TRACE(("In parent shell: child = %d\n", (int)pid)); return pid; } Modified: head/bin/sh/tests/execution/Makefile ============================================================================== --- head/bin/sh/tests/execution/Makefile Sat May 16 14:33:08 2020 (r361111) +++ head/bin/sh/tests/execution/Makefile Sat May 16 16:29:23 2020 (r361112) @@ -64,6 +64,7 @@ ${PACKAGE}FILES+= subshell2.0 ${PACKAGE}FILES+= subshell3.0 ${PACKAGE}FILES+= subshell4.0 ${PACKAGE}FILES+= unknown1.0 +${PACKAGE}FILES+= unknown2.0 ${PACKAGE}FILES+= var-assign1.0 .include Added: head/bin/sh/tests/execution/unknown2.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/bin/sh/tests/execution/unknown2.0 Sat May 16 16:29:23 2020 (r361112) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +{ + : $(/var/empty/nosuchtool) + : $(:) +} 2>/dev/null From owner-svn-src-all@freebsd.org Sat May 16 17:05:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 98EF92F7500; Sat, 16 May 2020 17:05:44 +0000 (UTC) (envelope-from kaktus@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 49PWr83ZsGz3G21; Sat, 16 May 2020 17:05:44 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 73A46192B1; Sat, 16 May 2020 17:05:44 +0000 (UTC) (envelope-from kaktus@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GH5iP4053310; Sat, 16 May 2020 17:05:44 GMT (envelope-from kaktus@FreeBSD.org) Received: (from kaktus@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GH5iWE053309; Sat, 16 May 2020 17:05:44 GMT (envelope-from kaktus@FreeBSD.org) Message-Id: <202005161705.04GH5iWE053309@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kaktus set sender to kaktus@FreeBSD.org using -f From: Pawel Biernacki Date: Sat, 16 May 2020 17:05:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361113 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: kaktus X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 361113 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 17:05:44 -0000 Author: kaktus Date: Sat May 16 17:05:44 2020 New Revision: 361113 URL: https://svnweb.freebsd.org/changeset/base/361113 Log: sysctl: fix setting net.isr.dispatch during early boot Fix another collateral damage of r357614: netisr is initialised way before malloc() is available hence it can't use sysctl_handle_string() that allocates temporary buffer. Handle that internally in sysctl_netisr_dispatch_policy(). PR: 246114 Reported by: delphij Reviewed by: kib Approved by: kib (mentor) Differential Revision: https://reviews.freebsd.org/D24858 Modified: head/sys/net/netisr.c Modified: head/sys/net/netisr.c ============================================================================== --- head/sys/net/netisr.c Sat May 16 16:29:23 2020 (r361112) +++ head/sys/net/netisr.c Sat May 16 17:05:44 2020 (r361113) @@ -345,19 +345,34 @@ static int sysctl_netisr_dispatch_policy(SYSCTL_HANDLER_ARGS) { char tmp[NETISR_DISPATCH_POLICY_MAXSTR]; + size_t len; u_int dispatch_policy; int error; netisr_dispatch_policy_to_str(netisr_dispatch_policy, tmp, sizeof(tmp)); - error = sysctl_handle_string(oidp, tmp, sizeof(tmp), req); - if (error == 0 && req->newptr != NULL) { - error = netisr_dispatch_policy_from_str(tmp, - &dispatch_policy); - if (error == 0 && dispatch_policy == NETISR_DISPATCH_DEFAULT) - error = EINVAL; - if (error == 0) - netisr_dispatch_policy = dispatch_policy; + /* + * netisr is initialised very early during the boot when malloc isn't + * available yet so we can't use sysctl_handle_string() to process + * any non-default value that was potentially set via loader. + */ + if (req->newptr != NULL) { + len = req->newlen - req->newidx; + if (len >= NETISR_DISPATCH_POLICY_MAXSTR) + return (EINVAL); + error = SYSCTL_IN(req, tmp, len); + if (error == 0) { + tmp[len] = '\0'; + error = netisr_dispatch_policy_from_str(tmp, + &dispatch_policy); + if (error == 0 && + dispatch_policy == NETISR_DISPATCH_DEFAULT) + error = EINVAL; + if (error == 0) + netisr_dispatch_policy = dispatch_policy; + } + } else { + error = sysctl_handle_string(oidp, tmp, sizeof(tmp), req); } return (error); } From owner-svn-src-all@freebsd.org Sat May 16 18:37:49 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 42A332F9C34; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@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 49PYtP14Nnz3Mh2; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 1FFBB1A441; Sat, 16 May 2020 18:37:49 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GIbn5w010122; Sat, 16 May 2020 18:37:49 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GIbnC6010121; Sat, 16 May 2020 18:37:49 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <202005161837.04GIbnC6010121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Sat, 16 May 2020 18:37:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361114 - head/libexec/rc/rc.d X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/libexec/rc/rc.d X-SVN-Commit-Revision: 361114 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:37:49 -0000 Author: cperciva Date: Sat May 16 18:37:48 2020 New Revision: 361114 URL: https://svnweb.freebsd.org/changeset/base/361114 Log: Move the devmatch rc.d script before netif in the boot process. Prior to this change, using lagg to aggregate wired and wireless networks was broken in the (relatively common) case where wifi drivers + firmware are loaded by devmatch, since the interface didn't exist at the time when the lagg interface was being created. Suggested by: imp MFC after: 3 days Modified: head/libexec/rc/rc.d/devmatch Modified: head/libexec/rc/rc.d/devmatch ============================================================================== --- head/libexec/rc/rc.d/devmatch Sat May 16 17:05:44 2020 (r361113) +++ head/libexec/rc/rc.d/devmatch Sat May 16 18:37:48 2020 (r361114) @@ -27,6 +27,7 @@ # # PROVIDE: devmatch # REQUIRE: kldxref +# BEFORE: netif # KEYWORD: nojail . /etc/rc.subr From owner-svn-src-all@freebsd.org Sat May 16 18:38:57 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A3AFE2F9CA5 for ; Sat, 16 May 2020 18:38:57 +0000 (UTC) (envelope-from 010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com) Received: from a8-13.smtp-out.amazonses.com (a8-13.smtp-out.amazonses.com [54.240.8.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49PYvh4kF1z3Mpt for ; Sat, 16 May 2020 18:38:56 +0000 (UTC) (envelope-from 010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn; d=tarsnap.com; t=1589654335; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=pPCQ0SDr5WyCBwNg5Sl97BhytqFTdZm8+TJgpUnR0iM=; b=hDXhICEvHDZUt6Kt6rESIYZQYluUATpTAJlOhIX3mUYKxvF0aUiPz/nzIIc8kP3h YcKE+lRSrlOLIQrKKky6zs8lmYLB6XX2fDpMTTj3+ajZtL0BiZzwWaO5qlu/WZXUIh3 5kUqjV4r+D+9YaY88YIlb1npxmU+b7GU/qXFxE4M= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1589654335; h=Subject:To:References:From:Message-ID:Date:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:Feedback-ID; bh=pPCQ0SDr5WyCBwNg5Sl97BhytqFTdZm8+TJgpUnR0iM=; b=HZoe/FHr+wdGHMMetahV046PFCYHBiDSnqejKv6cIZ/HRxYjdcd8YxL8e+jG6+i/ avZj0MucduQr0Q214XHe5TwmnFFxDMfQ1Yn70K9zFiqkxAesip/MDK1Ro/ur6qbxdLG 5pCjd0SWngFgL2H62TCrDLOIjB3xVJbGOJiSmxgA= Subject: Re: svn commit: r361114 - head/libexec/rc/rc.d To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202005161837.04GIbnC6010121@repo.freebsd.org> From: Colin Percival Autocrypt: addr=cperciva@tarsnap.com; prefer-encrypt=mutual; keydata= mQGhBElrAAcRBACDfDys4ZtK+ErCJ1HAzYeteKpm3OEsvT/49AjUTLihkF79HhIKrCQU+1KC zv7BwHCMLb6hq30As9L7iFKG7n5QFLFC4Te/VcITUnWHMG/c3ViLOfJGvi+9/nOEHaM1dVJY D6tEp5yM1nHmVQpo9932j4KGuGFR0LhOK5IHXOSfGwCgxSFDPdgxe2OEjWxjGgY+oV3EafcD +JROXCTjlcQiG/OguQH4Vks3mhHfFnEppLxTkDuYgHZQiUtpcT9ssH5khgqoTyMar05OUdAj ZIhNbWDh4LgTj+7ZmvLhXT5Zxw8LX9d7T36aTB8XDQSenDqEtinMWOb0TCBBLbsB8EFG1WTT ESbZci9jJS5yhtktuZoY/eM8uXMD/3k4FWFO80VRRkELSp+XSy/VlSQjyi/rhl2nQq/oOA9F oJbDaB0yq9VNhxP+uFBzBWSqeIX0t1ZWLtNfVFr4TRP5hihI5ICrg/0OpqgisKsU2NFe9xyO hyJLYmfD8ebpDJ/9k30C7Iju9pVrwLm1QgS4S2fqJRcR+U4WbjvP7CgStCVDb2xpbiBQZXJj aXZhbCA8Y3BlcmNpdmFAdGFyc25hcC5jb20+iGEEExECACEFAklrALYCGwMHCwkIBwMCAQQV AggDBBYCAwECHgECF4AACgkQOM7KaQxqam6/igCgn+z2k3V5ggNppmWrZstt1U2lugsAoL7L wS9V9yLtil3oWmHtwpUqYruEuQINBElrAAcQCAD3ZLMIsP4CIDoJORg+YY0lqLVBgcnF7pFb 4Uy2+KvdWofN+DKH61rZLjgXXkNE9M4EQC1B4lGttBP8IY2gs41y3AUogGdyFbidq99rCBz7 LTsgARHwFxZoaHmXyiZLEU1QZuMqwPZV1mCviRhN5E3rRqYNXVcrnXAAuhBpvNyj/ntHvcDN 2/m+ochiuBYueU4kX3lHya7sOj+mTsndcWmQ9soOUyr8O0r/BG088bMn4qqtUw4dl5/pglXk jbl7uOOPinKf0WVd2r6M0wLPJCD4NPHrCWRLLLAjwfjrtoSRvXxDbXhCdgGBa72+K8eYLzVs hgq7tJOoBWzjVK6XRxR7AAMGB/9Mo3iJ2DxqDecd02KCB5BsFDICbJGhPltU7FwrtbC7djSb XUrwsEVLHi4st4cbdGNCWCrp0BRezXZKohKnNAPFOTK++ZfgeKxrV2sJod+Q9RILF86tQ4XF 7A7Yme5hy92t/WgiU4vc/fWbgP8gV/19f8nunaT2E9NSa70mZFjZNu4iuwThoUUO5CV3Wo0Y UISsnRK8XD1+LR3A2qVyLiFRwh/miC1hgLFCTGCQ3GLxZeZzIpYSlGdQJ0L5lixW5ZQD9r1I 8i/8zhE6qRFAM0upUMI3Gt1Oq2w03DiXrZU0Fu/R8Rm8rlnkQKA+95mRTUq1xL5P5NZIi4gJ Z569OPMFiEkEGBECAAkFAklrAAcCGwwACgkQOM7KaQxqam41igCfbaldnFTu5uAdrnrghESv EI3CAo8AoLkNMks1pThl2BJNRm4CtTK9xZeH Message-ID: <010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@email.amazonses.com> Date: Sat, 16 May 2020 18:38:55 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 In-Reply-To: <202005161837.04GIbnC6010121@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SES-Outgoing: 2020.05.16-54.240.8.13 Feedback-ID: 1.us-east-1.Lv9FVjaNvvR5llaqfLoOVbo2VxOELl7cjN0AOyXnPlk=:AmazonSES X-Rspamd-Queue-Id: 49PYvh4kF1z3Mpt X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=pass header.d=tarsnap.com header.s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn header.b=hDXhICEv; dkim=pass header.d=amazonses.com header.s=224i4yxa5dv7c2xz3womw6peuasteono header.b=HZoe/FHr; dmarc=none; spf=pass (mx1.freebsd.org: domain of 010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com designates 54.240.8.13 as permitted sender) smtp.mailfrom=010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com X-Spamd-Result: default: False [-1.62 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[tarsnap.com:s=ae7m2yrxjw65l2cqdpjxuucyrvy564tn,amazonses.com:s=224i4yxa5dv7c2xz3womw6peuasteono]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:54.240.0.0/18:c]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DMARC_NA(0.00)[tarsnap.com]; RWL_MAILSPIKE_GOOD(0.00)[13.8.240.54.rep.mailspike.net : 127.0.0.18]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[tarsnap.com:+,amazonses.com:+]; RCVD_IN_DNSWL_NONE(0.00)[13.8.240.54.list.dnswl.org : 127.0.15.0]; FORGED_SENDER(0.30)[cperciva@tarsnap.com,010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com]; RCVD_COUNT_ZERO(0.00)[0]; MIME_TRACE(0.00)[0:+]; IP_SCORE(-1.92)[ip: (-1.94), ipnet: 54.240.8.0/21(-4.60), asn: 14618(-3.01), country: US(-0.05)]; ASN(0.00)[asn:14618, ipnet:54.240.8.0/21, country:US]; FROM_NEQ_ENVFROM(0.00)[cperciva@tarsnap.com,010001721ec82f69-59cd23d7-9f03-4d13-8419-39865b67dc0a-000000@amazonses.com]; FORGED_MUA_THUNDERBIRD_MSGID_UNKNOWN(2.50)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:38:57 -0000 On 2020-05-16 11:37, Colin Percival wrote: > Author: cperciva > Date: Sat May 16 18:37:48 2020 > New Revision: 361114 > URL: https://svnweb.freebsd.org/changeset/base/361114 > > Log: > Move the devmatch rc.d script before netif in the boot process. > > Prior to this change, using lagg to aggregate wired and wireless networks > was broken in the (relatively common) case where wifi drivers + firmware > are loaded by devmatch, since the interface didn't exist at the time when > the lagg interface was being created. > > Suggested by: imp > MFC after: 3 days PR: 246506 -- Colin Percival Security Officer Emeritus, FreeBSD | The power to serve Founder, Tarsnap | www.tarsnap.com | Online backups for the truly paranoid From owner-svn-src-all@freebsd.org Sat May 16 18:49:38 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 206BC2FA268; Sat, 16 May 2020 18:49:38 +0000 (UTC) (envelope-from adrian@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 49PZ8206Jyz3Nbk; Sat, 16 May 2020 18:49:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 F33871A632; Sat, 16 May 2020 18:49:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GInbnl016441; Sat, 16 May 2020 18:49:37 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GInbMg016440; Sat, 16 May 2020 18:49:37 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005161849.04GInbMg016440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 18:49:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361115 - head/tools/tools/ath/athratestats X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/tools/tools/ath/athratestats X-SVN-Commit-Revision: 361115 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 18:49:38 -0000 Author: adrian Date: Sat May 16 18:49:37 2020 New Revision: 361115 URL: https://svnweb.freebsd.org/changeset/base/361115 Log: [ath] Flip athratestats to use two columns for now. Yeah I have too many rates on the screen now... Modified: head/tools/tools/ath/athratestats/main.c Modified: head/tools/tools/ath/athratestats/main.c ============================================================================== --- head/tools/tools/ath/athratestats/main.c Sat May 16 18:37:48 2020 (r361114) +++ head/tools/tools/ath/athratestats/main.c Sat May 16 18:49:37 2020 (r361115) @@ -147,8 +147,11 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r PRINTATTR_OFF(COLOR_PAIR(3) | A_BOLD); } PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" + " avg last xmit "); + PRINTMSG(" TX Rate TXTOTAL:TXOK EWMA T/ F" " avg last xmit\n"); for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { + int c = 0; if ((mask & 1) == 0) continue; for (y = 0; y < NUM_PACKET_SIZE_BINS; y++) { @@ -165,7 +168,7 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r PRINTATTR_ON(COLOR_PAIR(1) | A_BOLD); #endif PRINTMSG("[%2u %s:%5u] %8ju:%-8ju " - "(%3d.%1d%%) %8ju/%4d %5uuS %u\n", + "(%3d.%1d%%) %8ju/%4d %5uuS %u ", dot11rate(rt, rix), dot11str(rt, rix), bin_to_size(y), @@ -187,7 +190,14 @@ ath_sample_stats(struct ath_ratestats *r, struct ath_r else if (sn->stats[y][rix].ewma_pct / 10 < 75) PRINTATTR_OFF(COLOR_PAIR(1) | A_BOLD); #endif + c++; + if (c == 2) { + PRINTMSG("\n"); + c = 0; + } } + if (c != 0) + PRINTMSG("\n"); } } From owner-svn-src-all@freebsd.org Sat May 16 19:26:40 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1150C2FB50C; Sat, 16 May 2020 19:26:40 +0000 (UTC) (envelope-from tuexen@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 49PZyl6kyYz3Qy4; Sat, 16 May 2020 19:26:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 E29FC1AE16; Sat, 16 May 2020 19:26:39 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GJQdar040844; Sat, 16 May 2020 19:26:39 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GJQdav040843; Sat, 16 May 2020 19:26:39 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <202005161926.04GJQdav040843@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Sat, 16 May 2020 19:26:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361116 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 361116 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 19:26:40 -0000 Author: tuexen Date: Sat May 16 19:26:39 2020 New Revision: 361116 URL: https://svnweb.freebsd.org/changeset/base/361116 Log: Ensure that an stcb is not dereferenced when it is about to be freed. This issue was found by SYZKALLER. MFC after: 3 days Modified: head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_indata.h Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat May 16 18:49:37 2020 (r361115) +++ head/sys/netinet/sctp_indata.c Sat May 16 19:26:39 2020 (r361116) @@ -164,6 +164,9 @@ sctp_build_readq_entry(struct sctp_tcb *stcb, read_queue_e->data = dm; read_queue_e->stcb = stcb; read_queue_e->port_from = stcb->rport; + if (stcb->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { + read_queue_e->do_not_ref_stcb = 1; + } failed_build: return (read_queue_e); } @@ -775,6 +778,7 @@ sctp_build_readq_entry_from_ctl(struct sctp_queued_to_ atomic_add_int(&nc->whoFrom->ref_count, 1); nc->stcb = control->stcb; nc->port_from = control->port_from; + nc->do_not_ref_stcb = control->do_not_ref_stcb; } static void Modified: head/sys/netinet/sctp_indata.h ============================================================================== --- head/sys/netinet/sctp_indata.h Sat May 16 18:49:37 2020 (r361115) +++ head/sys/netinet/sctp_indata.h Sat May 16 19:26:39 2020 (r361116) @@ -68,6 +68,9 @@ sctp_build_readq_entry(struct sctp_tcb *stcb, (_ctl)->data = dm; \ (_ctl)->stcb = (in_it); \ (_ctl)->port_from = (in_it)->rport; \ + if ((in_it)->asoc.state & SCTP_STATE_ABOUT_TO_BE_FREED) { \ + (_ctl)->do_not_ref_stcb = 1; \ + }\ } \ } while (0) From owner-svn-src-all@freebsd.org Sat May 16 19:38:59 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6673E2FB829; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49PbDz27B8z3wdV; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 29E171B00B; Sat, 16 May 2020 19:38:59 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GJcxkB047016; Sat, 16 May 2020 19:38:59 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GJcxnA047015; Sat, 16 May 2020 19:38:59 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <202005161938.04GJcxnA047015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sat, 16 May 2020 19:38:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361117 - head/bin/sh/tests/execution X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh/tests/execution X-SVN-Commit-Revision: 361117 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 19:38:59 -0000 Author: jilles Date: Sat May 16 19:38:58 2020 New Revision: 361117 URL: https://svnweb.freebsd.org/changeset/base/361117 Log: sh/tests: Fix keywords on newly added test Modified: Directory Properties: head/bin/sh/tests/execution/unknown2.0 (props changed) From owner-svn-src-all@freebsd.org Sat May 16 21:59:42 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4ECF12FEFD1; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@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 49PfML1LPbz45Dp; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1: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 295241CB16; Sat, 16 May 2020 21:59:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04GLxgQ9033461; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04GLxgto033460; Sat, 16 May 2020 21:59:42 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <202005162159.04GLxgto033460@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 16 May 2020 21:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r361118 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head X-SVN-Commit-Author: adrian X-SVN-Commit-Paths: head/sys/dev/ath/ath_rate/sample X-SVN-Commit-Revision: 361118 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 May 2020 21:59:42 -0000 Author: adrian Date: Sat May 16 21:59:41 2020 New Revision: 361118 URL: https://svnweb.freebsd.org/changeset/base/361118 Log: [ath_rate_sample] Fix correct status when completing frames with short failures. My preivous logic was a bit wrong. This caused transmissions that failed due to a mix of short and long retries to count intermediate rates as OK if the LONG retry count indicated some retries had made it to this intermediate rate, but the SHORT retry count was the one that caused the whole transmit to fail. Now status is passed in again - and this is the status for the whole transmission - and then update_stats() does some quick math to see if the current transmission series hit its long retry count or not before updating things as a success or failure. Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 19:38:58 2020 (r361117) +++ head/sys/dev/ath/ath_rate/sample/sample.c Sat May 16 21:59:41 2020 (r361118) @@ -933,6 +933,18 @@ ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath s3code, sched->t3); /* series 3 */ } +/* + * Update the current statistics. + * + * Note that status is for the FINAL transmit status, not this + * particular attempt. So, check if tries > tries0 and if so + * assume this status failed. + * + * This is important because some failures are due to both + * short AND long retries; if the final issue was a short + * retry failure then we still want to account for the + * bad long retry attempts. + */ static void update_stats(struct ath_softc *sc, struct ath_node *an, int frame_size, @@ -947,7 +959,7 @@ update_stats(struct ath_softc *sc, struct ath_node *an #endif const int size_bin = size_to_bin(frame_size); const int size = bin_to_size(size_bin); - int tt, tries_so_far; + int tt; int is_ht40 = (an->an_node.ni_chw == 40); int pct; @@ -955,6 +967,15 @@ update_stats(struct ath_softc *sc, struct ath_node *an return; /* + * Treat long retries as us exceeding retries, even + * if the eventual attempt at some other MRR schedule + * succeeded. + */ + if (tries > tries0) { + status = HAL_TXERR_XRETRY; + } + + /* * If status is FAIL then we treat all frames as bad. * This better accurately tracks EWMA and average TX time * because even if the eventual transmission succeeded, @@ -971,7 +992,6 @@ update_stats(struct ath_softc *sc, struct ath_node *an */ tt = calc_usecs_unicast_packet(sc, size, rix0, 0 /* short_tries */, MIN(tries0, tries) - 1, is_ht40); - tries_so_far = tries0; if (sn->stats[size_bin][rix0].total_packets < ssc->smoothing_minpackets) { /* just average the first few packets */ @@ -1194,7 +1214,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[0].rix, rc[0].tries, short_tries, long_tries, - long_tries > rc[0].tries, + status, nframes, nbad); long_tries -= rc[0].tries; } @@ -1203,7 +1223,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[1].rix, rc[1].tries, short_tries, long_tries, - long_tries > rc[1].tries, + status, nframes, nbad); long_tries -= rc[1].tries; } @@ -1212,7 +1232,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[2].rix, rc[2].tries, short_tries, long_tries, - long_tries > rc[2].tries, + status, nframes, nbad); long_tries -= rc[2].tries; } @@ -1221,7 +1241,7 @@ ath_rate_tx_complete(struct ath_softc *sc, struct ath_ update_stats(sc, an, frame_size, rc[3].rix, rc[3].tries, short_tries, long_tries, - long_tries > rc[3].tries, + status, nframes, nbad); } }