From owner-svn-src-all@freebsd.org Sun Jun 17 00:00:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF441003034; Sun, 17 Jun 2018 00:00:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1F61D74AC9; Sun, 17 Jun 2018 00:00:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 02175595F; Sun, 17 Jun 2018 00:00:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H00Obs086736; Sun, 17 Jun 2018 00:00:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H00OLd086735; Sun, 17 Jun 2018 00:00:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806170000.w5H00OLd086735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 00:00:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335271 - head/sbin/ddb X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/ddb X-SVN-Commit-Revision: 335271 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 00:00:25 -0000 Author: eadler Date: Sun Jun 17 00:00:24 2018 New Revision: 335271 URL: https://svnweb.freebsd.org/changeset/base/335271 Log: ddb: unbreak ppc usr/src/powerpc.powerpcspe/tmp/usr/include/strings.h:62: warning: shadowed declaration is here Modified: head/sbin/ddb/ddb_capture.c Modified: head/sbin/ddb/ddb_capture.c ============================================================================== --- head/sbin/ddb/ddb_capture.c Sat Jun 16 23:50:34 2018 (r335270) +++ head/sbin/ddb/ddb_capture.c Sun Jun 17 00:00:24 2018 (r335271) @@ -83,12 +83,12 @@ kread(kvm_t *kvm, void *kvm_pointer, void *address, si } static int -kread_symbol(kvm_t *kvm, int index, void *address, size_t size, +kread_symbol(kvm_t *kvm, int read_index, void *address, size_t size, size_t offset) { ssize_t ret; - ret = kvm_read(kvm, namelist[index].n_value + offset, address, size); + ret = kvm_read(kvm, namelist[read_index].n_value + offset, address, size); if (ret < 0 || (size_t)ret != size) return (-1); return (0); From owner-svn-src-all@freebsd.org Sun Jun 17 01:10:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E71001004AB0; Sun, 17 Jun 2018 01:10:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2DBDA766D2; Sun, 17 Jun 2018 01:10:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5H1AXRo057911; Sat, 16 Jun 2018 18:10:33 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5H1AWqE057910; Sat, 16 Jun 2018 18:10:32 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806170110.w5H1AWqE057910@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: <201806162350.w5GNoZld081724@repo.freebsd.org> To: Eitan Adler Date: Sat, 16 Jun 2018 18:10:32 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 01:10:39 -0000 [ Charset UTF-8 unsupported, converting... ] > Author: eadler > Date: Sat Jun 16 23:50:34 2018 > New Revision: 335270 > URL: https://svnweb.freebsd.org/changeset/base/335270 > > Log: > liby: build with WARNS=6 > > Tested with amd64, arm64, i386, mips > > Added: > head/lib/liby/yyerror.h (contents, props changed) > Modified: > head/lib/liby/Makefile > head/lib/liby/main.c > head/lib/liby/yyerror.c > > Modified: head/lib/liby/Makefile > ============================================================================== > --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 (r335269) > +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 (r335270) > @@ -5,6 +5,4 @@ LIB= y > SRCS= main.c yyerror.c > NO_PIC= > > -WARNS?= 1 > - > .include > > Modified: head/lib/liby/main.c > ============================================================================== > --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 (r335269) > +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 (r335270) > @@ -32,16 +32,17 @@ > #include > __FBSDID("$FreeBSD$"); > > -#ifndef lint > +#if defined(LIBC_SCCS) && !defined(lint) > static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > -#endif /* not lint */ > +#endif /* LIBC_SCCS and not lint */ > > #include > > -int yyparse(void); > +#include "yyerror.h" > > int > main(void) > { > + > exit(yyparse()); > } > > Modified: head/lib/liby/yyerror.c > ============================================================================== > --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 (r335269) > +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 (r335270) > @@ -32,16 +32,18 @@ > #include > __FBSDID("$FreeBSD$"); > > -#ifndef lint > +#if defined(LIBC_SCCS) && !defined(lint) > static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; > -#endif /* not lint */ > +#endif /* LIBC_SCCS and not lint */ > > #include > > +#include "yyerror.h" > + > int > -yyerror(msg) > -char *msg; > +yyerror(const char *msg) > { > - (void)fprintf(stderr, "%s\n", msg); > + > + fprintf(stderr, "%s\n", msg); > return(0); > } > > Added: head/lib/liby/yyerror.h > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 (r335270) > @@ -0,0 +1,36 @@ Where did this file come from???? > +/*- > + * SPDX-License-Identifier: BSD-3-Clause > + * > + * Copyright (c) 1990, 1993 > + * The Regents of the University of California. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + * notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + * notice, this list of conditions and the following disclaimer in the > + * documentation and/or other materials provided with the distribution. > + * 3. Neither the name of the 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$"); > + > +int yyparse(void); > +int yyerror(const char *msg); > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 01:23:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D41EF1005994 for ; Sun, 17 Jun 2018 01:23:34 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 803197739D for ; Sun, 17 Jun 2018 01:23:34 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f179.google.com (mail-yb0-f179.google.com [209.85.213.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 49F5D25BCC for ; Sun, 17 Jun 2018 01:23:34 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f179.google.com with SMTP id d123-v6so4806920ybh.9 for ; Sat, 16 Jun 2018 18:23:34 -0700 (PDT) X-Gm-Message-State: APt69E0l+oxmy+ZZbgW/iIs58w5pG97TJGcOlTQ3cnmCev/MJ/dzAdG0 c2qsTbU1CkOKBU3S83l9pDBsbNKcIkj0Qs0yJnb6fA== X-Google-Smtp-Source: ADUXVKIkXneen5zM2u7GVbkbIzK6SG7HBgG6N0I026AszxLnvzF0PUnP0Oi6NyAaFmTmz/T2nGkP8HhysRITsZWVdpM= X-Received: by 2002:a25:7a01:: with SMTP id v1-v6mr2414758ybc.87.1529198613805; Sat, 16 Jun 2018 18:23:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 18:23:03 -0700 (PDT) In-Reply-To: <201806170110.w5H1AWqE057910@pdx.rh.CN85.dnsmgr.net> References: <201806162350.w5GNoZld081724@repo.freebsd.org> <201806170110.w5H1AWqE057910@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Sat, 16 Jun 2018 18:23:03 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335270 - head/lib/liby To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 01:23:35 -0000 On 16 June 2018 at 18:10, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> Author: eadler >> Date: Sat Jun 16 23:50:34 2018 >> New Revision: 335270 >> URL: https://svnweb.freebsd.org/changeset/base/335270 >> >> Log: >> liby: build with WARNS=6 >> >> Tested with amd64, arm64, i386, mips >> >> Added: >> head/lib/liby/yyerror.h (contents, props changed) >> Modified: >> head/lib/liby/Makefile >> head/lib/liby/main.c >> head/lib/liby/yyerror.c >> >> Modified: head/lib/liby/Makefile >> ============================================================================== >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 (r335269) >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 (r335270) >> @@ -5,6 +5,4 @@ LIB= y >> SRCS= main.c yyerror.c >> NO_PIC= >> >> -WARNS?= 1 >> - >> .include >> >> Modified: head/lib/liby/main.c >> ============================================================================== >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 (r335269) >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 (r335270) >> @@ -32,16 +32,17 @@ >> #include >> __FBSDID("$FreeBSD$"); >> >> -#ifndef lint >> +#if defined(LIBC_SCCS) && !defined(lint) >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; >> -#endif /* not lint */ >> +#endif /* LIBC_SCCS and not lint */ >> >> #include >> >> -int yyparse(void); >> +#include "yyerror.h" >> >> int >> main(void) >> { >> + >> exit(yyparse()); >> } >> >> Modified: head/lib/liby/yyerror.c >> ============================================================================== >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 (r335269) >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 (r335270) >> @@ -32,16 +32,18 @@ >> #include >> __FBSDID("$FreeBSD$"); >> >> -#ifndef lint >> +#if defined(LIBC_SCCS) && !defined(lint) >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; >> -#endif /* not lint */ >> +#endif /* LIBC_SCCS and not lint */ >> >> #include >> >> +#include "yyerror.h" >> + >> int >> -yyerror(msg) >> -char *msg; >> +yyerror(const char *msg) >> { >> - (void)fprintf(stderr, "%s\n", msg); >> + >> + fprintf(stderr, "%s\n", msg); >> return(0); >> } >> >> Added: head/lib/liby/yyerror.h >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 (r335270) >> @@ -0,0 +1,36 @@ > > Where did this file come from???? I added a header file instead of keeping the prototypes in the .c files. Is something wrong with that? -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Jun 17 01:25:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3015E1005AE7 for ; Sun, 17 Jun 2018 01:25:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x244.google.com (mail-yb0-x244.google.com [IPv6:2607:f8b0:4002:c09::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B9C8577501 for ; Sun, 17 Jun 2018 01:25:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x244.google.com with SMTP id h141-v6so4814404ybg.4 for ; Sat, 16 Jun 2018 18:25:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=HDCg/5zVfgwRdmwmz0kFqXJcgsfQC7cmJju4/cZTJVM=; b=kQ1mPUp11sKx4IICxpcgdzpDXtXk639BjuRev6B1/Uqg4ISAX3JREEj48OT/Iq58N7 VszVx560CavSJW8FkwNzv9r7km2XUQKbzgSm6DFXQemMWNW+t4jhmoiJzsv7xRnPsy3E /t3aDLsMYQJJg4z7rAqszkASYtLbWr6ceDthg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=HDCg/5zVfgwRdmwmz0kFqXJcgsfQC7cmJju4/cZTJVM=; b=HVyZP4ITodnqYHf4tzafnxFGk8D1De8g1h0148giRBJxiSQ6Ykos4TJaMUa2ikioNC fMoh+pQSqyk1W0Fs7gFY7XbDUK8qmasRsoMsPkCRB3An67pfUXilLrAWUkiFF+83wCe1 e6u75iTVTQ+ZUGQpVtAp5JPf54tcBaWPd9RwhmhIBz2rTwE3gG9Q7UattZHd61yXz0aT 423UxFb8VPz0XclV50EJsckoR4OYHvaD4o8Rf5LIgxc2Re+YBHXOUea7Lr/A2jjrG5RO yMtbpw3YwfyQYcGn+H16vOSvIGc+oQywsedya89wh6ST9Pfk3H2vn0OUoA+qHOrIh8H+ RdDQ== X-Gm-Message-State: APt69E2OdUB9m/sQ4D9fr50waBmww4rG4Eg+spz91BIoMQciMD7amMAL 2zt3+kCVuCHMcSJWenVrOxFdCpFwZzhe3pgMB52HvA== X-Google-Smtp-Source: ADUXVKJKil3Jt62iZ5TMStrB0I82sQpIKWEiqrBOBs6yebbFQUyb4WsWOu8Es9GAE71/mAx0O5dyb4eeOyb+2/sSKqk= X-Received: by 2002:a5b:64c:: with SMTP id o12-v6mr3655420ybq.460.1529198733921; Sat, 16 Jun 2018 18:25:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 18:25:03 -0700 (PDT) In-Reply-To: <20180613140731.GA54540@raichu> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> <20180613140731.GA54540@raichu> From: Eitan Adler Date: Sat, 16 Jun 2018 18:25:03 -0700 Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Mark Johnston Cc: Oliver Pinter , Ed Maste , Sean Bruno , src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 01:25:35 -0000 On 13 June 2018 at 07:07, Mark Johnston wrote: > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote: >> On Wednesday, June 13, 2018, Ed Maste wrote: >> >> > On Tue, 12 Jun 2018 at 18:17, Sean Bruno wrote: >> > > >> > > On 06/12/18 16:05, Oliver Pinter wrote: >> > > > On 5/22/18, Ed Maste wrote: >> > > >> Author: emaste >> > > >> Date: Tue May 22 14:35:33 2018 >> > > >> New Revision: 334046 >> > > >> URL: https://svnweb.freebsd.org/changeset/base/334046 >> > > >> >> > > >> Log: >> > > >> intel-ucode-split: add -n flag to skip creating output files >> > > >> >> > > >> Sponsored by: The FreeBSD Foundation >> > > >> >> > > >> Modified: >> > > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c >> > > > >> > > > Hi! >> > > > >> > > > Could you please MFC the intel-ucode-split related commits to >> > 11-STABLE? >> > > > >> > > > Thanks, >> > > > op >> > > >> > > Do you need it in base for some reason? This code is already in the >> > > devcpu-data port and is used when the port is built. Its not needed for >> > > anything AFAIK. >> > >> > Indeed, the real use in FreeBSD is via the devcpu-data port; I >> > committed it to src/tools/ for collaboration and testing. I'll merge >> > it to stable/11 if it will be useful for someone, but am curious about >> > the use case. >> > >> >> >> I'm considering to write an in kernel microcode update facility, based on >> firmware(9), and in first idea it would be nice during the generation of >> firmware modules. > > FWIW, I'm working on this for 12.0 and was planning to describe my > proposal on -arch in the next couple of weeks. For my purposes at > least, firmware(9) isn't suitable. We'd like to ensure that updates are > applied before the kernel does CPU identification, and that happens > quite early during boot. This places some constraints on the > implementation which exclude firmware(9). Naive question, knowing nothing about firmware(9), but why can't it be enhanced to work that early? It seems there might be other use-cases for very-early-boot firmware application. -- Eitan Adler From owner-svn-src-all@freebsd.org Sun Jun 17 01:26:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40FB81005C7D; Sun, 17 Jun 2018 01:26:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4B54777BE; Sun, 17 Jun 2018 01:26:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B03A6688A; Sun, 17 Jun 2018 01:26:57 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H1QvnO032729; Sun, 17 Jun 2018 01:26:57 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H1Qv4m032728; Sun, 17 Jun 2018 01:26:57 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806170126.w5H1Qv4m032728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Jun 2018 01:26:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335272 - head/stand/efi/loader X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/efi/loader X-SVN-Commit-Revision: 335272 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 01:26:58 -0000 Author: imp Date: Sun Jun 17 01:26:57 2018 New Revision: 335272 URL: https://svnweb.freebsd.org/changeset/base/335272 Log: Many netboot scenarios don't have /boot/defaults/loader.conf. As a fallback, also check /boot/kernel/kernel existing as well, since that's the fallback behavior of the loader. Modified: head/stand/efi/loader/main.c Modified: head/stand/efi/loader/main.c ============================================================================== --- head/stand/efi/loader/main.c Sun Jun 17 00:00:24 2018 (r335271) +++ head/stand/efi/loader/main.c Sun Jun 17 01:26:57 2018 (r335272) @@ -220,7 +220,8 @@ sanity_check_currdev(void) { struct stat st; - return (stat("/boot/defaults/loader.conf", &st) == 0); + return (stat("/boot/defaults/loader.conf", &st) == 0 || + stat("/boot/kernel/kernel", &st) == 0); } #ifdef EFI_ZFS_BOOT From owner-svn-src-all@freebsd.org Sun Jun 17 01:39:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D24101006721; Sun, 17 Jun 2018 01:39:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85E2977F91; Sun, 17 Jun 2018 01:39:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 66F2C6A70; Sun, 17 Jun 2018 01:39:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H1dNHT037852; Sun, 17 Jun 2018 01:39:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H1dN5F037851; Sun, 17 Jun 2018 01:39:23 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806170139.w5H1dN5F037851@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 01:39:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335273 - head/sbin/gvinum X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sbin/gvinum X-SVN-Commit-Revision: 335273 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 01:39:24 -0000 Author: eadler Date: Sun Jun 17 01:39:22 2018 New Revision: 335273 URL: https://svnweb.freebsd.org/changeset/base/335273 Log: gvinum: revert WARNS change in Makefile Architectures that passed on a local build universe, failed on tinderbox. Revert the number change for now while I investigate. Modified: head/sbin/gvinum/Makefile Modified: head/sbin/gvinum/Makefile ============================================================================== --- head/sbin/gvinum/Makefile Sun Jun 17 01:26:57 2018 (r335272) +++ head/sbin/gvinum/Makefile Sun Jun 17 01:39:22 2018 (r335273) @@ -5,6 +5,7 @@ PROG= gvinum SRCS= gvinum.c gvinum.h geom_vinum_share.c MAN= gvinum.8 +WARNS= 2 CFLAGS+= -I${SRCTOP}/sys -I${SYSROOT:U${DESTDIR}}/${INCLUDEDIR}/edit LIBADD= edit geom From owner-svn-src-all@freebsd.org Sun Jun 17 02:49:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84A451009AA1; Sun, 17 Jun 2018 02:49:43 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 354767AF9F; Sun, 17 Jun 2018 02:49:43 +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 1545C7677; Sun, 17 Jun 2018 02:49:43 +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 w5H2ngO4074190; Sun, 17 Jun 2018 02:49:42 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H2ngkD074189; Sun, 17 Jun 2018 02:49:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806170249.w5H2ngkD074189@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Sun, 17 Jun 2018 02:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335274 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335274 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 02:49:43 -0000 Author: imp Date: Sun Jun 17 02:49:42 2018 New Revision: 335274 URL: https://svnweb.freebsd.org/changeset/base/335274 Log: FreeBSD/amd64 requires 256MiB to boot UEFI, 128MB simply doesn't work. 128MiB still works for Legacy booting, however. Go ahead and do 256MiB for all amd64 boxes, since the number of such boxes < 256MiB is vanishingly small. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sun Jun 17 01:39:22 2018 (r335273) +++ head/tools/boot/rootgen.sh Sun Jun 17 02:49:42 2018 (r335274) @@ -315,7 +315,7 @@ qemu_amd64_legacy() img=$1 sh=$2 - echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -m 256m --drive file=${img},format=raw ${qser}" > $sh } qemu_amd64_uefi() @@ -323,7 +323,7 @@ qemu_amd64_uefi() img=$1 sh=$2 - echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" > $sh } qemu_amd64_both() @@ -331,8 +331,8 @@ qemu_amd64_both() img=$1 sh=$2 - echo "qemu-system-x86_64 --drive file=${img},format=raw ${qser}" > $sh - echo "qemu-system-x86_64 -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" >> $sh + echo "qemu-system-x86_64 -m 256m --drive file=${img},format=raw ${qser}" > $sh + echo "qemu-system-x86_64 -m 256m -bios ~/bios/OVMF-X64.fd --drive file=${img},format=raw ${qser}" >> $sh } # arm From owner-svn-src-all@freebsd.org Sun Jun 17 02:43:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA4E8100973A; Sun, 17 Jun 2018 02:43:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 34A287AD47; Sun, 17 Jun 2018 02:43:42 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5H2hb6i058198; Sat, 16 Jun 2018 19:43:37 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5H2haP5058197; Sat, 16 Jun 2018 19:43:36 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806170243.w5H2haP5058197@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: To: Eitan Adler Date: Sat, 16 Jun 2018 19:43:36 -0700 (PDT) CC: "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 02:43:43 -0000 > On 16 June 2018 at 18:10, Rodney W. Grimes > wrote: > > [ Charset UTF-8 unsupported, converting... ] > >> Author: eadler > >> Date: Sat Jun 16 23:50:34 2018 > >> New Revision: 335270 > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > >> > >> Log: > >> liby: build with WARNS=6 > >> > >> Tested with amd64, arm64, i386, mips > >> > >> Added: > >> head/lib/liby/yyerror.h (contents, props changed) > >> Modified: > >> head/lib/liby/Makefile > >> head/lib/liby/main.c > >> head/lib/liby/yyerror.c > >> > >> Modified: head/lib/liby/Makefile > >> ============================================================================== > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 (r335269) > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 (r335270) > >> @@ -5,6 +5,4 @@ LIB= y > >> SRCS= main.c yyerror.c > >> NO_PIC= > >> > >> -WARNS?= 1 > >> - > >> .include > >> > >> Modified: head/lib/liby/main.c > >> ============================================================================== > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 (r335269) > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 (r335270) > >> @@ -32,16 +32,17 @@ > >> #include > >> __FBSDID("$FreeBSD$"); > >> > >> -#ifndef lint > >> +#if defined(LIBC_SCCS) && !defined(lint) > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > >> -#endif /* not lint */ > >> +#endif /* LIBC_SCCS and not lint */ > >> > >> #include > >> > >> -int yyparse(void); > >> +#include "yyerror.h" > >> > >> int > >> main(void) > >> { > >> + > >> exit(yyparse()); > >> } > >> > >> Modified: head/lib/liby/yyerror.c > >> ============================================================================== > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 (r335269) > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 (r335270) > >> @@ -32,16 +32,18 @@ > >> #include > >> __FBSDID("$FreeBSD$"); > >> > >> -#ifndef lint > >> +#if defined(LIBC_SCCS) && !defined(lint) > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; > >> -#endif /* not lint */ > >> +#endif /* LIBC_SCCS and not lint */ > >> > >> #include > >> > >> +#include "yyerror.h" > >> + > >> int > >> -yyerror(msg) > >> -char *msg; > >> +yyerror(const char *msg) > >> { > >> - (void)fprintf(stderr, "%s\n", msg); > >> + > >> + fprintf(stderr, "%s\n", msg); > >> return(0); > >> } > >> > >> Added: head/lib/liby/yyerror.h > >> ============================================================================== > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 (r335270) > >> @@ -0,0 +1,36 @@ > > > > Where did this file come from???? > > I added a header file instead of keeping the prototypes in the .c > files. Is something wrong with that? If you extracted part of a c file and placed it in a .h file, you should add a * from: pathname comment to this yyerror.h What flagged me was we shouldnt just have spontanious files arriving from 1990/1993 UCB. Thanks, Rod @@ -0,0 +1,36 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 1990, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 03:06:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11C19100A60D; Sun, 17 Jun 2018 03:06:34 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 72A467BD20; Sun, 17 Jun 2018 03:06:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5H36VTG058346; Sat, 16 Jun 2018 20:06:31 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5H36VRQ058345; Sat, 16 Jun 2018 20:06:31 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806170306.w5H36VRQ058345@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: To: Juli Mallett Date: Sat, 16 Jun 2018 20:06:31 -0700 (PDT) CC: rgrimes@freebsd.org, Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:06:34 -0000 > On 16 June 2018 at 19:43, Rodney W. Grimes > wrote: > > > > On 16 June 2018 at 18:10, Rodney W. Grimes > > > wrote: > > > > [ Charset UTF-8 unsupported, converting... ] > > > >> Author: eadler > > > >> Date: Sat Jun 16 23:50:34 2018 > > > >> New Revision: 335270 > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > > >> > > > >> Log: > > > >> liby: build with WARNS=6 > > > >> > > > >> Tested with amd64, arm64, i386, mips > > > >> > > > >> Added: > > > >> head/lib/liby/yyerror.h (contents, props changed) > > > >> Modified: > > > >> head/lib/liby/Makefile > > > >> head/lib/liby/main.c > > > >> head/lib/liby/yyerror.c > > > >> > > > >> Modified: head/lib/liby/Makefile > > > >> ============================================================ > > ================== > > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > > (r335269) > > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > > (r335270) > > > >> @@ -5,6 +5,4 @@ LIB= y > > > >> SRCS= main.c yyerror.c > > > >> NO_PIC= > > > >> > > > >> -WARNS?= 1 > > > >> - > > > >> .include > > > >> > > > >> Modified: head/lib/liby/main.c > > > >> ============================================================ > > ================== > > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > > (r335269) > > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > > (r335270) > > > >> @@ -32,16 +32,17 @@ > > > >> #include > > > >> __FBSDID("$FreeBSD$"); > > > >> > > > >> -#ifndef lint > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > > > >> -#endif /* not lint */ > > > >> +#endif /* LIBC_SCCS and not lint */ > > > >> > > > >> #include > > > >> > > > >> -int yyparse(void); > > > >> +#include "yyerror.h" > > > >> > > > >> int > > > >> main(void) > > > >> { > > > >> + > > > >> exit(yyparse()); > > > >> } > > > >> > > > >> Modified: head/lib/liby/yyerror.c > > > >> ============================================================ > > ================== > > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > > (r335269) > > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > > (r335270) > > > >> @@ -32,16 +32,18 @@ > > > >> #include > > > >> __FBSDID("$FreeBSD$"); > > > >> > > > >> -#ifndef lint > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; > > > >> -#endif /* not lint */ > > > >> +#endif /* LIBC_SCCS and not lint */ > > > >> > > > >> #include > > > >> > > > >> +#include "yyerror.h" > > > >> + > > > >> int > > > >> -yyerror(msg) > > > >> -char *msg; > > > >> +yyerror(const char *msg) > > > >> { > > > >> - (void)fprintf(stderr, "%s\n", msg); > > > >> + > > > >> + fprintf(stderr, "%s\n", msg); > > > >> return(0); > > > >> } > > > >> > > > >> Added: head/lib/liby/yyerror.h > > > >> ============================================================ > > ================== > > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > > (r335270) > > > >> @@ -0,0 +1,36 @@ > > > > > > > > Where did this file come from???? > > > > > > I added a header file instead of keeping the prototypes in the .c > > > files. Is something wrong with that? > > > > If you extracted part of a c file and placed it in a .h file, you > > should add a > > * from: pathname > > comment to this yyerror.h > > > > Rod, > > It's two prototypes. For functions that are extern. Including the UCB > copyright isn't even necessary, but seems reasonable. Actually including a 1990/1993 UCB copyright is -exactly- why the from: line should be there. If he had assigned his own copyright to this I wouldn't of batted an eye, but he didn't, which means he copied it from someplace. I would like to have that someplace clearly documented as has always historically been done when copying parts of or whole files around the BSD source tree. His commit message also lacked any details about this move of code, it just said, build with WARNS=6. > > No, people do not need to add "from:" notes when adding a header to provide > prototypes for extern functions. They do if they infact copied a portion of another file... > Juli. > > > > What flagged me was we shouldnt just have spontanious files arriving > > from 1990/1993 UCB. > > > > Thanks, > > Rod > > > > @@ -0,0 +1,36 @@ > > +/*- > > + * SPDX-License-Identifier: BSD-3-Clause > > + * > > + * Copyright (c) 1990, 1993 > > + * The Regents of the University of California. All rights reserved. > > + * > > + * Redistribution and use in source and binary forms, with or without > > + * modification, are permitted provided that the following conditions > > + * are met: > > > > -- > > Rod Grimes > > rgrimes@freebsd.org > > > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 03:10:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B08D1100A85A; Sun, 17 Jun 2018 03:10:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5EACE7C022; Sun, 17 Jun 2018 03:10:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3FBF67A50; Sun, 17 Jun 2018 03:10:26 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H3AQak085458; Sun, 17 Jun 2018 03:10:26 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H3AQ2I085457; Sun, 17 Jun 2018 03:10:26 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806170310.w5H3AQ2I085457@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 03:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335275 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335275 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:10:27 -0000 Author: asomers Date: Sun Jun 17 03:10:25 2018 New Revision: 335275 URL: https://svnweb.freebsd.org/changeset/base/335275 Log: audit(4): add tests for chflags and friends chflags, fchflags, and lchflags (but not chflagsat) are included. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15854 Modified: head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Sun Jun 17 02:49:42 2018 (r335274) +++ head/tests/sys/audit/file-attribute-modify.c Sun Jun 17 03:10:25 2018 (r335275) @@ -550,6 +550,141 @@ ATF_TC_CLEANUP(fchownat_failure, tc) } +ATF_TC_WITH_CLEANUP(chflags_success); +ATF_TC_HEAD(chflags_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "chflags(2) call"); +} + +ATF_TC_BODY(chflags_success, tc) +{ + /* File needs to exist to call chflags(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, chflags(path, UF_OFFLINE)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(chflags_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(chflags_failure); +ATF_TC_HEAD(chflags_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "chflags(2) call"); +} + +ATF_TC_BODY(chflags_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, chflags(errpath, UF_OFFLINE)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(chflags_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchflags_success); +ATF_TC_HEAD(fchflags_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "fchflags(2) call"); +} + +ATF_TC_BODY(fchflags_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "fchflags.*%d.*ret.*success", pid); + /* File needs to exist to call fchflags(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, fchflags(filedesc, UF_OFFLINE)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(fchflags_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(fchflags_failure); +ATF_TC_HEAD(fchflags_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "fchflags(2) call"); +} + +ATF_TC_BODY(fchflags_failure, tc) +{ + const char *regex = "fchflags.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, fchflags(-1, UF_OFFLINE)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(fchflags_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchflags_success); +ATF_TC_HEAD(lchflags_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lchflags(2) call"); +} + +ATF_TC_BODY(lchflags_success, tc) +{ + /* Symbolic link needs to exist to call lchflags(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, lchflags(path, UF_OFFLINE)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lchflags_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lchflags_failure); +ATF_TC_HEAD(lchflags_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lchflags(2) call"); +} + +ATF_TC_BODY(lchflags_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, lchflags(errpath, UF_OFFLINE)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lchflags_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, flock_success); @@ -576,6 +711,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, lchown_failure); ATF_TP_ADD_TC(tp, fchownat_success); ATF_TP_ADD_TC(tp, fchownat_failure); + + ATF_TP_ADD_TC(tp, chflags_success); + ATF_TP_ADD_TC(tp, chflags_failure); + ATF_TP_ADD_TC(tp, fchflags_success); + ATF_TP_ADD_TC(tp, fchflags_failure); + ATF_TP_ADD_TC(tp, lchflags_success); + ATF_TP_ADD_TC(tp, lchflags_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Jun 17 03:09:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9C321100A78D for ; Sun, 17 Jun 2018 03:09:33 +0000 (UTC) (envelope-from juli@northcloak.com) Received: from mail-qt0-x231.google.com (mail-qt0-x231.google.com [IPv6:2607:f8b0:400d:c0d::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 362227BEAB for ; Sun, 17 Jun 2018 03:09:33 +0000 (UTC) (envelope-from juli@northcloak.com) Received: by mail-qt0-x231.google.com with SMTP id y20-v6so12528553qto.8 for ; Sat, 16 Jun 2018 20:09:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northcloak-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=oO0X2qLdmLssDnMkKMSjWLxqjRpCOdhjpXHsmqjdBv8=; b=jQovmrNPFBafOaWz+byzFNFEdRRVsHs0yJ4hgK7yq62LKodsQknazkyhXgm1J2TNQG yISsV1kZvycr/ac9kjrbvBT7oZUicD6AUbmB2tpyWjhV2UNlmkd+N8vsIAesSJdOMyMj IzueLOXOeZ5SYIJTzW+9zROQDG9mGB1jPNLx9a5KpP+S4bt6XQ1P40jwmzsz1opAtKqM +BK84Vn1qjTz3ziltecrEfJt0+pT0acCrVTGQhhVpAXt7J0tt6EmozBf1EqJc/fS5pzb yCs2khGoThc0i4ySWkpkzcjWQKZmTunk6BcCu3ISSotCVOLIRyK2XVDrM6oXIozLp2Gv E+RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=oO0X2qLdmLssDnMkKMSjWLxqjRpCOdhjpXHsmqjdBv8=; b=odiW1cdG5Hqjdm0RRA4c8uvDHFCm1CHFcQoOe58Yxcw5ZHbWURArJNmSOMIw/ZJA0t Fe5rMjf+ug2DAd8orBlqxkJftYmcO1/FRHL5km9cH3TVA8sGjZy/c5mF43YnQiuePHbj EPJXqJTRc0ITMHqdM/KyhgEZ46xu3bGRX+r+8TZ9kmxWT+njsJh/ArbIUXIQT5EOKgQR 0+IzkopwZb5BYzxdl1eenBAz8WGi2Fk/zV/IvLmY6pLvnb2Gp0q5eG/aYcN7+Y6qIR88 uc+hiPD8zutOJV9M5IQXvRqLv6bg7NEt0Asav7SIKY92qOulDK2NxrzfxB7F8SYkP/ws LXJQ== X-Gm-Message-State: APt69E0pF1KlDm16Nx8aHScku7KrBJ4rkaBp4QsD5pCd7vb68wKZXtH5 eUfykXP0WbuxmZHGdEiX177xNGU18HtvrXV53tWT/Q== X-Google-Smtp-Source: ADUXVKKOlFS4+y4+QWSiFnvLoZLBzGqubWn6+vixV9Vl0bD3alFhZchNlLJqlTOAd5zETs3E0yWCoNYCXJbn8z1KuTw= X-Received: by 2002:a0c:d2ee:: with SMTP id x43-v6mr6421830qvh.237.1529204972797; Sat, 16 Jun 2018 20:09:32 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2221:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 20:08:52 -0700 (PDT) In-Reply-To: <201806170306.w5H36VRQ058345@pdx.rh.CN85.dnsmgr.net> References: <201806170306.w5H36VRQ058345@pdx.rh.CN85.dnsmgr.net> From: Juli Mallett Date: Sat, 16 Jun 2018 20:08:52 -0700 Message-ID: Subject: Re: svn commit: r335270 - head/lib/liby To: rgrimes@freebsd.org Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:09:33 -0000 On 16 June 2018 at 20:06, Rodney W. Grimes wrote: > > On 16 June 2018 at 19:43, Rodney W. Grimes net> > > wrote: > > > > > > On 16 June 2018 at 18:10, Rodney W. Grimes > > > > wrote: > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > >> Author: eadler > > > > >> Date: Sat Jun 16 23:50:34 2018 > > > > >> New Revision: 335270 > > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > > > >> > > > > >> Log: > > > > >> liby: build with WARNS=6 > > > > >> > > > > >> Tested with amd64, arm64, i386, mips > > > > >> > > > > >> Added: > > > > >> head/lib/liby/yyerror.h (contents, props changed) > > > > >> Modified: > > > > >> head/lib/liby/Makefile > > > > >> head/lib/liby/main.c > > > > >> head/lib/liby/yyerror.c > > > > >> > > > > >> Modified: head/lib/liby/Makefile > > > > >> ============================================================ > > > ================== > > > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > > > (r335269) > > > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > > > (r335270) > > > > >> @@ -5,6 +5,4 @@ LIB= y > > > > >> SRCS= main.c yyerror.c > > > > >> NO_PIC= > > > > >> > > > > >> -WARNS?= 1 > > > > >> - > > > > >> .include > > > > >> > > > > >> Modified: head/lib/liby/main.c > > > > >> ============================================================ > > > ================== > > > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > > > (r335269) > > > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > > > (r335270) > > > > >> @@ -32,16 +32,17 @@ > > > > >> #include > > > > >> __FBSDID("$FreeBSD$"); > > > > >> > > > > >> -#ifndef lint > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > > > > >> -#endif /* not lint */ > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > >> > > > > >> #include > > > > >> > > > > >> -int yyparse(void); > > > > >> +#include "yyerror.h" > > > > >> > > > > >> int > > > > >> main(void) > > > > >> { > > > > >> + > > > > >> exit(yyparse()); > > > > >> } > > > > >> > > > > >> Modified: head/lib/liby/yyerror.c > > > > >> ============================================================ > > > ================== > > > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > > > (r335269) > > > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > > > (r335270) > > > > >> @@ -32,16 +32,18 @@ > > > > >> #include > > > > >> __FBSDID("$FreeBSD$"); > > > > >> > > > > >> -#ifndef lint > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) > 6/4/93"; > > > > >> -#endif /* not lint */ > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > >> > > > > >> #include > > > > >> > > > > >> +#include "yyerror.h" > > > > >> + > > > > >> int > > > > >> -yyerror(msg) > > > > >> -char *msg; > > > > >> +yyerror(const char *msg) > > > > >> { > > > > >> - (void)fprintf(stderr, "%s\n", msg); > > > > >> + > > > > >> + fprintf(stderr, "%s\n", msg); > > > > >> return(0); > > > > >> } > > > > >> > > > > >> Added: head/lib/liby/yyerror.h > > > > >> ============================================================ > > > ================== > > > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > > > (r335270) > > > > >> @@ -0,0 +1,36 @@ > > > > > > > > > > Where did this file come from???? > > > > > > > > I added a header file instead of keeping the prototypes in the .c > > > > files. Is something wrong with that? > > > > > > If you extracted part of a c file and placed it in a .h file, you > > > should add a > > > * from: pathname > > > comment to this yyerror.h > > > > > > > Rod, > > > > It's two prototypes. For functions that are extern. Including the UCB > > copyright isn't even necessary, but seems reasonable. > > Actually including a 1990/1993 UCB copyright is -exactly- why > the from: line should be there. If he had assigned his own > copyright to this I wouldn't of batted an eye, but he didn't, > which means he copied it from someplace. I would like to have > that someplace clearly documented as has always historically > been done when copying parts of or whole files around the > BSD source tree. > > His commit message also lacked any details about this move > of code, it just said, build with WARNS=6. > > > > > No, people do not need to add "from:" notes when adding a header to > provide > > prototypes for extern functions. > > They do if they infact copied a portion of another file... I don't think this has been a FreeBSD norm since at least the late '90s for both trivial and nontrivial refactoring. We have good version control. If this is the expectation, I'd love it if you could find somewhere it's written down, or if it's not, start an FCP to get it written down. It seems important for this to be codified if people should expect to get called out on a mailing list for not doing it. From owner-svn-src-all@freebsd.org Sun Jun 17 03:18:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB393100AE03; Sun, 17 Jun 2018 03:18:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D3BA7C756; Sun, 17 Jun 2018 03:18:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E5767BFB; Sun, 17 Jun 2018 03:18:57 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H3IvoL090559; Sun, 17 Jun 2018 03:18:57 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H3IvJP090557; Sun, 17 Jun 2018 03:18:57 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806170318.w5H3IvJP090557@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 17 Jun 2018 03:18:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335276 - in head/stand/i386: gptboot zfsboot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in head/stand/i386: gptboot zfsboot X-SVN-Commit-Revision: 335276 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:18:58 -0000 Author: allanjude Date: Sun Jun 17 03:18:56 2018 New Revision: 335276 URL: https://svnweb.freebsd.org/changeset/base/335276 Log: gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early Normally the serial console is not enabled until /boot.config is read and we know how the serial console should be configured. Initialize the consoles early in 'dual' mode (serial & keyboard) with a default serial rate of 115200. Then serial is re-initialized once the disk is decrypted and the /boot.config file can be read. This allows the GELIBoot passphrase to be provided via the serial console. PR: 221526 Requested by: many Reviewed by: imp Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15862 Modified: head/stand/i386/gptboot/gptboot.c head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Sun Jun 17 03:10:25 2018 (r335275) +++ head/stand/i386/gptboot/gptboot.c Sun Jun 17 03:18:56 2018 (r335276) @@ -285,6 +285,16 @@ main(void) bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk.drive; + /* + * Initialize the serial console early with a modern default of 115200. + * Later, we'll read PATH_DOTCONFIG and reconfigure serial according + * to the configuration provided. + */ + opts = OPT_SET(RBX_DUAL); + ioctrl = (IO_SERIAL|IO_KEYBOARD); + if (sio_init(115200) != 0) + ioctrl &= ~IO_SERIAL; + #ifdef LOADER_GELI_SUPPORT geli_init(); #endif Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Sun Jun 17 03:10:25 2018 (r335275) +++ head/stand/i386/zfsboot/zfsboot.c Sun Jun 17 03:18:56 2018 (r335276) @@ -693,6 +693,16 @@ main(void) } setheap(heap_next, heap_end); + /* + * Initialize the serial console early with a modern default of 115200. + * Later, we'll read PATH_DOTCONFIG and reconfigure serial according + * to the configuration provided. + */ + opts = OPT_SET(RBX_DUAL); + ioctrl = (IO_SERIAL|IO_KEYBOARD); + if (sio_init(115200) != 0) + ioctrl &= ~IO_SERIAL; + dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; From owner-svn-src-all@freebsd.org Sun Jun 17 02:52:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3EF421009DDE for ; Sun, 17 Jun 2018 02:52:35 +0000 (UTC) (envelope-from juli@northcloak.com) Received: from mail-qk0-x235.google.com (mail-qk0-x235.google.com [IPv6:2607:f8b0:400d:c09::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D27C07B3EA for ; Sun, 17 Jun 2018 02:52:34 +0000 (UTC) (envelope-from juli@northcloak.com) Received: by mail-qk0-x235.google.com with SMTP id w23-v6so7734354qkb.8 for ; Sat, 16 Jun 2018 19:52:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northcloak-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=6vVIxhs3mZnyIVx6CSnwdsuY+WWeHpdck5wha9ackOc=; b=lb4PY3n9AuzYb67P5sx6bFwhOkxUdpmPm+K0WwPAAfy88aknUPkLEBJz5TSc9jYUql KaQ0qWZbUx7Yj4ZSfifJIIMNkwbWwXaK4IIr7KNXMfvrvPdGnHVcgZFPKoeDKSPuYzf/ 3lf5Tu6xOBBIsh9zFPAILVwjiopmMPeogsdp7+1kPkrb5Aip2uQtr1QLNplzI5veabUt zU3a0z7aplm6K1dTYGTmplHlk3OvJORDqF0ddoUSsEbbgSr+brKlotcNh+kHlTvjXBJ4 17bvw6ZO6p3kAioNpsfKpfns8TReweWDfAYyP/ujBUPrmBnIfvXg0efr+YrtvsBSdooQ Z6Iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=6vVIxhs3mZnyIVx6CSnwdsuY+WWeHpdck5wha9ackOc=; b=jWUYl1ciI0IOgVzGijh6tiOeArBhCgEAJPUPUMgoIZ/GHcBW3KMNFqawxdwWWRZgab ToHf1YoEZWH+Ieaa6UFeKIrhtyHPTg1JhTWV7PjOHOP3pK4ZDzcwMst7p2zE0tmjh5vp lxhMv0dhNXZcGkHpfPEQbiR0XLpn9HW/SgFqlQ+BtOvJrKNDUNI/9z4qy8aj8PorHXn4 RU1Q4Jbl2E3Nh/KTqbc+5fiUbuARTruT6EvkqsawuCSgz3t9OLV1iOt44TqIfE2ynxQy ELsST9mchw+GAzsDxqijySLlRwXK9juM+v/OAbG2LnKZF9i1+CwFLP5eVLs9l/J4C24m K2VA== X-Gm-Message-State: APt69E30lAoocsT4WQGqfuNq7ExTgzE3R0h03Qk6dvmZ/g2SpDQMGnMJ deasrh6s30l9Sa2A4LCW6uvJcz/GwcwyCx7uuG9WrA== X-Google-Smtp-Source: ADUXVKIpP7sb2f43lfAj+4mAKXiIKpbzSC9XkdVB2tUyZE/r/gayRBdAhCVgl4ScnLKkqvUQ5lzaarl+zJg/wRw1qGI= X-Received: by 2002:a37:db09:: with SMTP id e9-v6mr6171020qki.63.1529203953979; Sat, 16 Jun 2018 19:52:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2221:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 19:51:53 -0700 (PDT) In-Reply-To: <201806170243.w5H2haP5058197@pdx.rh.CN85.dnsmgr.net> References: <201806170243.w5H2haP5058197@pdx.rh.CN85.dnsmgr.net> From: Juli Mallett Date: Sat, 16 Jun 2018 19:51:53 -0700 Message-ID: Subject: Re: svn commit: r335270 - head/lib/liby To: rgrimes@freebsd.org Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 02:52:35 -0000 On 16 June 2018 at 19:43, Rodney W. Grimes wrote: > > On 16 June 2018 at 18:10, Rodney W. Grimes > > wrote: > > > [ Charset UTF-8 unsupported, converting... ] > > >> Author: eadler > > >> Date: Sat Jun 16 23:50:34 2018 > > >> New Revision: 335270 > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > >> > > >> Log: > > >> liby: build with WARNS=6 > > >> > > >> Tested with amd64, arm64, i386, mips > > >> > > >> Added: > > >> head/lib/liby/yyerror.h (contents, props changed) > > >> Modified: > > >> head/lib/liby/Makefile > > >> head/lib/liby/main.c > > >> head/lib/liby/yyerror.c > > >> > > >> Modified: head/lib/liby/Makefile > > >> ============================================================ > ================== > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > (r335269) > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > (r335270) > > >> @@ -5,6 +5,4 @@ LIB= y > > >> SRCS= main.c yyerror.c > > >> NO_PIC= > > >> > > >> -WARNS?= 1 > > >> - > > >> .include > > >> > > >> Modified: head/lib/liby/main.c > > >> ============================================================ > ================== > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > (r335269) > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > (r335270) > > >> @@ -32,16 +32,17 @@ > > >> #include > > >> __FBSDID("$FreeBSD$"); > > >> > > >> -#ifndef lint > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > > >> -#endif /* not lint */ > > >> +#endif /* LIBC_SCCS and not lint */ > > >> > > >> #include > > >> > > >> -int yyparse(void); > > >> +#include "yyerror.h" > > >> > > >> int > > >> main(void) > > >> { > > >> + > > >> exit(yyparse()); > > >> } > > >> > > >> Modified: head/lib/liby/yyerror.c > > >> ============================================================ > ================== > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > (r335269) > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > (r335270) > > >> @@ -32,16 +32,18 @@ > > >> #include > > >> __FBSDID("$FreeBSD$"); > > >> > > >> -#ifndef lint > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) 6/4/93"; > > >> -#endif /* not lint */ > > >> +#endif /* LIBC_SCCS and not lint */ > > >> > > >> #include > > >> > > >> +#include "yyerror.h" > > >> + > > >> int > > >> -yyerror(msg) > > >> -char *msg; > > >> +yyerror(const char *msg) > > >> { > > >> - (void)fprintf(stderr, "%s\n", msg); > > >> + > > >> + fprintf(stderr, "%s\n", msg); > > >> return(0); > > >> } > > >> > > >> Added: head/lib/liby/yyerror.h > > >> ============================================================ > ================== > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > (r335270) > > >> @@ -0,0 +1,36 @@ > > > > > > Where did this file come from???? > > > > I added a header file instead of keeping the prototypes in the .c > > files. Is something wrong with that? > > If you extracted part of a c file and placed it in a .h file, you > should add a > * from: pathname > comment to this yyerror.h > Rod, It's two prototypes. For functions that are extern. Including the UCB copyright isn't even necessary, but seems reasonable. No, people do not need to add "from:" notes when adding a header to provide prototypes for extern functions. Juli. > What flagged me was we shouldnt just have spontanious files arriving > from 1990/1993 UCB. > > Thanks, > Rod > > @@ -0,0 +1,36 @@ > +/*- > + * SPDX-License-Identifier: BSD-3-Clause > + * > + * Copyright (c) 1990, 1993 > + * The Regents of the University of California. All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > > -- > Rod Grimes > rgrimes@freebsd.org > > From owner-svn-src-all@freebsd.org Sun Jun 17 03:33:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1459100BCF6; Sun, 17 Jun 2018 03:33:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 883EE7D60C; Sun, 17 Jun 2018 03:33:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6A6ED7F51; Sun, 17 Jun 2018 03:33:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H3XUlu000480; Sun, 17 Jun 2018 03:33:30 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H3XUv7000479; Sun, 17 Jun 2018 03:33:30 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806170333.w5H3XUv7000479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 03:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335277 - head/usr.sbin/sysrc X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/sysrc X-SVN-Commit-Revision: 335277 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:33:31 -0000 Author: dteske Date: Sun Jun 17 03:33:29 2018 New Revision: 335277 URL: https://svnweb.freebsd.org/changeset/base/335277 Log: sysrc(8): Exit with failure on API error Fix exit status when f_sysrc_set() fails. Errors in the underlying API provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not being communicated back to the command-line. This was affecting ansible modules using sysrc as they were not able to accurately test for error. PR: bin/211448 Reported by: Christian Schwarz MFC after: 3 days X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/usr.sbin/sysrc/sysrc Modified: head/usr.sbin/sysrc/sysrc ============================================================================== --- head/usr.sbin/sysrc/sysrc Sun Jun 17 03:18:56 2018 (r335276) +++ head/usr.sbin/sysrc/sysrc Sun Jun 17 03:33:29 2018 (r335277) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2016 Devin Teske +# Copyright (c) 2010-2018 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="7.1 Feb-2,2016" +SYSRC_VERSION="7.2 Jun-16,2018" # # Options @@ -854,7 +854,7 @@ while [ $# -gt 0 ]; do # if [ ! "$SHOW_VALUE" ]; then echo "$NAME" - f_sysrc_set "$NAME" "$new" + f_sysrc_set "$NAME" "$new" || status=$FAILURE else if f_sysrc_set "$NAME" "$new"; then if [ "$SHOW_FILE" ]; then @@ -866,6 +866,8 @@ while [ $# -gt 0 ]; do echo -n "$before${SHOW_EQUALS:+\" #}" echo -n " -> ${SHOW_EQUALS:+\"}$after" echo "${SHOW_EQUALS:+\"}" + else + status=$FAILURE fi fi ;; From owner-svn-src-all@freebsd.org Sun Jun 17 03:15:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 60E49100AC6B; Sun, 17 Jun 2018 03:15:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C75B77C593; Sun, 17 Jun 2018 03:15:18 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5H3FHZg058429; Sat, 16 Jun 2018 20:15:17 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5H3FHOD058428; Sat, 16 Jun 2018 20:15:17 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806170315.w5H3FHOD058428@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: To: Juli Mallett Date: Sat, 16 Jun 2018 20:15:17 -0700 (PDT) CC: rgrimes@freebsd.org, Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:15:19 -0000 > On 16 June 2018 at 20:06, Rodney W. Grimes > wrote: > > > > On 16 June 2018 at 19:43, Rodney W. Grimes > net> > > > wrote: > > > > > > > > On 16 June 2018 at 18:10, Rodney W. Grimes > > > > > wrote: > > > > > > [ Charset UTF-8 unsupported, converting... ] > > > > > >> Author: eadler > > > > > >> Date: Sat Jun 16 23:50:34 2018 > > > > > >> New Revision: 335270 > > > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > > > > >> > > > > > >> Log: > > > > > >> liby: build with WARNS=6 > > > > > >> > > > > > >> Tested with amd64, arm64, i386, mips > > > > > >> > > > > > >> Added: > > > > > >> head/lib/liby/yyerror.h (contents, props changed) Just says added, not copied from some file, so VCS here does nothing for saying where this file came from. > > > > > >> Modified: > > > > > >> head/lib/liby/Makefile > > > > > >> head/lib/liby/main.c > > > > > >> head/lib/liby/yyerror.c > > > > > >> > > > > > >> Modified: head/lib/liby/Makefile > > > > > >> ============================================================ > > > > ================== > > > > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > > > > (r335269) > > > > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > > > > (r335270) > > > > > >> @@ -5,6 +5,4 @@ LIB= y > > > > > >> SRCS= main.c yyerror.c > > > > > >> NO_PIC= > > > > > >> > > > > > >> -WARNS?= 1 > > > > > >> - > > > > > >> .include > > > > > >> > > > > > >> Modified: head/lib/liby/main.c > > > > > >> ============================================================ > > > > ================== > > > > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > > > > (r335269) > > > > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > > > > (r335270) > > > > > >> @@ -32,16 +32,17 @@ > > > > > >> #include > > > > > >> __FBSDID("$FreeBSD$"); > > > > > >> > > > > > >> -#ifndef lint > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > > > > > >> -#endif /* not lint */ > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > >> > > > > > >> #include > > > > > >> > > > > > >> -int yyparse(void); > > > > > >> +#include "yyerror.h" > > > > > >> > > > > > >> int > > > > > >> main(void) > > > > > >> { > > > > > >> + > > > > > >> exit(yyparse()); > > > > > >> } > > > > > >> > > > > > >> Modified: head/lib/liby/yyerror.c > > > > > >> ============================================================ > > > > ================== > > > > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > > > > (r335269) > > > > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > > > > (r335270) > > > > > >> @@ -32,16 +32,18 @@ > > > > > >> #include > > > > > >> __FBSDID("$FreeBSD$"); > > > > > >> > > > > > >> -#ifndef lint > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) > > 6/4/93"; > > > > > >> -#endif /* not lint */ > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > >> > > > > > >> #include > > > > > >> > > > > > >> +#include "yyerror.h" > > > > > >> + > > > > > >> int > > > > > >> -yyerror(msg) > > > > > >> -char *msg; > > > > > >> +yyerror(const char *msg) > > > > > >> { > > > > > >> - (void)fprintf(stderr, "%s\n", msg); > > > > > >> + > > > > > >> + fprintf(stderr, "%s\n", msg); > > > > > >> return(0); > > > > > >> } > > > > > >> > > > > > >> Added: head/lib/liby/yyerror.h > > > > > >> ============================================================ > > > > ================== > > > > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > > > > (r335270) > > > > > >> @@ -0,0 +1,36 @@ > > > > > > > > > > > > Where did this file come from???? > > > > > > > > > > I added a header file instead of keeping the prototypes in the .c > > > > > files. Is something wrong with that? > > > > > > > > If you extracted part of a c file and placed it in a .h file, you > > > > should add a > > > > * from: pathname > > > > comment to this yyerror.h > > > > > > > > > > Rod, > > > > > > It's two prototypes. For functions that are extern. Including the UCB > > > copyright isn't even necessary, but seems reasonable. > > > > Actually including a 1990/1993 UCB copyright is -exactly- why > > the from: line should be there. If he had assigned his own > > copyright to this I wouldn't of batted an eye, but he didn't, > > which means he copied it from someplace. I would like to have > > that someplace clearly documented as has always historically > > been done when copying parts of or whole files around the > > BSD source tree. > > > > His commit message also lacked any details about this move > > of code, it just said, build with WARNS=6. > > > > > > > > No, people do not need to add "from:" notes when adding a header to > > provide > > > prototypes for extern functions. > > > > They do if they infact copied a portion of another file... > > > I don't think this has been a FreeBSD norm since at least the late '90s for > both trivial and nontrivial refactoring. We have good version control. The version control says 0 about where this file came from, the commit message should of. > If this is the expectation, I'd love it if you could find somewhere it's > written down, or if it's not, start an FCP to get it written down. It > seems important for this to be codified if people should expect to get > called out on a mailing list for not doing it. So all things must be written now? I do not think that holds true for most things. Perhaps this has died, but I would still like to see this file marked as derived from to explain the attribution to UCB, as that also is a bit abnormal to do without saying why your attributing it to them. I do know that from: was written, someplace in one of the guides, I shall strive to find it. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 03:10:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9903100A880 for ; Sun, 17 Jun 2018 03:10:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x232.google.com (mail-lf0-x232.google.com [IPv6:2a00:1450:4010:c07::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4781D7C12E for ; Sun, 17 Jun 2018 03:10:38 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x232.google.com with SMTP id t2-v6so13452257lfd.6 for ; Sat, 16 Jun 2018 20:10:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:cc; bh=QTBe7GSqXUyUKcLfK4EGFCpAX1uEssDqTvvFoDu1JBs=; b=Gg0zKITSC6yHUn6A3ik+rUnnEDOToSeDxksYdYa+Xpe6ZvQHj0VkSkXSjr+UAkKLCf H1XaY1+jWo/Uipa3/im8WuZDBo5euy+Pfz3YwfXkZksk1CcHv8kw9kmcUO1zODSkygu9 B3DLaUAbivasFoBw5gInerslCW+vjNLPDClQVKGMbfWLpWbclO7ABsThaKnKio5TuaOJ Stm0I+CCVbuTtT0tvRfILiAN4f86oPy3+D4gj5wkpjLxEzfQ5Oip+1efPe/MDV7r+ZGZ 7YM3PXghGytrxEnl8pJAtFheSFSEpLXRm/sdOtxMOhm6kr6pOzMyo1C9oVNvMRQU6upG 6aKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:cc; bh=QTBe7GSqXUyUKcLfK4EGFCpAX1uEssDqTvvFoDu1JBs=; b=CAawexInQtcL41eE33hDD+2cB7Ei939nSwsvxu7sUGS5WK3ARN0R4da8jawaiyRPek mBAP59/THzvtQfrZHltd1GMhZDa15VrhHDbrQmr4xX5Ie2vFe5jmXTVgCe0RhESn61iv EwMkN5Fx8A68QOiKnqnh1oTNO82WtUi1yr6HQ9mJC2QdAITneOb3cviBvFlOzuujjwc6 lS7BYOhU9c7qm76ZtdYUA+W+ehJZPwrEx90BFNik9kP45NXYdlWdKHv0xueHGlYhGFc7 qwHUIb/P7IXYRiyA3eWSKV7b2ZcuG+CRKJg1iV8VCtqZIh3TEe/GFC568/3tVJRkwfyZ YK1A== X-Gm-Message-State: APt69E0aZLGmN6z89EQ6SoCWuH5gj+R75fTjW4W2DoZwp0YQucRoCFzJ wiuTsOKo4+5IKSHzb5k4sWoMHJaZpgV1CVBwc+s= X-Received: by 2002:a2e:7403:: with SMTP id p3-v6mt5255171ljc.59.1529205036139; Sat, 16 Jun 2018 20:10:36 -0700 (PDT) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 2002:ab3:7206:0:0:0:0:0 with HTTP; Sat, 16 Jun 2018 20:10:35 -0700 (PDT) In-Reply-To: <201806161822.w5GIMZ9q016637@repo.freebsd.org> References: <201806161822.w5GIMZ9q016637@repo.freebsd.org> From: Alan Somers Date: Sat, 16 Jun 2018 21:10:35 -0600 X-Google-Sender-Auth: _DxehIlG6_wWaAU1Ga1YjlgmeMo Message-ID: Subject: Re: svn commit: r335260 - head/tests/sys/audit Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 03:10:39 -0000 Correction: these are tests for SysV message queues. POSIX message queues are TODO. On Sat, Jun 16, 2018 at 12:22 PM, Alan Somers wrote: > Author: asomers > Date: Sat Jun 16 18:22:35 2018 > New Revision: 335260 > URL: https://svnweb.freebsd.org/changeset/base/335260 > > Log: > audit(4): add tests for POSIX message queues > > Submitted by: aniketp > MFC after: 2 weeks > Sponsored by: Google, Inc. (GSoC 2018) > Differential Revision: https://reviews.freebsd.org/D15848 > > Added: > head/tests/sys/audit/inter-process.c (contents, props changed) > Modified: > head/tests/sys/audit/Makefile > > From owner-svn-src-all@freebsd.org Sun Jun 17 04:50:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AED76100DFA8; Sun, 17 Jun 2018 04:50:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail105.syd.optusnet.com.au (mail105.syd.optusnet.com.au [211.29.132.249]) by mx1.freebsd.org (Postfix) with ESMTP id 874CB7F498; Sun, 17 Jun 2018 04:50:47 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail105.syd.optusnet.com.au (Postfix) with ESMTPS id DBBE9104BA91; Sun, 17 Jun 2018 14:50:36 +1000 (AEST) Date: Sun, 17 Jun 2018 14:50:35 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Jilles Tjoelker cc: Bruce Evans , Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335041 - head/lib/libc/stdlib In-Reply-To: <20180613211443.GA57326@stack.nl> Message-ID: <20180617134656.I1009@besplex.bde.org> References: <201806130852.w5D8qH9a093758@repo.freebsd.org> <20180613194008.W2003@besplex.bde.org> <20180613211443.GA57326@stack.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=12FLwc3uCP0gRbeGofgA:9 a=d5NTAduOc25NkjkV:21 a=YlZUZctgaFuNHFV9:21 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 04:50:48 -0000 On Wed, 13 Jun 2018, Jilles Tjoelker wrote: > On Wed, Jun 13, 2018 at 08:03:13PM +1000, Bruce Evans wrote: >> On Wed, 13 Jun 2018, Eitan Adler wrote: > >>> Log: >>> libc: remove explicit cast NULL in atoi > >>> There isn't any reason to cast NULL so just remove it. Noticed when >>> cleaning up top. > >> There are many reasons to cast NULL for all members of the ato*() family: >> - it is required if no prototype is in scope >> - C99 specifies ato*() in terms of strtol*() and uses the cast to NULL, >> ... >> - POSIX specifies ato*() in terms of strtol*() and uses the cast to NULL, >> ... > > These reasons can be summarized to a single reason: the cast is required > if no prototype is in scope. > > I think it is unwise to call any function without a prototype in scope, > since this runs a risk of undefined behaviour if you get the types > wrong. That is a style matter, so it must not be enforced by specifications or man pages, and specifications and man pages should not have details to advocate it or to say when a prototype is needed for every single function. > For the code in libc, we ensure a prototype is in scope and no cast is > required. For the code in the man page, I doubt we should allow for > programmers that play tricks by declaring system functions manually > using K&R-style declarations or (even worse) call functions without > declaring them at all. Programmers who understand prototypes have no difficulty with not using them. libc isn't even controlled by us. Its API is specified by the standard selected by the user. Even C99 doesn't require prototypes. > Note that NULL may still need a cast when passed to a function with > variable number of parameters. Ideally these types are also checked > using attributes. A cast is almost needed for this NULL too. strtol()'s endptr arg should have type const char * so that strtol() can handle const char * string args without needing to cast away const in the caller. But then strtol() couldn't handle plain char * string args without needing worse casting away of const for the variable pointing to endptr. This variable would have type char * so its address would have type char **. C's type system is too weak for safe conversion of this to const char **, so the prototype is not allowed to do it without a diagnostic and an explicit cast must not be used. This cast is also dangerous, so the problem is reduced by using plain char ** for endptr. Since NULL is either an integer constant with value 0 or such a constant cast to unqualified void *, it can be converted without a diagnostic to either char ** or const char **. This is not obvious, and the explicit cast makes it clearer that conversion to plain char ** is really intended. >> FreeBSD used to do the same here, and should do the same here and >> elsewhere by copying better wording from POSIX whenever possible. > > For some reason, the FreeBSD text does not have the exception about > error handling. This exception permits an implementation like musl's > which calculates using int and hard-codes base 10, even if the compiler > documents a cast from long to int as truncating bits. I don't think we > should take advantage of this, though, since making atoi() faster than > strtol() may encourage people to use atoi(). Encouraging use of atoi() would almost be correct. All it needs to be a good API is defined error handling for unrepresentable values and garbage input. Too bad if the programmer doesn't check for errors. Error checking for strtol() is very rarely complete or correct. Unfortunately, atoi() isn't allowed to handle garbage input correctly. It is only allowed to do the right thing for unrepresentable values. I would clamp atoi() to INT_MAX/MIN and return ERANGE for unrepresentable values instead of blindly truncating long values. This already happens accidentally with 32-bit longs. FreeBSD's man page even documents this by giving the implementation detail for the undefined behaviour. Bruce From owner-svn-src-all@freebsd.org Sun Jun 17 05:14:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2E74100E706; Sun, 17 Jun 2018 05:14:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A6DA7FE65; Sun, 17 Jun 2018 05:14:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 37D8710F80; Sun, 17 Jun 2018 05:14:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H5Ep0X050843; Sun, 17 Jun 2018 05:14:51 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H5Epts050842; Sun, 17 Jun 2018 05:14:51 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806170514.w5H5Epts050842@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 05:14:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335278 - head/bin/pwd X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/bin/pwd X-SVN-Commit-Revision: 335278 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 05:14:51 -0000 Author: eadler Date: Sun Jun 17 05:14:50 2018 New Revision: 335278 URL: https://svnweb.freebsd.org/changeset/base/335278 Log: pwd: mark usage as dead Modified: head/bin/pwd/pwd.c Modified: head/bin/pwd/pwd.c ============================================================================== --- head/bin/pwd/pwd.c Sun Jun 17 03:33:29 2018 (r335277) +++ head/bin/pwd/pwd.c Sun Jun 17 05:14:50 2018 (r335278) @@ -95,7 +95,7 @@ main(int argc, char *argv[]) exit(0); } -void +void __dead2 usage(void) { From owner-svn-src-all@freebsd.org Sun Jun 17 05:55:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06A77100F31B; Sun, 17 Jun 2018 05:55:33 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A44480E05; Sun, 17 Jun 2018 05:55:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7966C11611; Sun, 17 Jun 2018 05:55:32 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H5tWkt071169; Sun, 17 Jun 2018 05:55:32 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H5tWn8071168; Sun, 17 Jun 2018 05:55:32 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806170555.w5H5tWn8071168@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 17 Jun 2018 05:55:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335279 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335279 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 05:55:33 -0000 Author: allanjude Date: Sun Jun 17 05:55:31 2018 New Revision: 335279 URL: https://svnweb.freebsd.org/changeset/base/335279 Log: rootgen.sh: complete all profiles except GELI+MBR (not supported) This extends the test suite to generate images for every combination of: amd64: mbr/gpt geli/nogeli ufs/zfs legacy/uefi/both Except for mbr+geli, which is not currently possible. Reviewed by: imp (previous version) Sponsored by: Klara Systems Differential Revision: https://reviews.freebsd.org/D15846 Modified: head/tools/boot/install-boot.sh head/tools/boot/rootgen.sh Modified: head/tools/boot/install-boot.sh ============================================================================== --- head/tools/boot/install-boot.sh Sun Jun 17 05:14:50 2018 (r335278) +++ head/tools/boot/install-boot.sh Sun Jun 17 05:55:31 2018 (r335279) @@ -27,7 +27,7 @@ find-part() { gpart show $dev | tail +2 | awk '$4 == "'$part'" { print $3; }' } -boot_nogeli_gpt_zfs_legacy() { +boot_nogeli_gpt_ufs_legacy() { dev=$1 dst=$2 @@ -35,20 +35,34 @@ boot_nogeli_gpt_zfs_legacy() { if [ -z "$idx" ] ; then die "No freebsd-boot partition found" fi - doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev - exit 0 + doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev } -boot_nogeli_gpt_ufs_legacy() { +boot_nogeli_gpt_ufs_uefi() { dev=$1 dst=$2 + idx=$(find-part $dev "efi") + if [ -z "$idx" ] ; then + die "No ESP partition found" + fi + doit gpart bootcode -p ${efi2} -i $idx $dev +} + +boot_nogeli_gpt_ufs_both() { + boot_nogeli_gpt_ufs_legacy $1 $2 $3 + boot_nogeli_gpt_ufs_uefi $1 $2 $3 +} + +boot_nogeli_gpt_zfs_legacy() { + dev=$1 + dst=$2 + idx=$(find-part $dev "freebsd-boot") if [ -z "$idx" ] ; then die "No freebsd-boot partition found" fi - doit gpart bootcode -b ${gpt0} -p ${gpt2} -i $idx $dev - exit 0 + doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev } boot_nogeli_gpt_zfs_uefi() { @@ -57,64 +71,132 @@ boot_nogeli_gpt_zfs_uefi() { idx=$(find-part $dev "efi") if [ -z "$idx" ] ; then - die "No efi ESP partition found" + die "No ESP partition found" fi doit gpart bootcode -p ${efi2} -i $idx $dev - exit 0 } boot_nogeli_gpt_zfs_both() { + boot_nogeli_gpt_zfs_legacy $1 $2 $3 + boot_nogeli_gpt_zfs_uefi $1 $2 $3 +} + +boot_nogeli_mbr_ufs_legacy() { dev=$1 dst=$2 - # XXX: Should this be copy/pasted, or should it call both _uefi and _legacy - idx=$(find-part $dev "efi") - if [ -z "$idx" ] ; then - die "No efi ESP partition found" + doit gpart bootcode -b ${mbr0} ${dev} + s=$(find-part $dev "freebsd") + if [ -z "$s" ] ; then + die "No freebsd slice found" fi - doit gpart bootcode -p ${efi2} -i $idx $dev + doit gpart bootcode -p ${mbr2} ${dev}s${s} +} - idx=$(find-part $dev "freebsd-boot") - if [ -z "$idx" ] ; then - die "No freebsd-boot partition found" +boot_nogeli_mbr_ufs_uefi() { + dev=$1 + dst=$2 + + s=$(find-part ${dev} "!239") + if [ -z "$s" ] ; then + die "No ESP slice found" fi - doit gpart bootcode -b ${gpt0} -p ${gptzfs2} -i $idx $dev - exit 0 + doit gpart bootcode -p ${efi2} -i ${s} ${dev} } +boot_nogeli_mbr_ufs_both() { + boot_nogeli_mbr_ufs_legacy $1 $2 $3 + boot_nogeli_mbr_ufs_uefi $1 $2 $3 +} + boot_nogeli_mbr_zfs_legacy() { dev=$1 dst=$2 # search to find the BSD slice - s=$(findpart $dev "freebsd-zfs") + s=$(find-part $dev "freebsd") if [ -z "$s" ] ; then + die "No BSD slice found" + fi + idx=$(find-part ${dev}s${s} "freebsd-zfs") + if [ -z "$idx" ] ; then die "No freebsd-zfs slice found" fi # search to find the freebsd-zfs partition within the slice # Or just assume it is 'a' because it has to be since it fails otherwise + doit gpart bootcode -b ${dst}/boot/mbr ${dev} dd if=${dst}/boot/zfsboot of=/tmp/zfsboot1 count=1 - doit gpart bootcode -b /tmp/zfsboo1 ${dev}s${s} # Put boot1 into the start of part + doit gpart bootcode -b /tmp/zfsboot1 ${dev}s${s} # Put boot1 into the start of part sysctl kern.geom.debugflags=0x10 # Put boot2 into ZFS boot slot - doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s} iseek=1 seek=1024 + doit dd if=${dst}/boot/zfsboot of=/dev/${dev}s${s}a skip=1 seek=1024 sysctl kern.geom.debugflags=0x0 - - exit 0 } -boot_nogeli_mbr_ufs_legacy() { +boot_nogeli_mbr_zfs_uefi() { dev=$1 dst=$2 - doit gpart bootcode -b ${mbr0} ${dev} - s=$(findpart $dev "freebsd-ufs") + s=$(find-part $dev "!239") if [ -z "$s" ] ; then - die "No freebsd-ufs slice found" + die "No ESP slice found" fi - doit gpart bootcode -p ${mbr2} ${dev}s${s} - exit 0 + doit gpart bootcode -p ${efi2} -i ${s} ${dev} } +boot_nogeli_mbr_zfs_both() { + boot_nogeli_mbr_zfs_legacy $1 $2 $3 + boot_nogeli_mbr_zfs_uefi $1 $2 $3 +} + +boot_geli_gpt_ufs_legacy() { + boot_nogeli_gpt_ufs_legacy $1 $2 $3 +} + +boot_geli_gpt_ufs_uefi() { + boot_nogeli_gpt_ufs_uefi $1 $2 $3 +} + +boot_geli_gpt_ufs_both() { + boot_nogeli_gpt_ufs_both $1 $2 $3 +} + +boot_geli_gpt_zfs_legacy() { + boot_nogeli_gpt_zfs_legacy $1 $2 $3 +} + +boot_geli_gpt_zfs_uefi() { + boot_nogeli_gpt_zfs_uefi $1 $2 $3 +} + +boot_geli_gpt_zfs_both() { + boot_nogeli_gpt_zfs_both $1 $2 $3 +} + +# GELI+MBR is not a valid configuration +boot_geli_mbr_ufs_legacy() { + exit 1 +} + +boot_geli_mbr_ufs_uefi() { + exit 1 +} + +boot_geli_mbr_ufs_both() { + exit 1 +} + +boot_geli_mbr_zfs_legacy() { + exit 1 +} + +boot_geli_mbr_zfs_uefi() { + exit 1 +} + +boot_geli_mbr_zfs_both() { + exit 1 +} + boot_nogeli_vtoc8_ufs_ofw() { dev=$1 dst=$2 @@ -122,7 +204,6 @@ boot_nogeli_vtoc8_ufs_ofw() { # For non-native builds, ensure that geom_part(4) supports VTOC8. kldload geom_part_vtoc8.ko doit gpart bootcode -p ${vtoc8} ${dev} - exit 0 } DESTDIR=/ @@ -166,11 +247,12 @@ gpt2=${DESTDIR}/boot/gptboot gptzfs2=${DESTDIR}/boot/gptzfsboot # For gpt + EFI we install the ESP -# XXX This should use newfs or makefs, but it deosn't yet +# XXX This should use newfs or makefs, but it doesn't yet +efi1=${DESTDIR}/boot/boot1.efi efi2=${DESTDIR}/boot/boot1.efifat -# For MBR, we have lots of choices, but select boot0 -mbr0=${DESTDIR}/boot/boot0 +# For MBR, we have lots of choices, but select mbr, boot0 has issues with UEFI +mbr0=${DESTDIR}/boot/mbr mbr2=${DESTDIR}/boot/boot # VTOC8 Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Sun Jun 17 05:14:50 2018 (r335278) +++ head/tools/boot/rootgen.sh Sun Jun 17 05:55:31 2018 (r335279) @@ -51,9 +51,9 @@ mk_nogeli_gpt_ufs_uefi() { /dev/ada0p2 / ufs rw 1 1 EOF # XXX need to make msdos part for this to work XXXX - cp ${src}/boot/boot.efifat ${img}.p1 + cp ${src}/boot/boot1.efifat ${img}.p1 makefs -t ffs -B little -s 200m ${img}.p2 ${src} - mkimg -s gpt -b ${src}/boot/pmbr \ + mkimg -s gpt \ -p efi:=${img}.p1 \ -p freebsd-ufs:=${img}.p2 -o ${img} rm -f ${src}/etc/fstab @@ -67,7 +67,7 @@ mk_nogeli_gpt_ufs_both() { /dev/ada0p3 / ufs rw 1 1 EOF # XXX need to make msdos part for this to work XXXX - cp ${src}/boot/boot.efifat ${img}.p1 + cp ${src}/boot/boot1.efifat ${img}.p1 makefs -t ffs -B little -s 200m ${img}.p3 ${src} # p1 is boot for uefi, p2 is boot for gpt, p3 is / mkimg -b ${src}/boot/pmbr -s gpt \ @@ -99,7 +99,6 @@ mk_nogeli_gpt_zfs_legacy() { zfs create -po mountpoint=/ ${pool}/ROOT/default # NB: The online guides go nuts customizing /var and other mountpoints here, no need cpsys ${src} ${mntpt} - df # need to make a couple of tweaks cat > ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${mntpt}/etc/fstab < ${mntpt}/boot/loader.conf < ${mntpt}/etc/fstab < ${mntpt}/boot/loader.conf < ${mntpt}/etc/fstab < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 45195100F5E0; Sun, 17 Jun 2018 06:03:49 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D67BF8124B; Sun, 17 Jun 2018 06:03:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B1F00117A4; Sun, 17 Jun 2018 06:03:48 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H63mKo076159; Sun, 17 Jun 2018 06:03:48 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H63mHA076158; Sun, 17 Jun 2018 06:03:48 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806170603.w5H63mHA076158@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 06:03:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335280 - head/usr.sbin/bsdconfig/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 335280 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 06:03:49 -0000 Author: dteske Date: Sun Jun 17 06:03:48 2018 New Revision: 335280 URL: https://svnweb.freebsd.org/changeset/base/335280 Log: sysrc.subr: Fix handling of files with missing newline at EOF PR: bin/203435 Reported by: Andreas Sommer MFC after: 1 week X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 05:55:31 2018 (r335279) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 06:03:48 2018 (r335280) @@ -559,6 +559,13 @@ f_sysrc_set() # If not found, append new value to last file and return. # if [ "$not_found" ]; then + # Add a newline if missing before appending to the file + awk 'BEGIN { wc = 0 } NR == 1 { + (cmd = "wc -l " FILENAME) | getline + close(cmd) + wc = $1 + } END { exit wc != NR }' "$file" || + echo >> "$file" || return $? echo "$varname=\"$new_value\"" >> "$file" return $? fi @@ -606,8 +613,11 @@ f_sysrc_set() # # Operate on the matching file, replacing only the last occurrence. # + # Use awk to ensure LF at end of each line, else files without ending + # LF will trigger a bug in `tail -r' where last two lines are joined. + # local new_contents retval - new_contents=$( tail -r $file 2> /dev/null ) + new_contents=$( awk 1 "$file" 2> /dev/null | tail -r ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? From owner-svn-src-all@freebsd.org Sun Jun 17 06:25:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F28C5100FB91; Sun, 17 Jun 2018 06:25:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC6381A1B; Sun, 17 Jun 2018 06:25:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7E33911AC9; Sun, 17 Jun 2018 06:25:32 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H6PWhs086448; Sun, 17 Jun 2018 06:25:32 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H6PWXQ086447; Sun, 17 Jun 2018 06:25:32 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806170625.w5H6PWXQ086447@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 06:25:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335281 - head/usr.sbin/bsdconfig/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 335281 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 06:25:33 -0000 Author: dteske Date: Sun Jun 17 06:25:32 2018 New Revision: 335281 URL: https://svnweb.freebsd.org/changeset/base/335281 Log: sysrc.subr: Fix display when value is "-n" PR: bin/226406 Reported by: Marius Halden MFC after: 1 week X-MFC-to: stable/11 Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 06:03:48 2018 (r335280) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 06:25:32 2018 (r335281) @@ -200,7 +200,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) } @@ -338,7 +338,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) } From owner-svn-src-all@freebsd.org Sun Jun 17 06:54:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6E960101104D; Sun, 17 Jun 2018 06:54:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail108.syd.optusnet.com.au (mail108.syd.optusnet.com.au [211.29.132.59]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB5B828CA; Sun, 17 Jun 2018 06:54:54 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from [192.168.0.102] (c110-21-101-228.carlnfd1.nsw.optusnet.com.au [110.21.101.228]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 5576B1A19CF; Sun, 17 Jun 2018 16:54:46 +1000 (AEST) Date: Sun, 17 Jun 2018 16:54:43 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Eitan Adler cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335278 - head/bin/pwd In-Reply-To: <201806170514.w5H5Epts050842@repo.freebsd.org> Message-ID: <20180617161907.Y1464@besplex.bde.org> References: <201806170514.w5H5Epts050842@repo.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.2 cv=FNpr/6gs c=1 sm=1 tr=0 a=PalzARQSbocsUSjMRkwAPg==:117 a=PalzARQSbocsUSjMRkwAPg==:17 a=kj9zAlcOel0A:10 a=ANYk93-bGHjE3TR_3hgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 06:54:55 -0000 On Sun, 17 Jun 2018, Eitan Adler wrote: > Log: > pwd: mark usage as dead > > Modified: > head/bin/pwd/pwd.c > > Modified: head/bin/pwd/pwd.c > ============================================================================== > --- head/bin/pwd/pwd.c Sun Jun 17 03:33:29 2018 (r335277) > +++ head/bin/pwd/pwd.c Sun Jun 17 05:14:50 2018 (r335278) > @@ -95,7 +95,7 @@ main(int argc, char *argv[]) > exit(0); > } > > -void > +void __dead2 > usage(void) > { I asked you to back out a previous addition of __dead2 about 20 additions of it ago. __dead2 here has no effect. The compiler can see that usage() doesn't return if it understands __dead2 at all, since usage() ends with exit() which is declared as __dead2. If __dead2 were added in a place where the addition is not complete nonsense, that is in the forward declaration of the function, then it would have an effect in compilers that don't implement -funit-at-a-time. Then since usage() is called before it is defined, compilers that don't parse the whole file before generating any code would have to consider the function as possibly returning for some of the calls to it unless the forward declaration tells them otherwise. However, -funit-at-a-time can't even be turned off for clang. -funit-at-time is merely the default for gcc starting with -O2, and can be turned off. Detecting functions that don't return is a trivial part of inlining. See my old mail about this for more details. Bruce From owner-svn-src-all@freebsd.org Sun Jun 17 07:08:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBDF51011AD2; Sun, 17 Jun 2018 07:08:48 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 844D182E96; Sun, 17 Jun 2018 07:08:48 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5FB1912144; Sun, 17 Jun 2018 07:08:48 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5H78mQa006932; Sun, 17 Jun 2018 07:08:48 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H78m4I006931; Sun, 17 Jun 2018 07:08:48 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201806170708.w5H78m4I006931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Sun, 17 Jun 2018 07:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335282 - head/contrib/ofed/librdmacm/examples X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/contrib/ofed/librdmacm/examples X-SVN-Commit-Revision: 335282 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 07:08:49 -0000 Author: slavash Date: Sun Jun 17 07:08:47 2018 New Revision: 335282 URL: https://svnweb.freebsd.org/changeset/base/335282 Log: Fix false positive on failure When running mckey, errors may happen in the init/connect stage. When leaving multicast groups, we override this value. Fix that by saving the return value from rdma_leave_multicast to different parameter, and only in case of failure in rdma_leave_multicast override it. MFC after: 1 week Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: head/contrib/ofed/librdmacm/examples/mckey.c Modified: head/contrib/ofed/librdmacm/examples/mckey.c ============================================================================== --- head/contrib/ofed/librdmacm/examples/mckey.c Sun Jun 17 06:25:32 2018 (r335281) +++ head/contrib/ofed/librdmacm/examples/mckey.c Sun Jun 17 07:08:47 2018 (r335282) @@ -475,7 +475,7 @@ static int get_dst_addr(char *dst, struct sockaddr *ad static int run(void) { - int i, ret; + int i, ret, err; printf("mckey: starting %s\n", is_sender ? "client" : "server"); if (src_addr) { @@ -543,10 +543,12 @@ static int run(void) } out: for (i = 0; i < connections; i++) { - ret = rdma_leave_multicast(test.nodes[i].cma_id, + err = rdma_leave_multicast(test.nodes[i].cma_id, test.dst_addr); - if (ret) + if (err) { perror("mckey: failure leaving"); + ret = err; + } } return ret; } From owner-svn-src-all@freebsd.org Sun Jun 17 11:03:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD12101A32A; Sun, 17 Jun 2018 11:03:58 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1413A69F1E; Sun, 17 Jun 2018 11:03:57 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([85.181.109.113]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M9wrU-1fNwyL17P6-00B6Dk; Sun, 17 Jun 2018 13:03:49 +0200 Date: Sun, 17 Jun 2018 13:03:15 +0200 From: "O. Hartmann" To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335254 - in head/stand/i386: libi386 zfsboot Message-ID: <20180617130342.30d74fbb@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201806161516.w5GFG33p017898@repo.freebsd.org> References: <201806161516.w5GFG33p017898@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:DqH47ld2GNFPyWzjDDEtjP4vqPwbVBYQvPSw7Jp+Mt2FcEIKalG O24clgMlEDgP5aLLsxQLv0PgzS+4U3wbZnHlYhY+MpRJfsmstmt8tU6cZzJXnY/ivqusMj3 I755HeHsQ0gCZZ4snW/8yVk+GHVtXuCYU4aly1Ntzz4jR6jPKX4yJNRs7bw0vbzEo44cUoN ZfGdR70SjY+IyAeMOUxmA== X-UI-Out-Filterresults: notjunk:1;V01:K0:Tx5RXinvod0=:Aoy7srnCPYTfnis489piLr +ObEwPR4UUcjdMCKb7IsUYdUtNjU81IVpLXEvmgAYqBC4PLagEnZD7JLsU1g3dE3MvTTyYvQx J77O/0nvXiT8rctthiHs3GnfPx2ovHfDd5wyaauipijD3rx12wCdNOTPLrA9vFWmZm7hDyyMo 5KXBz0qL4P7KKbFog7x+dT9k0IFCHFbXcXL6ikIJJMINcneGM3clrxuoFYdojfX3nohSBs/NU b6Iru96DO1/x3lpH6PGR1OpfUUbfbgLe6npryINHrKgD121rb3nm2IulwHlasxP1dmw68qWV+ l7UucB3AnwI9cTE0uIrd7GJ0j2CVvXAG4WaE7UwOlIoFtAC5JlMJDdDx1znHs22aTTAy/SQa5 7xoFeevMeUyLwQ8Tu8c11mLhdC4N5Pr3BC5smRinNDp95SmlcPFWJJ4xE6noCtWAJOoFq9EYf DIRp8KjdJVgAM6h7inrI8tsNMv2XaIGvU+onhn5KfAgFlxqCB0PNS8mj0T1Pr2zH4Z3CsB9wu nSElr/Vzb5bgEJXwiPqtI000rEQE1gKs0ZEV89T+MQYKx7zhxLw3ygF3ESVw6O2p2YN0TxPwq 4Igg2eifCd2zfulYh8TZ4YUfFiHK/6/EaT4VrrNUodiQIfejgcr7Uc3qVnaYLzESU+lqvfvpC +fEBpnDU9/3DrQQyKgP+c2DBachyUPaLdWCuVRXYzDaIyU35lCnlM7ZLqgdG5JVeZbldqdeDX /2KA+Z+oFjYr1UJm0mdX5e++XZ4ke5wYbWSEHvOUQxUZUCcWAyPQLgVYQd7k1IGLev6A5Z8ZS upwUmrY X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 11:03:58 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFNh dCwgMTYgSnVuIDIwMTggMTU6MTY6MDMgKzAwMDAgKFVUQykNCkFsbGFuIEp1ZGUgPGFsbGFuanVk ZUBGcmVlQlNELm9yZz4gc2NocmllYjoNCg0KPiBBdXRob3I6IGFsbGFuanVkZQ0KPiBEYXRlOiBT YXQgSnVuIDE2IDE1OjE2OjAyIDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzUyNTQNCj4gVVJMOiBo dHRwczovL3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzUyNTQNCj4gDQo+IExv ZzoNCj4gICBBdm9pZCByZWFkaW5nIHBhc3QgdGhlIGVuZCBvZiB0aGUgZGlzayBpbiB6ZnNib290 LmMgYW5kIGJpb3NkaXNrLmMNCj4gICANCj4gICBUaGUgR0VMSSBib290IGNvZGUgcm91bmRzIHJl YWRzIHVwIHRvIDRrLCBzaW5jZSB0aGUgZW5jcnlwdGVkIHNlY3RvcnMgYXJlDQo+ICAgNGssIGFu ZCBtdXN0IGJlIGRlY3J5cHRlZCBhcyBhIHVuaXQuIFdpdGggb2RkYmFsbCBzaXplZCBkaXNrcyAo YWxtb3N0DQo+ICAgYWx3YXlzIHZpcnR1YWwpLCB0aGlzIGNhbiBsZWFkIHRvIHJlYWRpbmcgcGFz dCB0aGUgZW5kIG9mIHRoZSBkaXNrLg0KPiAgIA0KPiAgIFJldmlld2VkIGJ5OglpbXAsIHRzb29t ZQ0KPiAgIFNwb25zb3JlZCBieToJS2xhcmEgU3lzdGVtcw0KPiAgIERpZmZlcmVudGlhbCBSZXZp c2lvbjoJaHR0cHM6Ly9yZXZpZXdzLmZyZWVic2Qub3JnL0QxNTg0NA0KPiANCj4gTW9kaWZpZWQ6 DQo+ICAgaGVhZC9zdGFuZC9pMzg2L2xpYmkzODYvYmlvc2Rpc2suYw0KPiAgIGhlYWQvc3RhbmQv aTM4Ni96ZnNib290L3pmc2Jvb3QuYw0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3RhbmQvaTM4Ni9s aWJpMzg2L2Jpb3NkaXNrLmMNCj4gPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09DQo+IC0tLSBoZWFkL3N0 YW5kL2kzODYvbGliaTM4Ni9iaW9zZGlzay5jCVNhdCBKdW4gMTYgMTU6MDU6MDUgMjAxOAkocjMz NTI1MykNCj4gKysrIGhlYWQvc3RhbmQvaTM4Ni9saWJpMzg2L2Jpb3NkaXNrLmMJU2F0IEp1biAx NiAxNToxNjowMiAyMDE4CShyMzM1MjU0KQ0KPiBAQCAtODgyLDYgKzg4MiwxMiBAQCBiZF9yZWFk KHN0cnVjdCBkaXNrX2RldmRlc2MgKmRldiwgZGFkZHJfdCBkYmxrLCBpbnQgYmwNCj4gIAkJCX0N Cj4gIAkJfQ0KPiAgDQo+ICsJCWlmIChhbGlnbmxiYSArIGFsaWduYmxrcyA+IEJEKGRldikuYmRf c2VjdG9ycykgew0KPiArCQkJREVCVUcoIlNob3J0ZWQgcmVhZCBhdCAlbGx1IGZyb20gJWQgdG8g JWxsdSBibG9ja3MiLA0KPiArCQkJICAgIGFsaWdubGJhLCBhbGlnbmJsa3MsIEJEKGRldikuYmRf c2VjdG9ycyAtIGFsaWdubGJhKTsNCj4gKwkJCWFsaWduYmxrcyA9IEJEKGRldikuYmRfc2VjdG9y cyAtIGFsaWdubGJhOw0KPiArCQl9DQo+ICsNCj4gIAkJZXJyID0gYmRfaW8oZGV2LCBhbGlnbmxi YSwgYWxpZ25ibGtzLCB0bXBidWYsIDApOw0KPiAgCQlpZiAoZXJyKQ0KPiAgCQkJcmV0dXJuIChl cnIpOw0KPiANCj4gTW9kaWZpZWQ6IGhlYWQvc3RhbmQvaTM4Ni96ZnNib290L3pmc2Jvb3QuYw0K PiA9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT0NCj4gLS0tIGhlYWQvc3RhbmQvaTM4Ni96ZnNib290L3pm c2Jvb3QuYwlTYXQgSnVuIDE2IDE1OjA1OjA1IDIwMTgJKHIzMzUyNTMpDQo+ICsrKyBoZWFkL3N0 YW5kL2kzODYvemZzYm9vdC96ZnNib290LmMJU2F0IEp1biAxNiAxNToxNjowMiAyMDE4CShyMzM1 MjU0KQ0KPiBAQCAtMjA5LDYgKzIwOSwxMiBAQCB2ZGV2X3JlYWQodm9pZCAqeHZkZXYsIHZvaWQg KnByaXYsIG9mZl90IG9mZiwgdm9pZCAqYnUNCj4gIAkJYWxpZ25uYiA9IHJvdW5kdXAyKG5iICog REVWX0JTSVpFICsgZGlmZiwgREVWX0dFTElCT09UX0JTSVpFKQ0KPiAgCQkgICAgLyBERVZfQlNJ WkU7DQo+ICANCj4gKwkJaWYgKGRzay0+c2l6ZSA+IDAgJiYgYWxpZ25sYmEgKyBhbGlnbm5iID4g ZHNrLT5zaXplICsgZHNrLT5zdGFydCkgew0KPiArCQkJcHJpbnRmKCJTaG9ydGVuaW5nIHJlYWQg YXQgJWxsZCBmcm9tICVkIHRvICVsbGRcbiIsIGFsaWdubGJhLA0KPiArCQkJICAgIGFsaWdubmIs IChkc2stPnNpemUgKyBkc2stPnN0YXJ0KSAtIGFsaWdubGJhKTsNCj4gKwkJCWFsaWdubmIgPSAo ZHNrLT5zaXplICsgZHNrLT5zdGFydCkgLSBhbGlnbmxiYTsNCj4gKwkJfQ0KPiArDQo+ICAJCWlm IChkcnZyZWFkKGRzaywgZG1hZGF0LT5yZGJ1ZiwgYWxpZ25sYmEsIGFsaWdubmIpKQ0KPiAgCQkJ cmV0dXJuIC0xOw0KPiAgI2lmZGVmIExPQURFUl9HRUxJX1NVUFBPUlQNCj4gQEAgLTY5NCw3ICs3 MDAsNyBAQCBtYWluKHZvaWQpDQo+ICAgICAgZHNrLT5zbGljZSA9ICoodWludDhfdCAqKVBUT1Yo QVJHUyArIDEpICsgMTsNCj4gICAgICBkc2stPnBhcnQgPSAwOw0KPiAgICAgIGRzay0+c3RhcnQg PSAwOw0KPiAtICAgIGRzay0+c2l6ZSA9IDA7DQo+ICsgICAgZHNrLT5zaXplID0gZHJ2c2l6ZV9l eHQoZHNrKTsNCj4gIA0KPiAgICAgIGJvb3RpbmZvLmJpX3ZlcnNpb24gPSBCT09USU5GT19WRVJT SU9OOw0KPiAgICAgIGJvb3RpbmZvLmJpX3NpemUgPSBzaXplb2YoYm9vdGluZm8pOw0KPiBAQCAt NzQ1LDcgKzc1MSw3IEBAIG1haW4odm9pZCkNCj4gIAlkc2stPnNsaWNlID0gMDsNCj4gIAlkc2st PnBhcnQgPSAwOw0KPiAgCWRzay0+c3RhcnQgPSAwOw0KPiAtCWRzay0+c2l6ZSA9IDA7DQo+ICsJ ZHNrLT5zaXplID0gZHJ2c2l6ZV9leHQoZHNrKTsNCj4gIAlwcm9iZV9kcml2ZShkc2spOw0KPiAg ICAgIH0NCj4gIA0KPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fXw0KPiBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0DQo+IGh0dHBzOi8v bGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhlYWQNCj4gVG8gdW5z dWJzY3JpYmUsIHNlbmQgYW55IG1haWwgdG8gInN2bi1zcmMtaGVhZC11bnN1YnNjcmliZUBmcmVl YnNkLm9yZyINCg0KSGVsbG8gQWxsYW4sDQoNCmFyZSB0aGVyZSBhbnkgY2hhbmNlcyB0aGF0IHRo ZXNlIGNoYW5nZXMgdG8gInN0YW5kIiBoYXZlIGluZmx1ZW5jZXMgKGluIGEgYmFkIHdheSkNCmJv b3Rpbmcgb2ZmIEFNRDY0IEdQVC9NQlIgZGlza3M/DQoNCkkgcmVhbGlzZWQgdGhhdCBDVVJSRU5U IHIzMzUyMjIgZnJvbSBGcmlkYXksIDEwdGggSnVuZSAyMDE4IGJvb3RlZCB3aXRob3V0IHByb2Js ZW1zDQooTmFub0JTRCwgc2xpZ2h0bHkgbW9kaWZpZWQgdG8gYm9vdCBvZmYgR1BUL1VFRkkgcGFy dGl0aW9ucywgYnV0IGluIGdlbmVyYWwgYSBzaW1wbGUNCiJncGFydCBib290Y29kZSAtYiBwbWJy IC1wIC9ib290L2dwdGJvb3QgLWkgMiBtbWNzZDAiIHByZXBhcmF0aW9uIG9mIGEgZGQnZCBpbWFn ZSkuDQpBbm90aGVyIHRyeSB3aXRoIHJlY2VudCByMzM1MjgyIG9uIGEgQVBVIDJDNCwgZnJlc2hs eSBidWlsZCBOYW5vQlNELCBmYWlscyB0byBib290DQpmaXJzdHN0YWdlOiB0aGUgKG1vc3QgcmVj ZW50KSBTRUFCaW9zIHN0b3BwcyBmb3IgZXZlciBhdCB0ZWxsaW5nICJCb290aW5nIGZyb20gaGFy ZA0KZGlzayI7IHdlcmUgdXN1YWxseSBhIGNhcnJldCBzdGFydHMgdG8gc3Bpbm4gdGhlcmUgaXMg dmFzdCBlbXB0eW5lc3MuIFByZXBhcmluZyB0aGUgYm9vdA0KcGFydGl0aW9uIHdpdGggYW4gb2xk ZXIgYm9vdGNvZGUgb24gdGhhdCB2ZXJ5IHNhbWUgU0QgY2FyZCB2aWEgImdwYXJ0IGJvb3Rjb2Rl IC1iIHBtYnINCi0gLXAgL2Jvb3QvZ3B0Ym9vdCAtaSAyIG1tY3NkMCIgd2l0aCBhbiBvbGRlciBi b290ZWQgaW1hZ2Ugb2YgQ1VSUkVOVCBoYXMgc29sdmVkIHRoZQ0KcHJvYmxlbS4gVGhlIGxheW91 dCBvZiB0aGUgU0QgY2FyZCBpcyBhcyBmb2xsb3dzLCBqdXN0IGZvciB0aGUgcmVjb3JkOg0KDQoj OiBncGFydCBzaG93IG1tY3NkMA0KPT4gICAgICA0MCAgNjA3NTE3OTIgIG1tY3NkMCAgR1BUICAo MjlHKQ0KICAgICAgICA0MCAgICAgIDEwMjQgICAgICAgMiAgZnJlZWJzZC1ib290ICAoNTEySykN CiAgICAgIDEwNjQgICAyMjA1OTQ0ICAgICAgIDMgIGZyZWVic2QtdWZzICAoMS4xRykNCiAgIDIy MDcwMDggICAyMjEwMTI3ICAgICAgIDQgIGZyZWVic2QtdWZzICAoMS4xRykNCiAgIDQ0MTcxMzUg ICAxMDQ4NTc2ICAgICAgIDUgIGZyZWVic2QtdWZzICAoNTEyTSkNCiAgIDU0NjU3MTEgIDU1Mjg2 MTIxICAgICAgICAgIC0gZnJlZSAtICAoMjZHKQ0KDQpLaW5kIHJlZ2FyZHMsDQoNCm9oDQoNCi0g LS0gDQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hlIGRlciBOdXR6dW5nIG9kZXIgw5xi ZXJtaXR0bHVuZyBtZWluZXIgRGF0ZW4gZsO8cg0KV2VyYmV6d2Vja2Ugb2RlciBmw7xyIGRpZSBN YXJrdC0gb2RlciBNZWludW5nc2ZvcnNjaHVuZyAowqcgMjggQWJzLiA0IEJEU0cpLg0KLS0tLS1C RUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUxVRUFSTUtBQjBXSVFRWlZaTXpBdHdDMlQvODZU clM1MjhmeUZoWWxBVUNXeVpBRGdBS0NSRFM1MjhmeUZoWQ0KbElRTkFmd090MEluOUdrdUlhbXJs dkxPcHlYSmFzNGgwc29xdi8zOUdRWXJtZVA3ZUIxK2M0ZlRkbUliQnRzRw0KTFFINjcxNXBkWGMv QU84UmE2Sk95Z3U4bHpuaUFnQ0ZhdWZ1TEdJSEFhbU5YRDYwR3ZwZVJMcnhWVWRSNkgxNA0KUnE1 azloc3JBemtIMG1PMFVHUHJqd242UlhYUys3Y0lIYTBoWVQxR2dYRjJWdHFyTkRjUw0KPTh1bzQN Ci0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-all@freebsd.org Sun Jun 17 11:32:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13980101AE8B; Sun, 17 Jun 2018 11:32:22 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from hz.grosbein.net (unknown [IPv6:2a01:4f8:d12:604::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 8CC5A6ACB0; Sun, 17 Jun 2018 11:32:21 +0000 (UTC) (envelope-from eugen@grosbein.net) Received: from eg.sd.rdtc.ru (root@eg.sd.rdtc.ru [62.231.161.221] (may be forged)) by hz.grosbein.net (8.15.2/8.15.2) with ESMTPS id w5HBWD8g092104 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 17 Jun 2018 13:32:14 +0200 (CEST) (envelope-from eugen@grosbein.net) X-Envelope-From: eugen@grosbein.net X-Envelope-To: allanjude@FreeBSD.org Received: from [10.58.0.4] ([10.58.0.4]) by eg.sd.rdtc.ru (8.15.2/8.15.2) with ESMTPS id w5HBW8bv009081 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 17 Jun 2018 18:32:08 +0700 (+07) (envelope-from eugen@grosbein.net) Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot To: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806170318.w5H3IvJP090557@repo.freebsd.org> From: Eugene Grosbein Message-ID: <5B2646B3.4020200@grosbein.net> Date: Sun, 17 Jun 2018 18:32:03 +0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <201806170318.w5H3IvJP090557@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.2 required=5.0 tests=BAYES_00, LOCAL_FROM, RDNS_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.1 X-Spam-Report: * -0.0 SPF_PASS SPF: sender matches SPF record * -2.3 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 2.6 LOCAL_FROM From my domains * 1.9 RDNS_NONE Delivered to internal network by a host with no rDNS X-Spam-Level: ** X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on hz.grosbein.net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 11:32:22 -0000 17.06.2018 10:18, Allan Jude wrote: > Author: allanjude > Date: Sun Jun 17 03:18:56 2018 > New Revision: 335276 > URL: https://svnweb.freebsd.org/changeset/base/335276 > > Log: > gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early > > Normally the serial console is not enabled until /boot.config is read and > we know how the serial console should be configured. Initialize the > consoles early in 'dual' mode (serial & keyboard) with a default serial > rate of 115200. Then serial is re-initialized once the disk is decrypted > and the /boot.config file can be read. > > This allows the GELIBoot passphrase to be provided via the serial console. > > PR: 221526 > Requested by: many > Reviewed by: imp > Sponsored by: Klara Systems > Differential Revision: https://reviews.freebsd.org/D15862 I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing missing serial ports. I even could reproduce that with VirtualBox machine configured with no serial ports (not same as existing bug inactive serial port). Should there be some way to disable this serial ports configuration at compile time? From owner-svn-src-all@freebsd.org Sun Jun 17 12:36:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B6BF101D7F2; Sun, 17 Jun 2018 12:36:39 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 746826CD8A; Sun, 17 Jun 2018 12:36:38 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wr0-x241.google.com with SMTP id w10-v6so14045202wrk.9; Sun, 17 Jun 2018 05:36:38 -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:user-agent; bh=Zi2Bo2n1jtSyQGGTCFCks04jDiG2qKN4wFeQuL8t8rA=; b=VWTXJuOXLnibkbna3qhZkenzulgSkPZM5iDQj58+YH89ERxtwB3HIw8eODOsNzLj5s ZIZdFQYRqW9FaF9zEhR0VeNpFfXXbmRwBMCkoVB4GeZv4ep8w8sYU2amVPilpG5aAKJY OVGn5YWo6DobOWQZD3IVOaKV0rnv+NSNqILiFeX7G5fqpLrSxIGmFsSSgv60iC42+A9t /+zgXUGaDA7CHia6rAQDP1y/+qfjrS4UIkSfzypIkY395ilGdG7kgCy6ttvzb6qMbSrB jcuPrQ7Dz0Ux1mitmxdiOx3ZSPVbZoRUwL6z8qzp/ieOyCQm1xoBJORROr61pu33vno5 B/pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=Zi2Bo2n1jtSyQGGTCFCks04jDiG2qKN4wFeQuL8t8rA=; b=Z4trjxYp6H/69DBpBKirbTHEdLK/rVv0Tt6yb0MyAffE2pBuLrEGa4qnE6kBf4iQTq iPGyX2JvFpMTix/ZluAQ6trxbR5IpH8Ed1FPZ7BXsoR3YzfIqEYZRT1p4GhLLB2LUHre JmBg1KW1StnuDADskxgIKC8Yo8eBcxzBe8sWKJWIBzgbQ5c5+YuTe2gHWhWf59VgU5xd QNID9k59pMJUbx4plx3JrQOS491MiVjdEd9WTZKOF4kRL6k583Il8fpqDUgH29SE+dpZ VQebv0ovnSFHCRWfm74gbRFCV7riRRb+m4l5v7uUzpDP5lyBoOIOgGfTesFxP6yUyXOC imHg== X-Gm-Message-State: APt69E1uCYWP6cM1MIW6fYO2u3UX9L8628xdG02tmbg1RrY/HZes3r01 eFiIHu7YaTj9hGZvwuA8Y9TWDA== X-Google-Smtp-Source: ADUXVKIRywbDKbv6L2f3Ik1FjTXDE8Yq6XSH7QUp72SoUogB5SNPeD58H8/WaPyNtm59SV6vXCw0ww== X-Received: by 2002:adf:93c6:: with SMTP id 64-v6mr7195669wrp.119.1529238997430; Sun, 17 Jun 2018 05:36:37 -0700 (PDT) Received: from pesky.lan (84.32.136.95.rev.vodafone.pt. [95.136.32.84]) by smtp.gmail.com with ESMTPSA id h11-v6sm11850494wrs.85.2018.06.17.05.36.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 05:36:36 -0700 (PDT) Sender: Mark Johnston Date: Sun, 17 Jun 2018 08:36:34 -0400 From: Mark Johnston To: Eitan Adler Cc: src-committers , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split Message-ID: <20180617123634.GB18322@pesky.lan> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> <20180613140731.GA54540@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 12:36:39 -0000 On Sat, Jun 16, 2018 at 06:25:03PM -0700, Eitan Adler wrote: > On 13 June 2018 at 07:07, Mark Johnston wrote: > > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote: > >> On Wednesday, June 13, 2018, Ed Maste wrote: > >> > >> > On Tue, 12 Jun 2018 at 18:17, Sean Bruno wrote: > >> > > > >> > > On 06/12/18 16:05, Oliver Pinter wrote: > >> > > > On 5/22/18, Ed Maste wrote: > >> > > >> Author: emaste > >> > > >> Date: Tue May 22 14:35:33 2018 > >> > > >> New Revision: 334046 > >> > > >> URL: https://svnweb.freebsd.org/changeset/base/334046 > >> > > >> > >> > > >> Log: > >> > > >> intel-ucode-split: add -n flag to skip creating output files > >> > > >> > >> > > >> Sponsored by: The FreeBSD Foundation > >> > > >> > >> > > >> Modified: > >> > > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c > >> > > > > >> > > > Hi! > >> > > > > >> > > > Could you please MFC the intel-ucode-split related commits to > >> > 11-STABLE? > >> > > > > >> > > > Thanks, > >> > > > op > >> > > > >> > > Do you need it in base for some reason? This code is already in the > >> > > devcpu-data port and is used when the port is built. Its not needed for > >> > > anything AFAIK. > >> > > >> > Indeed, the real use in FreeBSD is via the devcpu-data port; I > >> > committed it to src/tools/ for collaboration and testing. I'll merge > >> > it to stable/11 if it will be useful for someone, but am curious about > >> > the use case. > >> > > >> > >> > >> I'm considering to write an in kernel microcode update facility, based on > >> firmware(9), and in first idea it would be nice during the generation of > >> firmware modules. > > > > FWIW, I'm working on this for 12.0 and was planning to describe my > > proposal on -arch in the next couple of weeks. For my purposes at > > least, firmware(9) isn't suitable. We'd like to ensure that updates are > > applied before the kernel does CPU identification, and that happens > > quite early during boot. This places some constraints on the > > implementation which exclude firmware(9). > > Naive question, knowing nothing about firmware(9), but why can't it be > enhanced to work that early? It seems there might be other use-cases > for very-early-boot firmware application. The constraint means that almost none of the standard kernel APIs (e.g., malloc()) are usable at the time that the update is to be applied. It doesn't seem practical to me to try and implement firmware(9)'s abstractions under such limitations. Further, because microcode updating is an platform-specific operation, in this case it's preferable to tie the implementation to that platform's code. From owner-svn-src-all@freebsd.org Sun Jun 17 12:50:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BD41101DDB6 for ; Sun, 17 Jun 2018 12:50:46 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: from mail-yw0-x242.google.com (mail-yw0-x242.google.com [IPv6:2607:f8b0:4002:c05::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DD736D340 for ; Sun, 17 Jun 2018 12:50:46 +0000 (UTC) (envelope-from oliver.pinter@hardenedbsd.org) Received: by mail-yw0-x242.google.com with SMTP id u124-v6so4813242ywg.0 for ; Sun, 17 Jun 2018 05:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VHLWHiWVKKbO3K/0cw2wFWORNou3JKJ6eUrJGucxcwM=; b=mH2HGzejZSaIDMsztqrIKewrhBieJ7PNu7JrIr4uCS47bqcovkrD3L9SGyGWlBk7NV V/zvgRrZPuwVUjVBkdOl7GXYzDlC9tsiwAOk/HnzzIySAu5axEni2IVu3BhaLuofqp2p gNNdryHN017rFz9nxJe4353doseIhefZA/kBOnwIYRJqLk7jZvyeoD7xC/k1aU5Phn9x i6PuNBfzi9pSKxKXNdRH4jY342ihG9axHMInPUcqjuQy5t17aIelugPiBV4dgWLHmwCn f41NpAKg2XviMliz3UiKuxXnlSGfrbcU4p7r36GNnWTF0LqBJOzYH6gcUBdGgLo7vG39 iAhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VHLWHiWVKKbO3K/0cw2wFWORNou3JKJ6eUrJGucxcwM=; b=DXsZxENRAp6dcG6xzPhAIPwejQvTzw9QmIrFeem7j03NDtbE8ONJW1Y0EbbFtWmOJ2 5E55XVZMXk47FSOxK9JFG7z2a6UQqgrDiGgXy0DRp8CvsmTcgez3Qp4LCInVraDPam6e PflYFL92cuxJcu//SSKxbe6Z0FvmJiC2d4p8a8up+AGCj1t9zE59RitY9RUFjay2mQXv hgC3AdGAP9tWLdiVnstyV9Lv/eooK+mg/GK9xRAIxCOsNicpZwKnuLfWDlhQiPyXqPiN GkFySmoUE8M/dfzktAwmXlnsD0eCHqrn740ZlEWdN4bi87ok7lZTSvrXZARd8pGvs0jT h/7Q== X-Gm-Message-State: APt69E0HHZtYbX+gjDisRI/ITQKMMGJLk+o3fxa35VJt8hZ4ts3sKa8q 9jk5v9IWYUU+QJKjkXIPFazq7Flzh1sPvSlda2lN2Q== X-Google-Smtp-Source: ADUXVKKFr9rHt1JE+tEVtzwvYfzNNHWvUGK8nDlEU4lMziZQJvOMydFtAsmOLz/zKLxaUT3Fy9OpU/FTeAeCWv5FFjA= X-Received: by 2002:a81:b86:: with SMTP id 128-v6mr4228165ywl.214.1529239845123; Sun, 17 Jun 2018 05:50:45 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:db86:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 05:50:44 -0700 (PDT) In-Reply-To: <20180617123634.GB18322@pesky.lan> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> <20180613140731.GA54540@raichu> <20180617123634.GB18322@pesky.lan> From: Oliver Pinter Date: Sun, 17 Jun 2018 14:50:44 +0200 Message-ID: Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split To: Mark Johnston Cc: Eitan Adler , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 12:50:46 -0000 On Sunday, June 17, 2018, Mark Johnston wrote: > On Sat, Jun 16, 2018 at 06:25:03PM -0700, Eitan Adler wrote: > > On 13 June 2018 at 07:07, Mark Johnston wrote: > > > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote: > > >> On Wednesday, June 13, 2018, Ed Maste wrote: > > >> > > >> > On Tue, 12 Jun 2018 at 18:17, Sean Bruno > wrote: > > >> > > > > >> > > On 06/12/18 16:05, Oliver Pinter wrote: > > >> > > > On 5/22/18, Ed Maste wrote: > > >> > > >> Author: emaste > > >> > > >> Date: Tue May 22 14:35:33 2018 > > >> > > >> New Revision: 334046 > > >> > > >> URL: https://svnweb.freebsd.org/changeset/base/334046 > > >> > > >> > > >> > > >> Log: > > >> > > >> intel-ucode-split: add -n flag to skip creating output files > > >> > > >> > > >> > > >> Sponsored by: The FreeBSD Foundation > > >> > > >> > > >> > > >> Modified: > > >> > > >> head/tools/tools/intel-ucode-split/intel-ucode-split.c > > >> > > > > > >> > > > Hi! > > >> > > > > > >> > > > Could you please MFC the intel-ucode-split related commits to > > >> > 11-STABLE? > > >> > > > > > >> > > > Thanks, > > >> > > > op > > >> > > > > >> > > Do you need it in base for some reason? This code is already in > the > > >> > > devcpu-data port and is used when the port is built. Its not > needed for > > >> > > anything AFAIK. > > >> > > > >> > Indeed, the real use in FreeBSD is via the devcpu-data port; I > > >> > committed it to src/tools/ for collaboration and testing. I'll merge > > >> > it to stable/11 if it will be useful for someone, but am curious > about > > >> > the use case. > > >> > > > >> > > >> > > >> I'm considering to write an in kernel microcode update facility, > based on > > >> firmware(9), and in first idea it would be nice during the generation > of > > >> firmware modules. > > > > > > FWIW, I'm working on this for 12.0 and was planning to describe my > > > proposal on -arch in the next couple of weeks. For my purposes at > > > least, firmware(9) isn't suitable. We'd like to ensure that updates > are > > > applied before the kernel does CPU identification, and that happens > > > quite early during boot. This places some constraints on the > > > implementation which exclude firmware(9). > > > > Naive question, knowing nothing about firmware(9), but why can't it be > > enhanced to work that early? It seems there might be other use-cases > > for very-early-boot firmware application. > > The constraint means that almost none of the standard kernel APIs (e.g., > malloc()) are usable at the time that the update is to be applied. It > doesn't seem practical to me to try and implement firmware(9)'s > abstractions under such limitations. Further, because microcode > updating is an platform-specific operation, in this case it's preferable > to tie the implementation to that platform's code. How do you plan to put the firmware into memory? Preload it with the loader or compile into kernel module or with somehow early fs access from kernel? Or instead of updating the microcode from kernel, do the whole process from the loader? This will be problematic in resume case. _______________________________________________ > 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 Sun Jun 17 12:57:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB067101E155; Sun, 17 Jun 2018 12:57:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F7916D791; Sun, 17 Jun 2018 12:57:20 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-wm0-x243.google.com with SMTP id z6-v6so11876176wma.0; Sun, 17 Jun 2018 05:57:20 -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:user-agent; bh=J977th4S7twX6i1moKUOYQ1GtW7z7JupoLe+rdDy/e0=; b=VJnZuRSgpJjJOFWK5cimAZJiS+77X/W6YyKqMjeywGcS+Ce1Bokv8yIBtvoHBdtJfY GpGvFhNoBPIeB3d/+bxGSgoAIezDyTvS8aO1y7VkZt1Rr3/mMt/eo/7tT+sIDNMRFYnX hwbXiLXJBTL0/WDIjQnMsAPNO1x9h7mt+LS5BLn27w5H1mKlVZOUdlsXDK2KnsD8l6Qn zbLdBJF6w9eUL7QNQ5drnuRhUycJ/tD32w/bkLEDI8mGbZHX+CpLlpLKoIw6GXD0ok+w KRmrCpNaG9GtIqOEA0pw4jhPznSv7VaOWobj54BDtW9aTIXT3uE3flynY1FDHqWhQDws fGAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=J977th4S7twX6i1moKUOYQ1GtW7z7JupoLe+rdDy/e0=; b=tnX+MbycsLpeAOjhpr0TyIwb3Jsj1EFip4lGFo0IpDlGElGbilM5z8tWzHgLE9UIBt cHADadRRbf7WVo5n870cuo0IOq+PZFPHw+aFYRqq47NBrbmRCJbBF0jKSSP+AqSIAD7N CEHzMJoSBGFIUNEVS2Kk/MP/8i+b1bfeiA8FR+4GDLLRc1hQvEbfOsOtxXjcRA/RBWPW iILlgzNjskYXXGH9QpAa0QACYpBIS0n2MExUaLELL3IfiYanzc0Vl2FX+BrWp0/5SXpd p8yJi9xG1PwOxyHYSiIfNNbdRl54i7ZzZb34MbkZyq2N/O5+/IubOleON2uK1Bo0e6xl iC7w== X-Gm-Message-State: APt69E2AB+H2MqJFdpjgLwG0F9qQeuAL7oInXos9xVgsp6SSqNrYYkA9 ahYs+I8nZTLxWjO7nRO1MIM= X-Google-Smtp-Source: ADUXVKJ6mZwa/TtnXtxfgrrVOHWEG82IkQBwCs+mboMNOYl8JqXj9WMMftMEUYiRYSSUuIwfhUY0Kw== X-Received: by 2002:a1c:908b:: with SMTP id s133-v6mr6305127wmd.35.1529240239189; Sun, 17 Jun 2018 05:57:19 -0700 (PDT) Received: from pesky.lan (84.32.136.95.rev.vodafone.pt. [95.136.32.84]) by smtp.gmail.com with ESMTPSA id k17-v6sm7964272wmc.23.2018.06.17.05.57.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Jun 2018 05:57:18 -0700 (PDT) Sender: Mark Johnston Date: Sun, 17 Jun 2018 08:57:16 -0400 From: Mark Johnston To: Oliver Pinter Cc: Eitan Adler , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , src-committers Subject: Re: svn commit: r334046 - head/tools/tools/intel-ucode-split Message-ID: <20180617125715.GC18322@pesky.lan> References: <201805221435.w4MEZXnW041963@repo.freebsd.org> <20180613140731.GA54540@raichu> <20180617123634.GB18322@pesky.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 12:57:21 -0000 On Sun, Jun 17, 2018 at 02:50:44PM +0200, Oliver Pinter wrote: > On Sunday, June 17, 2018, Mark Johnston wrote: > > > On Sat, Jun 16, 2018 at 06:25:03PM -0700, Eitan Adler wrote: > > > On 13 June 2018 at 07:07, Mark Johnston wrote: > > > > On Wed, Jun 13, 2018 at 01:46:34AM +0200, Oliver Pinter wrote: > > > >> I'm considering to write an in kernel microcode update facility, > > based on > > > >> firmware(9), and in first idea it would be nice during the generation > > of > > > >> firmware modules. > > > > > > > > FWIW, I'm working on this for 12.0 and was planning to describe my > > > > proposal on -arch in the next couple of weeks. For my purposes at > > > > least, firmware(9) isn't suitable. We'd like to ensure that updates > > are > > > > applied before the kernel does CPU identification, and that happens > > > > quite early during boot. This places some constraints on the > > > > implementation which exclude firmware(9). > > > > > > Naive question, knowing nothing about firmware(9), but why can't it be > > > enhanced to work that early? It seems there might be other use-cases > > > for very-early-boot firmware application. > > > > The constraint means that almost none of the standard kernel APIs (e.g., > > malloc()) are usable at the time that the update is to be applied. It > > doesn't seem practical to me to try and implement firmware(9)'s > > abstractions under such limitations. Further, because microcode > > updating is an platform-specific operation, in this case it's preferable > > to tie the implementation to that platform's code. > > > How do you plan to put the firmware into memory? Preload it with the loader > or compile into kernel module or with somehow early fs access from kernel? > > Or instead of updating the microcode from kernel, do the whole process from > the loader? > This will be problematic in resume case. The loader can be instructed to load arbitrary files into memory before beginning execution of the kernel. Currently, my plan is to check for a loaded microcode file early in the MD startup code, and apply the update if one is present. This will be done following a resume as well. From owner-svn-src-all@freebsd.org Sun Jun 17 14:13:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 596FB102065A; Sun, 17 Jun 2018 14:13:46 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F12176FBC1; Sun, 17 Jun 2018 14:13:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCD5016691; Sun, 17 Jun 2018 14:13:45 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HEDjHB024515; Sun, 17 Jun 2018 14:13:45 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HEDjqE024514; Sun, 17 Jun 2018 14:13:45 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806171413.w5HEDjqE024514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 17 Jun 2018 14:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335283 - head X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335283 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 14:13:46 -0000 Author: ian Date: Sun Jun 17 14:13:45 2018 New Revision: 335283 URL: https://svnweb.freebsd.org/changeset/base/335283 Log: Build LOCAL_LIB_DIRS along with system lib dirs, rather than building them in parallel with LOCAL_DIRS and all the other system post-libs stuff. Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Sun Jun 17 07:08:47 2018 (r335282) +++ head/Makefile.inc1 Sun Jun 17 14:13:45 2018 (r335283) @@ -245,6 +245,17 @@ X${BINUTIL}?= ${${BINUTIL}} SUBDIR= ${SUBDIR_OVERRIDE} .else SUBDIR= lib libexec +# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR +# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and +# LOCAL_LIB_DIRS=foo/lib to behave as expected. +.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} +_REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} +.endfor +.for _DIR in ${LOCAL_LIB_DIRS} +.if ${_DIR} == ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)) +SUBDIR+= ${_DIR} +.endif +.endfor .if !defined(NO_ROOT) && (make(installworld) || make(install)) # Ensure libraries are installed before progressing. SUBDIR+=.WAIT @@ -280,17 +291,6 @@ SUBDIR+= tests # the LOCAL_DIRS and LOCAL_LIB_DIRS lists as needed. .for _DIR in ${LOCAL_DIRS} .if ${_DIR} == ".WAIT" || exists(${.CURDIR}/${_DIR}/Makefile) -SUBDIR+= ${_DIR} -.endif -.endfor -# Add LOCAL_LIB_DIRS, but only if they will not be picked up as a SUBDIR -# of a LOCAL_DIRS directory. This allows LOCAL_DIRS=foo and -# LOCAL_LIB_DIRS=foo/lib to behave as expected. -.for _DIR in ${LOCAL_DIRS:M*/} ${LOCAL_DIRS:N*/:S|$|/|} -_REDUNDANT_LIB_DIRS+= ${LOCAL_LIB_DIRS:M${_DIR}*} -.endfor -.for _DIR in ${LOCAL_LIB_DIRS} -.if ${_DIR} == ".WAIT" || (empty(_REDUNDANT_LIB_DIRS:M${_DIR}) && exists(${.CURDIR}/${_DIR}/Makefile)) SUBDIR+= ${_DIR} .endif .endfor From owner-svn-src-all@freebsd.org Sun Jun 17 15:07:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC4491022592; Sun, 17 Jun 2018 15:07:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 08683718D7; Sun, 17 Jun 2018 15:07:46 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5HF7ihg060647; Sun, 17 Jun 2018 08:07:44 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5HF7gdT060646; Sun, 17 Jun 2018 08:07:42 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806171507.w5HF7gdT060646@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: <201806170315.w5H3FHOD058428@pdx.rh.CN85.dnsmgr.net> To: rgrimes@freebsd.org Date: Sun, 17 Jun 2018 08:07:42 -0700 (PDT) CC: Juli Mallett , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 15:07:47 -0000 > > > > > > >> Author: eadler > > > > > > >> Date: Sat Jun 16 23:50:34 2018 > > > > > > >> New Revision: 335270 > > > > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > > > > > >> > > > > > > >> Log: > > > > > > >> liby: build with WARNS=6 > > > > > > >> > > > > > > >> Tested with amd64, arm64, i386, mips > > > > > > >> > > > > > > >> Added: > > > > > > >> head/lib/liby/yyerror.h (contents, props changed) > > Just says added, not copied from some file, so VCS here does > nothing for saying where this file came from. > > > > > > > >> Modified: > > > > > > >> head/lib/liby/Makefile > > > > > > >> head/lib/liby/main.c > > > > > > >> head/lib/liby/yyerror.c > > > > > > >> > > > > > > >> Modified: head/lib/liby/Makefile > > > > > > >> ============================================================ > > > > > ================== > > > > > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > > > > > (r335269) > > > > > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > > > > > (r335270) > > > > > > >> @@ -5,6 +5,4 @@ LIB= y > > > > > > >> SRCS= main.c yyerror.c > > > > > > >> NO_PIC= > > > > > > >> > > > > > > >> -WARNS?= 1 > > > > > > >> - > > > > > > >> .include > > > > > > >> > > > > > > >> Modified: head/lib/liby/main.c > > > > > > >> ============================================================ > > > > > ================== > > > > > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > > > > > (r335269) > > > > > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > > > > > (r335270) > > > > > > >> @@ -32,16 +32,17 @@ > > > > > > >> #include > > > > > > >> __FBSDID("$FreeBSD$"); > > > > > > >> > > > > > > >> -#ifndef lint > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/4/93"; > > > > > > >> -#endif /* not lint */ > > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > > >> > > > > > > >> #include > > > > > > >> > > > > > > >> -int yyparse(void); > > > > > > >> +#include "yyerror.h" > > > > > > >> > > > > > > >> int > > > > > > >> main(void) > > > > > > >> { > > > > > > >> + > > > > > > >> exit(yyparse()); > > > > > > >> } > > > > > > >> > > > > > > >> Modified: head/lib/liby/yyerror.c > > > > > > >> ============================================================ > > > > > ================== > > > > > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > > > > > (r335269) > > > > > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > > > > > (r335270) > > > > > > >> @@ -32,16 +32,18 @@ > > > > > > >> #include > > > > > > >> __FBSDID("$FreeBSD$"); > > > > > > >> > > > > > > >> -#ifndef lint > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) > > > 6/4/93"; > > > > > > >> -#endif /* not lint */ > > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > > >> > > > > > > >> #include > > > > > > >> > > > > > > >> +#include "yyerror.h" > > > > > > >> + > > > > > > >> int > > > > > > >> -yyerror(msg) > > > > > > >> -char *msg; > > > > > > >> +yyerror(const char *msg) > > > > > > >> { > > > > > > >> - (void)fprintf(stderr, "%s\n", msg); > > > > > > >> + > > > > > > >> + fprintf(stderr, "%s\n", msg); > > > > > > >> return(0); > > > > > > >> } > > > > > > >> > > > > > > >> Added: head/lib/liby/yyerror.h > > > > > > >> ============================================================ > > > > > ================== > > > > > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > > > > > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > > > > > (r335270) > > > > > > >> @@ -0,0 +1,36 @@ > > > > > > > > > > > > > > Where did this file come from???? > > > > > > > > > > > > I added a header file instead of keeping the prototypes in the .c > > > > > > files. Is something wrong with that? > > > > > > > > > > If you extracted part of a c file and placed it in a .h file, you > > > > > should add a > > > > > * from: pathname > > > > > comment to this yyerror.h > > > > > > > > > > > > > Rod, > > > > > > > > It's two prototypes. For functions that are extern. Including the UCB > > > > copyright isn't even necessary, but seems reasonable. > > > > > > Actually including a 1990/1993 UCB copyright is -exactly- why > > > the from: line should be there. If he had assigned his own > > > copyright to this I wouldn't of batted an eye, but he didn't, > > > which means he copied it from someplace. I would like to have > > > that someplace clearly documented as has always historically > > > been done when copying parts of or whole files around the > > > BSD source tree. See style(9), specifically: After any copyright header, there is a blank line, and the $FreeBSD$ for non C/C++ language source files. Version control system ID tags should only exist once in a file (unlike in this one). Non-C/C++ source files follow the example above, while C/C++ source files follow the one below. All VCS (version control system) revision identification in files obtained from elsewhere should be maintained, including, where applicable, multiple IDs showing a file's history. In general, do not edit foreign IDs or their infrastructure. Unless otherwise wrapped (such as ``#if defined(LIBC_SCCS)''), enclose both in ``#if 0 ... #endif'' to hide any uncompilable bits and to keep the IDs out of object files. Only add ``From: '' in front of foreign VCS IDs if the file is renamed. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ For this purpose the copyright has been copied from one file and placed into another file, and that qualifies as a "rename". All UCB copyrights should be trackable to a RCS/SCCSID. I am embarrassed that I had to actual go hunt for this, since it is a style(9) item it should be well known and used at all times, I should of known exactly where this text was. If you know of places that we copied the UCB copyright into another file and did not maintain this VCS history chain I would very much like to know of them so that we might post fact correct this. Regards, Rod > > > > > > His commit message also lacked any details about this move > > > of code, it just said, build with WARNS=6. > > > > > > > > > > > No, people do not need to add "from:" notes when adding a header to > > > provide > > > > prototypes for extern functions. > > > > > > They do if they infact copied a portion of another file... > > > > > > I don't think this has been a FreeBSD norm since at least the late '90s for > > both trivial and nontrivial refactoring. We have good version control. > > The version control says 0 about where this file came from, > the commit message should of. > > > If this is the expectation, I'd love it if you could find somewhere it's > > written down, or if it's not, start an FCP to get it written down. It > > seems important for this to be codified if people should expect to get > > called out on a mailing list for not doing it. It is codified. > So all things must be written now? I do not think that holds true > for most things. Perhaps this has died, but I would still like to > see this file marked as derived from to explain the attribution to > UCB, as that also is a bit abnormal to do without saying why your > attributing it to them. > > I do know that from: was written, someplace in one of the guides, > I shall strive to find it. Found. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 15:22:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A66CE1022A5B; Sun, 17 Jun 2018 15:22:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B0E872091; Sun, 17 Jun 2018 15:22:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3C1CE170FB; Sun, 17 Jun 2018 15:22:28 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HFMSFY059507; Sun, 17 Jun 2018 15:22:28 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HFMSJE059506; Sun, 17 Jun 2018 15:22:28 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806171522.w5HFMSJE059506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 15:22:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335284 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335284 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 15:22:28 -0000 Author: asomers Date: Sun Jun 17 15:22:27 2018 New Revision: 335284 URL: https://svnweb.freebsd.org/changeset/base/335284 Log: audit(4): add tests for extattr_get_file(2) and friends This commit includes extattr_{get_file, get_fd, get_link, list_file, list_fd, list_link}. It does not include any syscalls that modify, set, or delete extended attributes, as those are in a different audit class. Submitted by: aniketpt MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15859 Modified: head/tests/sys/audit/file-attribute-access.c Modified: head/tests/sys/audit/file-attribute-access.c ============================================================================== --- head/tests/sys/audit/file-attribute-access.c Sun Jun 17 14:13:45 2018 (r335283) +++ head/tests/sys/audit/file-attribute-access.c Sun Jun 17 15:22:27 2018 (r335284) @@ -26,6 +26,7 @@ */ #include +#include #include #include #include @@ -45,7 +46,9 @@ static int filedesc, fhdesc; static char extregex[80]; static struct stat statbuff; static struct statfs statfsbuff; +static const char *buff = "ezio"; static const char *auclass = "fa"; +static const char *name = "authorname"; static const char *path = "fileforaudit"; static const char *errpath = "dirdoesnotexist/fileforaudit"; static const char *successreg = "fileforaudit.*return,success"; @@ -799,6 +802,340 @@ ATF_TC_CLEANUP(fpathconf_failure, tc) } +ATF_TC_WITH_CLEANUP(extattr_get_file_success); +ATF_TC_HEAD(extattr_get_file_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_get_file(2) call"); +} + +ATF_TC_BODY(extattr_get_file_success, tc) +{ + /* File needs to exist to call extattr_get_file(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Set an extended attribute to be retrieved later on */ + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_file.*%s.*%s.*return,success", path, name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_get_file(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_get_file_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_get_file_failure); +ATF_TC_HEAD(extattr_get_file_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_get_file(2) call"); +} + +ATF_TC_BODY(extattr_get_file_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_file.*%s.*%s.*failure", path, name); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, extattr_get_file(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_get_file_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_get_fd_success); +ATF_TC_HEAD(extattr_get_fd_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_get_fd(2) call"); +} + +ATF_TC_BODY(extattr_get_fd_success, tc) +{ + /* File needs to exist to call extattr_get_fd(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Set an extended attribute to be retrieved later on */ + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_fd.*%s.*return,success", name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_get_fd(filedesc, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_get_fd_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_get_fd_failure); +ATF_TC_HEAD(extattr_get_fd_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_get_fd(2) call"); +} + +ATF_TC_BODY(extattr_get_fd_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_fd.*%s.*return,failure : Bad file descriptor", name); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, extattr_get_fd(-1, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_get_fd_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_get_link_success); +ATF_TC_HEAD(extattr_get_link_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_get_link(2) call"); +} + +ATF_TC_BODY(extattr_get_link_success, tc) +{ + /* Symbolic link needs to exist to call extattr_get_link(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + /* Set an extended attribute to be retrieved later on */ + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_link.*%s.*%s.*return,success", path, name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_get_link(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_get_link_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_get_link_failure); +ATF_TC_HEAD(extattr_get_link_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_get_link(2) call"); +} + +ATF_TC_BODY(extattr_get_link_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_get_link.*%s.*%s.*failure", path, name); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, extattr_get_link(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_get_link_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_file_success); +ATF_TC_HEAD(extattr_list_file_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_list_file(2) call"); +} + +ATF_TC_BODY(extattr_list_file_success, tc) +{ + int readbuff; + /* File needs to exist to call extattr_list_file(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((readbuff = extattr_list_file(path, + EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_file.*%s.*return,success,%d", path, readbuff); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_list_file_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_file_failure); +ATF_TC_HEAD(extattr_list_file_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_list_file(2) call"); +} + +ATF_TC_BODY(extattr_list_file_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_file.*%s.*return,failure", path); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, extattr_list_file(path, + EXTATTR_NAMESPACE_USER, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_list_file_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_fd_success); +ATF_TC_HEAD(extattr_list_fd_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_list_fd(2) call"); +} + +ATF_TC_BODY(extattr_list_fd_success, tc) +{ + int readbuff; + /* File needs to exist to call extattr_list_fd(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((readbuff = extattr_list_fd(filedesc, + EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_fd.*return,success,%d", readbuff); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_list_fd_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_fd_failure); +ATF_TC_HEAD(extattr_list_fd_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_list_fd(2) call"); +} + +ATF_TC_BODY(extattr_list_fd_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_fd.*return,failure : Bad file descriptor"); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, + extattr_list_fd(-1, EXTATTR_NAMESPACE_USER, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_list_fd_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_link_success); +ATF_TC_HEAD(extattr_list_link_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_list_link(2) call"); +} + +ATF_TC_BODY(extattr_list_link_success, tc) +{ + int readbuff; + /* Symbolic link needs to exist to call extattr_list_link(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + + ATF_REQUIRE((readbuff = extattr_list_link(path, + EXTATTR_NAMESPACE_USER, NULL, 0)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_link.*%s.*return,success,%d", path, readbuff); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_list_link_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_list_link_failure); +ATF_TC_HEAD(extattr_list_link_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_list_link(2) call"); +} + +ATF_TC_BODY(extattr_list_link_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_list_link.*%s.*failure", path); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, extattr_list_link(path, + EXTATTR_NAMESPACE_USER, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_list_link_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, stat_success); @@ -838,6 +1175,20 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, lpathconf_failure); ATF_TP_ADD_TC(tp, fpathconf_success); ATF_TP_ADD_TC(tp, fpathconf_failure); + + ATF_TP_ADD_TC(tp, extattr_get_file_success); + ATF_TP_ADD_TC(tp, extattr_get_file_failure); + ATF_TP_ADD_TC(tp, extattr_get_fd_success); + ATF_TP_ADD_TC(tp, extattr_get_fd_failure); + ATF_TP_ADD_TC(tp, extattr_get_link_success); + ATF_TP_ADD_TC(tp, extattr_get_link_failure); + + ATF_TP_ADD_TC(tp, extattr_list_file_success); + ATF_TP_ADD_TC(tp, extattr_list_file_failure); + ATF_TP_ADD_TC(tp, extattr_list_fd_success); + ATF_TP_ADD_TC(tp, extattr_list_fd_failure); + ATF_TP_ADD_TC(tp, extattr_list_link_success); + ATF_TP_ADD_TC(tp, extattr_list_link_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Jun 17 15:27:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2797B1022B9B for ; Sun, 17 Jun 2018 15:27:27 +0000 (UTC) (envelope-from juli@northcloak.com) Received: from mail-qt0-x22f.google.com (mail-qt0-x22f.google.com [IPv6:2607:f8b0:400d:c0d::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA0097229D for ; Sun, 17 Jun 2018 15:27:26 +0000 (UTC) (envelope-from juli@northcloak.com) Received: by mail-qt0-x22f.google.com with SMTP id l10-v6so13210633qtj.0 for ; Sun, 17 Jun 2018 08:27:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=northcloak-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Z8N/np7vjxcdf+Xwjm06Ppk/RHJGK1gQRQ+eOLOjno4=; b=AmlGkZorgEo6CgP+zHyrUUWWIvGTQPPlwALxuOl4zCZKKohAAXHN3XZRMgUDITvq6M 9HX2C+QgXudZs2/tLrWpGlgEnK5Q0N924j8nLGN+OgTMximZ508TiwwHtMR2jsazB/uk 9iNorj8BrNgsxV0gwitoFpfFUOHg1vMVQcUDGZfxjZ6kdt4vlcQFZXMEheu/zhcd3oWc mcUrEythWE6l+wda2Drn+L4KBTQepP0gdx/6s0p2O0PyhTEE9bJiJCvUkUdIzFyzd8Ui Ez6TE7/nr+zffqkuN3IHAhWECaDheC1srlIGpFtKMmnvBL2xRZ8lFSBCmbuQDCECu3MP d+uA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Z8N/np7vjxcdf+Xwjm06Ppk/RHJGK1gQRQ+eOLOjno4=; b=B/okPTBrjZ1LYpetCc7lwySQATlWnqNLMtu1lrPYz6v28LGGv3uLMwaQvG/+ZSPCGN t+2J+Ulsw2jCjMB/rDeGu+bcSrRE4tL2efYgCCQ7EyG/Oq/XWpENF6KVAUo663eW/TkR VDiPjT6fh1RWemghL3wlXC7WNQB5y8MT48ggOtc5O0Z3WKzyPTyJpMwy6BEdhM8zb1zY tJMLP0wCfcCX7YmAtE7a5qoHSSE0zLpLF4rkutCEjfK4LQFJBGOb5AgY4AHNihkaw7I9 E+44c2Y/JEa4ewvoMF5rjGxIpzxSRnr8pEtAJ4PHwAViymHbS92pJSCuD59GYnHLR4j8 frWQ== X-Gm-Message-State: APt69E1JcSSXIG/7gD8SVk00Lq+G2erKJlpFbU2w4IeWG/eSiZdKrpeU KsQzHFIM8PK7GPc8wKMrNxAoOwFd9k3mJLB1PxQ9mg== X-Google-Smtp-Source: ADUXVKKXFPzMMwZJaQgKKRBxAC8V+WZkrfrja6xu6XYKzUi4YN5sVblbeifRJpH5u9uKYzB7eY9TjYiX9hDQlueXhUo= X-Received: by 2002:a0c:d276:: with SMTP id o51-v6mr7869374qvh.182.1529249246161; Sun, 17 Jun 2018 08:27:26 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2221:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 08:26:45 -0700 (PDT) In-Reply-To: <201806171507.w5HF7gdT060646@pdx.rh.CN85.dnsmgr.net> References: <201806170315.w5H3FHOD058428@pdx.rh.CN85.dnsmgr.net> <201806171507.w5HF7gdT060646@pdx.rh.CN85.dnsmgr.net> From: Juli Mallett Date: Sun, 17 Jun 2018 08:26:45 -0700 Message-ID: Subject: Re: svn commit: r335270 - head/lib/liby To: rgrimes@freebsd.org Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 15:27:27 -0000 On 17 June 2018 at 08:07, Rodney W. Grimes wrote: > > > > > > > >> Author: eadler > > > > > > > >> Date: Sat Jun 16 23:50:34 2018 > > > > > > > >> New Revision: 335270 > > > > > > > >> URL: https://svnweb.freebsd.org/changeset/base/335270 > > > > > > > >> > > > > > > > >> Log: > > > > > > > >> liby: build with WARNS=6 > > > > > > > >> > > > > > > > >> Tested with amd64, arm64, i386, mips > > > > > > > >> > > > > > > > >> Added: > > > > > > > >> head/lib/liby/yyerror.h (contents, props changed) > > > > Just says added, not copied from some file, so VCS here does > > nothing for saying where this file came from. > > > > > > > > > >> Modified: > > > > > > > >> head/lib/liby/Makefile > > > > > > > >> head/lib/liby/main.c > > > > > > > >> head/lib/liby/yyerror.c > > > > > > > >> > > > > > > > >> Modified: head/lib/liby/Makefile > > > > > > > >> ============================== > ============================== > > > > > > ================== > > > > > > > >> --- head/lib/liby/Makefile Sat Jun 16 23:49:22 2018 > > > > > > (r335269) > > > > > > > >> +++ head/lib/liby/Makefile Sat Jun 16 23:50:34 2018 > > > > > > (r335270) > > > > > > > >> @@ -5,6 +5,4 @@ LIB= y > > > > > > > >> SRCS= main.c yyerror.c > > > > > > > >> NO_PIC= > > > > > > > >> > > > > > > > >> -WARNS?= 1 > > > > > > > >> - > > > > > > > >> .include > > > > > > > >> > > > > > > > >> Modified: head/lib/liby/main.c > > > > > > > >> ============================== > ============================== > > > > > > ================== > > > > > > > >> --- head/lib/liby/main.c Sat Jun 16 23:49:22 2018 > > > > > > (r335269) > > > > > > > >> +++ head/lib/liby/main.c Sat Jun 16 23:50:34 2018 > > > > > > (r335270) > > > > > > > >> @@ -32,16 +32,17 @@ > > > > > > > >> #include > > > > > > > >> __FBSDID("$FreeBSD$"); > > > > > > > >> > > > > > > > >> -#ifndef lint > > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > > >> static char sccsid[] = "@(#)main.c 8.1 (Berkeley) > 6/4/93"; > > > > > > > >> -#endif /* not lint */ > > > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > > > >> > > > > > > > >> #include > > > > > > > >> > > > > > > > >> -int yyparse(void); > > > > > > > >> +#include "yyerror.h" > > > > > > > >> > > > > > > > >> int > > > > > > > >> main(void) > > > > > > > >> { > > > > > > > >> + > > > > > > > >> exit(yyparse()); > > > > > > > >> } > > > > > > > >> > > > > > > > >> Modified: head/lib/liby/yyerror.c > > > > > > > >> ============================== > ============================== > > > > > > ================== > > > > > > > >> --- head/lib/liby/yyerror.c Sat Jun 16 23:49:22 2018 > > > > > > (r335269) > > > > > > > >> +++ head/lib/liby/yyerror.c Sat Jun 16 23:50:34 2018 > > > > > > (r335270) > > > > > > > >> @@ -32,16 +32,18 @@ > > > > > > > >> #include > > > > > > > >> __FBSDID("$FreeBSD$"); > > > > > > > >> > > > > > > > >> -#ifndef lint > > > > > > > >> +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > > >> static char sccsid[] = "@(#)yyerror.c 8.1 (Berkeley) > > > > 6/4/93"; > > > > > > > >> -#endif /* not lint */ > > > > > > > >> +#endif /* LIBC_SCCS and not lint */ > > > > > > > >> > > > > > > > >> #include > > > > > > > >> > > > > > > > >> +#include "yyerror.h" > > > > > > > >> + > > > > > > > >> int > > > > > > > >> -yyerror(msg) > > > > > > > >> -char *msg; > > > > > > > >> +yyerror(const char *msg) > > > > > > > >> { > > > > > > > >> - (void)fprintf(stderr, "%s\n", msg); > > > > > > > >> + > > > > > > > >> + fprintf(stderr, "%s\n", msg); > > > > > > > >> return(0); > > > > > > > >> } > > > > > > > >> > > > > > > > >> Added: head/lib/liby/yyerror.h > > > > > > > >> ============================== > ============================== > > > > > > ================== > > > > > > > >> --- /dev/null 00:00:00 1970 (empty, because file is newly > added) > > > > > > > >> +++ head/lib/liby/yyerror.h Sat Jun 16 23:50:34 2018 > > > > > > (r335270) > > > > > > > >> @@ -0,0 +1,36 @@ > > > > > > > > > > > > > > > > Where did this file come from???? > > > > > > > > > > > > > > I added a header file instead of keeping the prototypes in the > .c > > > > > > > files. Is something wrong with that? > > > > > > > > > > > > If you extracted part of a c file and placed it in a .h file, you > > > > > > should add a > > > > > > * from: pathname > > > > > > comment to this yyerror.h > > > > > > > > > > > > > > > > Rod, > > > > > > > > > > It's two prototypes. For functions that are extern. Including > the UCB > > > > > copyright isn't even necessary, but seems reasonable. > > > > > > > > Actually including a 1990/1993 UCB copyright is -exactly- why > > > > the from: line should be there. If he had assigned his own > > > > copyright to this I wouldn't of batted an eye, but he didn't, > > > > which means he copied it from someplace. I would like to have > > > > that someplace clearly documented as has always historically > > > > been done when copying parts of or whole files around the > > > > BSD source tree. > > See style(9), specifically: > After any copyright header, there is a blank line, and the $FreeBSD$ > for > non C/C++ language source files. Version control system ID tags > should > only exist once in a file (unlike in this one). Non-C/C++ source > files > follow the example above, while C/C++ source files follow the one > below. > All VCS (version control system) revision identification in files > obtained from elsewhere should be maintained, including, where > applicable, multiple IDs showing a file's history. In general, do not > edit foreign IDs or their infrastructure. Unless otherwise wrapped > (such > as ``#if defined(LIBC_SCCS)''), enclose both in ``#if 0 ... #endif'' > to > hide any uncompilable bits and to keep the IDs out of object files. > Only > add ``From: '' in front of foreign VCS IDs if the file is renamed. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > For this purpose the copyright has been copied from one file and placed > into another file, and that qualifies as a "rename". All UCB copyrights > should be trackable to a RCS/SCCSID. > > I am embarrassed that I had to actual go hunt for this, since it > is a style(9) item it should be well known and used at all times, > I should of known exactly where this text was. > Rod, this refers to doing things like this: /sys/libkern/ia64/bswap16.S: * from: NetBSD: htons.S,v 1.1 1996/04/17 22:36:54 cgd Saying that you should leave the $NetBSD$ stuff, and _only_ add from: in front of it if the file has been renamed. (In practice, we violate this constantly, and put from: in front of foreign VCS IDs frequently even where the file has the same name.) Please reread the whole paragraph and not just the bit that says ``From:'' Thanks! Juli. > If you know of places that we copied the UCB copyright into > another file and did not maintain this VCS history chain I > would very much like to know of them so that we might post > fact correct this. > > Regards, > Rod > > > > > > > > > His commit message also lacked any details about this move > > > > of code, it just said, build with WARNS=6. > > > > > > > > > > > > > > No, people do not need to add "from:" notes when adding a header to > > > > provide > > > > > prototypes for extern functions. > > > > > > > > They do if they infact copied a portion of another file... > > > > > > > > > I don't think this has been a FreeBSD norm since at least the late > '90s for > > > both trivial and nontrivial refactoring. We have good version control. > > > > The version control says 0 about where this file came from, > > the commit message should of. > > > > > If this is the expectation, I'd love it if you could find somewhere > it's > > > written down, or if it's not, start an FCP to get it written down. It > > > seems important for this to be codified if people should expect to get > > > called out on a mailing list for not doing it. > > It is codified. > > > So all things must be written now? I do not think that holds true > > for most things. Perhaps this has died, but I would still like to > > see this file marked as derived from to explain the attribution to > > UCB, as that also is a bit abnormal to do without saying why your > > attributing it to them. > > > > I do know that from: was written, someplace in one of the guides, > > I shall strive to find it. > > Found. > > > -- > Rod Grimes > rgrimes@freebsd.org > From owner-svn-src-all@freebsd.org Sun Jun 17 15:49:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB1931023372 for ; Sun, 17 Jun 2018 15:49:59 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2A7EE72C7D for ; Sun, 17 Jun 2018 15:49:59 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 114a9dba-7246-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 114a9dba-7246-11e8-b829-b3adae557cda; Sun, 17 Jun 2018 15:49:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5HFnnr5072461; Sun, 17 Jun 2018 09:49:49 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529250589.20460.19.camel@freebsd.org> Subject: Re: svn commit: r335270 - head/lib/liby From: Ian Lepore To: Juli Mallett , rgrimes@freebsd.org Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 17 Jun 2018 09:49:49 -0600 In-Reply-To: References: <201806170315.w5H3FHOD058428@pdx.rh.CN85.dnsmgr.net> <201806171507.w5HF7gdT060646@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 15:49:59 -0000 On Sun, 2018-06-17 at 08:26 -0700, Juli Mallett wrote: > On 17 June 2018 at 08:07, Rodney W. Grimes > wrote: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Author: eadler > > > > > > > > > > Date: Sat Jun 16 23:50:34 2018 > > > > > > > > > > New Revision: 335270 > > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/335270 > > > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > >   liby: build with WARNS=6 > > > > > > > > > > > > > > > > > > > >   Tested with amd64, arm64, i386, mips > > > > > > > > > > > > > > > > > > > > Added: > > > > > > > > > >   head/lib/liby/yyerror.h   (contents, props changed) > > > Just says added, not copied from some file, so VCS here does > > > nothing for saying where this file came from. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Modified: > > > > > > > > > >   head/lib/liby/Makefile > > > > > > > > > >   head/lib/liby/main.c > > > > > > > > > >   head/lib/liby/yyerror.c > > > > > > > > > > > > > > > > > > > > Modified: head/lib/liby/Makefile > > > > > > > > > > ============================== > > ============================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- head/lib/liby/Makefile    Sat Jun 16 23:49:22 2018 > > > > > > > (r335269) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +++ head/lib/liby/Makefile    Sat Jun 16 23:50:34 2018 > > > > > > > (r335270) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -5,6 +5,4 @@ LIB=  y > > > > > > > > > >  SRCS=        main.c yyerror.c > > > > > > > > > >  NO_PIC= > > > > > > > > > > > > > > > > > > > > -WARNS?=      1 > > > > > > > > > > - > > > > > > > > > >  .include > > > > > > > > > > > > > > > > > > > > Modified: head/lib/liby/main.c > > > > > > > > > > ============================== > > ============================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- head/lib/liby/main.c      Sat Jun 16 23:49:22 2018 > > > > > > > (r335269) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +++ head/lib/liby/main.c      Sat Jun 16 23:50:34 2018 > > > > > > > (r335270) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -32,16 +32,17 @@ > > > > > > > > > >  #include > > > > > > > > > >  __FBSDID("$FreeBSD$"); > > > > > > > > > > > > > > > > > > > > -#ifndef lint > > > > > > > > > > +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > > > > >  static char sccsid[] = "@(#)main.c   8.1 (Berkeley) > > 6/4/93"; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -#endif /* not lint */ > > > > > > > > > > +#endif /* LIBC_SCCS and not lint */ > > > > > > > > > > > > > > > > > > > >  #include > > > > > > > > > > > > > > > > > > > > -int yyparse(void); > > > > > > > > > > +#include "yyerror.h" > > > > > > > > > > > > > > > > > > > >  int > > > > > > > > > >  main(void) > > > > > > > > > >  { > > > > > > > > > > + > > > > > > > > > >       exit(yyparse()); > > > > > > > > > >  } > > > > > > > > > > > > > > > > > > > > Modified: head/lib/liby/yyerror.c > > > > > > > > > > ============================== > > ============================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- head/lib/liby/yyerror.c   Sat Jun 16 23:49:22 2018 > > > > > > > (r335269) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +++ head/lib/liby/yyerror.c   Sat Jun 16 23:50:34 2018 > > > > > > > (r335270) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -32,16 +32,18 @@ > > > > > > > > > >  #include > > > > > > > > > >  __FBSDID("$FreeBSD$"); > > > > > > > > > > > > > > > > > > > > -#ifndef lint > > > > > > > > > > +#if defined(LIBC_SCCS) && !defined(lint) > > > > > > > > > >  static char sccsid[] = "@(#)yyerror.c        8.1 (Berkeley) > > > > > 6/4/93"; > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -#endif /* not lint */ > > > > > > > > > > +#endif /* LIBC_SCCS and not lint */ > > > > > > > > > > > > > > > > > > > >  #include > > > > > > > > > > > > > > > > > > > > +#include "yyerror.h" > > > > > > > > > > + > > > > > > > > > >  int > > > > > > > > > > -yyerror(msg) > > > > > > > > > > -char *msg; > > > > > > > > > > +yyerror(const char *msg) > > > > > > > > > >  { > > > > > > > > > > -     (void)fprintf(stderr, "%s\n", msg); > > > > > > > > > > + > > > > > > > > > > +     fprintf(stderr, "%s\n", msg); > > > > > > > > > >       return(0); > > > > > > > > > >  } > > > > > > > > > > > > > > > > > > > > Added: head/lib/liby/yyerror.h > > > > > > > > > > ============================== > > ============================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ================== > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > --- /dev/null 00:00:00 1970   (empty, because file is newly > > added) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > +++ head/lib/liby/yyerror.h   Sat Jun 16 23:50:34 2018 > > > > > > > (r335270) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > @@ -0,0 +1,36 @@ > > > > > > > > > Where did this file come from???? > > > > > > > > I added a header file instead of keeping the prototypes in the > > .c > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > files. Is something wrong with that? > > > > > > > If you extracted part of a c file and placed it in a .h file, you > > > > > > > should add a > > > > > > >  * from:        pathname > > > > > > > comment to this yyerror.h > > > > > > > > > > > > > Rod, > > > > > > > > > > > > It's two prototypes.  For functions that are extern.  Including > > the UCB > > > > > > > > > > > > > > > > > > > > > > > > copyright isn't even necessary, but seems reasonable. > > > > > Actually including a 1990/1993 UCB copyright is -exactly- why > > > > > the from: line should be there.  If he had assigned his own > > > > > copyright to this I wouldn't of batted an eye, but he didn't, > > > > > which means he copied it from someplace.  I would like to have > > > > > that someplace clearly documented as has always historically > > > > > been done when copying parts of or whole files around the > > > > > BSD source tree. > > See style(9), specifically: > >      After any copyright header, there is a blank line, and the $FreeBSD$ > > for > >      non C/C++ language source files.  Version control system ID tags > > should > >      only exist once in a file (unlike in this one).  Non-C/C++ source > > files > >      follow the example above, while C/C++ source files follow the one > > below. > >      All VCS (version control system) revision identification in files > >      obtained from elsewhere should be maintained, including, where > >      applicable, multiple IDs showing a file's history.  In general, do not > >      edit foreign IDs or their infrastructure.  Unless otherwise wrapped > > (such > >      as ``#if defined(LIBC_SCCS)''), enclose both in ``#if 0 ... #endif'' > > to > >      hide any uncompilable bits and to keep the IDs out of object files. > > Only > >      add ``From: '' in front of foreign VCS IDs if the file is renamed. > >           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > > > For this purpose the copyright has  been copied from one file and placed > > into another file, and that qualifies as a "rename".   All UCB copyrights > > should be trackable to a RCS/SCCSID. > > > > I am embarrassed that I had to actual go hunt for this, since it > > is a style(9) item it should be well known and used at all times, > > I should of known exactly where this text was. > > > Rod, this refers to doing things like this: > > /sys/libkern/ia64/bswap16.S: *  from: NetBSD: htons.S,v 1.1 1996/04/17 > 22:36:54 cgd > > Saying that you should leave the $NetBSD$ stuff, and _only_ add from: in > front of it if the file has been renamed.  (In practice, we violate this > constantly, and put from: in front of foreign VCS IDs frequently even where > the file has the same name.) > > Please reread the whole paragraph and not just the bit that says ``From:'' > > Thanks! > > Juli. > > > > > > If you know of places that we copied the UCB copyright into > > another file and did not maintain this VCS history chain I > > would very much like to know of them so that we might post > > fact correct this. > > > > Regards, > > Rod > > > > > > > > > > > > > > > > > > > > > > > > His commit message also lacked any details about this move > > > > > of code, it just said, build with WARNS=6. > > > > > > > > > > > > > > > > > > > > > > > No, people do not need to add "from:" notes when adding a header to > > > > > provide > > > > > > > > > > > > prototypes for extern functions. > > > > > They do if they infact copied a portion of another file... > > > > > > > > I don't think this has been a FreeBSD norm since at least the late > > '90s for > > > > > > > > > > > both trivial and nontrivial refactoring.  We have good version control. > > > The version control says 0 about where this file came from, > > > the commit message should of. > > > > > > > > > > > If this is the expectation, I'd love it if you could find somewhere > > it's > > > > > > > > > > > written down, or if it's not, start an FCP to get it written down.  It > > > > seems important for this to be codified if people should expect to get > > > > called out on a mailing list for not doing it. > > It is codified. > > > > > > > > So all things must be written now?  I do not think that holds true > > > for most things.  Perhaps this has died, but I would still like to > > > see this file marked as derived from to explain the attribution to > > > UCB, as that also is a bit abnormal to do without saying why your > > > attributing it to them. > > > > > > I do know that from: was written, someplace in one of the guides, > > > I shall strive to find it. > > Found. All this drama about "copying" one line of text and adding another to create a new file. The no-brainer fix is to add a proper new-file license and stop arguing about what flavor of copying and what rules might apply to that. And for something that might actually matter: nobody seems to have noticed that this new header file lacks the standard include guards (something which style(9) seems to be silent about). -- Ian From owner-svn-src-all@freebsd.org Sun Jun 17 15:53:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 847D81023951 for ; Sun, 17 Jun 2018 15:53:16 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3071B7320D for ; Sun, 17 Jun 2018 15:53:16 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f178.google.com (mail-yb0-f178.google.com [209.85.213.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id EEAE0B47E for ; Sun, 17 Jun 2018 15:53:15 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f178.google.com with SMTP id q62-v6so5149335ybg.5 for ; Sun, 17 Jun 2018 08:53:15 -0700 (PDT) X-Gm-Message-State: APt69E29qnanmzsAkmzQvVc55Z95j063GQVhJLpg/gJSDY+ZlLzhs2p7 VI5fJxPhGxn12LnjCU6Qq87gBugoPF+JYy/SxJY4ZA== X-Google-Smtp-Source: ADUXVKJOlB9SxcDfO+LPeBttIo2hyMMw4EbckLgv9eqxNMb5beQVr/qyhSrMNEChtMKr2PYU4FSqT1G1vro+Z3/woEs= X-Received: by 2002:a25:2605:: with SMTP id m5-v6mr4852975ybm.89.1529250795352; Sun, 17 Jun 2018 08:53:15 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 08:52:44 -0700 (PDT) In-Reply-To: <1529250589.20460.19.camel@freebsd.org> References: <201806170315.w5H3FHOD058428@pdx.rh.CN85.dnsmgr.net> <201806171507.w5HF7gdT060646@pdx.rh.CN85.dnsmgr.net> <1529250589.20460.19.camel@freebsd.org> From: Eitan Adler Date: Sun, 17 Jun 2018 08:52:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335270 - head/lib/liby To: Ian Lepore Cc: Juli Mallett , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 15:53:16 -0000 On 17 June 2018 at 08:49, Ian Lepore wrote: > All this drama about "copying" one line of text and adding another to > create a new file. The no-brainer fix is to add a proper new-file > license and stop arguing about what flavor of copying and what rules > might apply to that. I didn't add my copyright since I didn't write it. I'll rewrite from scratch and add my own new-file copyright. This file contains precisely zero creative output [0] so it should't matter too much. > And for something that might actually matter: nobody seems to have > noticed that this new header file lacks the standard include guards > (something which style(9) seems to be silent about). Good point. [0] Oracle v Google notwithstanding -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Jun 17 16:20:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 005A4100085C; Sun, 17 Jun 2018 16:20:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71D52740CA; Sun, 17 Jun 2018 16:20:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5HGKAh5060871; Sun, 17 Jun 2018 09:20:10 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5HGKAvG060870; Sun, 17 Jun 2018 09:20:10 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806171620.w5HGKAvG060870@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335270 - head/lib/liby In-Reply-To: To: Eitan Adler Date: Sun, 17 Jun 2018 09:20:10 -0700 (PDT) CC: Ian Lepore , Juli Mallett , "Rodney W. Grimes" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 16:20:20 -0000 > On 17 June 2018 at 08:49, Ian Lepore wrote: > > All this drama about "copying" one line of text and adding another to > > create a new file. The no-brainer fix is to add a proper new-file > > license and stop arguing about what flavor of copying and what rules > > might apply to that. > > I didn't add my copyright since I didn't write it. I'll rewrite from > scratch and add my own new-file copyright. This file contains > precisely zero creative output [0] so it should't matter too much. I am fine with that solution. I am *not* fine with stamping UCB copyrights on something without source traceability to the UCB file that it came from. I hope all can understand that issue. If you can't lets take it offline. > > > And for something that might actually matter: nobody seems to have > > noticed that this new header file lacks the standard include guards > > (something which style(9) seems to be silent about). > > Good point. You normally do not need to do include guards on header files used by a single program. > > [0] Oracle v Google notwithstanding > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Sun Jun 17 16:24:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DEFD1000B44; Sun, 17 Jun 2018 16:24:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7A87454D; Sun, 17 Jun 2018 16:24:47 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DB43F17BD4; Sun, 17 Jun 2018 16:24:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HGOk5O091039; Sun, 17 Jun 2018 16:24:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HGOkbT091038; Sun, 17 Jun 2018 16:24:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806171624.w5HGOkbT091038@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 16:24:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335285 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335285 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 16:24:47 -0000 Author: asomers Date: Sun Jun 17 16:24:46 2018 New Revision: 335285 URL: https://svnweb.freebsd.org/changeset/base/335285 Log: audit(4): Add tests for a few syscalls in the ad class The ad audit class is for administrative commands. This commit adds test for settimeofday, adjtime, and getfh. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15861 Added: head/tests/sys/audit/administrative.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Sun Jun 17 15:22:27 2018 (r335284) +++ head/tests/sys/audit/Makefile Sun Jun 17 16:24:46 2018 (r335285) @@ -12,6 +12,7 @@ ATF_TESTS_C+= file-read ATF_TESTS_C+= open ATF_TESTS_C+= network ATF_TESTS_C+= inter-process +ATF_TESTS_C+= administrative SRCS.file-attribute-access+= file-attribute-access.c SRCS.file-attribute-access+= utils.c @@ -33,6 +34,8 @@ SRCS.network+= network.c SRCS.network+= utils.c SRCS.inter-process+= inter-process.c SRCS.inter-process+= utils.c +SRCS.administrative+= administrative.c +SRCS.administrative+= utils.c TEST_METADATA+= timeout="30" TEST_METADATA+= required_user="root" Added: head/tests/sys/audit/administrative.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/administrative.c Sun Jun 17 16:24:46 2018 (r335285) @@ -0,0 +1,214 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include + +#include +#include +#include + +#include "utils.h" + +static pid_t pid; +static int filedesc; +static mode_t mode = 0777; +static struct pollfd fds[1]; +static char adregex[60]; +static const char *auclass = "ad"; +static const char *path = "fileforaudit"; + + +ATF_TC_WITH_CLEANUP(settimeofday_success); +ATF_TC_HEAD(settimeofday_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "settimeofday(2) call"); +} + +ATF_TC_BODY(settimeofday_success, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "settimeofday.*%d.*success", pid); + + struct timeval tp; + struct timezone tzp; + ATF_REQUIRE_EQ(0, gettimeofday(&tp, &tzp)); + + FILE *pipefd = setup(fds, auclass); + /* Setting the same time as obtained by gettimeofday(2) */ + ATF_REQUIRE_EQ(0, settimeofday(&tp, &tzp)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(settimeofday_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(settimeofday_failure); +ATF_TC_HEAD(settimeofday_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "settimeofday(2) call"); +} + +ATF_TC_BODY(settimeofday_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "settimeofday.*%d.*failure", pid); + + struct timeval tp; + struct timezone tzp; + ATF_REQUIRE_EQ(0, gettimeofday(&tp, &tzp)); + + FILE *pipefd = setup(fds, auclass); + tp.tv_sec = -1; + /* Failure reason: Invalid value for tp.tv_sec; */ + ATF_REQUIRE_EQ(-1, settimeofday(&tp, &tzp)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(settimeofday_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(adjtime_success); +ATF_TC_HEAD(adjtime_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "adjtime(2) call"); +} + +ATF_TC_BODY(adjtime_success, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "adjtime.*%d.*return,success", pid); + + FILE *pipefd = setup(fds, auclass); + /* We don't want to change the system time, hence NULL */ + ATF_REQUIRE_EQ(0, adjtime(NULL,NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(adjtime_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(adjtime_failure); +ATF_TC_HEAD(adjtime_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "adjtime(2) call"); +} + +ATF_TC_BODY(adjtime_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "adjtime.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, adjtime((struct timeval *)(-1), NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(adjtime_failure, tc) +{ + cleanup(); +} + + + +ATF_TC_WITH_CLEANUP(nfs_getfh_success); +ATF_TC_HEAD(nfs_getfh_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "getfh(2) call"); +} + +ATF_TC_BODY(nfs_getfh_success, tc) +{ + fhandle_t fhp; + pid = getpid(); + snprintf(adregex, sizeof(adregex), "nfs_getfh.*%d.*ret.*success", pid); + + /* File needs to exist to call getfh(2) */ + ATF_REQUIRE(filedesc = open(path, O_CREAT, mode) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, getfh(path, &fhp)); + check_audit(fds, adregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(nfs_getfh_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(nfs_getfh_failure); +ATF_TC_HEAD(nfs_getfh_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "getfh(2) call"); +} + +ATF_TC_BODY(nfs_getfh_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "nfs_getfh.*%d.*ret.*failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, getfh(path, NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(nfs_getfh_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, settimeofday_success); + ATF_TP_ADD_TC(tp, settimeofday_failure); + ATF_TP_ADD_TC(tp, adjtime_success); + ATF_TP_ADD_TC(tp, adjtime_failure); + + ATF_TP_ADD_TC(tp, nfs_getfh_success); + ATF_TP_ADD_TC(tp, nfs_getfh_failure); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Sun Jun 17 16:30:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 306021000CBD; Sun, 17 Jun 2018 16:30:08 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0B767475A; Sun, 17 Jun 2018 16:30:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AE38217BE1; Sun, 17 Jun 2018 16:30:07 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HGU7lr091335; Sun, 17 Jun 2018 16:30:07 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HGU6u3091331; Sun, 17 Jun 2018 16:30:06 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806171630.w5HGU6u3091331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 17 Jun 2018 16:30:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335286 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 335286 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 16:30:08 -0000 Author: rmacklem Date: Sun Jun 17 16:30:06 2018 New Revision: 335286 URL: https://svnweb.freebsd.org/changeset/base/335286 Log: Make the pNFS NFSv4.1 client return a Flexible File layout upon error. The Flexible File layout LayoutReturn operation has argument fields where an I/O error encountered when attempting I/O on a DS can be reported back to the MDS. This patch adds code to the client to do this for the Flexible File layout mirrored case. This patch should only affect mounts using the "pnfs" option against servers that support the Flexible File layout. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfs/nfsclstate.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Sun Jun 17 16:24:46 2018 (r335285) +++ head/sys/fs/nfs/nfs_var.h Sun Jun 17 16:30:06 2018 (r335286) @@ -528,7 +528,7 @@ int nfsrpc_layoutcommit(struct nfsmount *, uint8_t *, NFSPROC_T *, void *); int nfsrpc_layoutreturn(struct nfsmount *, uint8_t *, int, int, int, uint32_t, int, uint64_t, uint64_t, nfsv4stateid_t *, struct ucred *, NFSPROC_T *, - void *); + uint32_t, uint32_t, char *); int nfsrpc_reclaimcomplete(struct nfsmount *, struct ucred *, NFSPROC_T *); int nfscl_doiods(vnode_t, struct uio *, int *, int *, uint32_t, int, struct ucred *, NFSPROC_T *); @@ -601,6 +601,7 @@ int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, uint64_t, struct nfsclflayout **, int *); +void nfscl_dserr(uint32_t, struct nfscldevinfo *, struct nfscllayout *); void nfscl_rellayout(struct nfscllayout *, int); struct nfscldevinfo *nfscl_getdevinfo(struct nfsclclient *, uint8_t *, struct nfscldevinfo *); Modified: head/sys/fs/nfs/nfsclstate.h ============================================================================== --- head/sys/fs/nfs/nfsclstate.h Sun Jun 17 16:24:46 2018 (r335285) +++ head/sys/fs/nfs/nfsclstate.h Sun Jun 17 16:30:06 2018 (r335286) @@ -340,6 +340,9 @@ struct nfsclrecalllayout { int nfsrecly_recalltype; uint32_t nfsrecly_iomode; uint32_t nfsrecly_stateseqid; + uint32_t nfsrecly_stat; + uint32_t nfsrecly_op; + char nfsrecly_devid[NFSX_V4DEVICEID]; }; /* Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 17 16:24:46 2018 (r335285) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Sun Jun 17 16:30:06 2018 (r335286) @@ -5203,10 +5203,11 @@ int nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, int fhlen, int reclaim, int layouttype, uint32_t iomode, int layoutreturn, uint64_t offset, uint64_t len, nfsv4stateid_t *stateidp, struct ucred *cred, NFSPROC_T *p, - void *stuff) + uint32_t stat, uint32_t op, char *devid) { uint32_t *tl; struct nfsrv_descript nfsd, *nd = &nfsd; + uint64_t tu64; int error; nfscl_reqstart(nd, NFSPROC_LAYOUTRETURN, nmp, fh, fhlen, NULL, NULL, @@ -5234,11 +5235,32 @@ nfsrpc_layoutreturn(struct nfsmount *nmp, uint8_t *fh, if (layouttype == NFSLAYOUT_NFSV4_1_FILES) *tl = txdr_unsigned(0); else if (layouttype == NFSLAYOUT_FLEXFILE) { - *tl = txdr_unsigned(2 * NFSX_UNSIGNED); - NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); - /* No ioerrs or stats yet. */ - *tl++ = 0; - *tl = 0; + if (stat != 0) { + *tl = txdr_unsigned(2 * NFSX_HYPER + + NFSX_STATEID + NFSX_V4DEVICEID + 5 * + NFSX_UNSIGNED); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_HYPER + + NFSX_STATEID + NFSX_V4DEVICEID + 5 * + NFSX_UNSIGNED); + *tl++ = txdr_unsigned(1); /* One error. */ + tu64 = 0; /* Offset. */ + txdr_hyper(tu64, tl); tl += 2; + tu64 = UINT64_MAX; /* Length. */ + txdr_hyper(tu64, tl); tl += 2; + NFSBCOPY(stateidp, tl, NFSX_STATEID); + tl += (NFSX_STATEID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(1); /* One error. */ + NFSBCOPY(devid, tl, NFSX_V4DEVICEID); + tl += (NFSX_V4DEVICEID / NFSX_UNSIGNED); + *tl++ = txdr_unsigned(stat); + *tl++ = txdr_unsigned(op); + } else { + *tl = txdr_unsigned(2 * NFSX_UNSIGNED); + NFSM_BUILD(tl, uint32_t *, 2 * NFSX_UNSIGNED); + /* No ioerrs. */ + *tl++ = 0; + } + *tl = 0; /* No stats yet. */ } } nd->nd_flag |= ND_USEGSSNAME; @@ -6017,6 +6039,12 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * error = nfsrpc_commitds(vp, off, xfer, *dspp, fhp, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); + NFSCL_DEBUG(4, "commitds=%d\n", error); + if (nfsds_failerr(error)) { + NFSCL_DEBUG(4, + "DS layreterr for commit\n"); + nfscl_dserr(NFSV4OP_COMMIT, dp, lyp); + } } NFSCL_DEBUG(4, "aft nfsio_commitds=%d\n", error); if (error == 0) { @@ -6031,11 +6059,16 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * np->n_flag &= ~NDSCOMMIT; mtx_unlock(&np->n_mtx); } - } else if (rwflag == NFSV4OPEN_ACCESSREAD) + } else if (rwflag == NFSV4OPEN_ACCESSREAD) { error = nfsrpc_readds(vp, uiop, stateidp, eofp, *dspp, off, xfer, fhp, 1, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); - else { + NFSCL_DEBUG(4, "readds=%d\n", error); + if (nfsds_failerr(error)) { + NFSCL_DEBUG(4, "DS layreterr for read\n"); + nfscl_dserr(NFSV4OP_READ, dp, lyp); + } + } else { if (flp->nfsfl_mirrorcnt == 1) { error = nfsrpc_writeds(vp, uiop, iomode, must_commit, stateidp, *dspp, off, xfer, @@ -6066,6 +6099,11 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * xfer, fhp, m, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); NFSCL_DEBUG(4, "nfsio_writedsmir=%d\n", error); + if (nfsds_failerr(error)) { + NFSCL_DEBUG(4, + "DS layreterr for write\n"); + nfscl_dserr(NFSV4OP_WRITE, dp, lyp); + } } } NFSCL_DEBUG(4, "aft read/writeds=%d\n", error); Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 17 16:24:46 2018 (r335285) +++ head/sys/fs/nfsclient/nfs_clstate.c Sun Jun 17 16:30:06 2018 (r335286) @@ -164,7 +164,7 @@ static void nfscl_emptylockowner(struct nfscllockowner static void nfscl_mergeflayouts(struct nfsclflayouthead *, struct nfsclflayouthead *); static int nfscl_layoutrecall(int, struct nfscllayout *, uint32_t, uint64_t, - uint64_t, uint32_t, struct nfsclrecalllayout *); + uint64_t, uint32_t, uint32_t, uint32_t, char *, struct nfsclrecalllayout *); static int nfscl_seq(uint32_t, uint32_t); static void nfscl_layoutreturn(struct nfsmount *, struct nfscllayout *, struct ucred *, NFSPROC_T *); @@ -2762,7 +2762,8 @@ tryagain2: break; (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, NFSLAYOUTIOMODE_ANY, 0, UINT64_MAX, - lyp->nfsly_stateid.seqid, recallp); + lyp->nfsly_stateid.seqid, 0, 0, NULL, + recallp); } lyp = nlyp; } @@ -3469,6 +3470,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) recalltype, lyp, iomode, off, len, stateid.seqid, + 0, 0, NULL, recallp); recallp = NULL; wakeup(clp); @@ -3503,6 +3505,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) lyp, iomode, 0, UINT64_MAX, lyp->nfsly_stateid.seqid, + 0, 0, NULL, recallp); recallp = NULL; gotone = 1; @@ -3526,7 +3529,7 @@ nfscl_docb(struct nfsrv_descript *nd, NFSPROC_T *p) recalltype, lyp, iomode, 0, UINT64_MAX, lyp->nfsly_stateid.seqid, - recallp); + 0, 0, NULL, recallp); recallp = NULL; gotone = 1; } @@ -4959,13 +4962,42 @@ nfscl_retoncloselayout(vnode_t vp, struct nfsclclient if (!LIST_EMPTY(&lyp->nfsly_flayrw)) iomode |= NFSLAYOUTIOMODE_RW; (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, - 0, UINT64_MAX, lyp->nfsly_stateid.seqid, *recallpp); + 0, UINT64_MAX, lyp->nfsly_stateid.seqid, 0, 0, NULL, + *recallpp); NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); *recallpp = NULL; } } /* + * Mark the layout to be recalled and with an error. + */ +void +nfscl_dserr(uint32_t op, struct nfscldevinfo *dp, struct nfscllayout *lyp) +{ + struct nfsclrecalllayout *recallp; + uint32_t iomode; + + recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); + iomode = 0; + NFSLOCKCLSTATE(); + if ((lyp->nfsly_flags & NFSLY_RECALL) == 0) { + if (!LIST_EMPTY(&lyp->nfsly_flayread)) + iomode |= NFSLAYOUTIOMODE_READ; + if (!LIST_EMPTY(&lyp->nfsly_flayrw)) + iomode |= NFSLAYOUTIOMODE_RW; + (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, + 0, UINT64_MAX, lyp->nfsly_stateid.seqid, NFSERR_IO, op, + dp->nfsdi_deviceid, recallp); + NFSUNLOCKCLSTATE(); + NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); + } else { + NFSUNLOCKCLSTATE(); + free(recallp, M_NFSLAYRECALL); + } +} + +/* * Dereference a layout. */ void @@ -5182,8 +5214,8 @@ nfscl_freedevinfo(struct nfscldevinfo *dip) */ static int nfscl_layoutrecall(int recalltype, struct nfscllayout *lyp, uint32_t iomode, - uint64_t off, uint64_t len, uint32_t stateseqid, - struct nfsclrecalllayout *recallp) + uint64_t off, uint64_t len, uint32_t stateseqid, uint32_t stat, uint32_t op, + char *devid, struct nfsclrecalllayout *recallp) { struct nfsclrecalllayout *rp, *orp; @@ -5192,6 +5224,10 @@ nfscl_layoutrecall(int recalltype, struct nfscllayout recallp->nfsrecly_stateseqid = stateseqid; recallp->nfsrecly_off = off; recallp->nfsrecly_len = len; + recallp->nfsrecly_stat = stat; + recallp->nfsrecly_op = op; + if (devid != NULL) + NFSBCOPY(devid, recallp->nfsrecly_devid, NFSX_V4DEVICEID); /* * Order the list as file returns first, followed by fsid and any * returns, both in increasing stateseqid order. @@ -5266,7 +5302,8 @@ nfscl_layoutreturn(struct nfsmount *nmp, struct nfscll lyp->nfsly_fhlen, 0, layouttype, rp->nfsrecly_iomode, rp->nfsrecly_recalltype, rp->nfsrecly_off, rp->nfsrecly_len, - &stateid, cred, p, NULL); + &stateid, cred, p, rp->nfsrecly_stat, rp->nfsrecly_op, + rp->nfsrecly_devid); } } From owner-svn-src-all@freebsd.org Sun Jun 17 17:10:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5815910028AB; Sun, 17 Jun 2018 17:10:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F095F75F68; Sun, 17 Jun 2018 17:10:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D1E3818266; Sun, 17 Jun 2018 17:10:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HHAZMW011938; Sun, 17 Jun 2018 17:10:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHAZmI011936; Sun, 17 Jun 2018 17:10:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806171710.w5HHAZmI011936@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 17:10:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335287 - head/contrib/openbsm/bin/praudit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/contrib/openbsm/bin/praudit X-SVN-Commit-Revision: 335287 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:10:36 -0000 Author: asomers Date: Sun Jun 17 17:10:35 2018 New Revision: 335287 URL: https://svnweb.freebsd.org/changeset/base/335287 Log: praudit(1): return 0 on success Cherry pick https://github.com/openbsm/openbsm/commit/ed83bb3 Submitted by: aniketp Reviewed by: rwatson, 0mp Obtained from: OpenBSM MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Pull Request: https://github.com/openbsm/openbsm/pull/32 Modified: head/contrib/openbsm/bin/praudit/praudit.1 head/contrib/openbsm/bin/praudit/praudit.c Modified: head/contrib/openbsm/bin/praudit/praudit.1 ============================================================================== --- head/contrib/openbsm/bin/praudit/praudit.1 Sun Jun 17 16:30:06 2018 (r335286) +++ head/contrib/openbsm/bin/praudit/praudit.1 Sun Jun 17 17:10:35 2018 (r335287) @@ -25,7 +25,7 @@ .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 4, 2009 +.Dd June 11, 2018 .Dt PRAUDIT 1 .Os .Sh NAME @@ -88,6 +88,8 @@ Events are displayed as per their descriptions given i .Pa /etc/security/audit_event ; UIDs and GIDs are expanded to their names; dates and times are displayed in human-readable format. +.Sh EXIT STATUS +.Ex -std .Sh FILES .Bl -tag -width ".Pa /etc/security/audit_control" -compact .It Pa /etc/security/audit_class Modified: head/contrib/openbsm/bin/praudit/praudit.c ============================================================================== --- head/contrib/openbsm/bin/praudit/praudit.c Sun Jun 17 16:30:06 2018 (r335286) +++ head/contrib/openbsm/bin/praudit/praudit.c Sun Jun 17 17:10:35 2018 (r335287) @@ -233,5 +233,5 @@ main(int argc, char **argv) if (oflags & AU_OFLAG_XML) au_print_xml_footer(stdout); - return (1); + return (0); } From owner-svn-src-all@freebsd.org Sun Jun 17 17:24:58 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4EA51002F56; Sun, 17 Jun 2018 17:24:58 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 661A4767CF; Sun, 17 Jun 2018 17:24:58 +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 45499185AF; Sun, 17 Jun 2018 17:24:58 +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 w5HHOwJH022428; Sun, 17 Jun 2018 17:24:58 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHOwVk022427; Sun, 17 Jun 2018 17:24:58 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171724.w5HHOwVk022427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:24: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: r335288 - stable/11/sys/dev/drm2/i915 X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/dev/drm2/i915 X-SVN-Commit-Revision: 335288 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:24:58 -0000 Author: dim Date: Sun Jun 17 17:24:57 2018 New Revision: 335288 URL: https://svnweb.freebsd.org/changeset/base/335288 Log: MFC r334946: Fix build of i915kms with base gcc Base gcc fails to compile sys/dev/drm2/i915/intel_display.c for i386, with the following -Werror warnings: cc1: warnings being treated as errors /usr/src/sys/dev/drm2/i915/intel_display.c:8884: warning: initialization from incompatible pointer type This is due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432, which incorrectly interprets the [] as a flexible array member. Because base gcc does not have a -W flag to suppress this particular warning, it requires a rather ugly cast. To not influence any other compiler, put it in a #if/#endif block. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D15744 Modified: stable/11/sys/dev/drm2/i915/intel_display.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/drm2/i915/intel_display.c ============================================================================== --- stable/11/sys/dev/drm2/i915/intel_display.c Sun Jun 17 17:10:35 2018 (r335287) +++ stable/11/sys/dev/drm2/i915/intel_display.c Sun Jun 17 17:24:57 2018 (r335288) @@ -8872,7 +8872,15 @@ static int intel_dmi_reverse_brightness(const struct d static const struct intel_dmi_quirk intel_dmi_quirks[] = { { - .dmi_id_list = &(const struct dmi_system_id[]) { + .dmi_id_list = +#if !defined(__clang__) && !__GNUC_PREREQ__(4, 3) + /* gcc 4.2 needs an additional cast, to avoid a bogus + * "initialization from incompatible pointer type" warning. + * see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36432 + */ + (const struct dmi_system_id (*)[]) +#endif + &(const struct dmi_system_id[]) { { .callback = intel_dmi_reverse_brightness, .ident = "NCR Corporation", From owner-svn-src-all@freebsd.org Sun Jun 17 17:28:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B3F010030D7; Sun, 17 Jun 2018 17:28:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BCDF676964; Sun, 17 Jun 2018 17:28:27 +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 9E2DF185B2; Sun, 17 Jun 2018 17:28:27 +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 w5HHSRC5022695; Sun, 17 Jun 2018 17:28:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHSRvM022694; Sun, 17 Jun 2018 17:28:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171728.w5HHSRvM022694@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335289 - in stable: 10/sys/dev/bxe 11/sys/dev/bxe X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/dev/bxe 11/sys/dev/bxe X-SVN-Commit-Revision: 335289 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:28:28 -0000 Author: dim Date: Sun Jun 17 17:28:27 2018 New Revision: 335289 URL: https://svnweb.freebsd.org/changeset/base/335289 Log: MFC r334948: Fix build of bxe with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so print these without casting. The kva field of struct bxe_bar is of type vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before printing. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D15733 Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/bxe/bxe.c ============================================================================== --- stable/11/sys/dev/bxe/bxe.c Sun Jun 17 17:24:57 2018 (r335288) +++ stable/11/sys/dev/bxe/bxe.c Sun Jun 17 17:28:27 2018 (r335289) @@ -12819,12 +12819,12 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%jd) -> %p\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#jx-%#jx (%jd) -> %#jx\n", i, PCIR_BAR(i), - (void *)rman_get_start(sc->bar[i].resource), - (void *)rman_get_end(sc->bar[i].resource), + rman_get_start(sc->bar[i].resource), + rman_get_end(sc->bar[i].resource), rman_get_size(sc->bar[i].resource), - (void *)sc->bar[i].kva); + (uintmax_t)sc->bar[i].kva); } return (0); From owner-svn-src-all@freebsd.org Sun Jun 17 17:28:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EEEB10030DC; Sun, 17 Jun 2018 17:28:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 209EB76965; Sun, 17 Jun 2018 17:28:28 +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 0214E185B3; Sun, 17 Jun 2018 17:28:28 +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 w5HHSR02022701; Sun, 17 Jun 2018 17:28:27 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHSRKO022700; Sun, 17 Jun 2018 17:28:27 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171728.w5HHSRKO022700@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:28:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335289 - in stable: 10/sys/dev/bxe 11/sys/dev/bxe X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in stable: 10/sys/dev/bxe 11/sys/dev/bxe X-SVN-Commit-Revision: 335289 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:28:28 -0000 Author: dim Date: Sun Jun 17 17:28:27 2018 New Revision: 335289 URL: https://svnweb.freebsd.org/changeset/base/335289 Log: MFC r334948: Fix build of bxe with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so print these without casting. The kva field of struct bxe_bar is of type vm_offset_t, which can be 32 or 64 bit, so cast it to uintmax_t before printing. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D15733 Modified: stable/10/sys/dev/bxe/bxe.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/sys/dev/bxe/bxe.c Directory Properties: stable/11/ (props changed) Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Sun Jun 17 17:24:57 2018 (r335288) +++ stable/10/sys/dev/bxe/bxe.c Sun Jun 17 17:28:27 2018 (r335289) @@ -12851,12 +12851,12 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%ld) -> %p\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#jx-%#jx (%jd) -> %#jx\n", i, PCIR_BAR(i), - (void *)rman_get_start(sc->bar[i].resource), - (void *)rman_get_end(sc->bar[i].resource), + rman_get_start(sc->bar[i].resource), + rman_get_end(sc->bar[i].resource), rman_get_size(sc->bar[i].resource), - (void *)sc->bar[i].kva); + (uintmax_t)sc->bar[i].kva); } return (0); From owner-svn-src-all@freebsd.org Sun Jun 17 17:31:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5885E10033D6; Sun, 17 Jun 2018 17:31:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04DDF76D1D; Sun, 17 Jun 2018 17:31:20 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DAA1C185F8; Sun, 17 Jun 2018 17:31:19 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HHVJwW023641; Sun, 17 Jun 2018 17:31:19 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHVHOA023626; Sun, 17 Jun 2018 17:31:17 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806171731.w5HHVHOA023626@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 17:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335290 - in head: etc/mtree usr.sbin/praudit usr.sbin/praudit/tests usr.sbin/praudit/tests/input X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: in head: etc/mtree usr.sbin/praudit usr.sbin/praudit/tests usr.sbin/praudit/tests/input X-SVN-Commit-Revision: 335290 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:31:20 -0000 Author: asomers Date: Sun Jun 17 17:31:16 2018 New Revision: 335290 URL: https://svnweb.freebsd.org/changeset/base/335290 Log: praudit(1): add tests Submitted by: aniketp MFC after: 2 weeks X-MFC-With: 335287 Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15751 Added: head/usr.sbin/praudit/tests/ head/usr.sbin/praudit/tests/Makefile (contents, props changed) head/usr.sbin/praudit/tests/input/ head/usr.sbin/praudit/tests/input/corrupted (contents, props changed) head/usr.sbin/praudit/tests/input/del_comma (contents, props changed) head/usr.sbin/praudit/tests/input/del_underscore (contents, props changed) head/usr.sbin/praudit/tests/input/no_args (contents, props changed) head/usr.sbin/praudit/tests/input/numeric_form (contents, props changed) head/usr.sbin/praudit/tests/input/raw_form (contents, props changed) head/usr.sbin/praudit/tests/input/same_line (contents, props changed) head/usr.sbin/praudit/tests/input/short_form (contents, props changed) head/usr.sbin/praudit/tests/input/trail (contents, props changed) head/usr.sbin/praudit/tests/input/xml_form (contents, props changed) head/usr.sbin/praudit/tests/praudit_test.sh (contents, props changed) Modified: head/etc/mtree/BSD.tests.dist head/usr.sbin/praudit/Makefile Modified: head/etc/mtree/BSD.tests.dist ============================================================================== --- head/etc/mtree/BSD.tests.dist Sun Jun 17 17:28:27 2018 (r335289) +++ head/etc/mtree/BSD.tests.dist Sun Jun 17 17:31:16 2018 (r335290) @@ -1028,6 +1028,8 @@ .. nmtree .. + praudit + .. pw .. rpcbind Modified: head/usr.sbin/praudit/Makefile ============================================================================== --- head/usr.sbin/praudit/Makefile Sun Jun 17 17:28:27 2018 (r335289) +++ head/usr.sbin/praudit/Makefile Sun Jun 17 17:31:16 2018 (r335290) @@ -14,4 +14,7 @@ WARNS?= 3 LIBADD= bsm +HAS_TESTS= +SUBDIR.${MK_TESTS}+= tests + .include Added: head/usr.sbin/praudit/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/Makefile Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,23 @@ +# $FreeBSD$ + +PACKAGE= tests + +TESTSDIR= ${TESTSBASE}/usr.sbin/praudit + +ATF_TESTS_SH= praudit_test + +${PACKAGE}FILES+= \ + input/trail \ + input/corrupted \ + input/del_comma \ + input/del_underscore \ + input/no_args \ + input/numeric_form \ + input/raw_form \ + input/same_line \ + input/short_form \ + input/xml_form + +TEST_METADATA+= timeout="10" + +.include Added: head/usr.sbin/praudit/tests/input/corrupted ============================================================================== Binary file. No diff available. Added: head/usr.sbin/praudit/tests/input/del_comma ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/del_comma Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Added: head/usr.sbin/praudit/tests/input/del_underscore ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/del_underscore Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +header_113_11_socket(2)_0_Mon Jun 11 10:18:45 2018_ + 380 msec +argument_1_0x1c_domain +argument_2_0x2_type +argument_3_0x0_protocol +subject_root_root_wheel_root_0_7053_4724_37636_10.0.2.2 +return_success_3 +trailer_113 Added: head/usr.sbin/praudit/tests/input/no_args ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/no_args Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Added: head/usr.sbin/praudit/tests/input/numeric_form ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/numeric_form Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Added: head/usr.sbin/praudit/tests/input/raw_form ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/raw_form Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +20,113,11,183,0,1528712325,380 +45,1,0x1c,domain +45,2,0x2,type +45,3,0x0,protocol +36,0,0,0,0,0,7053,4724,37636,10.0.2.2 +39,0,3 +19,113 Added: head/usr.sbin/praudit/tests/input/same_line ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/same_line Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1 @@ +header,113,11,socket(2),0,Mon Jun 11 10:18:45 2018, + 380 msec,argument,1,0x1c,domain,argument,2,0x2,type,argument,3,0x0,protocol,subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2,return,success,3,trailer,113, Added: head/usr.sbin/praudit/tests/input/short_form ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/short_form Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,7 @@ +header,113,11,AUE_SOCKET,0,Mon Jun 11 10:18:45 2018, + 380 msec +argument,1,0x1c,domain +argument,2,0x2,type +argument,3,0x0,protocol +subject,root,root,wheel,root,0,7053,4724,37636,10.0.2.2 +return,success,3 +trailer,113 Added: head/usr.sbin/praudit/tests/input/trail ============================================================================== Binary file. No diff available. Added: head/usr.sbin/praudit/tests/input/xml_form ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/input/xml_form Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,12 @@ + + + + + + + + + + + + Added: head/usr.sbin/praudit/tests/praudit_test.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/praudit/tests/praudit_test.sh Sun Jun 17 17:31:16 2018 (r335290) @@ -0,0 +1,183 @@ +# +# Copyright (c) 2018 Aniket Pandey +# +# 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$ +# + + +atf_test_case praudit_delim_comma +praudit_delim_comma_head() +{ + atf_set "descr" "Verify that comma delimiter is present with -d ',' cmd" +} + +praudit_delim_comma_body() +{ + atf_check -o file:$(atf_get_srcdir)/del_comma \ + praudit -d "," $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_delim_underscore +praudit_delim_underscore_head() +{ + atf_set "descr" "Verify that underscore delimiter is present with -d _" +} + +praudit_delim_underscore_body() +{ + atf_check -o file:$(atf_get_srcdir)/del_underscore \ + praudit -d "_" $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_no_args +praudit_no_args_head() +{ + atf_set "descr" "Verify that praudit outputs default form without " \ + "any arguments" +} + +praudit_no_args_body() +{ + atf_check -o file:$(atf_get_srcdir)/no_args \ + praudit $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_numeric_form +praudit_numeric_form_head() +{ + atf_set "descr" "Verify that praudit outputs the numeric form " \ + "with -n flag" +} + +praudit_numeric_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/numeric_form \ + praudit -n $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_raw_form +praudit_raw_form_head() +{ + atf_set "descr" "Verify that praudit outputs the raw form with -r flag" +} + +praudit_raw_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/raw_form \ + praudit -r $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_same_line +praudit_same_line_head() +{ + atf_set "descr" "Verify that praudit outputs the trail in the same " \ + "line with -l flag" +} + +praudit_same_line_body() +{ + atf_check -o file:$(atf_get_srcdir)/same_line \ + praudit -l $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_short_form +praudit_short_form_head() +{ + atf_set "descr" "Verify that praudit outputs the short form " \ + "with -s flag" +} + +praudit_short_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/short_form \ + praudit -s $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_xml_form +praudit_xml_form_head() +{ + atf_set "descr" "Verify that praudit outputs the XML file with -x flag" +} + +praudit_xml_form_body() +{ + atf_check -o file:$(atf_get_srcdir)/xml_form \ + praudit -x $(atf_get_srcdir)/trail +} + + +atf_test_case praudit_sync_to_next_record +praudit_sync_to_next_record_head() +{ + atf_set "descr" "Verify that praudit(1) outputs the last few audit " \ + "records when the initial part of the trail is " \ + "corrputed." +} + +praudit_sync_to_next_record_body() +{ + # The 'corrupted' binary file contains some redundant + # binary symbols before the actual audit record. + # Since 'praudit -p' syncs to the next legitimate record, + # it would skip the corrupted part and print the desired + # audit record to STDOUT. + atf_check -o file:$(atf_get_srcdir)/no_args \ + praudit -p $(atf_get_srcdir)/corrupted +} + + +atf_test_case praudit_raw_short_exclusive +praudit_raw_short_exclusive_head() +{ + atf_set "descr" "Verify that praudit outputs usage message on stderr " \ + "when both raw and short options are specified" +} + +praudit_raw_short_exclusive_body() +{ + atf_check -s exit:1 -e match:"usage: praudit" \ + praudit -rs $(atf_get_srcdir)/trail +} + + +atf_init_test_cases() +{ + atf_add_test_case praudit_delim_comma + atf_add_test_case praudit_delim_underscore + atf_add_test_case praudit_no_args + atf_add_test_case praudit_numeric_form + atf_add_test_case praudit_raw_form + atf_add_test_case praudit_same_line + atf_add_test_case praudit_short_form + atf_add_test_case praudit_xml_form + atf_add_test_case praudit_sync_to_next_record + atf_add_test_case praudit_raw_short_exclusive +} From owner-svn-src-all@freebsd.org Sun Jun 17 17:32:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 478621003492; Sun, 17 Jun 2018 17:32:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE9DB77062; Sun, 17 Jun 2018 17:32:32 +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 CFCB118747; Sun, 17 Jun 2018 17:32:32 +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 w5HHWWnE027421; Sun, 17 Jun 2018 17:32:32 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHWW7i027419; Sun, 17 Jun 2018 17:32:32 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171732.w5HHWW7i027419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:32:32 +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: r335291 - stable/11/sys/dev/ocs_fc X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/dev/ocs_fc X-SVN-Commit-Revision: 335291 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:32:33 -0000 Author: dim Date: Sun Jun 17 17:32:32 2018 New Revision: 335291 URL: https://svnweb.freebsd.org/changeset/base/335291 Log: MFC r334945: Fix build of ocs_fs with base gcc on i386 Add a few intermediate casts to uintptr_t to suppress "cast to pointer from integer of different size" warnings from gcc. Also remove a few incorrect casts. Reviewed by: ram Differential Revision: https://reviews.freebsd.org/D15747 Modified: stable/11/sys/dev/ocs_fc/ocs_ioctl.c stable/11/sys/dev/ocs_fc/ocs_sport.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/ocs_fc/ocs_ioctl.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_ioctl.c Sun Jun 17 17:31:16 2018 (r335290) +++ stable/11/sys/dev/ocs_fc/ocs_ioctl.c Sun Jun 17 17:32:32 2018 (r335291) @@ -140,7 +140,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo wrobj->host_buffer_descriptor[0].u.data.buffer_address_high = ocs_addr32_hi(dma->phys); /* copy the data into the DMA buffer */ - copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes); + copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); } break; case SLI4_OPC_COMMON_DELETE_OBJECT: @@ -169,8 +169,8 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo break; default: device_printf(ocs->dev, "%s: in=%p (%lld) out=%p (%lld)\n", __func__, - (void *)mcmd->in_addr, (unsigned long long)mcmd->in_bytes, - (void *)mcmd->out_addr, (unsigned long long)mcmd->out_bytes); + (void *)(uintptr_t)mcmd->in_addr, (unsigned long long)mcmd->in_bytes, + (void *)(uintptr_t)mcmd->out_addr, (unsigned long long)mcmd->out_bytes); device_printf(ocs->dev, "%s: unknown (opc=%#x)\n", __func__, req->opcode); hexdump(mcmd, mcmd->size, NULL, 0); @@ -184,7 +184,7 @@ ocs_process_sli_config (ocs_t *ocs, ocs_ioctl_elxu_mbo return ENXIO; } - copyin((void *)mcmd->in_addr, dma->virt, mcmd->in_bytes); + copyin((void *)(uintptr_t)mcmd->in_addr, dma->virt, mcmd->in_bytes); sli_config->payload.mem.address_low = ocs_addr32_lo(dma->phys); sli_config->payload.mem.address_high = ocs_addr32_hi(dma->phys); @@ -250,7 +250,7 @@ ocs_process_mbx_ioctl(ocs_t *ocs, ocs_ioctl_elxu_mbox_ if( SLI4_MBOX_COMMAND_SLI_CONFIG == ((sli4_mbox_command_header_t *)mcmd->payload)->command && mcmd->out_bytes && dma.virt) { - copyout(dma.virt, (void *)mcmd->out_addr, mcmd->out_bytes); + copyout(dma.virt, (void *)(uintptr_t)mcmd->out_addr, mcmd->out_bytes); } no_support: Modified: stable/11/sys/dev/ocs_fc/ocs_sport.c ============================================================================== --- stable/11/sys/dev/ocs_fc/ocs_sport.c Sun Jun 17 17:31:16 2018 (r335290) +++ stable/11/sys/dev/ocs_fc/ocs_sport.c Sun Jun 17 17:32:32 2018 (r335291) @@ -781,7 +781,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t case OCS_EVT_ENTER: { ocs_node_t *node; - ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name, + ocs_log_debug(ocs, "[%s] SPORT attached WWPN %016llx WWNN %016llx \n", sport->display_name, sport->wwpn, sport->wwnn); ocs_sport_lock(sport); ocs_list_foreach(&sport->node_list, node) { @@ -805,7 +805,7 @@ __ocs_sport_attached(ocs_sm_ctx_t *ctx, ocs_sm_event_t } case OCS_EVT_EXIT: - ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", (unsigned long long)sport->display_name, + ocs_log_debug(ocs, "[%s] SPORT deattached WWPN %016llx WWNN %016llx \n", sport->display_name, sport->wwpn, sport->wwnn); if (sport->enable_ini) { ocs_scsi_ini_del_sport(sport); From owner-svn-src-all@freebsd.org Sun Jun 17 17:35:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E1D3F10036BF; Sun, 17 Jun 2018 17:35:31 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93F53772E2; Sun, 17 Jun 2018 17:35:31 +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 752481874D; Sun, 17 Jun 2018 17:35:31 +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 w5HHZVfw027683; Sun, 17 Jun 2018 17:35:31 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHZVZP027682; Sun, 17 Jun 2018 17:35:31 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171735.w5HHZVZP027682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:35:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335292 - stable/11/sys/modules X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/modules X-SVN-Commit-Revision: 335292 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:35:32 -0000 Author: dim Date: Sun Jun 17 17:35:30 2018 New Revision: 335292 URL: https://svnweb.freebsd.org/changeset/base/335292 Log: MFC r334947: Disable building aesni with base gcc Because base gcc does not support the required intrinsics, do not attempt to compile the aesni module with it. Noticed by: Dan Allen Modified: stable/11/sys/modules/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/Makefile ============================================================================== --- stable/11/sys/modules/Makefile Sun Jun 17 17:32:32 2018 (r335291) +++ stable/11/sys/modules/Makefile Sun Jun 17 17:35:30 2018 (r335292) @@ -632,7 +632,9 @@ _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 From owner-svn-src-all@freebsd.org Sun Jun 17 17:38:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1092310038BF; Sun, 17 Jun 2018 17:38:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7B867760B; Sun, 17 Jun 2018 17:38:24 +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 94E171874F; Sun, 17 Jun 2018 17:38:24 +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 w5HHcOX9028019; Sun, 17 Jun 2018 17:38:24 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHcOus028018; Sun, 17 Jun 2018 17:38:24 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171738.w5HHcOus028018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 17:38: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: r335293 - stable/11/sys/dev/liquidio X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/dev/liquidio X-SVN-Commit-Revision: 335293 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:38:25 -0000 Author: dim Date: Sun Jun 17 17:38:24 2018 New Revision: 335293 URL: https://svnweb.freebsd.org/changeset/base/335293 Log: MFC r335034: Fix build of liquidio with base gcc on i386 Some casts from pointers to uint64_t and back in lio_main.c cause base gcc on i386 to warn "cast from pointer to integer of different size", and vice versa. Add additional casts to uintptr_t to suppress these. Reviewed by: sbruno Differential Revision: https://reviews.freebsd.org/D15754 Modified: stable/11/sys/dev/liquidio/lio_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/liquidio/lio_main.c ============================================================================== --- stable/11/sys/dev/liquidio/lio_main.c Sun Jun 17 17:35:30 2018 (r335292) +++ stable/11/sys/dev/liquidio/lio_main.c Sun Jun 17 17:38:24 2018 (r335293) @@ -1770,8 +1770,8 @@ lio_setup_glists(struct octeon_device *oct, struct lio if (g == NULL) break; - g->sg = (struct lio_sg_entry *) - ((uint64_t)lio->glists_virt_base[i] + + g->sg = (struct lio_sg_entry *)(uintptr_t) + ((uint64_t)(uintptr_t)lio->glists_virt_base[i] + (j * lio->glist_entry_size)); g->sg_dma_ptr = (uint64_t)lio->glists_dma_base[i] + (j * lio->glist_entry_size); From owner-svn-src-all@freebsd.org Sun Jun 17 17:43:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8795F1003BE1; Sun, 17 Jun 2018 17:43:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 381BB77B09; Sun, 17 Jun 2018 17:43:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17E23188E1; Sun, 17 Jun 2018 17:43:56 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HHhtWO032847; Sun, 17 Jun 2018 17:43:55 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HHhtRJ032846; Sun, 17 Jun 2018 17:43:55 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806171743.w5HHhtRJ032846@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 17:43:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335294 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335294 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 17:43:56 -0000 Author: asomers Date: Sun Jun 17 17:43:55 2018 New Revision: 335294 URL: https://svnweb.freebsd.org/changeset/base/335294 Log: audit(4): add tests for connect, connectat, and accept Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15853 Modified: head/tests/sys/audit/network.c Modified: head/tests/sys/audit/network.c ============================================================================== --- head/tests/sys/audit/network.c Sun Jun 17 17:38:24 2018 (r335293) +++ head/tests/sys/audit/network.c Sun Jun 17 17:43:55 2018 (r335294) @@ -38,14 +38,14 @@ #define SERVER_PATH "server" -static int sockfd; +static int sockfd, sockfd2; static socklen_t len; static struct pollfd fds[1]; static char extregex[80]; static const char *auclass = "nt"; static const char *nosupregex = "return,failure : Address family " "not supported by protocol family"; -static const char *invalregex = "return,failur.*Socket operation on non-socket"; +static const char *invalregex = "return,failure : Bad file descriptor"; /* * Variadic function to close socket descriptors @@ -207,7 +207,7 @@ ATF_TC_BODY(setsockopt_failure, tc) snprintf(extregex, sizeof(extregex), "setsockopt.*%s", invalregex); FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid socket descriptor */ - ATF_REQUIRE_EQ(-1, setsockopt(0, SOL_SOCKET, + ATF_REQUIRE_EQ(-1, setsockopt(-1, SOL_SOCKET, SO_REUSEADDR, &tr, sizeof(int))); check_audit(fds, extregex, pipefd); } @@ -327,7 +327,7 @@ ATF_TC_BODY(bindat_failure, tc) FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid socket descriptor */ - ATF_REQUIRE_EQ(-1, bindat(AT_FDCWD, 0, + ATF_REQUIRE_EQ(-1, bindat(AT_FDCWD, -1, (struct sockaddr *)&server, len)); check_audit(fds, extregex, pipefd); } @@ -382,7 +382,7 @@ ATF_TC_BODY(listen_failure, tc) snprintf(extregex, sizeof(extregex), "listen.*%s", invalregex); FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid socket descriptor */ - ATF_REQUIRE_EQ(-1, listen(0, 1)); + ATF_REQUIRE_EQ(-1, listen(-1, 1)); check_audit(fds, extregex, pipefd); } @@ -392,6 +392,216 @@ ATF_TC_CLEANUP(listen_failure, tc) } +ATF_TC_WITH_CLEANUP(connect_success); +ATF_TC_HEAD(connect_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "connect(2) call"); +} + +ATF_TC_BODY(connect_success, tc) +{ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Setup a non-blocking server socket */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, + SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); + /* Bind to the specified address and wait for connection */ + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Set up "blocking" client socket */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + + /* Audit record must contain AF_UNIX address path & sockfd2 */ + snprintf(extregex, sizeof(extregex), + "connect.*0x%x.*%s.*success", sockfd2, SERVER_PATH); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(connect_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(connect_failure); +ATF_TC_HEAD(connect_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "connect(2) call"); +} + +ATF_TC_BODY(connect_failure, tc) +{ + /* Preliminary socket setup */ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Audit record must contain AF_UNIX address path */ + snprintf(extregex, sizeof(extregex), + "connect.*%s.*return,failure", SERVER_PATH); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, connect(-1, (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(connect_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(connectat_success); +ATF_TC_HEAD(connectat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "connectat(2) call"); +} + +ATF_TC_BODY(connectat_success, tc) +{ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Setup a non-blocking server socket */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, + SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); + /* Bind to the specified address and wait for connection */ + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Set up "blocking" client socket */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + + /* Audit record must contain sockfd2 */ + snprintf(extregex, sizeof(extregex), + "connectat.*0x%x.*return,success", sockfd2); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, connectat(AT_FDCWD, sockfd2, + (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(connectat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(connectat_failure); +ATF_TC_HEAD(connectat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "connectat(2) call"); +} + +ATF_TC_BODY(connectat_failure, tc) +{ + /* Preliminary socket setup */ + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + snprintf(extregex, sizeof(extregex), "connectat.*%s", invalregex); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, connectat(AT_FDCWD, -1, + (struct sockaddr *)&server, len)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(connectat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(accept_success); +ATF_TC_HEAD(accept_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "accept(2) call"); +} + +ATF_TC_BODY(accept_success, tc) +{ + int clientfd; + struct sockaddr_un server; + assign_address(&server); + len = sizeof(struct sockaddr_un); + + /* Setup a non-blocking server socket */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, + SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); + /* Bind to the specified address and wait for connection */ + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Set up "blocking" client socket */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((clientfd = accept(sockfd, NULL, &len)) != -1); + + /* Audit record must contain clientfd & sockfd */ + snprintf(extregex, sizeof(extregex), + "accept.*0x%x.*return,success,%d", sockfd, clientfd); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(3, sockfd, sockfd2, clientfd); +} + +ATF_TC_CLEANUP(accept_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(accept_failure); +ATF_TC_HEAD(accept_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "accept(2) call"); +} + +ATF_TC_BODY(accept_failure, tc) +{ + /* Preliminary socket setup */ + struct sockaddr_un client; + len = sizeof(struct sockaddr_un); + snprintf(extregex, sizeof(extregex), "accept.*%s", invalregex); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, accept(-1, (struct sockaddr *)&client, &len)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(accept_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_success); @@ -407,6 +617,13 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, bindat_failure); ATF_TP_ADD_TC(tp, listen_success); ATF_TP_ADD_TC(tp, listen_failure); + + ATF_TP_ADD_TC(tp, connect_success); + ATF_TP_ADD_TC(tp, connect_failure); + ATF_TP_ADD_TC(tp, connectat_success); + ATF_TP_ADD_TC(tp, connectat_failure); + ATF_TP_ADD_TC(tp, accept_success); + ATF_TP_ADD_TC(tp, accept_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Jun 17 18:05:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3C60100434A; Sun, 17 Jun 2018 18:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD0F784DD; Sun, 17 Jun 2018 18:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 580F618C3D; Sun, 17 Jun 2018 18:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HI5SNn043878; Sun, 17 Jun 2018 18:05:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HI5SeH043877; Sun, 17 Jun 2018 18:05:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806171805.w5HI5SeH043877@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 18:05:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335295 - head/lib/liby X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/liby X-SVN-Commit-Revision: 335295 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 18:05:29 -0000 Author: eadler Date: Sun Jun 17 18:05:27 2018 New Revision: 335295 URL: https://svnweb.freebsd.org/changeset/base/335295 Log: liby: rewrite yyerror.h In order to prevent confusion about copyright, rewrite from scratch yyerror.h. See discussion on r335270 for details. Modified: head/lib/liby/yyerror.h Modified: head/lib/liby/yyerror.h ============================================================================== --- head/lib/liby/yyerror.h Sun Jun 17 17:43:55 2018 (r335294) +++ head/lib/liby/yyerror.h Sun Jun 17 18:05:27 2018 (r335295) @@ -1,8 +1,7 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2018 Eitan Adler * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -12,14 +11,11 @@ * 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 + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -27,10 +23,14 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $FreeBSD$ */ -#include -__FBSDID("$FreeBSD$"); +#ifndef YYERROR_H +#define YYERROR_H -int yyparse(void); int yyerror(const char *msg); +int yyparse(void); + +#endif /* YYERROR_H */ From owner-svn-src-all@freebsd.org Sun Jun 17 19:14:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C752C10065D8; Sun, 17 Jun 2018 19:14:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1997AA3D; Sun, 17 Jun 2018 19:14:06 +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 5E14B197E6; Sun, 17 Jun 2018 19:14:06 +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 w5HJE6HU080259; Sun, 17 Jun 2018 19:14:06 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HJE68q080258; Sun, 17 Jun 2018 19:14:06 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171914.w5HJE68q080258@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 19:14:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335296 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 335296 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 19:14:07 -0000 Author: dim Date: Sun Jun 17 19:14:05 2018 New Revision: 335296 URL: https://svnweb.freebsd.org/changeset/base/335296 Log: Fix build of aibs with base gcc on i386 Add a few intermediate casts to intptr_t to suppress "cast to pointer from integer of different size" warnings from gcc. In this case, the 'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an intermediate intmax_t, so no information is lost. Reviewed by: avg MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15725 Modified: head/sys/dev/acpi_support/atk0110.c Modified: head/sys/dev/acpi_support/atk0110.c ============================================================================== --- head/sys/dev/acpi_support/atk0110.c Sun Jun 17 18:05:27 2018 (r335295) +++ head/sys/dev/acpi_support/atk0110.c Sun Jun 17 19:14:05 2018 (r335296) @@ -453,7 +453,7 @@ static int aibs_sysctl(SYSCTL_HANDLER_ARGS) { struct aibs_softc *sc = arg1; - struct aibs_sensor *sensor = (void *)arg2; + struct aibs_sensor *sensor = (void *)(intptr_t)arg2; int i = oidp->oid_number; ACPI_STATUS rs; ACPI_OBJECT p, *bp; @@ -519,7 +519,7 @@ static int aibs_sysctl_ggrp(SYSCTL_HANDLER_ARGS) { struct aibs_softc *sc = arg1; - struct aibs_sensor *sensor = (void *)arg2; + struct aibs_sensor *sensor = (void *)(intptr_t)arg2; ACPI_STATUS rs; ACPI_OBJECT p, *bp; ACPI_OBJECT_LIST arg; From owner-svn-src-all@freebsd.org Sun Jun 17 19:24:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 286261006DAE; Sun, 17 Jun 2018 19:24:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C35057B0AD; Sun, 17 Jun 2018 19:24:40 +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 A0A3519980; Sun, 17 Jun 2018 19:24:40 +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 w5HJOeaW085532; Sun, 17 Jun 2018 19:24:40 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HJOeqE085531; Sun, 17 Jun 2018 19:24:40 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806171924.w5HJOeqE085531@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sun, 17 Jun 2018 19:24:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335297 - head/sys/compat/ndis X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: head/sys/compat/ndis X-SVN-Commit-Revision: 335297 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 19:24:41 -0000 Author: dim Date: Sun Jun 17 19:24:40 2018 New Revision: 335297 URL: https://svnweb.freebsd.org/changeset/base/335297 Log: Fix build of ndis with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so use an intermediate cast to uintptr_t to suppress it. In this case, the I/O port range is effectively limited to the range of 0..65535. Reviewed by: imp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D15746 Modified: head/sys/compat/ndis/subr_ndis.c Modified: head/sys/compat/ndis/subr_ndis.c ============================================================================== --- head/sys/compat/ndis/subr_ndis.c Sun Jun 17 19:14:05 2018 (r335296) +++ head/sys/compat/ndis/subr_ndis.c Sun Jun 17 19:24:40 2018 (r335297) @@ -1287,7 +1287,7 @@ NdisMRegisterIoPortRange(offset, adapter, port, numpor if (rman_get_size(sc->ndis_res_io) < numports) return (NDIS_STATUS_INVALID_LENGTH); - *offset = (void *)rman_get_start(sc->ndis_res_io); + *offset = (void *)(uintptr_t)rman_get_start(sc->ndis_res_io); return (NDIS_STATUS_SUCCESS); } From owner-svn-src-all@freebsd.org Sun Jun 17 19:31:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CE616100722C; Sun, 17 Jun 2018 19:31:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CAAC7B460; Sun, 17 Jun 2018 19:31:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F4B519B04; Sun, 17 Jun 2018 19:31:36 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HJVasm086798; Sun, 17 Jun 2018 19:31:36 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HJVaOa086797; Sun, 17 Jun 2018 19:31:36 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806171931.w5HJVaOa086797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Sun, 17 Jun 2018 19:31:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335298 - head/stand/common X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: head/stand/common X-SVN-Commit-Revision: 335298 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 19:31:37 -0000 Author: allanjude Date: Sun Jun 17 19:31:35 2018 New Revision: 335298 URL: https://svnweb.freebsd.org/changeset/base/335298 Log: stand/common/disk.c: Update debug printf This was missed in r330809 because it is compiled out by default Sponsored by: Klara Systems Modified: head/stand/common/disk.c Modified: head/stand/common/disk.c ============================================================================== --- head/stand/common/disk.c Sun Jun 17 19:24:40 2018 (r335297) +++ head/stand/common/disk.c Sun Jun 17 19:31:35 2018 (r335298) @@ -243,7 +243,7 @@ disk_open(struct disk_devdesc *dev, uint64_t mediasize od->mediasize = mediasize; od->sectorsize = sectorsize; DEBUG("%s unit %d, slice %d, partition %d => %p", - disk_fmtdev(dev), dev->d_unit, dev->d_slice, dev->d_partition, od); + disk_fmtdev(dev), dev->dd.d_unit, dev->d_slice, dev->d_partition, od); /* Determine disk layout. */ od->table = ptable_open(dev, mediasize / sectorsize, sectorsize, From owner-svn-src-all@freebsd.org Sun Jun 17 19:44:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 887BB10077AB; Sun, 17 Jun 2018 19:44:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3C43D7BC43; Sun, 17 Jun 2018 19:44:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D81519CEE; Sun, 17 Jun 2018 19:44:25 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HJiPRQ095713; Sun, 17 Jun 2018 19:44:25 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HJiOBn095712; Sun, 17 Jun 2018 19:44:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806171944.w5HJiOBn095712@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 19:44:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335299 - head X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335299 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 19:44:25 -0000 Author: eadler Date: Sun Jun 17 19:44:24 2018 New Revision: 335299 URL: https://svnweb.freebsd.org/changeset/base/335299 Log: README: add generic notes about GENERIC and NOTES Inform new users what GENERIC and NOTES are. These are useful for people perusing the tree without a great deal of specific fbsd knowledge. See discussion of r334073 for further motivation. Requested by: jhb Modified: head/README head/README.md Modified: head/README ============================================================================== --- head/README Sun Jun 17 19:31:35 2018 (r335298) +++ head/README Sun Jun 17 19:44:24 2018 (r335299) @@ -60,7 +60,9 @@ stand Boot loader sources. sys Kernel sources. -sys//conf Kernel configuration file +sys//conf Kernel configuration files. GENERIC is the configuration + used in release builds. NOTES contains documentation of + all possible entries. tests Regression tests which can be run by Kyua. See tests/README for additional information. Modified: head/README.md ============================================================================== --- head/README.md Sun Jun 17 19:31:35 2018 (r335298) +++ head/README.md Sun Jun 17 19:44:24 2018 (r335299) @@ -62,7 +62,9 @@ stand Boot loader sources. sys Kernel sources. -sys//conf Kernel configuration file +sys//conf Kernel configuration files. GENERIC is the configuration + used in release builds. NOTES contains documentation of + all possible entries. tests Regression tests which can be run by Kyua. See tests/README for additional information. From owner-svn-src-all@freebsd.org Sun Jun 17 19:45:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E711007864 for ; Sun, 17 Jun 2018 19:45:20 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D88ED7BDAC for ; Sun, 17 Jun 2018 19:45:19 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f177.google.com (mail-yb0-f177.google.com [209.85.213.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id A34BFCBB3 for ; Sun, 17 Jun 2018 19:45:19 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f177.google.com with SMTP id x6-v6so5245662ybl.12 for ; Sun, 17 Jun 2018 12:45:19 -0700 (PDT) X-Gm-Message-State: APt69E2MiM7XbP4t/yE6u+Ta8SIFpwm7PBhZ9scikbO0/JzJBBQXXx4o Adc1mSIHkmylXijV048vIlwgLdsmtaEVPj5dlRiKFg== X-Google-Smtp-Source: ADUXVKKYNeXhzQIuv5gDBq69iDFtJoSIcVWRYu11CC1TQzQpJXAsWOQ1oOQLbrLlfHUVLBCa90fRYmV84eSKVjXj01g= X-Received: by 2002:a25:2605:: with SMTP id m5-v6mr5202768ybm.89.1529264719235; Sun, 17 Jun 2018 12:45:19 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 12:44:48 -0700 (PDT) In-Reply-To: <7080153.TjCS0o8iqD@ralph.baldwin.cx> References: <201805230409.w4N491iB057004@repo.freebsd.org> <3609973.viVQJQYxmB@ralph.baldwin.cx> <7080153.TjCS0o8iqD@ralph.baldwin.cx> From: Eitan Adler Date: Sun, 17 Jun 2018 12:44:48 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334073 - head To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 19:45:20 -0000 On 23 May 2018 at 15:48, John Baldwin wrote: > On Wednesday, May 23, 2018 12:09:59 PM Eitan Adler wrote: >> On 23 May 2018 at 09:27, John Baldwin wrote: >> > On Wednesday, May 23, 2018 04:09:01 AM Eitan Adler wrote: >> >> Author: eadler >> >> Date: Wed May 23 04:09:01 2018 >> >> New Revision: 334073 >> >> URL: https://svnweb.freebsd.org/changeset/base/334073 >> >> >> >> Log: >> >> README: Reduce the textdump; describe the project >> >> >> >> Rework the README to make it a little easier for new users. This is the >> >> first file many will see when persuing the FreeBSD source code so >> >> >> >> - remove some of the text describes how to build. This is better covered >> >> in the linked documentation. >> >> - add a small blurb for what FreeBSD is. Some users might find this >> >> document through features such as github search so they may not even >> >> know what the project is >> >> >> >> generally, gear this file for the new, accidental, or casual user rather >> >> than towards someone seeking fuller documentation. >> >> >> >> Modified: >> >> head/README >> >> head/README.md >> >> >> >> Modified: head/README >> >> ============================================================================== >> >> --- head/README Wed May 23 03:41:22 2018 (r334072) >> >> +++ head/README Wed May 23 04:09:01 2018 (r334073) >> >> @@ -2,35 +2,25 @@ This is the top level of the FreeBSD source directory. >> >> - >> >> -The kernel configuration files reside in the sys//conf >> >> -sub-directory. GENERIC is the default configuration used in release builds. >> >> -NOTES contains entries and documentation for all possible >> >> -devices, not just those commonly used. >> > >> > I do think this paragraph is still useful as part of the Source Roadmap and >> > not really part of the build instructions. >> >> I added a reference to sys//conf to the bottom of the >> README.Adding something about NOTES might be helpful, but IMHO closer >> to the build. > > Yes, but the directory doesn't tell you which file is the default kernel. > I'm thinking in terms of a random person browsing the tree via github's web > interface who doesn't know which files are which in which case I think this > note was kind of useful. Sending README Sending README.md Transmitting file data ..done Committing transaction... Committed revision 335299. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Jun 17 20:06:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DBDC1008011; Sun, 17 Jun 2018 20:06: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 118D27C72A; Sun, 17 Jun 2018 20:06: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 E6CF81A042; Sun, 17 Jun 2018 20:06:28 +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 w5HK6SZx006045; Sun, 17 Jun 2018 20:06:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HK6Sde006042; Sun, 17 Jun 2018 20:06:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806172006.w5HK6Sde006042@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 17 Jun 2018 20:06:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335300 - head/sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/geom/part X-SVN-Commit-Revision: 335300 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:06:29 -0000 Author: emaste Date: Sun Jun 17 20:06:27 2018 New Revision: 335300 URL: https://svnweb.freebsd.org/changeset/base/335300 Log: Sort geom/part mbr/ebr/ldm alias table entries Having the table entries in alpha order simplifies future additions. Sponsored by: The FreeBSD Foundation Modified: head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_ldm.c head/sys/geom/part/g_part_mbr.c Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Sun Jun 17 19:44:24 2018 (r335299) +++ head/sys/geom/part/g_part_ebr.c Sun Jun 17 20:06:27 2018 (r335300) @@ -135,13 +135,13 @@ static struct g_part_ebr_alias { int alias; } ebr_alias_match[] = { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, - { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, - { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, - { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, }; static void ebr_set_chs(struct g_part_table *, uint32_t, u_char *, u_char *, Modified: head/sys/geom/part/g_part_ldm.c ============================================================================== --- head/sys/geom/part/g_part_ldm.c Sun Jun 17 19:44:24 2018 (r335299) +++ head/sys/geom/part/g_part_ldm.c Sun Jun 17 20:06:27 2018 (r335300) @@ -369,15 +369,15 @@ static struct g_part_ldm_alias { u_char typ; int alias; } ldm_alias_match[] = { - { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, - { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, - { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, - { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, }; static u_char* Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun Jun 17 19:44:24 2018 (r335299) +++ head/sys/geom/part/g_part_mbr.c Sun Jun 17 20:06:27 2018 (r335300) @@ -128,23 +128,23 @@ static struct g_part_mbr_alias { int alias; } mbr_alias_match[] = { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, + { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, + { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, { DOSPTYP_EXT, G_PART_ALIAS_EBR }, - { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, { DOSPTYP_FAT16, G_PART_ALIAS_MS_FAT16 }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, - { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, + { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, - { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, - { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_PPCBOOT, G_PART_ALIAS_PREP_BOOT }, { DOSPTYP_VMFS, G_PART_ALIAS_VMFS }, { DOSPTYP_VMKDIAG, G_PART_ALIAS_VMKDIAG }, - { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, - { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, - { DOSPTYP_HFS, G_PART_ALIAS_APPLE_HFS }, }; static int From owner-svn-src-all@freebsd.org Sun Jun 17 20:10:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D8CE10083AB; Sun, 17 Jun 2018 20:10: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 230CD7CBB6; Sun, 17 Jun 2018 20:10: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 048D01A065; Sun, 17 Jun 2018 20:10: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 w5HKAmPY007154; Sun, 17 Jun 2018 20:10:48 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HKAmXB007152; Sun, 17 Jun 2018 20:10:48 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806172010.w5HKAmXB007152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Sun, 17 Jun 2018 20:10:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335301 - in head: sbin/geom/class/part sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: sbin/geom/class/part sys/geom/part X-SVN-Commit-Revision: 335301 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:10:49 -0000 Author: emaste Date: Sun Jun 17 20:10:48 2018 New Revision: 335301 URL: https://svnweb.freebsd.org/changeset/base/335301 Log: gpart: add EFI alias for MBR partition scheme Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D15870 Modified: head/sbin/geom/class/part/gpart.8 head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_mbr.c Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Sun Jun 17 20:06:27 2018 (r335300) +++ head/sbin/geom/class/part/gpart.8 Sun Jun 17 20:10:48 2018 (r335301) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 11, 2018 +.Dd June 17, 2018 .Dt GPART 8 .Os .Sh NAME @@ -630,9 +630,11 @@ The scheme-specific type is .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). -In such cases, the GPT partitioning scheme is used and the -actual partition type for the system partition can also be specified as -.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" . +The scheme-specific types are +.Qq Li "!239" +for MBR, and +.Qq Li "!c12a7328-f81f-11d2-ba4b-00a0c93ec93b" +for GPT. .It Cm freebsd A .Fx Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Sun Jun 17 20:06:27 2018 (r335300) +++ head/sys/geom/part/g_part_ebr.c Sun Jun 17 20:10:48 2018 (r335301) @@ -135,6 +135,7 @@ static struct g_part_ebr_alias { int alias; } ebr_alias_match[] = { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, + { DOSPTYP_EFI, G_PART_ALIAS_EFI }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, { DOSPTYP_FAT32LBA, G_PART_ALIAS_MS_FAT32LBA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Sun Jun 17 20:06:27 2018 (r335300) +++ head/sys/geom/part/g_part_mbr.c Sun Jun 17 20:10:48 2018 (r335301) @@ -130,6 +130,7 @@ static struct g_part_mbr_alias { { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, { DOSPTYP_APPLE_BOOT, G_PART_ALIAS_APPLE_BOOT }, { DOSPTYP_APPLE_UFS, G_PART_ALIAS_APPLE_UFS }, + { DOSPTYP_EFI, G_PART_ALIAS_EFI }, { DOSPTYP_EXT, G_PART_ALIAS_EBR }, { DOSPTYP_EXTLBA, G_PART_ALIAS_EBR }, { DOSPTYP_FAT16, G_PART_ALIAS_MS_FAT16 }, From owner-svn-src-all@freebsd.org Sun Jun 17 20:10:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B1B9C10083CC; Sun, 17 Jun 2018 20:10:57 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B70D7CC96; Sun, 17 Jun 2018 20:10:55 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from comporellon.tachypleus.net (cpe-75-82-218-62.socal.res.rr.com [75.82.218.62]) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id w5HK0C6P029485 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 17 Jun 2018 13:00:12 -0700 Subject: Re: svn commit: r335299 - head To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806171944.w5HJiOBn095712@repo.freebsd.org> From: Nathan Whitehorn Message-ID: <3c1fe078-55bd-8bbd-eef8-10576c9fd7c8@freebsd.org> Date: Sun, 17 Jun 2018 13:00:11 -0700 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806171944.w5HJiOBn095712@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Sonic-CAuth: UmFuZG9tSVYpo/b9zuP29/DKEI9p+wr2DQyXrHcJz+0O4elkzGwK/4TgGmOi3ysrWhuYvU5v7dHFLj3WWZyHe1RDGid4PTVD+CZ6dcU7ztQ= X-Sonic-ID: C;gpA/C2ly6BG4kaH3kFY0nw== M;KhWfC2ly6BG4kaH3kFY0nw== X-Spam-Flag: No X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:10:57 -0000 As a minor caveat, the default release kernel on powerpc64 is "GENERIC64" not "GENERIC". -Nathan On 06/17/18 12:44, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 17 19:44:24 2018 > New Revision: 335299 > URL: https://svnweb.freebsd.org/changeset/base/335299 > > Log: > README: add generic notes about GENERIC and NOTES > > Inform new users what GENERIC and NOTES are. These are useful for people > perusing the tree without a great deal of specific fbsd knowledge. > See discussion of r334073 for further motivation. > > Requested by: jhb > > Modified: > head/README > head/README.md > > Modified: head/README > ============================================================================== > --- head/README Sun Jun 17 19:31:35 2018 (r335298) > +++ head/README Sun Jun 17 19:44:24 2018 (r335299) > @@ -60,7 +60,9 @@ stand Boot loader sources. > > sys Kernel sources. > > -sys//conf Kernel configuration file > +sys//conf Kernel configuration files. GENERIC is the configuration > + used in release builds. NOTES contains documentation of > + all possible entries. > > tests Regression tests which can be run by Kyua. See tests/README > for additional information. > > Modified: head/README.md > ============================================================================== > --- head/README.md Sun Jun 17 19:31:35 2018 (r335298) > +++ head/README.md Sun Jun 17 19:44:24 2018 (r335299) > @@ -62,7 +62,9 @@ stand Boot loader sources. > > sys Kernel sources. > > -sys//conf Kernel configuration file > +sys//conf Kernel configuration files. GENERIC is the configuration > + used in release builds. NOTES contains documentation of > + all possible entries. > > tests Regression tests which can be run by Kyua. See tests/README > for additional information. > From owner-svn-src-all@freebsd.org Sun Jun 17 20:26:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D536C1008889 for ; Sun, 17 Jun 2018 20:26:07 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 852F67D3DA for ; Sun, 17 Jun 2018 20:26:07 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f171.google.com (mail-yb0-f171.google.com [209.85.213.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 4FDF7CFBE for ; Sun, 17 Jun 2018 20:26:07 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f171.google.com with SMTP id w74-v6so5261793ybe.11 for ; Sun, 17 Jun 2018 13:26:07 -0700 (PDT) X-Gm-Message-State: APt69E3JnoVE6F/5wd1Z47UTF8qFQxdcDkVjMD3j1p6GlWMGcCibJBwV vDAVYkO6C2Z2fMn1Iz62chP0CeCL607EM355ct1x+g== X-Google-Smtp-Source: ADUXVKIDsljJP7pgpJZgf5UAYlrOXDMdUpgpTuhkhyBQKIvZR853zihJJ10E0tcZS0ZD0j05quwAKGAM6S3CLHBFBgs= X-Received: by 2002:a25:786:: with SMTP id 128-v6mr5338585ybh.338.1529267166833; Sun, 17 Jun 2018 13:26:06 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 13:25:36 -0700 (PDT) In-Reply-To: <3c1fe078-55bd-8bbd-eef8-10576c9fd7c8@freebsd.org> References: <201806171944.w5HJiOBn095712@repo.freebsd.org> <3c1fe078-55bd-8bbd-eef8-10576c9fd7c8@freebsd.org> From: Eitan Adler Date: Sun, 17 Jun 2018 13:25:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335299 - head To: Nathan Whitehorn Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:26:08 -0000 On 17 June 2018 at 13:00, Nathan Whitehorn wrote: > As a minor caveat, the default release kernel on powerpc64 is "GENERIC64" > not "GENERIC". I'm happy to add that, but for a general README I'm not convinced its important to be overly detailed. That said, noted. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Jun 17 20:32:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CEE401008C6A; Sun, 17 Jun 2018 20:32:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DDB57D8D8; Sun, 17 Jun 2018 20:32:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F2181A527; Sun, 17 Jun 2018 20:32:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HKWiqw021346; Sun, 17 Jun 2018 20:32:44 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HKWiLV021345; Sun, 17 Jun 2018 20:32:44 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806172032.w5HKWiLV021345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 20:32:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335302 - head/usr.sbin/bsdconfig/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 335302 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:32:45 -0000 Author: dteske Date: Sun Jun 17 20:32:43 2018 New Revision: 335302 URL: https://svnweb.freebsd.org/changeset/base/335302 Log: sysrc.subr: Fix a comment for accuracy PR: bin/203435 Reported by: Andreas Sommer MFC after: 6 days X-MFC-to: stable/11 X-MFC-with: r335280 Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/share/sysrc.subr Modified: head/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 20:10:48 2018 (r335301) +++ head/usr.sbin/bsdconfig/share/sysrc.subr Sun Jun 17 20:32:43 2018 (r335302) @@ -556,7 +556,7 @@ f_sysrc_set() fi # - # If not found, append new value to last file and return. + # If not found, append new value to first file and return. # if [ "$not_found" ]; then # Add a newline if missing before appending to the file From owner-svn-src-all@freebsd.org Sun Jun 17 20:33:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 219031008CC4; Sun, 17 Jun 2018 20:33:03 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C33EE7D9DF; Sun, 17 Jun 2018 20:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A458B1A529; Sun, 17 Jun 2018 20:33:02 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HKX2F9021442; Sun, 17 Jun 2018 20:33:02 GMT (envelope-from marius@FreeBSD.org) Received: (from marius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HKX23g021441; Sun, 17 Jun 2018 20:33:02 GMT (envelope-from marius@FreeBSD.org) Message-Id: <201806172033.w5HKX23g021441@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: marius set sender to marius@FreeBSD.org using -f From: Marius Strobl Date: Sun, 17 Jun 2018 20:33:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335303 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: marius X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335303 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:33:03 -0000 Author: marius Date: Sun Jun 17 20:33:02 2018 New Revision: 335303 URL: https://svnweb.freebsd.org/changeset/base/335303 Log: Assorted fixes to MSI-X/MSI/INTx setup in iflib(9): - In iflib_msix_init(), VMMs with broken MSI-X activation are trying to be worked around by manually enabling PCIM_MSIXCTRL_MSIX_ENABLE before calling pci_alloc_msix(9). Apart from constituting a layering violation, this has the problem of leaving PCIM_MSIXCTRL_MSIX_ENABLE enabled when falling back to MSI or INTx when e. g. MSI-X is black- listed and initially also when disabled via hw.pci.enable_msix. The later in turn was incorrectly worked around in r325166. Since r310806, pci(4) itself has code to deal with broken MSI-X handling of VMMs, so all of these workarounds in iflib(9) can go, fixing non-working interrupts when falling back to MSI/INTx. In any case, possibly further adjustments to broken MSI-X activation of VMMs like enabling r310806 by default in VM environments need to be placed into pci(4), not iflib(9). [1] - Also remove the pci_enable_busmaster(9) call from iflib_msix_init(), which is already more properly invoked from iflib_device_attach(). - When falling back to MSI/INTx, release the MSI-X BAR resource again. - When falling back to INTx, ensure scctx->isc_vectors is set to 1 and not to something higher from a device with more than one MSI message supported. - Make the nearby ring_state(s) stuff (static) const. Discussed with: jhb at BSDCan 2018 [1] Reviewed by: imp, jhb Differential Revision: https://reviews.freebsd.org/D15729 Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Sun Jun 17 20:32:43 2018 (r335302) +++ head/sys/net/iflib.c Sun Jun 17 20:33:02 2018 (r335303) @@ -5879,49 +5879,11 @@ iflib_msix_init(if_ctx_t ctx) bar = ctx->ifc_softc_ctx.isc_msix_bar; admincnt = sctx->isc_admin_intrcnt; - /* Override by global tuneable */ - { - int i; - size_t len = sizeof(i); - err = kernel_sysctlbyname(curthread, "hw.pci.enable_msix", &i, &len, NULL, 0, NULL, 0); - if (err == 0) { - if (i == 0) - goto msi; - } - else { - device_printf(dev, "unable to read hw.pci.enable_msix."); - } - } /* Override by tuneable */ if (scctx->isc_disable_msix) goto msi; /* - ** When used in a virtualized environment - ** PCI BUSMASTER capability may not be set - ** so explicity set it here and rewrite - ** the ENABLE in the MSIX control register - ** at this point to cause the host to - ** successfully initialize us. - */ - { - int msix_ctrl, rid; - - pci_enable_busmaster(dev); - rid = 0; - if (pci_find_cap(dev, PCIY_MSIX, &rid) == 0 && rid != 0) { - rid += PCIR_MSIX_CTRL; - msix_ctrl = pci_read_config(dev, rid, 2); - msix_ctrl |= PCIM_MSIXCTRL_MSIX_ENABLE; - pci_write_config(dev, rid, msix_ctrl, 2); - } else { - device_printf(dev, "PCIY_MSIX capability not found; " - "or rid %d == 0.\n", rid); - goto msi; - } - } - - /* * bar == -1 => "trust me I know what I'm doing" * Some drivers are for hardware that is so shoddily * documented that no one knows which bars are which @@ -6007,6 +5969,9 @@ iflib_msix_init(if_ctx_t ctx) return (vectors); } else { device_printf(dev, "failed to allocate %d msix vectors, err: %d - using MSI\n", vectors, err); + bus_release_resource(dev, SYS_RES_MEMORY, bar, + ctx->ifc_msix_mem); + ctx->ifc_msix_mem = NULL; } msi: vectors = pci_msi_count(dev); @@ -6017,6 +5982,7 @@ msi: device_printf(dev,"Using an MSI interrupt\n"); scctx->isc_intr = IFLIB_INTR_MSI; } else { + scctx->isc_vectors = 1; device_printf(dev,"Using a Legacy interrupt\n"); scctx->isc_intr = IFLIB_INTR_LEGACY; } @@ -6024,7 +5990,7 @@ msi: return (vectors); } -char * ring_states[] = { "IDLE", "BUSY", "STALLED", "ABDICATED" }; +static const char *ring_states[] = { "IDLE", "BUSY", "STALLED", "ABDICATED" }; static int mp_ring_state_handler(SYSCTL_HANDLER_ARGS) @@ -6032,7 +5998,7 @@ mp_ring_state_handler(SYSCTL_HANDLER_ARGS) int rc; uint16_t *state = ((uint16_t *)oidp->oid_arg1); struct sbuf *sb; - char *ring_state = "UNKNOWN"; + const char *ring_state = "UNKNOWN"; /* XXX needed ? */ rc = sysctl_wire_old_buffer(req, 0); From owner-svn-src-all@freebsd.org Sun Jun 17 20:44:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDFB91009473; Sun, 17 Jun 2018 20:44:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7589D7E435; Sun, 17 Jun 2018 20:44:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3F81A1A716; Sun, 17 Jun 2018 20:44:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HKiLIo027105; Sun, 17 Jun 2018 20:44:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HKiLOl027104; Sun, 17 Jun 2018 20:44:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806172044.w5HKiLOl027104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sun, 17 Jun 2018 20:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335304 - head/sys/dev/acpi_support X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/sys/dev/acpi_support X-SVN-Commit-Revision: 335304 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:44:22 -0000 Author: eadler Date: Sun Jun 17 20:44:20 2018 New Revision: 335304 URL: https://svnweb.freebsd.org/changeset/base/335304 Log: acpi: Add support for Thinkpads Mic led PR: 229074 Submitted by: "Ali Abdallah" Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Sun Jun 17 20:33:02 2018 (r335303) +++ head/sys/dev/acpi_support/acpi_ibm.c Sun Jun 17 20:44:20 2018 (r335304) @@ -74,6 +74,7 @@ ACPI_MODULE_NAME("IBM") #define ACPI_IBM_METHOD_FANSTATUS 12 #define ACPI_IBM_METHOD_THERMAL 13 #define ACPI_IBM_METHOD_HANDLEREVENTS 14 +#define ACPI_IBM_METHOD_MIC_LED 15 /* Hotkeys/Buttons */ #define IBM_RTC_HOTKEY1 0x64 @@ -175,6 +176,10 @@ struct acpi_ibm_softc { int led_busy; int led_state; + /* Mic led handle */ + ACPI_HANDLE mic_led_handle; + int mic_led_state; + int wlan_bt_flags; int thermal_updt_supported; @@ -258,7 +263,11 @@ static struct { .method = ACPI_IBM_METHOD_FANSTATUS, .description = "Fan enable", }, - + { + .name = "mic_led", + .method = ACPI_IBM_METHOD_MIC_LED, + .description = "Mic led", + }, { NULL, 0, NULL, 0 } }; @@ -371,6 +380,35 @@ ibm_led_task(struct acpi_ibm_softc *sc, int pending __ } static int +acpi_ibm_mic_led_set (struct acpi_ibm_softc *sc, int arg) +{ + ACPI_OBJECT_LIST input; + ACPI_OBJECT params[1]; + ACPI_STATUS status; + + if (arg < 0 || arg > 1) + return (EINVAL); + + if (sc->mic_led_handle) { + params[0].Type = ACPI_TYPE_INTEGER; + params[0].Integer.Value = 0; + /* mic led: 0 off, 2 on */ + if (arg == 1) + params[0].Integer.Value = 2; + + input.Pointer = params; + input.Count = 1; + + status = AcpiEvaluateObject (sc->handle, "MMTS", &input, NULL); + if (ACPI_SUCCESS(status)) + sc->mic_led_state = arg; + return(status); + } + + return (0); +} + +static int acpi_ibm_probe(device_t dev) { if (acpi_disabled("ibm") || @@ -552,6 +590,9 @@ acpi_ibm_resume(device_t dev) } ACPI_SERIAL_END(ibm); + /* The mic led does not turn back on when sysctl_set is called in the above loop */ + acpi_ibm_mic_led_set(sc, sc->mic_led_state); + return (0); } @@ -739,6 +780,12 @@ acpi_ibm_sysctl_get(struct acpi_ibm_softc *sc, int met else val = -1; break; + case ACPI_IBM_METHOD_MIC_LED: + if (sc->mic_led_handle) + return sc->mic_led_state; + else + val = -1; + break; } return (val); @@ -783,6 +830,10 @@ acpi_ibm_sysctl_set(struct acpi_ibm_softc *sc, int met return acpi_ibm_mute_set(sc, arg); break; + case ACPI_IBM_METHOD_MIC_LED: + return acpi_ibm_mic_led_set (sc, arg); + break; + case ACPI_IBM_METHOD_THINKLIGHT: return acpi_ibm_thinklight_set(sc, arg); break; @@ -841,6 +892,17 @@ acpi_ibm_sysctl_init(struct acpi_ibm_softc *sc, int me case ACPI_IBM_METHOD_MUTE: /* EC is required here, which was already checked before */ return (TRUE); + + case ACPI_IBM_METHOD_MIC_LED: + if (ACPI_SUCCESS(AcpiGetHandle(sc->handle, "MMTS", &sc->mic_led_handle))) + { + /* Turn off mic led by default */ + acpi_ibm_mic_led_set (sc, 0); + return(TRUE); + } + else + sc->mic_led_handle = NULL; + return (FALSE); case ACPI_IBM_METHOD_THINKLIGHT: sc->cmos_handle = NULL; From owner-svn-src-all@freebsd.org Sun Jun 17 20:45:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 904F110095BD; Sun, 17 Jun 2018 20:45:49 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46DA37E621; Sun, 17 Jun 2018 20:45:49 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 283A61A71C; Sun, 17 Jun 2018 20:45:49 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HKjnMJ027226; Sun, 17 Jun 2018 20:45:49 GMT (envelope-from bryanv@FreeBSD.org) Received: (from bryanv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HKjmE6027224; Sun, 17 Jun 2018 20:45:48 GMT (envelope-from bryanv@FreeBSD.org) Message-Id: <201806172045.w5HKjmE6027224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bryanv set sender to bryanv@FreeBSD.org using -f From: Bryan Venteicher Date: Sun, 17 Jun 2018 20:45:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335305 - head/sys/dev/virtio X-SVN-Group: head X-SVN-Commit-Author: bryanv X-SVN-Commit-Paths: head/sys/dev/virtio X-SVN-Commit-Revision: 335305 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:45:49 -0000 Author: bryanv Date: Sun Jun 17 20:45:48 2018 New Revision: 335305 URL: https://svnweb.freebsd.org/changeset/base/335305 Log: Update VirtIO definitions from Linux virtio_config.h and virtio_ring.h headers Modified: head/sys/dev/virtio/virtio_config.h head/sys/dev/virtio/virtio_ring.h Modified: head/sys/dev/virtio/virtio_config.h ============================================================================== --- head/sys/dev/virtio/virtio_config.h Sun Jun 17 20:44:20 2018 (r335304) +++ head/sys/dev/virtio/virtio_config.h Sun Jun 17 20:45:48 2018 (r335305) @@ -33,35 +33,58 @@ /* Status byte for guest to report progress. */ #define VIRTIO_CONFIG_STATUS_RESET 0x00 +/* We have seen device and processed generic fields. */ #define VIRTIO_CONFIG_STATUS_ACK 0x01 -#define VIRTIO_CONFIG_STATUS_DRIVER 0x03 +/* We have found a driver for the device. */ +#define VIRTIO_CONFIG_STATUS_DRIVER 0x02 +/* Driver has used its parts of the config, and is happy. */ #define VIRTIO_CONFIG_STATUS_DRIVER_OK 0x04 +/* Driver has finished configuring features (modern only). */ +#define VIRTIO_CONFIG_S_FEATURES_OK 0x08 +/* Device entered invalid state, driver must reset it. */ +#define VIRTIO_CONFIG_S_NEEDS_RESET 0x40 +/* We've given up on this device. */ #define VIRTIO_CONFIG_STATUS_FAILED 0x80 /* * Generate interrupt when the virtqueue ring is * completely used, even if we've suppressed them. */ -#define VIRTIO_F_NOTIFY_ON_EMPTY (1 << 24) +#define VIRTIO_F_NOTIFY_ON_EMPTY (1UL << 24) +/* Can the device handle any descriptor layout? */ +#define VIRTIO_F_ANY_LAYOUT (1UL << 27) + /* Support for indirect buffer descriptors. */ -#define VIRTIO_RING_F_INDIRECT_DESC (1 << 28) +#define VIRTIO_RING_F_INDIRECT_DESC (1UL << 28) /* Support to suppress interrupt until specific index is reached. */ -#define VIRTIO_RING_F_EVENT_IDX (1 << 29) +#define VIRTIO_RING_F_EVENT_IDX (1UL << 29) /* * The guest should never negotiate this feature; it * is used to detect faulty drivers. */ -#define VIRTIO_F_BAD_FEATURE (1 << 30) +#define VIRTIO_F_BAD_FEATURE (1UL << 30) +/* v1.0 compliant. */ +#define VIRTIO_F_VERSION_1 (1ULL << 32) + /* - * Some VirtIO feature bits (currently bits 28 through 31) are + * If clear - device has the IOMMU bypass quirk feature. + * If set - use platform tools to detect the IOMMU. + * + * Note the reverse polarity (compared to most other features), + * this is for compatibility with legacy systems. + */ +#define VIRTIO_F_IOMMU_PLATFORM (1ULL << 33) + +/* + * Some VirtIO feature bits (currently bits 28 through 34) are * reserved for the transport being used (eg. virtio_ring), the * rest are per-device feature bits. */ #define VIRTIO_TRANSPORT_F_START 28 -#define VIRTIO_TRANSPORT_F_END 32 +#define VIRTIO_TRANSPORT_F_END 34 #endif /* _VIRTIO_CONFIG_H_ */ Modified: head/sys/dev/virtio/virtio_ring.h ============================================================================== --- head/sys/dev/virtio/virtio_ring.h Sun Jun 17 20:44:20 2018 (r335304) +++ head/sys/dev/virtio/virtio_ring.h Sun Jun 17 20:45:48 2018 (r335305) @@ -92,6 +92,13 @@ struct vring { struct vring_used *used; }; +/* Alignment requirements for vring elements. + * When using pre-virtio 1.0 layout, these fall out naturally. + */ +#define VRING_AVAIL_ALIGN_SIZE 2 +#define VRING_USED_ALIGN_SIZE 4 +#define VRING_DESC_ALIGN_SIZE 16 + /* The standard layout for the ring is a continuous chunk of memory which * looks like this. We assume num is a power of 2. * From owner-svn-src-all@freebsd.org Sun Jun 17 20:47:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE488100975D for ; Sun, 17 Jun 2018 20:47:41 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 436747E8AA for ; Sun, 17 Jun 2018 20:47:41 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f170.google.com (mail-yb0-f170.google.com [209.85.213.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 0976CD1CF for ; Sun, 17 Jun 2018 20:47:41 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f170.google.com with SMTP id q62-v6so5282496ybg.5 for ; Sun, 17 Jun 2018 13:47:41 -0700 (PDT) X-Gm-Message-State: APt69E11cgGfRV4ozIZyf9AjJpyS8i/hceW3zlLgmWYwGcy0iMWF2HyU /R6teB8aYaIhwZf5NzUjnGN3UdAyogBBb1FmgoJZMA== X-Google-Smtp-Source: ADUXVKK+yzqSFMpzSw9nFkGRmty1GIZmgHhm1uUJ2NTnY2IMM0tLHpEBhHMjohcP7p0GUnGiF3UufjZZsw+tNF44T3I= X-Received: by 2002:a25:8751:: with SMTP id e17-v6mr5152466ybn.194.1529268460624; Sun, 17 Jun 2018 13:47:40 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Sun, 17 Jun 2018 13:47:10 -0700 (PDT) In-Reply-To: <20180617161907.Y1464@besplex.bde.org> References: <201806170514.w5H5Epts050842@repo.freebsd.org> <20180617161907.Y1464@besplex.bde.org> From: Eitan Adler Date: Sun, 17 Jun 2018 13:47:10 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335278 - head/bin/pwd To: Bruce Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 20:47:41 -0000 On 16 June 2018 at 23:54, Bruce Evans wrote: > On Sun, 17 Jun 2018, Eitan Adler wrote: > >> Log: >> pwd: mark usage as dead >> >> Modified: >> head/bin/pwd/pwd.c >> >> Modified: head/bin/pwd/pwd.c >> >> ============================================================================== >> --- head/bin/pwd/pwd.c Sun Jun 17 03:33:29 2018 (r335277) >> +++ head/bin/pwd/pwd.c Sun Jun 17 05:14:50 2018 (r335278) >> @@ -95,7 +95,7 @@ main(int argc, char *argv[]) >> exit(0); >> } >> >> -void >> +void __dead2 >> usage(void) >> { > > > I asked you to back out a previous addition of __dead2 about 20 additions > of it ago. > > __dead2 here has no effect. The compiler can see that usage() doesn't > return if it understands __dead2 at all, since usage() ends with exit() > which is declared as __dead2. You are correct that this doesn't do much for the compiler. On the other hand it does shut up clang and some other static analyzers. It also doesn't cause any harm, so I don't see why it should be removed. Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sun Jun 17 21:09:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AC6B9100AD02; Sun, 17 Jun 2018 21:09:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E1B97FC94; Sun, 17 Jun 2018 21:09:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3AA851AA6D; Sun, 17 Jun 2018 21:09:22 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HL9Mq9037577; Sun, 17 Jun 2018 21:09:22 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HL9Loo037576; Sun, 17 Jun 2018 21:09:21 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806172109.w5HL9Loo037576@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 21:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335306 - head/usr.sbin/bsdconfig X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig X-SVN-Commit-Revision: 335306 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 21:09:22 -0000 Author: dteske Date: Sun Jun 17 21:09:21 2018 New Revision: 335306 URL: https://svnweb.freebsd.org/changeset/base/335306 Log: bsdconfig: Make examples optional PR: bin/228485 Submitted by: Dmitry Wagin Reported by: Dmitry Wagin MFC after: 1 week Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/Makefile Modified: head/usr.sbin/bsdconfig/Makefile ============================================================================== --- head/usr.sbin/bsdconfig/Makefile Sun Jun 17 20:45:48 2018 (r335305) +++ head/usr.sbin/bsdconfig/Makefile Sun Jun 17 21:09:21 2018 (r335306) @@ -1,10 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= console \ diskmgmt \ docsinstall \ dot \ - examples \ include \ includes \ mouse \ @@ -17,6 +18,10 @@ SUBDIR= console \ timezone \ ttys \ usermgmt + +.if ${MK_EXAMPLES} != "no" +SUBDIR+= examples +.endif FILESDIR= ${LIBEXECDIR}/bsdconfig FILES= USAGE From owner-svn-src-all@freebsd.org Sun Jun 17 21:29:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44F9A100B742; Sun, 17 Jun 2018 21:29:36 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECD1980A51; Sun, 17 Jun 2018 21:29:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C9CB61ADF2; Sun, 17 Jun 2018 21:29:35 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HLTZ4Z047920; Sun, 17 Jun 2018 21:29:35 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HLTZ6l047919; Sun, 17 Jun 2018 21:29:35 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806172129.w5HLTZ6l047919@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 Jun 2018 21:29:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335307 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335307 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 21:29:36 -0000 Author: asomers Date: Sun Jun 17 21:29:35 2018 New Revision: 335307 URL: https://svnweb.freebsd.org/changeset/base/335307 Log: audit(4): add tests for Sys V shared memory syscalls includes shmget, shmat, shmdt, and shmctl Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15860 Modified: head/tests/sys/audit/inter-process.c Modified: head/tests/sys/audit/inter-process.c ============================================================================== --- head/tests/sys/audit/inter-process.c Sun Jun 17 21:09:21 2018 (r335306) +++ head/tests/sys/audit/inter-process.c Sun Jun 17 21:29:35 2018 (r335307) @@ -29,11 +29,11 @@ #include #include #include +#include #include #include #include -#include #include #include "utils.h" @@ -45,9 +45,11 @@ struct msgstr { }; typedef struct msgstr msgstr_t; -static int msqid; +static pid_t pid; +static int msqid, shmid; static struct pollfd fds[1]; static struct msqid_ds msgbuff; +static struct shmid_ds shmbuff; static char ipcregex[BUFFSIZE]; static const char *auclass = "ip"; @@ -392,6 +394,341 @@ ATF_TC_CLEANUP(msgctl_illegal_command, tc) } +ATF_TC_WITH_CLEANUP(shmget_success); +ATF_TC_HEAD(shmget_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmget(2) call"); +} + +ATF_TC_BODY(shmget_success, tc) +{ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + /* Check the presence of shared memory ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), "shmget.*ret.*success,%d", shmid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmget_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmget_failure); +ATF_TC_HEAD(shmget_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmget(2) call"); +} + +ATF_TC_BODY(shmget_failure, tc) +{ + const char *regex = "shmget.*return,failure.*No such file or directory"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmget((key_t)(-1), 0, 0)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmget_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmat_success); +ATF_TC_HEAD(shmat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmat(2) call"); +} + +ATF_TC_BODY(shmat_success, tc) +{ + void *addr; + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((intptr_t)(addr = shmat(shmid, NULL, 0)) != -1); + + /* Check for shared memory ID and process address in record */ + snprintf(ipcregex, sizeof(ipcregex), "shmat.*Shared Memory " + "IPC.*%d.*return,success,%d", shmid, (int)addr); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmat_failure); +ATF_TC_HEAD(shmat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmat(2) call"); +} + +ATF_TC_BODY(shmat_failure, tc) +{ + const char *regex = "shmat.*Shared Memory IPC.*return,failure"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, (intptr_t)shmat(-1, NULL, 0)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmdt_success); +ATF_TC_HEAD(shmdt_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmdt(2) call"); +} + +ATF_TC_BODY(shmdt_success, tc) +{ + void *addr; + pid = getpid(); + snprintf(ipcregex, sizeof(ipcregex), "shmdt.*%d.*return,success", pid); + + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + /* Attach the shared memory to calling process's address space */ + ATF_REQUIRE((intptr_t)(addr = shmat(shmid, NULL, 0)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, shmdt(addr)); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmdt_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmdt_failure); +ATF_TC_HEAD(shmdt_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmdt(2) call"); +} + +ATF_TC_BODY(shmdt_failure, tc) +{ + const char *regex = "shmdt.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmdt(NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmdt_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_rmid_success); +ATF_TC_HEAD(shmctl_rmid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(shmctl_rmid_success, tc) +{ + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); + /* Check the presence of shmid and IPC_RMID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "shmctl.*IPC_RMID.*%d.*return,success", shmid); + check_audit(fds, ipcregex, pipefd); +} + +ATF_TC_CLEANUP(shmctl_rmid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_rmid_failure); +ATF_TC_HEAD(shmctl_rmid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(shmctl_rmid_failure, tc) +{ + const char *regex = "shmctl.*IPC_RMID.*return,fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmctl(-1, IPC_RMID, NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmctl_rmid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_stat_success); +ATF_TC_HEAD(shmctl_stat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(shmctl_stat_success, tc) +{ + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_STAT, &shmbuff)); + /* Check if shared memory ID and IPC_STAT are present in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "shmctl.*IPC_STAT.*%d.*return,success", shmid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmctl_stat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_stat_failure); +ATF_TC_HEAD(shmctl_stat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(shmctl_stat_failure, tc) +{ + const char *regex = "shmctl.*IPC_STAT.*return,fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmctl(-1, IPC_STAT, &shmbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmctl_stat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_set_success); +ATF_TC_HEAD(shmctl_set_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shmctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(shmctl_set_success, tc) +{ + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + /* Fill up the shmbuff structure to be used with IPC_SET */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_STAT, &shmbuff)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_SET, &shmbuff)); + /* Check the presence of shared memory ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "shmctl.*IPC_SET.*%d.*return,success", msqid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmctl_set_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_set_failure); +ATF_TC_HEAD(shmctl_set_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(shmctl_set_failure, tc) +{ + const char *regex = "shmctl.*IPC_SET.*return,failure.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmctl(-1, IPC_SET, &shmbuff)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(shmctl_set_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shmctl_illegal_command); +ATF_TC_HEAD(shmctl_illegal_command, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shmctl(2) call for illegal cmd value"); +} + +ATF_TC_BODY(shmctl_illegal_command, tc) +{ + /* Create a shared memory segment and obtain the identifier */ + ATF_REQUIRE((shmid = + shmget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + const char *regex = "shmctl.*illegal command.*fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, shmctl(shmid, -1, &shmbuff)); + check_audit(fds, regex, pipefd); + + /* Destroy the shared memory with ID = shmid */ + ATF_REQUIRE_EQ(0, shmctl(shmid, IPC_RMID, NULL)); +} + +ATF_TC_CLEANUP(shmctl_illegal_command, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, msgget_success); @@ -408,6 +745,21 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, msgctl_set_success); ATF_TP_ADD_TC(tp, msgctl_set_failure); ATF_TP_ADD_TC(tp, msgctl_illegal_command); + + ATF_TP_ADD_TC(tp, shmget_success); + ATF_TP_ADD_TC(tp, shmget_failure); + ATF_TP_ADD_TC(tp, shmat_success); + ATF_TP_ADD_TC(tp, shmat_failure); + ATF_TP_ADD_TC(tp, shmdt_success); + ATF_TP_ADD_TC(tp, shmdt_failure); + + ATF_TP_ADD_TC(tp, shmctl_rmid_success); + ATF_TP_ADD_TC(tp, shmctl_rmid_failure); + ATF_TP_ADD_TC(tp, shmctl_stat_success); + ATF_TP_ADD_TC(tp, shmctl_stat_failure); + ATF_TP_ADD_TC(tp, shmctl_set_success); + ATF_TP_ADD_TC(tp, shmctl_set_failure); + ATF_TP_ADD_TC(tp, shmctl_illegal_command); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Sun Jun 17 22:09:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B56A100C930; Sun, 17 Jun 2018 22:09:44 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B6828820A1; Sun, 17 Jun 2018 22:09:43 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 922081B470; Sun, 17 Jun 2018 22:09:43 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HM9hY9068719; Sun, 17 Jun 2018 22:09:43 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HM9hQh068718; Sun, 17 Jun 2018 22:09:43 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806172209.w5HM9hQh068718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Sun, 17 Jun 2018 22:09:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335308 - head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: head X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: head/usr.sbin/bsdconfig/usermgmt/share X-SVN-Commit-Revision: 335308 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 22:09:44 -0000 Author: dteske Date: Sun Jun 17 22:09:43 2018 New Revision: 335308 URL: https://svnweb.freebsd.org/changeset/base/335308 Log: bsdconfig: Fix a bug when editing users The usermgmt API was stomping on a global ($user_gid to be specific) so things would appear to work fine until you tried to make a second pass into the API with the now-tainted variable contents. Fixed by localizing menu-specific contents as to not leak outside API. PR: bin/208774 Reported by: Martin Waschbuesch MFC after: 1 week X-MFC-to: stable/11, stable/10 Sponsored by: Smule, Inc. Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Modified: head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Sun Jun 17 21:29:35 2018 (r335307) +++ head/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Sun Jun 17 22:09:43 2018 (r335308) @@ -1020,13 +1020,6 @@ f_dialog_menu_user_add() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1038,6 +1031,14 @@ f_dialog_menu_user_add() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_add/$msg_exit' '1' '$msg_login: $_user_name' @@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_delete/$msg_exit' '1' '$msg_login: $_user_name' @@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit() local _user_$var eval f_shell_escape \"\$user_$var\" _user_$var done + + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi menu_list=" 'X' '$msg_save/$msg_exit' From owner-svn-src-all@freebsd.org Sun Jun 17 23:08:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 26CD9100E360; Sun, 17 Jun 2018 23:08:55 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CD90584240; Sun, 17 Jun 2018 23:08:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AA9C01BE15; Sun, 17 Jun 2018 23:08:54 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5HN8sht000299; Sun, 17 Jun 2018 23:08:54 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5HN8s3B000298; Sun, 17 Jun 2018 23:08:54 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806172308.w5HN8s3B000298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sun, 17 Jun 2018 23:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335309 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 335309 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.26 Precedence: list List-Id: "SVN commit messages 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, 17 Jun 2018 23:08:55 -0000 Author: rmacklem Date: Sun Jun 17 23:08:54 2018 New Revision: 335309 URL: https://svnweb.freebsd.org/changeset/base/335309 Log: Revert r335263, since it can cause crashes in unusual circumstances. This needs to be fixed in a different way. Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 17 22:09:43 2018 (r335308) +++ head/sys/fs/nfs/nfs_commonkrpc.c Sun Jun 17 23:08:54 2018 (r335309) @@ -157,9 +157,6 @@ static int nfsv2_procid[NFS_V3NPROCS] = { /* * Initialize sockets and congestion for a new NFS connection. * We do not free the sockaddr if error. - * Which arguments are set to NULL indicate what kind of call it is. - * cred == NULL --> a call to connect to a pNFS DS - * nmp == NULL --> indicates an upcall to userland or a NFSv4 callback */ int newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp, @@ -296,38 +293,24 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq retries = nmp->nm_retry; } else retries = INT_MAX; - if (NFSHASNFSV4N(nmp)) { - if (cred != NULL) { - /* - * Make sure the nfscbd_pool doesn't get - * destroyed while doing this. - */ - NFSD_LOCK(); - if (nfs_numnfscbd > 0) { - nfs_numnfscbd++; - NFSD_UNLOCK(); - xprt = svc_vc_create_backchannel( - nfscbd_pool); - CLNT_CONTROL(client, CLSET_BACKCHANNEL, - xprt); - NFSD_LOCK(); - nfs_numnfscbd--; - if (nfs_numnfscbd == 0) - wakeup(&nfs_numnfscbd); - } + /* cred == NULL for DS connects. */ + if (NFSHASNFSV4N(nmp) && cred != NULL) { + /* + * Make sure the nfscbd_pool doesn't get destroyed + * while doing this. + */ + NFSD_LOCK(); + if (nfs_numnfscbd > 0) { + nfs_numnfscbd++; NFSD_UNLOCK(); - } else { - /* - * cred == NULL for a DS connect. - * For connects to a DS, set a retry limit - * so that failed DSs will be detected. - * This is ok for NFSv4.1, since a DS does - * not maintain open/lock state and is the - * only case where using a "soft" mount is - * recommended for NFSv4. - */ - retries = 2; + xprt = svc_vc_create_backchannel(nfscbd_pool); + CLNT_CONTROL(client, CLSET_BACKCHANNEL, xprt); + NFSD_LOCK(); + nfs_numnfscbd--; + if (nfs_numnfscbd == 0) + wakeup(&nfs_numnfscbd); } + NFSD_UNLOCK(); } } else { /* @@ -779,7 +762,6 @@ tryagain: else stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, nd->nd_mreq, &nd->nd_mrep, timo); - NFSCL_DEBUG(2, "clnt call=%d\n", stat); if (rep != NULL) { /* @@ -807,60 +789,6 @@ tryagain: error = EPROTONOSUPPORT; } else if (stat == RPC_INTR) { error = EINTR; - } else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV || - stat == RPC_SYSTEMERROR) { - if ((nd->nd_flag & ND_NFSV41) != 0 && nmp != NULL && - nd->nd_procnum != NFSPROC_NULL) { - /* - * The nfsess_defunct field is protected by - * the NFSLOCKMNT()/nm_mtx lock and not the - * nfsess_mtx lock to simplify its handling, - * for the MDS session. This lock is also - * sufficient for nfsess_sessionid, since it - * never changes in the structure. - */ - NFSLOCKCLSTATE(); - NFSLOCKMNT(nmp); - /* The session must be marked defunct. */ - if (dssep == NULL) { - /* - * This is either an MDS proxy operation or - * a client mount with "soft,retrans=N" options. - * Mark the MDS session defunct and initiate - * recovery, as required. - */ - NFSCL_DEBUG(1, "Failed soft proxy RPC\n"); - sep = NFSMNT_MDSSESSION(nmp); - if (bcmp(sep->nfsess_sessionid, nd->nd_sequence, - NFSX_V4SESSIONID) == 0) { - /* Initiate recovery. */ - sep->nfsess_defunct = 1; - NFSCL_DEBUG(1, "Marked defunct\n"); - if (nmp->nm_clp != NULL) { - nmp->nm_clp->nfsc_flags |= - NFSCLFLAGS_RECOVER; - wakeup(nmp->nm_clp); - } - } - } else { - /* - * This is a client side DS RPC. Just mark - * the session defunct. A subsequent LayoutGet - * should get a new session. - */ - NFSCL_DEBUG(1, "Failed client DS RPC\n"); - if (bcmp(dssep->nfsess_sessionid, - nd->nd_sequence, NFSX_V4SESSIONID) == 0) { - /* Mark it defunct. */ - dssep->nfsess_defunct = 1; - NFSCL_DEBUG(1, "Marked defunct\n"); - } - } - NFSUNLOCKMNT(nmp); - NFSUNLOCKCLSTATE(); - } - NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); - error = ENXIO; } else { NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EACCES; From owner-svn-src-all@freebsd.org Mon Jun 18 02:06:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DB3510125F1; Mon, 18 Jun 2018 02:06:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF29C6933D; Mon, 18 Jun 2018 02:06:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 866F31DB00; Mon, 18 Jun 2018 02:06:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5I26Gcg093033; Mon, 18 Jun 2018 02:06:16 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5I26GKG093032; Mon, 18 Jun 2018 02:06:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806180206.w5I26GKG093032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 18 Jun 2018 02:06:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335310 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335310 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 02:06:17 -0000 Author: eadler Date: Mon Jun 18 02:06:16 2018 New Revision: 335310 URL: https://svnweb.freebsd.org/changeset/base/335310 Log: top(1): use more modern signal code Rather than manually build signal masks use functions designed for that reason. Also use sigprocmask instead of sigblock. Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sun Jun 17 23:08:54 2018 (r335309) +++ head/usr.bin/top/top.c Mon Jun 18 02:06:16 2018 (r335310) @@ -50,10 +50,6 @@ typedef void sigret_t; /* The buffer that stdio will use */ static char stdoutbuf[Buffersize]; -/* build Signal masks */ -#define Smask(s) (1 << ((s) - 1)) - - static int fmt_flags = 0; int pcpu_stats = false; @@ -233,7 +229,7 @@ main(int argc, char *argv[]) static char tempbuf1[50]; static char tempbuf2[50]; - int old_sigmask; /* only used for BSD-style signals */ + sigset_t old_sigmask, new_sigmask; int topn = Infinity; double delay = 2; int displays = 0; /* indicates unspecified */ @@ -591,13 +587,18 @@ main(int argc, char *argv[]) } /* hold interrupt signals while setting up the screen and the handlers */ - old_sigmask = sigblock(Smask(SIGINT) | Smask(SIGQUIT) | Smask(SIGTSTP)); + + sigemptyset(&new_sigmask); + sigaddset(&new_sigmask, SIGINT); + sigaddset(&new_sigmask, SIGQUIT); + sigaddset(&new_sigmask, SIGTSTP); + sigprocmask(SIG_BLOCK, &new_sigmask, &old_sigmask); init_screen(); signal(SIGINT, leave); signal(SIGQUIT, leave); signal(SIGTSTP, tstop); signal(SIGWINCH, top_winch); - sigsetmask(old_sigmask); + sigprocmask(SIG_SETMASK, &old_sigmask, NULL); if (warnings) { fputs("....", stderr); From owner-svn-src-all@freebsd.org Mon Jun 18 04:12:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 613951015BD4; Mon, 18 Jun 2018 04:12:59 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F31E56D227; Mon, 18 Jun 2018 04:12:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CEC651F1AC; Mon, 18 Jun 2018 04:12:58 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5I4CwZq061382; Mon, 18 Jun 2018 04:12:58 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5I4CwXq061380; Mon, 18 Jun 2018 04:12:58 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806180412.w5I4CwXq061380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Jun 2018 04:12:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335311 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335311 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 04:12:59 -0000 Author: asomers Date: Mon Jun 18 04:12:58 2018 New Revision: 335311 URL: https://svnweb.freebsd.org/changeset/base/335311 Log: Fix 32-bit build after 335307 This was correct in the final version on Phabricator, but somehow I screwed up applying the patch locally. Reported by: linimon Pointy-hat-to: asomers MFC after: 2 weeks X-MFC-With: 335307 Modified: head/tests/sys/audit/inter-process.c Modified: head/tests/sys/audit/inter-process.c ============================================================================== --- head/tests/sys/audit/inter-process.c Mon Jun 18 02:06:16 2018 (r335310) +++ head/tests/sys/audit/inter-process.c Mon Jun 18 04:12:58 2018 (r335311) @@ -460,7 +460,7 @@ ATF_TC_BODY(shmat_success, tc) /* Check for shared memory ID and process address in record */ snprintf(ipcregex, sizeof(ipcregex), "shmat.*Shared Memory " - "IPC.*%d.*return,success,%d", shmid, (int)addr); + "IPC.*%d.*return,success", shmid); check_audit(fds, ipcregex, pipefd); /* Destroy the shared memory with ID = shmid */ From owner-svn-src-all@freebsd.org Mon Jun 18 04:50:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9585610167A3; Mon, 18 Jun 2018 04:50:36 +0000 (UTC) (envelope-from lidl@pix.net) Received: from hydra.pix.net (hydra.pix.net [IPv6:2001:470:e254::4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.pix.net", Issuer "Pix.Com Technologies LLC CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4824C6E18B; Mon, 18 Jun 2018 04:50:36 +0000 (UTC) (envelope-from lidl@pix.net) Received: from torb.pix.net (torb.pix.net [192.168.16.32]) (authenticated bits=0) by hydra.pix.net (8.15.2/8.15.2) with ESMTPA id w5I4oZwj082410; Mon, 18 Jun 2018 00:50:35 -0400 (EDT) (envelope-from lidl@pix.net) Subject: Re: svn commit: r334947 - head/sys/modules To: Dimitry Andric Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806110842.w5B8g4we013345@repo.freebsd.org> <77FB2EB5-5C81-42DE-BA57-72B2926DD2FA@FreeBSD.org> From: Kurt Lidl Message-ID: Date: Mon, 18 Jun 2018 00:50:35 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <77FB2EB5-5C81-42DE-BA57-72B2926DD2FA@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 04:50:36 -0000 On 6/16/18 5:50 PM, Dimitry Andric wrote: > On 16 Jun 2018, at 16:57, Kurt Lidl wrote: >> >> On 6/11/18 4:42 AM, Dimitry Andric wrote: >>> Author: dim >>> Date: Mon Jun 11 08:42:03 2018 >>> New Revision: 334947 >>> URL: https://svnweb.freebsd.org/changeset/base/334947 >>> Log: >>> Disable building aesni with base gcc >>> Because base gcc does not support the required intrinsics, do not >>> attempt to compile the aesni module with it. >>> Noticed by: Dan Allen >>> MFC after: 3 days >>> Modified: >>> head/sys/modules/Makefile >>> Modified: head/sys/modules/Makefile >>> ============================================================================== >>> --- head/sys/modules/Makefile Mon Jun 11 08:11:35 2018 (r334946) >>> +++ head/sys/modules/Makefile Mon Jun 11 08:42:03 2018 (r334947) >>> @@ -627,7 +627,9 @@ _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 >> >> I thought that FreeBSD's base gcc (but not a stock 4.2.1 gcc) had support for this. As documented in UPDATING: >> >> 20130903: >> AES-NI intrinsic support has been added to gcc. The AES-NI module >> has been updated to use this support. A new gcc is required to build >> the aesni module on both i386 and amd64. > > It didn't work for the original reporter on freebsd-stable@ here: > > https://lists.freebsd.org/pipermail/freebsd-stable/2018-May/089026.html > > and for me it still gives: > > $ make -C /usr/src/sys/modules/aesni > gcc -c -O3 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -I. -I/usr/src/sys -fno-common -mno-mmx -mno-sse -msoft-float -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-uninitialized -finline-limit=8000 -fms-extensions --param inline-unit-growth=100 --param large-function-growth=1000 -mno-align-long-strings -mpreferred-stack-boundary=2 -std=iso9899:1999 -Werror -mmmx -msse -msse4 -maes -mpclmul /usr/src/sys/crypto/aesni/aesni_ghash.c > cc1: error: unrecognized command line option "-msse4" > cc1: error: unrecognized command line option "-mpclmul" > *** Error code 1 > > Those unrecognized flags were added more than 3 years ago, in r275732, > so I assume this has been broken since that time. Maybe nobody built > any kernels with gcc for 3 years? :) Looking at the reported problem, I see that the user is attempting to make this work on a Pentium-4 (ie, 32bit) machine. Which doesn't have any of the CPU support needed for the AES code to work anyway. I'm pretty sure that the AES stuff didn't exist on any of the 32 bit CPUs. So, whether or not the compiler could compile the code or not, that CPU isn't going to be able to execute it. Thanks everyone for your comments and looking into the issue. -Kurt From owner-svn-src-all@freebsd.org Mon Jun 18 04:54:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9374F1016C2A; Mon, 18 Jun 2018 04:54:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 42FCA6E585; Mon, 18 Jun 2018 04:54:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 241E01F81A; Mon, 18 Jun 2018 04:54:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5I4sA6q082084; Mon, 18 Jun 2018 04:54:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5I4sAmk082083; Mon, 18 Jun 2018 04:54:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806180454.w5I4sAmk082083@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 18 Jun 2018 04:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335312 - head/usr.bin/dc X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/dc X-SVN-Commit-Revision: 335312 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 04:54:10 -0000 Author: eadler Date: Mon Jun 18 04:54:09 2018 New Revision: 335312 URL: https://svnweb.freebsd.org/changeset/base/335312 Log: dc: make use of caph_enter We already use caph library so this makes sense. Modified: head/usr.bin/dc/dc.c Modified: head/usr.bin/dc/dc.c ============================================================================== --- head/usr.bin/dc/dc.c Mon Jun 18 04:12:58 2018 (r335311) +++ head/usr.bin/dc/dc.c Mon Jun 18 04:54:09 2018 (r335312) @@ -137,7 +137,7 @@ main(int argc, char *argv[]) if (caph_limit_stream(fd, CAPH_READ) < 0 || caph_limit_stdio() < 0 || - (cap_enter() < 0 && errno != ENOSYS)) + caph_enter() < 0) err(1, "capsicum"); procfd(fd, argv[0]); @@ -146,7 +146,7 @@ main(int argc, char *argv[]) if (preproc_done) return (0); - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter()) err(1, "capsicum"); src_setstream(&src, stdin); reset_bmachine(&src); From owner-svn-src-all@freebsd.org Mon Jun 18 04:58:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62A441016D4F; Mon, 18 Jun 2018 04:58:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 09E006E76B; Mon, 18 Jun 2018 04:58:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D47E11F826; Mon, 18 Jun 2018 04:58:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5I4wmOe082318; Mon, 18 Jun 2018 04:58:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5I4wmOE082317; Mon, 18 Jun 2018 04:58:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806180458.w5I4wmOE082317@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Mon, 18 Jun 2018 04:58:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335313 - head/lib/libcapsicum X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/lib/libcapsicum X-SVN-Commit-Revision: 335313 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 04:58:49 -0000 Author: eadler Date: Mon Jun 18 04:58:48 2018 New Revision: 335313 URL: https://svnweb.freebsd.org/changeset/base/335313 Log: libcapsicum: adding missing man page links Modified: head/lib/libcapsicum/Makefile Modified: head/lib/libcapsicum/Makefile ============================================================================== --- head/lib/libcapsicum/Makefile Mon Jun 18 04:54:09 2018 (r335312) +++ head/lib/libcapsicum/Makefile Mon Jun 18 04:58:48 2018 (r335313) @@ -6,6 +6,8 @@ INCS= capsicum_helpers.h MAN+= capsicum_helpers.3 +MLINKS+=capsicum_helpers.3 caph_enter.3 +MLINKS+=capsicum_helpers.3 caph_enter_casper.3 MLINKS+=capsicum_helpers.3 caph_limit_stream.3 MLINKS+=capsicum_helpers.3 caph_limit_stdin.3 MLINKS+=capsicum_helpers.3 caph_limit_stderr.3 From owner-svn-src-all@freebsd.org Mon Jun 18 06:01:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CACB510184A2; Mon, 18 Jun 2018 06:01:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CBBF70218; Mon, 18 Jun 2018 06:01:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5F0992021A; Mon, 18 Jun 2018 06:01:29 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5I61T5s016613; Mon, 18 Jun 2018 06:01:29 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5I61TXB016612; Mon, 18 Jun 2018 06:01:29 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201806180601.w5I61TXB016612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Mon, 18 Jun 2018 06:01:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335314 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 335314 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 06:01:30 -0000 Author: ed Date: Mon Jun 18 06:01:28 2018 New Revision: 335314 URL: https://svnweb.freebsd.org/changeset/base/335314 Log: Fix bad logic in iovlist_truncate(). To conform to RFC 5426, this function is intended to truncate messages if they exceed the message size limits. Unfortunately, the amount of space was computed the wrong way around, causing messages to be truncated entirely. Reported by: Michael Grimm on stable@ MFC after: 3 days Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Mon Jun 18 04:58:48 2018 (r335313) +++ head/usr.sbin/syslogd/syslogd.c Mon Jun 18 06:01:28 2018 (r335314) @@ -1613,8 +1613,8 @@ iovlist_truncate(struct iovlist *il, size_t size) struct iovec *last; size_t diff; - while (size > il->totalsize) { - diff = size - il->totalsize; + while (il->totalsize > size) { + diff = il->totalsize - size; last = &il->iov[il->iovcnt - 1]; if (diff >= last->iov_len) { /* Remove the last iovec entirely. */ From owner-svn-src-all@freebsd.org Mon Jun 18 13:26:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75CF81007505; Mon, 18 Jun 2018 13:26:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23C577EDE0; Mon, 18 Jun 2018 13:26:46 +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 04F1824AD9; Mon, 18 Jun 2018 13:26:46 +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 w5IDQjIF041578; Mon, 18 Jun 2018 13:26:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IDQj6P041577; Mon, 18 Jun 2018 13:26:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806181326.w5IDQj6P041577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jun 2018 13:26:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335315 - head/sys/compat/linsysfs X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linsysfs X-SVN-Commit-Revision: 335315 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 13:26:46 -0000 Author: emaste Date: Mon Jun 18 13:26:45 2018 New Revision: 335315 URL: https://svnweb.freebsd.org/changeset/base/335315 Log: linsysfs: depend on linux_common module on arm64, as on amd64 Sponsored by: Turing Robotic Industries Modified: head/sys/compat/linsysfs/linsysfs.c Modified: head/sys/compat/linsysfs/linsysfs.c ============================================================================== --- head/sys/compat/linsysfs/linsysfs.c Mon Jun 18 06:01:28 2018 (r335314) +++ head/sys/compat/linsysfs/linsysfs.c Mon Jun 18 13:26:45 2018 (r335315) @@ -557,7 +557,7 @@ linsysfs_uninit(PFS_INIT_ARGS) } PSEUDOFS(linsysfs, 1, VFCF_JAIL); -#if defined(__amd64__) +#if defined(__aarch64__) || defined(__amd64__) MODULE_DEPEND(linsysfs, linux_common, 1, 1, 1); #else MODULE_DEPEND(linsysfs, linux, 1, 1, 1); From owner-svn-src-all@freebsd.org Mon Jun 18 13:49:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 973CB1008A97; Mon, 18 Jun 2018 13:49:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 436E17FC4C; Mon, 18 Jun 2018 13:49:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2037124E32; Mon, 18 Jun 2018 13:49:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IDniL3052106; Mon, 18 Jun 2018 13:49:44 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IDnix6052105; Mon, 18 Jun 2018 13:49:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806181349.w5IDnix6052105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 18 Jun 2018 13:49:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335316 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335316 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 13:49:45 -0000 Author: trasz Date: Mon Jun 18 13:49:44 2018 New Revision: 335316 URL: https://svnweb.freebsd.org/changeset/base/335316 Log: Improve spelling and capitalize "Kerberos". MFC after: 2 weeks Sponsored by: DARPA, AFRL Modified: head/share/man/man7/hier.7 Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Mon Jun 18 13:26:45 2018 (r335315) +++ head/share/man/man7/hier.7 Mon Jun 18 13:49:44 2018 (r335316) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd April 2, 2018 +.Dd June 18, 2018 .Dt HIER 7 .Os .Sh NAME @@ -474,7 +474,7 @@ Handbook .It Pa ja/ Japanese translations of documents in /usr/share/doc .It Pa legal/ -License files for vendor supplied firmwares +License files for vendor supplied firmware files .It Pa ncurses/ HTML documents pertaining to ncurses; see @@ -623,7 +623,7 @@ utilities covered by the GNU General Public License source code for files in .Pa /usr/include .It Pa kerberos5/ -build infrastructure for kerberos version 5 +build infrastructure for Kerberos version 5 .It Pa lib/ source code for files in .Pa /lib @@ -801,7 +801,7 @@ for privilege separation. .It Pa games/ miscellaneous game status and score files .It Pa heimdal/ -kerberos server databases; see +Kerberos server databases; see .Xr kdc 8 .It Pa log/ miscellaneous system log files From owner-svn-src-all@freebsd.org Mon Jun 18 14:10:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4E5C0100A017; Mon, 18 Jun 2018 14:10: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 04BB880DCC; Mon, 18 Jun 2018 14:10: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 DA2C625174; Mon, 18 Jun 2018 14:10:12 +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 w5IEACvf063247; Mon, 18 Jun 2018 14:10:12 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IEACQ2063246; Mon, 18 Jun 2018 14:10:12 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806181410.w5IEACQ2063246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Mon, 18 Jun 2018 14:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335317 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335317 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 14:10:13 -0000 Author: rrs Date: Mon Jun 18 14:10:12 2018 New Revision: 335317 URL: https://svnweb.freebsd.org/changeset/base/335317 Log: Move to using the inp->vnet pointer has suggested by lstewart. This is far better since the hpts system is using the inp as its basis anyway. Unfortunately his comments came late. Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Mon Jun 18 13:49:44 2018 (r335316) +++ head/sys/netinet/tcp_hpts.c Mon Jun 18 14:10:12 2018 (r335317) @@ -1216,7 +1216,7 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim inp->inp_in_input = 0; tp = intotcpcb(inp); mtx_unlock(&hpts->p_mtx); - CURVNET_SET(tp->t_vnet); + CURVNET_SET(inp->inp_vnet); if (drop_reason) { INP_INFO_RLOCK(&V_tcbinfo); ti_locked = TI_RLOCKED; @@ -1589,7 +1589,7 @@ out_now: getmicrouptime(&sv); cts = tcp_tv_to_usectick(&sv); } - CURVNET_SET(tp->t_vnet); + CURVNET_SET(inp->inp_vnet); /* * There is a hole here, we get the refcnt on the * inp so it will still be preserved but to make From owner-svn-src-all@freebsd.org Mon Jun 18 15:07:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 77EC3100D3B3; Mon, 18 Jun 2018 15:07:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D22483674; Mon, 18 Jun 2018 15:07:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 09C2E25B17; Mon, 18 Jun 2018 15:07:11 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IF7AUG094460; Mon, 18 Jun 2018 15:07:10 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IF7A3H094459; Mon, 18 Jun 2018 15:07:10 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806181507.w5IF7A3H094459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Jun 2018 15:07:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335318 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335318 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 15:07:11 -0000 Author: asomers Date: Mon Jun 18 15:07:10 2018 New Revision: 335318 URL: https://svnweb.freebsd.org/changeset/base/335318 Log: audit(4): add tests for extattr_set_file and friends Includes extattr_{set_file, _set_fd, _set_link, _delete_file, _delete_fd, _delete_link} Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15867 Modified: head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Mon Jun 18 14:10:12 2018 (r335317) +++ head/tests/sys/audit/file-attribute-modify.c Mon Jun 18 15:07:10 2018 (r335318) @@ -25,6 +25,8 @@ * $FreeBSD$ */ +#include +#include #include #include @@ -37,11 +39,13 @@ static pid_t pid; static uid_t uid = -1; static gid_t gid = -1; -static int filedesc; +static int filedesc, retval; static struct pollfd fds[1]; static mode_t mode = 0777; static char extregex[80]; +static const char *buff = "ezio"; static const char *auclass = "fm"; +static const char *name = "authorname"; static const char *path = "fileforaudit"; static const char *errpath = "adirhasnoname/fileforaudit"; static const char *successreg = "fileforaudit.*return,success"; @@ -685,6 +689,333 @@ ATF_TC_CLEANUP(lchflags_failure, tc) } +ATF_TC_WITH_CLEANUP(extattr_set_file_success); +ATF_TC_HEAD(extattr_set_file_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_set_file(2) call"); +} + +ATF_TC_BODY(extattr_set_file_success, tc) +{ + /* File needs to exist to call extattr_set_file(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_file.*%s.*%s.*return,success", path, name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_set_file_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_set_file_failure); +ATF_TC_HEAD(extattr_set_file_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_set_file(2) call"); +} + +ATF_TC_BODY(extattr_set_file_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_file.*%s.*%s.*failure", path, name); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_set_file_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_set_fd_success); +ATF_TC_HEAD(extattr_set_fd_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_set_fd(2) call"); +} + +ATF_TC_BODY(extattr_set_fd_success, tc) +{ + /* File needs to exist to call extattr_set_fd(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_fd.*%s.*return,success", name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_fd(filedesc, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_set_fd_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_set_fd_failure); +ATF_TC_HEAD(extattr_set_fd_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_set_fd(2) call"); +} + +ATF_TC_BODY(extattr_set_fd_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_fd.*%s.*return,failure : Bad file descriptor", name); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, extattr_set_fd(-1, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_set_fd_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_set_link_success); +ATF_TC_HEAD(extattr_set_link_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_set_link(2) call"); +} + +ATF_TC_BODY(extattr_set_link_success, tc) +{ + /* Symbolic link needs to exist to call extattr_set_link(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_link.*%s.*%s.*return,success", path, name); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_set_link_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_set_link_failure); +ATF_TC_HEAD(extattr_set_link_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_set_link(2) call"); +} + +ATF_TC_BODY(extattr_set_link_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_set_link.*%s.*%s.*failure", path, name); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, extattr_set_link(path, + EXTATTR_NAMESPACE_USER, name, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_set_link_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_file_success); +ATF_TC_HEAD(extattr_delete_file_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_delete_file(2) call"); +} + +ATF_TC_BODY(extattr_delete_file_success, tc) +{ + /* File needs to exist to call extattr_delete_file(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((retval = extattr_delete_file(path, + EXTATTR_NAMESPACE_USER, name)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_file.*%s.*return,success,%d", path, retval); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_delete_file_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_file_failure); +ATF_TC_HEAD(extattr_delete_file_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_delete_file(2) call"); +} + +ATF_TC_BODY(extattr_delete_file_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_file.*%s.*return,failure", path); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, extattr_delete_file(path, + EXTATTR_NAMESPACE_USER, name)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_delete_file_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_fd_success); +ATF_TC_HEAD(extattr_delete_fd_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_delete_fd(2) call"); +} + +ATF_TC_BODY(extattr_delete_fd_success, tc) +{ + /* File needs to exist to call extattr_delete_fd(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_file(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((retval = extattr_delete_fd(filedesc, + EXTATTR_NAMESPACE_USER, name)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_fd.*return,success,%d", retval); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(extattr_delete_fd_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_fd_failure); +ATF_TC_HEAD(extattr_delete_fd_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_delete_fd(2) call"); +} + +ATF_TC_BODY(extattr_delete_fd_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_fd.*return,failure : Bad file descriptor"); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, extattr_delete_fd(-1, EXTATTR_NAMESPACE_USER, name)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_delete_fd_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_link_success); +ATF_TC_HEAD(extattr_delete_link_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "extattr_delete_link(2) call"); +} + +ATF_TC_BODY(extattr_delete_link_success, tc) +{ + /* Symbolic link needs to exist to call extattr_delete_link(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + ATF_REQUIRE_EQ(sizeof(buff), extattr_set_link(path, + EXTATTR_NAMESPACE_USER, name, buff, sizeof(buff))); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((retval = extattr_delete_link(path, + EXTATTR_NAMESPACE_USER, name)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_link.*%s.*return,success,%d", path, retval); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_delete_link_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(extattr_delete_link_failure); +ATF_TC_HEAD(extattr_delete_link_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "extattr_delete_link(2) call"); +} + +ATF_TC_BODY(extattr_delete_link_failure, tc) +{ + /* Prepare the regex to be checked in the audit record */ + snprintf(extregex, sizeof(extregex), + "extattr_delete_link.*%s.*failure", path); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, extattr_delete_link(path, + EXTATTR_NAMESPACE_USER, name)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(extattr_delete_link_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, flock_success); @@ -718,6 +1049,20 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fchflags_failure); ATF_TP_ADD_TC(tp, lchflags_success); ATF_TP_ADD_TC(tp, lchflags_failure); + + ATF_TP_ADD_TC(tp, extattr_set_file_success); + ATF_TP_ADD_TC(tp, extattr_set_file_failure); + ATF_TP_ADD_TC(tp, extattr_set_fd_success); + ATF_TP_ADD_TC(tp, extattr_set_fd_failure); + ATF_TP_ADD_TC(tp, extattr_set_link_success); + ATF_TP_ADD_TC(tp, extattr_set_link_failure); + + ATF_TP_ADD_TC(tp, extattr_delete_file_success); + ATF_TP_ADD_TC(tp, extattr_delete_file_failure); + ATF_TP_ADD_TC(tp, extattr_delete_fd_success); + ATF_TP_ADD_TC(tp, extattr_delete_fd_failure); + ATF_TP_ADD_TC(tp, extattr_delete_link_success); + ATF_TP_ADD_TC(tp, extattr_delete_link_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Jun 18 15:27:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63125100E3B8; Mon, 18 Jun 2018 15:27:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1006184321; Mon, 18 Jun 2018 15:27:32 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CE3B925E8B; Mon, 18 Jun 2018 15:27:31 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IFRV2k005184; Mon, 18 Jun 2018 15:27:31 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IFRV1Z005183; Mon, 18 Jun 2018 15:27:31 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806181527.w5IFRV1Z005183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Jun 2018 15:27:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335319 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335319 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 15:27:32 -0000 Author: asomers Date: Mon Jun 18 15:27:31 2018 New Revision: 335319 URL: https://svnweb.freebsd.org/changeset/base/335319 Log: audit(4): add tests for send, recv, sendto, and recvfrom Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15869 Modified: head/tests/sys/audit/network.c Modified: head/tests/sys/audit/network.c ============================================================================== --- head/tests/sys/audit/network.c Mon Jun 18 15:07:10 2018 (r335318) +++ head/tests/sys/audit/network.c Mon Jun 18 15:27:31 2018 (r335319) @@ -32,16 +32,20 @@ #include #include #include -#include #include "utils.h" +#define MAX_DATA 1024 #define SERVER_PATH "server" -static int sockfd, sockfd2; -static socklen_t len; +static int sockfd, sockfd2, connectfd; +static ssize_t data_bytes; static struct pollfd fds[1]; +static struct sockaddr_un server; static char extregex[80]; +static char data[MAX_DATA]; +static socklen_t len = sizeof(struct sockaddr_un); +static char msgbuff[MAX_DATA] = "This message does not exist"; static const char *auclass = "nt"; static const char *nosupregex = "return,failure : Address family " "not supported by protocol family"; @@ -66,11 +70,11 @@ close_sockets(int count, ...) * Assign local filesystem address to a Unix domain socket */ static void -assign_address(struct sockaddr_un *server) +assign_address(struct sockaddr_un *serveraddr) { - memset(server, 0, sizeof(*server)); - server->sun_family = AF_UNIX; - strcpy(server->sun_path, SERVER_PATH); + memset(serveraddr, 0, sizeof(*serveraddr)); + serveraddr->sun_family = AF_UNIX; + strcpy(serveraddr->sun_path, SERVER_PATH); } @@ -203,12 +207,10 @@ ATF_TC_HEAD(setsockopt_failure, tc) ATF_TC_BODY(setsockopt_failure, tc) { - int tr = 1; snprintf(extregex, sizeof(extregex), "setsockopt.*%s", invalregex); FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid socket descriptor */ - ATF_REQUIRE_EQ(-1, setsockopt(-1, SOL_SOCKET, - SO_REUSEADDR, &tr, sizeof(int))); + ATF_REQUIRE_EQ(-1, setsockopt(-1, SOL_SOCKET, 0, NULL, 0)); check_audit(fds, extregex, pipefd); } @@ -227,10 +229,7 @@ ATF_TC_HEAD(bind_success, tc) ATF_TC_BODY(bind_success, tc) { - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - /* Preliminary socket setup */ ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); /* Check the presence of AF_UNIX address path in audit record */ @@ -258,10 +257,7 @@ ATF_TC_HEAD(bind_failure, tc) ATF_TC_BODY(bind_failure, tc) { - /* Preliminary socket setup */ - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); /* Check the presence of AF_UNIX path in audit record */ snprintf(extregex, sizeof(extregex), "bind.*%s.*return,failure", SERVER_PATH); @@ -287,10 +283,7 @@ ATF_TC_HEAD(bindat_success, tc) ATF_TC_BODY(bindat_success, tc) { - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - /* Preliminary socket setup */ ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); /* Check the presence of socket descriptor in audit record */ @@ -319,10 +312,7 @@ ATF_TC_HEAD(bindat_failure, tc) ATF_TC_BODY(bindat_failure, tc) { - /* Preliminary socket setup */ - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); snprintf(extregex, sizeof(extregex), "bindat.*%s", invalregex); FILE *pipefd = setup(fds, auclass); @@ -347,10 +337,7 @@ ATF_TC_HEAD(listen_success, tc) ATF_TC_BODY(listen_success, tc) { - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - /* Preliminary socket setup */ ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); @@ -401,14 +388,9 @@ ATF_TC_HEAD(connect_success, tc) ATF_TC_BODY(connect_success, tc) { - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - - /* Setup a non-blocking server socket */ - ATF_REQUIRE((sockfd = socket(PF_UNIX, - SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); - /* Bind to the specified address and wait for connection */ + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); ATF_REQUIRE_EQ(0, listen(sockfd, 1)); @@ -442,11 +424,7 @@ ATF_TC_HEAD(connect_failure, tc) ATF_TC_BODY(connect_failure, tc) { - /* Preliminary socket setup */ - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - /* Audit record must contain AF_UNIX address path */ snprintf(extregex, sizeof(extregex), "connect.*%s.*return,failure", SERVER_PATH); @@ -472,14 +450,9 @@ ATF_TC_HEAD(connectat_success, tc) ATF_TC_BODY(connectat_success, tc) { - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - - /* Setup a non-blocking server socket */ - ATF_REQUIRE((sockfd = socket(PF_UNIX, - SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); - /* Bind to the specified address and wait for connection */ + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); ATF_REQUIRE_EQ(0, listen(sockfd, 1)); @@ -514,10 +487,7 @@ ATF_TC_HEAD(connectat_failure, tc) ATF_TC_BODY(connectat_failure, tc) { - /* Preliminary socket setup */ - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); snprintf(extregex, sizeof(extregex), "connectat.*%s", invalregex); FILE *pipefd = setup(fds, auclass); @@ -542,15 +512,9 @@ ATF_TC_HEAD(accept_success, tc) ATF_TC_BODY(accept_success, tc) { - int clientfd; - struct sockaddr_un server; assign_address(&server); - len = sizeof(struct sockaddr_un); - - /* Setup a non-blocking server socket */ - ATF_REQUIRE((sockfd = socket(PF_UNIX, - SOCK_STREAM | SOCK_NONBLOCK, 0)) != -1); - /* Bind to the specified address and wait for connection */ + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); ATF_REQUIRE_EQ(0, listen(sockfd, 1)); @@ -559,15 +523,15 @@ ATF_TC_BODY(accept_success, tc) ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); FILE *pipefd = setup(fds, auclass); - ATF_REQUIRE((clientfd = accept(sockfd, NULL, &len)) != -1); + ATF_REQUIRE((connectfd = accept(sockfd, NULL, &len)) != -1); - /* Audit record must contain clientfd & sockfd */ + /* Audit record must contain connectfd & sockfd */ snprintf(extregex, sizeof(extregex), - "accept.*0x%x.*return,success,%d", sockfd, clientfd); + "accept.*0x%x.*return,success,%d", sockfd, connectfd); check_audit(fds, extregex, pipefd); /* Close all socket descriptors */ - close_sockets(3, sockfd, sockfd2, clientfd); + close_sockets(3, sockfd, sockfd2, connectfd); } ATF_TC_CLEANUP(accept_success, tc) @@ -585,14 +549,10 @@ ATF_TC_HEAD(accept_failure, tc) ATF_TC_BODY(accept_failure, tc) { - /* Preliminary socket setup */ - struct sockaddr_un client; - len = sizeof(struct sockaddr_un); snprintf(extregex, sizeof(extregex), "accept.*%s", invalregex); - FILE *pipefd = setup(fds, auclass); /* Failure reason: Invalid socket descriptor */ - ATF_REQUIRE_EQ(-1, accept(-1, (struct sockaddr *)&client, &len)); + ATF_REQUIRE_EQ(-1, accept(-1, NULL, NULL)); check_audit(fds, extregex, pipefd); } @@ -602,6 +562,252 @@ ATF_TC_CLEANUP(accept_failure, tc) } +ATF_TC_WITH_CLEANUP(send_success); +ATF_TC_HEAD(send_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "send(2) call"); +} + +ATF_TC_BODY(send_success, tc) +{ + assign_address(&server); + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Set up "blocking" client and connect with non-blocking server */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); + ATF_REQUIRE((connectfd = accept(sockfd, NULL, &len)) != -1); + + /* Send a sample message to the connected socket */ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((data_bytes = + send(sockfd2, msgbuff, strlen(msgbuff), 0)) != -1); + + /* Audit record must contain sockfd2 and data_bytes */ + snprintf(extregex, sizeof(extregex), + "send.*0x%x.*return,success,%zd", sockfd2, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(3, sockfd, sockfd2, connectfd); +} + +ATF_TC_CLEANUP(send_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(send_failure); +ATF_TC_HEAD(send_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "send(2) call"); +} + +ATF_TC_BODY(send_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "send.*%s", invalregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, send(-1, NULL, 0, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(send_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recv_success); +ATF_TC_HEAD(recv_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "recv(2) call"); +} + +ATF_TC_BODY(recv_success, tc) +{ + assign_address(&server); + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Set up "blocking" client and connect with non-blocking server */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); + ATF_REQUIRE((connectfd = accept(sockfd, NULL, &len)) != -1); + /* Send a sample message to the connected socket */ + ATF_REQUIRE(send(sockfd2, msgbuff, strlen(msgbuff), 0) != -1); + + /* Receive data once connectfd is ready for reading */ + FILE *pipefd = setup(fds, auclass); + //ATF_REQUIRE(check_readfs(connectfd) != 0); + ATF_REQUIRE((data_bytes = recv(connectfd, data, MAX_DATA, 0)) != 0); + + /* Audit record must contain connectfd and data_bytes */ + snprintf(extregex, sizeof(extregex), + "recv.*0x%x.*return,success,%zd", connectfd, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(3, sockfd, sockfd2, connectfd); +} + +ATF_TC_CLEANUP(recv_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recv_failure); +ATF_TC_HEAD(recv_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "recv(2) call"); +} + +ATF_TC_BODY(recv_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "recv.*%s", invalregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, recv(-1, NULL, 0, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(recv_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(sendto_success); +ATF_TC_HEAD(sendto_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "sendto(2) call"); +} + +ATF_TC_BODY(sendto_success, tc) +{ + assign_address(&server); + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + + /* Set up client socket to be used for sending the data */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + + /* Send a sample message to server's address */ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((data_bytes = sendto(sockfd2, msgbuff, + strlen(msgbuff), 0, (struct sockaddr *)&server, len)) != -1); + + /* Audit record must contain sockfd2 and data_bytes */ + snprintf(extregex, sizeof(extregex), + "sendto.*0x%x.*return,success,%zd", sockfd2, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(sendto_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(sendto_failure); +ATF_TC_HEAD(sendto_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "sendto(2) call"); +} + +ATF_TC_BODY(sendto_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "sendto.*%s", invalregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, sendto(-1, NULL, 0, 0, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(sendto_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recvfrom_success); +ATF_TC_HEAD(recvfrom_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "recvfrom(2) call"); +} + +ATF_TC_BODY(recvfrom_success, tc) +{ + assign_address(&server); + /* Setup a server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + + /* Set up client socket to be used for sending the data */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + ATF_REQUIRE(sendto(sockfd2, msgbuff, strlen(msgbuff), 0, + (struct sockaddr *)&server, len) != -1); + + /* Receive data once sockfd is ready for reading */ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((data_bytes = recvfrom(sockfd, data, + MAX_DATA, 0, NULL, &len)) != 0); + + /* Audit record must contain sockfd and data_bytes */ + snprintf(extregex, sizeof(extregex), + "recvfrom.*0x%x.*return,success,%zd", sockfd, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(recvfrom_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recvfrom_failure); +ATF_TC_HEAD(recvfrom_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "recvfrom(2) call"); +} + +ATF_TC_BODY(recvfrom_failure, tc) +{ + snprintf(extregex, sizeof(extregex), "recvfrom.*%s", invalregex); + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, recvfrom(-1, NULL, 0, 0, NULL, NULL)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(recvfrom_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_success); @@ -624,6 +830,16 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, connectat_failure); ATF_TP_ADD_TC(tp, accept_success); ATF_TP_ADD_TC(tp, accept_failure); + + ATF_TP_ADD_TC(tp, send_success); + ATF_TP_ADD_TC(tp, send_failure); + ATF_TP_ADD_TC(tp, recv_success); + ATF_TP_ADD_TC(tp, recv_failure); + + ATF_TP_ADD_TC(tp, sendto_success); + ATF_TP_ADD_TC(tp, sendto_failure); + ATF_TP_ADD_TC(tp, recvfrom_success); + ATF_TP_ADD_TC(tp, recvfrom_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Jun 18 15:37:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C75D5100EB88; Mon, 18 Jun 2018 15:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79B51849FE; Mon, 18 Jun 2018 15:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 56A7F2603C; Mon, 18 Jun 2018 15:37:44 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IFbi0t010045; Mon, 18 Jun 2018 15:37:44 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IFbig5010044; Mon, 18 Jun 2018 15:37:44 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806181537.w5IFbig5010044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Mon, 18 Jun 2018 15:37:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335320 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335320 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 15:37:45 -0000 Author: asomers Date: Mon Jun 18 15:37:43 2018 New Revision: 335320 URL: https://svnweb.freebsd.org/changeset/base/335320 Log: audit(4): Add tests for {get/set}auid, {get/set}audit, {get/set}audit_addr Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15871 Modified: head/tests/sys/audit/administrative.c Modified: head/tests/sys/audit/administrative.c ============================================================================== --- head/tests/sys/audit/administrative.c Mon Jun 18 15:27:31 2018 (r335319) +++ head/tests/sys/audit/administrative.c Mon Jun 18 15:37:43 2018 (r335320) @@ -39,7 +39,7 @@ static pid_t pid; static int filedesc; static mode_t mode = 0777; static struct pollfd fds[1]; -static char adregex[60]; +static char adregex[80]; static const char *auclass = "ad"; static const char *path = "fileforaudit"; @@ -200,6 +200,301 @@ ATF_TC_CLEANUP(nfs_getfh_failure, tc) } +ATF_TC_WITH_CLEANUP(getauid_success); +ATF_TC_HEAD(getauid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "getauid(2) call"); +} + +ATF_TC_BODY(getauid_success, tc) +{ + au_id_t auid; + pid = getpid(); + snprintf(adregex, sizeof(adregex), "getauid.*%d.*return,success", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, getauid(&auid)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getauid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getauid_failure); +ATF_TC_HEAD(getauid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "getauid(2) call"); +} + +ATF_TC_BODY(getauid_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "getauid.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, getauid(NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getauid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setauid_success); +ATF_TC_HEAD(setauid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "setauid(2) call"); +} + +ATF_TC_BODY(setauid_success, tc) +{ + au_id_t auid; + pid = getpid(); + snprintf(adregex, sizeof(adregex), "setauid.*%d.*return,success", pid); + ATF_REQUIRE_EQ(0, getauid(&auid)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, setauid(&auid)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setauid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setauid_failure); +ATF_TC_HEAD(setauid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "setauid(2) call"); +} + +ATF_TC_BODY(setauid_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "setauid.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, setauid(NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setauid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getaudit_success); +ATF_TC_HEAD(getaudit_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "getaudit(2) call"); +} + +ATF_TC_BODY(getaudit_success, tc) +{ + pid = getpid(); + auditinfo_t auditinfo; + snprintf(adregex, sizeof(adregex), "getaudit.*%d.*return,success", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, getaudit(&auditinfo)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getaudit_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getaudit_failure); +ATF_TC_HEAD(getaudit_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "getaudit(2) call"); +} + +ATF_TC_BODY(getaudit_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "getaudit.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, getaudit(NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getaudit_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setaudit_success); +ATF_TC_HEAD(setaudit_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "setaudit(2) call"); +} + +ATF_TC_BODY(setaudit_success, tc) +{ + pid = getpid(); + auditinfo_t auditinfo; + snprintf(adregex, sizeof(adregex), "setaudit.*%d.*return,success", pid); + ATF_REQUIRE_EQ(0, getaudit(&auditinfo)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, setaudit(&auditinfo)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setaudit_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setaudit_failure); +ATF_TC_HEAD(setaudit_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "setaudit(2) call"); +} + +ATF_TC_BODY(setaudit_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), "setaudit.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, setaudit(NULL)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setaudit_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getaudit_addr_success); +ATF_TC_HEAD(getaudit_addr_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "getaudit_addr(2) call"); +} + +ATF_TC_BODY(getaudit_addr_success, tc) +{ + pid = getpid(); + auditinfo_addr_t auditinfo; + snprintf(adregex, sizeof(adregex), + "getaudit_addr.*%d.*return,success", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, getaudit_addr(&auditinfo, sizeof(auditinfo))); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getaudit_addr_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(getaudit_addr_failure); +ATF_TC_HEAD(getaudit_addr_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "getaudit_addr(2) call"); +} + +ATF_TC_BODY(getaudit_addr_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), + "getaudit_addr.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, getaudit_addr(NULL, 0)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(getaudit_addr_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setaudit_addr_success); +ATF_TC_HEAD(setaudit_addr_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "setaudit_addr(2) call"); +} + +ATF_TC_BODY(setaudit_addr_success, tc) +{ + pid = getpid(); + auditinfo_addr_t auditinfo; + snprintf(adregex, sizeof(adregex), + "setaudit_addr.*%d.*return,success", pid); + + ATF_REQUIRE_EQ(0, getaudit_addr(&auditinfo, sizeof(auditinfo))); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, setaudit_addr(&auditinfo, sizeof(auditinfo))); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setaudit_addr_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(setaudit_addr_failure); +ATF_TC_HEAD(setaudit_addr_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "setaudit_addr(2) call"); +} + +ATF_TC_BODY(setaudit_addr_failure, tc) +{ + pid = getpid(); + snprintf(adregex, sizeof(adregex), + "setaudit_addr.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Bad address */ + ATF_REQUIRE_EQ(-1, setaudit_addr(NULL, 0)); + check_audit(fds, adregex, pipefd); +} + +ATF_TC_CLEANUP(setaudit_addr_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, settimeofday_success); @@ -209,6 +504,21 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, nfs_getfh_success); ATF_TP_ADD_TC(tp, nfs_getfh_failure); + + ATF_TP_ADD_TC(tp, getauid_success); + ATF_TP_ADD_TC(tp, getauid_failure); + ATF_TP_ADD_TC(tp, setauid_success); + ATF_TP_ADD_TC(tp, setauid_failure); + + ATF_TP_ADD_TC(tp, getaudit_success); + ATF_TP_ADD_TC(tp, getaudit_failure); + ATF_TP_ADD_TC(tp, setaudit_success); + ATF_TP_ADD_TC(tp, setaudit_failure); + + ATF_TP_ADD_TC(tp, getaudit_addr_success); + ATF_TP_ADD_TC(tp, getaudit_addr_failure); + ATF_TP_ADD_TC(tp, setaudit_addr_success); + ATF_TP_ADD_TC(tp, setaudit_addr_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Mon Jun 18 16:24:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA161011581; Mon, 18 Jun 2018 16:24:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5980686A5A; Mon, 18 Jun 2018 16:24:45 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 375AB26830; Mon, 18 Jun 2018 16:24:45 +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 w5IGOj8n034759; Mon, 18 Jun 2018 16:24:45 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IGOgUL034745; Mon, 18 Jun 2018 16:24:42 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806181624.w5IGOgUL034745@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jun 2018 16:24:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335321 - in head/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: in head/stand: . geli i386/gptboot i386/gptzfsboot i386/isoboot i386/loader i386/zfsboot libsa libsa/geli X-SVN-Commit-Revision: 335321 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 16:24:46 -0000 Author: imp Date: Mon Jun 18 16:24:42 2018 New Revision: 335321 URL: https://svnweb.freebsd.org/changeset/base/335321 Log: stand: move libgeliboot into libsa. Reduce by 1 the number of crazy libraries we need in stand by moving geli into libsa (where architecturally it belonged all along). This just moves things around without any code changes. Added: head/stand/libsa/geli/ head/stand/libsa/geli/Makefile.inc (contents, props changed) - copied, changed from r335320, head/stand/geli/Makefile head/stand/libsa/geli/geliboot.c (contents, props changed) - copied, changed from r335320, head/stand/geli/geliboot.c head/stand/libsa/geli/geliboot.h (contents, props changed) - copied, changed from r335320, head/stand/geli/geliboot.h head/stand/libsa/geli/geliboot_crypto.c (contents, props changed) - copied, changed from r335320, head/stand/geli/geliboot_crypto.c head/stand/libsa/geli/geliboot_internal.h (contents, props changed) - copied, changed from r335320, head/stand/geli/geliboot_internal.h head/stand/libsa/geli/pwgets.c (contents, props changed) - copied, changed from r335320, head/stand/geli/pwgets.c Deleted: head/stand/geli/Makefile head/stand/geli/Makefile.depend head/stand/geli/geliboot.c head/stand/geli/geliboot.h head/stand/geli/geliboot_crypto.c head/stand/geli/geliboot_internal.h head/stand/geli/pwgets.c Modified: head/stand/Makefile head/stand/defs.mk head/stand/i386/gptboot/Makefile head/stand/i386/gptzfsboot/Makefile head/stand/i386/isoboot/Makefile head/stand/i386/loader/Makefile head/stand/i386/zfsboot/Makefile head/stand/libsa/Makefile Modified: head/stand/Makefile ============================================================================== --- head/stand/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -21,8 +21,6 @@ S.${MK_ZFS}+= zfs S.yes+= defaults S.yes+= man -S.${MK_LOADER_GELI}+= geli - .include S.${MK_EFI}+= efi Modified: head/stand/defs.mk ============================================================================== --- head/stand/defs.mk Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/defs.mk Mon Jun 18 16:24:42 2018 (r335321) @@ -67,8 +67,7 @@ MK_LOADER_GELI=yes .endif .if ${MK_LOADER_GELI} == "yes" CFLAGS+= -DLOADER_GELI_SUPPORT -CFLAGS+= -I${BOOTSRC}/geli -LIBGELIBOOT= ${BOOTOBJ}/geli/libgeliboot.a +CFLAGS+= -I${SASRC}/geli .endif # MK_LOADER_GELI .endif # HAVE_GELI Modified: head/stand/i386/gptboot/Makefile ============================================================================== --- head/stand/i386/gptboot/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/i386/gptboot/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -64,7 +64,7 @@ gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include Modified: head/stand/i386/gptzfsboot/Makefile ============================================================================== --- head/stand/i386/gptzfsboot/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/i386/gptzfsboot/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -75,7 +75,7 @@ gptzfsboot.bin: gptzfsboot.out gptzfsboot.out: ${BTXCRT} zfsboot.o sio.o gpt.o drv.o cons.o \ ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBZFSBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} zfsboot.o: ${ZFSSRC}/zfsimpl.c Modified: head/stand/i386/isoboot/Makefile ============================================================================== --- head/stand/i386/isoboot/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/i386/isoboot/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -66,6 +66,6 @@ isoboot.bin: isoboot.out ${OBJCOPY} -S -O binary isoboot.out ${.TARGET} isoboot.out: ${BTXCRT} isoboot.o sio.o crc32.o drv.o cons.o ${OPENCRYPTO_XTS} - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSA32} .include Modified: head/stand/i386/loader/Makefile ============================================================================== --- head/stand/i386/loader/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/i386/loader/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -71,8 +71,8 @@ FILESMODE_${LOADER}= ${BINMODE} -b # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} -LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBGELIBOOT} ${LIBSA32} +DPADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} +LDADD= ${LDR_INTERP32} ${LIBFIREWIRE} ${LIBZFSBOOT} ${LIBI386} ${LIBSA32} .if ${MACHINE_CPUARCH} == "amd64" CFLAGS+= -DLOADER_PREFER_AMD64 Modified: head/stand/i386/zfsboot/Makefile ============================================================================== --- head/stand/i386/zfsboot/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/i386/zfsboot/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -82,7 +82,7 @@ zfsboot.bin: zfsboot.out ${OBJCOPY} -S -O binary zfsboot.out ${.TARGET} zfsboot.out: ${BTXCRT} zfsboot.o sio.o drv.o cons.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBGELIBOOT} ${LIBSA32} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBZFSBOOT} ${LIBSA32} SRCS= zfsboot.c Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Mon Jun 18 15:37:43 2018 (r335320) +++ head/stand/libsa/Makefile Mon Jun 18 16:24:42 2018 (r335321) @@ -151,4 +151,9 @@ CFLAGS.bzipfs.c+= -I${SRCTOP}/contrib/bzip2 .PATH: ${SYSDIR}/libkern SRCS+= explicit_bzero.c +# Maybe GELI +.if ${MK_LOADER_GELI} == "yes" +.include "${SASRC}/geli/Makefile.inc" +.endif + .include Copied and modified: head/stand/libsa/geli/Makefile.inc (from r335320, head/stand/geli/Makefile) ============================================================================== --- head/stand/geli/Makefile Mon Jun 18 15:37:43 2018 (r335320, copy source) +++ head/stand/libsa/geli/Makefile.inc Mon Jun 18 16:24:42 2018 (r335321) @@ -1,12 +1,10 @@ # $FreeBSD$ -# libgeliboot +# Extra stuff for GELI -DO32=1 +.PATH: ${SASRC}/geli -.include +CFLAGS+= -I${LDRSRC} -LIB= geliboot - # Our password input method SRCS+= pwgets.c @@ -21,10 +19,11 @@ SRCS+= md5c.c # AES implementation from sys/crypto .PATH: ${SYSDIR}/crypto/rijndael -CFLAGS+= -I${LDRSRC} -# Remove asserts -CFLAGS+= -DNDEBUG -SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c +.for i in rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c +# Remove asserts XXX BAD +CFLAGS.${i}+= -DNDEBUG +SRCS+= ${i} +.endfor # local GELI Implementation .PATH: ${SYSDIR}/geom/eli @@ -33,5 +32,3 @@ SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_e # aes .PATH: ${SYSDIR}/opencrypto SRCS+= xform_aes_xts.c - -.include Copied and modified: head/stand/libsa/geli/geliboot.c (from r335320, head/stand/geli/geliboot.c) ============================================================================== Copied and modified: head/stand/libsa/geli/geliboot.h (from r335320, head/stand/geli/geliboot.h) ============================================================================== Copied and modified: head/stand/libsa/geli/geliboot_crypto.c (from r335320, head/stand/geli/geliboot_crypto.c) ============================================================================== --- head/stand/geli/geliboot_crypto.c Mon Jun 18 15:37:43 2018 (r335320, copy source) +++ head/stand/libsa/geli/geliboot_crypto.c Mon Jun 18 16:24:42 2018 (r335321) @@ -71,7 +71,7 @@ geliboot_crypt(u_int algo, int enc, u_char *data, size } if (datasize != (blks / 8)) { printf("Failed to decrypt the entire input: " - "%u != %u\n", blks, datasize); + "%u != %zu\n", blks, datasize); return (1); } break; Copied and modified: head/stand/libsa/geli/geliboot_internal.h (from r335320, head/stand/geli/geliboot_internal.h) ============================================================================== Copied and modified: head/stand/libsa/geli/pwgets.c (from r335320, head/stand/geli/pwgets.c) ============================================================================== From owner-svn-src-all@freebsd.org Mon Jun 18 17:27:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C55A010148E8; Mon, 18 Jun 2018 17:27: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E42768D7A; Mon, 18 Jun 2018 17:27: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 4C5BE27217; Mon, 18 Jun 2018 17:27: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 w5IHRi8B065416; Mon, 18 Jun 2018 17:27:44 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IHRiOW065415; Mon, 18 Jun 2018 17:27:44 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806181727.w5IHRiOW065415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 18 Jun 2018 17:27:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335322 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335322 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 17:27:44 -0000 Author: erj Date: Mon Jun 18 17:27:43 2018 New Revision: 335322 URL: https://svnweb.freebsd.org/changeset/base/335322 Log: iflib: Style fixes MFC after: 1 week Modified: head/sys/net/iflib.c Modified: head/sys/net/iflib.c ============================================================================== --- head/sys/net/iflib.c Mon Jun 18 16:24:42 2018 (r335321) +++ head/sys/net/iflib.c Mon Jun 18 17:27:43 2018 (r335322) @@ -2275,7 +2275,7 @@ iflib_init_locked(if_ctx_t ctx) } } } - done: +done: if_setdrvflagbits(ctx->ifc_ifp, IFF_DRV_RUNNING, IFF_DRV_OACTIVE); IFDI_INTR_ENABLE(ctx); txq = ctx->ifc_txqs; @@ -4014,7 +4014,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) */ if (avoid_reset) { if_setflagbits(ifp, IFF_UP,0); - if (!(if_getdrvflags(ifp)& IFF_DRV_RUNNING)) + if (!(if_getdrvflags(ifp) & IFF_DRV_RUNNING)) reinit = 1; #ifdef INET if (!(if_getflags(ifp) & IFF_NOARP)) @@ -4115,7 +4115,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) #endif setmask |= (mask & IFCAP_FLAGS); - if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) + if (setmask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) setmask |= (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6); if ((mask & IFCAP_WOL) && (if_getcapabilities(ifp) & IFCAP_WOL) != 0) @@ -4140,7 +4140,7 @@ iflib_if_ioctl(if_t ifp, u_long command, caddr_t data) CTX_UNLOCK(ctx); } break; - } + } case SIOCGPRIVATE_0: case SIOCSDRVSPEC: case SIOCGDRVSPEC: @@ -5097,7 +5097,7 @@ iflib_queues_alloc(if_ctx_t ctx) KASSERT(ntxqs > 0, ("number of queues per qset must be at least 1")); KASSERT(nrxqs > 0, ("number of queues per qset must be at least 1")); -/* Allocate the TX ring struct memory */ + /* Allocate the TX ring struct memory */ if (!(ctx->ifc_txqs = (iflib_txq_t) malloc(sizeof(struct iflib_txq) * ntxqsets, M_IFLIB, M_NOWAIT | M_ZERO))) { From owner-svn-src-all@freebsd.org Mon Jun 18 17:37:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E16771015219 for ; Mon, 18 Jun 2018 17:37:08 +0000 (UTC) (envelope-from SRS0=qhqNxm=JE=metaleadz.com=cruz.volkman@yourhostingaccount.com) Received: from walmailout05.yourhostingaccount.com (walmailout05.yourhostingaccount.com [65.254.253.44]) (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 84D1D69538 for ; Mon, 18 Jun 2018 17:37:08 +0000 (UTC) (envelope-from SRS0=qhqNxm=JE=metaleadz.com=cruz.volkman@yourhostingaccount.com) Received: from walmailscan15.yourhostingaccount.com ([10.1.15.15] helo=walmailscan15.yourhostingaccount.com) by walmailout05.yourhostingaccount.com with esmtp (Exim) id 1fUy5O-0002gE-JR for svn-src-all@freebsd.org; Mon, 18 Jun 2018 13:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=metaleadz.com; s=dkim; h=Sender:Content-Type:MIME-Version:Message-ID:Date: Subject:To:From:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uunpdPdrJJCFlxls3IrYmfj7vSzQjM7gXDv0g2gDnbw=; b=c56LN9i4Jx2ylhlwT1bfH/RMqf gMLt7Fz7o4S/1JL2aEa5MmJHObVRdNfLXU7KxoRFSMgw1eFzjjYInZas48McI9b+kaLorI/E+m3iA aOdN00WMRXSbpWHflM+nzRkhhbU9+QKkvV0scPrJxPmIi7DQumRpwOD+JySedC9n+ItN+Mhz9eKKE 2hDH9W+gvuniOech5AmFWDYYvSgYjOZ7jJ0eVsVyGzcqLMGhhkDg/J0lcn5hly6aI7ncXFJTI0r3o sZVawohhCV1n+LrfhqSTyPsc2Iurs8y5PC9/rDkx45VQ7nBcCEzBwX8FNS4X4mYt8ZSF2YwKWcv1F PEx29h2w==; Received: from [10.114.3.33] (helo=walimpout13) by walmailscan15.yourhostingaccount.com with esmtp (Exim) id 1fUy5O-0002PW-GN for svn-src-all@freebsd.org; Mon, 18 Jun 2018 13:37:02 -0400 Received: from walauthsmtp06.yourhostingaccount.com ([10.1.18.6]) by walimpout13 with id 0Hcy1y00807rVmq01Hd2dX; Mon, 18 Jun 2018 13:37:02 -0400 X-Authority-Analysis: v=2.2 cv=ZcdtDodA c=1 sm=1 tr=0 a=fsJ80uyv01TBpq5N3xWxAg==:117 a=Md1NQtxkHouhF32oPp0oRQ==:17 a=7mUfYlMuFuIA:10 a=yGNerdK6CKIA:10 a=DAwyPP_o2Byb1YXLmDAA:9 a=PlK977gGsdjXNAxZ3MAA:9 a=KOcHwsMkAJ0rhWe8:21 a=S2mM_NNO-atWsNwI:21 a=CjuIK1q_8ugA:10 a=yMhMjlubAAAA:8 a=SSmOFEACAAAA:8 a=kYvvtKErsGpl6MjWL2YA:9 a=Fr6nP0FoFKYh3RMP:21 a=gKO2Hq4RSVkA:10 a=UiCQ7L4-1S4A:10 a=hTZeC7Yk6K0A:10 a=frz4AuCg-hUA:10 Received: from [49.207.59.149] (port=49712 helo=HIPL2003) by walauthsmtp06.yourhostingaccount.com with esmtpa (Exim) id 1fUy4i-00085r-LF for svn-src-all@freebsd.org; Mon, 18 Jun 2018 13:36:21 -0400 From: "Cruz Volkman" To: Subject: IT Professionals List Date: Mon, 18 Jun 2018 23:05:28 +0530 Message-ID: MIME-Version: 1.0 X-Mailer: Microsoft Outlook 15.0 Thread-Index: AdQHJz1FuWKMDHZ1RISgW5RZqHDGOA== Content-Language: en-us X-EN-UserInfo: 666c0466b42cf1587025d9c8878ffa4c:931c98230c6409dcc37fa7e93b490c27 X-EN-AuthUser: cruz.volkman@metaleadz.com Sender: "Cruz Volkman" X-EN-OrigIP: 49.207.59.149 X-EN-OrigHost: unknown Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 17:37:09 -0000 Hi, Hope this email finds you well! I understand that you are providing Cybersecurity Solution to various Industries so I am reaching out to you to check if you'd be interested in reaching out to IT key decision maker business contacts to increase your customer base? Have access to all IT professionals below: * CIO, CISO, CSO, CTO, COO * EVP, VP of IT, SVP * IT Director, Director of Infrastructure * IT project managers * Security Systems Administrator * IT Security Engineer * Cyber Security Manager * Security Risk Officer * IT Security Consultant and more. Information fields: Contact Name, Job Title, Email Address, Phone Number, Fax Number, Company details & Technology Type. Please send me your exact target audience (Geographic Location / Business Vertical / Job Titles), so that we can discuss further. Target Industry : ________________________________ (Any Industry), Target Geography: ________________________________ (Worldwide) Target Job Title : ________________________________ (Any Title) Look forward to continued success with you! Thanks & Best Regards, Cruz Volkman Manager-Demand Generation If you do not wish to receive further emails kindly reply with "Leave Out" From owner-svn-src-all@freebsd.org Mon Jun 18 17:57:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 950731016255; Mon, 18 Jun 2018 17:57:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 269246A03E; Mon, 18 Jun 2018 17:57:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 3E60910AFAD; Mon, 18 Jun 2018 13:57:12 -0400 (EDT) Subject: Re: svn commit: r335278 - head/bin/pwd To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806170514.w5H5Epts050842@repo.freebsd.org> From: John Baldwin Message-ID: <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> Date: Mon, 18 Jun 2018 10:57:11 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806170514.w5H5Epts050842@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Mon, 18 Jun 2018 13:57:12 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 17:57:13 -0000 On 6/16/18 10:14 PM, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 17 05:14:50 2018 > New Revision: 335278 > URL: https://svnweb.freebsd.org/changeset/base/335278 > > Log: > pwd: mark usage as dead You keep committing changes like this and ignoring e-mails about them. What broken compiler are you using that doesn't properly inherit __dead2 from the call to exit()? -- John Baldwin From owner-svn-src-all@freebsd.org Mon Jun 18 18:08:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78CE11016BD8; Mon, 18 Jun 2018 18:08: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0F3336A877; Mon, 18 Jun 2018 18:08: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 D89BA27927; Mon, 18 Jun 2018 18:08:19 +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 w5II8Jps085995; Mon, 18 Jun 2018 18:08:19 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5II8Joc085994; Mon, 18 Jun 2018 18:08:19 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806181808.w5II8Joc085994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jun 2018 18:08:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335323 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 335323 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 18:08:20 -0000 Author: emaste Date: Mon Jun 18 18:08:19 2018 New Revision: 335323 URL: https://svnweb.freebsd.org/changeset/base/335323 Log: arm64 linuxulator: add dup syscall entry Missed in r333027 Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/arm64/linux/syscalls.master Modified: head/sys/arm64/linux/syscalls.master ============================================================================== --- head/sys/arm64/linux/syscalls.master Mon Jun 18 17:27:43 2018 (r335322) +++ head/sys/arm64/linux/syscalls.master Mon Jun 18 18:08:19 2018 (r335323) @@ -42,7 +42,7 @@ struct epoll_event *events, \ l_int maxevents, l_int timeout, \ l_sigset_t *mask, l_size_t sigsetsize); } -23 AUE_NULL UNIMPL linux_dup +23 AUE_DUP NOPROTO { int dup(u_int fd); } 24 AUE_NULL STD { int linux_dup3(l_int oldfd, l_int newfd, \ l_int flags); } 25 AUE_FCNTL STD { int linux_fcntl(l_uint fd, l_uint cmd, \ From owner-svn-src-all@freebsd.org Mon Jun 18 18:10:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 687631016E58; Mon, 18 Jun 2018 18:10:13 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCD66AA7B; Mon, 18 Jun 2018 18:10:13 +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 EEF7D2792B; Mon, 18 Jun 2018 18:10: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 w5IIACR0086144; Mon, 18 Jun 2018 18:10:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IIACFI086140; Mon, 18 Jun 2018 18:10:12 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806181810.w5IIACFI086140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jun 2018 18:10:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335324 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 335324 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 18:10:13 -0000 Author: emaste Date: Mon Jun 18 18:10:11 2018 New Revision: 335324 URL: https://svnweb.freebsd.org/changeset/base/335324 Log: Regen arm64 linuxulator sysent files after r335323 Modified: head/sys/arm64/linux/linux_syscall.h head/sys/arm64/linux/linux_syscalls.c head/sys/arm64/linux/linux_sysent.c head/sys/arm64/linux/linux_systrace_args.c Modified: head/sys/arm64/linux/linux_syscall.h ============================================================================== --- head/sys/arm64/linux/linux_syscall.h Mon Jun 18 18:08:19 2018 (r335323) +++ head/sys/arm64/linux/linux_syscall.h Mon Jun 18 18:10:11 2018 (r335324) @@ -23,6 +23,7 @@ #define LINUX_SYS_linux_epoll_create1 20 #define LINUX_SYS_linux_epoll_ctl 21 #define LINUX_SYS_linux_epoll_pwait 22 +#define LINUX_SYS_dup 23 #define LINUX_SYS_linux_dup3 24 #define LINUX_SYS_linux_fcntl 25 #define LINUX_SYS_linux_inotify_init1 26 Modified: head/sys/arm64/linux/linux_syscalls.c ============================================================================== --- head/sys/arm64/linux/linux_syscalls.c Mon Jun 18 18:08:19 2018 (r335323) +++ head/sys/arm64/linux/linux_syscalls.c Mon Jun 18 18:10:11 2018 (r335324) @@ -30,7 +30,7 @@ const char *linux_syscallnames[] = { "linux_epoll_create1", /* 20 = linux_epoll_create1 */ "linux_epoll_ctl", /* 21 = linux_epoll_ctl */ "linux_epoll_pwait", /* 22 = linux_epoll_pwait */ - "#23", /* 23 = linux_dup */ + "dup", /* 23 = dup */ "linux_dup3", /* 24 = linux_dup3 */ "linux_fcntl", /* 25 = linux_fcntl */ "linux_inotify_init1", /* 26 = linux_inotify_init1 */ Modified: head/sys/arm64/linux/linux_sysent.c ============================================================================== --- head/sys/arm64/linux/linux_sysent.c Mon Jun 18 18:08:19 2018 (r335323) +++ head/sys/arm64/linux/linux_sysent.c Mon Jun 18 18:10:11 2018 (r335324) @@ -40,7 +40,7 @@ struct sysent linux_sysent[] = { { AS(linux_epoll_create1_args), (sy_call_t *)linux_epoll_create1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 20 = linux_epoll_create1 */ { AS(linux_epoll_ctl_args), (sy_call_t *)linux_epoll_ctl, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 21 = linux_epoll_ctl */ { AS(linux_epoll_pwait_args), (sy_call_t *)linux_epoll_pwait, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 22 = linux_epoll_pwait */ - { 0, (sy_call_t *)nosys, AUE_NULL, NULL, 0, 0, 0, SY_THR_ABSENT }, /* 23 = linux_dup */ + { AS(dup_args), (sy_call_t *)sys_dup, AUE_DUP, NULL, 0, 0, 0, SY_THR_STATIC }, /* 23 = dup */ { AS(linux_dup3_args), (sy_call_t *)linux_dup3, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 24 = linux_dup3 */ { AS(linux_fcntl_args), (sy_call_t *)linux_fcntl, AUE_FCNTL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 25 = linux_fcntl */ { AS(linux_inotify_init1_args), (sy_call_t *)linux_inotify_init1, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 26 = linux_inotify_init1 */ Modified: head/sys/arm64/linux/linux_systrace_args.c ============================================================================== --- head/sys/arm64/linux/linux_systrace_args.c Mon Jun 18 18:08:19 2018 (r335323) +++ head/sys/arm64/linux/linux_systrace_args.c Mon Jun 18 18:10:11 2018 (r335324) @@ -122,6 +122,13 @@ systrace_args(int sysnum, void *params, uint64_t *uarg *n_args = 6; break; } + /* dup */ + case 23: { + struct dup_args *p = params; + uarg[0] = p->fd; /* u_int */ + *n_args = 1; + break; + } /* linux_dup3 */ case 24: { struct linux_dup3_args *p = params; @@ -2234,6 +2241,16 @@ systrace_entry_setargdesc(int sysnum, int ndx, char *d break; }; break; + /* dup */ + case 23: + switch(ndx) { + case 0: + p = "u_int"; + break; + default: + break; + }; + break; /* linux_dup3 */ case 24: switch(ndx) { @@ -5496,6 +5513,11 @@ systrace_return_setargdesc(int sysnum, int ndx, char * break; /* linux_epoll_pwait */ case 22: + if (ndx == 0 || ndx == 1) + p = "int"; + break; + /* dup */ + case 23: if (ndx == 0 || ndx == 1) p = "int"; break; From owner-svn-src-all@freebsd.org Mon Jun 18 18:35:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 860C71018B47; Mon, 18 Jun 2018 18:35: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 343546B9A8; Mon, 18 Jun 2018 18:35: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 EB3B127DFE; Mon, 18 Jun 2018 18:35:29 +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 w5IIZThY001243; Mon, 18 Jun 2018 18:35:29 GMT (envelope-from tuexen@FreeBSD.org) Received: (from tuexen@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IIZTID001240; Mon, 18 Jun 2018 18:35:29 GMT (envelope-from tuexen@FreeBSD.org) Message-Id: <201806181835.w5IIZTID001240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tuexen set sender to tuexen@FreeBSD.org using -f From: Michael Tuexen Date: Mon, 18 Jun 2018 18:35:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335325 - head/cddl/lib/libdtrace X-SVN-Group: head X-SVN-Commit-Author: tuexen X-SVN-Commit-Paths: head/cddl/lib/libdtrace X-SVN-Commit-Revision: 335325 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 18:35:30 -0000 Author: tuexen Date: Mon Jun 18 18:35:29 2018 New Revision: 335325 URL: https://svnweb.freebsd.org/changeset/base/335325 Log: The IP, TCP, and UDP provider report IP addresses as strings. In some cases, the required information is not available and the UDP provider reported an empty string in this case and the IP and TCP provider reported a NULL pointer. This patch changes the value provided in this case to the string "". This make the behaviour consistent and in-line with the behaviour of Solaris. Reviewed by: markj@, dteske@, gnn@ Differential Revision: https://reviews.freebsd.org/D15855 Modified: head/cddl/lib/libdtrace/ip.d head/cddl/lib/libdtrace/tcp.d head/cddl/lib/libdtrace/udp.d Modified: head/cddl/lib/libdtrace/ip.d ============================================================================== --- head/cddl/lib/libdtrace/ip.d Mon Jun 18 18:10:11 2018 (r335324) +++ head/cddl/lib/libdtrace/ip.d Mon Jun 18 18:35:29 2018 (r335325) @@ -228,11 +228,11 @@ translator ipinfo_t < uint8_t *p > { ((struct ip *)p)->ip_v == 4 ? ntohs(((struct ip *)p)->ip_len) - (((struct ip *)p)->ip_hl << 2): ntohs(((struct ip6_hdr *)p)->ip6_ctlun.ip6_un1.ip6_un1_plen); - ip_saddr = p == NULL ? 0 : + ip_saddr = p == NULL ? "" : ((struct ip *)p)->ip_v == 4 ? inet_ntoa(&((struct ip *)p)->ip_src.s_addr) : inet_ntoa6(&((struct ip6_hdr *)p)->ip6_src); - ip_daddr = p == NULL ? 0 : + ip_daddr = p == NULL ? "" : ((struct ip *)p)->ip_v == 4 ? inet_ntoa(&((struct ip *)p)->ip_dst.s_addr) : inet_ntoa6(&((struct ip6_hdr *)p)->ip6_dst); @@ -246,11 +246,11 @@ translator ipinfo_t < struct mbuf *m > { ntohs(((struct ip *)m->m_data)->ip_len) - (((struct ip *)m->m_data)->ip_hl << 2): ntohs(((struct ip6_hdr *)m->m_data)->ip6_ctlun.ip6_un1.ip6_un1_plen); - ip_saddr = m == NULL ? 0 : + ip_saddr = m == NULL ? "" : ((struct ip *)m->m_data)->ip_v == 4 ? inet_ntoa(&((struct ip *)m->m_data)->ip_src.s_addr) : inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_src); - ip_daddr = m == NULL ? 0 : + ip_daddr = m == NULL ? "" : ((struct ip *)m->m_data)->ip_v == 4 ? inet_ntoa(&((struct ip *)m->m_data)->ip_dst.s_addr) : inet_ntoa6(&((struct ip6_hdr *)m->m_data)->ip6_dst); Modified: head/cddl/lib/libdtrace/tcp.d ============================================================================== --- head/cddl/lib/libdtrace/tcp.d Mon Jun 18 18:10:11 2018 (r335324) +++ head/cddl/lib/libdtrace/tcp.d Mon Jun 18 18:35:29 2018 (r335325) @@ -190,11 +190,11 @@ translator tcpsinfo_t < struct tcpcb *p > { tcps_active = -1; /* XXX */ tcps_lport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_lport); tcps_rport = p == NULL ? 0 : ntohs(p->t_inpcb->inp_inc.inc_ie.ie_fport); - tcps_laddr = p == NULL ? 0 : + tcps_laddr = p == NULL ? "" : p->t_inpcb->inp_vflag == INP_IPV4 ? inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependladdr.id6_addr); - tcps_raddr = p == NULL ? 0 : + tcps_raddr = p == NULL ? "" : p->t_inpcb->inp_vflag == INP_IPV4 ? inet_ntoa(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : inet_ntoa6(&p->t_inpcb->inp_inc.inc_ie.ie_dependfaddr.id6_addr); Modified: head/cddl/lib/libdtrace/udp.d ============================================================================== --- head/cddl/lib/libdtrace/udp.d Mon Jun 18 18:10:11 2018 (r335324) +++ head/cddl/lib/libdtrace/udp.d Mon Jun 18 18:35:29 2018 (r335325) @@ -56,11 +56,11 @@ translator udpsinfo_t < struct inpcb *p > { udps_addr = (uintptr_t)p; udps_lport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_lport); udps_rport = p == NULL ? 0 : ntohs(p->inp_inc.inc_ie.ie_fport); - udps_laddr = p == NULL ? "" : + udps_laddr = p == NULL ? "" : p->inp_vflag == INP_IPV4 ? inet_ntoa(&p->inp_inc.inc_ie.ie_dependladdr.id46_addr.ia46_addr4.s_addr) : inet_ntoa6(&p->inp_inc.inc_ie.ie_dependladdr.id6_addr); - udps_raddr = p == NULL ? "" : + udps_raddr = p == NULL ? "" : p->inp_vflag == INP_IPV4 ? inet_ntoa(&p->inp_inc.inc_ie.ie_dependfaddr.id46_addr.ia46_addr4.s_addr) : inet_ntoa6(&p->inp_inc.inc_ie.ie_dependfaddr.id6_addr); From owner-svn-src-all@freebsd.org Mon Jun 18 18:43:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6951019536; Mon, 18 Jun 2018 18:43:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C47246C1DE; Mon, 18 Jun 2018 18:43:45 +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 A014827FAF; Mon, 18 Jun 2018 18:43:45 +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 w5IIhjUL006089; Mon, 18 Jun 2018 18:43:45 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IIhjnB006088; Mon, 18 Jun 2018 18:43:45 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806181843.w5IIhjnB006088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jun 2018 18:43:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335327 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 335327 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 18:43:46 -0000 Author: emaste Date: Mon Jun 18 18:43:45 2018 New Revision: 335327 URL: https://svnweb.freebsd.org/changeset/base/335327 Log: linuxulator: add debugging for invalid capget/capset version Sponsored by: Turing Robotic Industries Inc. Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Mon Jun 18 18:38:58 2018 (r335326) +++ head/sys/compat/linux/linux_misc.c Mon Jun 18 18:43:45 2018 (r335327) @@ -1895,6 +1895,11 @@ linux_capget(struct thread *td, struct linux_capget_ar return (error); if (luch.version != _LINUX_CAPABILITY_VERSION) { +#ifdef DEBUG + if (ldebug(capget)) + printf(LMSG("invalid capget capability version 0x%x"), + luch.version); +#endif luch.version = _LINUX_CAPABILITY_VERSION; error = copyout(&luch, args->hdrp, sizeof(luch)); if (error) @@ -1934,6 +1939,11 @@ linux_capset(struct thread *td, struct linux_capset_ar return (error); if (luch.version != _LINUX_CAPABILITY_VERSION) { +#ifdef DEBUG + if (ldebug(capset)) + printf(LMSG("invalid capset capability version 0x%x"), + luch.version); +#endif luch.version = _LINUX_CAPABILITY_VERSION; error = copyout(&luch, args->hdrp, sizeof(luch)); if (error) From owner-svn-src-all@freebsd.org Mon Jun 18 19:34:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18BF5101C629; Mon, 18 Jun 2018 19:34:36 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B7F8F6E5C1; Mon, 18 Jun 2018 19:34:35 +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 98388860; Mon, 18 Jun 2018 19:34:35 +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 w5IJYZcr032252; Mon, 18 Jun 2018 19:34:35 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IJYYVo032249; Mon, 18 Jun 2018 19:34:34 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806181934.w5IJYYVo032249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Mon, 18 Jun 2018 19:34:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335333 - head/sys/arm64/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/arm64/linux X-SVN-Commit-Revision: 335333 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 19:34:36 -0000 Author: emaste Date: Mon Jun 18 19:34:34 2018 New Revision: 335333 URL: https://svnweb.freebsd.org/changeset/base/335333 Log: Introduce arm64 linuxulator stubs This provides stub implementations of arm64 Linux vdso and machdep, ptrace, and futex sufficient for executing an arm64 Linux 'hello world' binary. Reviewed by: andrew Sponsored by: Turing Robotic Industries Differential Revision: https://reviews.freebsd.org/D15832 Added: head/sys/arm64/linux/linux_locore.s (contents, props changed) head/sys/arm64/linux/linux_machdep.c (contents, props changed) head/sys/arm64/linux/linux_ptrace.c (contents, props changed) head/sys/arm64/linux/linux_support.s (contents, props changed) Added: head/sys/arm64/linux/linux_locore.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_locore.s Mon Jun 18 19:34:34 2018 (r335333) @@ -0,0 +1,58 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Turing Robotic Industries Inc. + * + * 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$ + */ + +/* + * arm64 Linux VDSO implementation. + */ + +#include + + .data + + .globl linux_platform +linux_platform: + .asciz "arm64" + + .text + +ENTRY(__kernel_rt_sigreturn) + brk #0 /* LINUXTODO: implement __kernel_rt_sigreturn */ + ret + +ENTRY(__kernel_gettimeofday) + brk #0 /* LINUXTODO: implement __kernel_gettimeofday */ + ret + +ENTRY(__kernel_clock_gettime) + brk #0 /* LINUXTODO: implement __kernel_clock_gettime */ + ret + +ENTRY(__kernel_clock_getres) + brk #0 /* LINUXTODO: implement __kernel_clock_getres */ + ret Added: head/sys/arm64/linux/linux_machdep.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_machdep.c Mon Jun 18 19:34:34 2018 (r335333) @@ -0,0 +1,132 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Turing Robotic Industries Inc. + * Copyright (c) 2000 Marcel Moolenaar + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* DTrace probes */ +LIN_SDT_PROBE_DEFINE0(machdep, linux_set_upcall_kse, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_mmap2, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_rt_sigsuspend, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_sigaltstack, todo); +LIN_SDT_PROBE_DEFINE0(machdep, linux_set_cloned_tls, todo); + +/* + * LINUXTODO: deduplicate; linux_execve is common across archs, except that on + * amd64 compat linuxulator it calls freebsd32_exec_copyin_args. + */ +int +linux_execve(struct thread *td, struct linux_execve_args *uap) +{ + struct image_args eargs; + char *path; + int error; + + LCONVPATHEXIST(td, uap->path, &path); + + error = exec_copyin_args(&eargs, path, UIO_SYSSPACE, uap->argp, + uap->envp); + free(path, M_TEMP); + if (error == 0) + error = linux_common_execve(td, &eargs); + return (error); +} + +/* LINUXTODO: implement (or deduplicate) arm64 linux_set_upcall_kse */ +int +linux_set_upcall_kse(struct thread *td, register_t stack) +{ + + LIN_SDT_PROBE0(machdep, linux_set_upcall_kse, todo); + return (EDOOFUS); +} + +/* LINUXTODO: deduplicate arm64 linux_mmap2 */ +int +linux_mmap2(struct thread *td, struct linux_mmap2_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_mmap2, todo); + return (linux_mmap_common(td, PTROUT(uap->addr), uap->len, uap->prot, + uap->flags, uap->fd, uap->pgoff)); +} + +int +linux_mprotect(struct thread *td, struct linux_mprotect_args *uap) +{ + + return (linux_mprotect_common(td, PTROUT(uap->addr), uap->len, + uap->prot)); +} + +/* LINUXTODO: implement arm64 linux_rt_sigsuspend */ +int +linux_rt_sigsuspend(struct thread *td, struct linux_rt_sigsuspend_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_rt_sigsuspend, todo); + return (EDOOFUS); +} + +/* LINUXTODO: implement arm64 linux_sigaltstack */ +int +linux_sigaltstack(struct thread *td, struct linux_sigaltstack_args *uap) +{ + + LIN_SDT_PROBE0(machdep, linux_sigaltstack, todo); + return (EDOOFUS); +} + +/* LINUXTODO: implement arm64 linux_set_cloned_tls */ +int +linux_set_cloned_tls(struct thread *td, void *desc) +{ + + LIN_SDT_PROBE0(machdep, linux_set_cloned_tls, todo); + return (EDOOFUS); +} Added: head/sys/arm64/linux/linux_ptrace.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_ptrace.c Mon Jun 18 19:34:34 2018 (r335333) @@ -0,0 +1,56 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Turing Robotic Industries Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* DTrace probes */ +LIN_SDT_PROBE_DEFINE0(ptrace, linux_ptrace, todo); + +int +linux_ptrace(struct thread *td, struct linux_ptrace_args *uap) +{ + + /* LINUXTODO: implement arm64 linux_ptrace */ + LIN_SDT_PROBE0(ptrace, linux_ptrace, todo); + return (EDOOFUS); +} Added: head/sys/arm64/linux/linux_support.s ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm64/linux/linux_support.s Mon Jun 18 19:34:34 2018 (r335333) @@ -0,0 +1,57 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (C) 2018 Turing Robotic Industries Inc. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include "linux_assym.h" +#include + +#include "assym.inc" + +/* + * LINUXTODO: implement futex_* + */ + +ENTRY(futex_xchgl) + brk #0 + ret + +ENTRY(futex_addl) + brk #0 + ret + +ENTRY(futex_orl) + brk #0 + ret + +ENTRY(futex_andl) + brk #0 + ret + +ENTRY(futex_xorl) + brk #0 + ret From owner-svn-src-all@freebsd.org Mon Jun 18 19:35:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61038101C6F9; Mon, 18 Jun 2018 19:35:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 10A216E7CE; Mon, 18 Jun 2018 19:35:18 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5E3C866; Mon, 18 Jun 2018 19:35:17 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IJZHRM032353; Mon, 18 Jun 2018 19:35:17 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IJZHE3032351; Mon, 18 Jun 2018 19:35:17 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201806181935.w5IJZHE3032351@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Mon, 18 Jun 2018 19:35:17 +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: r335335 - in stable/11/lib/libc: stdio tests/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: cy X-SVN-Commit-Paths: in stable/11/lib/libc: stdio tests/stdio X-SVN-Commit-Revision: 335335 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 19:35:18 -0000 Author: cy Date: Mon Jun 18 19:35:17 2018 New Revision: 335335 URL: https://svnweb.freebsd.org/changeset/base/335335 Log: MFC r333895, r334022 r333895: Drop obsolete Buenos Aires Convention. Prompted by: Recent discussion r334022: Drop obsolete Buenos Aires Convention. Modified: stable/11/lib/libc/stdio/gets_s.c stable/11/lib/libc/tests/stdio/gets_s_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/gets_s.c ============================================================================== --- stable/11/lib/libc/stdio/gets_s.c Mon Jun 18 19:34:43 2018 (r335334) +++ stable/11/lib/libc/stdio/gets_s.c Mon Jun 18 19:35:17 2018 (r335335) @@ -4,7 +4,7 @@ * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * Copyright (c) 2017, 2018 - * Cyril S. E. Schubert. All rights reserved. + * Cyril S. E. Schubert * * This code is derived from software contributed to Berkeley by * Chris Torek. Modified: stable/11/lib/libc/tests/stdio/gets_s_test.c ============================================================================== --- stable/11/lib/libc/tests/stdio/gets_s_test.c Mon Jun 18 19:34:43 2018 (r335334) +++ stable/11/lib/libc/tests/stdio/gets_s_test.c Mon Jun 18 19:35:17 2018 (r335335) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2017 Cyril S. E. Schubert. All rights reserved. + * Copyright (c) 2017 Cyril S. E. Schubert * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Mon Jun 18 19:40:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52189101CBFC; Mon, 18 Jun 2018 19:40:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 01E476EB85; Mon, 18 Jun 2018 19:40:22 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B7DFD871; Mon, 18 Jun 2018 19:40:21 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IJeLeh032768; Mon, 18 Jun 2018 19:40:21 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IJeL67032767; Mon, 18 Jun 2018 19:40:21 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806181940.w5IJeL67032767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jun 2018 19:40:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335336 - head/stand/geli X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/geli X-SVN-Commit-Revision: 335336 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 19:40:22 -0000 Author: imp Date: Mon Jun 18 19:40:21 2018 New Revision: 335336 URL: https://svnweb.freebsd.org/changeset/base/335336 Log: Remove now-empty geli directory Deleted: head/stand/geli/ From owner-svn-src-all@freebsd.org Mon Jun 18 19:53:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBF7A101DBBC; Mon, 18 Jun 2018 19:53:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DA9A6F8D1; Mon, 18 Jun 2018 19:53:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5EE2EB9E; Mon, 18 Jun 2018 19:53:12 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IJrCSW043328; Mon, 18 Jun 2018 19:53:12 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IJrCbv043327; Mon, 18 Jun 2018 19:53:12 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806181953.w5IJrCbv043327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jun 2018 19:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335337 - head/stand/libsa X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/stand/libsa X-SVN-Commit-Revision: 335337 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 19:53:13 -0000 Author: imp Date: Mon Jun 18 19:53:11 2018 New Revision: 335337 URL: https://svnweb.freebsd.org/changeset/base/335337 Log: Remove stray debugging line. Noticed by: ian@ Modified: head/stand/libsa/Makefile Modified: head/stand/libsa/Makefile ============================================================================== --- head/stand/libsa/Makefile Mon Jun 18 19:40:21 2018 (r335336) +++ head/stand/libsa/Makefile Mon Jun 18 19:53:11 2018 (r335337) @@ -103,7 +103,6 @@ STAND_H_INC=ctype.h fcntl.h signal.h stdio.h stdlib.h OTHER_INC=stdarg.h errno.h stdint.h beforedepend: - echo beforedepend; \ mkdir -p ${FAKE_DIRS}; \ for i in ${SAFE_INCS}; do \ ln -sf ${SRCTOP}/include/$$i $$i; \ From owner-svn-src-all@freebsd.org Mon Jun 18 20:12:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 46CD4101EF50; Mon, 18 Jun 2018 20:12: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC0DE708DE; Mon, 18 Jun 2018 20:12:55 +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 CD089EEB; Mon, 18 Jun 2018 20:12:55 +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 w5IKCthK053694; Mon, 18 Jun 2018 20:12:55 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IKCtQ7053689; Mon, 18 Jun 2018 20:12:55 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806182012.w5IKCtQ7053689@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 18 Jun 2018 20:12:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv X-SVN-Commit-Revision: 335338 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 20:12:56 -0000 Author: erj Date: Mon Jun 18 20:12:54 2018 New Revision: 335338 URL: https://svnweb.freebsd.org/changeset/base/335338 Log: ixl(4): Update to use iflib Update the driver to use iflib in order to bring performance, maintainability, and (hopefully) stability benefits to the driver. The driver currently isn't completely ported; features that are missing: - VF driver (ixlv) - SR-IOV host support - RDMA support The plan is to have these re-added to the driver before the next FreeBSD release. Reviewed by: gallatin@ Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com Tested by: jeffrey.e.pieper@intel.com MFC after: 1 month Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D15577 Added: head/sys/dev/ixl/ixl_debug.h (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files.amd64 head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_pf_i2c.c head/sys/dev/ixl/ixl_pf_iov.c head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/ixl/ixl_pf_qmgr.c head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlvc.c head/sys/modules/Makefile head/sys/modules/ixl/Makefile head/sys/modules/ixlv/Makefile Modified: head/sys/amd64/conf/GENERIC ============================================================================== --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018 (r335337) +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018 (r335338) @@ -240,8 +240,8 @@ device em # Intel PRO/1000 Gigabit Ethernet Family device ix # Intel PRO/10GbE PCIE PF Ethernet device ixv # Intel PRO/10GbE PCIE VF Ethernet device ixl # Intel XL710 40Gbe PCIE Ethernet -options IXL_IW # Enable iWARP Client Interface in ixl(4) -device ixlv # Intel XL710 40Gbe VF PCIE Ethernet +#options IXL_IW # Enable iWARP Client Interface in ixl(4) +#device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device le # AMD Am7900 LANCE and Am79C9xx PCnet device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Mon Jun 18 19:53:11 2018 (r335337) +++ head/sys/conf/files.amd64 Mon Jun 18 20:12:54 2018 (r335338) @@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_pf_i2c.c optional ixl pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixl_iw.c optional ixl pci \ - compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/if_ixlv.c optional ixlv pci \ - compile-with "${NORMAL_C} -I$S/dev/ixl" +#dev/ixl/ixl_iw.c optional ixl pci \ +# compile-with "${NORMAL_C} -I$S/dev/ixl" +#dev/ixl/if_ixlv.c optional ixlv pci \ +# compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixlvc.c optional ixlv pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 19:53:11 2018 (r335337) +++ head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:12:54 2018 (r335338) @@ -132,7 +132,7 @@ i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_ bus_dmamap_unload(mem->tag, mem->map); bus_dmamem_free(mem->tag, mem->va, mem->map); bus_dma_tag_destroy(mem->tag); - return (0); + return (I40E_SUCCESS); } void Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon Jun 18 19:53:11 2018 (r335337) +++ head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:12:54 2018 (r335338) @@ -51,60 +51,79 @@ #define IXL_DRIVER_VERSION_MINOR 9 #define IXL_DRIVER_VERSION_BUILD 9 -char ixl_driver_version[] = __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." - __XSTRING(IXL_DRIVER_VERSION_MINOR) "." - __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k"; +#define IXL_DRIVER_VERSION_STRING \ + __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ + __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ + __XSTRING(IXL_DRIVER_VERSION_BUILD) "-iflib-k" /********************************************************************* * PCI Device ID Table * * Used by probe to select devices to load on - * Last field stores an index into ixl_strings - * Last entry must be all 0s * - * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } + * ( Vendor ID, Device ID, Branding String ) *********************************************************************/ -static ixl_vendor_info_t ixl_vendor_info_array[] = +static pci_vendor_info_t ixl_vendor_info_array[] = { - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, 0, 0, 0}, - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, 0, 0, 0}, + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) Ethernet Controller X710 for 10GbE SFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet Controller XL710 for 40GbE backplane"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, "Intel(R) Ethernet Controller X710 for 10GbE backplane"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, "Intel(R) Ethernet Controller XL710 for 40GbE QSFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, "Intel(R) Ethernet Controller XL710 for 40GbE QSFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, "Intel(R) Ethernet Controller X710 for 10GbE QSFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, "Intel(R) Ethernet Controller X710 for 10GBASE-T"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, "Intel(R) Ethernet Controller X710/X557-AT 10GBASE-T"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, "Intel(R) Ethernet Connection X722 for 10GbE backplane"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, "Intel(R) Ethernet Connection X722 for 10GbE QSFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, "Intel(R) Ethernet Connection X722 for 10GbE SFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, "Intel(R) Ethernet Connection X722 for 1GbE"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, "Intel(R) Ethernet Connection X722 for 10GBASE-T"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, "Intel(R) Ethernet Connection X722 for 10GbE SFP+"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, "Intel(R) Ethernet Controller XXV710 for 25GbE backplane"), + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, "Intel(R) Ethernet Controller XXV710 for 25GbE SFP28"), /* required last entry */ - {0, 0, 0, 0, 0} + PVID_END }; /********************************************************************* - * Table of branding strings - *********************************************************************/ - -static char *ixl_strings[] = { - "Intel(R) Ethernet Connection 700 Series PF Driver" -}; - - -/********************************************************************* * Function prototypes *********************************************************************/ -static int ixl_probe(device_t); -static int ixl_attach(device_t); -static int ixl_detach(device_t); -static int ixl_shutdown(device_t); +/*** IFLIB interface ***/ +static void *ixl_register(device_t dev); +static int ixl_if_attach_pre(if_ctx_t ctx); +static int ixl_if_attach_post(if_ctx_t ctx); +static int ixl_if_detach(if_ctx_t ctx); +static int ixl_if_shutdown(if_ctx_t ctx); +static int ixl_if_suspend(if_ctx_t ctx); +static int ixl_if_resume(if_ctx_t ctx); +static int ixl_if_msix_intr_assign(if_ctx_t ctx, int msix); +static void ixl_if_enable_intr(if_ctx_t ctx); +static void ixl_if_disable_intr(if_ctx_t ctx); +static int ixl_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); +static int ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); +static int ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, int ntxqsets); +static int ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nqs, int nqsets); +static void ixl_if_queues_free(if_ctx_t ctx); +static void ixl_if_update_admin_status(if_ctx_t ctx); +static void ixl_if_multi_set(if_ctx_t ctx); +static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); +static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); +static int ixl_if_media_change(if_ctx_t ctx); +static int ixl_if_promisc_set(if_ctx_t ctx, int flags); +static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); +static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); +static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); +static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); +static void ixl_if_vflr_handle(if_ctx_t ctx); +// static void ixl_if_link_intr_enable(if_ctx_t ctx); +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 int ixl_save_pf_tunables(struct ixl_pf *); +/*** Other ***/ +static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int); +static void ixl_save_pf_tunables(struct ixl_pf *); +static int ixl_allocate_pci_resources(struct ixl_pf *); /********************************************************************* * FreeBSD Device Interface Entry Points @@ -112,16 +131,17 @@ static int ixl_save_pf_tunables(struct ixl_pf *); static device_method_t ixl_methods[] = { /* Device interface */ - DEVMETHOD(device_probe, ixl_probe), - DEVMETHOD(device_attach, ixl_attach), - DEVMETHOD(device_detach, ixl_detach), - DEVMETHOD(device_shutdown, ixl_shutdown), + DEVMETHOD(device_register, ixl_register), + DEVMETHOD(device_probe, iflib_device_probe), + DEVMETHOD(device_attach, iflib_device_attach), + DEVMETHOD(device_detach, iflib_device_detach), + DEVMETHOD(device_shutdown, iflib_device_shutdown), #ifdef PCI_IOV DEVMETHOD(pci_iov_init, ixl_iov_init), DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), DEVMETHOD(pci_iov_add_vf, ixl_add_vf), #endif - {0, 0} + DEVMETHOD_END }; static driver_t ixl_driver = { @@ -130,15 +150,52 @@ static driver_t ixl_driver = { devclass_t ixl_devclass; DRIVER_MODULE(ixl, pci, ixl_driver, ixl_devclass, 0, 0); +MODULE_VERSION(ixl, 3); -MODULE_VERSION(ixl, 1); - MODULE_DEPEND(ixl, pci, 1, 1, 1); MODULE_DEPEND(ixl, ether, 1, 1, 1); -#if defined(DEV_NETMAP) && __FreeBSD_version >= 1100000 -MODULE_DEPEND(ixl, netmap, 1, 1, 1); -#endif /* DEV_NETMAP */ +MODULE_DEPEND(ixl, iflib, 1, 1, 1); +static device_method_t ixl_if_methods[] = { + DEVMETHOD(ifdi_attach_pre, ixl_if_attach_pre), + DEVMETHOD(ifdi_attach_post, ixl_if_attach_post), + DEVMETHOD(ifdi_detach, ixl_if_detach), + DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), + DEVMETHOD(ifdi_suspend, ixl_if_suspend), + DEVMETHOD(ifdi_resume, ixl_if_resume), + DEVMETHOD(ifdi_init, ixl_if_init), + DEVMETHOD(ifdi_stop, ixl_if_stop), + DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), + DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), + DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), + //DEVMETHOD(ifdi_link_intr_enable, ixl_if_link_intr_enable), + DEVMETHOD(ifdi_rx_queue_intr_enable, ixl_if_rx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queue_intr_enable, ixl_if_tx_queue_intr_enable), + DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), + DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), + DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), + DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), + DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), + DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), + DEVMETHOD(ifdi_media_status, ixl_if_media_status), + DEVMETHOD(ifdi_media_change, ixl_if_media_change), + DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), + DEVMETHOD(ifdi_timer, ixl_if_timer), + DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), + DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), + DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), + DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), + DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), + DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), + // ifdi_led_func + // ifdi_debug + DEVMETHOD_END +}; + +static driver_t ixl_if_driver = { + "ixl_if", ixl_if_methods, sizeof(struct ixl_pf) +}; + /* ** TUNEABLE PARAMETERS: */ @@ -147,39 +204,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, 0, "IXL driver parameters"); /* - * MSIX should be the default for best performance, - * but this allows it to be forced off for testing. - */ -static int ixl_enable_msix = 1; -TUNABLE_INT("hw.ixl.enable_msix", &ixl_enable_msix); -SYSCTL_INT(_hw_ixl, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixl_enable_msix, 0, - "Enable MSI-X interrupts"); - -/* -** Number of descriptors per ring -** - TX and RX sizes are independently configurable -*/ -static int ixl_tx_ring_size = IXL_DEFAULT_RING; -TUNABLE_INT("hw.ixl.tx_ring_size", &ixl_tx_ring_size); -SYSCTL_INT(_hw_ixl, OID_AUTO, tx_ring_size, CTLFLAG_RDTUN, - &ixl_tx_ring_size, 0, "TX Descriptor Ring Size"); - -static int ixl_rx_ring_size = IXL_DEFAULT_RING; -TUNABLE_INT("hw.ixl.rx_ring_size", &ixl_rx_ring_size); -SYSCTL_INT(_hw_ixl, OID_AUTO, rx_ring_size, CTLFLAG_RDTUN, - &ixl_rx_ring_size, 0, "RX Descriptor Ring Size"); - -/* -** This can be set manually, if left as 0 the -** number of queues will be calculated based -** on cpus and msix vectors available. -*/ -static int ixl_max_queues = 0; -TUNABLE_INT("hw.ixl.max_queues", &ixl_max_queues); -SYSCTL_INT(_hw_ixl, OID_AUTO, max_queues, CTLFLAG_RDTUN, - &ixl_max_queues, 0, "Number of Queues"); - -/* * Leave this on unless you need to send flow control * frames (or other control frames) from software */ @@ -190,6 +214,13 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, CTL &ixl_enable_tx_fc_filter, 0, "Filter out packets with Ethertype 0x8808 from being sent out by non-HW sources"); +static int ixl_i2c_access_method = 0; +TUNABLE_INT("hw.ixl.i2c_access_method", + &ixl_i2c_access_method); +SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, + &ixl_i2c_access_method, 0, + IXL_SYSCTL_HELP_I2C_METHOD); + /* * Different method for processing TX descriptor * completion. @@ -215,20 +246,22 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, shared_debug_mask, CTLFL &ixl_shared_debug_mask, 0, "Display debug statements that are printed in shared code"); +#if 0 /* ** Controls for Interrupt Throttling ** - true/false for dynamic adjustment ** - default values for static ITR */ -static int ixl_dynamic_rx_itr = 1; +static int ixl_dynamic_rx_itr = 0; TUNABLE_INT("hw.ixl.dynamic_rx_itr", &ixl_dynamic_rx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_rx_itr, CTLFLAG_RDTUN, &ixl_dynamic_rx_itr, 0, "Dynamic RX Interrupt Rate"); -static int ixl_dynamic_tx_itr = 1; +static int ixl_dynamic_tx_itr = 0; TUNABLE_INT("hw.ixl.dynamic_tx_itr", &ixl_dynamic_tx_itr); SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_tx_itr, CTLFLAG_RDTUN, &ixl_dynamic_tx_itr, 0, "Dynamic TX Interrupt Rate"); +#endif static int ixl_rx_itr = IXL_ITR_8K; TUNABLE_INT("hw.ixl.rx_itr", &ixl_rx_itr); @@ -256,165 +289,131 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, CTLFLA &ixl_limit_iwarp_msix, 0, "Limit MSIX vectors assigned to iWARP"); #endif -#ifdef DEV_NETMAP -#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ -#include -#endif /* DEV_NETMAP */ +extern struct if_txrx ixl_txrx_hwb; +extern struct if_txrx ixl_txrx_dwb; -/********************************************************************* - * Device identification routine - * - * ixl_probe determines if the driver should be loaded on - * the hardware based on PCI vendor/device id of the device. - * - * return BUS_PROBE_DEFAULT on success, positive on failure - *********************************************************************/ +static struct if_shared_ctx ixl_sctx_init = { + .isc_magic = IFLIB_MAGIC, + .isc_q_align = PAGE_SIZE, + .isc_tx_maxsize = IXL_TSO_SIZE, + .isc_tx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, -static int -ixl_probe(device_t dev) -{ - ixl_vendor_info_t *ent; + .isc_rx_maxsize = 16384, + .isc_rx_nsegments = IXL_MAX_RX_SEGS, + .isc_rx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, + .isc_nfl = 1, + .isc_ntxqs = 1, + .isc_nrxqs = 1, - u16 pci_vendor_id, pci_device_id; - u16 pci_subvendor_id, pci_subdevice_id; - char device_name[256]; + .isc_admin_intrcnt = 1, + .isc_vendor_info = ixl_vendor_info_array, + .isc_driver_version = IXL_DRIVER_VERSION_STRING, + .isc_driver = &ixl_if_driver, + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_ADMIN_ALWAYS_RUN, -#if 0 - INIT_DEBUGOUT("ixl_probe: begin"); -#endif - pci_vendor_id = pci_get_vendor(dev); - if (pci_vendor_id != I40E_INTEL_VENDOR_ID) - return (ENXIO); + .isc_nrxd_min = {IXL_MIN_RING}, + .isc_ntxd_min = {IXL_MIN_RING}, + .isc_nrxd_max = {IXL_MAX_RING}, + .isc_ntxd_max = {IXL_MAX_RING}, + .isc_nrxd_default = {IXL_DEFAULT_RING}, + .isc_ntxd_default = {IXL_DEFAULT_RING}, +}; - pci_device_id = pci_get_device(dev); - pci_subvendor_id = pci_get_subvendor(dev); - pci_subdevice_id = pci_get_subdevice(dev); +if_shared_ctx_t ixl_sctx = &ixl_sctx_init; - ent = ixl_vendor_info_array; - while (ent->vendor_id != 0) { - if ((pci_vendor_id == ent->vendor_id) && - (pci_device_id == ent->device_id) && - - ((pci_subvendor_id == ent->subvendor_id) || - (ent->subvendor_id == 0)) && - - ((pci_subdevice_id == ent->subdevice_id) || - (ent->subdevice_id == 0))) { - sprintf(device_name, "%s, Version - %s", - ixl_strings[ent->index], - ixl_driver_version); - device_set_desc_copy(dev, device_name); - return (BUS_PROBE_DEFAULT); - } - ent++; - } - return (ENXIO); +/*** Functions ***/ +static void * +ixl_register(device_t dev) +{ + return (ixl_sctx); } -/* - * Sanity check and save off tunable values. - */ static int -ixl_save_pf_tunables(struct ixl_pf *pf) +ixl_allocate_pci_resources(struct ixl_pf *pf) { - device_t dev = pf->dev; + int rid; + struct i40e_hw *hw = &pf->hw; + device_t dev = iflib_get_dev(pf->vsi.ctx); - /* Save tunable information */ - pf->enable_msix = ixl_enable_msix; - pf->max_queues = ixl_max_queues; - pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; - pf->dynamic_rx_itr = ixl_dynamic_rx_itr; - pf->dynamic_tx_itr = ixl_dynamic_tx_itr; - pf->dbg_mask = ixl_core_debug_mask; - pf->hw.debug_mask = ixl_shared_debug_mask; -#ifdef DEV_NETMAP - if (ixl_enable_head_writeback == 0) - device_printf(dev, "Head writeback mode cannot be disabled " - "when netmap is enabled\n"); - pf->vsi.enable_head_writeback = 1; -#else - pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); -#endif + /* Map BAR0 */ + rid = PCIR_BAR(0); + pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + + if (!(pf->pci_mem)) { + device_printf(dev, "Unable to allocate bus resource: PCI memory\n"); + return (ENXIO); + } - ixl_vsi_setup_rings_size(&pf->vsi, ixl_tx_ring_size, ixl_rx_ring_size); + /* Save off the PCI information */ + hw->vendor_id = pci_get_vendor(dev); + hw->device_id = pci_get_device(dev); + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); + hw->subsystem_vendor_id = + pci_read_config(dev, PCIR_SUBVEND_0, 2); + hw->subsystem_device_id = + pci_read_config(dev, PCIR_SUBDEV_0, 2); - if (ixl_tx_itr < 0 || ixl_tx_itr > IXL_MAX_ITR) { - device_printf(dev, "Invalid tx_itr value of %d set!\n", - ixl_tx_itr); - device_printf(dev, "tx_itr must be between %d and %d, " - "inclusive\n", - 0, IXL_MAX_ITR); - device_printf(dev, "Using default value of %d instead\n", - IXL_ITR_4K); - pf->tx_itr = IXL_ITR_4K; - } else - pf->tx_itr = ixl_tx_itr; + hw->bus.device = pci_get_slot(dev); + hw->bus.func = pci_get_function(dev); - if (ixl_rx_itr < 0 || ixl_rx_itr > IXL_MAX_ITR) { - device_printf(dev, "Invalid rx_itr value of %d set!\n", - ixl_rx_itr); - device_printf(dev, "rx_itr must be between %d and %d, " - "inclusive\n", - 0, IXL_MAX_ITR); - device_printf(dev, "Using default value of %d instead\n", - IXL_ITR_8K); - pf->rx_itr = IXL_ITR_8K; - } else - pf->rx_itr = ixl_rx_itr; + /* Save off register access information */ + pf->osdep.mem_bus_space_tag = + rman_get_bustag(pf->pci_mem); + pf->osdep.mem_bus_space_handle = + rman_get_bushandle(pf->pci_mem); + pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); + pf->osdep.flush_reg = I40E_GLGEN_STAT; + pf->osdep.dev = dev; - return (0); -} + pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; + pf->hw.back = &pf->osdep; + + return (0); + } -/********************************************************************* - * Device initialization routine - * - * The attach entry point is called when the driver is being loaded. - * This routine identifies the type of hardware, allocates all resources - * and initializes the hardware. - * - * return 0 on success, positive on failure - *********************************************************************/ - static int -ixl_attach(device_t dev) +ixl_if_attach_pre(if_ctx_t ctx) { - struct ixl_pf *pf; - struct i40e_hw *hw; - struct ixl_vsi *vsi; + device_t dev; + struct ixl_pf *pf; + struct i40e_hw *hw; + struct ixl_vsi *vsi; + if_softc_ctx_t scctx; + struct i40e_filter_control_settings filter; enum i40e_status_code status; - int error = 0; + int error = 0; - INIT_DEBUGOUT("ixl_attach: begin"); + INIT_DEBUGOUT("ixl_if_attach_pre: begin"); /* Allocate, clear, and link in our primary soft structure */ - pf = device_get_softc(dev); - pf->dev = pf->osdep.dev = dev; + dev = iflib_get_dev(ctx); + pf = iflib_get_softc(ctx); + vsi = &pf->vsi; + vsi->back = pf; + pf->dev = dev; hw = &pf->hw; /* ** Note this assumes we have a single embedded VSI, ** this could be enhanced later to allocate multiple */ - vsi = &pf->vsi; - vsi->dev = pf->dev; - vsi->back = pf; + //vsi->dev = pf->dev; + vsi->hw = &pf->hw; + vsi->id = 0; + vsi->num_vlans = 0; + vsi->ctx = ctx; + vsi->media = iflib_get_media(ctx); + vsi->shared = scctx = iflib_get_softc_ctx(ctx); /* Save tunable values */ - error = ixl_save_pf_tunables(pf); - if (error) - return (error); + ixl_save_pf_tunables(pf); - /* Core Lock Init*/ - IXL_PF_LOCK_INIT(pf, device_get_nameunit(dev)); - - /* Set up the timer callout */ - callout_init_mtx(&pf->timer, &pf->pf_mtx, 0); - /* Do PCI setup - map BAR0, etc */ if (ixl_allocate_pci_resources(pf)) { device_printf(dev, "Allocation of PCI resources failed\n"); error = ENXIO; - goto err_out; + goto err_pci_res; } /* Establish a clean starting point */ @@ -478,16 +477,11 @@ ixl_attach(device_t dev) /* Get capabilities from the device */ error = ixl_get_hw_capabilities(pf); if (error) { - device_printf(dev, "HW capabilities failure!\n"); + device_printf(dev, "get_hw_capabilities failed: %d\n", + error); goto err_get_cap; } - /* - * Allocate interrupts and figure out number of queues to use - * for PF interface - */ - pf->msix = ixl_init_msix(pf); - /* Set up host memory cache */ status = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, hw->func_caps.num_rx_qp, 0, 0); @@ -496,7 +490,6 @@ ixl_attach(device_t dev) i40e_stat_str(hw, status)); goto err_get_cap; } - status = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); if (status) { device_printf(dev, "configure_lan_hmc failed: %s\n", @@ -504,23 +497,6 @@ ixl_attach(device_t dev) goto err_mac_hmc; } - /* Init queue allocation manager */ - error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); - if (error) { - device_printf(dev, "Failed to init queue manager for PF queues, error %d\n", - error); - goto err_mac_hmc; - } - /* reserve a contiguous allocation for the PF's VSI */ - error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, vsi->num_queues, &pf->qtag); - if (error) { - device_printf(dev, "Failed to reserve queues for PF LAN VSI, error %d\n", - error); - goto err_mac_hmc; - } - device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", - pf->qtag.num_allocated, pf->qtag.num_active); - /* Disable LLDP from the firmware for certain NVM versions */ if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) || (pf->hw.aq.fw_maj_ver < 4)) { @@ -536,46 +512,120 @@ ixl_attach(device_t dev) goto err_mac_hmc; } bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); + iflib_set_mac(ctx, hw->mac.addr); i40e_get_port_mac_addr(hw, hw->mac.port_addr); + /* Set up the device filtering */ + bzero(&filter, sizeof(filter)); + filter.enable_ethtype = TRUE; + filter.enable_macvlan = TRUE; + filter.enable_fdir = FALSE; + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; + if (i40e_set_filter_control(hw, &filter)) + device_printf(dev, "i40e_set_filter_control() failed\n"); + /* Query device FW LLDP status */ ixl_get_fw_lldp_status(pf); /* Tell FW to apply DCB config on link up */ - if ((hw->mac.type != I40E_MAC_X722) - && ((pf->hw.aq.api_maj_ver > 1) - || (pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver >= 7))) - i40e_aq_set_dcb_parameters(hw, true, NULL); + i40e_aq_set_dcb_parameters(hw, true, NULL); - /* Initialize mac filter list for VSI */ - SLIST_INIT(&vsi->ftl); - - /* Set up SW VSI and allocate queue memory and rings */ - if (ixl_setup_stations(pf)) { - device_printf(dev, "setup stations failed!\n"); - error = ENOMEM; - goto err_mac_hmc; + /* Fill out iflib parameters */ + if (hw->mac.type == I40E_MAC_X722) + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 128; + else + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 64; + if (vsi->enable_head_writeback) { + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] + * sizeof(struct i40e_tx_desc) + sizeof(u32), DBA_ALIGN); + scctx->isc_txrx = &ixl_txrx_hwb; + } else { + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] + * sizeof(struct i40e_tx_desc), DBA_ALIGN); + scctx->isc_txrx = &ixl_txrx_dwb; } + scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] + * sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); + scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); + scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; + scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; + scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; + scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; + scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; + scctx->isc_tx_csum_flags = CSUM_OFFLOAD; + scctx->isc_capenable = IXL_CAPS; + INIT_DEBUGOUT("ixl_if_attach_pre: end"); + return (0); + +err_mac_hmc: + i40e_shutdown_lan_hmc(hw); +err_get_cap: + i40e_shutdown_adminq(hw); +err_out: + ixl_free_pci_resources(pf); +err_pci_res: + return (error); +} + +static int +ixl_if_attach_post(if_ctx_t ctx) +{ + device_t dev; + struct ixl_pf *pf; + struct i40e_hw *hw; + struct ixl_vsi *vsi; + int error = 0; + enum i40e_status_code status; + + INIT_DEBUGOUT("ixl_if_attach_post: begin"); + + dev = iflib_get_dev(ctx); + pf = iflib_get_softc(ctx); + vsi = &pf->vsi; + vsi->ifp = iflib_get_ifp(ctx); + hw = &pf->hw; + /* Setup OS network interface / ifnet */ - if (ixl_setup_interface(dev, vsi)) { + if (ixl_setup_interface(dev, pf)) { device_printf(dev, "interface setup failed!\n"); error = EIO; - goto err_late; + goto err; } /* Determine link state */ if (ixl_attach_get_link_status(pf)) { error = EINVAL; - goto err_late; + goto err; } error = ixl_switch_config(pf); if (error) { device_printf(dev, "Initial ixl_switch_config() failed: %d\n", error); - goto err_late; + goto err; } + /* Add protocol filters to list */ + ixl_init_filters(vsi); + + /* Init queue allocation manager */ + error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); + if (error) { + device_printf(dev, "Failed to init queue manager for PF queues, error %d\n", + error); + goto err; + } + /* reserve a contiguous allocation for the PF's VSI */ + error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, + max(vsi->num_rx_queues, vsi->num_tx_queues), &pf->qtag); + if (error) { + device_printf(dev, "Failed to reserve queues for PF LAN VSI, error %d\n", + error); + goto err; + } + device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", + pf->qtag.num_allocated, pf->qtag.num_active); + /* Limit PHY interrupts to link, autoneg, and modules failure */ status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, NULL); @@ -583,91 +633,35 @@ ixl_attach(device_t dev) device_printf(dev, "i40e_aq_set_phy_mask() failed: err %s," " aq_err %s\n", i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); - goto err_late; + goto err; } - /* Get the bus configuration and set the shared code's config */ + /* Get the bus configuration and set the shared code */ ixl_get_bus_info(pf); - /* - * In MSI-X mode, initialize the Admin Queue interrupt, - * so userland tools can communicate with the adapter regardless of - * the ifnet interface's status. - */ - if (pf->msix > 1) { - error = ixl_setup_adminq_msix(pf); - if (error) { - device_printf(dev, "ixl_setup_adminq_msix() error: %d\n", - error); - goto err_late; - } - error = ixl_setup_adminq_tq(pf); - if (error) { - device_printf(dev, "ixl_setup_adminq_tq() error: %d\n", - error); - goto err_late; - } - ixl_configure_intr0_msix(pf); - ixl_enable_intr0(hw); - - error = ixl_setup_queue_msix(vsi); - if (error) - device_printf(dev, "ixl_setup_queue_msix() error: %d\n", - error); - error = ixl_setup_queue_tqs(vsi); - if (error) - device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", - error); - } else { - error = ixl_setup_legacy(pf); - - error = ixl_setup_adminq_tq(pf); - if (error) { - device_printf(dev, "ixl_setup_adminq_tq() error: %d\n", - error); - goto err_late; - } - - error = ixl_setup_queue_tqs(vsi); - if (error) - device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", - error); + /* Keep admin queue interrupts active while driver is loaded */ + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { + ixl_configure_intr0_msix(pf); + ixl_enable_intr0(hw); } - if (error) { - device_printf(dev, "interrupt setup error: %d\n", error); - } - /* Set initial advertised speed sysctl value */ ixl_set_initial_advertised_speeds(pf); /* Initialize statistics & add sysctls */ ixl_add_device_sysctls(pf); - ixl_pf_reset_stats(pf); ixl_update_stats_counters(pf); ixl_add_hw_stats(pf); - /* Register for VLAN events */ - vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, - ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); - vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, - ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); + hw->phy.get_link_info = true; + i40e_get_link_status(hw, &pf->link_up); + ixl_update_link_status(pf); #ifdef PCI_IOV ixl_initialize_sriov(pf); #endif -#ifdef DEV_NETMAP - if (vsi->num_rx_desc == vsi->num_tx_desc) { - vsi->queues[0].num_desc = vsi->num_rx_desc; - ixl_netmap_attach(vsi); - } else - device_printf(dev, - "Netmap is not supported when RX and TX descriptor ring sizes differ\n"); - -#endif /* DEV_NETMAP */ - #ifdef IXL_IW if (hw->func_caps.iwarp && ixl_enable_iwarp) { pf->iw_enabled = (pf->iw_msix > 0) ? true : false; @@ -677,7 +671,7 @@ ixl_attach(device_t dev) device_printf(dev, "interfacing to iwarp driver failed: %d\n", error); - goto err_late; + goto err; } else device_printf(dev, "iWARP ready\n"); } else @@ -689,54 +683,38 @@ ixl_attach(device_t dev) } #endif - INIT_DEBUGOUT("ixl_attach: end"); + INIT_DBG_DEV(dev, "end"); return (0); -err_late: - if (vsi->ifp != NULL) { - ether_ifdetach(vsi->ifp); - if_free(vsi->ifp); - } -err_mac_hmc: - i40e_shutdown_lan_hmc(hw); -err_get_cap: - i40e_shutdown_adminq(hw); -err_out: - ixl_free_pci_resources(pf); - ixl_free_vsi(vsi); - IXL_PF_LOCK_DESTROY(pf); +err: + INIT_DEBUGOUT("end: error %d", error); + /* ixl_if_detach() is called on error from this */ return (error); } -/********************************************************************* - * Device removal routine - * - * The detach entry point is called when the driver is being removed. - * This routine stops the adapter and deallocates all the resources - * that were allocated for driver operation. - * - * return 0 on success, positive on failure - *********************************************************************/ - static int -ixl_detach(device_t dev) +ixl_if_detach(if_ctx_t ctx) { - struct ixl_pf *pf = device_get_softc(dev); - struct i40e_hw *hw = &pf->hw; - struct ixl_vsi *vsi = &pf->vsi; + struct ixl_pf *pf = iflib_get_softc(ctx); + struct ixl_vsi *vsi = &pf->vsi; + struct i40e_hw *hw = &pf->hw; + device_t dev = pf->dev; enum i40e_status_code status; #if defined(PCI_IOV) || defined(IXL_IW) int error; #endif - INIT_DEBUGOUT("ixl_detach: begin"); + INIT_DBG_DEV(dev, "begin"); - /* Make sure VLANS are not using driver */ - if (vsi->ifp->if_vlantrunk != NULL) { - device_printf(dev, "Vlan in use, detach first\n"); - return (EBUSY); +#ifdef IXL_IW + if (ixl_enable_iwarp && pf->iw_enabled) { + error = ixl_iw_pf_detach(pf); + if (error == EBUSY) { + device_printf(dev, "iwarp in use; stop it first.\n"); + return (error); + } } - +#endif #ifdef PCI_IOV error = pci_iov_detach(dev); if (error != 0) { @@ -744,73 +722,989 @@ ixl_detach(device_t dev) return (error); } #endif - /* Remove all previously allocated media types */ - ifmedia_removeall(&vsi->media); + ifmedia_removeall(vsi->media); - ether_ifdetach(vsi->ifp); - if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) - ixl_stop(pf); - /* Shutdown LAN HMC */ - status = i40e_shutdown_lan_hmc(hw); - if (status) - device_printf(dev, - "Shutdown LAN HMC failed with code %d\n", status); + if (hw->hmc.hmc_obj) { + status = i40e_shutdown_lan_hmc(hw); + if (status) + device_printf(dev, + "i40e_shutdown_lan_hmc() failed with status %s\n", + i40e_stat_str(hw, status)); + } - /* Teardown LAN queue resources */ - ixl_teardown_queue_msix(vsi); - ixl_free_queue_tqs(vsi); /* Shutdown admin queue */ ixl_disable_intr0(hw); - ixl_teardown_adminq_msix(pf); - ixl_free_adminq_tq(pf); status = i40e_shutdown_adminq(hw); if (status) device_printf(dev, - "Shutdown Admin queue failed with code %d\n", status); + "i40e_shutdown_adminq() failed with status %s\n", + i40e_stat_str(hw, status)); - /* Unregister VLAN events */ - if (vsi->vlan_attach != NULL) - EVENTHANDLER_DEREGISTER(vlan_config, vsi->vlan_attach); - if (vsi->vlan_detach != NULL) - EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); + ixl_pf_qmgr_destroy(&pf->qmgr); + ixl_free_pci_resources(pf); + ixl_free_mac_filters(vsi); + INIT_DBG_DEV(dev, "end"); + return (0); +} *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Mon Jun 18 20:33:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A281310202F8; Mon, 18 Jun 2018 20:33:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D31171DF8; Mon, 18 Jun 2018 20:33:02 +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 2E04E1279; Mon, 18 Jun 2018 20:33:02 +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 w5IKX2eg064588; Mon, 18 Jun 2018 20:33:02 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IKWri2064522; Mon, 18 Jun 2018 20:32:53 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806182032.w5IKWri2064522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Mon, 18 Jun 2018 20:32:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335339 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 335339 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 20:33:03 -0000 Author: erj Date: Mon Jun 18 20:32:53 2018 New Revision: 335339 URL: https://svnweb.freebsd.org/changeset/base/335339 Log: ixl(4): Update version number to 2.0.0-k And update copyrights to current year. MFC after: 1 month Sponsored by: Intel Corporation Modified: head/sys/dev/ixl/i40e_adminq.c head/sys/dev/ixl/i40e_adminq.h head/sys/dev/ixl/i40e_adminq_cmd.h head/sys/dev/ixl/i40e_alloc.h head/sys/dev/ixl/i40e_common.c head/sys/dev/ixl/i40e_dcb.c head/sys/dev/ixl/i40e_dcb.h head/sys/dev/ixl/i40e_devids.h head/sys/dev/ixl/i40e_hmc.c head/sys/dev/ixl/i40e_hmc.h head/sys/dev/ixl/i40e_lan_hmc.c head/sys/dev/ixl/i40e_lan_hmc.h head/sys/dev/ixl/i40e_nvm.c head/sys/dev/ixl/i40e_osdep.c head/sys/dev/ixl/i40e_osdep.h head/sys/dev/ixl/i40e_prototype.h head/sys/dev/ixl/i40e_register.h head/sys/dev/ixl/i40e_status.h head/sys/dev/ixl/i40e_type.h head/sys/dev/ixl/if_ixl.c head/sys/dev/ixl/if_ixlv.c head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_debug.h head/sys/dev/ixl/ixl_iw.c head/sys/dev/ixl/ixl_iw.h head/sys/dev/ixl/ixl_iw_int.h head/sys/dev/ixl/ixl_pf.h head/sys/dev/ixl/ixl_pf_i2c.c head/sys/dev/ixl/ixl_pf_iov.c head/sys/dev/ixl/ixl_pf_iov.h head/sys/dev/ixl/ixl_pf_main.c head/sys/dev/ixl/ixl_pf_qmgr.c head/sys/dev/ixl/ixl_pf_qmgr.h head/sys/dev/ixl/ixl_txrx.c head/sys/dev/ixl/ixlv.h head/sys/dev/ixl/ixlv_vc_mgr.h head/sys/dev/ixl/ixlvc.c head/sys/dev/ixl/virtchnl.h Modified: head/sys/dev/ixl/i40e_adminq.c ============================================================================== --- head/sys/dev/ixl/i40e_adminq.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_adminq.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_adminq.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_adminq.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_adminq_cmd.h ============================================================================== --- head/sys/dev/ixl/i40e_adminq_cmd.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_adminq_cmd.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_alloc.h ============================================================================== --- head/sys/dev/ixl/i40e_alloc.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_alloc.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_common.c ============================================================================== --- head/sys/dev/ixl/i40e_common.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_common.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_dcb.c ============================================================================== --- head/sys/dev/ixl/i40e_dcb.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_dcb.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_dcb.h ============================================================================== --- head/sys/dev/ixl/i40e_dcb.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_dcb.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_devids.h ============================================================================== --- head/sys/dev/ixl/i40e_devids.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_devids.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_hmc.c ============================================================================== --- head/sys/dev/ixl/i40e_hmc.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_hmc.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_hmc.h ============================================================================== --- head/sys/dev/ixl/i40e_hmc.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_hmc.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_lan_hmc.c ============================================================================== --- head/sys/dev/ixl/i40e_lan_hmc.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_lan_hmc.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_lan_hmc.h ============================================================================== --- head/sys/dev/ixl/i40e_lan_hmc.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_lan_hmc.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_nvm.c ============================================================================== --- head/sys/dev/ixl/i40e_nvm.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_nvm.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_osdep.c ============================================================================== --- head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_osdep.h ============================================================================== --- head/sys/dev/ixl/i40e_osdep.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_osdep.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_prototype.h ============================================================================== --- head/sys/dev/ixl/i40e_prototype.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_prototype.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_register.h ============================================================================== --- head/sys/dev/ixl/i40e_register.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_register.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_status.h ============================================================================== --- head/sys/dev/ixl/i40e_status.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_status.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/i40e_type.h ============================================================================== --- head/sys/dev/ixl/i40e_type.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/i40e_type.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/if_ixl.c ============================================================================== --- head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without @@ -47,14 +47,14 @@ /********************************************************************* * Driver version *********************************************************************/ -#define IXL_DRIVER_VERSION_MAJOR 1 -#define IXL_DRIVER_VERSION_MINOR 9 -#define IXL_DRIVER_VERSION_BUILD 9 +#define IXL_DRIVER_VERSION_MAJOR 2 +#define IXL_DRIVER_VERSION_MINOR 0 +#define IXL_DRIVER_VERSION_BUILD 0 #define IXL_DRIVER_VERSION_STRING \ __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ - __XSTRING(IXL_DRIVER_VERSION_BUILD) "-iflib-k" + __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k" /********************************************************************* * PCI Device ID Table Modified: head/sys/dev/ixl/if_ixlv.c ============================================================================== --- head/sys/dev/ixl/if_ixlv.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/if_ixlv.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_debug.h ============================================================================== --- head/sys/dev/ixl/ixl_debug.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_debug.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2016, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_iw.c ============================================================================== --- head/sys/dev/ixl/ixl_iw.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_iw.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_iw.h ============================================================================== --- head/sys/dev/ixl/ixl_iw.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_iw.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_iw_int.h ============================================================================== --- head/sys/dev/ixl/ixl_iw_int.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_iw_int.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_i2c.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_i2c.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_i2c.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_iov.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_iov.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_iov.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_iov.h ============================================================================== --- head/sys/dev/ixl/ixl_pf_iov.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_iov.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_main.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_main.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_main.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_qmgr.c ============================================================================== --- head/sys/dev/ixl/ixl_pf_qmgr.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_qmgr.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_pf_qmgr.h ============================================================================== --- head/sys/dev/ixl/ixl_pf_qmgr.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_pf_qmgr.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixl_txrx.c ============================================================================== --- head/sys/dev/ixl/ixl_txrx.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixl_txrx.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixlv.h ============================================================================== --- head/sys/dev/ixl/ixlv.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixlv.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixlv_vc_mgr.h ============================================================================== --- head/sys/dev/ixl/ixlv_vc_mgr.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixlv_vc_mgr.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/ixlvc.c ============================================================================== --- head/sys/dev/ixl/ixlvc.c Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/ixlvc.c Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/ixl/virtchnl.h ============================================================================== --- head/sys/dev/ixl/virtchnl.h Mon Jun 18 20:12:54 2018 (r335338) +++ head/sys/dev/ixl/virtchnl.h Mon Jun 18 20:32:53 2018 (r335339) @@ -1,6 +1,6 @@ /****************************************************************************** - Copyright (c) 2013-2017, Intel Corporation + Copyright (c) 2013-2018, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without From owner-svn-src-all@freebsd.org Mon Jun 18 20:42:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B159C1020E45; Mon, 18 Jun 2018 20:42:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 60FB172598; Mon, 18 Jun 2018 20:42:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4394C142A; Mon, 18 Jun 2018 20:42:54 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IKgsT7069437; Mon, 18 Jun 2018 20:42:54 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IKgsGE069436; Mon, 18 Jun 2018 20:42:54 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806182042.w5IKgsGE069436@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Mon, 18 Jun 2018 20:42:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335340 - stable/10/sys/dev/bxe X-SVN-Group: stable-10 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/10/sys/dev/bxe X-SVN-Commit-Revision: 335340 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 20:42:54 -0000 Author: dim Date: Mon Jun 18 20:42:53 2018 New Revision: 335340 URL: https://svnweb.freebsd.org/changeset/base/335340 Log: Follow-up to r335289, which merged r334948 from head, to really fix the bxe build on i386. In the stable/10 branch, the rman functions still use u_long instead of uintmax_t (this was changed in r294883 and r297000), so these have to be printed using the l modifier instead. Pointy hat to: me Noticed by: gjb Modified: stable/10/sys/dev/bxe/bxe.c Modified: stable/10/sys/dev/bxe/bxe.c ============================================================================== --- stable/10/sys/dev/bxe/bxe.c Mon Jun 18 20:32:53 2018 (r335339) +++ stable/10/sys/dev/bxe/bxe.c Mon Jun 18 20:42:53 2018 (r335340) @@ -12851,7 +12851,7 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#jx-%#jx (%jd) -> %#jx\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %#lx-%#lx (%ld) -> %#jx\n", i, PCIR_BAR(i), rman_get_start(sc->bar[i].resource), rman_get_end(sc->bar[i].resource), From owner-svn-src-all@freebsd.org Mon Jun 18 21:18:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6383E1022C2F; Mon, 18 Jun 2018 21:18:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08D9073CA0; Mon, 18 Jun 2018 21:18:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA28418FB; Mon, 18 Jun 2018 21:18:21 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ILILG9085170; Mon, 18 Jun 2018 21:18:21 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ILILHm085167; Mon, 18 Jun 2018 21:18:21 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182118.w5ILILHm085167@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 21:18:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335341 - in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Commit-Revision: 335341 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 21:18:22 -0000 Author: oshogbo Date: Mon Jun 18 21:18:20 2018 New Revision: 335341 URL: https://svnweb.freebsd.org/changeset/base/335341 Log: libnv: change name of cookie from cookiep to cookie. The name was inconsistent with rest of the library. No functional change intended. Pointed out by: pjd@ Modified: head/share/man/man9/cnv.9 head/sys/contrib/libnv/cnvlist.c head/sys/sys/cnv.h Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Mon Jun 18 20:42:53 2018 (r335340) +++ head/share/man/man9/cnv.9 Mon Jun 18 21:18:20 2018 (r335341) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 18, 2018 +.Dd June 18, 2018 .Dt CNV 9 .Os .Sh NAME @@ -38,80 +38,80 @@ .Sh SYNOPSIS .In sys/cnv.h .Ft const char * -.Fn cnvlist_name "void *cookiep" +.Fn cnvlist_name "void *cookie" .Ft int -.Fn cnvlist_type "void *cookiep" +.Fn cnvlist_type "void *cookie" .\" .Ft bool -.Fn cnvlist_get_bool "void *cookiep" +.Fn cnvlist_get_bool "void *cookie" .Ft uint64_t -.Fn cnvlist_get_number "void *cookiep" +.Fn cnvlist_get_number "void *cookie" .Ft "const char *" -.Fn cnvlist_get_string "void *cookiep" +.Fn cnvlist_get_string "void *cookie" .Ft "const nvlist_t *" -.Fn cnvlist_get_nvlist "void *cookiep" +.Fn cnvlist_get_nvlist "void *cookie" .Ft "const void *" -.Fn cnvlist_get_binary "void *cookiep" "size_t *sizep" +.Fn cnvlist_get_binary "void *cookie" "size_t *sizep" .Ft "const bool *" -.Fn cnvlist_get_bool_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp" .Ft "const uint64_t *" -.Fn cnvlist_get_number_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp" .Ft "const char * const *" -.Fn cnvlist_get_string_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp" .Ft "const nvlist_t * const *" -.Fn cnvlist_get_nvlist_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp" .Ft int -.Fn cnvlist_get_descriptor "void *cookiep" +.Fn cnvlist_get_descriptor "void *cookie" .Ft "const int *" -.Fn cnvlist_get_descriptor_array "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp" .\" .Ft bool -.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie" .Ft uint64_t -.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookie" .Ft "const char *" -.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookie" .Ft "const nvlist_t *" -.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookie" .Ft "const void *" -.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookiep" "size_t *sizep" +.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookie" "size_t *sizep" .Ft "const bool *" -.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" .Ft "const uint64_t *" -.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" .Ft "const char * const *" -.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" .Ft "const nvlist_t * const *" -.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" .Ft int -.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookie" .Ft "const int *" -.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookiep" "size_t *nitemsp" +.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" .\" .Ft void -.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookie" .Ft void -.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookiep" +.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookie" .Sh DESCRIPTION The .Nm libnv Modified: head/sys/contrib/libnv/cnvlist.c ============================================================================== --- head/sys/contrib/libnv/cnvlist.c Mon Jun 18 20:42:53 2018 (r335340) +++ head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:18:20 2018 (r335341) @@ -56,29 +56,29 @@ __FBSDID("$FreeBSD$"); #include "nvpair_impl.h" const char * -cnvlist_name(void *cookiep) +cnvlist_name(void *cookie) { - return (nvpair_name(cookiep)); + return (nvpair_name(cookie)); } int -cnvlist_type(void *cookiep) +cnvlist_type(void *cookie) { - return (nvpair_type(cookiep)); + return (nvpair_type(cookie)); } #define CNVLIST_GET(ftype, type, NVTYPE) \ ftype \ -cnvlist_get_##type(void *cookiep) \ +cnvlist_get_##type(void *cookie) \ { \ \ - if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ - nvpair_name(cookiep)); \ + nvpair_name(cookie)); \ } \ - return (nvpair_get_##type(cookiep)); \ + return (nvpair_get_##type(cookie)); \ } CNVLIST_GET(bool, bool, BOOL) @@ -93,14 +93,14 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR) #define CNVLIST_GET_ARRAY(ftype, type, NVTYPE) \ ftype \ -cnvlist_get_##type(void *cookiep, size_t *nitemsp) \ +cnvlist_get_##type(void *cookie, size_t *nitemsp) \ { \ \ - if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ - nvpair_name(cookiep)); \ + nvpair_name(cookie)); \ } \ - return (nvpair_get_##type(cookiep, nitemsp)); \ + return (nvpair_get_##type(cookie, nitemsp)); \ } CNVLIST_GET_ARRAY(const bool *, bool_array, BOOL_ARRAY) @@ -114,27 +114,27 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCR #undef CNVLIST_GET_ARRAY const void * -cnvlist_get_binary(void *cookiep, size_t *sizep) +cnvlist_get_binary(void *cookie, size_t *sizep) { - if (nvpair_type(cookiep) != NV_TYPE_BINARY) - nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep)); - return (nvpair_get_binary(cookiep, sizep)); + if (nvpair_type(cookie) != NV_TYPE_BINARY) + nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookie)); + return (nvpair_get_binary(cookie, sizep)); } #define CNVLIST_TAKE(ftype, type, NVTYPE) \ ftype \ -cnvlist_take_##type(nvlist_t *nvl, void *cookiep) \ +cnvlist_take_##type(nvlist_t *nvl, void *cookie) \ { \ ftype value; \ \ - if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ - nvpair_name(cookiep)); \ + nvpair_name(cookie)); \ } \ - value = (ftype)(intptr_t)nvpair_get_##type(cookiep); \ - nvlist_remove_nvpair(nvl, cookiep); \ - nvpair_free_structure(cookiep); \ + value = (ftype)(intptr_t)nvpair_get_##type(cookie); \ + nvlist_remove_nvpair(nvl, cookie); \ + nvpair_free_structure(cookie); \ return (value); \ } @@ -150,17 +150,17 @@ CNVLIST_TAKE(int, descriptor, DESCRIPTOR) #define CNVLIST_TAKE_ARRAY(ftype, type, NVTYPE) \ ftype \ -cnvlist_take_##type(nvlist_t *nvl, void *cookiep, size_t *nitemsp) \ +cnvlist_take_##type(nvlist_t *nvl, void *cookie, size_t *nitemsp) \ { \ ftype value; \ \ - if (nvpair_type(cookiep) != NV_TYPE_##NVTYPE) { \ + if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ - nvpair_name(cookiep)); \ + nvpair_name(cookie)); \ } \ - value = (ftype)(intptr_t)nvpair_get_##type(cookiep, nitemsp); \ - nvlist_remove_nvpair(nvl, cookiep); \ - nvpair_free_structure(cookiep); \ + value = (ftype)(intptr_t)nvpair_get_##type(cookie, nitemsp); \ + nvlist_remove_nvpair(nvl, cookie); \ + nvpair_free_structure(cookie); \ return (value); \ } @@ -175,25 +175,25 @@ CNVLIST_TAKE_ARRAY(int *, descriptor_array, DESCRIPTOR #undef CNVLIST_TAKE_ARRAY void * -cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep) +cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep) { void *value; - if (nvpair_type(cookiep) != NV_TYPE_BINARY) - nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookiep)); - value = (void *)(intptr_t)nvpair_get_binary(cookiep, sizep); - nvlist_remove_nvpair(nvl, cookiep); - nvpair_free_structure(cookiep); + if (nvpair_type(cookie) != NV_TYPE_BINARY) + nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookie)); + value = (void *)(intptr_t)nvpair_get_binary(cookie, sizep); + nvlist_remove_nvpair(nvl, cookie); + nvpair_free_structure(cookie); return (value); } #define CNVLIST_FREE(type) \ void \ -cnvlist_free_##type(nvlist_t *nvl, void *cookiep) \ +cnvlist_free_##type(nvlist_t *nvl, void *cookie) \ { \ \ - nvlist_free_nvpair(nvl, cookiep); \ + nvlist_free_nvpair(nvl, cookie); \ } CNVLIST_FREE(bool) Modified: head/sys/sys/cnv.h ============================================================================== --- head/sys/sys/cnv.h Mon Jun 18 20:42:53 2018 (r335340) +++ head/sys/sys/cnv.h Mon Jun 18 21:18:20 2018 (r335341) @@ -52,8 +52,8 @@ __BEGIN_DECLS /* * Functions which returns information about the given cookie. */ -const char *cnvlist_name(void *cookiep); -int cnvlist_type(void *cookiep); +const char *cnvlist_name(void *cookie); +int cnvlist_type(void *cookie); /* * The cnvlist_get functions returns value associated with the given cookie. @@ -61,18 +61,18 @@ int cnvlist_type(void *cookiep); * not be freed by the caller. */ -bool cnvlist_get_bool(void *cookiep); -uint64_t cnvlist_get_number(void *cookiep); -const char *cnvlist_get_string(void *cookiep); -const nvlist_t *cnvlist_get_nvlist(void *cookiep); -const void *cnvlist_get_binary(void *cookiep, size_t *sizep); -const bool *cnvlist_get_bool_array(void *cookiep, size_t *nitemsp); -const uint64_t *cnvlist_get_number_array(void *cookiep, size_t *nitemsp); -const char * const *cnvlist_get_string_array(void *cookiep, size_t *nitemsp); -const nvlist_t * const *cnvlist_get_nvlist_array(void *cookiep, size_t *nitemsp); +bool cnvlist_get_bool(void *cookie); +uint64_t cnvlist_get_number(void *cookie); +const char *cnvlist_get_string(void *cookie); +const nvlist_t *cnvlist_get_nvlist(void *cookie); +const void *cnvlist_get_binary(void *cookie, size_t *sizep); +const bool *cnvlist_get_bool_array(void *cookie, size_t *nitemsp); +const uint64_t *cnvlist_get_number_array(void *cookie, size_t *nitemsp); +const char * const *cnvlist_get_string_array(void *cookie, size_t *nitemsp); +const nvlist_t * const *cnvlist_get_nvlist_array(void *cookie, size_t *nitemsp); #ifndef _KERNEL -int cnvlist_get_descriptor(void *cookiep); -const int *cnvlist_get_descriptor_array(void *cookiep, size_t *nitemsp); +int cnvlist_get_descriptor(void *cookie); +const int *cnvlist_get_descriptor_array(void *cookie, size_t *nitemsp); #endif @@ -82,18 +82,18 @@ const int *cnvlist_get_descriptor_array(void *cookiep * The caller is responsible for freeing received data. */ -bool cnvlist_take_bool(nvlist_t *nvl, void *cookiep); -uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookiep); -char *cnvlist_take_string(nvlist_t *nvl, void *cookiep); -nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookiep); -void *cnvlist_take_binary(nvlist_t *nvl, void *cookiep, size_t *sizep); -bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); -uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); -char **cnvlist_take_string_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); -nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +bool cnvlist_take_bool(nvlist_t *nvl, void *cookie); +uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookie); +char *cnvlist_take_string(nvlist_t *nvl, void *cookie); +nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookie); +void *cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep); +bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); +uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); +char **cnvlist_take_string_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); +nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); #ifndef _KERNEL -int cnvlist_take_descriptor(nvlist_t *nvl, void *cookiep); -int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookiep, size_t *nitemsp); +int cnvlist_take_descriptor(nvlist_t *nvl, void *cookie); +int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); #endif /* @@ -101,18 +101,18 @@ int *cnvlist_take_descriptor_array(nvlist_t *nvl, v * and frees memory associated with it. */ -void cnvlist_free_bool(nvlist_t *nvl, void *cookiep); -void cnvlist_free_number(nvlist_t *nvl, void *cookiep); -void cnvlist_free_string(nvlist_t *nvl, void *cookiep); -void cnvlist_free_nvlist(nvlist_t *nvl, void *cookiep); -void cnvlist_free_binary(nvlist_t *nvl, void *cookiep); -void cnvlist_free_bool_array(nvlist_t *nvl, void *cookiep); -void cnvlist_free_number_array(nvlist_t *nvl, void *cookiep); -void cnvlist_free_string_array(nvlist_t *nvl, void *cookiep); -void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookiep); +void cnvlist_free_bool(nvlist_t *nvl, void *cookie); +void cnvlist_free_number(nvlist_t *nvl, void *cookie); +void cnvlist_free_string(nvlist_t *nvl, void *cookie); +void cnvlist_free_nvlist(nvlist_t *nvl, void *cookie); +void cnvlist_free_binary(nvlist_t *nvl, void *cookie); +void cnvlist_free_bool_array(nvlist_t *nvl, void *cookie); +void cnvlist_free_number_array(nvlist_t *nvl, void *cookie); +void cnvlist_free_string_array(nvlist_t *nvl, void *cookie); +void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookie); #ifndef _KERNEL -void cnvlist_free_descriptor(nvlist_t *nvl, void *cookiep); -void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookiep); +void cnvlist_free_descriptor(nvlist_t *nvl, void *cookie); +void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookie); #endif __END_DECLS From owner-svn-src-all@freebsd.org Mon Jun 18 21:23:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0802C102317F; Mon, 18 Jun 2018 21:23:42 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B174B74218; Mon, 18 Jun 2018 21:23:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9281A1AB1; Mon, 18 Jun 2018 21:23:41 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ILNfmA090051; Mon, 18 Jun 2018 21:23:41 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ILNflk090049; Mon, 18 Jun 2018 21:23:41 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182123.w5ILNflk090049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 21:23:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335342 - in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: share/man/man9 sys/contrib/libnv sys/sys X-SVN-Commit-Revision: 335342 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 21:23:42 -0000 Author: oshogbo Date: Mon Jun 18 21:23:40 2018 New Revision: 335342 URL: https://svnweb.freebsd.org/changeset/base/335342 Log: libnv: add const to cookies arguments Pointed out by: pjd@ Modified: head/share/man/man9/cnv.9 head/sys/contrib/libnv/cnvlist.c head/sys/sys/cnv.h Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Mon Jun 18 21:18:20 2018 (r335341) +++ head/share/man/man9/cnv.9 Mon Jun 18 21:23:40 2018 (r335342) @@ -38,32 +38,32 @@ .Sh SYNOPSIS .In sys/cnv.h .Ft const char * -.Fn cnvlist_name "void *cookie" +.Fn cnvlist_name "const void *cookie" .Ft int -.Fn cnvlist_type "void *cookie" +.Fn cnvlist_type "const void *cookie" .\" .Ft bool -.Fn cnvlist_get_bool "void *cookie" +.Fn cnvlist_get_bool "const void *cookie" .Ft uint64_t -.Fn cnvlist_get_number "void *cookie" +.Fn cnvlist_get_number "const void *cookie" .Ft "const char *" -.Fn cnvlist_get_string "void *cookie" +.Fn cnvlist_get_string "const void *cookie" .Ft "const nvlist_t *" -.Fn cnvlist_get_nvlist "void *cookie" +.Fn cnvlist_get_nvlist "const void *cookie" .Ft "const void *" -.Fn cnvlist_get_binary "void *cookie" "size_t *sizep" +.Fn cnvlist_get_binary "const void *cookie" "size_t *sizep" .Ft "const bool *" -.Fn cnvlist_get_bool_array "void *cookie" "size_t *nitemsp" +.Fn cnvlist_get_bool_array "const void *cookie" "size_t *nitemsp" .Ft "const uint64_t *" -.Fn cnvlist_get_number_array "void *cookie" "size_t *nitemsp" +.Fn cnvlist_get_number_array "const void *cookie" "size_t *nitemsp" .Ft "const char * const *" -.Fn cnvlist_get_string_array "void *cookie" "size_t *nitemsp" +.Fn cnvlist_get_string_array "const void *cookie" "size_t *nitemsp" .Ft "const nvlist_t * const *" -.Fn cnvlist_get_nvlist_array "void *cookie" "size_t *nitemsp" +.Fn cnvlist_get_nvlist_array "const void *cookie" "size_t *nitemsp" .Ft int -.Fn cnvlist_get_descriptor "void *cookie" +.Fn cnvlist_get_descriptor "const void *cookie" .Ft "const int *" -.Fn cnvlist_get_descriptor_array "void *cookie" "size_t *nitemsp" +.Fn cnvlist_get_descriptor_array "const void *cookie" "size_t *nitemsp" .\" .Ft bool .Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie" Modified: head/sys/contrib/libnv/cnvlist.c ============================================================================== --- head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:18:20 2018 (r335341) +++ head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:23:40 2018 (r335342) @@ -56,14 +56,14 @@ __FBSDID("$FreeBSD$"); #include "nvpair_impl.h" const char * -cnvlist_name(void *cookie) +cnvlist_name(const void *cookie) { return (nvpair_name(cookie)); } int -cnvlist_type(void *cookie) +cnvlist_type(const void *cookie) { return (nvpair_type(cookie)); @@ -71,7 +71,7 @@ cnvlist_type(void *cookie) #define CNVLIST_GET(ftype, type, NVTYPE) \ ftype \ -cnvlist_get_##type(void *cookie) \ +cnvlist_get_##type(const void *cookie) \ { \ \ if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ @@ -93,7 +93,7 @@ CNVLIST_GET(int, descriptor, DESCRIPTOR) #define CNVLIST_GET_ARRAY(ftype, type, NVTYPE) \ ftype \ -cnvlist_get_##type(void *cookie, size_t *nitemsp) \ +cnvlist_get_##type(const void *cookie, size_t *nitemsp) \ { \ \ if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ @@ -114,7 +114,7 @@ CNVLIST_GET_ARRAY(const int *, descriptor_array, DESCR #undef CNVLIST_GET_ARRAY const void * -cnvlist_get_binary(void *cookie, size_t *sizep) +cnvlist_get_binary(const void *cookie, size_t *sizep) { if (nvpair_type(cookie) != NV_TYPE_BINARY) Modified: head/sys/sys/cnv.h ============================================================================== --- head/sys/sys/cnv.h Mon Jun 18 21:18:20 2018 (r335341) +++ head/sys/sys/cnv.h Mon Jun 18 21:23:40 2018 (r335342) @@ -52,8 +52,8 @@ __BEGIN_DECLS /* * Functions which returns information about the given cookie. */ -const char *cnvlist_name(void *cookie); -int cnvlist_type(void *cookie); +const char *cnvlist_name(const void *cookie); +int cnvlist_type(const void *cookie); /* * The cnvlist_get functions returns value associated with the given cookie. @@ -61,18 +61,18 @@ int cnvlist_type(void *cookie); * not be freed by the caller. */ -bool cnvlist_get_bool(void *cookie); -uint64_t cnvlist_get_number(void *cookie); -const char *cnvlist_get_string(void *cookie); -const nvlist_t *cnvlist_get_nvlist(void *cookie); -const void *cnvlist_get_binary(void *cookie, size_t *sizep); -const bool *cnvlist_get_bool_array(void *cookie, size_t *nitemsp); -const uint64_t *cnvlist_get_number_array(void *cookie, size_t *nitemsp); -const char * const *cnvlist_get_string_array(void *cookie, size_t *nitemsp); -const nvlist_t * const *cnvlist_get_nvlist_array(void *cookie, size_t *nitemsp); +bool cnvlist_get_bool(const void *cookie); +uint64_t cnvlist_get_number(const void *cookie); +const char *cnvlist_get_string(const void *cookie); +const nvlist_t *cnvlist_get_nvlist(const void *cookie); +const void *cnvlist_get_binary(const void *cookie, size_t *sizep); +const bool *cnvlist_get_bool_array(const void *cookie, size_t *nitemsp); +const uint64_t *cnvlist_get_number_array(const void *cookie, size_t *nitemsp); +const char * const *cnvlist_get_string_array(const void *cookie, size_t *nitemsp); +const nvlist_t * const *cnvlist_get_nvlist_array(const void *cookie, size_t *nitemsp); #ifndef _KERNEL -int cnvlist_get_descriptor(void *cookie); -const int *cnvlist_get_descriptor_array(void *cookie, size_t *nitemsp); +int cnvlist_get_descriptor(const void *cookie); +const int *cnvlist_get_descriptor_array(const void *cookie, size_t *nitemsp); #endif From owner-svn-src-all@freebsd.org Mon Jun 18 21:27:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 059E71023443; Mon, 18 Jun 2018 21:27:00 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC02774540; Mon, 18 Jun 2018 21:26:59 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 74AE41AC5; Mon, 18 Jun 2018 21:26:59 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5ILQx4L090376; Mon, 18 Jun 2018 21:26:59 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5ILQwCZ090372; Mon, 18 Jun 2018 21:26:58 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182126.w5ILQwCZ090372@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 21:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335343 - in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys X-SVN-Commit-Revision: 335343 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 21:27:00 -0000 Author: oshogbo Date: Mon Jun 18 21:26:58 2018 New Revision: 335343 URL: https://svnweb.freebsd.org/changeset/base/335343 Log: libnv: Remove nvlist argument from cnvlist_{take,free}_* functions. All information which are need for those operations is already stored in the cookie. We decided not to bump libnv version because this API is not used yet in the base system. Reviewed by: pjd Modified: head/lib/libnv/tests/cnv_tests.cc head/share/man/man9/cnv.9 head/sys/contrib/libnv/cnvlist.c head/sys/sys/cnv.h Modified: head/lib/libnv/tests/cnv_tests.cc ============================================================================== --- head/lib/libnv/tests/cnv_tests.cc Mon Jun 18 21:23:40 2018 (r335342) +++ head/lib/libnv/tests/cnv_tests.cc Mon Jun 18 21:26:58 2018 (r335343) @@ -575,7 +575,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_bool) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - ATF_REQUIRE_EQ(cnvlist_take_bool(nvl, cookie), value); + ATF_REQUIRE_EQ(cnvlist_take_bool(cookie), value); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -618,7 +618,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_number) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - ATF_REQUIRE_EQ(cnvlist_take_number(nvl, cookie), value); + ATF_REQUIRE_EQ(cnvlist_take_number(cookie), value); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -662,7 +662,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_string) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - out_string = cnvlist_take_string(nvl, cookie); + out_string = cnvlist_take_string(cookie); ATF_REQUIRE(out_string != NULL); ATF_REQUIRE_EQ(strcmp(out_string, value), 0); @@ -725,7 +725,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_nvlist) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - result = cnvlist_take_nvlist(nvl, cookie); + result = cnvlist_take_nvlist(cookie); ATF_REQUIRE(!nvlist_exists_nvlist(nvl, key)); ATF_REQUIRE(result == value); @@ -784,7 +784,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_bool_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - out_array = cnvlist_take_bool_array(nvl, cookie, &nitems); + out_array = cnvlist_take_bool_array(cookie, &nitems); ATF_REQUIRE_EQ(nitems, 16); ATF_REQUIRE(out_array != NULL); for (i = 0; i < 16; i++) @@ -836,7 +836,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_number_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - out_array = cnvlist_take_number_array(nvl, cookie, &nitems); + out_array = cnvlist_take_number_array(cookie, &nitems); ATF_REQUIRE(out_array != NULL); ATF_REQUIRE_EQ(nitems, 16); @@ -885,7 +885,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_string_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - out_array = cnvlist_take_string_array(nvl, cookie, &nitems); + out_array = cnvlist_take_string_array(cookie, &nitems); ATF_REQUIRE_EQ(nitems, 4); for (i = 0; i < 4; i++) { ATF_REQUIRE(out_array[i] != NULL); @@ -957,7 +957,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_nvlist_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - result = cnvlist_take_nvlist_array(nvl, cookie, &num_items); + result = cnvlist_take_nvlist_array(cookie, &num_items); ATF_REQUIRE(result != NULL); ATF_REQUIRE_EQ(num_items, 8); @@ -1022,7 +1022,7 @@ ATF_TEST_CASE_BODY(cnvlist_take_binary) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - out_binary = cnvlist_take_binary(nvl, cookie, &out_size); + out_binary = cnvlist_take_binary(cookie, &out_size); ATF_REQUIRE_EQ(out_size, in_size); ATF_REQUIRE_EQ(memcmp(in_binary, out_binary, out_size), 0); @@ -1069,7 +1069,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_bool) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_bool(nvl, cookie); + cnvlist_free_bool(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1112,7 +1112,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_number) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_number(nvl, cookie); + cnvlist_free_number(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1155,7 +1155,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_string) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_string(nvl, cookie); + cnvlist_free_string(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1215,7 +1215,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_nvlist) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_nvlist(nvl, cookie); + cnvlist_free_nvlist(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1262,7 +1262,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_binary) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_binary(nvl, cookie); + cnvlist_free_binary(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1309,7 +1309,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_bool_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_bool_array(nvl, cookie); + cnvlist_free_bool_array(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1354,7 +1354,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_number_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_number_array(nvl, cookie); + cnvlist_free_number_array(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1396,7 +1396,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_string_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_string_array(nvl, cookie); + cnvlist_free_string_array(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); @@ -1459,7 +1459,7 @@ ATF_TEST_CASE_BODY(cnvlist_free_nvlist_array) cookie = NULL; ATF_REQUIRE_EQ(strcmp(key, nvlist_next(nvl, &type, &cookie)), 0); - cnvlist_free_nvlist_array(nvl, cookie); + cnvlist_free_nvlist_array(cookie); cookie = NULL; ATF_REQUIRE_EQ(nvlist_error(nvl), 0); Modified: head/share/man/man9/cnv.9 ============================================================================== --- head/share/man/man9/cnv.9 Mon Jun 18 21:23:40 2018 (r335342) +++ head/share/man/man9/cnv.9 Mon Jun 18 21:26:58 2018 (r335343) @@ -66,52 +66,52 @@ .Fn cnvlist_get_descriptor_array "const void *cookie" "size_t *nitemsp" .\" .Ft bool -.Fn cnvlist_take_bool "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_take_bool "void *cookie" .Ft uint64_t -.Fn cnvlist_take_number "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_take_number "void *cookie" .Ft "const char *" -.Fn cnvlist_take_string "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_take_string "void *cookie" .Ft "const nvlist_t *" -.Fn cnvlist_take_nvlist "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_take_nvlist "void *cookie" .Ft "const void *" -.Fn cnvlist_take_binary "nvlist_t *nvl" "void *cookie" "size_t *sizep" +.Fn cnvlist_take_binary "void *cookie" "size_t *sizep" .Ft "const bool *" -.Fn cnvlist_take_bool_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" +.Fn cnvlist_take_bool_array "void *cookie" "size_t *nitemsp" .Ft "const uint64_t *" -.Fn cnvlist_take_number_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" +.Fn cnvlist_take_number_array "void *cookie" "size_t *nitemsp" .Ft "const char * const *" -.Fn cnvlist_take_string_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" +.Fn cnvlist_take_string_array "void *cookie" "size_t *nitemsp" .Ft "const nvlist_t * const *" -.Fn cnvlist_take_nvlist_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" +.Fn cnvlist_take_nvlist_array "void *cookie" "size_t *nitemsp" .Ft int -.Fn cnvlist_take_descriptor "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_take_descriptor "void *cookie" .Ft "const int *" -.Fn cnvlist_take_descriptor_array "nvlist_t *nvl" "void *cookie" "size_t *nitemsp" +.Fn cnvlist_take_descriptor_array "void *cookie" "size_t *nitemsp" .\" .Ft void -.Fn cnvlist_free_null "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_null "void *cookie" .Ft void -.Fn cnvlist_free_bool "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_bool "void *cookie" .Ft void -.Fn cnvlist_free_number "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_number "void *cookie" .Ft void -.Fn cnvlist_free_string "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_string "void *cookie" .Ft void -.Fn cnvlist_free_nvlist "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_nvlist "void *cookie" .Ft void -.Fn cnvlist_free_descriptor "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_descriptor "void *cookie" .Ft void -.Fn cnvlist_free_binary "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_binary "void *cookie" .Ft void -.Fn cnvlist_free_bool_array "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_bool_array "void *cookie" .Ft void -.Fn cnvlist_free_number_array "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_number_array "void *cookie" .Ft void -.Fn cnvlist_free_string_array "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_string_array "void *cookie" .Ft void -.Fn cnvlist_free_nvlist_array "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_nvlist_array "void *cookie" .Ft void -.Fn cnvlist_free_descriptor_array "nvlist_t *nvl" "void *cookie" +.Fn cnvlist_free_descriptor_array "void *cookie" .Sh DESCRIPTION The .Nm libnv @@ -192,8 +192,8 @@ while (nvlist_next(nvl, &type, &cookie) != NULL) { } } -name = cnvlist_take_string(nvl, scookie); -cnvlist_free_bool(nvl, bcookie); +name = cnvlist_take_string(scookie); +cnvlist_free_bool(bcookie); printf("test2: %s\\n", name); free(name); Modified: head/sys/contrib/libnv/cnvlist.c ============================================================================== --- head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:23:40 2018 (r335342) +++ head/sys/contrib/libnv/cnvlist.c Mon Jun 18 21:26:58 2018 (r335343) @@ -124,14 +124,16 @@ cnvlist_get_binary(const void *cookie, size_t *sizep) #define CNVLIST_TAKE(ftype, type, NVTYPE) \ ftype \ -cnvlist_take_##type(nvlist_t *nvl, void *cookie) \ +cnvlist_take_##type(void *cookie) \ { \ ftype value; \ + nvlist_t *nvl; \ \ if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookie)); \ } \ + nvl = nvpair_nvlist(cookie); \ value = (ftype)(intptr_t)nvpair_get_##type(cookie); \ nvlist_remove_nvpair(nvl, cookie); \ nvpair_free_structure(cookie); \ @@ -150,14 +152,16 @@ CNVLIST_TAKE(int, descriptor, DESCRIPTOR) #define CNVLIST_TAKE_ARRAY(ftype, type, NVTYPE) \ ftype \ -cnvlist_take_##type(nvlist_t *nvl, void *cookie, size_t *nitemsp) \ +cnvlist_take_##type(void *cookie, size_t *nitemsp) \ { \ ftype value; \ + nvlist_t *nvl; \ \ if (nvpair_type(cookie) != NV_TYPE_##NVTYPE) { \ nvlist_report_missing(NV_TYPE_##NVTYPE, \ nvpair_name(cookie)); \ } \ + nvl = nvpair_nvlist(cookie); \ value = (ftype)(intptr_t)nvpair_get_##type(cookie, nitemsp); \ nvlist_remove_nvpair(nvl, cookie); \ nvpair_free_structure(cookie); \ @@ -175,12 +179,14 @@ CNVLIST_TAKE_ARRAY(int *, descriptor_array, DESCRIPTOR #undef CNVLIST_TAKE_ARRAY void * -cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep) +cnvlist_take_binary(void *cookie, size_t *sizep) { void *value; + nvlist_t *nvl; if (nvpair_type(cookie) != NV_TYPE_BINARY) nvlist_report_missing(NV_TYPE_BINARY, nvpair_name(cookie)); + nvl = nvpair_nvlist(cookie); value = (void *)(intptr_t)nvpair_get_binary(cookie, sizep); nvlist_remove_nvpair(nvl, cookie); nvpair_free_structure(cookie); @@ -190,10 +196,10 @@ cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_ #define CNVLIST_FREE(type) \ void \ -cnvlist_free_##type(nvlist_t *nvl, void *cookie) \ +cnvlist_free_##type(void *cookie) \ { \ \ - nvlist_free_nvpair(nvl, cookie); \ + nvlist_free_nvpair(nvpair_nvlist(cookie), cookie); \ } CNVLIST_FREE(bool) Modified: head/sys/sys/cnv.h ============================================================================== --- head/sys/sys/cnv.h Mon Jun 18 21:23:40 2018 (r335342) +++ head/sys/sys/cnv.h Mon Jun 18 21:26:58 2018 (r335343) @@ -82,18 +82,18 @@ const int *cnvlist_get_descriptor_array(const void *c * The caller is responsible for freeing received data. */ -bool cnvlist_take_bool(nvlist_t *nvl, void *cookie); -uint64_t cnvlist_take_number(nvlist_t *nvl, void *cookie); -char *cnvlist_take_string(nvlist_t *nvl, void *cookie); -nvlist_t *cnvlist_take_nvlist(nvlist_t *nvl, void *cookie); -void *cnvlist_take_binary(nvlist_t *nvl, void *cookie, size_t *sizep); -bool *cnvlist_take_bool_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); -uint64_t *cnvlist_take_number_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); -char **cnvlist_take_string_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); -nvlist_t **cnvlist_take_nvlist_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); +bool cnvlist_take_bool(void *cookie); +uint64_t cnvlist_take_number(void *cookie); +char *cnvlist_take_string(void *cookie); +nvlist_t *cnvlist_take_nvlist(void *cookie); +void *cnvlist_take_binary(void *cookie, size_t *sizep); +bool *cnvlist_take_bool_array(void *cookie, size_t *nitemsp); +uint64_t *cnvlist_take_number_array(void *cookie, size_t *nitemsp); +char **cnvlist_take_string_array(void *cookie, size_t *nitemsp); +nvlist_t **cnvlist_take_nvlist_array(void *cookie, size_t *nitemsp); #ifndef _KERNEL -int cnvlist_take_descriptor(nvlist_t *nvl, void *cookie); -int *cnvlist_take_descriptor_array(nvlist_t *nvl, void *cookie, size_t *nitemsp); +int cnvlist_take_descriptor(void *cookie); +int *cnvlist_take_descriptor_array(void *cookie, size_t *nitemsp); #endif /* @@ -101,18 +101,18 @@ int *cnvlist_take_descriptor_array(nvlist_t *nvl, v * and frees memory associated with it. */ -void cnvlist_free_bool(nvlist_t *nvl, void *cookie); -void cnvlist_free_number(nvlist_t *nvl, void *cookie); -void cnvlist_free_string(nvlist_t *nvl, void *cookie); -void cnvlist_free_nvlist(nvlist_t *nvl, void *cookie); -void cnvlist_free_binary(nvlist_t *nvl, void *cookie); -void cnvlist_free_bool_array(nvlist_t *nvl, void *cookie); -void cnvlist_free_number_array(nvlist_t *nvl, void *cookie); -void cnvlist_free_string_array(nvlist_t *nvl, void *cookie); -void cnvlist_free_nvlist_array(nvlist_t *nvl, void *cookie); +void cnvlist_free_bool(void *cookie); +void cnvlist_free_number(void *cookie); +void cnvlist_free_string(void *cookie); +void cnvlist_free_nvlist(void *cookie); +void cnvlist_free_binary(void *cookie); +void cnvlist_free_bool_array(void *cookie); +void cnvlist_free_number_array(void *cookie); +void cnvlist_free_string_array(void *cookie); +void cnvlist_free_nvlist_array(void *cookie); #ifndef _KERNEL -void cnvlist_free_descriptor(nvlist_t *nvl, void *cookie); -void cnvlist_free_descriptor_array(nvlist_t *nvl, void *cookie); +void cnvlist_free_descriptor(void *cookie); +void cnvlist_free_descriptor_array(void *cookie); #endif __END_DECLS From owner-svn-src-all@freebsd.org Mon Jun 18 22:21:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8DBA1001554; Mon, 18 Jun 2018 22:21:29 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 721917684B; Mon, 18 Jun 2018 22:21:29 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5337224B6; Mon, 18 Jun 2018 22:21:29 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IMLT1L019340; Mon, 18 Jun 2018 22:21:29 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IMLTsa019339; Mon, 18 Jun 2018 22:21:29 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182221.w5IMLTsa019339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 22:21:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335344 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 335344 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 22:21:30 -0000 Author: oshogbo Date: Mon Jun 18 22:21:28 2018 New Revision: 335344 URL: https://svnweb.freebsd.org/changeset/base/335344 Log: libnv: clean parent in nvlist_array when removing it. When we are removing element form the nvlist we should also clean parent, because the array is not a part of the nvlist anymore. Submitted by: Mindaugas Rasiukevicius Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Mon Jun 18 21:26:58 2018 (r335343) +++ head/sys/contrib/libnv/nvpair.c Mon Jun 18 22:21:28 2018 (r335344) @@ -206,8 +206,10 @@ nvpair_remove_nvlist_array(nvpair_t *nvp) /* XXX: DECONST is bad, mkay? */ nvlarray = __DECONST(nvlist_t **, nvpair_get_nvlist_array(nvp, &count)); - for (i = 0; i < count; i++) + for (i = 0; i < count; i++) { nvlist_set_array_next(nvlarray[i], NULL); + nvlist_set_parent(nvlarray[i], NULL); + } } void From owner-svn-src-all@freebsd.org Mon Jun 18 22:22:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3AEE91001612; Mon, 18 Jun 2018 22:22:07 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E53C376B0E; Mon, 18 Jun 2018 22:22:06 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C7E7224ED; Mon, 18 Jun 2018 22:22:06 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IMM6NB020122; Mon, 18 Jun 2018 22:22:06 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IMM6h5020121; Mon, 18 Jun 2018 22:22:06 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182222.w5IMM6h5020121@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 22:22:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335345 - head/lib/libnv/tests X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libnv/tests X-SVN-Commit-Revision: 335345 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 22:22:07 -0000 Author: oshogbo Date: Mon Jun 18 22:22:06 2018 New Revision: 335345 URL: https://svnweb.freebsd.org/changeset/base/335345 Log: libnv: add regression test for r335344. Modified: head/lib/libnv/tests/nv_array_tests.cc Modified: head/lib/libnv/tests/nv_array_tests.cc ============================================================================== --- head/lib/libnv/tests/nv_array_tests.cc Mon Jun 18 22:21:28 2018 (r335344) +++ head/lib/libnv/tests/nv_array_tests.cc Mon Jun 18 22:22:06 2018 (r335345) @@ -312,6 +312,7 @@ ATF_TEST_CASE_BODY(nvlist_nvlist_array__basic) for (i = 0; i < num_items; i++) { ATF_REQUIRE_EQ(nvlist_error(result[i]), 0); ATF_REQUIRE(nvlist_get_array_next(result[i]) == NULL); + ATF_REQUIRE(nvlist_get_parent(result[i], NULL) == NULL); ATF_REQUIRE(nvlist_get_array_next(const_result[i]) == NULL); ATF_REQUIRE(!nvlist_in_array(const_result[i])); } From owner-svn-src-all@freebsd.org Mon Jun 18 22:27:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1497A1001AF0; Mon, 18 Jun 2018 22:27:30 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B665476DEF; Mon, 18 Jun 2018 22:27:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 97A062515; Mon, 18 Jun 2018 22:27:29 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IMRT4O021078; Mon, 18 Jun 2018 22:27:29 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IMRT1k021077; Mon, 18 Jun 2018 22:27:29 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806182227.w5IMRT1k021077@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Mon, 18 Jun 2018 22:27:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335346 - head/sys/modules X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/modules X-SVN-Commit-Revision: 335346 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 22:27:30 -0000 Author: mmacy Date: Mon Jun 18 22:27:29 2018 New Revision: 335346 URL: https://svnweb.freebsd.org/changeset/base/335346 Log: remove epoch_test from default build Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jun 18 22:22:06 2018 (r335345) +++ head/sys/modules/Makefile Mon Jun 18 22:27:29 2018 (r335346) @@ -121,7 +121,6 @@ SUBDIR= \ ${_ena} \ ${_ep} \ ${_epic} \ - epoch_test \ esp \ ${_et} \ evdev \ From owner-svn-src-all@freebsd.org Mon Jun 18 22:57:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 908F41003D3B; Mon, 18 Jun 2018 22:57:34 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 41E4F7856A; Mon, 18 Jun 2018 22:57:34 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 045BC29D9; Mon, 18 Jun 2018 22:57:34 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IMvX97036486; Mon, 18 Jun 2018 22:57:33 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IMvWH7036479; Mon, 18 Jun 2018 22:57:32 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182257.w5IMvWH7036479@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 22:57:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335347 - in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: lib/libnv/tests share/man/man9 sys/contrib/libnv sys/sys X-SVN-Commit-Revision: 335347 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 22:57:34 -0000 Author: oshogbo Date: Mon Jun 18 22:57:32 2018 New Revision: 335347 URL: https://svnweb.freebsd.org/changeset/base/335347 Log: libnv: Add nvlist_append_*_array() family of functions. The nvlist_append_{bool,number,string,nvlist,descriptor}_array() functions allows to dynamically extend array stored in the nvlist. Submitted by: Mindaugas Rasiukevicius Added: head/lib/libnv/tests/nvlist_append_test.c (contents, props changed) Modified: head/lib/libnv/tests/Makefile head/share/man/man9/nv.9 head/sys/contrib/libnv/nv_impl.h head/sys/contrib/libnv/nvlist.c head/sys/contrib/libnv/nvpair.c head/sys/sys/nv.h Modified: head/lib/libnv/tests/Makefile ============================================================================== --- head/lib/libnv/tests/Makefile Mon Jun 18 22:27:29 2018 (r335346) +++ head/lib/libnv/tests/Makefile Mon Jun 18 22:57:32 2018 (r335347) @@ -7,6 +7,7 @@ ATF_TESTS_CXX= \ nv_tests \ TAP_TESTS_C+= nvlist_add_test +TAP_TESTS_C+= nvlist_append_test TAP_TESTS_C+= nvlist_exists_test TAP_TESTS_C+= nvlist_free_test TAP_TESTS_C+= nvlist_get_test Added: head/lib/libnv/tests/nvlist_append_test.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libnv/tests/nvlist_append_test.c Mon Jun 18 22:57:32 2018 (r335347) @@ -0,0 +1,120 @@ +/*- + * Copyright (c) 2018 The NetBSD Foundation, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. 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 FOUNDATION OR CONTRIBUTORS + * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include +#include +#include +#include + +static int ntest = 1; + +#define CHECK(expr) do { \ + if ((expr)) \ + printf("ok # %d %s:%u\n", ntest, __FILE__, __LINE__); \ + else \ + printf("not ok # %d %s:%u\n", ntest, __FILE__, __LINE__);\ + ntest++; \ +} while (0) + +int +main(void) +{ + const bool *bool_result; + const char * const *string_result; + const nvlist_t * const *nvl_result; + nvlist_t *nvl, *nvl1, *nvl2, **items; + unsigned int i; + size_t nitems; + + printf("1..32\n"); + + nvl = nvlist_create(0); + + for (i = 0; i < 16; i++) + nvlist_append_bool_array(nvl, "nvl/bool", i % 2 == 0); + + CHECK(nvlist_error(nvl) == 0); + CHECK(!nvlist_empty(nvl)); + CHECK(nvlist_exists_bool_array(nvl, "nvl/bool")); + + bool_result = nvlist_get_bool_array(nvl, "nvl/bool", &nitems); + CHECK(nitems == 16); + CHECK(bool_result != NULL); + for (i = 0; i < nitems; i++) + CHECK(bool_result[i] == (i % 2 == 0)); + + + nvlist_append_string_array(nvl, "nvl/string", "a"); + nvlist_append_string_array(nvl, "nvl/string", "abc"); + string_result = nvlist_get_string_array(nvl, "nvl/string", &nitems); + CHECK(nitems == 2); + CHECK(strcmp(string_result[0], "a") == 0); + CHECK(strcmp(string_result[1], "abc") == 0); + + + nvl1 = nvlist_create(0); + nvlist_add_string(nvl1, "key1", "test1"); + nvlist_append_nvlist_array(nvl, "nvl/nvl", nvl1); + nvlist_destroy(nvl1); + + nvl2 = nvlist_create(0); + nvlist_add_string(nvl2, "key2", "test2"); + nvlist_append_nvlist_array(nvl, "nvl/nvl", nvl2); + nvlist_destroy(nvl2); + + nvl_result = nvlist_get_nvlist_array(nvl, "nvl/nvl", &nitems); + CHECK(nitems == 2); + CHECK(strcmp(nvlist_get_string(nvl_result[0], "key1"), "test1") == 0); + CHECK(strcmp(nvlist_get_string(nvl_result[1], "key2"), "test2") == 0); + + nvl1 = nvlist_create(0); + nvlist_add_number(nvl1, "key1", 10); + nvlist_append_nvlist_array(nvl, "nvl/nvl_array", nvl1); + nvlist_destroy(nvl1); + + nvl2 = nvlist_create(0); + nvlist_add_number(nvl2, "key1", 20); + nvlist_append_nvlist_array(nvl, "nvl/nvl_array", nvl2); + nvlist_destroy(nvl2); + + items = nvlist_take_nvlist_array(nvl, "nvl/nvl_array", &nitems); + CHECK(nvlist_get_number(items[0], "key1") == 10); + CHECK(nvlist_get_number(items[1], "key1") == 20); + CHECK(nvlist_error(items[0]) == 0); + CHECK(nvlist_error(items[1]) == 0); + + nvlist_move_nvlist_array(nvl, "nvl/nvl_new_array", items, nitems); + CHECK(nvlist_error(nvl) == 0); + + nvlist_destroy(nvl); + + return (0); +} Modified: head/share/man/man9/nv.9 ============================================================================== --- head/share/man/man9/nv.9 Mon Jun 18 22:27:29 2018 (r335346) +++ head/share/man/man9/nv.9 Mon Jun 18 22:57:32 2018 (r335347) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 16, 2017 +.Dd June 19, 2018 .Dt NV 9 .Os .Sh NAME @@ -55,7 +55,8 @@ .Nm nvlist_add , .Nm nvlist_move , .Nm nvlist_get , -.Nm nvlist_take +.Nm nvlist_take , +.Nm nvlist_append .Nd "library for name/value pairs" .Sh LIBRARY .Lb libnv @@ -239,6 +240,17 @@ .Fn nvlist_take_descriptor_array "nvlist_t *nvl" "const char *name" "size_t *nitems" .\" .Ft void +.Fn nvlist_append_bool_array "nvlist_t *nvl" "const char *name" "const bool value" +.Ft void +.Fn nvlist_append_number_array "nvlist_t *nvl" "const char *name" "const uint64_t value" +.Ft void +.Fn nvlist_append_string_array "nvlist_t *nvl" "const char *name" "const char * const value" +.Ft void +.Fn nvlist_append_nvlist_array "nvlist_t *nvl" "const char *name" "const nvlist_t * const value" +.Ft void +.Fn nvlist_append_descriptor_array "nvlist_t *nvl" "const char *name" "int value" +.\" +.Ft void .Fn nvlist_free "nvlist_t *nvl" "const char *name" .Ft void .Fn nvlist_free_type "nvlist_t *nvl" "const char *name" "int type" @@ -708,6 +720,20 @@ the array using the .Xr free 3 function. The nvlist must not be in error state. +.Pp +The +.Fn nvlist_append_bool_array , +.Fn nvlist_append_number_array , +.Fn nvlist_append_string_array , +.Fn nvlist_append_nvlist_array , +.Fn nvlist_append_descriptor_array +functions append an element to the existing array using the same semantics +as the add functions (i.e. the element will be copied when applicable). +If the array for a given key does not exist, then it will be created +as if using the +.Fn nvlist_add__array +function. +The internal error is set on append failure. .Pp The .Fn nvlist_free Modified: head/sys/contrib/libnv/nv_impl.h ============================================================================== --- head/sys/contrib/libnv/nv_impl.h Mon Jun 18 22:27:29 2018 (r335346) +++ head/sys/contrib/libnv/nv_impl.h Mon Jun 18 22:57:32 2018 (r335347) @@ -143,6 +143,12 @@ nvpair_t *nvpair_move_descriptor_array(const char *nam nvpair_t *nvpair_move_number_array(const char *name, uint64_t *value, size_t nitems); nvpair_t *nvpair_move_string_array(const char *name, char **value, size_t nitems); +int nvpair_append_bool_array(nvpair_t *nvp, const bool value); +int nvpair_append_number_array(nvpair_t *nvp, const uint64_t value); +int nvpair_append_string_array(nvpair_t *nvp, const char *value); +int nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value); +int nvpair_append_descriptor_array(nvpair_t *nvp, const int value); + bool nvpair_get_bool(const nvpair_t *nvp); uint64_t nvpair_get_number(const nvpair_t *nvp); const char *nvpair_get_string(const nvpair_t *nvp); Modified: head/sys/contrib/libnv/nvlist.c ============================================================================== --- head/sys/contrib/libnv/nvlist.c Mon Jun 18 22:27:29 2018 (r335346) +++ head/sys/contrib/libnv/nvlist.c Mon Jun 18 22:57:32 2018 (r335347) @@ -1607,6 +1607,37 @@ NVLIST_ADD_ARRAY(const int *, descriptor) #undef NVLIST_ADD_ARRAY +#define NVLIST_APPEND_ARRAY(vtype, type, TYPE) \ +void \ +nvlist_append_##type##_array(nvlist_t *nvl, const char *name, vtype value)\ +{ \ + nvpair_t *nvp; \ + \ + if (nvlist_error(nvl) != 0) { \ + ERRNO_SET(nvlist_error(nvl)); \ + return; \ + } \ + nvp = nvlist_find(nvl, NV_TYPE_##TYPE##_ARRAY, name); \ + if (nvp == NULL) { \ + nvlist_add_##type##_array(nvl, name, &value, 1); \ + return; \ + } \ + if (nvpair_append_##type##_array(nvp, value) == -1) { \ + nvl->nvl_error = ERRNO_OR_DEFAULT(ENOMEM); \ + ERRNO_SET(nvl->nvl_error); \ + } \ +} + +NVLIST_APPEND_ARRAY(const bool, bool, BOOL) +NVLIST_APPEND_ARRAY(const uint64_t, number, NUMBER) +NVLIST_APPEND_ARRAY(const char *, string, STRING) +NVLIST_APPEND_ARRAY(const nvlist_t *, nvlist, NVLIST) +#ifndef _KERNEL +NVLIST_APPEND_ARRAY(const int, descriptor, DESCRIPTOR) +#endif + +#undef NVLIST_APPEND_ARRAY + bool nvlist_move_nvpair(nvlist_t *nvl, nvpair_t *nvp) { Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Mon Jun 18 22:27:29 2018 (r335346) +++ head/sys/contrib/libnv/nvpair.c Mon Jun 18 22:57:32 2018 (r335347) @@ -144,6 +144,28 @@ nvpair_allocv(const char *name, int type, uint64_t dat return (nvp); } +static int +nvpair_append(nvpair_t *nvp, const void *value, size_t valsize, size_t datasize) +{ + void *olddata, *data, *valp; + size_t oldlen; + + oldlen = nvp->nvp_nitems * valsize; + olddata = (void *)(uintptr_t)nvp->nvp_data; + data = nv_realloc(olddata, oldlen + valsize); + if (data == NULL) { + ERRNO_SET(ENOMEM); + return (-1); + } + valp = (unsigned char *)data + oldlen; + memcpy(valp, value, valsize); + + nvp->nvp_data = (uint64_t)(uintptr_t)data; + nvp->nvp_datasize += datasize; + nvp->nvp_nitems++; + return (0); +} + nvlist_t * nvpair_nvlist(const nvpair_t *nvp) { @@ -1910,6 +1932,121 @@ nvpair_get_descriptor_array(const nvpair_t *nvp, size_ *nitems = nvp->nvp_nitems; return ((const int *)(intptr_t)nvp->nvp_data); +} +#endif + +int +nvpair_append_bool_array(nvpair_t *nvp, const bool value) +{ + + NVPAIR_ASSERT(nvp); + PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_BOOL_ARRAY); + return (nvpair_append(nvp, &value, sizeof(value), sizeof(value))); +} + +int +nvpair_append_number_array(nvpair_t *nvp, const uint64_t value) +{ + + NVPAIR_ASSERT(nvp); + PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NUMBER_ARRAY); + return (nvpair_append(nvp, &value, sizeof(value), sizeof(value))); +} + +int +nvpair_append_string_array(nvpair_t *nvp, const char *value) +{ + char *str; + + NVPAIR_ASSERT(nvp); + PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_STRING_ARRAY); + if (value == NULL) { + ERRNO_SET(EINVAL); + return (-1); + } + str = nv_strdup(value); + if (str == NULL) { + return (-1); + } + if (nvpair_append(nvp, &str, sizeof(str), strlen(str) + 1) == -1) { + nv_free(str); + return (-1); + } + return (0); +} + +int +nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value) +{ + nvpair_t *tmpnvp; + nvlist_t *nvl, *prev; + int flags; + + NVPAIR_ASSERT(nvp); + PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_NVLIST_ARRAY); + if (value == NULL || nvlist_error(value) != 0 || + nvlist_get_pararr(value, NULL) != NULL) { + ERRNO_SET(EINVAL); + return (-1); + } + nvl = nvlist_clone(value); + if (nvl == NULL) { + return (-1); + } + flags = nvlist_flags(nvl) | NV_FLAG_IN_ARRAY; + nvlist_set_flags(nvl, flags); + + tmpnvp = NULL; + if (nvp->nvp_nitems > 0) { + nvlist_t **nvls = (void *)(uintptr_t)nvp->nvp_data; + + prev = nvls[nvp->nvp_nitems - 1]; + PJDLOG_ASSERT(prev != NULL); + + tmpnvp = nvpair_allocv(" ", NV_TYPE_NVLIST, + (uint64_t)(uintptr_t)nvl, 0, 0); + if (tmpnvp == NULL) { + goto fail; + } + } + if (nvpair_append(nvp, &nvl, sizeof(nvl), 0) == -1) { + goto fail; + } + if (tmpnvp) { + NVPAIR_ASSERT(tmpnvp); + nvlist_set_array_next(prev, tmpnvp); + } + nvlist_set_parent(nvl, nvp); + return (0); +fail: + if (tmpnvp) { + nvpair_free(tmpnvp); + } + nvlist_destroy(nvl); + return (-1); +} + +#ifndef _KERNEL +int +nvpair_append_descriptor_array(nvpair_t *nvp, const int value) +{ + int fd; + + NVPAIR_ASSERT(nvp); + PJDLOG_ASSERT(nvp->nvp_type == NV_TYPE_DESCRIPTOR_ARRAY); + if (value < 0 || !fd_is_valid(value)) { + ERRNO_SET(EBADF); + return -1; + } + fd = fcntl(value, F_DUPFD_CLOEXEC, 0); + if (fd == -1) { + return (-1); + } + if (nvpair_append(nvp, &fd, sizeof(fd), sizeof(fd)) == -1) { + close(fd); + return (-1); + } + return (0); } #endif Modified: head/sys/sys/nv.h ============================================================================== --- head/sys/sys/nv.h Mon Jun 18 22:27:29 2018 (r335346) +++ head/sys/sys/nv.h Mon Jun 18 22:57:32 2018 (r335347) @@ -162,6 +162,14 @@ void nvlist_add_descriptor(nvlist_t *nvl, const char * void nvlist_add_descriptor_array(nvlist_t *nvl, const char *name, const int *value, size_t nitems); #endif +void nvlist_append_bool_array(nvlist_t *nvl, const char *name, const bool value); +void nvlist_append_number_array(nvlist_t *nvl, const char *name, const uint64_t value); +void nvlist_append_string_array(nvlist_t *nvl, const char *name, const char * const value); +void nvlist_append_nvlist_array(nvlist_t *nvl, const char *name, const nvlist_t * const value); +#ifndef _KERNEL +void nvlist_append_descriptor_array(nvlist_t *nvl, const char *name, int value); +#endif + /* * The nvlist_move functions add the given name/value pair. * The functions consumes provided buffer. From owner-svn-src-all@freebsd.org Mon Jun 18 23:00:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4631003FDD; Mon, 18 Jun 2018 23:00:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BA9278764; Mon, 18 Jun 2018 23:00:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1257729DD; Mon, 18 Jun 2018 23:00:16 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5IN0Fno036698; Mon, 18 Jun 2018 23:00:15 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5IN0Fgm036697; Mon, 18 Jun 2018 23:00:15 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806182300.w5IN0Fgm036697@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Mon, 18 Jun 2018 23:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335348 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335348 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 23:00:16 -0000 Author: oshogbo Date: Mon Jun 18 23:00:15 2018 New Revision: 335348 URL: https://svnweb.freebsd.org/changeset/base/335348 Log: libnv: add note about nvlist_pack and nvlist_unpack Fix small typo as well. Submitted by: Mindaugas Rasiukevicius Modified: head/share/man/man9/nv.9 Modified: head/share/man/man9/nv.9 ============================================================================== --- head/share/man/man9/nv.9 Mon Jun 18 22:57:32 2018 (r335347) +++ head/share/man/man9/nv.9 Mon Jun 18 23:00:15 2018 (r335348) @@ -589,7 +589,7 @@ The .Fn nvlist_add_nvlist_array , .Fn nvlist_add_descriptor_array functions add element to the given nvlist. -When adding string or binary buffor the functions will allocate memory +When adding string or binary buffer the functions will allocate memory and copy the data over. When adding nvlist, the nvlist will be cloned and clone will be added. When adding descriptor, the descriptor will be duplicated using the @@ -768,6 +768,13 @@ function name from the nvlist and free all resources a If element of the given name and the given type does not exist, the program will be aborted. The nvlist must not be in error state. +.Sh NOTES +The +.Fn nvlist_pack +and +.Fn nvlist_unpack +functions handle the byte-order conversions, so the binary buffer can be +packed/unpacked by the hosts with the different endianness. .Sh EXAMPLES The following example demonstrates how to prepare an nvlist and send it over .Xr unix 4 From owner-svn-src-all@freebsd.org Mon Jun 18 23:16:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162881004F13; Mon, 18 Jun 2018 23:16:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B77DD792BB; Mon, 18 Jun 2018 23:16:47 +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 775512D7A; Mon, 18 Jun 2018 23:16:47 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5INGlsj046601; Mon, 18 Jun 2018 23:16:47 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5INGliB046600; Mon, 18 Jun 2018 23:16:47 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806182316.w5INGliB046600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Mon, 18 Jun 2018 23:16:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335349 - head/tools/boot X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/boot X-SVN-Commit-Revision: 335349 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.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 23:16:48 -0000 Author: imp Date: Mon Jun 18 23:16:47 2018 New Revision: 335349 URL: https://svnweb.freebsd.org/changeset/base/335349 Log: Switch to creating UEFI ESPs using loader.efi instead of boot1.efi. Cope for the fact that laoder.efi, not being boot1, doesn't read /boot.config by setting boot_serial and force the serial console. Also add sysctl so we can display the boot method. Provide a variable, do_boot1_efi, if you want to use boot1 for testing. But since it's transient, it's just a variable and not available on the command line. Modified: head/tools/boot/rootgen.sh Modified: head/tools/boot/rootgen.sh ============================================================================== --- head/tools/boot/rootgen.sh Mon Jun 18 23:00:15 2018 (r335348) +++ head/tools/boot/rootgen.sh Mon Jun 18 23:16:47 2018 (r335349) @@ -2,6 +2,8 @@ # $FreeBSD$ +do_boot1_efi=0 + # # Builds all the bat-shit crazy combinations we support booting from, # at least for amd64. It assume you have a ~sane kernel in /boot/kernel @@ -29,6 +31,29 @@ cpsys() { (cd $src ; tar cf - .) | (cd $dst; tar xf -) } +make_esp() +{ + local src dst md mntpt + src=$1 + dst=$2 + + if [ "${do_boot1_efi}" -eq 1 ]; then + cp ${src}/boot/boot1.efifat ${dst} + else + dd if=/dev/zero of=${dst} count=1 seek=$((100 * 1024 * 1024 / 512)) + md=$(mdconfig -f ${dst}) + newfs_msdos -a 32 /dev/${md} + mntpt=$(mktemp -d /tmp/stand-test.XXXXXX) + mount -t msdos /dev/${md} ${mntpt} +# mkdir -p ${mntpt}/efi/freebsd # not yet + mkdir -p ${mntpt}/efi/boot + cp ${src}/boot/loader.efi ${mntpt}/efi/boot/bootx64.efi + umount ${mntpt} + rmdir ${mntpt} + mdconfig -d -u ${md} + fi +} + mk_nogeli_gpt_ufs_legacy() { src=$1 img=$2 @@ -50,8 +75,7 @@ mk_nogeli_gpt_ufs_uefi() { cat > ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${src}/etc/fstab < ${src}/etc/fstab < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${mntpt}/boot/loader.conf <> ${mntpt}/boot/loader.conf < ${DESTDIR}/boot.config +cat > ${DESTDIR}/boot/loader.conf < ${DESTDIR}/etc/rc < Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E74B5100633E; Mon, 18 Jun 2018 23:41:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 00D0779F80; Mon, 18 Jun 2018 23:41:24 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 5b035b98; Tue, 19 Jun 2018 01:41:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; s=mail; bh=15BImz rCjzwz4xu2pNPTA8Pht90=; b=e/qLGSKjkXyxGPIkmkdcEVcqgl6gafoX59YIfE Ji2xDX0hIUAqRarVE1j1XOFaFH3AoorBVg41ResF01dD5qwQJ30zOTGw9+oir+YU vE/f7Q7DE/z6Kf2vOYY4G4fNmKFFgay34F/g5qDzL+HPgTufovG6A/0CLXswiDUV 3VD68= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h= mime-version:content-type:content-transfer-encoding:date:from:to :cc:subject:in-reply-to:references:message-id; q=dns; s=mail; b= PDYUVe28cez+Pe3JEOyB1132t4YD79hdl+TToCuuwGPoOP/wcGoBu5mYxEMbNlNg /KHPccpBY36UlMBgtlN4iDJ38a2iMrBCZlS7oAUC89w+vj233s5l0Oy+2nRcrZds sce91QQnDHLYLUxfY5AepNnRu14TxZfYsU4Fn+9XZ/g= Received: from webmail.megadrive.org (www1.blih.net [212.83.177.180]) by mail.blih.net (OpenSMTPD) with ESMTP id 3238bafc; Tue, 19 Jun 2018 01:41:22 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 19 Jun 2018 01:41:22 +0200 From: Emmanuel Vadot To: Matt Macy Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, owner-src-committers@freebsd.org Subject: Re: svn commit: r335346 - head/sys/modules Organization: Bidouilliste In-Reply-To: <201806182227.w5IMRT1k021077@repo.freebsd.org> References: <201806182227.w5IMRT1k021077@repo.freebsd.org> Message-ID: <77532ed528d32792e8a56d2ef55033c0@megadrive.org> X-Sender: manu@bidouilliste.com User-Agent: Roundcube Webmail/1.1.1 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 18 Jun 2018 23:41:26 -0000 On 2018-06-19 00:27, Matt Macy wrote: > Author: mmacy > Date: Mon Jun 18 22:27:29 2018 > New Revision: 335346 > URL: https://svnweb.freebsd.org/changeset/base/335346 > > Log: > remove epoch_test from default build Requested by: manu Thanks, > Modified: > head/sys/modules/Makefile > > Modified: head/sys/modules/Makefile > ============================================================================== > --- head/sys/modules/Makefile Mon Jun 18 22:22:06 2018 (r335345) > +++ head/sys/modules/Makefile Mon Jun 18 22:27:29 2018 (r335346) > @@ -121,7 +121,6 @@ SUBDIR= \ > ${_ena} \ > ${_ep} \ > ${_epic} \ > - epoch_test \ > esp \ > ${_et} \ > evdev \ -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Tue Jun 19 00:27:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D0A91008ADC; Tue, 19 Jun 2018 00:27: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6BA87B6A9; Tue, 19 Jun 2018 00:27:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A94833CDB; Tue, 19 Jun 2018 00:27:30 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J0RUk1082007; Tue, 19 Jun 2018 00:27:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J0RUNt082006; Tue, 19 Jun 2018 00:27:30 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806190027.w5J0RUNt082006@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Jun 2018 00:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335350 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 335350 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 00:27:31 -0000 Author: imp Date: Tue Jun 19 00:27:30 2018 New Revision: 335350 URL: https://svnweb.freebsd.org/changeset/base/335350 Log: Add my script for coping with git-svn and the need to rebase changes for different branches. It's a bit rough right now, but should be good enough for most people to try to use. It's definitely 'tools' tree quality. Added: head/tools/tools/git/git-svn-rebase (contents, props changed) Modified: head/tools/tools/git/HOWTO Modified: head/tools/tools/git/HOWTO ============================================================================== --- head/tools/tools/git/HOWTO Mon Jun 18 23:16:47 2018 (r335349) +++ head/tools/tools/git/HOWTO Tue Jun 19 00:27:30 2018 (r335350) @@ -142,3 +142,18 @@ and 5, the commit hashes of all of your commits change You must go back and find the new commit hashes of your commits to pass to importgit. Passing -r C1~..C2 would import your commits as they were *before* your code review fixes were applied. + +III. git-svn-rebase + +git-svn-rebase is a script that helps you keep current when using git +plus subversion as outline in https://wiki.freebsd.org/GitWorkflow/GitSvn +since it's otherwise a pain to have many branhes active. It will rebase +those branches that haven't been merged yet. Some tweaking may be needed +if you have other, weird branches in your tree (including any stable +branches). To run it just cd into the git subversion tree somewhere and +type + $ git-svn-rebase +and it will do its thing and leave the tree on the master branch. + +Your tree must be clean to start this, and while it tries to catch +some failures, not all of them have been allowed for. Added: head/tools/tools/git/git-svn-rebase ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/git/git-svn-rebase Tue Jun 19 00:27:30 2018 (r335350) @@ -0,0 +1,57 @@ +#!/bin/sh + +# $FreeBSD$ + +# SPDX-License-Identifier: BSD-2-Clause-FreeBSD +# +# Copyright (c) 2018 M. Warner Losh +# +# 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. + +# +# simple script to keep all my branches up to date while tracking +# FreeBSD (or any upstream svn source) with git. Run it often, and it +# will rebase all the branches so they don't get too stale. +# Takes no args, and acts goofy if you have really old branches +# which is why stable/* and mfc* are excluded. Caution to should be taken +# when using this. +# + +FAIL= +echo ----------------- Checkout master for svn rebase ------------ +git checkout master +echo ----------------- Rebasing our master to svn upstream ------------ +git svn rebase +for i in $(git branch --no-merge | grep -v stable/ | grep -v mfc); do + echo ----------------- Rebasing $i to the tip of master ------------ + git rebase master $i || { + echo "****************** REBASE OF $i FAILED, ABORTING *****************" + FAIL="$FAIL $i" + git rebase --abort + } +done +echo ----------------- Checkout out master again ------------ +git checkout master +git branch +if [ -n "$FAIL" ]; then + echo Failed branches: $FAIL +fi From owner-svn-src-all@freebsd.org Tue Jun 19 00:38:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53E8410097E1; Tue, 19 Jun 2018 00:38:30 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED2B57C275; Tue, 19 Jun 2018 00:38:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFD573E99; Tue, 19 Jun 2018 00:38:29 +0000 (UTC) (envelope-from avos@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J0cTwS088000; Tue, 19 Jun 2018 00:38:29 GMT (envelope-from avos@FreeBSD.org) Received: (from avos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J0cSkZ087994; Tue, 19 Jun 2018 00:38:28 GMT (envelope-from avos@FreeBSD.org) Message-Id: <201806190038.w5J0cSkZ087994@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avos set sender to avos@FreeBSD.org using -f From: Andriy Voskoboinyk Date: Tue, 19 Jun 2018 00:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335351 - in head/sys/dev/rtwn: rtl8812a rtl8812a/usb rtl8821a/usb X-SVN-Group: head X-SVN-Commit-Author: avos X-SVN-Commit-Paths: in head/sys/dev/rtwn: rtl8812a rtl8812a/usb rtl8821a/usb X-SVN-Commit-Revision: 335351 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 00:38:30 -0000 Author: avos Date: Tue Jun 19 00:38:28 2018 New Revision: 335351 URL: https://svnweb.freebsd.org/changeset/base/335351 Log: rtwn(4): decode some bit fields + merge duplicate code. Add macros for R12A_RXDMA_PRO register (descriptions were seen in the RTL8822B vendor driver) and merge 2 r21au_init_burstlen() copies. No functional change intended. Modified: head/sys/dev/rtwn/rtl8812a/r12a_reg.h head/sys/dev/rtwn/rtl8812a/usb/r12au.h head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c head/sys/dev/rtwn/rtl8821a/usb/r21au.h head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c Modified: head/sys/dev/rtwn/rtl8812a/r12a_reg.h ============================================================================== --- head/sys/dev/rtwn/rtl8812a/r12a_reg.h Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8812a/r12a_reg.h Tue Jun 19 00:38:28 2018 (r335351) @@ -58,6 +58,16 @@ /* Bits for R92C_LEDCFG2. */ #define R12A_LEDCFG2_ENA 0x20 +/* Bits for R12A_RXDMA_PRO. */ +#define R12A_DMA_MODE 0x02 +#define R12A_BURST_CNT_M 0x0c +#define R12A_BURST_CNT_S 2 +#define R12A_BURST_SZ_M 0x30 +#define R12A_BURST_SZ_S 4 +#define R12A_BURST_SZ_USB3 0 +#define R12A_BURST_SZ_USB2 1 +#define R12A_BURST_SZ_USB1 2 + /* Bits for R12A_CCK_CHECK. */ #define R12A_CCK_CHECK_BCN1 0x20 #define R12A_CCK_CHECK_5GHZ 0x80 Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au.h ============================================================================== --- head/sys/dev/rtwn/rtl8812a/usb/r12au.h Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8812a/usb/r12au.h Tue Jun 19 00:38:28 2018 (r335351) @@ -37,6 +37,7 @@ */ /* r12au_init.c */ void r12au_init_rx_agg(struct rtwn_softc *); +void r12au_init_burstlen_usb2(struct rtwn_softc *); void r12au_init_burstlen(struct rtwn_softc *); void r12au_init_ampdu_fwhw(struct rtwn_softc *); void r12au_init_ampdu(struct rtwn_softc *); Modified: head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8812a/usb/r12au_init.c Tue Jun 19 00:38:28 2018 (r335351) @@ -72,19 +72,32 @@ r12au_init_rx_agg(struct rtwn_softc *sc) } void +r12au_init_burstlen_usb2(struct rtwn_softc *sc) +{ + const uint8_t dma_count = R12A_DMA_MODE | SM(R12A_BURST_CNT, 3); + + if ((rtwn_read_1(sc, R92C_USB_INFO) & 0x30) == 0) { + /* Set burst packet length to 512 B. */ + rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M, + dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB2)); + } else { + /* Set burst packet length to 64 B. */ + rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M, + dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB1)); + } +} + +void r12au_init_burstlen(struct rtwn_softc *sc) { - if (rtwn_read_1(sc, R92C_TYPE_ID + 3) & 0x80) { - if ((rtwn_read_1(sc, R92C_USB_INFO) & 0x30) == 0) { - /* Set burst packet length to 512 B. */ - rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x20, 0x1e); - } else { - /* Set burst packet length to 64 B. */ - rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x10, 0x2e); - } - } else { /* USB 3.0 */ + const uint8_t dma_count = R12A_DMA_MODE | SM(R12A_BURST_CNT, 3); + + if (rtwn_read_1(sc, R92C_TYPE_ID + 3) & 0x80) + r12au_init_burstlen_usb2(sc); + else { /* USB 3.0 */ /* Set burst packet length to 1 KB. */ - rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x30, 0x0e); + rtwn_setbits_1(sc, R12A_RXDMA_PRO, R12A_BURST_SZ_M, + dma_count | SM(R12A_BURST_SZ, R12A_BURST_SZ_USB3)); rtwn_setbits_1(sc, 0xf008, 0x18, 0); } Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au.h ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au.h Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au.h Tue Jun 19 00:38:28 2018 (r335351) @@ -37,7 +37,6 @@ */ /* r21au_init.c */ void r21au_init_tx_agg(struct rtwn_softc *); -void r21au_init_burstlen(struct rtwn_softc *); /* r21au_dfs.c */ void r21au_chan_check(void *, int); Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_attach.c Tue Jun 19 00:38:28 2018 (r335351) @@ -135,7 +135,7 @@ r21a_attach_private(struct rtwn_softc *sc) rs->rs_fix_spur = rtwn_nop_softc_chan; rs->rs_set_band_2ghz = r21a_set_band_2ghz; rs->rs_set_band_5ghz = r21a_set_band_5ghz; - rs->rs_init_burstlen = r21au_init_burstlen; + rs->rs_init_burstlen = r12au_init_burstlen_usb2; rs->rs_init_ampdu_fwhw = r21a_init_ampdu_fwhw; rs->rs_crystalcap_write = r21a_crystalcap_write; #ifndef RTWN_WITHOUT_UCODE Modified: head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c ============================================================================== --- head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c Tue Jun 19 00:27:30 2018 (r335350) +++ head/sys/dev/rtwn/rtl8821a/usb/r21au_init.c Tue Jun 19 00:38:28 2018 (r335351) @@ -70,14 +70,3 @@ r21au_init_tx_agg(struct rtwn_softc *sc) rtwn_write_1(sc, R21A_DWBCN1_CTRL, uc->tx_agg_desc_num << 1); } -void -r21au_init_burstlen(struct rtwn_softc *sc) -{ - if ((rtwn_read_1(sc, R92C_USB_INFO) & 0x30) == 0) { - /* Set burst packet length to 512 B. */ - rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x20, 0x1e); - } else { - /* Set burst packet length to 64 B. */ - rtwn_setbits_1(sc, R12A_RXDMA_PRO, 0x10, 0x2e); - } -} From owner-svn-src-all@freebsd.org Tue Jun 19 00:50:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8E05100A6C9; Tue, 19 Jun 2018 00:50:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A40A7CD8C; Tue, 19 Jun 2018 00:50:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5B6F44072; Tue, 19 Jun 2018 00:50:28 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J0oSrh093578; Tue, 19 Jun 2018 00:50:28 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J0oSnE093577; Tue, 19 Jun 2018 00:50:28 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806190050.w5J0oSnE093577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Tue, 19 Jun 2018 00:50:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335352 - head/sys/dev/cxgbe/common X-SVN-Group: head X-SVN-Commit-Author: np X-SVN-Commit-Paths: head/sys/dev/cxgbe/common X-SVN-Commit-Revision: 335352 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 00:50:29 -0000 Author: np Date: Tue Jun 19 00:50:27 2018 New Revision: 335352 URL: https://svnweb.freebsd.org/changeset/base/335352 Log: cxgbe(4): Some mailbox commands require access to the Tx pipeline and can time out if it's backed up due to a non-stop deluge of PAUSE frames from a misbehaving peer. Detect this situation and toggle MPS TxEn to allow forward progress. MFC after: 2 weeks Sponsored by: Chelsio Communications Modified: head/sys/dev/cxgbe/common/t4_hw.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Tue Jun 19 00:38:28 2018 (r335351) +++ head/sys/dev/cxgbe/common/t4_hw.c Tue Jun 19 00:50:27 2018 (r335352) @@ -239,6 +239,63 @@ static void fw_asrt(struct adapter *adap, struct fw_de be32_to_cpu(asrt->u.assert.y)); } +struct port_tx_state { + uint64_t rx_pause; + uint64_t tx_frames; +}; + +static void +read_tx_state_one(struct adapter *sc, int i, struct port_tx_state *tx_state) +{ + uint32_t rx_pause_reg, tx_frames_reg; + + if (is_t4(sc)) { + tx_frames_reg = PORT_REG(i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L); + rx_pause_reg = PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L); + } else { + tx_frames_reg = T5_PORT_REG(i, A_MPS_PORT_STAT_TX_PORT_FRAMES_L); + rx_pause_reg = T5_PORT_REG(i, A_MPS_PORT_STAT_RX_PORT_PAUSE_L); + } + + tx_state->rx_pause = t4_read_reg64(sc, rx_pause_reg); + tx_state->tx_frames = t4_read_reg64(sc, tx_frames_reg); +} + +static void +read_tx_state(struct adapter *sc, struct port_tx_state *tx_state) +{ + int i; + + for_each_port(sc, i) + read_tx_state_one(sc, i, &tx_state[i]); +} + +static void +check_tx_state(struct adapter *sc, struct port_tx_state *tx_state) +{ + uint32_t port_ctl_reg; + uint64_t tx_frames, rx_pause; + int i; + + for_each_port(sc, i) { + rx_pause = tx_state[i].rx_pause; + tx_frames = tx_state[i].tx_frames; + read_tx_state_one(sc, i, &tx_state[i]); /* update */ + + if (is_t4(sc)) + port_ctl_reg = PORT_REG(i, A_MPS_PORT_CTL); + else + port_ctl_reg = T5_PORT_REG(i, A_MPS_PORT_CTL); + if (t4_read_reg(sc, port_ctl_reg) & F_PORTTXEN && + rx_pause != tx_state[i].rx_pause && + tx_frames == tx_state[i].tx_frames) { + t4_set_reg_field(sc, port_ctl_reg, F_PORTTXEN, 0); + mdelay(1); + t4_set_reg_field(sc, port_ctl_reg, F_PORTTXEN, F_PORTTXEN); + } + } +} + #define X_CIM_PF_NOACCESS 0xeeeeeeee /** * t4_wr_mbox_meat_timeout - send a command to FW through the given mailbox @@ -280,13 +337,14 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int }; u32 v; u64 res; - int i, ms, delay_idx, ret; + int i, ms, delay_idx, ret, next_tx_check; const __be64 *p = cmd; u32 data_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_DATA); u32 ctl_reg = PF_REG(mbox, A_CIM_PF_MAILBOX_CTRL); u32 ctl; __be64 cmd_rpl[MBOX_LEN/8]; u32 pcie_fw; + struct port_tx_state tx_state[MAX_NPORTS]; if (adap->flags & CHK_MBOX_ACCESS) ASSERT_SYNCHRONIZED_OP(adap); @@ -375,8 +433,8 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int CH_DUMP_MBOX(adap, mbox, data_reg); t4_write_reg(adap, ctl_reg, F_MBMSGVALID | V_MBOWNER(X_MBOWNER_FW)); - t4_read_reg(adap, ctl_reg); /* flush write */ - + read_tx_state(adap, &tx_state[0]); /* also flushes the write_reg */ + next_tx_check = 1000; delay_idx = 0; ms = delay[0]; @@ -391,6 +449,12 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int if (pcie_fw & F_PCIE_FW_ERR) break; } + + if (i >= next_tx_check) { + check_tx_state(adap, &tx_state[0]); + next_tx_check = i + 1000; + } + if (sleep_ok) { ms = delay[delay_idx]; /* last element may repeat */ if (delay_idx < ARRAY_SIZE(delay) - 1) From owner-svn-src-all@freebsd.org Tue Jun 19 01:00:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DE24E100AF7C; Tue, 19 Jun 2018 01:00:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 912657D505; Tue, 19 Jun 2018 01:00:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6E3554213; Tue, 19 Jun 2018 01:00:28 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J10ST2098449; Tue, 19 Jun 2018 01:00:28 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J10SGa098448; Tue, 19 Jun 2018 01:00:28 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806190100.w5J10SGa098448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 01:00:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335353 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335353 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 01:00:29 -0000 Author: bdrewery Date: Tue Jun 19 01:00:27 2018 New Revision: 335353 URL: https://svnweb.freebsd.org/changeset/base/335353 Log: Don't bootstrap lld if an external linker is used. Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 00:50:27 2018 (r335352) +++ head/Makefile.inc1 Tue Jun 19 01:00:27 2018 (r335353) @@ -232,6 +232,10 @@ X${BINUTIL}?= ${${BINUTIL}} .endif .endfor +# If a full path to an external linker is given, don't build lld. +.if ${XLD:M/*} +MK_LLD_BOOTSTRAP= no +.endif # We must do lib/ and libexec/ before bin/ in case of a mid-install error to # keep the users system reasonably usable. For static->dynamic root upgrades, From owner-svn-src-all@freebsd.org Tue Jun 19 01:32:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32AA2100EDAF; Tue, 19 Jun 2018 01:32:34 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D017C7F9EF; Tue, 19 Jun 2018 01:32:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B0EFA49A5; Tue, 19 Jun 2018 01:32:33 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J1WXdX018894; Tue, 19 Jun 2018 01:32:33 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J1WXAd018892; Tue, 19 Jun 2018 01:32:33 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806190132.w5J1WXAd018892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 19 Jun 2018 01:32:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335354 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335354 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 01:32:34 -0000 Author: asomers Date: Tue Jun 19 01:32:33 2018 New Revision: 335354 URL: https://svnweb.freebsd.org/changeset/base/335354 Log: audit(4): add tests for ioctl(2) Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15872 Added: head/tests/sys/audit/ioctl.c (contents, props changed) Modified: head/tests/sys/audit/Makefile Modified: head/tests/sys/audit/Makefile ============================================================================== --- head/tests/sys/audit/Makefile Tue Jun 19 01:00:27 2018 (r335353) +++ head/tests/sys/audit/Makefile Tue Jun 19 01:32:33 2018 (r335354) @@ -10,6 +10,7 @@ ATF_TESTS_C+= file-close ATF_TESTS_C+= file-write ATF_TESTS_C+= file-read ATF_TESTS_C+= open +ATF_TESTS_C+= ioctl ATF_TESTS_C+= network ATF_TESTS_C+= inter-process ATF_TESTS_C+= administrative @@ -30,6 +31,8 @@ SRCS.file-read+= file-read.c SRCS.file-read+= utils.c SRCS.open+= open.c SRCS.open+= utils.c +SRCS.ioctl+= ioctl.c +SRCS.ioctl+= utils.c SRCS.network+= network.c SRCS.network+= utils.c SRCS.inter-process+= inter-process.c Added: head/tests/sys/audit/ioctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tests/sys/audit/ioctl.c Tue Jun 19 01:32:33 2018 (r335354) @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2018 Aniket Pandey + * + * 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 + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * 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 + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include + +#include +#include + +#include +#include +#include + +#include "utils.h" + +static int filedesc; +static char ioregex[80]; +static const char *auclass = "io"; +static struct pollfd fds[1]; +static unsigned long request = AUDITPIPE_FLUSH; + + +ATF_TC_WITH_CLEANUP(ioctl_success); +ATF_TC_HEAD(ioctl_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "ioctl(2) call"); +} + +ATF_TC_BODY(ioctl_success, tc) +{ + /* auditpipe(4) supports quite a few ioctls */ + ATF_REQUIRE((filedesc = open("/dev/auditpipe", O_RDONLY)) != -1); + /* Prepare the regex to be checked in the audit record */ + snprintf(ioregex, sizeof(ioregex), + "ioctl.*%#lx.*%#x.*return,success", request, filedesc); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE(ioctl(filedesc, request) != -1); + check_audit(fds, ioregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(ioctl_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(ioctl_failure); +ATF_TC_HEAD(ioctl_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "ioctl(2) call"); +} + +ATF_TC_BODY(ioctl_failure, tc) +{ + snprintf(ioregex, sizeof(ioregex), + "ioctl.*%#lx.*return,failure : Bad file descriptor", request); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, ioctl(-1, request)); + check_audit(fds, ioregex, pipefd); +} + +ATF_TC_CLEANUP(ioctl_failure, tc) +{ + cleanup(); +} + + +ATF_TP_ADD_TCS(tp) +{ + ATF_TP_ADD_TC(tp, ioctl_success); + ATF_TP_ADD_TC(tp, ioctl_failure); + + return (atf_no_error()); +} From owner-svn-src-all@freebsd.org Tue Jun 19 01:33:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A443B100EEE0; Tue, 19 Jun 2018 01:33:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 57B677FB74; Tue, 19 Jun 2018 01:33:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3993A49B4; Tue, 19 Jun 2018 01:33:04 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J1X4vS018988; Tue, 19 Jun 2018 01:33:04 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J1X4G1018987; Tue, 19 Jun 2018 01:33:04 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201806190133.w5J1X4G1018987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Tue, 19 Jun 2018 01:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335355 - head/contrib/amd/amq X-SVN-Group: head X-SVN-Commit-Author: cy X-SVN-Commit-Paths: head/contrib/amd/amq X-SVN-Commit-Revision: 335355 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 01:33:04 -0000 Author: cy Date: Tue Jun 19 01:33:03 2018 New Revision: 335355 URL: https://svnweb.freebsd.org/changeset/base/335355 Log: Fix amq -i timestamp segmentation violation. MFC after: 1 week Modified: head/contrib/amd/amq/amq.c Modified: head/contrib/amd/amq/amq.c ============================================================================== --- head/contrib/amd/amq/amq.c Tue Jun 19 01:32:33 2018 (r335354) +++ head/contrib/amd/amq/amq.c Tue Jun 19 01:33:03 2018 (r335355) @@ -79,7 +79,7 @@ enum show_opt { static void time_print(time_type tt) { - time_t t = (time_t)*tt; + time_t t = (time_t)(intptr_t)tt; struct tm *tp = localtime(&t); printf("%02d/%02d/%04d %02d:%02d:%02d", tp->tm_mon + 1, tp->tm_mday, From owner-svn-src-all@freebsd.org Tue Jun 19 01:54:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4537510118E0; Tue, 19 Jun 2018 01:54:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ECC781B58; Tue, 19 Jun 2018 01:54:02 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E52D14D8F; Tue, 19 Jun 2018 01:54:01 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J1s14m029648; Tue, 19 Jun 2018 01:54:01 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J1s0Nd029642; Tue, 19 Jun 2018 01:54:00 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806190154.w5J1s0Nd029642@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 19 Jun 2018 01:54:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335356 - in head/sys: kern netinet netinet/tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: in head/sys: kern netinet netinet/tcp_stacks X-SVN-Commit-Revision: 335356 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 01:54:02 -0000 Author: mmacy Date: Tue Jun 19 01:54:00 2018 New Revision: 335356 URL: https://svnweb.freebsd.org/changeset/base/335356 Log: convert inpcbinfo hash and info rwlocks to epoch + mutex - Convert inpcbinfo info & hash locks to epoch for read and mutex for write - Garbage collect code that handled INP_INFO_TRY_RLOCK failures as INP_INFO_RLOCK which can no longer fail When running 64 netperfs sending minimal sized packets on a 2x8x2 reduces unhalted core cycles samples in rwlock rlock/runlock in udp_send from 51% to 3%. Overall packet throughput rate limited by CPU affinity and NIC driver design choices. On the receiver unhalted core cycles samples in in_pcblookup_hash went from 13% to to 1.6% Tested by LLNW and pho@ Reviewed by: jtl Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15686 Modified: head/sys/kern/subr_witness.c head/sys/netinet/in_pcb.h head/sys/netinet/tcp_hpts.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_stacks/rack.c head/sys/netinet/tcp_timewait.c Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/kern/subr_witness.c Tue Jun 19 01:54:00 2018 (r335356) @@ -561,14 +561,14 @@ static struct witness_order_list_entry order_lists[] = /* * UDP/IP */ - { "udp", &lock_class_rw }, + { "udp", &lock_class_mtx_sleep }, { "udpinp", &lock_class_rw }, { "so_snd", &lock_class_mtx_sleep }, { NULL, NULL }, /* * TCP/IP */ - { "tcp", &lock_class_rw }, + { "tcp", &lock_class_mtx_sleep }, { "tcpinp", &lock_class_rw }, { "so_snd", &lock_class_mtx_sleep }, { NULL, NULL }, Modified: head/sys/netinet/in_pcb.h ============================================================================== --- head/sys/netinet/in_pcb.h Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/netinet/in_pcb.h Tue Jun 19 01:54:00 2018 (r335356) @@ -51,6 +51,8 @@ #include #include #include +#include +#include #include #endif #include @@ -157,6 +159,7 @@ struct in_conninfo { * Key: * (b) - Protected by the hpts lock. * (c) - Constant after initialization + * (e) - Protected by the net_epoch_prempt epoch * (g) - Protected by the pcbgroup lock * (i) - Protected by the inpcb lock * (p) - Protected by the pcbinfo lock for the inpcb @@ -231,7 +234,7 @@ struct inpcbpolicy; struct m_snd_tag; struct inpcb { /* Cache line #1 (amd64) */ - CK_LIST_ENTRY(inpcb) inp_hash; /* (h/i) hash list */ + CK_LIST_ENTRY(inpcb) inp_hash; /* [w](h/i) [r](e/i) hash list */ CK_LIST_ENTRY(inpcb) inp_pcbgrouphash; /* (g/i) hash list */ struct rwlock inp_lock; /* Cache line #2 (amd64) */ @@ -324,8 +327,8 @@ struct inpcb { struct route_in6 inp_route6; }; CK_LIST_ENTRY(inpcb) inp_list; /* (p/l) list for all PCBs for proto */ - /* (p[w]) for list iteration */ - /* (p[r]/l) for addition/removal */ + /* (e[r]) for list iteration */ + /* (p[w]/l) for addition/removal */ struct epoch_context inp_epoch_ctx; }; #endif /* _KERNEL */ @@ -436,22 +439,23 @@ struct in_pcblist { * Locking key: * * (c) Constant or nearly constant after initialisation + * (e) - Protected by the net_epoch_prempt epoch * (g) Locked by ipi_lock * (l) Locked by ipi_list_lock - * (h) Read using either ipi_hash_lock or inpcb lock; write requires both + * (h) Read using either net_epoch_preempt or inpcb lock; write requires both ipi_hash_lock and inpcb lock * (p) Protected by one or more pcbgroup locks * (x) Synchronisation properties poorly defined */ struct inpcbinfo { /* - * Global lock protecting full inpcb list traversal + * Global lock protecting inpcb list modification */ - struct rwlock ipi_lock; + struct mtx ipi_lock; /* * Global list of inpcbs on the protocol. */ - struct inpcbhead *ipi_listhead; /* (g/l) */ + struct inpcbhead *ipi_listhead; /* [r](e) [w](g/l) */ u_int ipi_count; /* (l) */ /* @@ -482,9 +486,9 @@ struct inpcbinfo { u_int ipi_hashfields; /* (c) */ /* - * Global lock protecting non-pcbgroup hash lookup tables. + * Global lock protecting modification non-pcbgroup hash lookup tables. */ - struct rwlock ipi_hash_lock; + struct mtx ipi_hash_lock; /* * Global hash of inpcbs, hashed by local and foreign addresses and @@ -626,20 +630,18 @@ int inp_so_options(const struct inpcb *inp); #endif /* _KERNEL */ #define INP_INFO_LOCK_INIT(ipi, d) \ - rw_init_flags(&(ipi)->ipi_lock, (d), RW_RECURSE) -#define INP_INFO_LOCK_DESTROY(ipi) rw_destroy(&(ipi)->ipi_lock) -#define INP_INFO_RLOCK(ipi) rw_rlock(&(ipi)->ipi_lock) -#define INP_INFO_WLOCK(ipi) rw_wlock(&(ipi)->ipi_lock) -#define INP_INFO_TRY_RLOCK(ipi) rw_try_rlock(&(ipi)->ipi_lock) -#define INP_INFO_TRY_WLOCK(ipi) rw_try_wlock(&(ipi)->ipi_lock) -#define INP_INFO_TRY_UPGRADE(ipi) rw_try_upgrade(&(ipi)->ipi_lock) -#define INP_INFO_WLOCKED(ipi) rw_wowned(&(ipi)->ipi_lock) -#define INP_INFO_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_lock) -#define INP_INFO_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_lock) -#define INP_INFO_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_LOCKED) -#define INP_INFO_RLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_RLOCKED) -#define INP_INFO_WLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_WLOCKED) -#define INP_INFO_UNLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_lock, RA_UNLOCKED) + mtx_init(&(ipi)->ipi_lock, (d), NULL, MTX_DEF| MTX_RECURSE) +#define INP_INFO_LOCK_DESTROY(ipi) mtx_destroy(&(ipi)->ipi_lock) +#define INP_INFO_RLOCK(ipi) NET_EPOCH_ENTER() +#define INP_INFO_WLOCK(ipi) mtx_lock(&(ipi)->ipi_lock) +#define INP_INFO_TRY_WLOCK(ipi) mtx_trylock(&(ipi)->ipi_lock) +#define INP_INFO_WLOCKED(ipi) mtx_owned(&(ipi)->ipi_lock) +#define INP_INFO_RUNLOCK(ipi) NET_EPOCH_EXIT() +#define INP_INFO_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_lock) +#define INP_INFO_LOCK_ASSERT(ipi) MPASS(in_epoch() || mtx_owned(&(ipi)->ipi_lock)) +#define INP_INFO_RLOCK_ASSERT(ipi) MPASS(in_epoch()) +#define INP_INFO_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_lock, MA_OWNED) +#define INP_INFO_UNLOCK_ASSERT(ipi) MPASS(!in_epoch() && !mtx_owned(&(ipi)->ipi_lock)) #define INP_LIST_LOCK_INIT(ipi, d) \ rw_init_flags(&(ipi)->ipi_list_lock, (d), 0) @@ -660,17 +662,14 @@ int inp_so_options(const struct inpcb *inp); #define INP_LIST_UNLOCK_ASSERT(ipi) \ rw_assert(&(ipi)->ipi_list_lock, RA_UNLOCKED) -#define INP_HASH_LOCK_INIT(ipi, d) \ - rw_init_flags(&(ipi)->ipi_hash_lock, (d), 0) -#define INP_HASH_LOCK_DESTROY(ipi) rw_destroy(&(ipi)->ipi_hash_lock) -#define INP_HASH_RLOCK(ipi) rw_rlock(&(ipi)->ipi_hash_lock) -#define INP_HASH_WLOCK(ipi) rw_wlock(&(ipi)->ipi_hash_lock) -#define INP_HASH_RUNLOCK(ipi) rw_runlock(&(ipi)->ipi_hash_lock) -#define INP_HASH_WUNLOCK(ipi) rw_wunlock(&(ipi)->ipi_hash_lock) -#define INP_HASH_LOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_hash_lock, \ - RA_LOCKED) -#define INP_HASH_WLOCK_ASSERT(ipi) rw_assert(&(ipi)->ipi_hash_lock, \ - RA_WLOCKED) +#define INP_HASH_LOCK_INIT(ipi, d) mtx_init(&(ipi)->ipi_hash_lock, (d), NULL, MTX_DEF) +#define INP_HASH_LOCK_DESTROY(ipi) mtx_destroy(&(ipi)->ipi_hash_lock) +#define INP_HASH_RLOCK(ipi) NET_EPOCH_ENTER() +#define INP_HASH_WLOCK(ipi) mtx_lock(&(ipi)->ipi_hash_lock) +#define INP_HASH_RUNLOCK(ipi) NET_EPOCH_EXIT() +#define INP_HASH_WUNLOCK(ipi) mtx_unlock(&(ipi)->ipi_hash_lock) +#define INP_HASH_LOCK_ASSERT(ipi) MPASS(in_epoch() || mtx_owned(&(ipi)->ipi_hash_lock)) +#define INP_HASH_WLOCK_ASSERT(ipi) mtx_assert(&(ipi)->ipi_hash_lock, MA_OWNED); #define INP_GROUP_LOCK_INIT(ipg, d) mtx_init(&(ipg)->ipg_lock, (d), NULL, \ MTX_DEF | MTX_DUPOK) Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/netinet/tcp_hpts.c Tue Jun 19 01:54:00 2018 (r335356) @@ -184,9 +184,6 @@ TUNABLE_INT("net.inet.tcp.hpts_logging_sz", &tcp_hpts_ static struct tcp_hptsi tcp_pace; -static int -tcp_hptsi_lock_inpinfo(struct inpcb *inp, - struct tcpcb **tp); static void tcp_wakehpts(struct tcp_hpts_entry *p); static void tcp_wakeinput(struct tcp_hpts_entry *p); static void tcp_input_data(struct tcp_hpts_entry *hpts, struct timeval *tv); @@ -498,59 +495,6 @@ SYSCTL_PROC(_net_inet_tcp_hpts, OID_AUTO, log, CTLTYPE 0, 0, sysctl_tcp_hpts_log, "A", "tcp hptsi log"); -/* - * Try to get the INP_INFO lock. - * - * This function always succeeds in getting the lock. It will clear - * *tpp and return (1) if something critical changed while the inpcb - * was unlocked. Otherwise, it will leave *tpp unchanged and return (0). - * - * This function relies on the fact that the hpts always holds a - * reference on the inpcb while the segment is on the hptsi wheel and - * in the input queue. - * - */ -static int -tcp_hptsi_lock_inpinfo(struct inpcb *inp, struct tcpcb **tpp) -{ - struct tcp_function_block *tfb; - struct tcpcb *tp; - void *ptr; - - /* Try the easy way. */ - if (INP_INFO_TRY_RLOCK(&V_tcbinfo)) - return (0); - - /* - * OK, let's try the hard way. We'll save the function pointer block - * to make sure that doesn't change while we aren't holding the - * lock. - */ - tp = *tpp; - tfb = tp->t_fb; - ptr = tp->t_fb_ptr; - INP_WUNLOCK(inp); - INP_INFO_RLOCK(&V_tcbinfo); - INP_WLOCK(inp); - /* If the session went away, return an error. */ - if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) || - (inp->inp_flags2 & INP_FREED)) { - *tpp = NULL; - return (1); - } - /* - * If the function block or stack-specific data block changed, - * report an error. - */ - tp = intotcpcb(inp); - if ((tp->t_fb != tfb) && (tp->t_fb_ptr != ptr)) { - *tpp = NULL; - return (1); - } - return (0); -} - - static void tcp_wakehpts(struct tcp_hpts_entry *hpts) { @@ -1290,10 +1234,7 @@ out: (m->m_pkthdr.pace_lock == TI_RLOCKED || tp->t_state != TCPS_ESTABLISHED)) { ti_locked = TI_RLOCKED; - if (tcp_hptsi_lock_inpinfo(inp, &tp)) { - CURVNET_RESTORE(); - goto out; - } + INP_INFO_RLOCK(&V_tcbinfo); m = tp->t_in_pkt; } if (in_newts_every_tcb) { @@ -1360,7 +1301,6 @@ out: */ if ((inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) || (inp->inp_flags2 & INP_FREED)) { - out_free: while (m) { m_freem(m); m = n; @@ -1376,8 +1316,7 @@ out: if (ti_locked == TI_UNLOCKED && (tp->t_state != TCPS_ESTABLISHED)) { ti_locked = TI_RLOCKED; - if (tcp_hptsi_lock_inpinfo(inp, &tp)) - goto out_free; + INP_INFO_RLOCK(&V_tcbinfo); } } /** end while(m) */ } /** end if ((m != NULL) && (m == tp->t_in_pkt)) */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/netinet/tcp_input.c Tue Jun 19 01:54:00 2018 (r335356) @@ -960,25 +960,10 @@ findpcb: * * XXXRW: It may be time to rethink timewait locking. */ -relocked: if (inp->inp_flags & INP_TIMEWAIT) { if (ti_locked == TI_UNLOCKED) { - if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { - in_pcbref(inp); - INP_WUNLOCK(inp); - INP_INFO_RLOCK(&V_tcbinfo); - ti_locked = TI_RLOCKED; - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) { - inp = NULL; - goto findpcb; - } else if (inp->inp_flags & INP_DROPPED) { - INP_WUNLOCK(inp); - inp = NULL; - goto findpcb; - } - } else - ti_locked = TI_RLOCKED; + INP_INFO_RLOCK(); + ti_locked = TI_RLOCKED; } INP_INFO_RLOCK_ASSERT(&V_tcbinfo); @@ -1026,23 +1011,8 @@ relocked: (tp->t_state == TCPS_LISTEN && (thflags & TH_SYN) && !IS_FASTOPEN(tp->t_flags)))) { if (ti_locked == TI_UNLOCKED) { - if (INP_INFO_TRY_RLOCK(&V_tcbinfo) == 0) { - in_pcbref(inp); - INP_WUNLOCK(inp); - INP_INFO_RLOCK(&V_tcbinfo); - ti_locked = TI_RLOCKED; - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) { - inp = NULL; - goto findpcb; - } else if (inp->inp_flags & INP_DROPPED) { - INP_WUNLOCK(inp); - inp = NULL; - goto findpcb; - } - goto relocked; - } else - ti_locked = TI_RLOCKED; + INP_INFO_RLOCK(); + ti_locked = TI_RLOCKED; } INP_INFO_RLOCK_ASSERT(&V_tcbinfo); } Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/netinet/tcp_stacks/rack.c Tue Jun 19 01:54:00 2018 (r335356) @@ -6837,34 +6837,8 @@ rack_do_segment(struct mbuf *m, struct tcphdr *th, str * Initial input (ACK to SYN-ACK etc)lets go ahead and get * it processed */ - if (ti_locked != TI_RLOCKED && INP_INFO_TRY_RLOCK(&V_tcbinfo)) - ti_locked = TI_RLOCKED; - if (ti_locked != TI_RLOCKED) { - inp = tp->t_inpcb; - tfb = tp->t_fb; - in_pcbref(inp); - INP_WUNLOCK(inp); - INP_INFO_RLOCK(&V_tcbinfo); - ti_locked = TI_RLOCKED; - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - inp = NULL; - if (inp == NULL || (inp->inp_flags2 & INP_FREED) || - (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED))) { - /* The TCPCB went away. Free the packet. */ - INP_INFO_RUNLOCK(&V_tcbinfo); - if (inp) - INP_WUNLOCK(inp); - m_freem(m); - return; - } - /* If the stack changed, call the correct stack. */ - if (tp->t_fb != tfb) { - tp->t_fb->tfb_tcp_do_segment(m, th, so, tp, - drop_hdrlen, tlen, iptos, ti_locked); - return; - } - } + INP_INFO_RLOCK(); + ti_locked = TI_RLOCKED; tcp_get_usecs(&tv); rack_hpts_do_segment(m, th, so, tp, drop_hdrlen, tlen, iptos, ti_locked, 0, &tv); Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Tue Jun 19 01:33:03 2018 (r335355) +++ head/sys/netinet/tcp_timewait.c Tue Jun 19 01:54:00 2018 (r335356) @@ -707,54 +707,46 @@ tcp_tw_2msl_scan(int reuse) in_pcbref(inp); TW_RUNLOCK(V_tw_lock); - if (INP_INFO_TRY_RLOCK(&V_tcbinfo)) { - - INP_WLOCK(inp); - tw = intotw(inp); - if (in_pcbrele_wlocked(inp)) { - if (__predict_true(tw == NULL)) { - INP_INFO_RUNLOCK(&V_tcbinfo); - continue; - } else { - /* This should not happen as in TIMEWAIT - * state the inp should not be destroyed - * before its tcptw. If INVARIANTS is - * defined panic. - */ + INP_INFO_RLOCK(&V_tcbinfo); + INP_WLOCK(inp); + tw = intotw(inp); + if (in_pcbrele_wlocked(inp)) { + if (__predict_true(tw == NULL)) { + INP_INFO_RUNLOCK(&V_tcbinfo); + continue; + } else { + /* This should not happen as in TIMEWAIT + * state the inp should not be destroyed + * before its tcptw. If INVARIANTS is + * defined panic. + */ #ifdef INVARIANTS - panic("%s: Panic before an infinite " - "loop: INP_TIMEWAIT && (INP_FREED " - "|| inp last reference) && tw != " - "NULL", __func__); + panic("%s: Panic before an infinite " + "loop: INP_TIMEWAIT && (INP_FREED " + "|| inp last reference) && tw != " + "NULL", __func__); #else - log(LOG_ERR, "%s: Avoid an infinite " - "loop: INP_TIMEWAIT && (INP_FREED " - "|| inp last reference) && tw != " - "NULL", __func__); + log(LOG_ERR, "%s: Avoid an infinite " + "loop: INP_TIMEWAIT && (INP_FREED " + "|| inp last reference) && tw != " + "NULL", __func__); #endif - INP_INFO_RUNLOCK(&V_tcbinfo); - break; - } - } - - if (tw == NULL) { - /* tcp_twclose() has already been called */ - INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); - continue; + break; } + } - tcp_twclose(tw, reuse); + if (tw == NULL) { + /* tcp_twclose() has already been called */ + INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); - if (reuse) - return tw; - } else { - /* INP_INFO lock is busy, continue later. */ - INP_WLOCK(inp); - if (!in_pcbrele_wlocked(inp)) - INP_WUNLOCK(inp); - break; + continue; } + + tcp_twclose(tw, reuse); + INP_INFO_RUNLOCK(&V_tcbinfo); + if (reuse) + return tw; } return NULL; From owner-svn-src-all@freebsd.org Tue Jun 19 02:05:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1F481012D48; Tue, 19 Jun 2018 02:05:40 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5754582976; Tue, 19 Jun 2018 02:05:40 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io0-x242.google.com with SMTP id l25-v6so18626374ioh.12; Mon, 18 Jun 2018 19:05:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=D0jVkVt2WYgP0cW+j+tzHxUIadD3F7iw7XmlGZhIQh4=; b=Q273nOaR4UKTJ62tMBXBpBzAEYR/EVRpTQ3VEy96yci3FpxwDiXD0MjinxMFM0vzS5 W4W5oEvdol6N3hfmp+tWqRbkIAH22iWrPoQk/4DEEq16U6OuzM1RYx2edYYCQJ0awzET irkxKUMRkr4Ue+9GhH4UXd6scDLa4y7MDgckdqH7/CcZ0lZrSrhpS35cJ//aZEreNg2K Tm5gvIXlwJZ/LpHPXOGp9I60KE/D8f5BcckGFT9l4IQPruCMRUQpj2lQ4xaXLn4mkm63 rG/7CLUwZRW1nLWi6r6VQv21IVOWPVEcuQ25zU0MJUIn62IxDGcrVot9AnzKIeBNtuPU i+Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=D0jVkVt2WYgP0cW+j+tzHxUIadD3F7iw7XmlGZhIQh4=; b=FB3aWif8lY2JlwufGMWRHkem8MJ5+WJMtrUYvbCoPcnONDol2jSoyhTON9kSd9xLPa INHFKZawEXts8KTL07YcaluF+AZc1dzYcU/wNFR4tVrck8JZRPQMPTqULG9qox/fzC2U 136Mf9z6QrulRSu0gxz3Om8QEjHqPlaFgPRUsBGNkK6gFq+7i1zzipDZmXs47Qs+QQc0 otZHpvhWgRxdJr2Jk/d0ccJg/ZlQnc6KWrt6Z/CXZehUHSBT7LQYDBTEN76tZCRUBMCT ZhWgFkEgvoRi3Qasv3Pw05EjSuIzgqs6NnG7AVgoGdUHTgjOyCcLFhKnn3KzNmGl6o/o +cxw== X-Gm-Message-State: APt69E0IVVDO0rEPjBDPmYG1DyDLFOisNoyVUmYF1pzGpcHZwdmsldZn ArB9mG3VbaPavsM94HJxuOrUc57RnAefSYpseQ9ASw== X-Google-Smtp-Source: ADUXVKJTCMLHExMV9XwJQ4sMKM+aleUzoP7WKq12Lz7SQBfRtpQVnJpLgxgFpdbDE7j7gxnRhSwHGMrhLlELRsLjIZs= X-Received: by 2002:a6b:d00c:: with SMTP id x12-v6mr721784ioa.5.1529373939239; Mon, 18 Jun 2018 19:05:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 19:05:38 -0700 (PDT) In-Reply-To: <201806182012.w5IKCtQ7053689@repo.freebsd.org> References: <201806182012.w5IKCtQ7053689@repo.freebsd.org> From: Matthew Macy Date: Mon, 18 Jun 2018 19:05:38 -0700 Message-ID: Subject: Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv To: Eric Joyner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 02:05:41 -0000 This breaks universe / tinderbox on AMD64. You appear to have committed parts of a patch to ixlvc.c. I'm not quite clear on what happened here and if just removing the '+' will produce something usable. void ixlv_configure_queues(struct ixlv_sc *sc) { device_t dev = sc->dev; struct ixl_vsi *vsi = &sc->vsi; + if_softc_ctx_t scctx = iflib_get_softc_ctx(vsi->ctx); + struct ixl_tx_queue *tx_que = vsi->tx_queues; + struct ixl_rx_queue *rx_que = vsi->rx_queues; struct tx_ring *txr; struct rx_ring *rxr; int len, pairs; struct virtchnl_vsi_queue_config_info *vqci; struct virtchnl_queue_pair_info *vqpi; + /* XXX: Linux PF driver wants matching ids in each tx/rx struct, so both TX/RX + * queues of a pair need to be configured */ + pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); len = sizeof(struct virtchnl_vsi_queue_config_info) + (sizeof(struct virtchnl_queue_pair_info) * pairs); vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); if (!vqci) { device_printf(dev, "%s: unable to allocate memory\n", __func__); ixl_vc_schedule_retry(&sc->vc_mgr); return; } vqci->vsi_id = sc->vsi_res->vsi_id; vqci->num_queue_pairs = pairs; vqpi = vqci->qpair; /* Size check is not needed here - HW max is 16 queue pairs, and we * can fit info for 31 of them into the AQ buffer before it overflows. */ + for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) { + txr = &tx_que->txr; + rxr = &rx_que->rxr; + vqpi->txq.vsi_id = vqci->vsi_id; vqpi->txq.queue_id = i; + vqpi->txq.ring_len = scctx->isc_ntxd[0]; + vqpi->txq.dma_ring_addr = txr->tx_paddr; On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner wrote: > Author: erj > Date: Mon Jun 18 20:12:54 2018 > New Revision: 335338 > URL: https://svnweb.freebsd.org/changeset/base/335338 > > Log: > ixl(4): Update to use iflib > > Update the driver to use iflib in order to bring performance, > maintainability, and (hopefully) stability benefits to the driver. > > The driver currently isn't completely ported; features that are missing: > > - VF driver (ixlv) > - SR-IOV host support > - RDMA support > > The plan is to have these re-added to the driver before the next FreeBSD release. > > Reviewed by: gallatin@ > Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com > Tested by: jeffrey.e.pieper@intel.com > MFC after: 1 month > Sponsored by: Intel Corporation > Differential Revision: https://reviews.freebsd.org/D15577 > > Added: > head/sys/dev/ixl/ixl_debug.h (contents, props changed) > Modified: > head/sys/amd64/conf/GENERIC > head/sys/conf/files.amd64 > head/sys/dev/ixl/i40e_osdep.c > head/sys/dev/ixl/if_ixl.c > head/sys/dev/ixl/if_ixlv.c > head/sys/dev/ixl/ixl.h > head/sys/dev/ixl/ixl_pf.h > head/sys/dev/ixl/ixl_pf_i2c.c > head/sys/dev/ixl/ixl_pf_iov.c > head/sys/dev/ixl/ixl_pf_main.c > head/sys/dev/ixl/ixl_pf_qmgr.c > head/sys/dev/ixl/ixl_txrx.c > head/sys/dev/ixl/ixlv.h > head/sys/dev/ixl/ixlvc.c > head/sys/modules/Makefile > head/sys/modules/ixl/Makefile > head/sys/modules/ixlv/Makefile > > Modified: head/sys/amd64/conf/GENERIC > ============================================================================== > --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018 (r335337) > +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018 (r335338) > @@ -240,8 +240,8 @@ device em # Intel PRO/1000 Gigabit Ethernet Family > device ix # Intel PRO/10GbE PCIE PF Ethernet > device ixv # Intel PRO/10GbE PCIE VF Ethernet > device ixl # Intel XL710 40Gbe PCIE Ethernet > -options IXL_IW # Enable iWARP Client Interface in ixl(4) > -device ixlv # Intel XL710 40Gbe VF PCIE Ethernet > +#options IXL_IW # Enable iWARP Client Interface in ixl(4) > +#device ixlv # Intel XL710 40Gbe VF PCIE Ethernet > device le # AMD Am7900 LANCE and Am79C9xx PCnet > device ti # Alteon Networks Tigon I/II gigabit Ethernet > device txp # 3Com 3cR990 (``Typhoon'') > > Modified: head/sys/conf/files.amd64 > ============================================================================== > --- head/sys/conf/files.amd64 Mon Jun 18 19:53:11 2018 (r335337) > +++ head/sys/conf/files.amd64 Mon Jun 18 20:12:54 2018 (r335338) > @@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c optional ixl pci pci_iov \ > compile-with "${NORMAL_C} -I$S/dev/ixl" > dev/ixl/ixl_pf_i2c.c optional ixl pci \ > compile-with "${NORMAL_C} -I$S/dev/ixl" > -dev/ixl/ixl_iw.c optional ixl pci \ > - compile-with "${NORMAL_C} -I$S/dev/ixl" > -dev/ixl/if_ixlv.c optional ixlv pci \ > - compile-with "${NORMAL_C} -I$S/dev/ixl" > +#dev/ixl/ixl_iw.c optional ixl pci \ > +# compile-with "${NORMAL_C} -I$S/dev/ixl" > +#dev/ixl/if_ixlv.c optional ixlv pci \ > +# compile-with "${NORMAL_C} -I$S/dev/ixl" > dev/ixl/ixlvc.c optional ixlv pci \ > compile-with "${NORMAL_C} -I$S/dev/ixl" > dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ > > Modified: head/sys/dev/ixl/i40e_osdep.c > ============================================================================== > --- head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 19:53:11 2018 (r335337) > +++ head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:12:54 2018 (r335338) > @@ -132,7 +132,7 @@ i40e_free_dma_mem(struct i40e_hw *hw, struct i40e_dma_ > bus_dmamap_unload(mem->tag, mem->map); > bus_dmamem_free(mem->tag, mem->va, mem->map); > bus_dma_tag_destroy(mem->tag); > - return (0); > + return (I40E_SUCCESS); > } > > void > > Modified: head/sys/dev/ixl/if_ixl.c > ============================================================================== > --- head/sys/dev/ixl/if_ixl.c Mon Jun 18 19:53:11 2018 (r335337) > +++ head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:12:54 2018 (r335338) > @@ -51,60 +51,79 @@ > #define IXL_DRIVER_VERSION_MINOR 9 > #define IXL_DRIVER_VERSION_BUILD 9 > > -char ixl_driver_version[] = __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." > - __XSTRING(IXL_DRIVER_VERSION_MINOR) "." > - __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k"; > +#define IXL_DRIVER_VERSION_STRING \ > + __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ > + __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ > + __XSTRING(IXL_DRIVER_VERSION_BUILD) "-iflib-k" > > /********************************************************************* > * PCI Device ID Table > * > * Used by probe to select devices to load on > - * Last field stores an index into ixl_strings > - * Last entry must be all 0s > * > - * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } > + * ( Vendor ID, Device ID, Branding String ) > *********************************************************************/ > > -static ixl_vendor_info_t ixl_vendor_info_array[] = > +static pci_vendor_info_t ixl_vendor_info_array[] = > { > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, 0, 0, 0}, > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, 0, 0, 0}, > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) Ethernet Controller X710 for 10GbE SFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet Controller XL710 for 40GbE backplane"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, "Intel(R) Ethernet Controller X710 for 10GbE backplane"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, "Intel(R) Ethernet Controller XL710 for 40GbE QSFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, "Intel(R) Ethernet Controller XL710 for 40GbE QSFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, "Intel(R) Ethernet Controller X710 for 10GbE QSFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, "Intel(R) Ethernet Controller X710 for 10GBASE-T"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, "Intel(R) Ethernet Controller X710/X557-AT 10GBASE-T"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, "Intel(R) Ethernet Connection X722 for 10GbE backplane"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, "Intel(R) Ethernet Connection X722 for 10GbE QSFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, "Intel(R) Ethernet Connection X722 for 10GbE SFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, "Intel(R) Ethernet Connection X722 for 1GbE"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, "Intel(R) Ethernet Connection X722 for 10GBASE-T"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, "Intel(R) Ethernet Connection X722 for 10GbE SFP+"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, "Intel(R) Ethernet Controller XXV710 for 25GbE backplane"), > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, "Intel(R) Ethernet Controller XXV710 for 25GbE SFP28"), > /* required last entry */ > - {0, 0, 0, 0, 0} > + PVID_END > }; > > /********************************************************************* > - * Table of branding strings > - *********************************************************************/ > - > -static char *ixl_strings[] = { > - "Intel(R) Ethernet Connection 700 Series PF Driver" > -}; > - > - > -/********************************************************************* > * Function prototypes > *********************************************************************/ > -static int ixl_probe(device_t); > -static int ixl_attach(device_t); > -static int ixl_detach(device_t); > -static int ixl_shutdown(device_t); > +/*** IFLIB interface ***/ > +static void *ixl_register(device_t dev); > +static int ixl_if_attach_pre(if_ctx_t ctx); > +static int ixl_if_attach_post(if_ctx_t ctx); > +static int ixl_if_detach(if_ctx_t ctx); > +static int ixl_if_shutdown(if_ctx_t ctx); > +static int ixl_if_suspend(if_ctx_t ctx); > +static int ixl_if_resume(if_ctx_t ctx); > +static int ixl_if_msix_intr_assign(if_ctx_t ctx, int msix); > +static void ixl_if_enable_intr(if_ctx_t ctx); > +static void ixl_if_disable_intr(if_ctx_t ctx); > +static int ixl_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t rxqid); > +static int ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t txqid); > +static int ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int ntxqs, int ntxqsets); > +static int ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, uint64_t *paddrs, int nqs, int nqsets); > +static void ixl_if_queues_free(if_ctx_t ctx); > +static void ixl_if_update_admin_status(if_ctx_t ctx); > +static void ixl_if_multi_set(if_ctx_t ctx); > +static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); > +static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq *ifmr); > +static int ixl_if_media_change(if_ctx_t ctx); > +static int ixl_if_promisc_set(if_ctx_t ctx, int flags); > +static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); > +static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); > +static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); > +static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter cnt); > +static void ixl_if_vflr_handle(if_ctx_t ctx); > +// static void ixl_if_link_intr_enable(if_ctx_t ctx); > +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 int ixl_save_pf_tunables(struct ixl_pf *); > +/*** Other ***/ > +static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr *ifma, int); > +static void ixl_save_pf_tunables(struct ixl_pf *); > +static int ixl_allocate_pci_resources(struct ixl_pf *); > > /********************************************************************* > * FreeBSD Device Interface Entry Points > @@ -112,16 +131,17 @@ static int ixl_save_pf_tunables(struct ixl_pf *); > > static device_method_t ixl_methods[] = { > /* Device interface */ > - DEVMETHOD(device_probe, ixl_probe), > - DEVMETHOD(device_attach, ixl_attach), > - DEVMETHOD(device_detach, ixl_detach), > - DEVMETHOD(device_shutdown, ixl_shutdown), > + DEVMETHOD(device_register, ixl_register), > + DEVMETHOD(device_probe, iflib_device_probe), > + DEVMETHOD(device_attach, iflib_device_attach), > + DEVMETHOD(device_detach, iflib_device_detach), > + DEVMETHOD(device_shutdown, iflib_device_shutdown), > #ifdef PCI_IOV > DEVMETHOD(pci_iov_init, ixl_iov_init), > DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), > DEVMETHOD(pci_iov_add_vf, ixl_add_vf), > #endif > - {0, 0} > + DEVMETHOD_END > }; > > static driver_t ixl_driver = { > @@ -130,15 +150,52 @@ static driver_t ixl_driver = { > > devclass_t ixl_devclass; > DRIVER_MODULE(ixl, pci, ixl_driver, ixl_devclass, 0, 0); > +MODULE_VERSION(ixl, 3); > > -MODULE_VERSION(ixl, 1); > - > MODULE_DEPEND(ixl, pci, 1, 1, 1); > MODULE_DEPEND(ixl, ether, 1, 1, 1); > -#if defined(DEV_NETMAP) && __FreeBSD_version >= 1100000 > -MODULE_DEPEND(ixl, netmap, 1, 1, 1); > -#endif /* DEV_NETMAP */ > +MODULE_DEPEND(ixl, iflib, 1, 1, 1); > > +static device_method_t ixl_if_methods[] = { > + DEVMETHOD(ifdi_attach_pre, ixl_if_attach_pre), > + DEVMETHOD(ifdi_attach_post, ixl_if_attach_post), > + DEVMETHOD(ifdi_detach, ixl_if_detach), > + DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), > + DEVMETHOD(ifdi_suspend, ixl_if_suspend), > + DEVMETHOD(ifdi_resume, ixl_if_resume), > + DEVMETHOD(ifdi_init, ixl_if_init), > + DEVMETHOD(ifdi_stop, ixl_if_stop), > + DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), > + DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), > + DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), > + //DEVMETHOD(ifdi_link_intr_enable, ixl_if_link_intr_enable), > + DEVMETHOD(ifdi_rx_queue_intr_enable, ixl_if_rx_queue_intr_enable), > + DEVMETHOD(ifdi_tx_queue_intr_enable, ixl_if_tx_queue_intr_enable), > + DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), > + DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), > + DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), > + DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), > + DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), > + DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), > + DEVMETHOD(ifdi_media_status, ixl_if_media_status), > + DEVMETHOD(ifdi_media_change, ixl_if_media_change), > + DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), > + DEVMETHOD(ifdi_timer, ixl_if_timer), > + DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), > + DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), > + DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), > + DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), > + DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), > + DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), > + // ifdi_led_func > + // ifdi_debug > + DEVMETHOD_END > +}; > + > +static driver_t ixl_if_driver = { > + "ixl_if", ixl_if_methods, sizeof(struct ixl_pf) > +}; > + > /* > ** TUNEABLE PARAMETERS: > */ > @@ -147,39 +204,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, 0, > "IXL driver parameters"); > > /* > - * MSIX should be the default for best performance, > - * but this allows it to be forced off for testing. > - */ > -static int ixl_enable_msix = 1; > -TUNABLE_INT("hw.ixl.enable_msix", &ixl_enable_msix); > -SYSCTL_INT(_hw_ixl, OID_AUTO, enable_msix, CTLFLAG_RDTUN, &ixl_enable_msix, 0, > - "Enable MSI-X interrupts"); > - > -/* > -** Number of descriptors per ring > -** - TX and RX sizes are independently configurable > -*/ > -static int ixl_tx_ring_size = IXL_DEFAULT_RING; > -TUNABLE_INT("hw.ixl.tx_ring_size", &ixl_tx_ring_size); > -SYSCTL_INT(_hw_ixl, OID_AUTO, tx_ring_size, CTLFLAG_RDTUN, > - &ixl_tx_ring_size, 0, "TX Descriptor Ring Size"); > - > -static int ixl_rx_ring_size = IXL_DEFAULT_RING; > -TUNABLE_INT("hw.ixl.rx_ring_size", &ixl_rx_ring_size); > -SYSCTL_INT(_hw_ixl, OID_AUTO, rx_ring_size, CTLFLAG_RDTUN, > - &ixl_rx_ring_size, 0, "RX Descriptor Ring Size"); > - > -/* > -** This can be set manually, if left as 0 the > -** number of queues will be calculated based > -** on cpus and msix vectors available. > -*/ > -static int ixl_max_queues = 0; > -TUNABLE_INT("hw.ixl.max_queues", &ixl_max_queues); > -SYSCTL_INT(_hw_ixl, OID_AUTO, max_queues, CTLFLAG_RDTUN, > - &ixl_max_queues, 0, "Number of Queues"); > - > -/* > * Leave this on unless you need to send flow control > * frames (or other control frames) from software > */ > @@ -190,6 +214,13 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, CTL > &ixl_enable_tx_fc_filter, 0, > "Filter out packets with Ethertype 0x8808 from being sent out by non-HW sources"); > > +static int ixl_i2c_access_method = 0; > +TUNABLE_INT("hw.ixl.i2c_access_method", > + &ixl_i2c_access_method); > +SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, > + &ixl_i2c_access_method, 0, > + IXL_SYSCTL_HELP_I2C_METHOD); > + > /* > * Different method for processing TX descriptor > * completion. > @@ -215,20 +246,22 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, shared_debug_mask, CTLFL > &ixl_shared_debug_mask, 0, > "Display debug statements that are printed in shared code"); > > +#if 0 > /* > ** Controls for Interrupt Throttling > ** - true/false for dynamic adjustment > ** - default values for static ITR > */ > -static int ixl_dynamic_rx_itr = 1; > +static int ixl_dynamic_rx_itr = 0; > TUNABLE_INT("hw.ixl.dynamic_rx_itr", &ixl_dynamic_rx_itr); > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_rx_itr, CTLFLAG_RDTUN, > &ixl_dynamic_rx_itr, 0, "Dynamic RX Interrupt Rate"); > > -static int ixl_dynamic_tx_itr = 1; > +static int ixl_dynamic_tx_itr = 0; > TUNABLE_INT("hw.ixl.dynamic_tx_itr", &ixl_dynamic_tx_itr); > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_tx_itr, CTLFLAG_RDTUN, > &ixl_dynamic_tx_itr, 0, "Dynamic TX Interrupt Rate"); > +#endif > > static int ixl_rx_itr = IXL_ITR_8K; > TUNABLE_INT("hw.ixl.rx_itr", &ixl_rx_itr); > @@ -256,165 +289,131 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, CTLFLA > &ixl_limit_iwarp_msix, 0, "Limit MSIX vectors assigned to iWARP"); > #endif > > -#ifdef DEV_NETMAP > -#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ > -#include > -#endif /* DEV_NETMAP */ > +extern struct if_txrx ixl_txrx_hwb; > +extern struct if_txrx ixl_txrx_dwb; > > -/********************************************************************* > - * Device identification routine > - * > - * ixl_probe determines if the driver should be loaded on > - * the hardware based on PCI vendor/device id of the device. > - * > - * return BUS_PROBE_DEFAULT on success, positive on failure > - *********************************************************************/ > +static struct if_shared_ctx ixl_sctx_init = { > + .isc_magic = IFLIB_MAGIC, > + .isc_q_align = PAGE_SIZE, > + .isc_tx_maxsize = IXL_TSO_SIZE, > + .isc_tx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, > > -static int > -ixl_probe(device_t dev) > -{ > - ixl_vendor_info_t *ent; > + .isc_rx_maxsize = 16384, > + .isc_rx_nsegments = IXL_MAX_RX_SEGS, > + .isc_rx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, > + .isc_nfl = 1, > + .isc_ntxqs = 1, > + .isc_nrxqs = 1, > > - u16 pci_vendor_id, pci_device_id; > - u16 pci_subvendor_id, pci_subdevice_id; > - char device_name[256]; > + .isc_admin_intrcnt = 1, > + .isc_vendor_info = ixl_vendor_info_array, > + .isc_driver_version = IXL_DRIVER_VERSION_STRING, > + .isc_driver = &ixl_if_driver, > + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | IFLIB_ADMIN_ALWAYS_RUN, > > -#if 0 > - INIT_DEBUGOUT("ixl_probe: begin"); > -#endif > - pci_vendor_id = pci_get_vendor(dev); > - if (pci_vendor_id != I40E_INTEL_VENDOR_ID) > - return (ENXIO); > + .isc_nrxd_min = {IXL_MIN_RING}, > + .isc_ntxd_min = {IXL_MIN_RING}, > + .isc_nrxd_max = {IXL_MAX_RING}, > + .isc_ntxd_max = {IXL_MAX_RING}, > + .isc_nrxd_default = {IXL_DEFAULT_RING}, > + .isc_ntxd_default = {IXL_DEFAULT_RING}, > +}; > > - pci_device_id = pci_get_device(dev); > - pci_subvendor_id = pci_get_subvendor(dev); > - pci_subdevice_id = pci_get_subdevice(dev); > +if_shared_ctx_t ixl_sctx = &ixl_sctx_init; > > - ent = ixl_vendor_info_array; > - while (ent->vendor_id != 0) { > - if ((pci_vendor_id == ent->vendor_id) && > - (pci_device_id == ent->device_id) && > - > - ((pci_subvendor_id == ent->subvendor_id) || > - (ent->subvendor_id == 0)) && > - > - ((pci_subdevice_id == ent->subdevice_id) || > - (ent->subdevice_id == 0))) { > - sprintf(device_name, "%s, Version - %s", > - ixl_strings[ent->index], > - ixl_driver_version); > - device_set_desc_copy(dev, device_name); > - return (BUS_PROBE_DEFAULT); > - } > - ent++; > - } > - return (ENXIO); > +/*** Functions ***/ > +static void * > +ixl_register(device_t dev) > +{ > + return (ixl_sctx); > } > > -/* > - * Sanity check and save off tunable values. > - */ > static int > -ixl_save_pf_tunables(struct ixl_pf *pf) > +ixl_allocate_pci_resources(struct ixl_pf *pf) > { > - device_t dev = pf->dev; > + int rid; > + struct i40e_hw *hw = &pf->hw; > + device_t dev = iflib_get_dev(pf->vsi.ctx); > > - /* Save tunable information */ > - pf->enable_msix = ixl_enable_msix; > - pf->max_queues = ixl_max_queues; > - pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; > - pf->dynamic_rx_itr = ixl_dynamic_rx_itr; > - pf->dynamic_tx_itr = ixl_dynamic_tx_itr; > - pf->dbg_mask = ixl_core_debug_mask; > - pf->hw.debug_mask = ixl_shared_debug_mask; > -#ifdef DEV_NETMAP > - if (ixl_enable_head_writeback == 0) > - device_printf(dev, "Head writeback mode cannot be disabled " > - "when netmap is enabled\n"); > - pf->vsi.enable_head_writeback = 1; > -#else > - pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); > -#endif > + /* Map BAR0 */ > + rid = PCIR_BAR(0); > + pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, > + &rid, RF_ACTIVE); > + > + if (!(pf->pci_mem)) { > + device_printf(dev, "Unable to allocate bus resource: PCI memory\n"); > + return (ENXIO); > + } > > - ixl_vsi_setup_rings_size(&pf->vsi, ixl_tx_ring_size, ixl_rx_ring_size); > + /* Save off the PCI information */ > + hw->vendor_id = pci_get_vendor(dev); > + hw->device_id = pci_get_device(dev); > + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); > + hw->subsystem_vendor_id = > + pci_read_config(dev, PCIR_SUBVEND_0, 2); > + hw->subsystem_device_id = > + pci_read_config(dev, PCIR_SUBDEV_0, 2); > > - if (ixl_tx_itr < 0 || ixl_tx_itr > IXL_MAX_ITR) { > - device_printf(dev, "Invalid tx_itr value of %d set!\n", > - ixl_tx_itr); > - device_printf(dev, "tx_itr must be between %d and %d, " > - "inclusive\n", > - 0, IXL_MAX_ITR); > - device_printf(dev, "Using default value of %d instead\n", > - IXL_ITR_4K); > - pf->tx_itr = IXL_ITR_4K; > - } else > - pf->tx_itr = ixl_tx_itr; > + hw->bus.device = pci_get_slot(dev); > + hw->bus.func = pci_get_function(dev); > > - if (ixl_rx_itr < 0 || ixl_rx_itr > IXL_MAX_ITR) { > - device_printf(dev, "Invalid rx_itr value of %d set!\n", > - ixl_rx_itr); > - device_printf(dev, "rx_itr must be between %d and %d, " > - "inclusive\n", > - 0, IXL_MAX_ITR); > - device_printf(dev, "Using default value of %d instead\n", > - IXL_ITR_8K); > - pf->rx_itr = IXL_ITR_8K; > - } else > - pf->rx_itr = ixl_rx_itr; > + /* Save off register access information */ > + pf->osdep.mem_bus_space_tag = > + rman_get_bustag(pf->pci_mem); > + pf->osdep.mem_bus_space_handle = > + rman_get_bushandle(pf->pci_mem); > + pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); > + pf->osdep.flush_reg = I40E_GLGEN_STAT; > + pf->osdep.dev = dev; > > - return (0); > -} > + pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; > + pf->hw.back = &pf->osdep; > + > + return (0); > + } > > -/********************************************************************* > - * Device initialization routine > - * > - * The attach entry point is called when the driver is being loaded. > - * This routine identifies the type of hardware, allocates all resources > - * and initializes the hardware. > - * > - * return 0 on success, positive on failure > - *********************************************************************/ > - > static int > -ixl_attach(device_t dev) > +ixl_if_attach_pre(if_ctx_t ctx) > { > - struct ixl_pf *pf; > - struct i40e_hw *hw; > - struct ixl_vsi *vsi; > + device_t dev; > + struct ixl_pf *pf; > + struct i40e_hw *hw; > + struct ixl_vsi *vsi; > + if_softc_ctx_t scctx; > + struct i40e_filter_control_settings filter; > enum i40e_status_code status; > - int error = 0; > + int error = 0; > > - INIT_DEBUGOUT("ixl_attach: begin"); > + INIT_DEBUGOUT("ixl_if_attach_pre: begin"); > > /* Allocate, clear, and link in our primary soft structure */ > - pf = device_get_softc(dev); > - pf->dev = pf->osdep.dev = dev; > + dev = iflib_get_dev(ctx); > + pf = iflib_get_softc(ctx); > + vsi = &pf->vsi; > + vsi->back = pf; > + pf->dev = dev; > hw = &pf->hw; > > /* > ** Note this assumes we have a single embedded VSI, > ** this could be enhanced later to allocate multiple > */ > - vsi = &pf->vsi; > - vsi->dev = pf->dev; > - vsi->back = pf; > + //vsi->dev = pf->dev; > + vsi->hw = &pf->hw; > + vsi->id = 0; > + vsi->num_vlans = 0; > + vsi->ctx = ctx; > + vsi->media = iflib_get_media(ctx); > + vsi->shared = scctx = iflib_get_softc_ctx(ctx); > > /* Save tunable values */ > - error = ixl_save_pf_tunables(pf); > - if (error) > - return (error); > + ixl_save_pf_tunables(pf); > > - /* Core Lock Init*/ > - IXL_PF_LOCK_INIT(pf, device_get_nameunit(dev)); > - > - /* Set up the timer callout */ > - callout_init_mtx(&pf->timer, &pf->pf_mtx, 0); > - > /* Do PCI setup - map BAR0, etc */ > if (ixl_allocate_pci_resources(pf)) { > device_printf(dev, "Allocation of PCI resources failed\n"); > error = ENXIO; > - goto err_out; > + goto err_pci_res; > } > > /* Establish a clean starting point */ > @@ -478,16 +477,11 @@ ixl_attach(device_t dev) > /* Get capabilities from the device */ > error = ixl_get_hw_capabilities(pf); > if (error) { > - device_printf(dev, "HW capabilities failure!\n"); > + device_printf(dev, "get_hw_capabilities failed: %d\n", > + error); > goto err_get_cap; > } > > - /* > - * Allocate interrupts and figure out number of queues to use > - * for PF interface > - */ > - pf->msix = ixl_init_msix(pf); > - > /* Set up host memory cache */ > status = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, > hw->func_caps.num_rx_qp, 0, 0); > @@ -496,7 +490,6 @@ ixl_attach(device_t dev) > i40e_stat_str(hw, status)); > goto err_get_cap; > } > - > status = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); > if (status) { > device_printf(dev, "configure_lan_hmc failed: %s\n", > @@ -504,23 +497,6 @@ ixl_attach(device_t dev) > goto err_mac_hmc; > } > > - /* Init queue allocation manager */ > - error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); > - if (error) { > - device_printf(dev, "Failed to init queue manager for PF queues, error %d\n", > - error); > - goto err_mac_hmc; > - } > - /* reserve a contiguous allocation for the PF's VSI */ > - error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, vsi->num_queues, &pf->qtag); > - if (error) { > - device_printf(dev, "Failed to reserve queues for PF LAN VSI, error %d\n", > - error); > - goto err_mac_hmc; > - } > - device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", > - pf->qtag.num_allocated, pf->qtag.num_active); > - > /* Disable LLDP from the firmware for certain NVM versions */ > if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) || > (pf->hw.aq.fw_maj_ver < 4)) { > @@ -536,46 +512,120 @@ ixl_attach(device_t dev) > goto err_mac_hmc; > } > bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); > + iflib_set_mac(ctx, hw->mac.addr); > i40e_get_port_mac_addr(hw, hw->mac.port_addr); > > + /* Set up the device filtering */ > + bzero(&filter, sizeof(filter)); > + filter.enable_ethtype = TRUE; > + filter.enable_macvlan = TRUE; > + filter.enable_fdir = FALSE; > + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; > + if (i40e_set_filter_control(hw, &filter)) > + device_printf(dev, "i40e_set_filter_control() failed\n"); > + > /* Query device FW LLDP status */ > ixl_get_fw_lldp_status(pf); > /* Tell FW to apply DCB config on link up */ > - if ((hw->mac.type != I40E_MAC_X722) > - && ((pf->hw.aq.api_maj_ver > 1) > - || (pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver >= 7))) > - i40e_aq_set_dcb_parameters(hw, true, NULL); > + i40e_aq_set_dcb_parameters(hw, true, NULL); > > - /* Initialize mac filter list for VSI */ > - SLIST_INIT(&vsi->ftl); > - > - /* Set up SW VSI and allocate queue memory and rings */ > - if (ixl_setup_stations(pf)) { > - device_printf(dev, "setup stations failed!\n"); > - error = ENOMEM; > - goto err_mac_hmc; > + /* Fill out iflib parameters */ > + if (hw->mac.type == I40E_MAC_X722) > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 128; > + else > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 64; > + if (vsi->enable_head_writeback) { > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] > + * sizeof(struct i40e_tx_desc) + sizeof(u32), DBA_ALIGN); > + scctx->isc_txrx = &ixl_txrx_hwb; > + } else { > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] > + * sizeof(struct i40e_tx_desc), DBA_ALIGN); > + scctx->isc_txrx = &ixl_txrx_dwb; > } > + scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] > + * sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); > + scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); > + scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; > + scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; > + scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; > + scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; > + scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; > + scctx->isc_tx_csum_flags = CSUM_OFFLOAD; > + scctx->isc_capenable = IXL_CAPS; > > + INIT_DEBUGOUT("ixl_if_attach_pre: end"); > + return (0); > + > +err_mac_hmc: > + i40e_shutdown_lan_hmc(hw); > +err_get_cap: > + i40e_shutdown_adminq(hw); > +err_out: > + ixl_free_pci_resources(pf); > +err_pci_res: > + return (error); > +} > + > +static int > +ixl_if_attach_post(if_ctx_t ctx) > +{ > + device_t dev; > + struct ixl_pf *pf; > + struct i40e_hw *hw; > + struct ixl_vsi *vsi; > + int error = 0; > + enum i40e_status_code status; > + > + INIT_DEBUGOUT("ixl_if_attach_post: begin"); > + > + dev = iflib_get_dev(ctx); > + pf = iflib_get_softc(ctx); > + vsi = &pf->vsi; > + vsi->ifp = iflib_get_ifp(ctx); > + hw = &pf->hw; > + > /* Setup OS network interface / ifnet */ > - if (ixl_setup_interface(dev, vsi)) { > + if (ixl_setup_interface(dev, pf)) { > device_printf(dev, "interface setup failed!\n"); > error = EIO; > - goto err_late; > + goto err; > } > > /* Determine link state */ > if (ixl_attach_get_link_status(pf)) { > error = EINVAL; > - goto err_late; > + goto err; > } > > error = ixl_switch_config(pf); > if (error) { > device_printf(dev, "Initial ixl_switch_config() failed: %d\n", > error); > - goto err_late; > + goto err; > } > > + /* Add protocol filters to list */ > + ixl_init_filters(vsi); > + > + /* Init queue allocation manager */ > + error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); > + if (error) { > + device_printf(dev, "Failed to init queue manager for PF queues, error %d\n", > + error); > + goto err; > + } > + /* reserve a contiguous allocation for the PF's VSI */ > + error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, > + max(vsi->num_rx_queues, vsi->num_tx_queues), &pf->qtag); > + if (error) { > + device_printf(dev, "Failed to reserve queues for PF LAN VSI, error %d\n", > + error); > + goto err; > + } > + device_printf(dev, "Allocating %d queues for PF LAN VSI; %d queues active\n", > + pf->qtag.num_allocated, pf->qtag.num_active); > + > /* Limit PHY interrupts to link, autoneg, and modules failure */ > status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, > NULL); > @@ -583,91 +633,35 @@ ixl_attach(device_t dev) > device_printf(dev, "i40e_aq_set_phy_mask() failed: err %s," > " aq_err %s\n", i40e_stat_str(hw, status), > i40e_aq_str(hw, hw->aq.asq_last_status)); > - goto err_late; > + goto err; > } > > - /* Get the bus configuration and set the shared code's config */ > + /* Get the bus configuration and set the shared code */ > ixl_get_bus_info(pf); > > - /* > - * In MSI-X mode, initialize the Admin Queue interrupt, > - * so userland tools can communicate with the adapter regardless of > - * the ifnet interface's status. > - */ > - if (pf->msix > 1) { > - error = ixl_setup_adminq_msix(pf); > - if (error) { > - device_printf(dev, "ixl_setup_adminq_msix() error: %d\n", > - error); > - goto err_late; > - } > - error = ixl_setup_adminq_tq(pf); > - if (error) { > - device_printf(dev, "ixl_setup_adminq_tq() error: %d\n", > - error); > - goto err_late; > - } > - ixl_configure_intr0_msix(pf); > - ixl_enable_intr0(hw); > - > - error = ixl_setup_queue_msix(vsi); > - if (error) > - device_printf(dev, "ixl_setup_queue_msix() error: %d\n", > - error); > - error = ixl_setup_queue_tqs(vsi); > - if (error) > - device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", > - error); > - } else { > - error = ixl_setup_legacy(pf); > - > - error = ixl_setup_adminq_tq(pf); > - if (error) { > - device_printf(dev, "ixl_setup_adminq_tq() error: %d\n", > - error); > - goto err_late; > - } > - > - error = ixl_setup_queue_tqs(vsi); > - if (error) > - device_printf(dev, "ixl_setup_queue_tqs() error: %d\n", > - error); > + /* Keep admin queue interrupts active while driver is loaded */ > + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { > + ixl_configure_intr0_msix(pf); > + ixl_enable_intr0(hw); > } > > - if (error) { > - device_printf(dev, "interrupt setup error: %d\n", error); > - } > - > /* Set initial advertised speed sysctl value */ > ixl_set_initial_advertised_speeds(pf); > > /* Initialize statistics & add sysctls */ > ixl_add_device_sysctls(pf); > - > ixl_pf_reset_stats(pf); > ixl_update_stats_counters(pf); > ixl_add_hw_stats(pf); > > - /* Register for VLAN events */ > - vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, > - ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); > - vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, > - ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); > + hw->phy.get_link_info = true; > + i40e_get_link_status(hw, &pf->link_up); > + ixl_update_link_status(pf); > > #ifdef PCI_IOV > ixl_initialize_sriov(pf); > #endif > > -#ifdef DEV_NETMAP > - if (vsi->num_rx_desc == vsi->num_tx_desc) { > - vsi->queues[0].num_desc = vsi->num_rx_desc; > - ixl_netmap_attach(vsi); > - } else > - device_printf(dev, > - "Netmap is not supported when RX and TX descriptor ring sizes differ\n"); > - > -#endif /* DEV_NETMAP */ > - > #ifdef IXL_IW > if (hw->func_caps.iwarp && ixl_enable_iwarp) { > pf->iw_enabled = (pf->iw_msix > 0) ? true : false; > @@ -677,7 +671,7 @@ ixl_attach(device_t dev) > device_printf(dev, > "interfacing to iwarp driver failed: %d\n", > error); > - goto err_late; > + goto err; > } else > device_printf(dev, "iWARP ready\n"); > } else > @@ -689,54 +683,38 @@ ixl_attach(device_t dev) > } > #endif > > - INIT_DEBUGOUT("ixl_attach: end"); > + INIT_DBG_DEV(dev, "end"); > return (0); > > -err_late: > - if (vsi->ifp != NULL) { > - ether_ifdetach(vsi->ifp); > - if_free(vsi->ifp); > - } > -err_mac_hmc: > - i40e_shutdown_lan_hmc(hw); > -err_get_cap: > - i40e_shutdown_adminq(hw); > -err_out: > - ixl_free_pci_resources(pf); > - ixl_free_vsi(vsi); > - IXL_PF_LOCK_DESTROY(pf); > +err: > + INIT_DEBUGOUT("end: error %d", error); > + /* ixl_if_detach() is called on error from this */ > return (error); > } > > -/********************************************************************* > - * Device removal routine > - * > - * The detach entry point is called when the driver is being removed. > - * This routine stops the adapter and deallocates all the resources > - * that were allocated for driver operation. > - * > - * return 0 on success, positive on failure > - *********************************************************************/ > - > static int > -ixl_detach(device_t dev) > +ixl_if_detach(if_ctx_t ctx) > { > - struct ixl_pf *pf = device_get_softc(dev); > - struct i40e_hw *hw = &pf->hw; > - struct ixl_vsi *vsi = &pf->vsi; > + struct ixl_pf *pf = iflib_get_softc(ctx); > + struct ixl_vsi *vsi = &pf->vsi; > + struct i40e_hw *hw = &pf->hw; > + device_t dev = pf->dev; > enum i40e_status_code status; > #if defined(PCI_IOV) || defined(IXL_IW) > int error; > #endif > > - INIT_DEBUGOUT("ixl_detach: begin"); > + INIT_DBG_DEV(dev, "begin"); > > - /* Make sure VLANS are not using driver */ > - if (vsi->ifp->if_vlantrunk != NULL) { > - device_printf(dev, "Vlan in use, detach first\n"); > - return (EBUSY); > +#ifdef IXL_IW > + if (ixl_enable_iwarp && pf->iw_enabled) { > + error = ixl_iw_pf_detach(pf); > + if (error == EBUSY) { > + device_printf(dev, "iwarp in use; stop it first.\n"); > + return (error); > + } > } > - > +#endif > #ifdef PCI_IOV > error = pci_iov_detach(dev); > if (error != 0) { > @@ -744,73 +722,989 @@ ixl_detach(device_t dev) > return (error); > } > #endif > - > /* Remove all previously allocated media types */ > - ifmedia_removeall(&vsi->media); > + ifmedia_removeall(vsi->media); > > - ether_ifdetach(vsi->ifp); > - if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) > - ixl_stop(pf); > - > /* Shutdown LAN HMC */ > - status = i40e_shutdown_lan_hmc(hw); > - if (status) > - device_printf(dev, > - "Shutdown LAN HMC failed with code %d\n", status); > + if (hw->hmc.hmc_obj) { > + status = i40e_shutdown_lan_hmc(hw); > + if (status) > + device_printf(dev, > + "i40e_shutdown_lan_hmc() failed with status %s\n", > + i40e_stat_str(hw, status)); > + } > > - /* Teardown LAN queue resources */ > - ixl_teardown_queue_msix(vsi); > - ixl_free_queue_tqs(vsi); > /* Shutdown admin queue */ > ixl_disable_intr0(hw); > - ixl_teardown_adminq_msix(pf); > - ixl_free_adminq_tq(pf); > status = i40e_shutdown_adminq(hw); > if (status) > device_printf(dev, > - "Shutdown Admin queue failed with code %d\n", status); > + "i40e_shutdown_adminq() failed with status %s\n", > + i40e_stat_str(hw, status)); > > - /* Unregister VLAN events */ > - if (vsi->vlan_attach != NULL) > - EVENTHANDLER_DEREGISTER(vlan_config, vsi->vlan_attach); > - if (vsi->vlan_detach != NULL) > - EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); > + ixl_pf_qmgr_destroy(&pf->qmgr); > + ixl_free_pci_resources(pf); > + ixl_free_mac_filters(vsi); > + INIT_DBG_DEV(dev, "end"); > + return (0); > +} > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > From owner-svn-src-all@freebsd.org Tue Jun 19 02:38:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1123F1015AD4 for ; Tue, 19 Jun 2018 02:38:51 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90FB5846A6 for ; Tue, 19 Jun 2018 02:38:50 +0000 (UTC) (envelope-from ricera10@gmail.com) Received: by mail-it0-f43.google.com with SMTP id v83-v6so15027960itc.3 for ; Mon, 18 Jun 2018 19:38:50 -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=j/DBPGUbSqv8U4/NT4+I+2Gr7PNbnGxjUGHH1lvgI94=; b=BLBk5ATm1JkfqaDj1VBeLEIuYxBNv4G7feuRKdla9iv4KG2MvkTqT7V7yxdzV2XTpa /LiwJ1r+VJ0LOoKPqJWcWvNvIEHjzKAIaHZ2JlqQsn+axuKb41qfoh+3wmH+ms16f0Uh 2+nOTsevFyhy2L4rv49/8fVXQ3LBBsiauvS7mFnVfdvTk3u6NC7ME7PkGzYH65qMZQ8X teaoPK0am1cMfr0YB4bNeCzmr9Z4IfLFp4PSwnx6wS4qpYiTadxU8S996rG6psLuuoxG c/B/PZjeBXJmOaTmt2+jZWErk0fng/mqcq8fQisKYz/PdR+xSuoANWkizLezooNfw/Vw yDVQ== X-Gm-Message-State: APt69E1ftGPdEYx/G/BMPF/SHKGlsq3cJbxMs7czC8bsq9kJFFJZpIzf HpuRuk16l56BflnRK85Qcb0YLTQ6 X-Google-Smtp-Source: ADUXVKJTWS0gRDGTt7s3ygAGWoSadlGAhNNA7iMUOl3SrGGTWDZwQbCd5aaB5+FkxRm8vrfEXFCl6Q== X-Received: by 2002:a02:6001:: with SMTP id i1-v6mr12255456jac.5.1529375923466; Mon, 18 Jun 2018 19:38:43 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id h81-v6sm5884011ith.2.2018.06.18.19.38.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jun 2018 19:38:42 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id 76-v6so15047737itx.4 for ; Mon, 18 Jun 2018 19:38:42 -0700 (PDT) X-Received: by 2002:a02:8aec:: with SMTP id i41-v6mr12333811jal.33.1529375922176; Mon, 18 Jun 2018 19:38:42 -0700 (PDT) MIME-Version: 1.0 References: <201806182012.w5IKCtQ7053689@repo.freebsd.org> In-Reply-To: From: Eric Joyner Date: Mon, 18 Jun 2018 19:38:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv To: mat.macy@gmail.com Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 02:38:52 -0000 It probably won't result in anything usable. I need to remove ixlvc.c from the build since the VF driver as a whole doesn't work atm. - Eric On Mon, Jun 18, 2018 at 7:05 PM Matthew Macy wrote: > This breaks universe / tinderbox on AMD64. You appear to have > committed parts of a patch to ixlvc.c. I'm not quite clear on what > happened here and if just removing the '+' will produce something > usable. > > > > void > ixlv_configure_queues(struct ixlv_sc *sc) > { > device_t dev = sc->dev; > struct ixl_vsi *vsi = &sc->vsi; > + if_softc_ctx_t scctx = iflib_get_softc_ctx(vsi->ctx); > + struct ixl_tx_queue *tx_que = vsi->tx_queues; > + struct ixl_rx_queue *rx_que = vsi->rx_queues; > struct tx_ring *txr; > struct rx_ring *rxr; > int len, pairs; > > struct virtchnl_vsi_queue_config_info *vqci; > struct virtchnl_queue_pair_info *vqpi; > > + /* XXX: Linux PF driver wants matching ids in each tx/rx struct, > so both TX/RX > + * queues of a pair need to be configured */ > + pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); > len = sizeof(struct virtchnl_vsi_queue_config_info) + > (sizeof(struct virtchnl_queue_pair_info) * pairs); > vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); > if (!vqci) { > device_printf(dev, "%s: unable to allocate memory\n", __func__); > ixl_vc_schedule_retry(&sc->vc_mgr); > return; > } > vqci->vsi_id = sc->vsi_res->vsi_id; > vqci->num_queue_pairs = pairs; > vqpi = vqci->qpair; > /* Size check is not needed here - HW max is 16 queue pairs, and we > * can fit info for 31 of them into the AQ buffer before it overflows. > */ > + for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) { > + txr = &tx_que->txr; > + rxr = &rx_que->rxr; > + > vqpi->txq.vsi_id = vqci->vsi_id; > vqpi->txq.queue_id = i; > + vqpi->txq.ring_len = scctx->isc_ntxd[0]; > + vqpi->txq.dma_ring_addr = txr->tx_paddr; > > On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner wrote: > > Author: erj > > Date: Mon Jun 18 20:12:54 2018 > > New Revision: 335338 > > URL: https://svnweb.freebsd.org/changeset/base/335338 > > > > Log: > > ixl(4): Update to use iflib > > > > Update the driver to use iflib in order to bring performance, > > maintainability, and (hopefully) stability benefits to the driver. > > > > The driver currently isn't completely ported; features that are > missing: > > > > - VF driver (ixlv) > > - SR-IOV host support > > - RDMA support > > > > The plan is to have these re-added to the driver before the next > FreeBSD release. > > > > Reviewed by: gallatin@ > > Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com > > Tested by: jeffrey.e.pieper@intel.com > > MFC after: 1 month > > Sponsored by: Intel Corporation > > Differential Revision: https://reviews.freebsd.org/D15577 > > > > Added: > > head/sys/dev/ixl/ixl_debug.h (contents, props changed) > > Modified: > > head/sys/amd64/conf/GENERIC > > head/sys/conf/files.amd64 > > head/sys/dev/ixl/i40e_osdep.c > > head/sys/dev/ixl/if_ixl.c > > head/sys/dev/ixl/if_ixlv.c > > head/sys/dev/ixl/ixl.h > > head/sys/dev/ixl/ixl_pf.h > > head/sys/dev/ixl/ixl_pf_i2c.c > > head/sys/dev/ixl/ixl_pf_iov.c > > head/sys/dev/ixl/ixl_pf_main.c > > head/sys/dev/ixl/ixl_pf_qmgr.c > > head/sys/dev/ixl/ixl_txrx.c > > head/sys/dev/ixl/ixlv.h > > head/sys/dev/ixl/ixlvc.c > > head/sys/modules/Makefile > > head/sys/modules/ixl/Makefile > > head/sys/modules/ixlv/Makefile > > > > Modified: head/sys/amd64/conf/GENERIC > > > ============================================================================== > > --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018 (r335337) > > +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018 (r335338) > > @@ -240,8 +240,8 @@ device em # Intel > PRO/1000 Gigabit Ethernet Family > > device ix # Intel PRO/10GbE PCIE PF > Ethernet > > device ixv # Intel PRO/10GbE PCIE VF > Ethernet > > device ixl # Intel XL710 40Gbe PCIE Ethernet > > -options IXL_IW # Enable iWARP Client > Interface in ixl(4) > > -device ixlv # Intel XL710 40Gbe VF PCIE > Ethernet > > +#options IXL_IW # Enable iWARP Client > Interface in ixl(4) > > +#device ixlv # Intel XL710 40Gbe VF > PCIE Ethernet > > device le # AMD Am7900 LANCE and Am79C9xx > PCnet > > device ti # Alteon Networks Tigon I/II > gigabit Ethernet > > device txp # 3Com 3cR990 (``Typhoon'') > > > > Modified: head/sys/conf/files.amd64 > > > ============================================================================== > > --- head/sys/conf/files.amd64 Mon Jun 18 19:53:11 2018 (r335337) > > +++ head/sys/conf/files.amd64 Mon Jun 18 20:12:54 2018 (r335338) > > @@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c optional > ixl pci pci_iov \ > > compile-with "${NORMAL_C} -I$S/dev/ixl" > > dev/ixl/ixl_pf_i2c.c optional ixl pci \ > > compile-with "${NORMAL_C} -I$S/dev/ixl" > > -dev/ixl/ixl_iw.c optional ixl pci \ > > - compile-with "${NORMAL_C} -I$S/dev/ixl" > > -dev/ixl/if_ixlv.c optional ixlv pci \ > > - compile-with "${NORMAL_C} -I$S/dev/ixl" > > +#dev/ixl/ixl_iw.c optional ixl pci \ > > +# compile-with "${NORMAL_C} -I$S/dev/ixl" > > +#dev/ixl/if_ixlv.c optional ixlv pci \ > > +# compile-with "${NORMAL_C} -I$S/dev/ixl" > > dev/ixl/ixlvc.c optional ixlv pci \ > > compile-with "${NORMAL_C} -I$S/dev/ixl" > > dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ > > > > Modified: head/sys/dev/ixl/i40e_osdep.c > > > ============================================================================== > > --- head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 19:53:11 2018 > (r335337) > > +++ head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:12:54 2018 > (r335338) > > @@ -132,7 +132,7 @@ i40e_free_dma_mem(struct i40e_hw *hw, struct > i40e_dma_ > > bus_dmamap_unload(mem->tag, mem->map); > > bus_dmamem_free(mem->tag, mem->va, mem->map); > > bus_dma_tag_destroy(mem->tag); > > - return (0); > > + return (I40E_SUCCESS); > > } > > > > void > > > > Modified: head/sys/dev/ixl/if_ixl.c > > > ============================================================================== > > --- head/sys/dev/ixl/if_ixl.c Mon Jun 18 19:53:11 2018 (r335337) > > +++ head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:12:54 2018 (r335338) > > @@ -51,60 +51,79 @@ > > #define IXL_DRIVER_VERSION_MINOR 9 > > #define IXL_DRIVER_VERSION_BUILD 9 > > > > -char ixl_driver_version[] = __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." > > - __XSTRING(IXL_DRIVER_VERSION_MINOR) "." > > - __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k"; > > +#define IXL_DRIVER_VERSION_STRING \ > > + __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ > > + __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ > > + __XSTRING(IXL_DRIVER_VERSION_BUILD) "-iflib-k" > > > > /********************************************************************* > > * PCI Device ID Table > > * > > * Used by probe to select devices to load on > > - * Last field stores an index into ixl_strings > > - * Last entry must be all 0s > > * > > - * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } > > + * ( Vendor ID, Device ID, Branding String ) > > *********************************************************************/ > > > > -static ixl_vendor_info_t ixl_vendor_info_array[] = > > +static pci_vendor_info_t ixl_vendor_info_array[] = > > { > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, 0, 0, 0}, > > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, 0, 0, 0}, > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) > Ethernet Controller X710 for 10GbE SFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet > Controller XL710 for 40GbE backplane"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, "Intel(R) Ethernet > Controller X710 for 10GbE backplane"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, "Intel(R) > Ethernet Controller XL710 for 40GbE QSFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, "Intel(R) > Ethernet Controller XL710 for 40GbE QSFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, "Intel(R) > Ethernet Controller X710 for 10GbE QSFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, "Intel(R) > Ethernet Controller X710 for 10GBASE-T"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, "Intel(R) > Ethernet Controller X710/X557-AT 10GBASE-T"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, "Intel(R) > Ethernet Connection X722 for 10GbE backplane"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, "Intel(R) > Ethernet Connection X722 for 10GbE QSFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, "Intel(R) > Ethernet Connection X722 for 10GbE SFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, > "Intel(R) Ethernet Connection X722 for 1GbE"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, > "Intel(R) Ethernet Connection X722 for 10GBASE-T"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, "Intel(R) > Ethernet Connection X722 for 10GbE SFP+"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, "Intel(R) > Ethernet Controller XXV710 for 25GbE backplane"), > > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, "Intel(R) > Ethernet Controller XXV710 for 25GbE SFP28"), > > /* required last entry */ > > - {0, 0, 0, 0, 0} > > + PVID_END > > }; > > > > /********************************************************************* > > - * Table of branding strings > > - *********************************************************************/ > > - > > -static char *ixl_strings[] = { > > - "Intel(R) Ethernet Connection 700 Series PF Driver" > > -}; > > - > > - > > -/********************************************************************* > > * Function prototypes > > *********************************************************************/ > > -static int ixl_probe(device_t); > > -static int ixl_attach(device_t); > > -static int ixl_detach(device_t); > > -static int ixl_shutdown(device_t); > > +/*** IFLIB interface ***/ > > +static void *ixl_register(device_t dev); > > +static int ixl_if_attach_pre(if_ctx_t ctx); > > +static int ixl_if_attach_post(if_ctx_t ctx); > > +static int ixl_if_detach(if_ctx_t ctx); > > +static int ixl_if_shutdown(if_ctx_t ctx); > > +static int ixl_if_suspend(if_ctx_t ctx); > > +static int ixl_if_resume(if_ctx_t ctx); > > +static int ixl_if_msix_intr_assign(if_ctx_t ctx, int msix); > > +static void ixl_if_enable_intr(if_ctx_t ctx); > > +static void ixl_if_disable_intr(if_ctx_t ctx); > > +static int ixl_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t > rxqid); > > +static int ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t > txqid); > > +static int ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, > uint64_t *paddrs, int ntxqs, int ntxqsets); > > +static int ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, > uint64_t *paddrs, int nqs, int nqsets); > > +static void ixl_if_queues_free(if_ctx_t ctx); > > +static void ixl_if_update_admin_status(if_ctx_t ctx); > > +static void ixl_if_multi_set(if_ctx_t ctx); > > +static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); > > +static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq > *ifmr); > > +static int ixl_if_media_change(if_ctx_t ctx); > > +static int ixl_if_promisc_set(if_ctx_t ctx, int flags); > > +static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); > > +static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); > > +static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); > > +static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter > cnt); > > +static void ixl_if_vflr_handle(if_ctx_t ctx); > > +// static void ixl_if_link_intr_enable(if_ctx_t ctx); > > +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 int ixl_save_pf_tunables(struct ixl_pf *); > > +/*** Other ***/ > > +static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr > *ifma, int); > > +static void ixl_save_pf_tunables(struct ixl_pf *); > > +static int ixl_allocate_pci_resources(struct ixl_pf *); > > > > /********************************************************************* > > * FreeBSD Device Interface Entry Points > > @@ -112,16 +131,17 @@ static int ixl_save_pf_tunables(struct > ixl_pf *); > > > > static device_method_t ixl_methods[] = { > > /* Device interface */ > > - DEVMETHOD(device_probe, ixl_probe), > > - DEVMETHOD(device_attach, ixl_attach), > > - DEVMETHOD(device_detach, ixl_detach), > > - DEVMETHOD(device_shutdown, ixl_shutdown), > > + DEVMETHOD(device_register, ixl_register), > > + DEVMETHOD(device_probe, iflib_device_probe), > > + DEVMETHOD(device_attach, iflib_device_attach), > > + DEVMETHOD(device_detach, iflib_device_detach), > > + DEVMETHOD(device_shutdown, iflib_device_shutdown), > > #ifdef PCI_IOV > > DEVMETHOD(pci_iov_init, ixl_iov_init), > > DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), > > DEVMETHOD(pci_iov_add_vf, ixl_add_vf), > > #endif > > - {0, 0} > > + DEVMETHOD_END > > }; > > > > static driver_t ixl_driver = { > > @@ -130,15 +150,52 @@ static driver_t ixl_driver = { > > > > devclass_t ixl_devclass; > > DRIVER_MODULE(ixl, pci, ixl_driver, ixl_devclass, 0, 0); > > +MODULE_VERSION(ixl, 3); > > > > -MODULE_VERSION(ixl, 1); > > - > > MODULE_DEPEND(ixl, pci, 1, 1, 1); > > MODULE_DEPEND(ixl, ether, 1, 1, 1); > > -#if defined(DEV_NETMAP) && __FreeBSD_version >= 1100000 > > -MODULE_DEPEND(ixl, netmap, 1, 1, 1); > > -#endif /* DEV_NETMAP */ > > +MODULE_DEPEND(ixl, iflib, 1, 1, 1); > > > > +static device_method_t ixl_if_methods[] = { > > + DEVMETHOD(ifdi_attach_pre, ixl_if_attach_pre), > > + DEVMETHOD(ifdi_attach_post, ixl_if_attach_post), > > + DEVMETHOD(ifdi_detach, ixl_if_detach), > > + DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), > > + DEVMETHOD(ifdi_suspend, ixl_if_suspend), > > + DEVMETHOD(ifdi_resume, ixl_if_resume), > > + DEVMETHOD(ifdi_init, ixl_if_init), > > + DEVMETHOD(ifdi_stop, ixl_if_stop), > > + DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), > > + DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), > > + DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), > > + //DEVMETHOD(ifdi_link_intr_enable, ixl_if_link_intr_enable), > > + DEVMETHOD(ifdi_rx_queue_intr_enable, > ixl_if_rx_queue_intr_enable), > > + DEVMETHOD(ifdi_tx_queue_intr_enable, > ixl_if_tx_queue_intr_enable), > > + DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), > > + DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), > > + DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), > > + DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), > > + DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), > > + DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), > > + DEVMETHOD(ifdi_media_status, ixl_if_media_status), > > + DEVMETHOD(ifdi_media_change, ixl_if_media_change), > > + DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), > > + DEVMETHOD(ifdi_timer, ixl_if_timer), > > + DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), > > + DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), > > + DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), > > + DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), > > + DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), > > + DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), > > + // ifdi_led_func > > + // ifdi_debug > > + DEVMETHOD_END > > +}; > > + > > +static driver_t ixl_if_driver = { > > + "ixl_if", ixl_if_methods, sizeof(struct ixl_pf) > > +}; > > + > > /* > > ** TUNEABLE PARAMETERS: > > */ > > @@ -147,39 +204,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, > 0, > > "IXL driver parameters"); > > > > /* > > - * MSIX should be the default for best performance, > > - * but this allows it to be forced off for testing. > > - */ > > -static int ixl_enable_msix = 1; > > -TUNABLE_INT("hw.ixl.enable_msix", &ixl_enable_msix); > > -SYSCTL_INT(_hw_ixl, OID_AUTO, enable_msix, CTLFLAG_RDTUN, > &ixl_enable_msix, 0, > > - "Enable MSI-X interrupts"); > > - > > -/* > > -** Number of descriptors per ring > > -** - TX and RX sizes are independently configurable > > -*/ > > -static int ixl_tx_ring_size = IXL_DEFAULT_RING; > > -TUNABLE_INT("hw.ixl.tx_ring_size", &ixl_tx_ring_size); > > -SYSCTL_INT(_hw_ixl, OID_AUTO, tx_ring_size, CTLFLAG_RDTUN, > > - &ixl_tx_ring_size, 0, "TX Descriptor Ring Size"); > > - > > -static int ixl_rx_ring_size = IXL_DEFAULT_RING; > > -TUNABLE_INT("hw.ixl.rx_ring_size", &ixl_rx_ring_size); > > -SYSCTL_INT(_hw_ixl, OID_AUTO, rx_ring_size, CTLFLAG_RDTUN, > > - &ixl_rx_ring_size, 0, "RX Descriptor Ring Size"); > > - > > -/* > > -** This can be set manually, if left as 0 the > > -** number of queues will be calculated based > > -** on cpus and msix vectors available. > > -*/ > > -static int ixl_max_queues = 0; > > -TUNABLE_INT("hw.ixl.max_queues", &ixl_max_queues); > > -SYSCTL_INT(_hw_ixl, OID_AUTO, max_queues, CTLFLAG_RDTUN, > > - &ixl_max_queues, 0, "Number of Queues"); > > - > > -/* > > * Leave this on unless you need to send flow control > > * frames (or other control frames) from software > > */ > > @@ -190,6 +214,13 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, > CTL > > &ixl_enable_tx_fc_filter, 0, > > "Filter out packets with Ethertype 0x8808 from being sent out by > non-HW sources"); > > > > +static int ixl_i2c_access_method = 0; > > +TUNABLE_INT("hw.ixl.i2c_access_method", > > + &ixl_i2c_access_method); > > +SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, > > + &ixl_i2c_access_method, 0, > > + IXL_SYSCTL_HELP_I2C_METHOD); > > + > > /* > > * Different method for processing TX descriptor > > * completion. > > @@ -215,20 +246,22 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, shared_debug_mask, > CTLFL > > &ixl_shared_debug_mask, 0, > > "Display debug statements that are printed in shared code"); > > > > +#if 0 > > /* > > ** Controls for Interrupt Throttling > > ** - true/false for dynamic adjustment > > ** - default values for static ITR > > */ > > -static int ixl_dynamic_rx_itr = 1; > > +static int ixl_dynamic_rx_itr = 0; > > TUNABLE_INT("hw.ixl.dynamic_rx_itr", &ixl_dynamic_rx_itr); > > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_rx_itr, CTLFLAG_RDTUN, > > &ixl_dynamic_rx_itr, 0, "Dynamic RX Interrupt Rate"); > > > > -static int ixl_dynamic_tx_itr = 1; > > +static int ixl_dynamic_tx_itr = 0; > > TUNABLE_INT("hw.ixl.dynamic_tx_itr", &ixl_dynamic_tx_itr); > > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_tx_itr, CTLFLAG_RDTUN, > > &ixl_dynamic_tx_itr, 0, "Dynamic TX Interrupt Rate"); > > +#endif > > > > static int ixl_rx_itr = IXL_ITR_8K; > > TUNABLE_INT("hw.ixl.rx_itr", &ixl_rx_itr); > > @@ -256,165 +289,131 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, > CTLFLA > > &ixl_limit_iwarp_msix, 0, "Limit MSIX vectors assigned to iWARP"); > > #endif > > > > -#ifdef DEV_NETMAP > > -#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ > > -#include > > -#endif /* DEV_NETMAP */ > > +extern struct if_txrx ixl_txrx_hwb; > > +extern struct if_txrx ixl_txrx_dwb; > > > > -/********************************************************************* > > - * Device identification routine > > - * > > - * ixl_probe determines if the driver should be loaded on > > - * the hardware based on PCI vendor/device id of the device. > > - * > > - * return BUS_PROBE_DEFAULT on success, positive on failure > > - *********************************************************************/ > > +static struct if_shared_ctx ixl_sctx_init = { > > + .isc_magic = IFLIB_MAGIC, > > + .isc_q_align = PAGE_SIZE, > > + .isc_tx_maxsize = IXL_TSO_SIZE, > > + .isc_tx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, > > > > -static int > > -ixl_probe(device_t dev) > > -{ > > - ixl_vendor_info_t *ent; > > + .isc_rx_maxsize = 16384, > > + .isc_rx_nsegments = IXL_MAX_RX_SEGS, > > + .isc_rx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, > > + .isc_nfl = 1, > > + .isc_ntxqs = 1, > > + .isc_nrxqs = 1, > > > > - u16 pci_vendor_id, pci_device_id; > > - u16 pci_subvendor_id, pci_subdevice_id; > > - char device_name[256]; > > + .isc_admin_intrcnt = 1, > > + .isc_vendor_info = ixl_vendor_info_array, > > + .isc_driver_version = IXL_DRIVER_VERSION_STRING, > > + .isc_driver = &ixl_if_driver, > > + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | > IFLIB_ADMIN_ALWAYS_RUN, > > > > -#if 0 > > - INIT_DEBUGOUT("ixl_probe: begin"); > > -#endif > > - pci_vendor_id = pci_get_vendor(dev); > > - if (pci_vendor_id != I40E_INTEL_VENDOR_ID) > > - return (ENXIO); > > + .isc_nrxd_min = {IXL_MIN_RING}, > > + .isc_ntxd_min = {IXL_MIN_RING}, > > + .isc_nrxd_max = {IXL_MAX_RING}, > > + .isc_ntxd_max = {IXL_MAX_RING}, > > + .isc_nrxd_default = {IXL_DEFAULT_RING}, > > + .isc_ntxd_default = {IXL_DEFAULT_RING}, > > +}; > > > > - pci_device_id = pci_get_device(dev); > > - pci_subvendor_id = pci_get_subvendor(dev); > > - pci_subdevice_id = pci_get_subdevice(dev); > > +if_shared_ctx_t ixl_sctx = &ixl_sctx_init; > > > > - ent = ixl_vendor_info_array; > > - while (ent->vendor_id != 0) { > > - if ((pci_vendor_id == ent->vendor_id) && > > - (pci_device_id == ent->device_id) && > > - > > - ((pci_subvendor_id == ent->subvendor_id) || > > - (ent->subvendor_id == 0)) && > > - > > - ((pci_subdevice_id == ent->subdevice_id) || > > - (ent->subdevice_id == 0))) { > > - sprintf(device_name, "%s, Version - %s", > > - ixl_strings[ent->index], > > - ixl_driver_version); > > - device_set_desc_copy(dev, device_name); > > - return (BUS_PROBE_DEFAULT); > > - } > > - ent++; > > - } > > - return (ENXIO); > > +/*** Functions ***/ > > +static void * > > +ixl_register(device_t dev) > > +{ > > + return (ixl_sctx); > > } > > > > -/* > > - * Sanity check and save off tunable values. > > - */ > > static int > > -ixl_save_pf_tunables(struct ixl_pf *pf) > > +ixl_allocate_pci_resources(struct ixl_pf *pf) > > { > > - device_t dev = pf->dev; > > + int rid; > > + struct i40e_hw *hw = &pf->hw; > > + device_t dev = iflib_get_dev(pf->vsi.ctx); > > > > - /* Save tunable information */ > > - pf->enable_msix = ixl_enable_msix; > > - pf->max_queues = ixl_max_queues; > > - pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; > > - pf->dynamic_rx_itr = ixl_dynamic_rx_itr; > > - pf->dynamic_tx_itr = ixl_dynamic_tx_itr; > > - pf->dbg_mask = ixl_core_debug_mask; > > - pf->hw.debug_mask = ixl_shared_debug_mask; > > -#ifdef DEV_NETMAP > > - if (ixl_enable_head_writeback == 0) > > - device_printf(dev, "Head writeback mode cannot be > disabled " > > - "when netmap is enabled\n"); > > - pf->vsi.enable_head_writeback = 1; > > -#else > > - pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); > > -#endif > > + /* Map BAR0 */ > > + rid = PCIR_BAR(0); > > + pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, > > + &rid, RF_ACTIVE); > > + > > + if (!(pf->pci_mem)) { > > + device_printf(dev, "Unable to allocate bus resource: PCI > memory\n"); > > + return (ENXIO); > > + } > > > > - ixl_vsi_setup_rings_size(&pf->vsi, ixl_tx_ring_size, > ixl_rx_ring_size); > > + /* Save off the PCI information */ > > + hw->vendor_id = pci_get_vendor(dev); > > + hw->device_id = pci_get_device(dev); > > + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); > > + hw->subsystem_vendor_id = > > + pci_read_config(dev, PCIR_SUBVEND_0, 2); > > + hw->subsystem_device_id = > > + pci_read_config(dev, PCIR_SUBDEV_0, 2); > > > > - if (ixl_tx_itr < 0 || ixl_tx_itr > IXL_MAX_ITR) { > > - device_printf(dev, "Invalid tx_itr value of %d set!\n", > > - ixl_tx_itr); > > - device_printf(dev, "tx_itr must be between %d and %d, " > > - "inclusive\n", > > - 0, IXL_MAX_ITR); > > - device_printf(dev, "Using default value of %d instead\n", > > - IXL_ITR_4K); > > - pf->tx_itr = IXL_ITR_4K; > > - } else > > - pf->tx_itr = ixl_tx_itr; > > + hw->bus.device = pci_get_slot(dev); > > + hw->bus.func = pci_get_function(dev); > > > > - if (ixl_rx_itr < 0 || ixl_rx_itr > IXL_MAX_ITR) { > > - device_printf(dev, "Invalid rx_itr value of %d set!\n", > > - ixl_rx_itr); > > - device_printf(dev, "rx_itr must be between %d and %d, " > > - "inclusive\n", > > - 0, IXL_MAX_ITR); > > - device_printf(dev, "Using default value of %d instead\n", > > - IXL_ITR_8K); > > - pf->rx_itr = IXL_ITR_8K; > > - } else > > - pf->rx_itr = ixl_rx_itr; > > + /* Save off register access information */ > > + pf->osdep.mem_bus_space_tag = > > + rman_get_bustag(pf->pci_mem); > > + pf->osdep.mem_bus_space_handle = > > + rman_get_bushandle(pf->pci_mem); > > + pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); > > + pf->osdep.flush_reg = I40E_GLGEN_STAT; > > + pf->osdep.dev = dev; > > > > - return (0); > > -} > > + pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; > > + pf->hw.back = &pf->osdep; > > + > > + return (0); > > + } > > > > -/********************************************************************* > > - * Device initialization routine > > - * > > - * The attach entry point is called when the driver is being loaded. > > - * This routine identifies the type of hardware, allocates all > resources > > - * and initializes the hardware. > > - * > > - * return 0 on success, positive on failure > > - *********************************************************************/ > > - > > static int > > -ixl_attach(device_t dev) > > +ixl_if_attach_pre(if_ctx_t ctx) > > { > > - struct ixl_pf *pf; > > - struct i40e_hw *hw; > > - struct ixl_vsi *vsi; > > + device_t dev; > > + struct ixl_pf *pf; > > + struct i40e_hw *hw; > > + struct ixl_vsi *vsi; > > + if_softc_ctx_t scctx; > > + struct i40e_filter_control_settings filter; > > enum i40e_status_code status; > > - int error = 0; > > + int error = 0; > > > > - INIT_DEBUGOUT("ixl_attach: begin"); > > + INIT_DEBUGOUT("ixl_if_attach_pre: begin"); > > > > /* Allocate, clear, and link in our primary soft structure */ > > - pf = device_get_softc(dev); > > - pf->dev = pf->osdep.dev = dev; > > + dev = iflib_get_dev(ctx); > > + pf = iflib_get_softc(ctx); > > + vsi = &pf->vsi; > > + vsi->back = pf; > > + pf->dev = dev; > > hw = &pf->hw; > > > > /* > > ** Note this assumes we have a single embedded VSI, > > ** this could be enhanced later to allocate multiple > > */ > > - vsi = &pf->vsi; > > - vsi->dev = pf->dev; > > - vsi->back = pf; > > + //vsi->dev = pf->dev; > > + vsi->hw = &pf->hw; > > + vsi->id = 0; > > + vsi->num_vlans = 0; > > + vsi->ctx = ctx; > > + vsi->media = iflib_get_media(ctx); > > + vsi->shared = scctx = iflib_get_softc_ctx(ctx); > > > > /* Save tunable values */ > > - error = ixl_save_pf_tunables(pf); > > - if (error) > > - return (error); > > + ixl_save_pf_tunables(pf); > > > > - /* Core Lock Init*/ > > - IXL_PF_LOCK_INIT(pf, device_get_nameunit(dev)); > > - > > - /* Set up the timer callout */ > > - callout_init_mtx(&pf->timer, &pf->pf_mtx, 0); > > - > > /* Do PCI setup - map BAR0, etc */ > > if (ixl_allocate_pci_resources(pf)) { > > device_printf(dev, "Allocation of PCI resources > failed\n"); > > error = ENXIO; > > - goto err_out; > > + goto err_pci_res; > > } > > > > /* Establish a clean starting point */ > > @@ -478,16 +477,11 @@ ixl_attach(device_t dev) > > /* Get capabilities from the device */ > > error = ixl_get_hw_capabilities(pf); > > if (error) { > > - device_printf(dev, "HW capabilities failure!\n"); > > + device_printf(dev, "get_hw_capabilities failed: %d\n", > > + error); > > goto err_get_cap; > > } > > > > - /* > > - * Allocate interrupts and figure out number of queues to use > > - * for PF interface > > - */ > > - pf->msix = ixl_init_msix(pf); > > - > > /* Set up host memory cache */ > > status = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, > > hw->func_caps.num_rx_qp, 0, 0); > > @@ -496,7 +490,6 @@ ixl_attach(device_t dev) > > i40e_stat_str(hw, status)); > > goto err_get_cap; > > } > > - > > status = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); > > if (status) { > > device_printf(dev, "configure_lan_hmc failed: %s\n", > > @@ -504,23 +497,6 @@ ixl_attach(device_t dev) > > goto err_mac_hmc; > > } > > > > - /* Init queue allocation manager */ > > - error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); > > - if (error) { > > - device_printf(dev, "Failed to init queue manager for PF > queues, error %d\n", > > - error); > > - goto err_mac_hmc; > > - } > > - /* reserve a contiguous allocation for the PF's VSI */ > > - error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, vsi->num_queues, > &pf->qtag); > > - if (error) { > > - device_printf(dev, "Failed to reserve queues for PF LAN > VSI, error %d\n", > > - error); > > - goto err_mac_hmc; > > - } > > - device_printf(dev, "Allocating %d queues for PF LAN VSI; %d > queues active\n", > > - pf->qtag.num_allocated, pf->qtag.num_active); > > - > > /* Disable LLDP from the firmware for certain NVM versions */ > > if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) > || > > (pf->hw.aq.fw_maj_ver < 4)) { > > @@ -536,46 +512,120 @@ ixl_attach(device_t dev) > > goto err_mac_hmc; > > } > > bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); > > + iflib_set_mac(ctx, hw->mac.addr); > > i40e_get_port_mac_addr(hw, hw->mac.port_addr); > > > > + /* Set up the device filtering */ > > + bzero(&filter, sizeof(filter)); > > + filter.enable_ethtype = TRUE; > > + filter.enable_macvlan = TRUE; > > + filter.enable_fdir = FALSE; > > + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; > > + if (i40e_set_filter_control(hw, &filter)) > > + device_printf(dev, "i40e_set_filter_control() failed\n"); > > + > > /* Query device FW LLDP status */ > > ixl_get_fw_lldp_status(pf); > > /* Tell FW to apply DCB config on link up */ > > - if ((hw->mac.type != I40E_MAC_X722) > > - && ((pf->hw.aq.api_maj_ver > 1) > > - || (pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver >= > 7))) > > - i40e_aq_set_dcb_parameters(hw, true, NULL); > > + i40e_aq_set_dcb_parameters(hw, true, NULL); > > > > - /* Initialize mac filter list for VSI */ > > - SLIST_INIT(&vsi->ftl); > > - > > - /* Set up SW VSI and allocate queue memory and rings */ > > - if (ixl_setup_stations(pf)) { > > - device_printf(dev, "setup stations failed!\n"); > > - error = ENOMEM; > > - goto err_mac_hmc; > > + /* Fill out iflib parameters */ > > + if (hw->mac.type == I40E_MAC_X722) > > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 128; > > + else > > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 64; > > + if (vsi->enable_head_writeback) { > > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] > > + * sizeof(struct i40e_tx_desc) + sizeof(u32), > DBA_ALIGN); > > + scctx->isc_txrx = &ixl_txrx_hwb; > > + } else { > > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] > > + * sizeof(struct i40e_tx_desc), DBA_ALIGN); > > + scctx->isc_txrx = &ixl_txrx_dwb; > > } > > + scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] > > + * sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); > > + scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); > > + scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; > > + scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; > > + scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; > > + scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; > > + scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; > > + scctx->isc_tx_csum_flags = CSUM_OFFLOAD; > > + scctx->isc_capenable = IXL_CAPS; > > > > + INIT_DEBUGOUT("ixl_if_attach_pre: end"); > > + return (0); > > + > > +err_mac_hmc: > > + i40e_shutdown_lan_hmc(hw); > > +err_get_cap: > > + i40e_shutdown_adminq(hw); > > +err_out: > > + ixl_free_pci_resources(pf); > > +err_pci_res: > > + return (error); > > +} > > + > > +static int > > +ixl_if_attach_post(if_ctx_t ctx) > > +{ > > + device_t dev; > > + struct ixl_pf *pf; > > + struct i40e_hw *hw; > > + struct ixl_vsi *vsi; > > + int error = 0; > > + enum i40e_status_code status; > > + > > + INIT_DEBUGOUT("ixl_if_attach_post: begin"); > > + > > + dev = iflib_get_dev(ctx); > > + pf = iflib_get_softc(ctx); > > + vsi = &pf->vsi; > > + vsi->ifp = iflib_get_ifp(ctx); > > + hw = &pf->hw; > > + > > /* Setup OS network interface / ifnet */ > > - if (ixl_setup_interface(dev, vsi)) { > > + if (ixl_setup_interface(dev, pf)) { > > device_printf(dev, "interface setup failed!\n"); > > error = EIO; > > - goto err_late; > > + goto err; > > } > > > > /* Determine link state */ > > if (ixl_attach_get_link_status(pf)) { > > error = EINVAL; > > - goto err_late; > > + goto err; > > } > > > > error = ixl_switch_config(pf); > > if (error) { > > device_printf(dev, "Initial ixl_switch_config() failed: > %d\n", > > error); > > - goto err_late; > > + goto err; > > } > > > > + /* Add protocol filters to list */ > > + ixl_init_filters(vsi); > > + > > + /* Init queue allocation manager */ > > + error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); > > + if (error) { > > + device_printf(dev, "Failed to init queue manager for PF > queues, error %d\n", > > + error); > > + goto err; > > + } > > + /* reserve a contiguous allocation for the PF's VSI */ > > + error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, > > + max(vsi->num_rx_queues, vsi->num_tx_queues), &pf->qtag); > > + if (error) { > > + device_printf(dev, "Failed to reserve queues for PF LAN > VSI, error %d\n", > > + error); > > + goto err; > > + } > > + device_printf(dev, "Allocating %d queues for PF LAN VSI; %d > queues active\n", > > + pf->qtag.num_allocated, pf->qtag.num_active); > > + > > /* Limit PHY interrupts to link, autoneg, and modules failure */ > > status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, > > NULL); > > @@ -583,91 +633,35 @@ ixl_attach(device_t dev) > > device_printf(dev, "i40e_aq_set_phy_mask() failed: err > %s," > > " aq_err %s\n", i40e_stat_str(hw, status), > > i40e_aq_str(hw, hw->aq.asq_last_status)); > > - goto err_late; > > + goto err; > > } > > > > - /* Get the bus configuration and set the shared code's config */ > > + /* Get the bus configuration and set the shared code */ > > ixl_get_bus_info(pf); > > > > - /* > > - * In MSI-X mode, initialize the Admin Queue interrupt, > > - * so userland tools can communicate with the adapter regardless > of > > - * the ifnet interface's status. > > - */ > > - if (pf->msix > 1) { > > - error = ixl_setup_adminq_msix(pf); > > - if (error) { > > - device_printf(dev, "ixl_setup_adminq_msix() > error: %d\n", > > - error); > > - goto err_late; > > - } > > - error = ixl_setup_adminq_tq(pf); > > - if (error) { > > - device_printf(dev, "ixl_setup_adminq_tq() error: > %d\n", > > - error); > > - goto err_late; > > - } > > - ixl_configure_intr0_msix(pf); > > - ixl_enable_intr0(hw); > > - > > - error = ixl_setup_queue_msix(vsi); > > - if (error) > > - device_printf(dev, "ixl_setup_queue_msix() > error: %d\n", > > - error); > > - error = ixl_setup_queue_tqs(vsi); > > - if (error) > > - device_printf(dev, "ixl_setup_queue_tqs() error: > %d\n", > > - error); > > - } else { > > - error = ixl_setup_legacy(pf); > > - > > - error = ixl_setup_adminq_tq(pf); > > - if (error) { > > - device_printf(dev, "ixl_setup_adminq_tq() error: > %d\n", > > - error); > > - goto err_late; > > - } > > - > > - error = ixl_setup_queue_tqs(vsi); > > - if (error) > > - device_printf(dev, "ixl_setup_queue_tqs() error: > %d\n", > > - error); > > + /* Keep admin queue interrupts active while driver is loaded */ > > + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { > > + ixl_configure_intr0_msix(pf); > > + ixl_enable_intr0(hw); > > } > > > > - if (error) { > > - device_printf(dev, "interrupt setup error: %d\n", error); > > - } > > - > > /* Set initial advertised speed sysctl value */ > > ixl_set_initial_advertised_speeds(pf); > > > > /* Initialize statistics & add sysctls */ > > ixl_add_device_sysctls(pf); > > - > > ixl_pf_reset_stats(pf); > > ixl_update_stats_counters(pf); > > ixl_add_hw_stats(pf); > > > > - /* Register for VLAN events */ > > - vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, > > - ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); > > - vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, > > - ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); > > + hw->phy.get_link_info = true; > > + i40e_get_link_status(hw, &pf->link_up); > > + ixl_update_link_status(pf); > > > > #ifdef PCI_IOV > > ixl_initialize_sriov(pf); > > #endif > > > > -#ifdef DEV_NETMAP > > - if (vsi->num_rx_desc == vsi->num_tx_desc) { > > - vsi->queues[0].num_desc = vsi->num_rx_desc; > > - ixl_netmap_attach(vsi); > > - } else > > - device_printf(dev, > > - "Netmap is not supported when RX and TX descriptor > ring sizes differ\n"); > > - > > -#endif /* DEV_NETMAP */ > > - > > #ifdef IXL_IW > > if (hw->func_caps.iwarp && ixl_enable_iwarp) { > > pf->iw_enabled = (pf->iw_msix > 0) ? true : false; > > @@ -677,7 +671,7 @@ ixl_attach(device_t dev) > > device_printf(dev, > > "interfacing to iwarp driver failed: > %d\n", > > error); > > - goto err_late; > > + goto err; > > } else > > device_printf(dev, "iWARP ready\n"); > > } else > > @@ -689,54 +683,38 @@ ixl_attach(device_t dev) > > } > > #endif > > > > - INIT_DEBUGOUT("ixl_attach: end"); > > + INIT_DBG_DEV(dev, "end"); > > return (0); > > > > -err_late: > > - if (vsi->ifp != NULL) { > > - ether_ifdetach(vsi->ifp); > > - if_free(vsi->ifp); > > - } > > -err_mac_hmc: > > - i40e_shutdown_lan_hmc(hw); > > -err_get_cap: > > - i40e_shutdown_adminq(hw); > > -err_out: > > - ixl_free_pci_resources(pf); > > - ixl_free_vsi(vsi); > > - IXL_PF_LOCK_DESTROY(pf); > > +err: > > + INIT_DEBUGOUT("end: error %d", error); > > + /* ixl_if_detach() is called on error from this */ > > return (error); > > } > > > > -/********************************************************************* > > - * Device removal routine > > - * > > - * The detach entry point is called when the driver is being removed. > > - * This routine stops the adapter and deallocates all the resources > > - * that were allocated for driver operation. > > - * > > - * return 0 on success, positive on failure > > - *********************************************************************/ > > - > > static int > > -ixl_detach(device_t dev) > > +ixl_if_detach(if_ctx_t ctx) > > { > > - struct ixl_pf *pf = device_get_softc(dev); > > - struct i40e_hw *hw = &pf->hw; > > - struct ixl_vsi *vsi = &pf->vsi; > > + struct ixl_pf *pf = iflib_get_softc(ctx); > > + struct ixl_vsi *vsi = &pf->vsi; > > + struct i40e_hw *hw = &pf->hw; > > + device_t dev = pf->dev; > > enum i40e_status_code status; > > #if defined(PCI_IOV) || defined(IXL_IW) > > int error; > > #endif > > > > - INIT_DEBUGOUT("ixl_detach: begin"); > > + INIT_DBG_DEV(dev, "begin"); > > > > - /* Make sure VLANS are not using driver */ > > - if (vsi->ifp->if_vlantrunk != NULL) { > > - device_printf(dev, "Vlan in use, detach first\n"); > > - return (EBUSY); > > +#ifdef IXL_IW > > + if (ixl_enable_iwarp && pf->iw_enabled) { > > + error = ixl_iw_pf_detach(pf); > > + if (error == EBUSY) { > > + device_printf(dev, "iwarp in use; stop it > first.\n"); > > + return (error); > > + } > > } > > - > > +#endif > > #ifdef PCI_IOV > > error = pci_iov_detach(dev); > > if (error != 0) { > > @@ -744,73 +722,989 @@ ixl_detach(device_t dev) > > return (error); > > } > > #endif > > - > > /* Remove all previously allocated media types */ > > - ifmedia_removeall(&vsi->media); > > + ifmedia_removeall(vsi->media); > > > > - ether_ifdetach(vsi->ifp); > > - if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) > > - ixl_stop(pf); > > - > > /* Shutdown LAN HMC */ > > - status = i40e_shutdown_lan_hmc(hw); > > - if (status) > > - device_printf(dev, > > - "Shutdown LAN HMC failed with code %d\n", status); > > + if (hw->hmc.hmc_obj) { > > + status = i40e_shutdown_lan_hmc(hw); > > + if (status) > > + device_printf(dev, > > + "i40e_shutdown_lan_hmc() failed with status > %s\n", > > + i40e_stat_str(hw, status)); > > + } > > > > - /* Teardown LAN queue resources */ > > - ixl_teardown_queue_msix(vsi); > > - ixl_free_queue_tqs(vsi); > > /* Shutdown admin queue */ > > ixl_disable_intr0(hw); > > - ixl_teardown_adminq_msix(pf); > > - ixl_free_adminq_tq(pf); > > status = i40e_shutdown_adminq(hw); > > if (status) > > device_printf(dev, > > - "Shutdown Admin queue failed with code %d\n", > status); > > + "i40e_shutdown_adminq() failed with status %s\n", > > + i40e_stat_str(hw, status)); > > > > - /* Unregister VLAN events */ > > - if (vsi->vlan_attach != NULL) > > - EVENTHANDLER_DEREGISTER(vlan_config, vsi->vlan_attach); > > - if (vsi->vlan_detach != NULL) > > - EVENTHANDLER_DEREGISTER(vlan_unconfig, vsi->vlan_detach); > > + ixl_pf_qmgr_destroy(&pf->qmgr); > > + ixl_free_pci_resources(pf); > > + ixl_free_mac_filters(vsi); > > + INIT_DBG_DEV(dev, "end"); > > + return (0); > > +} > > > > > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > > > From owner-svn-src-all@freebsd.org Tue Jun 19 02:48:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E27EC10165D0; Tue, 19 Jun 2018 02:48:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9825E84CF4; Tue, 19 Jun 2018 02:48:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793F1567D; Tue, 19 Jun 2018 02:48:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J2mr93056147; Tue, 19 Jun 2018 02:48:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J2mrH4056146; Tue, 19 Jun 2018 02:48:53 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806190248.w5J2mrH4056146@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Tue, 19 Jun 2018 02:48:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335357 - head/sys/amd64/conf X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/amd64/conf X-SVN-Commit-Revision: 335357 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 02:48:54 -0000 Author: mmacy Date: Tue Jun 19 02:48:53 2018 New Revision: 335357 URL: https://svnweb.freebsd.org/changeset/base/335357 Log: remove ixl iwarp and ixlv from the build until they are in a working state Modified: head/sys/amd64/conf/NOTES Modified: head/sys/amd64/conf/NOTES ============================================================================== --- head/sys/amd64/conf/NOTES Tue Jun 19 01:54:00 2018 (r335356) +++ head/sys/amd64/conf/NOTES Tue Jun 19 02:48:53 2018 (r335357) @@ -333,8 +333,8 @@ device ipw # Intel 2100 wireless NICs. device iwi # Intel 2200BG/2225BG/2915ABG wireless NICs. device iwn # Intel 4965/1000/5000/6000 wireless NICs. device ixl # Intel XL710 40Gbe PCIE Ethernet -options IXL_IW # Enable iWARP Client Interface in ixl(4) -device ixlv # Intel XL710 40Gbe VF PCIE Ethernet +#options IXL_IW # Enable iWARP Client Interface in ixl(4) +#device ixlv # Intel XL710 40Gbe VF PCIE Ethernet device mthca # Mellanox HCA InfiniBand device mlx4 # Shared code module between IB and Ethernet device mlx4ib # Mellanox ConnectX HCA InfiniBand From owner-svn-src-all@freebsd.org Tue Jun 19 02:49:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 76F971016644; Tue, 19 Jun 2018 02:49:14 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0949384E13; Tue, 19 Jun 2018 02:49:14 +0000 (UTC) (envelope-from mat.macy@gmail.com) Received: by mail-io0-x242.google.com with SMTP id t6-v6so18696647iob.10; Mon, 18 Jun 2018 19:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+MCSv+56+KGx8M/uvMfwRvZbSG/eIxSI2T09rTmJQ2Q=; b=Nry3gdwobjByzYuOJ2qDqVusO+sur+gi9YQ/F463V8Hg061I2jkG7uWjb+sNGa9zbv LyKKWKnhocsYps8tl3lYaCI9m6K64m2ZgFX5H3grday6lkOklRDV6Ay2xWA98TwE0SUE k75Np3uIEEL+wFiz3BzOxhDAQB2MGlNSHtbHACz5ryNHxRzXxHxT4Xu3vSCWBTbwkqGb HwBt98i7zT0NtsmKvtKdGrGoSB4h2Q+ikkJjTddptuDTRcft6t0Tu0ZqluBsvxRLEeJA s/fUo5Jx+DFg9DvIFOFtddx1+hNQDApqOlJsmmFU66NcLD7+ZatRc37xn6vg2GBFBjl6 7cYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+MCSv+56+KGx8M/uvMfwRvZbSG/eIxSI2T09rTmJQ2Q=; b=DA10DLi2Gxl1odLzk2C6F1mWHuLWHfBAsQUZGpEBL39WfDKJjBptUfxAj0bzZRsCpz FVmwqDK5AJcmvKHtOsrb//iJej96XxUwQr1EfmeNsl1I95nO2qZyWz6lhGP2SYea9Stf ko6H4ISOigH6fCNY/hyVjC3q9GtDZR2MtMNy1JH4NYA+I9gk0msi4iANBVu+2QGKIFRq EK7wftAhOiFwYRr2c1KCe+f+f06VE4SWHHD+Ev0yWeWWQBoD055lfrXeKFKeTgyM/Naj JgCNrlSIUZaf8S1wn5YKOWEcc+yT+BB1yPhJvTj0nZPuhcSCp3ueMyhypTT3ANyo+d6Y RFdg== X-Gm-Message-State: APt69E1CLHEnJJtBRrW4KpxR9U62p0r9oF5W1f3O8HePMDOGEEpqFmx+ cn+Z5EwhuZEomw4HI3Xori9IlLhQsgIvrfmC3y8= X-Google-Smtp-Source: ADUXVKJw87Swhb733dCsQGaV2NZDRI4aRINUm0a2K45J0yEOJQB7Ya9T1vnbD/qGyslhCh2YQKBOu6sDvcEw/vBgozI= X-Received: by 2002:a6b:2c4f:: with SMTP id s76-v6mr12244399ios.132.1529376552971; Mon, 18 Jun 2018 19:49:12 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a02:8cd:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 19:49:12 -0700 (PDT) In-Reply-To: References: <201806182012.w5IKCtQ7053689@repo.freebsd.org> From: Matthew Macy Date: Mon, 18 Jun 2018 19:49:12 -0700 Message-ID: Subject: Re: svn commit: r335338 - in head/sys: amd64/conf conf dev/ixl modules modules/ixl modules/ixlv To: Eric Joyner Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 02:49:14 -0000 OK. I've taken it out of NOTES until such time. -M On Mon, Jun 18, 2018 at 7:38 PM, Eric Joyner wrote: > It probably won't result in anything usable. I need to remove ixlvc.c from > the build since the VF driver as a whole doesn't work atm. > > - Eric > > On Mon, Jun 18, 2018 at 7:05 PM Matthew Macy wrote: >> >> This breaks universe / tinderbox on AMD64. You appear to have >> committed parts of a patch to ixlvc.c. I'm not quite clear on what >> happened here and if just removing the '+' will produce something >> usable. >> >> >> >> void >> ixlv_configure_queues(struct ixlv_sc *sc) >> { >> device_t dev = sc->dev; >> struct ixl_vsi *vsi = &sc->vsi; >> + if_softc_ctx_t scctx = iflib_get_softc_ctx(vsi->ctx); >> + struct ixl_tx_queue *tx_que = vsi->tx_queues; >> + struct ixl_rx_queue *rx_que = vsi->rx_queues; >> struct tx_ring *txr; >> struct rx_ring *rxr; >> int len, pairs; >> >> struct virtchnl_vsi_queue_config_info *vqci; >> struct virtchnl_queue_pair_info *vqpi; >> >> + /* XXX: Linux PF driver wants matching ids in each tx/rx struct, >> so both TX/RX >> + * queues of a pair need to be configured */ >> + pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); >> len = sizeof(struct virtchnl_vsi_queue_config_info) + >> (sizeof(struct virtchnl_queue_pair_info) * pairs); >> vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); >> if (!vqci) { >> device_printf(dev, "%s: unable to allocate memory\n", __func__); >> ixl_vc_schedule_retry(&sc->vc_mgr); >> return; >> } >> vqci->vsi_id = sc->vsi_res->vsi_id; >> vqci->num_queue_pairs = pairs; >> vqpi = vqci->qpair; >> /* Size check is not needed here - HW max is 16 queue pairs, and we >> * can fit info for 31 of them into the AQ buffer before it overflows. >> */ >> + for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) { >> + txr = &tx_que->txr; >> + rxr = &rx_que->rxr; >> + >> vqpi->txq.vsi_id = vqci->vsi_id; >> vqpi->txq.queue_id = i; >> + vqpi->txq.ring_len = scctx->isc_ntxd[0]; >> + vqpi->txq.dma_ring_addr = txr->tx_paddr; >> >> On Mon, Jun 18, 2018 at 1:12 PM, Eric Joyner wrote: >> > Author: erj >> > Date: Mon Jun 18 20:12:54 2018 >> > New Revision: 335338 >> > URL: https://svnweb.freebsd.org/changeset/base/335338 >> > >> > Log: >> > ixl(4): Update to use iflib >> > >> > Update the driver to use iflib in order to bring performance, >> > maintainability, and (hopefully) stability benefits to the driver. >> > >> > The driver currently isn't completely ported; features that are >> > missing: >> > >> > - VF driver (ixlv) >> > - SR-IOV host support >> > - RDMA support >> > >> > The plan is to have these re-added to the driver before the next >> > FreeBSD release. >> > >> > Reviewed by: gallatin@ >> > Contributions by: gallatin@, mmacy@, krzysztof.galazka@intel.com >> > Tested by: jeffrey.e.pieper@intel.com >> > MFC after: 1 month >> > Sponsored by: Intel Corporation >> > Differential Revision: https://reviews.freebsd.org/D15577 >> > >> > Added: >> > head/sys/dev/ixl/ixl_debug.h (contents, props changed) >> > Modified: >> > head/sys/amd64/conf/GENERIC >> > head/sys/conf/files.amd64 >> > head/sys/dev/ixl/i40e_osdep.c >> > head/sys/dev/ixl/if_ixl.c >> > head/sys/dev/ixl/if_ixlv.c >> > head/sys/dev/ixl/ixl.h >> > head/sys/dev/ixl/ixl_pf.h >> > head/sys/dev/ixl/ixl_pf_i2c.c >> > head/sys/dev/ixl/ixl_pf_iov.c >> > head/sys/dev/ixl/ixl_pf_main.c >> > head/sys/dev/ixl/ixl_pf_qmgr.c >> > head/sys/dev/ixl/ixl_txrx.c >> > head/sys/dev/ixl/ixlv.h >> > head/sys/dev/ixl/ixlvc.c >> > head/sys/modules/Makefile >> > head/sys/modules/ixl/Makefile >> > head/sys/modules/ixlv/Makefile >> > >> > Modified: head/sys/amd64/conf/GENERIC >> > >> > ============================================================================== >> > --- head/sys/amd64/conf/GENERIC Mon Jun 18 19:53:11 2018 >> > (r335337) >> > +++ head/sys/amd64/conf/GENERIC Mon Jun 18 20:12:54 2018 >> > (r335338) >> > @@ -240,8 +240,8 @@ device em # Intel >> > PRO/1000 Gigabit Ethernet Family >> > device ix # Intel PRO/10GbE PCIE PF >> > Ethernet >> > device ixv # Intel PRO/10GbE PCIE VF >> > Ethernet >> > device ixl # Intel XL710 40Gbe PCIE >> > Ethernet >> > -options IXL_IW # Enable iWARP Client >> > Interface in ixl(4) >> > -device ixlv # Intel XL710 40Gbe VF PCIE >> > Ethernet >> > +#options IXL_IW # Enable iWARP Client >> > Interface in ixl(4) >> > +#device ixlv # Intel XL710 40Gbe VF >> > PCIE Ethernet >> > device le # AMD Am7900 LANCE and Am79C9xx >> > PCnet >> > device ti # Alteon Networks Tigon I/II >> > gigabit Ethernet >> > device txp # 3Com 3cR990 (``Typhoon'') >> > >> > Modified: head/sys/conf/files.amd64 >> > >> > ============================================================================== >> > --- head/sys/conf/files.amd64 Mon Jun 18 19:53:11 2018 >> > (r335337) >> > +++ head/sys/conf/files.amd64 Mon Jun 18 20:12:54 2018 >> > (r335338) >> > @@ -270,10 +270,10 @@ dev/ixl/ixl_pf_iov.c optional >> > ixl pci pci_iov \ >> > compile-with "${NORMAL_C} -I$S/dev/ixl" >> > dev/ixl/ixl_pf_i2c.c optional ixl pci \ >> > compile-with "${NORMAL_C} -I$S/dev/ixl" >> > -dev/ixl/ixl_iw.c optional ixl pci \ >> > - compile-with "${NORMAL_C} -I$S/dev/ixl" >> > -dev/ixl/if_ixlv.c optional ixlv pci \ >> > - compile-with "${NORMAL_C} -I$S/dev/ixl" >> > +#dev/ixl/ixl_iw.c optional ixl pci \ >> > +# compile-with "${NORMAL_C} -I$S/dev/ixl" >> > +#dev/ixl/if_ixlv.c optional ixlv pci \ >> > +# compile-with "${NORMAL_C} -I$S/dev/ixl" >> > dev/ixl/ixlvc.c optional ixlv pci \ >> > compile-with "${NORMAL_C} -I$S/dev/ixl" >> > dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ >> > >> > Modified: head/sys/dev/ixl/i40e_osdep.c >> > >> > ============================================================================== >> > --- head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 19:53:11 2018 >> > (r335337) >> > +++ head/sys/dev/ixl/i40e_osdep.c Mon Jun 18 20:12:54 2018 >> > (r335338) >> > @@ -132,7 +132,7 @@ i40e_free_dma_mem(struct i40e_hw *hw, struct >> > i40e_dma_ >> > bus_dmamap_unload(mem->tag, mem->map); >> > bus_dmamem_free(mem->tag, mem->va, mem->map); >> > bus_dma_tag_destroy(mem->tag); >> > - return (0); >> > + return (I40E_SUCCESS); >> > } >> > >> > void >> > >> > Modified: head/sys/dev/ixl/if_ixl.c >> > >> > ============================================================================== >> > --- head/sys/dev/ixl/if_ixl.c Mon Jun 18 19:53:11 2018 >> > (r335337) >> > +++ head/sys/dev/ixl/if_ixl.c Mon Jun 18 20:12:54 2018 >> > (r335338) >> > @@ -51,60 +51,79 @@ >> > #define IXL_DRIVER_VERSION_MINOR 9 >> > #define IXL_DRIVER_VERSION_BUILD 9 >> > >> > -char ixl_driver_version[] = __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." >> > - __XSTRING(IXL_DRIVER_VERSION_MINOR) "." >> > - __XSTRING(IXL_DRIVER_VERSION_BUILD) "-k"; >> > +#define IXL_DRIVER_VERSION_STRING \ >> > + __XSTRING(IXL_DRIVER_VERSION_MAJOR) "." \ >> > + __XSTRING(IXL_DRIVER_VERSION_MINOR) "." \ >> > + __XSTRING(IXL_DRIVER_VERSION_BUILD) "-iflib-k" >> > >> > /********************************************************************* >> > * PCI Device ID Table >> > * >> > * Used by probe to select devices to load on >> > - * Last field stores an index into ixl_strings >> > - * Last entry must be all 0s >> > * >> > - * { Vendor ID, Device ID, SubVendor ID, SubDevice ID, String Index } >> > + * ( Vendor ID, Device ID, Branding String ) >> > *********************************************************************/ >> > >> > -static ixl_vendor_info_t ixl_vendor_info_array[] = >> > +static pci_vendor_info_t ixl_vendor_info_array[] = >> > { >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, 0, 0, 0}, >> > - {I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, 0, 0, 0}, >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_XL710, "Intel(R) >> > Ethernet Controller X710 for 10GbE SFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_B, "Intel(R) Ethernet >> > Controller XL710 for 40GbE backplane"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_C, "Intel(R) Ethernet >> > Controller X710 for 10GbE backplane"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_A, "Intel(R) >> > Ethernet Controller XL710 for 40GbE QSFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_B, "Intel(R) >> > Ethernet Controller XL710 for 40GbE QSFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_C, "Intel(R) >> > Ethernet Controller X710 for 10GbE QSFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T, "Intel(R) >> > Ethernet Controller X710 for 10GBASE-T"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T4, "Intel(R) >> > Ethernet Controller X710/X557-AT 10GBASE-T"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_KX_X722, "Intel(R) >> > Ethernet Connection X722 for 10GbE backplane"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_QSFP_X722, "Intel(R) >> > Ethernet Connection X722 for 10GbE QSFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_X722, "Intel(R) >> > Ethernet Connection X722 for 10GbE SFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_1G_BASE_T_X722, >> > "Intel(R) Ethernet Connection X722 for 1GbE"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_10G_BASE_T_X722, >> > "Intel(R) Ethernet Connection X722 for 10GBASE-T"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_SFP_I_X722, "Intel(R) >> > Ethernet Connection X722 for 10GbE SFP+"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_B, "Intel(R) >> > Ethernet Controller XXV710 for 25GbE backplane"), >> > + PVIDV(I40E_INTEL_VENDOR_ID, I40E_DEV_ID_25G_SFP28, "Intel(R) >> > Ethernet Controller XXV710 for 25GbE SFP28"), >> > /* required last entry */ >> > - {0, 0, 0, 0, 0} >> > + PVID_END >> > }; >> > >> > /********************************************************************* >> > - * Table of branding strings >> > - *********************************************************************/ >> > - >> > -static char *ixl_strings[] = { >> > - "Intel(R) Ethernet Connection 700 Series PF Driver" >> > -}; >> > - >> > - >> > -/********************************************************************* >> > * Function prototypes >> > *********************************************************************/ >> > -static int ixl_probe(device_t); >> > -static int ixl_attach(device_t); >> > -static int ixl_detach(device_t); >> > -static int ixl_shutdown(device_t); >> > +/*** IFLIB interface ***/ >> > +static void *ixl_register(device_t dev); >> > +static int ixl_if_attach_pre(if_ctx_t ctx); >> > +static int ixl_if_attach_post(if_ctx_t ctx); >> > +static int ixl_if_detach(if_ctx_t ctx); >> > +static int ixl_if_shutdown(if_ctx_t ctx); >> > +static int ixl_if_suspend(if_ctx_t ctx); >> > +static int ixl_if_resume(if_ctx_t ctx); >> > +static int ixl_if_msix_intr_assign(if_ctx_t ctx, int msix); >> > +static void ixl_if_enable_intr(if_ctx_t ctx); >> > +static void ixl_if_disable_intr(if_ctx_t ctx); >> > +static int ixl_if_rx_queue_intr_enable(if_ctx_t ctx, uint16_t >> > rxqid); >> > +static int ixl_if_tx_queue_intr_enable(if_ctx_t ctx, uint16_t >> > txqid); >> > +static int ixl_if_tx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, >> > uint64_t *paddrs, int ntxqs, int ntxqsets); >> > +static int ixl_if_rx_queues_alloc(if_ctx_t ctx, caddr_t *vaddrs, >> > uint64_t *paddrs, int nqs, int nqsets); >> > +static void ixl_if_queues_free(if_ctx_t ctx); >> > +static void ixl_if_update_admin_status(if_ctx_t ctx); >> > +static void ixl_if_multi_set(if_ctx_t ctx); >> > +static int ixl_if_mtu_set(if_ctx_t ctx, uint32_t mtu); >> > +static void ixl_if_media_status(if_ctx_t ctx, struct ifmediareq >> > *ifmr); >> > +static int ixl_if_media_change(if_ctx_t ctx); >> > +static int ixl_if_promisc_set(if_ctx_t ctx, int flags); >> > +static void ixl_if_timer(if_ctx_t ctx, uint16_t qid); >> > +static void ixl_if_vlan_register(if_ctx_t ctx, u16 vtag); >> > +static void ixl_if_vlan_unregister(if_ctx_t ctx, u16 vtag); >> > +static uint64_t ixl_if_get_counter(if_ctx_t ctx, ift_counter >> > cnt); >> > +static void ixl_if_vflr_handle(if_ctx_t ctx); >> > +// static void ixl_if_link_intr_enable(if_ctx_t ctx); >> > +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 int ixl_save_pf_tunables(struct ixl_pf *); >> > +/*** Other ***/ >> > +static int ixl_mc_filter_apply(void *arg, struct ifmultiaddr >> > *ifma, int); >> > +static void ixl_save_pf_tunables(struct ixl_pf *); >> > +static int ixl_allocate_pci_resources(struct ixl_pf *); >> > >> > /********************************************************************* >> > * FreeBSD Device Interface Entry Points >> > @@ -112,16 +131,17 @@ static int ixl_save_pf_tunables(struct >> > ixl_pf *); >> > >> > static device_method_t ixl_methods[] = { >> > /* Device interface */ >> > - DEVMETHOD(device_probe, ixl_probe), >> > - DEVMETHOD(device_attach, ixl_attach), >> > - DEVMETHOD(device_detach, ixl_detach), >> > - DEVMETHOD(device_shutdown, ixl_shutdown), >> > + DEVMETHOD(device_register, ixl_register), >> > + DEVMETHOD(device_probe, iflib_device_probe), >> > + DEVMETHOD(device_attach, iflib_device_attach), >> > + DEVMETHOD(device_detach, iflib_device_detach), >> > + DEVMETHOD(device_shutdown, iflib_device_shutdown), >> > #ifdef PCI_IOV >> > DEVMETHOD(pci_iov_init, ixl_iov_init), >> > DEVMETHOD(pci_iov_uninit, ixl_iov_uninit), >> > DEVMETHOD(pci_iov_add_vf, ixl_add_vf), >> > #endif >> > - {0, 0} >> > + DEVMETHOD_END >> > }; >> > >> > static driver_t ixl_driver = { >> > @@ -130,15 +150,52 @@ static driver_t ixl_driver = { >> > >> > devclass_t ixl_devclass; >> > DRIVER_MODULE(ixl, pci, ixl_driver, ixl_devclass, 0, 0); >> > +MODULE_VERSION(ixl, 3); >> > >> > -MODULE_VERSION(ixl, 1); >> > - >> > MODULE_DEPEND(ixl, pci, 1, 1, 1); >> > MODULE_DEPEND(ixl, ether, 1, 1, 1); >> > -#if defined(DEV_NETMAP) && __FreeBSD_version >= 1100000 >> > -MODULE_DEPEND(ixl, netmap, 1, 1, 1); >> > -#endif /* DEV_NETMAP */ >> > +MODULE_DEPEND(ixl, iflib, 1, 1, 1); >> > >> > +static device_method_t ixl_if_methods[] = { >> > + DEVMETHOD(ifdi_attach_pre, ixl_if_attach_pre), >> > + DEVMETHOD(ifdi_attach_post, ixl_if_attach_post), >> > + DEVMETHOD(ifdi_detach, ixl_if_detach), >> > + DEVMETHOD(ifdi_shutdown, ixl_if_shutdown), >> > + DEVMETHOD(ifdi_suspend, ixl_if_suspend), >> > + DEVMETHOD(ifdi_resume, ixl_if_resume), >> > + DEVMETHOD(ifdi_init, ixl_if_init), >> > + DEVMETHOD(ifdi_stop, ixl_if_stop), >> > + DEVMETHOD(ifdi_msix_intr_assign, ixl_if_msix_intr_assign), >> > + DEVMETHOD(ifdi_intr_enable, ixl_if_enable_intr), >> > + DEVMETHOD(ifdi_intr_disable, ixl_if_disable_intr), >> > + //DEVMETHOD(ifdi_link_intr_enable, ixl_if_link_intr_enable), >> > + DEVMETHOD(ifdi_rx_queue_intr_enable, >> > ixl_if_rx_queue_intr_enable), >> > + DEVMETHOD(ifdi_tx_queue_intr_enable, >> > ixl_if_tx_queue_intr_enable), >> > + DEVMETHOD(ifdi_tx_queues_alloc, ixl_if_tx_queues_alloc), >> > + DEVMETHOD(ifdi_rx_queues_alloc, ixl_if_rx_queues_alloc), >> > + DEVMETHOD(ifdi_queues_free, ixl_if_queues_free), >> > + DEVMETHOD(ifdi_update_admin_status, ixl_if_update_admin_status), >> > + DEVMETHOD(ifdi_multi_set, ixl_if_multi_set), >> > + DEVMETHOD(ifdi_mtu_set, ixl_if_mtu_set), >> > + DEVMETHOD(ifdi_media_status, ixl_if_media_status), >> > + DEVMETHOD(ifdi_media_change, ixl_if_media_change), >> > + DEVMETHOD(ifdi_promisc_set, ixl_if_promisc_set), >> > + DEVMETHOD(ifdi_timer, ixl_if_timer), >> > + DEVMETHOD(ifdi_vlan_register, ixl_if_vlan_register), >> > + DEVMETHOD(ifdi_vlan_unregister, ixl_if_vlan_unregister), >> > + DEVMETHOD(ifdi_get_counter, ixl_if_get_counter), >> > + DEVMETHOD(ifdi_vflr_handle, ixl_if_vflr_handle), >> > + DEVMETHOD(ifdi_i2c_req, ixl_if_i2c_req), >> > + DEVMETHOD(ifdi_priv_ioctl, ixl_if_priv_ioctl), >> > + // ifdi_led_func >> > + // ifdi_debug >> > + DEVMETHOD_END >> > +}; >> > + >> > +static driver_t ixl_if_driver = { >> > + "ixl_if", ixl_if_methods, sizeof(struct ixl_pf) >> > +}; >> > + >> > /* >> > ** TUNEABLE PARAMETERS: >> > */ >> > @@ -147,39 +204,6 @@ static SYSCTL_NODE(_hw, OID_AUTO, ixl, CTLFLAG_RD, >> > 0, >> > "IXL driver parameters"); >> > >> > /* >> > - * MSIX should be the default for best performance, >> > - * but this allows it to be forced off for testing. >> > - */ >> > -static int ixl_enable_msix = 1; >> > -TUNABLE_INT("hw.ixl.enable_msix", &ixl_enable_msix); >> > -SYSCTL_INT(_hw_ixl, OID_AUTO, enable_msix, CTLFLAG_RDTUN, >> > &ixl_enable_msix, 0, >> > - "Enable MSI-X interrupts"); >> > - >> > -/* >> > -** Number of descriptors per ring >> > -** - TX and RX sizes are independently configurable >> > -*/ >> > -static int ixl_tx_ring_size = IXL_DEFAULT_RING; >> > -TUNABLE_INT("hw.ixl.tx_ring_size", &ixl_tx_ring_size); >> > -SYSCTL_INT(_hw_ixl, OID_AUTO, tx_ring_size, CTLFLAG_RDTUN, >> > - &ixl_tx_ring_size, 0, "TX Descriptor Ring Size"); >> > - >> > -static int ixl_rx_ring_size = IXL_DEFAULT_RING; >> > -TUNABLE_INT("hw.ixl.rx_ring_size", &ixl_rx_ring_size); >> > -SYSCTL_INT(_hw_ixl, OID_AUTO, rx_ring_size, CTLFLAG_RDTUN, >> > - &ixl_rx_ring_size, 0, "RX Descriptor Ring Size"); >> > - >> > -/* >> > -** This can be set manually, if left as 0 the >> > -** number of queues will be calculated based >> > -** on cpus and msix vectors available. >> > -*/ >> > -static int ixl_max_queues = 0; >> > -TUNABLE_INT("hw.ixl.max_queues", &ixl_max_queues); >> > -SYSCTL_INT(_hw_ixl, OID_AUTO, max_queues, CTLFLAG_RDTUN, >> > - &ixl_max_queues, 0, "Number of Queues"); >> > - >> > -/* >> > * Leave this on unless you need to send flow control >> > * frames (or other control frames) from software >> > */ >> > @@ -190,6 +214,13 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, enable_tx_fc_filter, >> > CTL >> > &ixl_enable_tx_fc_filter, 0, >> > "Filter out packets with Ethertype 0x8808 from being sent out by >> > non-HW sources"); >> > >> > +static int ixl_i2c_access_method = 0; >> > +TUNABLE_INT("hw.ixl.i2c_access_method", >> > + &ixl_i2c_access_method); >> > +SYSCTL_INT(_hw_ixl, OID_AUTO, i2c_access_method, CTLFLAG_RDTUN, >> > + &ixl_i2c_access_method, 0, >> > + IXL_SYSCTL_HELP_I2C_METHOD); >> > + >> > /* >> > * Different method for processing TX descriptor >> > * completion. >> > @@ -215,20 +246,22 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, shared_debug_mask, >> > CTLFL >> > &ixl_shared_debug_mask, 0, >> > "Display debug statements that are printed in shared code"); >> > >> > +#if 0 >> > /* >> > ** Controls for Interrupt Throttling >> > ** - true/false for dynamic adjustment >> > ** - default values for static ITR >> > */ >> > -static int ixl_dynamic_rx_itr = 1; >> > +static int ixl_dynamic_rx_itr = 0; >> > TUNABLE_INT("hw.ixl.dynamic_rx_itr", &ixl_dynamic_rx_itr); >> > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_rx_itr, CTLFLAG_RDTUN, >> > &ixl_dynamic_rx_itr, 0, "Dynamic RX Interrupt Rate"); >> > >> > -static int ixl_dynamic_tx_itr = 1; >> > +static int ixl_dynamic_tx_itr = 0; >> > TUNABLE_INT("hw.ixl.dynamic_tx_itr", &ixl_dynamic_tx_itr); >> > SYSCTL_INT(_hw_ixl, OID_AUTO, dynamic_tx_itr, CTLFLAG_RDTUN, >> > &ixl_dynamic_tx_itr, 0, "Dynamic TX Interrupt Rate"); >> > +#endif >> > >> > static int ixl_rx_itr = IXL_ITR_8K; >> > TUNABLE_INT("hw.ixl.rx_itr", &ixl_rx_itr); >> > @@ -256,165 +289,131 @@ SYSCTL_INT(_hw_ixl, OID_AUTO, limit_iwarp_msix, >> > CTLFLA >> > &ixl_limit_iwarp_msix, 0, "Limit MSIX vectors assigned to iWARP"); >> > #endif >> > >> > -#ifdef DEV_NETMAP >> > -#define NETMAP_IXL_MAIN /* only bring in one part of the netmap code */ >> > -#include >> > -#endif /* DEV_NETMAP */ >> > +extern struct if_txrx ixl_txrx_hwb; >> > +extern struct if_txrx ixl_txrx_dwb; >> > >> > -/********************************************************************* >> > - * Device identification routine >> > - * >> > - * ixl_probe determines if the driver should be loaded on >> > - * the hardware based on PCI vendor/device id of the device. >> > - * >> > - * return BUS_PROBE_DEFAULT on success, positive on failure >> > - *********************************************************************/ >> > +static struct if_shared_ctx ixl_sctx_init = { >> > + .isc_magic = IFLIB_MAGIC, >> > + .isc_q_align = PAGE_SIZE, >> > + .isc_tx_maxsize = IXL_TSO_SIZE, >> > + .isc_tx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, >> > >> > -static int >> > -ixl_probe(device_t dev) >> > -{ >> > - ixl_vendor_info_t *ent; >> > + .isc_rx_maxsize = 16384, >> > + .isc_rx_nsegments = IXL_MAX_RX_SEGS, >> > + .isc_rx_maxsegsize = IXL_MAX_DMA_SEG_SIZE, >> > + .isc_nfl = 1, >> > + .isc_ntxqs = 1, >> > + .isc_nrxqs = 1, >> > >> > - u16 pci_vendor_id, pci_device_id; >> > - u16 pci_subvendor_id, pci_subdevice_id; >> > - char device_name[256]; >> > + .isc_admin_intrcnt = 1, >> > + .isc_vendor_info = ixl_vendor_info_array, >> > + .isc_driver_version = IXL_DRIVER_VERSION_STRING, >> > + .isc_driver = &ixl_if_driver, >> > + .isc_flags = IFLIB_NEED_SCRATCH | IFLIB_NEED_ZERO_CSUM | >> > IFLIB_ADMIN_ALWAYS_RUN, >> > >> > -#if 0 >> > - INIT_DEBUGOUT("ixl_probe: begin"); >> > -#endif >> > - pci_vendor_id = pci_get_vendor(dev); >> > - if (pci_vendor_id != I40E_INTEL_VENDOR_ID) >> > - return (ENXIO); >> > + .isc_nrxd_min = {IXL_MIN_RING}, >> > + .isc_ntxd_min = {IXL_MIN_RING}, >> > + .isc_nrxd_max = {IXL_MAX_RING}, >> > + .isc_ntxd_max = {IXL_MAX_RING}, >> > + .isc_nrxd_default = {IXL_DEFAULT_RING}, >> > + .isc_ntxd_default = {IXL_DEFAULT_RING}, >> > +}; >> > >> > - pci_device_id = pci_get_device(dev); >> > - pci_subvendor_id = pci_get_subvendor(dev); >> > - pci_subdevice_id = pci_get_subdevice(dev); >> > +if_shared_ctx_t ixl_sctx = &ixl_sctx_init; >> > >> > - ent = ixl_vendor_info_array; >> > - while (ent->vendor_id != 0) { >> > - if ((pci_vendor_id == ent->vendor_id) && >> > - (pci_device_id == ent->device_id) && >> > - >> > - ((pci_subvendor_id == ent->subvendor_id) || >> > - (ent->subvendor_id == 0)) && >> > - >> > - ((pci_subdevice_id == ent->subdevice_id) || >> > - (ent->subdevice_id == 0))) { >> > - sprintf(device_name, "%s, Version - %s", >> > - ixl_strings[ent->index], >> > - ixl_driver_version); >> > - device_set_desc_copy(dev, device_name); >> > - return (BUS_PROBE_DEFAULT); >> > - } >> > - ent++; >> > - } >> > - return (ENXIO); >> > +/*** Functions ***/ >> > +static void * >> > +ixl_register(device_t dev) >> > +{ >> > + return (ixl_sctx); >> > } >> > >> > -/* >> > - * Sanity check and save off tunable values. >> > - */ >> > static int >> > -ixl_save_pf_tunables(struct ixl_pf *pf) >> > +ixl_allocate_pci_resources(struct ixl_pf *pf) >> > { >> > - device_t dev = pf->dev; >> > + int rid; >> > + struct i40e_hw *hw = &pf->hw; >> > + device_t dev = iflib_get_dev(pf->vsi.ctx); >> > >> > - /* Save tunable information */ >> > - pf->enable_msix = ixl_enable_msix; >> > - pf->max_queues = ixl_max_queues; >> > - pf->enable_tx_fc_filter = ixl_enable_tx_fc_filter; >> > - pf->dynamic_rx_itr = ixl_dynamic_rx_itr; >> > - pf->dynamic_tx_itr = ixl_dynamic_tx_itr; >> > - pf->dbg_mask = ixl_core_debug_mask; >> > - pf->hw.debug_mask = ixl_shared_debug_mask; >> > -#ifdef DEV_NETMAP >> > - if (ixl_enable_head_writeback == 0) >> > - device_printf(dev, "Head writeback mode cannot be >> > disabled " >> > - "when netmap is enabled\n"); >> > - pf->vsi.enable_head_writeback = 1; >> > -#else >> > - pf->vsi.enable_head_writeback = !!(ixl_enable_head_writeback); >> > -#endif >> > + /* Map BAR0 */ >> > + rid = PCIR_BAR(0); >> > + pf->pci_mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, >> > + &rid, RF_ACTIVE); >> > + >> > + if (!(pf->pci_mem)) { >> > + device_printf(dev, "Unable to allocate bus resource: PCI >> > memory\n"); >> > + return (ENXIO); >> > + } >> > >> > - ixl_vsi_setup_rings_size(&pf->vsi, ixl_tx_ring_size, >> > ixl_rx_ring_size); >> > + /* Save off the PCI information */ >> > + hw->vendor_id = pci_get_vendor(dev); >> > + hw->device_id = pci_get_device(dev); >> > + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); >> > + hw->subsystem_vendor_id = >> > + pci_read_config(dev, PCIR_SUBVEND_0, 2); >> > + hw->subsystem_device_id = >> > + pci_read_config(dev, PCIR_SUBDEV_0, 2); >> > >> > - if (ixl_tx_itr < 0 || ixl_tx_itr > IXL_MAX_ITR) { >> > - device_printf(dev, "Invalid tx_itr value of %d set!\n", >> > - ixl_tx_itr); >> > - device_printf(dev, "tx_itr must be between %d and %d, " >> > - "inclusive\n", >> > - 0, IXL_MAX_ITR); >> > - device_printf(dev, "Using default value of %d >> > instead\n", >> > - IXL_ITR_4K); >> > - pf->tx_itr = IXL_ITR_4K; >> > - } else >> > - pf->tx_itr = ixl_tx_itr; >> > + hw->bus.device = pci_get_slot(dev); >> > + hw->bus.func = pci_get_function(dev); >> > >> > - if (ixl_rx_itr < 0 || ixl_rx_itr > IXL_MAX_ITR) { >> > - device_printf(dev, "Invalid rx_itr value of %d set!\n", >> > - ixl_rx_itr); >> > - device_printf(dev, "rx_itr must be between %d and %d, " >> > - "inclusive\n", >> > - 0, IXL_MAX_ITR); >> > - device_printf(dev, "Using default value of %d >> > instead\n", >> > - IXL_ITR_8K); >> > - pf->rx_itr = IXL_ITR_8K; >> > - } else >> > - pf->rx_itr = ixl_rx_itr; >> > + /* Save off register access information */ >> > + pf->osdep.mem_bus_space_tag = >> > + rman_get_bustag(pf->pci_mem); >> > + pf->osdep.mem_bus_space_handle = >> > + rman_get_bushandle(pf->pci_mem); >> > + pf->osdep.mem_bus_space_size = rman_get_size(pf->pci_mem); >> > + pf->osdep.flush_reg = I40E_GLGEN_STAT; >> > + pf->osdep.dev = dev; >> > >> > - return (0); >> > -} >> > + pf->hw.hw_addr = (u8 *) &pf->osdep.mem_bus_space_handle; >> > + pf->hw.back = &pf->osdep; >> > + >> > + return (0); >> > + } >> > >> > -/********************************************************************* >> > - * Device initialization routine >> > - * >> > - * The attach entry point is called when the driver is being loaded. >> > - * This routine identifies the type of hardware, allocates all >> > resources >> > - * and initializes the hardware. >> > - * >> > - * return 0 on success, positive on failure >> > - *********************************************************************/ >> > - >> > static int >> > -ixl_attach(device_t dev) >> > +ixl_if_attach_pre(if_ctx_t ctx) >> > { >> > - struct ixl_pf *pf; >> > - struct i40e_hw *hw; >> > - struct ixl_vsi *vsi; >> > + device_t dev; >> > + struct ixl_pf *pf; >> > + struct i40e_hw *hw; >> > + struct ixl_vsi *vsi; >> > + if_softc_ctx_t scctx; >> > + struct i40e_filter_control_settings filter; >> > enum i40e_status_code status; >> > - int error = 0; >> > + int error = 0; >> > >> > - INIT_DEBUGOUT("ixl_attach: begin"); >> > + INIT_DEBUGOUT("ixl_if_attach_pre: begin"); >> > >> > /* Allocate, clear, and link in our primary soft structure */ >> > - pf = device_get_softc(dev); >> > - pf->dev = pf->osdep.dev = dev; >> > + dev = iflib_get_dev(ctx); >> > + pf = iflib_get_softc(ctx); >> > + vsi = &pf->vsi; >> > + vsi->back = pf; >> > + pf->dev = dev; >> > hw = &pf->hw; >> > >> > /* >> > ** Note this assumes we have a single embedded VSI, >> > ** this could be enhanced later to allocate multiple >> > */ >> > - vsi = &pf->vsi; >> > - vsi->dev = pf->dev; >> > - vsi->back = pf; >> > + //vsi->dev = pf->dev; >> > + vsi->hw = &pf->hw; >> > + vsi->id = 0; >> > + vsi->num_vlans = 0; >> > + vsi->ctx = ctx; >> > + vsi->media = iflib_get_media(ctx); >> > + vsi->shared = scctx = iflib_get_softc_ctx(ctx); >> > >> > /* Save tunable values */ >> > - error = ixl_save_pf_tunables(pf); >> > - if (error) >> > - return (error); >> > + ixl_save_pf_tunables(pf); >> > >> > - /* Core Lock Init*/ >> > - IXL_PF_LOCK_INIT(pf, device_get_nameunit(dev)); >> > - >> > - /* Set up the timer callout */ >> > - callout_init_mtx(&pf->timer, &pf->pf_mtx, 0); >> > - >> > /* Do PCI setup - map BAR0, etc */ >> > if (ixl_allocate_pci_resources(pf)) { >> > device_printf(dev, "Allocation of PCI resources >> > failed\n"); >> > error = ENXIO; >> > - goto err_out; >> > + goto err_pci_res; >> > } >> > >> > /* Establish a clean starting point */ >> > @@ -478,16 +477,11 @@ ixl_attach(device_t dev) >> > /* Get capabilities from the device */ >> > error = ixl_get_hw_capabilities(pf); >> > if (error) { >> > - device_printf(dev, "HW capabilities failure!\n"); >> > + device_printf(dev, "get_hw_capabilities failed: %d\n", >> > + error); >> > goto err_get_cap; >> > } >> > >> > - /* >> > - * Allocate interrupts and figure out number of queues to use >> > - * for PF interface >> > - */ >> > - pf->msix = ixl_init_msix(pf); >> > - >> > /* Set up host memory cache */ >> > status = i40e_init_lan_hmc(hw, hw->func_caps.num_tx_qp, >> > hw->func_caps.num_rx_qp, 0, 0); >> > @@ -496,7 +490,6 @@ ixl_attach(device_t dev) >> > i40e_stat_str(hw, status)); >> > goto err_get_cap; >> > } >> > - >> > status = i40e_configure_lan_hmc(hw, I40E_HMC_MODEL_DIRECT_ONLY); >> > if (status) { >> > device_printf(dev, "configure_lan_hmc failed: %s\n", >> > @@ -504,23 +497,6 @@ ixl_attach(device_t dev) >> > goto err_mac_hmc; >> > } >> > >> > - /* Init queue allocation manager */ >> > - error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); >> > - if (error) { >> > - device_printf(dev, "Failed to init queue manager for PF >> > queues, error %d\n", >> > - error); >> > - goto err_mac_hmc; >> > - } >> > - /* reserve a contiguous allocation for the PF's VSI */ >> > - error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, vsi->num_queues, >> > &pf->qtag); >> > - if (error) { >> > - device_printf(dev, "Failed to reserve queues for PF LAN >> > VSI, error %d\n", >> > - error); >> > - goto err_mac_hmc; >> > - } >> > - device_printf(dev, "Allocating %d queues for PF LAN VSI; %d >> > queues active\n", >> > - pf->qtag.num_allocated, pf->qtag.num_active); >> > - >> > /* Disable LLDP from the firmware for certain NVM versions */ >> > if (((pf->hw.aq.fw_maj_ver == 4) && (pf->hw.aq.fw_min_ver < 3)) >> > || >> > (pf->hw.aq.fw_maj_ver < 4)) { >> > @@ -536,46 +512,120 @@ ixl_attach(device_t dev) >> > goto err_mac_hmc; >> > } >> > bcopy(hw->mac.addr, hw->mac.perm_addr, ETHER_ADDR_LEN); >> > + iflib_set_mac(ctx, hw->mac.addr); >> > i40e_get_port_mac_addr(hw, hw->mac.port_addr); >> > >> > + /* Set up the device filtering */ >> > + bzero(&filter, sizeof(filter)); >> > + filter.enable_ethtype = TRUE; >> > + filter.enable_macvlan = TRUE; >> > + filter.enable_fdir = FALSE; >> > + filter.hash_lut_size = I40E_HASH_LUT_SIZE_512; >> > + if (i40e_set_filter_control(hw, &filter)) >> > + device_printf(dev, "i40e_set_filter_control() >> > failed\n"); >> > + >> > /* Query device FW LLDP status */ >> > ixl_get_fw_lldp_status(pf); >> > /* Tell FW to apply DCB config on link up */ >> > - if ((hw->mac.type != I40E_MAC_X722) >> > - && ((pf->hw.aq.api_maj_ver > 1) >> > - || (pf->hw.aq.api_maj_ver == 1 && pf->hw.aq.api_min_ver >= >> > 7))) >> > - i40e_aq_set_dcb_parameters(hw, true, NULL); >> > + i40e_aq_set_dcb_parameters(hw, true, NULL); >> > >> > - /* Initialize mac filter list for VSI */ >> > - SLIST_INIT(&vsi->ftl); >> > - >> > - /* Set up SW VSI and allocate queue memory and rings */ >> > - if (ixl_setup_stations(pf)) { >> > - device_printf(dev, "setup stations failed!\n"); >> > - error = ENOMEM; >> > - goto err_mac_hmc; >> > + /* Fill out iflib parameters */ >> > + if (hw->mac.type == I40E_MAC_X722) >> > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 128; >> > + else >> > + scctx->isc_ntxqsets_max = scctx->isc_nrxqsets_max = 64; >> > + if (vsi->enable_head_writeback) { >> > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] >> > + * sizeof(struct i40e_tx_desc) + sizeof(u32), >> > DBA_ALIGN); >> > + scctx->isc_txrx = &ixl_txrx_hwb; >> > + } else { >> > + scctx->isc_txqsizes[0] = roundup2(scctx->isc_ntxd[0] >> > + * sizeof(struct i40e_tx_desc), DBA_ALIGN); >> > + scctx->isc_txrx = &ixl_txrx_dwb; >> > } >> > + scctx->isc_rxqsizes[0] = roundup2(scctx->isc_nrxd[0] >> > + * sizeof(union i40e_32byte_rx_desc), DBA_ALIGN); >> > + scctx->isc_msix_bar = PCIR_BAR(IXL_MSIX_BAR); >> > + scctx->isc_tx_nsegments = IXL_MAX_TX_SEGS; >> > + scctx->isc_tx_tso_segments_max = IXL_MAX_TSO_SEGS; >> > + scctx->isc_tx_tso_size_max = IXL_TSO_SIZE; >> > + scctx->isc_tx_tso_segsize_max = IXL_MAX_DMA_SEG_SIZE; >> > + scctx->isc_rss_table_size = pf->hw.func_caps.rss_table_size; >> > + scctx->isc_tx_csum_flags = CSUM_OFFLOAD; >> > + scctx->isc_capenable = IXL_CAPS; >> > >> > + INIT_DEBUGOUT("ixl_if_attach_pre: end"); >> > + return (0); >> > + >> > +err_mac_hmc: >> > + i40e_shutdown_lan_hmc(hw); >> > +err_get_cap: >> > + i40e_shutdown_adminq(hw); >> > +err_out: >> > + ixl_free_pci_resources(pf); >> > +err_pci_res: >> > + return (error); >> > +} >> > + >> > +static int >> > +ixl_if_attach_post(if_ctx_t ctx) >> > +{ >> > + device_t dev; >> > + struct ixl_pf *pf; >> > + struct i40e_hw *hw; >> > + struct ixl_vsi *vsi; >> > + int error = 0; >> > + enum i40e_status_code status; >> > + >> > + INIT_DEBUGOUT("ixl_if_attach_post: begin"); >> > + >> > + dev = iflib_get_dev(ctx); >> > + pf = iflib_get_softc(ctx); >> > + vsi = &pf->vsi; >> > + vsi->ifp = iflib_get_ifp(ctx); >> > + hw = &pf->hw; >> > + >> > /* Setup OS network interface / ifnet */ >> > - if (ixl_setup_interface(dev, vsi)) { >> > + if (ixl_setup_interface(dev, pf)) { >> > device_printf(dev, "interface setup failed!\n"); >> > error = EIO; >> > - goto err_late; >> > + goto err; >> > } >> > >> > /* Determine link state */ >> > if (ixl_attach_get_link_status(pf)) { >> > error = EINVAL; >> > - goto err_late; >> > + goto err; >> > } >> > >> > error = ixl_switch_config(pf); >> > if (error) { >> > device_printf(dev, "Initial ixl_switch_config() failed: >> > %d\n", >> > error); >> > - goto err_late; >> > + goto err; >> > } >> > >> > + /* Add protocol filters to list */ >> > + ixl_init_filters(vsi); >> > + >> > + /* Init queue allocation manager */ >> > + error = ixl_pf_qmgr_init(&pf->qmgr, hw->func_caps.num_tx_qp); >> > + if (error) { >> > + device_printf(dev, "Failed to init queue manager for PF >> > queues, error %d\n", >> > + error); >> > + goto err; >> > + } >> > + /* reserve a contiguous allocation for the PF's VSI */ >> > + error = ixl_pf_qmgr_alloc_contiguous(&pf->qmgr, >> > + max(vsi->num_rx_queues, vsi->num_tx_queues), &pf->qtag); >> > + if (error) { >> > + device_printf(dev, "Failed to reserve queues for PF LAN >> > VSI, error %d\n", >> > + error); >> > + goto err; >> > + } >> > + device_printf(dev, "Allocating %d queues for PF LAN VSI; %d >> > queues active\n", >> > + pf->qtag.num_allocated, pf->qtag.num_active); >> > + >> > /* Limit PHY interrupts to link, autoneg, and modules failure */ >> > status = i40e_aq_set_phy_int_mask(hw, IXL_DEFAULT_PHY_INT_MASK, >> > NULL); >> > @@ -583,91 +633,35 @@ ixl_attach(device_t dev) >> > device_printf(dev, "i40e_aq_set_phy_mask() failed: err >> > %s," >> > " aq_err %s\n", i40e_stat_str(hw, status), >> > i40e_aq_str(hw, hw->aq.asq_last_status)); >> > - goto err_late; >> > + goto err; >> > } >> > >> > - /* Get the bus configuration and set the shared code's config */ >> > + /* Get the bus configuration and set the shared code */ >> > ixl_get_bus_info(pf); >> > >> > - /* >> > - * In MSI-X mode, initialize the Admin Queue interrupt, >> > - * so userland tools can communicate with the adapter regardless >> > of >> > - * the ifnet interface's status. >> > - */ >> > - if (pf->msix > 1) { >> > - error = ixl_setup_adminq_msix(pf); >> > - if (error) { >> > - device_printf(dev, "ixl_setup_adminq_msix() >> > error: %d\n", >> > - error); >> > - goto err_late; >> > - } >> > - error = ixl_setup_adminq_tq(pf); >> > - if (error) { >> > - device_printf(dev, "ixl_setup_adminq_tq() error: >> > %d\n", >> > - error); >> > - goto err_late; >> > - } >> > - ixl_configure_intr0_msix(pf); >> > - ixl_enable_intr0(hw); >> > - >> > - error = ixl_setup_queue_msix(vsi); >> > - if (error) >> > - device_printf(dev, "ixl_setup_queue_msix() >> > error: %d\n", >> > - error); >> > - error = ixl_setup_queue_tqs(vsi); >> > - if (error) >> > - device_printf(dev, "ixl_setup_queue_tqs() error: >> > %d\n", >> > - error); >> > - } else { >> > - error = ixl_setup_legacy(pf); >> > - >> > - error = ixl_setup_adminq_tq(pf); >> > - if (error) { >> > - device_printf(dev, "ixl_setup_adminq_tq() error: >> > %d\n", >> > - error); >> > - goto err_late; >> > - } >> > - >> > - error = ixl_setup_queue_tqs(vsi); >> > - if (error) >> > - device_printf(dev, "ixl_setup_queue_tqs() error: >> > %d\n", >> > - error); >> > + /* Keep admin queue interrupts active while driver is loaded */ >> > + if (vsi->shared->isc_intr == IFLIB_INTR_MSIX) { >> > + ixl_configure_intr0_msix(pf); >> > + ixl_enable_intr0(hw); >> > } >> > >> > - if (error) { >> > - device_printf(dev, "interrupt setup error: %d\n", >> > error); >> > - } >> > - >> > /* Set initial advertised speed sysctl value */ >> > ixl_set_initial_advertised_speeds(pf); >> > >> > /* Initialize statistics & add sysctls */ >> > ixl_add_device_sysctls(pf); >> > - >> > ixl_pf_reset_stats(pf); >> > ixl_update_stats_counters(pf); >> > ixl_add_hw_stats(pf); >> > >> > - /* Register for VLAN events */ >> > - vsi->vlan_attach = EVENTHANDLER_REGISTER(vlan_config, >> > - ixl_register_vlan, vsi, EVENTHANDLER_PRI_FIRST); >> > - vsi->vlan_detach = EVENTHANDLER_REGISTER(vlan_unconfig, >> > - ixl_unregister_vlan, vsi, EVENTHANDLER_PRI_FIRST); >> > + hw->phy.get_link_info = true; >> > + i40e_get_link_status(hw, &pf->link_up); >> > + ixl_update_link_status(pf); >> > >> > #ifdef PCI_IOV >> > ixl_initialize_sriov(pf); >> > #endif >> > >> > -#ifdef DEV_NETMAP >> > - if (vsi->num_rx_desc == vsi->num_tx_desc) { >> > - vsi->queues[0].num_desc = vsi->num_rx_desc; >> > - ixl_netmap_attach(vsi); >> > - } else >> > - device_printf(dev, >> > - "Netmap is not supported when RX and TX descriptor >> > ring sizes differ\n"); >> > - >> > -#endif /* DEV_NETMAP */ >> > - >> > #ifdef IXL_IW >> > if (hw->func_caps.iwarp && ixl_enable_iwarp) { >> > pf->iw_enabled = (pf->iw_msix > 0) ? true : false; >> > @@ -677,7 +671,7 @@ ixl_attach(device_t dev) >> > device_printf(dev, >> > "interfacing to iwarp driver failed: >> > %d\n", >> > error); >> > - goto err_late; >> > + goto err; >> > } else >> > device_printf(dev, "iWARP ready\n"); >> > } else >> > @@ -689,54 +683,38 @@ ixl_attach(device_t dev) >> > } >> > #endif >> > >> > - INIT_DEBUGOUT("ixl_attach: end"); >> > + INIT_DBG_DEV(dev, "end"); >> > return (0); >> > >> > -err_late: >> > - if (vsi->ifp != NULL) { >> > - ether_ifdetach(vsi->ifp); >> > - if_free(vsi->ifp); >> > - } >> > -err_mac_hmc: >> > - i40e_shutdown_lan_hmc(hw); >> > -err_get_cap: >> > - i40e_shutdown_adminq(hw); >> > -err_out: >> > - ixl_free_pci_resources(pf); >> > - ixl_free_vsi(vsi); >> > - IXL_PF_LOCK_DESTROY(pf); >> > +err: >> > + INIT_DEBUGOUT("end: error %d", error); >> > + /* ixl_if_detach() is called on error from this */ >> > return (error); >> > } >> > >> > -/********************************************************************* >> > - * Device removal routine >> > - * >> > - * The detach entry point is called when the driver is being removed. >> > - * This routine stops the adapter and deallocates all the resources >> > - * that were allocated for driver operation. >> > - * >> > - * return 0 on success, positive on failure >> > - *********************************************************************/ >> > - >> > static int >> > -ixl_detach(device_t dev) >> > +ixl_if_detach(if_ctx_t ctx) >> > { >> > - struct ixl_pf *pf = device_get_softc(dev); >> > - struct i40e_hw *hw = &pf->hw; >> > - struct ixl_vsi *vsi = &pf->vsi; >> > + struct ixl_pf *pf = iflib_get_softc(ctx); >> > + struct ixl_vsi *vsi = &pf->vsi; >> > + struct i40e_hw *hw = &pf->hw; >> > + device_t dev = pf->dev; >> > enum i40e_status_code status; >> > #if defined(PCI_IOV) || defined(IXL_IW) >> > int error; >> > #endif >> > >> > - INIT_DEBUGOUT("ixl_detach: begin"); >> > + INIT_DBG_DEV(dev, "begin"); >> > >> > - /* Make sure VLANS are not using driver */ >> > - if (vsi->ifp->if_vlantrunk != NULL) { >> > - device_printf(dev, "Vlan in use, detach first\n"); >> > - return (EBUSY); >> > +#ifdef IXL_IW >> > + if (ixl_enable_iwarp && pf->iw_enabled) { >> > + error = ixl_iw_pf_detach(pf); >> > + if (error == EBUSY) { >> > + device_printf(dev, "iwarp in use; stop it >> > first.\n"); >> > + return (error); >> > + } >> > } >> > - >> > +#endif >> > #ifdef PCI_IOV >> > error = pci_iov_detach(dev); >> > if (error != 0) { >> > @@ -744,73 +722,989 @@ ixl_detach(device_t dev) >> > return (error); >> > } >> > #endif >> > - >> > /* Remove all previously allocated media types */ >> > - ifmedia_removeall(&vsi->media); >> > + ifmedia_removeall(vsi->media); >> > >> > - ether_ifdetach(vsi->ifp); >> > - if (vsi->ifp->if_drv_flags & IFF_DRV_RUNNING) >> > - ixl_stop(pf); >> > - >> > /* Shutdown LAN HMC */ >> > - status = i40e_shutdown_lan_hmc(hw); >> > - if (status) >> > - device_printf(dev, >> > - "Shutdown LAN HMC failed with code %d\n", status); >> > + if (hw->hmc.hmc_obj) { >> > + status = i40e_shutdown_lan_hmc(hw); >> > + if (status) >> > + device_printf(dev, >> > + "i40e_shutdown_lan_hmc() failed with status >> > %s\n", >> > + i40e_stat_str(hw, status)); >> > + } >> > >> > - /* Teardown LAN queue resources */ >> > - ixl_teardown_queue_msix(vsi); >> > - ixl_free_queue_tqs(vsi); >> > /* Shutdown admin queue */ >> > ixl_disable_intr0(hw); >> > - ixl_teardown_adminq_msix(pf); >> > - ixl_free_adminq_tq(pf); >> > status = i40e_shutdown_adminq(hw); >> > if (status) >> > device_printf(dev, >> > - "Shutdown Admin queue failed with code %d\n", >> > status); >> > + "i40e_shutdown_adminq() failed with status %s\n", >> > + i40e_stat_str(hw, status)); >> > >> > - /* Unregister VLAN events */ >> > - if (vsi->vlan_attach != NULL) >> > - EVENTHANDLER_DEREGISTER(vlan_config, vsi->vlan_attach); >> > - if (vsi->vlan_detach != NULL) >> > - EVENTHANDLER_DEREGISTER(vlan_unconfig, >> > vsi->vlan_detach); >> > + ixl_pf_qmgr_destroy(&pf->qmgr); >> > + ixl_free_pci_resources(pf); >> > + ixl_free_mac_filters(vsi); >> > + INIT_DBG_DEV(dev, "end"); >> > + return (0); >> > +} >> > >> > >> > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** >> > From owner-svn-src-all@freebsd.org Tue Jun 19 03:11:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 508401017D4B; Tue, 19 Jun 2018 03:11:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 031E08619A; Tue, 19 Jun 2018 03:11:10 +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 DA13E5B93; Tue, 19 Jun 2018 03:11:09 +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 w5J3B9qN068417; Tue, 19 Jun 2018 03:11:09 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J3B9wP068416; Tue, 19 Jun 2018 03:11:09 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806190311.w5J3B9wP068416@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Tue, 19 Jun 2018 03:11:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335358 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335358 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 03:11:10 -0000 Author: erj Date: Tue Jun 19 03:11:09 2018 New Revision: 335358 URL: https://svnweb.freebsd.org/changeset/base/335358 Log: ixl(4): Remove ixlvc.c from files.amd64 ixlvc.c is only used by the VF driver (ixlv), and that driver currently doesn't work. It will be re-added once the VF driver is finished being ported to iflib. Modified: head/sys/conf/files.amd64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Jun 19 02:48:53 2018 (r335357) +++ head/sys/conf/files.amd64 Tue Jun 19 03:11:09 2018 (r335358) @@ -274,8 +274,8 @@ dev/ixl/ixl_pf_i2c.c optional ixl pci \ # compile-with "${NORMAL_C} -I$S/dev/ixl" #dev/ixl/if_ixlv.c optional ixlv pci \ # compile-with "${NORMAL_C} -I$S/dev/ixl" -dev/ixl/ixlvc.c optional ixlv pci \ - compile-with "${NORMAL_C} -I$S/dev/ixl" +#dev/ixl/ixlvc.c optional ixlv pci \ +# compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/ixl_txrx.c optional ixl pci | ixlv pci \ compile-with "${NORMAL_C} -I$S/dev/ixl" dev/ixl/i40e_osdep.c optional ixl pci | ixlv pci \ From owner-svn-src-all@freebsd.org Tue Jun 19 04:18:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97F87101C51F; Tue, 19 Jun 2018 04:18:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9D868A15; Tue, 19 Jun 2018 04:18:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BA1E664A; Tue, 19 Jun 2018 04:18:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J4INtS002839; Tue, 19 Jun 2018 04:18:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J4IN4L002838; Tue, 19 Jun 2018 04:18:23 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806190418.w5J4IN4L002838@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Jun 2018 04:18:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335359 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335359 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 04:18:24 -0000 Author: eadler Date: Tue Jun 19 04:18:23 2018 New Revision: 335359 URL: https://svnweb.freebsd.org/changeset/base/335359 Log: top(1): correct header in UP mode Fix an oversight from r334869 which made the same change, but only for SMP systems. This avoids a segfault while D15801 is being reviewed. Reviewed by: kevans Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue Jun 19 03:11:09 2018 (r335358) +++ head/usr.bin/top/machine.c Tue Jun 19 04:18:23 2018 (r335359) @@ -87,7 +87,7 @@ struct handle { */ static const char io_header[] = - " PID%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; + " %s%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; static const char io_Proc_format[] = "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; @@ -103,7 +103,7 @@ static const char smp_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; static char up_header_thr_and_pid[] = - " PID%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; + " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_header_id_only[] = " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_Proc_format[] = From owner-svn-src-all@freebsd.org Tue Jun 19 05:01:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC7B4101EF51; Tue, 19 Jun 2018 05:01:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F75F6A19D; Tue, 19 Jun 2018 05:01:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 820F26D7E; Tue, 19 Jun 2018 05:01:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5J518sP026395; Tue, 19 Jun 2018 05:01:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J5188t026394; Tue, 19 Jun 2018 05:01:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806190501.w5J5188t026394@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Jun 2018 05:01:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335360 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335360 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 05:01:09 -0000 Author: eadler Date: Tue Jun 19 05:01:07 2018 New Revision: 335360 URL: https://svnweb.freebsd.org/changeset/base/335360 Log: top(1): correct assertion Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Tue Jun 19 04:18:23 2018 (r335359) +++ head/usr.bin/top/top.c Tue Jun 19 05:01:07 2018 (r335360) @@ -1169,7 +1169,7 @@ restart: clear_message(); break; case CMD_NONE: - assert("reached switch without command"); + assert(false && "reached switch without command"); } } } From owner-svn-src-all@freebsd.org Tue Jun 19 05:27:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16A691020843 for ; Tue, 19 Jun 2018 05:27:01 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B113B6B178 for ; Tue, 19 Jun 2018 05:27:00 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 7AEA319866 for ; Tue, 19 Jun 2018 05:27:00 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f170.google.com with SMTP id j134-v6so6467228ywg.4 for ; Mon, 18 Jun 2018 22:27:00 -0700 (PDT) X-Gm-Message-State: APt69E1UORaKW6wOopplRnRiUkxAsIxVHimmBHt+shrHDVNrV1W7yD2K UB1kuzgOdYnnf+eet+Es5510uh7rqZq0vVJwjIWcUg== X-Google-Smtp-Source: ADUXVKJWd3EW80zhhUjv4tKxtG0Vn5pJOAltK7i+SnsLFldP1lOc4EN9CAhrxsIqOrRqabZKDv22Kn1V69aflTroGFk= X-Received: by 2002:a81:b70b:: with SMTP id v11-v6mr7064879ywh.182.1529386019871; Mon, 18 Jun 2018 22:26:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 22:26:29 -0700 (PDT) In-Reply-To: <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> From: Eitan Adler Date: Mon, 18 Jun 2018 22:26:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335278 - head/bin/pwd To: John Baldwin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 05:27:01 -0000 On 18 June 2018 at 10:57, John Baldwin wrote: > On 6/16/18 10:14 PM, Eitan Adler wrote: >> Author: eadler >> Date: Sun Jun 17 05:14:50 2018 >> New Revision: 335278 >> URL: https://svnweb.freebsd.org/changeset/base/335278 >> >> Log: >> pwd: mark usage as dead > > You keep committing changes like this and ignoring e-mails about them. I replied both the first time and this time. I may have (accidentally?) ignored similar emails though. The question I have is other than the mild code churn what's the harm? > What broken compiler are you using that doesn't properly inherit __dead2 > from the call to exit()? In this case, scan-build50 was getting annoyed. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Tue Jun 19 05:28:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D52751020950; Tue, 19 Jun 2018 05:28:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87DA96B322; Tue, 19 Jun 2018 05:28:15 +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 691807241; Tue, 19 Jun 2018 05:28:15 +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 w5J5SFs7038598; Tue, 19 Jun 2018 05:28:15 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5J5SFYh038597; Tue, 19 Jun 2018 05:28:15 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806190528.w5J5SFYh038597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 19 Jun 2018 05:28:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335361 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335361 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 05:28:16 -0000 Author: rrs Date: Tue Jun 19 05:28:14 2018 New Revision: 335361 URL: https://svnweb.freebsd.org/changeset/base/335361 Log: Move the tp set back to where it was before we started playing with the VNET sets. This way we have verified the INP settings before we go to the trouble of de-referencing it. Reviewed by: and suggested by lstewart Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_hpts.c Modified: head/sys/netinet/tcp_hpts.c ============================================================================== --- head/sys/netinet/tcp_hpts.c Tue Jun 19 05:01:07 2018 (r335360) +++ head/sys/netinet/tcp_hpts.c Tue Jun 19 05:28:14 2018 (r335361) @@ -1158,7 +1158,6 @@ tcp_input_data(struct tcp_hpts_entry *hpts, struct tim hpts->p_inp = inp; drop_reason = inp->inp_hpts_drop_reas; inp->inp_in_input = 0; - tp = intotcpcb(inp); mtx_unlock(&hpts->p_mtx); CURVNET_SET(inp->inp_vnet); if (drop_reason) { @@ -1183,6 +1182,7 @@ out: mtx_lock(&hpts->p_mtx); continue; } + tp = intotcpcb(inp); if ((tp == NULL) || (tp->t_inpcb == NULL)) { goto out; } From owner-svn-src-all@freebsd.org Tue Jun 19 05:43:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0986610219C0 for ; Tue, 19 Jun 2018 05:43:53 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8A4C6BFCA for ; Tue, 19 Jun 2018 05:43:52 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com [209.85.161.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 71AD819A80 for ; Tue, 19 Jun 2018 05:43:52 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yw0-f171.google.com with SMTP id t198-v6so6476476ywc.3 for ; Mon, 18 Jun 2018 22:43:52 -0700 (PDT) X-Gm-Message-State: APt69E3vAk/AQVjqwsMdBw6/dnpKRp5NnSsgRGa2qdQmClwgWHt4AEGh o1P5+I1Q01+XNoERVFAX9KGvekib4+RKynWyfwNkqQ== X-Google-Smtp-Source: ADUXVKLLMO0+jXDoVa35/Gy3KdtglhZpewee5E6JwJquW3H4j+PaQ4hAQ1huWRHAvmqjMu1am5QsUrcESEFuLnshZN4= X-Received: by 2002:a0d:e812:: with SMTP id r18-v6mr7619119ywe.19.1529387032053; Mon, 18 Jun 2018 22:43:52 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 22:43:21 -0700 (PDT) In-Reply-To: <201806030651.w536pCYd089861@pdx.rh.CN85.dnsmgr.net> References: <201806030651.w536pCYd089861@pdx.rh.CN85.dnsmgr.net> From: Eitan Adler Date: Mon, 18 Jun 2018 22:43:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r334540 - head/usr.bin/top To: "Rodney W. Grimes" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 05:43:53 -0000 On 2 June 2018 at 23:51, Rodney W. Grimes wrote: > [ Charset UTF-8 unsupported, converting... ] >> On 2 June 2018 at 21:14, Rodney W. Grimes >> wrote: >> >> On 2 June 2018 at 16:53, Rodney W. Grimes >> >> wrote: >> >> > [ Charset UTF-8 unsupported, converting... ] >> >> >> Author: eadler >> >> >> Date: Sat Jun 2 21:40:45 2018 >> >> >> New Revision: 334540 >> >> >> URL: https://svnweb.freebsd.org/changeset/base/334540 >> >> >> >> >> >> Log: >> >> >> top(1): cleanup memory allocation and warnings >> >> >> >> >> >> - Prefer calloc over malloc. This is more predicable and we're not in a >> >> >> performance sensitive context. [1] >> >> >> - Remove bogus comment (obsolete from prior commit). [2] >> >> >> - Remove void casts and type casts of NULL >> >> >> - Remove redundant declaration of 'quit' >> >> >> - Add additional const >> >> >> >> >> >> Reported by: kib [1], vangyzen [2] >> >> >> >> >> >> Modified: >> >> >> head/usr.bin/top/display.c >> >> >> head/usr.bin/top/machine.c >> >> >> head/usr.bin/top/screen.c >> >> >> head/usr.bin/top/screen.h >> >> >> head/usr.bin/top/utils.c >> >> > ... >> >> > >> >> >> >> >> >> Modified: head/usr.bin/top/screen.c >> >> >> ============================================================================== >> >> >> --- head/usr.bin/top/screen.c Sat Jun 2 21:16:20 2018 (r334539) >> >> >> +++ head/usr.bin/top/screen.c Sat Jun 2 21:40:45 2018 (r334540) >> >> >> @@ -3,7 +3,7 @@ >> >> >> * Version 3 >> >> >> * >> >> >> * This program may be freely redistributed, >> >> >> - * but this entire comment MUST remain intact. >> >> >> + * but this entire ceomment MUST remain intact. >> >> > >> >> > I know you have already fixed this spelling error, >> >> > but I believe there are some other commits that actually >> >> > removed either this string, or some part of "this entire" >> >> > comment that is to "remain intact". >> >> >> >> I just went through my commits to top(1) and don't see any others. Did >> >> I miss any? >> > >> > Index: commands.c >> > =================================================================== >> > --- commands.c (revision 333898) >> > +++ commands.c (working copy) >> > @@ -1,6 +1,5 @@ >> > /* >> > * Top users/processes display for Unix >> > - * Version 3 >> > * >> > * This program may be freely redistributed, >> > * but this entire comment MUST remain intact. >> > >> > Found with a cd usr.bin/top; svn diff -r 333898 which is >> > when you moved it to usr.bin. Further investigation >> > shows that this line was deleted at r333909. >> >> I removed the version line, not the license line. Do you believe >> "entire comment" includes the version information? > > I would interpret entire to be anything between /* and */. Sorry about the delay in responding: there was some ongoing conversations with core@ about the licensing of top(1). While that assertion isn't clear, I also don't think it's harmful to restore. I'll do so in my next pass. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Tue Jun 19 10:34:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 474E7100EA5C; Tue, 19 Jun 2018 10:34:46 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAD0978A28; Tue, 19 Jun 2018 10:34:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC2341254D; Tue, 19 Jun 2018 10:34:45 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JAYjZg098594; Tue, 19 Jun 2018 10:34:45 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JAYjpx098593; Tue, 19 Jun 2018 10:34:45 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806191034.w5JAYjpx098593@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Tue, 19 Jun 2018 10:34:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335362 - head/sys/net X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sys/net X-SVN-Commit-Revision: 335362 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 10:34:46 -0000 Author: ae Date: Tue Jun 19 10:34:45 2018 New Revision: 335362 URL: https://svnweb.freebsd.org/changeset/base/335362 Log: Move BPFIF_* macro definitions into .c file, where struct bpf_if is declared. They are only used in this file and there is no need to export them via bpfdesc.h. Modified: head/sys/net/bpf.c head/sys/net/bpfdesc.h Modified: head/sys/net/bpf.c ============================================================================== --- head/sys/net/bpf.c Tue Jun 19 05:28:14 2018 (r335361) +++ head/sys/net/bpf.c Tue Jun 19 10:34:45 2018 (r335362) @@ -117,6 +117,11 @@ struct bpf_if { CTASSERT(offsetof(struct bpf_if, bif_ext) == 0); +#define BPFIF_RLOCK(bif) rw_rlock(&(bif)->bif_lock) +#define BPFIF_RUNLOCK(bif) rw_runlock(&(bif)->bif_lock) +#define BPFIF_WLOCK(bif) rw_wlock(&(bif)->bif_lock) +#define BPFIF_WUNLOCK(bif) rw_wunlock(&(bif)->bif_lock) + #if defined(DEV_BPF) || defined(NETGRAPH_BPF) #define PRINET 26 /* interruptible */ Modified: head/sys/net/bpfdesc.h ============================================================================== --- head/sys/net/bpfdesc.h Tue Jun 19 05:28:14 2018 (r335361) +++ head/sys/net/bpfdesc.h Tue Jun 19 10:34:45 2018 (r335362) @@ -152,11 +152,6 @@ struct xbpf_d { u_int64_t bd_spare[4]; }; -#define BPFIF_RLOCK(bif) rw_rlock(&(bif)->bif_lock) -#define BPFIF_RUNLOCK(bif) rw_runlock(&(bif)->bif_lock) -#define BPFIF_WLOCK(bif) rw_wlock(&(bif)->bif_lock) -#define BPFIF_WUNLOCK(bif) rw_wunlock(&(bif)->bif_lock) - #define BPFIF_FLAG_DYING 1 /* Reject new bpf consumers */ #endif From owner-svn-src-all@freebsd.org Tue Jun 19 11:06:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EE571010EFD; Tue, 19 Jun 2018 11:06:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A6BD7A2C8; Tue, 19 Jun 2018 11:06:37 +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 0CEB812A64; Tue, 19 Jun 2018 11:06:37 +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 w5JB6aDF013761; Tue, 19 Jun 2018 11:06:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JB6arZ013760; Tue, 19 Jun 2018 11:06:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806191106.w5JB6arZ013760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 19 Jun 2018 11:06:36 +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: r335363 - stable/11/sys/compat/linuxkpi/common/include/net X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/net X-SVN-Commit-Revision: 335363 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 11:06:37 -0000 Author: hselasky Date: Tue Jun 19 11:06:36 2018 New Revision: 335363 URL: https://svnweb.freebsd.org/changeset/base/335363 Log: MFC r334993: Implement the ip_eth_mc_map() function in the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/net/ip.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/net/ip.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/net/ip.h Tue Jun 19 10:34:45 2018 (r335362) +++ stable/11/sys/compat/linuxkpi/common/include/net/ip.h Tue Jun 19 11:06:36 2018 (r335363) @@ -58,6 +58,20 @@ inet_get_local_port_range(struct vnet *vnet, int *low, } static inline void +ip_eth_mc_map(uint32_t addr, char *buf) +{ + + addr = ntohl(addr); + + buf[0] = 0x01; + buf[1] = 0x00; + buf[2] = 0x5e; + buf[3] = (addr >> 16) & 0x7f; + buf[4] = (addr >> 8) & 0xff; + buf[5] = (addr & 0xff); +} + +static inline void ip_ib_mc_map(uint32_t addr, const unsigned char *bcast, char *buf) { unsigned char scope; From owner-svn-src-all@freebsd.org Tue Jun 19 11:20:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24B5B10120FE; Tue, 19 Jun 2018 11:20:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CAA5D7ACFD; Tue, 19 Jun 2018 11:20:28 +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 AD0DC12C11; Tue, 19 Jun 2018 11:20:28 +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 w5JBKS5o019321; Tue, 19 Jun 2018 11:20:28 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JBKSeF019320; Tue, 19 Jun 2018 11:20:28 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806191120.w5JBKSeF019320@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Tue, 19 Jun 2018 11:20:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335364 - 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: 335364 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 11:20:29 -0000 Author: rrs Date: Tue Jun 19 11:20:28 2018 New Revision: 335364 URL: https://svnweb.freebsd.org/changeset/base/335364 Log: Make sure that the t_peakrate_thr is not compiled in by default until NF can upstream it. Reviewed by: and suggested lstewart Sponsored by: Netflix Inc. Modified: head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Tue Jun 19 11:06:36 2018 (r335363) +++ head/sys/netinet/tcp_stacks/rack.c Tue Jun 19 11:20:28 2018 (r335364) @@ -1206,7 +1206,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r tp->t_stats_gput_prev); tp->t_flags &= ~TF_GPUTINPROG; tp->t_stats_gput_prev = gput; - +#ifdef NETFLIX_CWV if (tp->t_maxpeakrate) { /* * We update t_peakrate_thr. This gives us roughly @@ -1214,6 +1214,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r */ tcp_update_peakrate_thr(tp); } +#endif } #endif if (tp->snd_cwnd > tp->snd_ssthresh) { @@ -1267,11 +1268,11 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *r tcp_newcwv_update_pipeack(tp, data); } } -#endif /* we enforce max peak rate if it is set. */ if (tp->t_peakrate_thr && tp->snd_cwnd > tp->t_peakrate_thr) { tp->snd_cwnd = tp->t_peakrate_thr; } +#endif } static void From owner-svn-src-all@freebsd.org Tue Jun 19 11:23:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E54631012503; Tue, 19 Jun 2018 11:23:48 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 965517B2FC; Tue, 19 Jun 2018 11:23:48 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7629112DB3; Tue, 19 Jun 2018 11:23:48 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JBNmpv024104; Tue, 19 Jun 2018 11:23:48 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JBNmIx024103; Tue, 19 Jun 2018 11:23:48 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806191123.w5JBNmIx024103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 19 Jun 2018 11:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335365 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 335365 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 11:23:49 -0000 Author: kibab Date: Tue Jun 19 11:23:48 2018 New Revision: 335365 URL: https://svnweb.freebsd.org/changeset/base/335365 Log: Set MMC_DATA_MULTI flag when doing multi-block transfers Lower layers (MMC / SDHCI controller drivers) may make certain decisions based on the presence of this flag. The fact that sdhci.c doesn't look at this flag is another problem that should be fixed separately. Found when adding MMCCAM support to AllWinner MMC controller driver where the presence of this flag actually matters. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15888 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Jun 19 11:20:28 2018 (r335364) +++ head/sys/cam/mmc/mmc_da.c Tue Jun 19 11:23:48 2018 (r335365) @@ -1778,6 +1778,7 @@ sddastart(struct cam_periph *periph, union ccb *start_ mmcio->cmd.data->flags = (bp->bio_cmd == BIO_READ ? MMC_DATA_READ : MMC_DATA_WRITE); /* Direct h/w to issue CMD12 upon completion */ if (count > 1) { + mmcio->cmd.data->flags |= MMC_DATA_MULTI; mmcio->stop.opcode = MMC_STOP_TRANSMISSION; mmcio->stop.flags = MMC_RSP_R1B | MMC_CMD_AC; mmcio->stop.arg = 0; From owner-svn-src-all@freebsd.org Tue Jun 19 11:25:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0998C10126C9; Tue, 19 Jun 2018 11:25:41 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AC5967B4AF; Tue, 19 Jun 2018 11:25:40 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8D8DF12DB9; Tue, 19 Jun 2018 11:25:40 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JBPedl024224; Tue, 19 Jun 2018 11:25:40 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JBPe5X024223; Tue, 19 Jun 2018 11:25:40 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806191125.w5JBPe5X024223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 19 Jun 2018 11:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335366 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 335366 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 11:25:41 -0000 Author: kibab Date: Tue Jun 19 11:25:40 2018 New Revision: 335366 URL: https://svnweb.freebsd.org/changeset/base/335366 Log: Correctly define rawscr so initializing it doesn't result in overwriting memory. We need 8 bytes of storage for rawscr. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15889 Modified: head/sys/cam/mmc/mmc_da.c Modified: head/sys/cam/mmc/mmc_da.c ============================================================================== --- head/sys/cam/mmc/mmc_da.c Tue Jun 19 11:23:48 2018 (r335365) +++ head/sys/cam/mmc/mmc_da.c Tue Jun 19 11:25:40 2018 (r335366) @@ -818,6 +818,7 @@ mmc_app_get_scr(struct cam_periph *periph, union ccb * struct mmc_data d; memset(&cmd, 0, sizeof(cmd)); + memset(&d, 0, sizeof(d)); memset(rawscr, 0, 8); cmd.opcode = ACMD_SEND_SCR; @@ -1296,13 +1297,13 @@ sdda_start_init(void *context, union ccb *start_ccb) /* Find out if the card supports High speed timing */ if (mmcp->card_features & CARD_FEATURE_SD20) { /* Get and decode SCR */ - uint32_t rawscr; + uint32_t rawscr[2]; uint8_t res[64]; - if (mmc_app_get_scr(periph, start_ccb, &rawscr)) { + if (mmc_app_get_scr(periph, start_ccb, rawscr)) { CAM_DEBUG(periph->path, CAM_DEBUG_PERIPH, ("Cannot get SCR\n")); goto finish_hs_tests; } - mmc_app_decode_scr(&rawscr, &softc->scr); + mmc_app_decode_scr(rawscr, &softc->scr); if ((softc->scr.sda_vsn >= 1) && (softc->csd.ccc & (1<<10))) { mmc_sd_switch(periph, start_ccb, SD_SWITCH_MODE_CHECK, From owner-svn-src-all@freebsd.org Tue Jun 19 11:28:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B87A51012949; Tue, 19 Jun 2018 11:28:51 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A597B69E; Tue, 19 Jun 2018 11:28:51 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 480C212DC5; Tue, 19 Jun 2018 11:28:51 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JBSpO0024381; Tue, 19 Jun 2018 11:28:51 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JBSpWo024380; Tue, 19 Jun 2018 11:28:51 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806191128.w5JBSpWo024380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 19 Jun 2018 11:28:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335367 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 335367 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 11:28:51 -0000 Author: kibab Date: Tue Jun 19 11:28:50 2018 New Revision: 335367 URL: https://svnweb.freebsd.org/changeset/base/335367 Log: Don't try to turn power down MMC bus if it is already down Regulator framework doens't like turning off already turned off regulators, so we get panic on AllWinner boards. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15890 Modified: head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Jun 19 11:25:40 2018 (r335366) +++ head/sys/cam/mmc/mmc_xpt.c Tue Jun 19 11:28:50 2018 (r335367) @@ -574,14 +574,16 @@ mmcprobe_start(struct cam_periph *periph, union ccb *s /* FALLTHROUGH */ case PROBE_IDENTIFY: xpt_path_inq(&start_ccb->cpi, periph->path); - CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_PROBE, ("Start with PROBE_RESET\n")); - init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); - cts->ios.power_mode = power_off; - cts->ios_valid = MMC_PM; + init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); xpt_action(start_ccb); - mtx_sleep(periph, p_mtx, 0, "mmcios", 100); - + if (cts->ios.power_mode != power_off) { + init_standard_ccb(start_ccb, XPT_SET_TRAN_SETTINGS); + cts->ios.power_mode = power_off; + cts->ios_valid = MMC_PM; + xpt_action(start_ccb); + mtx_sleep(periph, p_mtx, 0, "mmcios", 100); + } /* mmc_power_up */ /* Get the host OCR */ init_standard_ccb(start_ccb, XPT_GET_TRAN_SETTINGS); From owner-svn-src-all@freebsd.org Tue Jun 19 12:16:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4239B1015CDE; Tue, 19 Jun 2018 12:16:20 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DB20F7D92A; Tue, 19 Jun 2018 12:16:19 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B641F135F2; Tue, 19 Jun 2018 12:16:19 +0000 (UTC) (envelope-from pi@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JCGJY2049248; Tue, 19 Jun 2018 12:16:19 GMT (envelope-from pi@FreeBSD.org) Received: (from pi@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JCGJ2G049247; Tue, 19 Jun 2018 12:16:19 GMT (envelope-from pi@FreeBSD.org) Message-Id: <201806191216.w5JCGJ2G049247@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pi set sender to pi@FreeBSD.org using -f From: Kurt Jaeger Date: Tue, 19 Jun 2018 12:16:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335368 - head/share/misc X-SVN-Group: head X-SVN-Commit-Author: pi X-SVN-Commit-Paths: head/share/misc X-SVN-Commit-Revision: 335368 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 12:16:20 -0000 Author: pi (ports committer) Date: Tue Jun 19 12:16:19 2018 New Revision: 335368 URL: https://svnweb.freebsd.org/changeset/base/335368 Log: share/misc/organization.dot: updates - add krion, philip to postmaster@ - remove trhodes from donations@, email bounces Approved by: remko Modified: head/share/misc/organization.dot Modified: head/share/misc/organization.dot ============================================================================== --- head/share/misc/organization.dot Tue Jun 19 11:28:50 2018 (r335367) +++ head/share/misc/organization.dot Tue Jun 19 12:16:19 2018 (r335368) @@ -48,13 +48,13 @@ clusteradm [label="Cluster Administrators\nclusteradm@ dnsadm [label="DNS Administrators\ndnsadm@FreeBSD.org\nbillf, dg, ps,\nkensmith, peter"] mirroradmin [label="FTP/WWW Mirror Site Coordinators\nmirror-admin@FreeBSD.org\nkuriyama, kensmith"] perforceadmin [label="Perforce Repository Administrators\nperforce-admin@FreeBSD.org\nscottl, kensmith, gordon,\nrwatson, peter, dhw"] -postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, ler, pi, rea, remko, zi"] +postmaster [label="Postmaster Team\npostmaster@FreeBSD.org\ndhw, krion, ler, philip, pi, rea, remko, zi"] refadm [label="Reference Systems Administrators\nrefadm@FreeBSD.org\njake, billf, markm, simon,\nobrien, ps, kensmith,\npeter, dhw"] webmaster [label="Webmaster Team\nwebmaster@FreeBSD.org\ngjb, wblock, blackend,\ngabor, hrs, wosch"] # Misc hats go here alphabetically sorted -donations [label="Donations Team\ndonations@FreeBSD.org\nwilko, gahr, pgolluci,\nobrien, trhodes, ds,\nrwatson"] +donations [label="Donations Team\ndonations@FreeBSD.org\nwilko, gahr, pgolluci,\nobrien, ds,\nrwatson"] marketing [label="Marketing Team\nmarketing@FreeBSD.org\nSteven Beedle, Denise Ebery, deb,\njkoshy, dru, mwlucas, imp,\nKris Moore, murray, mattt,\nJeremy C. Reed, rwatson"] vendorrelations [label="Vendor Relations\nvendor-relations@FreeBSD.org\ncore, FreeBSD Foundation"] From owner-svn-src-all@freebsd.org Tue Jun 19 13:28:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 478AC1019B95; Tue, 19 Jun 2018 13:28:03 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF2CC80515; Tue, 19 Jun 2018 13:28:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CBDB91415E; Tue, 19 Jun 2018 13:28:02 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JDS2vH085151; Tue, 19 Jun 2018 13:28:02 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JDS2XP085150; Tue, 19 Jun 2018 13:28:02 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806191328.w5JDS2XP085150@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Jun 2018 13:28:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335369 - head/share/mk X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/share/mk X-SVN-Commit-Revision: 335369 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 13:28:03 -0000 Author: br Date: Tue Jun 19 13:28:02 2018 New Revision: 335369 URL: https://svnweb.freebsd.org/changeset/base/335369 Log: Don't use TARGET_ARCH in this file, use MACHINE_ARCH instead. TARGET_ARCH is not defined when building ports/packages. Sponsored by: DARPA, AFRL Modified: head/share/mk/bsd.cpu.mk Modified: head/share/mk/bsd.cpu.mk ============================================================================== --- head/share/mk/bsd.cpu.mk Tue Jun 19 12:16:19 2018 (r335368) +++ head/share/mk/bsd.cpu.mk Tue Jun 19 13:28:02 2018 (r335369) @@ -366,7 +366,7 @@ CFLAGS += -mcpu=8540 -Wa,-me500 -mspe=yes -mabi=spe -m .endif .if ${MACHINE_CPUARCH} == "riscv" -.if ${TARGET_ARCH:Mriscv*sf} +.if ${MACHINE_ARCH:Mriscv*sf} CFLAGS += -march=rv64imac -mabi=lp64 ACFLAGS += -march=rv64imac -mabi=lp64 .else From owner-svn-src-all@freebsd.org Tue Jun 19 14:47:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D769E101EAD2; Tue, 19 Jun 2018 14:47:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8796D84855; Tue, 19 Jun 2018 14:47:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 687AE14EE0; Tue, 19 Jun 2018 14:47:00 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JEl04x027283; Tue, 19 Jun 2018 14:47:00 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JEl0Gv027278; Tue, 19 Jun 2018 14:47:00 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806191447.w5JEl0Gv027278@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Tue, 19 Jun 2018 14:46:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335370 - head/contrib/llvm/projects/libunwind/src X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/contrib/llvm/projects/libunwind/src X-SVN-Commit-Revision: 335370 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 14:47:01 -0000 Author: br Date: Tue Jun 19 14:46:59 2018 New Revision: 335370 URL: https://svnweb.freebsd.org/changeset/base/335370 Log: o Implement unw_getcontext() o Restore floating-point registers in jumpto() These are required to native cross build GCC and GDB (both do require libc++ and libunwind). These are not tested. Sponsored by: DARPA, AFRL Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Tue Jun 19 13:28:02 2018 (r335369) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersRestore.S Tue Jun 19 14:46:59 2018 (r335370) @@ -488,6 +488,41 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind14Regis // .p2align 2 DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Registers_riscv6jumptoEv) +#ifdef __riscv_float_abi_double + fld f0, (8 * 32 + 8 * 0)(a0) + fld f1, (8 * 32 + 8 * 1)(a0) + fld f2, (8 * 32 + 8 * 2)(a0) + fld f3, (8 * 32 + 8 * 3)(a0) + fld f4, (8 * 32 + 8 * 4)(a0) + fld f5, (8 * 32 + 8 * 5)(a0) + fld f6, (8 * 32 + 8 * 6)(a0) + fld f7, (8 * 32 + 8 * 7)(a0) + fld f8, (8 * 32 + 8 * 8)(a0) + fld f9, (8 * 32 + 8 * 9)(a0) + fld f10, (8 * 32 + 8 * 10)(a0) + fld f11, (8 * 32 + 8 * 11)(a0) + fld f12, (8 * 32 + 8 * 12)(a0) + fld f13, (8 * 32 + 8 * 13)(a0) + fld f14, (8 * 32 + 8 * 14)(a0) + fld f15, (8 * 32 + 8 * 15)(a0) + fld f16, (8 * 32 + 8 * 16)(a0) + fld f17, (8 * 32 + 8 * 17)(a0) + fld f18, (8 * 32 + 8 * 18)(a0) + fld f19, (8 * 32 + 8 * 19)(a0) + fld f20, (8 * 32 + 8 * 20)(a0) + fld f21, (8 * 32 + 8 * 21)(a0) + fld f22, (8 * 32 + 8 * 22)(a0) + fld f23, (8 * 32 + 8 * 23)(a0) + fld f24, (8 * 32 + 8 * 24)(a0) + fld f25, (8 * 32 + 8 * 25)(a0) + fld f26, (8 * 32 + 8 * 26)(a0) + fld f27, (8 * 32 + 8 * 27)(a0) + fld f28, (8 * 32 + 8 * 28)(a0) + fld f29, (8 * 32 + 8 * 29)(a0) + fld f30, (8 * 32 + 8 * 30)(a0) + fld f31, (8 * 32 + 8 * 31)(a0) +#endif + // x0 is zero ld x1, (8 * 1)(a0) ld x2, (8 * 2)(a0) @@ -521,8 +556,6 @@ DEFINE_LIBUNWIND_PRIVATE_FUNCTION(_ZN9libunwind15Regis ld x30, (8 * 30)(a0) ld x31, (8 * 31)(a0) ld x10, (8 * 10)(a0) // restore a0 - - /* RISCVTODO: restore FPU registers */ ret // jump to ra Modified: head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S ============================================================================== --- head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Tue Jun 19 13:28:02 2018 (r335369) +++ head/contrib/llvm/projects/libunwind/src/UnwindRegistersSave.S Tue Jun 19 14:46:59 2018 (r335370) @@ -665,8 +665,83 @@ DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) #elif defined(__riscv) -/* RISCVTODO */ +# +# extern int unw_getcontext(unw_context_t* thread_state) +# +# On entry: +# thread_state pointer is in a0 +# +DEFINE_LIBUNWIND_FUNCTION(unw_getcontext) + // x0 is zero + sd x1, (8 * 1)(a0) + sd x2, (8 * 2)(a0) + sd x3, (8 * 3)(a0) + sd x4, (8 * 4)(a0) + sd x5, (8 * 5)(a0) + sd x6, (8 * 6)(a0) + sd x7, (8 * 7)(a0) + sd x8, (8 * 8)(a0) + sd x9, (8 * 9)(a0) + sd x10, (8 * 10)(a0) + sd x11, (8 * 11)(a0) + sd x12, (8 * 12)(a0) + sd x13, (8 * 13)(a0) + sd x14, (8 * 14)(a0) + sd x15, (8 * 15)(a0) + sd x16, (8 * 16)(a0) + sd x17, (8 * 17)(a0) + sd x18, (8 * 18)(a0) + sd x19, (8 * 19)(a0) + sd x20, (8 * 20)(a0) + sd x21, (8 * 21)(a0) + sd x22, (8 * 22)(a0) + sd x23, (8 * 23)(a0) + sd x24, (8 * 24)(a0) + sd x25, (8 * 25)(a0) + sd x26, (8 * 26)(a0) + sd x27, (8 * 27)(a0) + sd x28, (8 * 28)(a0) + sd x29, (8 * 29)(a0) + sd x30, (8 * 30)(a0) + sd x31, (8 * 31)(a0) +#ifdef __riscv_float_abi_double + fsd f0, (8 * 32 + 8 * 0)(a0) + fsd f1, (8 * 32 + 8 * 1)(a0) + fsd f2, (8 * 32 + 8 * 2)(a0) + fsd f3, (8 * 32 + 8 * 3)(a0) + fsd f4, (8 * 32 + 8 * 4)(a0) + fsd f5, (8 * 32 + 8 * 5)(a0) + fsd f6, (8 * 32 + 8 * 6)(a0) + fsd f7, (8 * 32 + 8 * 7)(a0) + fsd f8, (8 * 32 + 8 * 8)(a0) + fsd f9, (8 * 32 + 8 * 9)(a0) + fsd f10, (8 * 32 + 8 * 10)(a0) + fsd f11, (8 * 32 + 8 * 11)(a0) + fsd f12, (8 * 32 + 8 * 12)(a0) + fsd f13, (8 * 32 + 8 * 13)(a0) + fsd f14, (8 * 32 + 8 * 14)(a0) + fsd f15, (8 * 32 + 8 * 15)(a0) + fsd f16, (8 * 32 + 8 * 16)(a0) + fsd f17, (8 * 32 + 8 * 17)(a0) + fsd f18, (8 * 32 + 8 * 18)(a0) + fsd f19, (8 * 32 + 8 * 19)(a0) + fsd f20, (8 * 32 + 8 * 20)(a0) + fsd f21, (8 * 32 + 8 * 21)(a0) + fsd f22, (8 * 32 + 8 * 22)(a0) + fsd f23, (8 * 32 + 8 * 23)(a0) + fsd f24, (8 * 32 + 8 * 24)(a0) + fsd f25, (8 * 32 + 8 * 25)(a0) + fsd f26, (8 * 32 + 8 * 26)(a0) + fsd f27, (8 * 32 + 8 * 27)(a0) + fsd f28, (8 * 32 + 8 * 28)(a0) + fsd f29, (8 * 32 + 8 * 29)(a0) + fsd f30, (8 * 32 + 8 * 30)(a0) + fsd f31, (8 * 32 + 8 * 31)(a0) +#endif + + li a0, 0 // return UNW_ESUCCESS + ret // jump to ra #endif NO_EXEC_STACK_DIRECTIVE From owner-svn-src-all@freebsd.org Tue Jun 19 15:05:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88B03101FF37; Tue, 19 Jun 2018 15:05:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B8DB8599E; Tue, 19 Jun 2018 15:05:32 +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 1CC091523B; Tue, 19 Jun 2018 15:05:32 +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 w5JF5WtD037503; Tue, 19 Jun 2018 15:05:32 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JF5Vqn037502; Tue, 19 Jun 2018 15:05:31 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806191505.w5JF5Vqn037502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 19 Jun 2018 15:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335371 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 335371 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 15:05:32 -0000 Author: kevans Date: Tue Jun 19 15:05:31 2018 New Revision: 335371 URL: https://svnweb.freebsd.org/changeset/base/335371 Log: lualoader: Correct kernel_options handling `kernel_options` were being passed as flags to load, rather than to the kernel being loaded. This is the kernel_options counterpart to r335009. Modified: head/stand/lua/config.lua Modified: head/stand/lua/config.lua ============================================================================== --- head/stand/lua/config.lua Tue Jun 19 14:46:59 2018 (r335370) +++ head/stand/lua/config.lua Tue Jun 19 15:05:31 2018 (r335371) @@ -425,8 +425,8 @@ function config.loadKernel(other_kernel) local function tryLoad(names) for name in names:gmatch("([^;]+)%s*;?") do - local r = loader.perform("load " .. flags .. - " " .. name) + local r = loader.perform("load " .. name .. + " " .. flags) if r == 0 then return name end From owner-svn-src-all@freebsd.org Tue Jun 19 15:55:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7322A1023072; Tue, 19 Jun 2018 15:55:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152EA87F19; Tue, 19 Jun 2018 15:55:22 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA87115A9D; Tue, 19 Jun 2018 15:55:21 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JFtLqZ063596; Tue, 19 Jun 2018 15:55:21 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JFtLM9063595; Tue, 19 Jun 2018 15:55:21 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806191555.w5JFtLM9063595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 19 Jun 2018 15:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335372 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 335372 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 15:55:22 -0000 Author: sbruno Date: Tue Jun 19 15:55:21 2018 New Revision: 335372 URL: https://svnweb.freebsd.org/changeset/base/335372 Log: Remove "diff" line indicator. Next to see if this code works or not. Submitted by: mmacy Sponsored by: Limelight Networks Modified: head/sys/dev/ixl/ixlvc.c Modified: head/sys/dev/ixl/ixlvc.c ============================================================================== --- head/sys/dev/ixl/ixlvc.c Tue Jun 19 15:05:31 2018 (r335371) +++ head/sys/dev/ixl/ixlvc.c Tue Jun 19 15:55:21 2018 (r335372) @@ -386,9 +386,9 @@ ixlv_configure_queues(struct ixlv_sc *sc) { device_t dev = sc->dev; struct ixl_vsi *vsi = &sc->vsi; -+ if_softc_ctx_t scctx = iflib_get_softc_ctx(vsi->ctx); -+ struct ixl_tx_queue *tx_que = vsi->tx_queues; -+ struct ixl_rx_queue *rx_que = vsi->rx_queues; + if_softc_ctx_t scctx = iflib_get_softc_ctx(vsi->ctx); + struct ixl_tx_queue *tx_que = vsi->tx_queues; + struct ixl_rx_queue *rx_que = vsi->rx_queues; struct tx_ring *txr; struct rx_ring *rxr; int len, pairs; @@ -396,9 +396,9 @@ ixlv_configure_queues(struct ixlv_sc *sc) struct virtchnl_vsi_queue_config_info *vqci; struct virtchnl_queue_pair_info *vqpi; -+ /* XXX: Linux PF driver wants matching ids in each tx/rx struct, so both TX/RX -+ * queues of a pair need to be configured */ -+ pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); + /* XXX: Linux PF driver wants matching ids in each tx/rx struct, so both TX/RX + * queues of a pair need to be configured */ + pairs = max(vsi->num_tx_queues, vsi->num_rx_queues); len = sizeof(struct virtchnl_vsi_queue_config_info) + (sizeof(struct virtchnl_queue_pair_info) * pairs); vqci = malloc(len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -413,24 +413,24 @@ ixlv_configure_queues(struct ixlv_sc *sc) /* Size check is not needed here - HW max is 16 queue pairs, and we * can fit info for 31 of them into the AQ buffer before it overflows. */ -+ for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) { -+ txr = &tx_que->txr; -+ rxr = &rx_que->rxr; -+ + for (int i = 0; i < pairs; i++, tx_que++, rx_que++, vqpi++) { + txr = &tx_que->txr; + rxr = &rx_que->rxr; + vqpi->txq.vsi_id = vqci->vsi_id; vqpi->txq.queue_id = i; -+ vqpi->txq.ring_len = scctx->isc_ntxd[0]; -+ vqpi->txq.dma_ring_addr = txr->tx_paddr; + vqpi->txq.ring_len = scctx->isc_ntxd[0]; + vqpi->txq.dma_ring_addr = txr->tx_paddr; /* Enable Head writeback */ vqpi->txq.headwb_enabled = 0; vqpi->txq.dma_headwb_addr = 0; vqpi->rxq.vsi_id = vqci->vsi_id; vqpi->rxq.queue_id = i; -+ vqpi->rxq.ring_len = scctx->isc_nrxd[0]; -+ vqpi->rxq.dma_ring_addr = rxr->rx_paddr; -+ vqpi->rxq.max_pkt_size = scctx->isc_max_frame_size; -+ // TODO: Get this value from iflib, somehow + vqpi->rxq.ring_len = scctx->isc_nrxd[0]; + vqpi->rxq.dma_ring_addr = rxr->rx_paddr; + vqpi->rxq.max_pkt_size = scctx->isc_max_frame_size; + // TODO: Get this value from iflib, somehow vqpi->rxq.databuffer_size = rxr->mbuf_sz; vqpi->rxq.splithdr_enabled = 0; } @@ -451,8 +451,8 @@ ixlv_enable_queues(struct ixlv_sc *sc) struct virtchnl_queue_select vqs; vqs.vsi_id = sc->vsi_res->vsi_id; -+ /* XXX: In Linux PF, as long as neither of these is 0, -+ * every queue in VF VSI is enabled. */ + /* XXX: In Linux PF, as long as neither of these is 0, + * every queue in VF VSI is enabled. */ vqs.tx_queues = (1 << sc->vsi_res->num_queue_pairs) - 1; vqs.rx_queues = vqs.tx_queues; ixlv_send_pf_msg(sc, VIRTCHNL_OP_ENABLE_QUEUES, @@ -470,8 +470,8 @@ ixlv_disable_queues(struct ixlv_sc *sc) struct virtchnl_queue_select vqs; vqs.vsi_id = sc->vsi_res->vsi_id; -+ /* XXX: In Linux PF, as long as neither of these is 0, -+ * every queue in VF VSI is disabled. */ + /* XXX: In Linux PF, as long as neither of these is 0, + * every queue in VF VSI is disabled. */ vqs.tx_queues = (1 << sc->vsi_res->num_queue_pairs) - 1; vqs.rx_queues = vqs.tx_queues; ixlv_send_pf_msg(sc, VIRTCHNL_OP_DISABLE_QUEUES, @@ -490,29 +490,29 @@ ixlv_map_queues(struct ixlv_sc *sc) struct virtchnl_irq_map_info *vm; int i, q, len; struct ixl_vsi *vsi = &sc->vsi; -+ struct ixl_rx_queue *rx_que = vsi->rx_queues; -+ if_softc_ctx_t scctx = vsi->shared; -+ device_t dev = sc->dev; -+ -+ // XXX: What happens if we only get 1 MSI-X vector? -+ MPASS(scctx->isc_vectors > 1); + struct ixl_rx_queue *rx_que = vsi->rx_queues; + if_softc_ctx_t scctx = vsi->shared; + device_t dev = sc->dev; + // XXX: What happens if we only get 1 MSI-X vector? + MPASS(scctx->isc_vectors > 1); + /* How many queue vectors, adminq uses one */ -+ // XXX: How do we know how many interrupt vectors we have? -+ q = scctx->isc_vectors - 1; + // XXX: How do we know how many interrupt vectors we have? + q = scctx->isc_vectors - 1; len = sizeof(struct virtchnl_irq_map_info) + -+ (scctx->isc_vectors * sizeof(struct i40e_virtchnl_vector_map)); + (scctx->isc_vectors * sizeof(struct i40e_virtchnl_vector_map)); vm = malloc(len, M_DEVBUF, M_NOWAIT); if (!vm) { -+ device_printf(dev, "%s: unable to allocate memory\n", __func__); + device_printf(dev, "%s: unable to allocate memory\n", __func__); ixl_vc_schedule_retry(&sc->vc_mgr); return; } -+ vm->num_vectors = scctx->isc_vectors; + vm->num_vectors = scctx->isc_vectors; /* Queue vectors first */ -+ for (i = 0; i < q; i++, rx_que++) { + for (i = 0; i < q; i++, rx_que++) { vm->vecmap[i].vsi_id = sc->vsi_res->vsi_id; vm->vecmap[i].vector_id = i + 1; /* first is adminq */ // vm->vecmap[i].txq_map = (1 << que->me); @@ -890,12 +890,12 @@ void ixlv_set_rss_hena(struct ixlv_sc *sc) { struct virtchnl_rss_hena hena; -+ struct i40e_hw *hw = &sc->hw; + struct i40e_hw *hw = &sc->hw; -+ if (hw->mac.type == I40E_MAC_X722_VF) -+ hena.hena = IXL_DEFAULT_RSS_HENA_X722; -+ else -+ hena.hena = IXL_DEFAULT_RSS_HENA_XL710; + if (hw->mac.type == I40E_MAC_X722_VF) + hena.hena = IXL_DEFAULT_RSS_HENA_X722; + else + hena.hena = IXL_DEFAULT_RSS_HENA_XL710; ixlv_send_pf_msg(sc, VIRTCHNL_OP_SET_RSS_HENA, (u8 *)&hena, sizeof(hena)); @@ -931,9 +931,9 @@ ixlv_config_rss_lut(struct ixlv_sc *sc) * num_queues.) */ que_id = rss_get_indirection_to_bucket(i); -+ que_id = que_id % sc->vsi.num_rx_queues; + que_id = que_id % sc->vsi.num_rx_queues; #else -+ que_id = i % sc->vsi.num_rx_queues; + que_id = i % sc->vsi.num_rx_queues; #endif lut = que_id & IXL_RSS_VSI_LUT_ENTRY_MASK; rss_lut_msg->lut[i] = lut; @@ -980,9 +980,7 @@ ixlv_vc_completion(struct ixlv_sc *sc, case VIRTCHNL_EVENT_RESET_IMPENDING: device_printf(dev, "PF initiated reset!\n"); sc->init_state = IXLV_RESET_PENDING; -+ // mtx_unlock(&sc->mtx); -+ ixlv_if_init(sc->vsi.ctx); -+ // mtx_lock(&sc->mtx); + ixlv_if_init(sc->vsi.ctx); break; default: device_printf(dev, "%s: Unknown event %d from AQ\n", From owner-svn-src-all@freebsd.org Tue Jun 19 15:57:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D90F2102325E; Tue, 19 Jun 2018 15:57:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 589716811F; Tue, 19 Jun 2018 15:57:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id 23F3118C50; Tue, 19 Jun 2018 15:57:27 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 287E78A3; Tue, 19 Jun 2018 15:57:26 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id qVPRUBhrY7rb; Tue, 19 Jun 2018 15:57:23 +0000 (UTC) Subject: Re: svn commit: r335244 - head DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com C778A89D To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806160502.w5G52CIO039774@slippy.cwsent.com> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: Date: Tue, 19 Jun 2018 08:57:21 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806160502.w5G52CIO039774@slippy.cwsent.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ItbHzN6ozFf4ZGAE6vb7CtxR65GUJboYk" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 15:57:28 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ItbHzN6ozFf4ZGAE6vb7CtxR65GUJboYk Content-Type: multipart/mixed; boundary="FyYr4GhKXSz7igo7cbrSUOpkrYH5yp70l"; protected-headers="v1" From: Bryan Drewery To: Cy Schubert Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: Subject: Re: svn commit: r335244 - head References: <201806160502.w5G52CIO039774@slippy.cwsent.com> In-Reply-To: <201806160502.w5G52CIO039774@slippy.cwsent.com> --FyYr4GhKXSz7igo7cbrSUOpkrYH5yp70l Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/15/2018 10:02 PM, Cy Schubert wrote: > In message <201806160436.w5G4aXks039566@slippy.cwsent.com>, Cy Schubert= =20 > writes: >> In message <201806160035.w5G0ZJfd066325@repo.freebsd.org>, Bryan=20 >> Drewery writes >> : >>> Author: bdrewery >>> Date: Sat Jun 16 00:35:19 2018 >>> New Revision: 335244 >>> URL: https://svnweb.freebsd.org/changeset/base/335244 >>> >>> Log: >>> Assert that a build is done before an install. >>> =20 >>> This should also catch cases where the wrong MAKEOBJDIRPREFIX is us= ed for >>> install. >>> =20 >>> MFC after: 2 weeks >>> Sponsored by: Dell EMC >>> >>> 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 Fri Jun 15 23:42:22 2018 (r335243) >>> +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) >>> @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP=3D no >>> .if make(installworld) || make(install) || make(distributeworld) || = \ >>> make(stageworld) >>> .-include "${OBJTOP}/compiler-metadata.mk" >>> +.if !defined(_LOADED_COMPILER_METADATA) >>> +.error A build is required first. You may have the wrong MAKEOBJDIR= PREFIX >> s >>> et. >>> .endif >>> +.endif >>> =20 >>> # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it = from t >> he >>> # tree to be friendlier to foreign OS builds. It's safe to do so unc= onditi >> on >>> ally >>> @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META >>> @: > ${.TARGET} >>> @echo ".info Using cached compiler metadata from build at $$(hostna= me)=20 >>> on $$(date)" \ >>> > ${.TARGET} >>> + @echo "_LOADED_COMPILER_METADATA=3Dt" >> ${.TARGET} >>> .for v in ${_COMPILER_METADATA_VARS} >>> @echo "${v}=3D${${v}}" >> ${.TARGET} >>> .endfor >>> >> >> Another data point: This also broke the following: >> >> cwsys# poudriere jail -c -m src=3D/opt/src/svn-current -j HEADi386 -a = i386 >> [00:00:00] Creating HEADi386 fs at /poudriere/amd64/jails/HEADi386... = >> done >> [00:00:01] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEAD= i3 >> 86/usr/src... done >> [00:06:01] Starting make installworld >> --- installworld --- >> make[1]: "/export/obj/opt/src/svn-current/i386.i386/compiler-metadata.= mk >> " line 1: Using cached compiler metadata from build at cwsys on Fri Ju= n=20 >> 15 18:39:46 PDT 2018 >> make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is=20 >> required first. You may have the wrong MAKEOBJDIRPREFIX set. >> *** [installworld] Error code 1 >> >> make: stopped in /opt/src/svn-current >> 1 error >> >> make: stopped in /opt/src/svn-current >> [00:06:01] Error: Failed to 'make installworld' >> [00:06:01] Error while creating jail, cleaning up. >> [00:06:01] Removing HEADi386 jail... done >> [00:06:03] Cleaning HEADi386 data... done >> cwsys#=20 >=20 > Nevermind. I found it. Stupid error on my part. >=20 >=20 I'm curious what you did? Did you svn update after a buildworld and then tried installworld? That would fail 1 time here but not again in the future. (Thinking outloud now, I could probably reuse the vcsversion code in newvers.sh to record the build revision during buildworld and check it matches at installworld time, but the assumes the same vcs tool is on the install machine so it probably wouldn't work.) I'm happy to see it may have caught a subtle mistake for you. --=20 Regards, Bryan Drewery --FyYr4GhKXSz7igo7cbrSUOpkrYH5yp70l-- --ItbHzN6ozFf4ZGAE6vb7CtxR65GUJboYk Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbKSfhAAoJEDXXcbtuRpfPpNQH/R2bhzkmYz+Gb7QpWL4F4p7z tNqk+iccP/9s2/aWKjq9rXnkPmwmK9c8kmhhdrvn9DZWboL7F6osYQ+oI0hUo7DO fXecZxYok5AxYOJo/+chyYdkEpkjT/EiftdehYoG2xHuWlXMHHUtanrbe5RHYg3X jSPYjFUcQMVvfqyWU8gXXIjapJrk4GNDa97pjD1Z0T04uE8+oAD/TD1r9VKsYcgB af6QBKb6xr9Qfoo6ZQ2I6dcuN+Fap6q6mSK3Ut9AfD+sOx8ewV/ju4mhZvG32pHu +VIQ/yaoieuboBkXACExWlBBWoCU4krlAKeB4cFImBwzqfl/EbuOG/iy9FTHwYg= =4miA -----END PGP SIGNATURE----- --ItbHzN6ozFf4ZGAE6vb7CtxR65GUJboYk-- From owner-svn-src-all@freebsd.org Tue Jun 19 16:14:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 65376102414A; Tue, 19 Jun 2018 16:14:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12FC968F0C; Tue, 19 Jun 2018 16:14:24 +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 E865415E09; Tue, 19 Jun 2018 16:14:23 +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 w5JGENbQ073554; Tue, 19 Jun 2018 16:14:23 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JGENxd073551; Tue, 19 Jun 2018 16:14:23 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806191614.w5JGENxd073551@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Tue, 19 Jun 2018 16:14:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335373 - in head/sys: arm/arm arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: in head/sys: arm/arm arm64/arm64 X-SVN-Commit-Revision: 335373 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 16:14:24 -0000 Author: andrew Date: Tue Jun 19 16:14:23 2018 New Revision: 335373 URL: https://svnweb.freebsd.org/changeset/base/335373 Log: Move common GIC interrupt numbers to the common header. These are the same across the GICv2 and GICv3 drivers so we only need a single copy of them. Sponsored by: Turing Robotic Industries Modified: head/sys/arm/arm/gic.h head/sys/arm/arm/gic_common.h head/sys/arm64/arm64/gic_v3_reg.h Modified: head/sys/arm/arm/gic.h ============================================================================== --- head/sys/arm/arm/gic.h Tue Jun 19 15:55:21 2018 (r335372) +++ head/sys/arm/arm/gic.h Tue Jun 19 16:14:23 2018 (r335373) @@ -39,12 +39,6 @@ #ifndef _ARM_GIC_H_ #define _ARM_GIC_H_ -#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ -#define GIC_LAST_SGI 15 -#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ -#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ -#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ - #ifdef INTRNG struct arm_gic_range { uint64_t bus; Modified: head/sys/arm/arm/gic_common.h ============================================================================== --- head/sys/arm/arm/gic_common.h Tue Jun 19 15:55:21 2018 (r335372) +++ head/sys/arm/arm/gic_common.h Tue Jun 19 16:14:23 2018 (r335373) @@ -44,6 +44,15 @@ __BUS_ACCESSOR(gic, hw_rev, GIC, HW_REV, u_int); __BUS_ACCESSOR(gic, bus, GIC, BUS, u_int); +/* Software Generated Interrupts */ +#define GIC_FIRST_SGI 0 /* Irqs 0-15 are SGIs/IPIs. */ +#define GIC_LAST_SGI 15 +/* Private Peripheral Interrupts */ +#define GIC_FIRST_PPI 16 /* Irqs 16-31 are private (per */ +#define GIC_LAST_PPI 31 /* core) peripheral interrupts. */ +/* Shared Peripheral Interrupts */ +#define GIC_FIRST_SPI 32 /* Irqs 32+ are shared peripherals. */ + /* Common register values */ #define GICD_CTLR 0x0000 /* v1 ICDDCR */ #define GICD_TYPER 0x0004 /* v1 ICDICTR */ Modified: head/sys/arm64/arm64/gic_v3_reg.h ============================================================================== --- head/sys/arm64/arm64/gic_v3_reg.h Tue Jun 19 15:55:21 2018 (r335372) +++ head/sys/arm64/arm64/gic_v3_reg.h Tue Jun 19 16:14:23 2018 (r335373) @@ -44,14 +44,7 @@ /* Upper value is determined by LPI max priority */ #define GIC_PRIORITY_MIN (0xFCUL) -/* Numbers for software generated interrupts */ -#define GIC_FIRST_SGI (0) -#define GIC_LAST_SGI (15) -/* Numbers for private peripheral interrupts */ -#define GIC_FIRST_PPI (16) -#define GIC_LAST_PPI (31) -/* Numbers for spared peripheral interrupts */ -#define GIC_FIRST_SPI (32) +/* Numbers for shared peripheral interrupts */ #define GIC_LAST_SPI (1019) /* Numbers for local peripheral interrupts */ #define GIC_FIRST_LPI (8192) From owner-svn-src-all@freebsd.org Tue Jun 19 16:25:25 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 238321024A53; Tue, 19 Jun 2018 16:25:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0C44696F4; Tue, 19 Jun 2018 16:25:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 0DCAB10AFAD; Tue, 19 Jun 2018 12:25:22 -0400 (EDT) Subject: Re: svn commit: r335278 - head/bin/pwd To: Eitan Adler References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <4ad7ef96-e623-5ab8-dc47-c3178115ff24@FreeBSD.org> Date: Tue, 19 Jun 2018 09:25:21 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Tue, 19 Jun 2018 12:25:23 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 16:25:25 -0000 On 6/18/18 10:26 PM, Eitan Adler wrote: > On 18 June 2018 at 10:57, John Baldwin wrote: >> On 6/16/18 10:14 PM, Eitan Adler wrote: >>> Author: eadler >>> Date: Sun Jun 17 05:14:50 2018 >>> New Revision: 335278 >>> URL: https://svnweb.freebsd.org/changeset/base/335278 >>> >>> Log: >>> pwd: mark usage as dead >> >> You keep committing changes like this and ignoring e-mails about them. > > I replied both the first time and this time. I may have > (accidentally?) ignored similar emails though. The question I have is > other than the mild code churn what's the harm? It adds clutter. Also, fixing the tool means you fix all the places at once rather than slowly adding workarounds one by one. >> What broken compiler are you using that doesn't properly inherit __dead2 >> from the call to exit()? > > In this case, scan-build50 was getting annoyed. Does scan-build from LLVM 6.0 handle this correctly? If so, I'd say to just mark this warning as broken (and thus ignore it) for scan-build50 just as we ignore certain warnings from GCC 4.2.1 because they are broken-as-implemented. -- John Baldwin From owner-svn-src-all@freebsd.org Tue Jun 19 16:38:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF8931025450; Tue, 19 Jun 2018 16:38:55 +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 463F669E92; Tue, 19 Jun 2018 16:38:55 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id VJeYfUuzU5wO5VJeZf1jsY; Tue, 19 Jun 2018 10:38:48 -0600 X-Authority-Analysis: v=2.3 cv=SJtsqtnH c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=7mUfYlMuFuIA:10 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=VxmjJ2MpAAAA:8 a=de9WLqMfldIyrYc-PEkA:9 a=UUJ1fl0ynekyqbNe:21 a=cI1PkZSQL8lh-kV2:21 a=QEXdDO2ut3YA:10 a=tPJkxjwt9L8A:10 a=sOZRmQItfYXAhTsvMYwA:9 a=OnK2ZLNbMPet9n7r:21 a=QCgDuXMSJE38EZMV:21 a=DZ06r5BzFtDYjEGM:21 a=_W_S_7VecoQA:10 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=7gXAzLPJhVmCkEl4_tsf:22 Received: from [10.168.3.99] (S0106d4ca6d8943b0.gv.shawcable.net [70.66.132.207]) by spqr.komquats.com (Postfix) with ESMTPSA id 341EF8F4; Tue, 19 Jun 2018 09:38:45 -0700 (PDT) MIME-Version: 1.0 From: Cy Schubert Subject: RE: svn commit: r335244 - head Date: Tue, 19 Jun 2018 09:38:48 -0700 To: Bryan Drewery CC: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Message-Id: <20180619163845.341EF8F4@spqr.komquats.com> X-CMAE-Envelope: MS4wfEGnq3vGy59uJVjm1BRqDbfIxLiKkGFF9fa6ulgTQtnhokB0nFoq6j9sIZrdKMnDyVmVBaYtYAQqqtqXWloUvSpzqH6tdPsnQlDVqcW5JslYqXdt0mNk DzJCqIBXoLsjo2x1hJ7OoeNJQG9nYC96WtOLSNd3h/MnhPWvVhJ8NdPBBjWT0RhX5xeGbR+81W3o/WM7AMo5aMtRnYKOyWl1dROh4gVpVWzx+qsr83sEwqs/ xTIOq4YWNnBudEvhxDRHfjQjeTHSqjkUuM1JbcHXznou338/LfSjZqw0VOSkjdMj Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 16:38:56 -0000 I have a script that invokes buildworld/kernel, installworld/kernel, then p= roceeds to update jails if the jails are not in use. I passed the wrong arg= ument to my script. I hastily did control-r to find my last command and hit= enter without thinking (being rushed as usual). I assumed I used the corre= ct arguments. My assumption was incorrect. Sloppiness on my part. My script takes a snapshot of /usr/src and /usr/obj (whatever dataset they = reside in), svn up, buildworld/kernel, install*, mergemaster if requested, = then finally deletes the snapshots (depending on arguments). The return cod= e specifies whether poudeiere updates or not. I was rushing out the door that evening, so I figured I could squeeze in a = build by the time I got home. I specified to my script to build and install= only the kernel but the poudeiere invocation that followed wasn't aware th= at I had invoked the previous script to only build and install the kernel. = Not enough care for details that evening on my part. When I got home to dis= cover the install failure I had forgotten that I passed an argument to the = script to build/install only the kernel. Not a big deal, just need to be more careful next time. --- Sent using a tiny phone keyboard. Apologies for any typos and autocorrect. Also, this old phone only supports top post. Apologies. Cy Schubert or The need of the many outweighs the greed of the few. --- -----Original Message----- From: Bryan Drewery Sent: 19/06/2018 08:57 To: Cy Schubert Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-head@freeb= sd.org Subject: Re: svn commit: r335244 - head On 6/15/2018 10:02 PM, Cy Schubert wrote: > In message <201806160436.w5G4aXks039566@slippy.cwsent.com>, Cy Schubert=20 > writes: >> In message <201806160035.w5G0ZJfd066325@repo.freebsd.org>, Bryan=20 >> Drewery writes >> : >>> Author: bdrewery >>> Date: Sat Jun 16 00:35:19 2018 >>> New Revision: 335244 >>> URL: https://svnweb.freebsd.org/changeset/base/335244 >>> >>> Log: >>> Assert that a build is done before an install. >>> =20 >>> This should also catch cases where the wrong MAKEOBJDIRPREFIX is used= for >>> install. >>> =20 >>> MFC after: 2 weeks >>> Sponsored by: Dell EMC >>> >>> 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 Fri Jun 15 23:42:22 2018 (r335243) >>> +++ head/Makefile.inc1 Sat Jun 16 00:35:19 2018 (r335244) >>> @@ -89,7 +89,10 @@ MK_GCC_BOOTSTRAP=3D no >>> .if make(installworld) || make(install) || make(distributeworld) || \ >>> make(stageworld) >>> .-include "${OBJTOP}/compiler-metadata.mk" >>> +.if !defined(_LOADED_COMPILER_METADATA) >>> +.error A build is required first. You may have the wrong MAKEOBJDIRPR= EFIX >> s >>> et. >>> .endif >>> +.endif >>> =20 >>> # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it fr= om t >> he >>> # tree to be friendlier to foreign OS builds. It's safe to do so uncon= diti >> on >>> ally >>> @@ -195,6 +198,7 @@ compiler-metadata.mk: .PHONY .META >>> @: > ${.TARGET} >>> @echo ".info Using cached compiler metadata from build at $$(hostname= )=20 >>> on $$(date)" \ >>> > ${.TARGET} >>> + @echo "_LOADED_COMPILER_METADATA=3Dt" >> ${.TARGET} >>> .for v in ${_COMPILER_METADATA_VARS} >>> @echo "${v}=3D${${v}}" >> ${.TARGET} >>> .endfor >>> >> >> Another data point: This also broke the following: >> >> cwsys# poudriere jail -c -m src=3D/opt/src/svn-current -j HEADi386 -a i3= 86 >> [00:00:00] Creating HEADi386 fs at /poudriere/amd64/jails/HEADi386...=20 >> done >> [00:00:01] Copying /opt/src/svn-current to /poudriere/amd64/jails/HEADi3 >> 86/usr/src... done >> [00:06:01] Starting make installworld >> --- installworld --- >> make[1]: "/export/obj/opt/src/svn-current/i386.i386/compiler-metadata.mk >> " line 1: Using cached compiler metadata from build at cwsys on Fri Jun= =20 >> 15 18:39:46 PDT 2018 >> make[1]: "/opt/src/svn-current/Makefile.inc1" line 93: A build is=20 >> required first. You may have the wrong MAKEOBJDIRPREFIX set. >> *** [installworld] Error code 1 >> >> make: stopped in /opt/src/svn-current >> 1 error >> >> make: stopped in /opt/src/svn-current >> [00:06:01] Error: Failed to 'make installworld' >> [00:06:01] Error while creating jail, cleaning up. >> [00:06:01] Removing HEADi386 jail... done >> [00:06:03] Cleaning HEADi386 data... done >> cwsys#=20 >=20 > Nevermind. I found it. Stupid error on my part. >=20 >=20 I'm curious what you did? Did you svn update after a buildworld and then tried installworld? That would fail 1 time here but not again in the future. (Thinking outloud now, I could probably reuse the vcsversion code in newvers.sh to record the build revision during buildworld and check it matches at installworld time, but the assumes the same vcs tool is on the install machine so it probably wouldn't work.) I'm happy to see it may have caught a subtle mistake for you. --=20 Regards, Bryan Drewery From owner-svn-src-all@freebsd.org Tue Jun 19 16:55:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0399C100021B; Tue, 19 Jun 2018 16:55:40 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A56A36AC1B; Tue, 19 Jun 2018 16:55:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 868A9164CC; Tue, 19 Jun 2018 16:55:39 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JGtdR4094377; Tue, 19 Jun 2018 16:55:39 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JGtd2l094376; Tue, 19 Jun 2018 16:55:39 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806191655.w5JGtd2l094376@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 19 Jun 2018 16:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335374 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335374 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 16:55:40 -0000 Author: asomers Date: Tue Jun 19 16:55:39 2018 New Revision: 335374 URL: https://svnweb.freebsd.org/changeset/base/335374 Log: audit(4): add tests for utimes(2) and friends, mprotect, and undelete Includes utimes(2), futimes(2), lutimes(2), futimesat(2), mprotect(2), and undelete(2). undelete, for now, is tested only in failure mode. Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15893 Modified: head/tests/sys/audit/file-attribute-modify.c Modified: head/tests/sys/audit/file-attribute-modify.c ============================================================================== --- head/tests/sys/audit/file-attribute-modify.c Tue Jun 19 16:14:23 2018 (r335373) +++ head/tests/sys/audit/file-attribute-modify.c Tue Jun 19 16:55:39 2018 (r335374) @@ -28,10 +28,13 @@ #include #include #include +#include #include +#include #include #include +#include #include #include "utils.h" @@ -689,6 +692,257 @@ ATF_TC_CLEANUP(lchflags_failure, tc) } +ATF_TC_WITH_CLEANUP(utimes_success); +ATF_TC_HEAD(utimes_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "utimes(2) call"); +} + +ATF_TC_BODY(utimes_success, tc) +{ + /* File needs to exist to call utimes(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, utimes(path, NULL)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(utimes_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(utimes_failure); +ATF_TC_HEAD(utimes_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "utimes(2) call"); +} + +ATF_TC_BODY(utimes_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, utimes(errpath, NULL)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(utimes_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(futimes_success); +ATF_TC_HEAD(futimes_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "futimes(2) call"); +} + +ATF_TC_BODY(futimes_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "futimes.*%d.*ret.*success", pid); + + /* File needs to exist to call futimes(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, futimes(filedesc, NULL)); + check_audit(fds, extregex, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(futimes_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(futimes_failure); +ATF_TC_HEAD(futimes_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "futimes(2) call"); +} + +ATF_TC_BODY(futimes_failure, tc) +{ + const char *regex = "futimes.*return,failure : Bad file descriptor"; + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid file descriptor */ + ATF_REQUIRE_EQ(-1, futimes(-1, NULL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(futimes_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lutimes_success); +ATF_TC_HEAD(lutimes_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "lutimes(2) call"); +} + +ATF_TC_BODY(lutimes_success, tc) +{ + /* Symbolic link needs to exist to call lutimes(2) */ + ATF_REQUIRE_EQ(0, symlink("symlink", path)); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, lutimes(path, NULL)); + check_audit(fds, successreg, pipefd); +} + +ATF_TC_CLEANUP(lutimes_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(lutimes_failure); +ATF_TC_HEAD(lutimes_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "lutimes(2) call"); +} + +ATF_TC_BODY(lutimes_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: symbolic link does not exist */ + ATF_REQUIRE_EQ(-1, lutimes(errpath, NULL)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(lutimes_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(futimesat_success); +ATF_TC_HEAD(futimesat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "futimesat(2) call"); +} + +ATF_TC_BODY(futimesat_success, tc) +{ + /* File needs to exist to call futimesat(2) */ + ATF_REQUIRE((filedesc = open(path, O_CREAT, mode)) != -1); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, futimesat(AT_FDCWD, path, NULL)); + check_audit(fds, successreg, pipefd); + close(filedesc); +} + +ATF_TC_CLEANUP(futimesat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(futimesat_failure); +ATF_TC_HEAD(futimesat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "futimesat(2) call"); +} + +ATF_TC_BODY(futimesat_failure, tc) +{ + FILE *pipefd = setup(fds, auclass); + /* Failure reason: file does not exist */ + ATF_REQUIRE_EQ(-1, futimesat(AT_FDCWD, errpath, NULL)); + check_audit(fds, failurereg, pipefd); +} + +ATF_TC_CLEANUP(futimesat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(mprotect_success); +ATF_TC_HEAD(mprotect_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "mprotect(2) call"); +} + +ATF_TC_BODY(mprotect_success, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "mprotect.*%d.*ret.*success", pid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, mprotect(NULL, 0, PROT_NONE)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(mprotect_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(mprotect_failure); +ATF_TC_HEAD(mprotect_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "mprotect(2) call"); +} + +ATF_TC_BODY(mprotect_failure, tc) +{ + const char *regex = "mprotect.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, mprotect((void *)SIZE_MAX, -1, PROT_NONE)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(mprotect_failure, tc) +{ + cleanup(); +} + +/* + * undelete(2) only works on whiteout files in union file system. Hence, no + * test case for successful invocation. + */ + +ATF_TC_WITH_CLEANUP(undelete_failure); +ATF_TC_HEAD(undelete_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "undelete(2) call"); +} + +ATF_TC_BODY(undelete_failure, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), "undelete.*%d.*ret.*failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: File does not exist */ + ATF_REQUIRE_EQ(-1, undelete(errpath)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(undelete_failure, tc) +{ + cleanup(); +} + + ATF_TC_WITH_CLEANUP(extattr_set_file_success); ATF_TC_HEAD(extattr_set_file_success, tc) { @@ -1049,6 +1303,19 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, fchflags_failure); ATF_TP_ADD_TC(tp, lchflags_success); ATF_TP_ADD_TC(tp, lchflags_failure); + + ATF_TP_ADD_TC(tp, utimes_success); + ATF_TP_ADD_TC(tp, utimes_failure); + ATF_TP_ADD_TC(tp, futimes_success); + ATF_TP_ADD_TC(tp, futimes_failure); + ATF_TP_ADD_TC(tp, lutimes_success); + ATF_TP_ADD_TC(tp, lutimes_failure); + ATF_TP_ADD_TC(tp, futimesat_success); + ATF_TP_ADD_TC(tp, futimesat_failure); + + ATF_TP_ADD_TC(tp, mprotect_success); + ATF_TP_ADD_TC(tp, mprotect_failure); + ATF_TP_ADD_TC(tp, undelete_failure); ATF_TP_ADD_TC(tp, extattr_set_file_success); ATF_TP_ADD_TC(tp, extattr_set_file_failure); From owner-svn-src-all@freebsd.org Tue Jun 19 17:11:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF84D100118B; Tue, 19 Jun 2018 17:11:54 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A277D6B788; Tue, 19 Jun 2018 17:11:54 +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 83843167EC; Tue, 19 Jun 2018 17:11:54 +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 w5JHBss6002456; Tue, 19 Jun 2018 17:11:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JHBsVd002455; Tue, 19 Jun 2018 17:11:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806191711.w5JHBsVd002455@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Jun 2018 17:11:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335375 - stable/11/usr.bin/elfdump X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/elfdump X-SVN-Commit-Revision: 335375 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 17:11:55 -0000 Author: emaste Date: Tue Jun 19 17:11:53 2018 New Revision: 335375 URL: https://svnweb.freebsd.org/changeset/base/335375 Log: MFC r334363: elfdump: chase ABI tag note name change from r232832 r232832 changed the ABI tag note name from .note.ABI-tag to .note.tag. Follow suit in elfdump. Elfdump's note parsing is very basic and should be significantly reworked, but for now just restore the broken functionality. PR: 228290 Submitted by: martin at lispworks.com Modified: stable/11/usr.bin/elfdump/elfdump.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/elfdump/elfdump.c ============================================================================== --- stable/11/usr.bin/elfdump/elfdump.c Tue Jun 19 16:55:39 2018 (r335374) +++ stable/11/usr.bin/elfdump/elfdump.c Tue Jun 19 17:11:53 2018 (r335375) @@ -663,7 +663,7 @@ main(int ac, char **av) case SHT_NOTE: name = elf_get_word(e, v, SH_NAME); if (flags & ED_NOTE && - strcmp(shstrtab + name, ".note.ABI-tag") == 0) + strcmp(shstrtab + name, ".note.tag") == 0) elf_print_note(e, v); break; case SHT_DYNSYM: From owner-svn-src-all@freebsd.org Tue Jun 19 17:28:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CDC251002111; Tue, 19 Jun 2018 17:28:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8013B6C2D7; Tue, 19 Jun 2018 17:28:06 +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 612D216A2D; Tue, 19 Jun 2018 17:28:06 +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 w5JHS6eg010136; Tue, 19 Jun 2018 17:28:06 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JHS51w010133; Tue, 19 Jun 2018 17:28:05 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806191728.w5JHS51w010133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Jun 2018 17:28:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335376 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 335376 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 17:28:07 -0000 Author: emaste Date: Tue Jun 19 17:28:05 2018 New Revision: 335376 URL: https://svnweb.freebsd.org/changeset/base/335376 Log: usr.bin/ar: use standard 2-Clause FreeBSD license Many licenses on ar files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the usual standard 2-clause FreeBSD license for those files where I have obtained permission from all of the listed copyright holders. Approved by: jkoshy, kaiw Differential Revision: https://reviews.freebsd.org/D14561 Modified: head/usr.bin/ar/acplex.l head/usr.bin/ar/acpyacc.y head/usr.bin/ar/ar.h head/usr.bin/ar/write.c Modified: head/usr.bin/ar/acplex.l ============================================================================== --- head/usr.bin/ar/acplex.l Tue Jun 19 17:11:53 2018 (r335375) +++ head/usr.bin/ar/acplex.l Tue Jun 19 17:28:05 2018 (r335376) @@ -9,22 +9,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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 Modified: head/usr.bin/ar/acpyacc.y ============================================================================== --- head/usr.bin/ar/acpyacc.y Tue Jun 19 17:11:53 2018 (r335375) +++ head/usr.bin/ar/acpyacc.y Tue Jun 19 17:28:05 2018 (r335376) @@ -9,22 +9,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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 Modified: head/usr.bin/ar/ar.h ============================================================================== --- head/usr.bin/ar/ar.h Tue Jun 19 17:11:53 2018 (r335375) +++ head/usr.bin/ar/ar.h Tue Jun 19 17:28:05 2018 (r335376) @@ -8,22 +8,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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$ */ Modified: head/usr.bin/ar/write.c ============================================================================== --- head/usr.bin/ar/write.c Tue Jun 19 17:11:53 2018 (r335375) +++ head/usr.bin/ar/write.c Tue Jun 19 17:28:05 2018 (r335376) @@ -8,22 +8,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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 From owner-svn-src-all@freebsd.org Tue Jun 19 17:30:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EFAEB1002349; Tue, 19 Jun 2018 17:30: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A353D6C4EF; Tue, 19 Jun 2018 17:30: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 850B616A38; Tue, 19 Jun 2018 17:30: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 w5JHUCiG010298; Tue, 19 Jun 2018 17:30:12 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JHUB4m010295; Tue, 19 Jun 2018 17:30:11 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806191730.w5JHUB4m010295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Jun 2018 17:30:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335377 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 335377 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 17:30:13 -0000 Author: emaste Date: Tue Jun 19 17:30:11 2018 New Revision: 335377 URL: https://svnweb.freebsd.org/changeset/base/335377 Log: usr.bin/ar: remove incorrect SPDX tags Three ar files have a non-standard variation of the BSD license, so remove their SPDX tags. Sponsored by: The FreeBSD Foundation Modified: head/usr.bin/ar/ar.c head/usr.bin/ar/read.c head/usr.bin/ar/util.c Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Tue Jun 19 17:28:05 2018 (r335376) +++ head/usr.bin/ar/ar.c Tue Jun 19 17:30:11 2018 (r335377) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-3-Clause - * * Copyright (c) 2007 Kai Wang * Copyright (c) 2007 Tim Kientzle * Copyright (c) 2007 Joseph Koshy Modified: head/usr.bin/ar/read.c ============================================================================== --- head/usr.bin/ar/read.c Tue Jun 19 17:28:05 2018 (r335376) +++ head/usr.bin/ar/read.c Tue Jun 19 17:30:11 2018 (r335377) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 2007 Kai Wang * Copyright (c) 2007 Tim Kientzle * All rights reserved. Modified: head/usr.bin/ar/util.c ============================================================================== --- head/usr.bin/ar/util.c Tue Jun 19 17:28:05 2018 (r335376) +++ head/usr.bin/ar/util.c Tue Jun 19 17:30:11 2018 (r335377) @@ -1,6 +1,4 @@ /*- - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD - * * Copyright (c) 2003-2007 Tim Kientzle * All rights reserved. * From owner-svn-src-all@freebsd.org Tue Jun 19 17:39:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5665A1002CB4; Tue, 19 Jun 2018 17:39:33 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A5B466CD90; Tue, 19 Jun 2018 17:39:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5JHdSIB070581; Tue, 19 Jun 2018 10:39:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5JHdSje070580; Tue, 19 Jun 2018 10:39:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806191739.w5JHdSje070580@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335377 - head/usr.bin/ar In-Reply-To: <201806191730.w5JHUB4m010295@repo.freebsd.org> To: Ed Maste Date: Tue, 19 Jun 2018 10:39:28 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 17:39:33 -0000 > Author: emaste > Date: Tue Jun 19 17:30:11 2018 > New Revision: 335377 > URL: https://svnweb.freebsd.org/changeset/base/335377 > > Log: > usr.bin/ar: remove incorrect SPDX tags > > Three ar files have a non-standard variation of the BSD license, so > remove their SPDX tags. > > Sponsored by: The FreeBSD Foundation > > Modified: > head/usr.bin/ar/ar.c > head/usr.bin/ar/read.c > head/usr.bin/ar/util.c > > Modified: head/usr.bin/ar/ar.c > ============================================================================== > --- head/usr.bin/ar/ar.c Tue Jun 19 17:28:05 2018 (r335376) > +++ head/usr.bin/ar/ar.c Tue Jun 19 17:30:11 2018 (r335377) > @@ -1,6 +1,4 @@ > /*- > - * SPDX-License-Identifier: BSD-3-Clause > - * Does it make since to put some comment here to keep these from coming back in the future? Thanks, Rod > * Copyright (c) 2007 Kai Wang > * Copyright (c) 2007 Tim Kientzle > * Copyright (c) 2007 Joseph Koshy > > Modified: head/usr.bin/ar/read.c > ============================================================================== > --- head/usr.bin/ar/read.c Tue Jun 19 17:28:05 2018 (r335376) > +++ head/usr.bin/ar/read.c Tue Jun 19 17:30:11 2018 (r335377) > @@ -1,6 +1,4 @@ > /*- > - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > - * > * Copyright (c) 2007 Kai Wang > * Copyright (c) 2007 Tim Kientzle > * All rights reserved. > > Modified: head/usr.bin/ar/util.c > ============================================================================== > --- head/usr.bin/ar/util.c Tue Jun 19 17:28:05 2018 (r335376) > +++ head/usr.bin/ar/util.c Tue Jun 19 17:30:11 2018 (r335377) > @@ -1,6 +1,4 @@ > /*- > - * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > - * > * Copyright (c) 2003-2007 Tim Kientzle > * All rights reserved. > * > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 19 17:41:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F025B100324C; Tue, 19 Jun 2018 17:41:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A25166D0C0; Tue, 19 Jun 2018 17:41:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8420A16D32; Tue, 19 Jun 2018 17:41:46 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JHfkl1018676; Tue, 19 Jun 2018 17:41:46 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JHfkxM018675; Tue, 19 Jun 2018 17:41:46 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806191741.w5JHfkxM018675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 19 Jun 2018 17:41:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335378 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335378 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 17:41:47 -0000 Author: asomers Date: Tue Jun 19 17:41:46 2018 New Revision: 335378 URL: https://svnweb.freebsd.org/changeset/base/335378 Log: audit(4): add tests for sendmsg, recvmsg, shutdown, and sendfile Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15895 Modified: head/tests/sys/audit/network.c Modified: head/tests/sys/audit/network.c ============================================================================== --- head/tests/sys/audit/network.c Tue Jun 19 17:30:11 2018 (r335377) +++ head/tests/sys/audit/network.c Tue Jun 19 17:41:46 2018 (r335378) @@ -27,31 +27,65 @@ #include #include +#include +#include #include #include #include #include +#include #include "utils.h" -#define MAX_DATA 1024 +#define MAX_DATA 128 #define SERVER_PATH "server" +static pid_t pid; +static mode_t mode = 0777; static int sockfd, sockfd2, connectfd; static ssize_t data_bytes; +static socklen_t len = sizeof(struct sockaddr_un); +static struct iovec io1, io2; static struct pollfd fds[1]; static struct sockaddr_un server; -static char extregex[80]; +static struct msghdr sendbuf, recvbuf; +static char extregex[MAX_DATA]; static char data[MAX_DATA]; -static socklen_t len = sizeof(struct sockaddr_un); static char msgbuff[MAX_DATA] = "This message does not exist"; static const char *auclass = "nt"; +static const char *path = "fileforaudit"; static const char *nosupregex = "return,failure : Address family " "not supported by protocol family"; static const char *invalregex = "return,failure : Bad file descriptor"; /* + * Initialize iovec structure to be used as a field of struct msghdr + */ +static void +init_iov(struct iovec *io, char msgbuf[], int datalen) +{ + io->iov_base = msgbuf; + io->iov_len = datalen; +} + +/* + * Initialize msghdr structure for communication via datagram sockets + */ +static void +init_msghdr(struct msghdr *hdrbuf, struct iovec *io, struct sockaddr_un *addr) +{ + socklen_t length; + + bzero(hdrbuf, sizeof(*hdrbuf)); + length = (socklen_t)sizeof(struct sockaddr_un); + hdrbuf->msg_name = addr; + hdrbuf->msg_namelen = length; + hdrbuf->msg_iov = io; + hdrbuf->msg_iovlen = 1; +} + +/* * Variadic function to close socket descriptors */ static void @@ -648,7 +682,6 @@ ATF_TC_BODY(recv_success, tc) /* Receive data once connectfd is ready for reading */ FILE *pipefd = setup(fds, auclass); - //ATF_REQUIRE(check_readfs(connectfd) != 0); ATF_REQUIRE((data_bytes = recv(connectfd, data, MAX_DATA, 0)) != 0); /* Audit record must contain connectfd and data_bytes */ @@ -808,6 +841,253 @@ ATF_TC_CLEANUP(recvfrom_failure, tc) } +ATF_TC_WITH_CLEANUP(sendmsg_success); +ATF_TC_HEAD(sendmsg_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "recvmsg(2) call"); +} + +ATF_TC_BODY(sendmsg_success, tc) +{ + assign_address(&server); + /* Create a datagram server socket & bind to UNIX address family */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + + /* Message buffer to be sent to the server */ + init_iov(&io1, msgbuff, sizeof(msgbuff)); + init_msghdr(&sendbuf, &io1, &server); + + /* Set up UDP client to communicate with the server */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + + /* Send a sample message to the specified client address */ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((data_bytes = sendmsg(sockfd2, &sendbuf, 0)) != -1); + + /* Audit record must contain sockfd2 and data_bytes */ + snprintf(extregex, sizeof(extregex), + "sendmsg.*0x%x.*return,success,%zd", sockfd2, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(sendmsg_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(sendmsg_failure); +ATF_TC_HEAD(sendmsg_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "sendmsg(2) call"); +} + +ATF_TC_BODY(sendmsg_failure, tc) +{ + snprintf(extregex, sizeof(extregex), + "sendmsg.*return,failure : Bad address"); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, sendmsg(-1, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(sendmsg_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recvmsg_success); +ATF_TC_HEAD(recvmsg_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "recvmsg(2) call"); +} + +ATF_TC_BODY(recvmsg_success, tc) +{ + assign_address(&server); + /* Create a datagram server socket & bind to UNIX address family */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + + /* Message buffer to be sent to the server */ + init_iov(&io1, msgbuff, sizeof(msgbuff)); + init_msghdr(&sendbuf, &io1, &server); + + /* Prepare buffer to store the received data in */ + init_iov(&io2, data, sizeof(data)); + init_msghdr(&recvbuf, &io2, NULL); + + /* Set up UDP client to communicate with the server */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_DGRAM, 0)) != -1); + /* Send a sample message to the connected socket */ + ATF_REQUIRE(sendmsg(sockfd2, &sendbuf, 0) != -1); + + /* Receive data once clientfd is ready for reading */ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((data_bytes = recvmsg(sockfd, &recvbuf, 0)) != -1); + + /* Audit record must contain sockfd and data_bytes */ + snprintf(extregex, sizeof(extregex), + "recvmsg.*%#x.*return,success,%zd", sockfd, data_bytes); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(2, sockfd, sockfd2); +} + +ATF_TC_CLEANUP(recvmsg_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(recvmsg_failure); +ATF_TC_HEAD(recvmsg_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "recvmsg(2) call"); +} + +ATF_TC_BODY(recvmsg_failure, tc) +{ + snprintf(extregex, sizeof(extregex), + "recvmsg.*return,failure : Bad address"); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, recvmsg(-1, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(recvmsg_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shutdown_success); +ATF_TC_HEAD(shutdown_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "shutdown(2) call"); +} + +ATF_TC_BODY(shutdown_success, tc) +{ + assign_address(&server); + /* Setup server socket and bind to the specified address */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, bind(sockfd, (struct sockaddr *)&server, len)); + ATF_REQUIRE_EQ(0, listen(sockfd, 1)); + + /* Setup client and connect with the blocking server */ + ATF_REQUIRE((sockfd2 = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + ATF_REQUIRE_EQ(0, connect(sockfd2, (struct sockaddr *)&server, len)); + ATF_REQUIRE((connectfd = accept(sockfd, NULL, &len)) != -1); + + /* Audit record must contain clientfd */ + snprintf(extregex, sizeof(extregex), + "shutdown.*%#x.*return,success", connectfd); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, shutdown(connectfd, SHUT_RDWR)); + check_audit(fds, extregex, pipefd); + + /* Close all socket descriptors */ + close_sockets(3, sockfd, sockfd2, connectfd); +} + +ATF_TC_CLEANUP(shutdown_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(shutdown_failure); +ATF_TC_HEAD(shutdown_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "shutdown(2) call"); +} + +ATF_TC_BODY(shutdown_failure, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), + "shutdown.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: Invalid socket descriptor */ + ATF_REQUIRE_EQ(-1, shutdown(-1, SHUT_RDWR)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(shutdown_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(sendfile_success); +ATF_TC_HEAD(sendfile_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "sendfile(2) call"); +} + +ATF_TC_BODY(sendfile_success, tc) +{ + int filedesc; + ATF_REQUIRE((filedesc = open(path, O_CREAT | O_RDONLY, mode)) != -1); + /* Create a simple UNIX socket to send out random data */ + ATF_REQUIRE((sockfd = socket(PF_UNIX, SOCK_STREAM, 0)) != -1); + /* Check the presence of sockfd, non-file in the audit record */ + snprintf(extregex, sizeof(extregex), + "sendfile.*%#x,non-file.*return,success", filedesc); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, sendfile(filedesc, sockfd, 0, 0, NULL, NULL, 0)); + check_audit(fds, extregex, pipefd); + + /* Teardown socket and file descriptors */ + close_sockets(2, sockfd, filedesc); +} + +ATF_TC_CLEANUP(sendfile_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(sendfile_failure); +ATF_TC_HEAD(sendfile_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "sendfile(2) call"); +} + +ATF_TC_BODY(sendfile_failure, tc) +{ + pid = getpid(); + snprintf(extregex, sizeof(extregex), + "sendfile.*%d.*return,failure", pid); + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, sendfile(-1, -1, 0, 0, NULL, NULL, 0)); + check_audit(fds, extregex, pipefd); +} + +ATF_TC_CLEANUP(sendfile_failure, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, socket_success); @@ -840,6 +1120,16 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, sendto_failure); ATF_TP_ADD_TC(tp, recvfrom_success); ATF_TP_ADD_TC(tp, recvfrom_failure); + + ATF_TP_ADD_TC(tp, sendmsg_success); + ATF_TP_ADD_TC(tp, sendmsg_failure); + ATF_TP_ADD_TC(tp, recvmsg_success); + ATF_TP_ADD_TC(tp, recvmsg_failure); + + ATF_TP_ADD_TC(tp, shutdown_success); + ATF_TP_ADD_TC(tp, shutdown_failure); + ATF_TP_ADD_TC(tp, sendfile_success); + ATF_TP_ADD_TC(tp, sendfile_failure); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Tue Jun 19 18:09:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 024A41004DCF; Tue, 19 Jun 2018 18:09:16 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A84DD6E718; Tue, 19 Jun 2018 18:09:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 87EE4170FE; Tue, 19 Jun 2018 18:09:15 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JI9F55031311; Tue, 19 Jun 2018 18:09:15 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JI9F2P031310; Tue, 19 Jun 2018 18:09:15 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806191809.w5JI9F2P031310@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 19 Jun 2018 18:09:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335379 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 335379 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 18:09:16 -0000 Author: sbruno Date: Tue Jun 19 18:09:15 2018 New Revision: 335379 URL: https://svnweb.freebsd.org/changeset/base/335379 Log: Set prev to NULL so its garaunteed to have a value of some kind and gcc doesn't explode. Feel free to fix this correctly or whatever for gcc builds. This *should* quiesce tinderbox after r335347 for the gcc builds. Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Tue Jun 19 17:41:46 2018 (r335378) +++ head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:09:15 2018 (r335379) @@ -1979,7 +1979,7 @@ int nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value) { nvpair_t *tmpnvp; - nvlist_t *nvl, *prev; + nvlist_t *nvl, *prev = NULL; int flags; NVPAIR_ASSERT(nvp); From owner-svn-src-all@freebsd.org Tue Jun 19 18:25:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EF6D61006375; Tue, 19 Jun 2018 18:25:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D85A6F76C; Tue, 19 Jun 2018 18:25:44 +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 7F0B917443; Tue, 19 Jun 2018 18:25:44 +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 w5JIPihm042112; Tue, 19 Jun 2018 18:25:44 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JIPiRB042111; Tue, 19 Jun 2018 18:25:44 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201806191825.w5JIPiRB042111@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 Jun 2018 18:25:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335380 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 335380 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 18:25:45 -0000 Author: lwhsu (ports committer) Date: Tue Jun 19 18:25:43 2018 New Revision: 335380 URL: https://svnweb.freebsd.org/changeset/base/335380 Log: style(9) fix, I was also going to silence gcc. Approved by: emaste, oshogbo Sponsored by: The FreeBSD Foundation Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:09:15 2018 (r335379) +++ head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:25:43 2018 (r335380) @@ -1997,6 +1997,7 @@ nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist nvlist_set_flags(nvl, flags); tmpnvp = NULL; + prev = NULL; if (nvp->nvp_nitems > 0) { nvlist_t **nvls = (void *)(uintptr_t)nvp->nvp_data; From owner-svn-src-all@freebsd.org Tue Jun 19 18:32:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B5421006AE2; Tue, 19 Jun 2018 18:32:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 195266FCFF; Tue, 19 Jun 2018 18:32:07 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EE7AB175B6; Tue, 19 Jun 2018 18:32:06 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JIW6H6046077; Tue, 19 Jun 2018 18:32:06 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JIW6Nd046076; Tue, 19 Jun 2018 18:32:06 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806191832.w5JIW6Nd046076@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Tue, 19 Jun 2018 18:32:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335381 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335381 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 18:32:07 -0000 Author: asomers Date: Tue Jun 19 18:32:06 2018 New Revision: 335381 URL: https://svnweb.freebsd.org/changeset/base/335381 Log: top(1): Fix Coverity warning Don't call strerror on negative errnos Reported by: Coverity CID: 976708 Reviewed by: eadler Differential Revision: https://reviews.freebsd.org/D15909 Modified: head/usr.bin/top/commands.c Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Tue Jun 19 18:25:43 2018 (r335380) +++ head/usr.bin/top/commands.c Tue Jun 19 18:32:06 2018 (r335381) @@ -242,7 +242,7 @@ err_string(void) errp = &(errs[cnt++]); if (errp->errnum != currerr) { - if (currerr != -1) + if (currerr >= 0) { if ((stringlen = str_adderr(string, stringlen, currerr)) < 2) { From owner-svn-src-all@freebsd.org Tue Jun 19 18:43:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F23FE100759C; Tue, 19 Jun 2018 18:43:02 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9FF9F70567; Tue, 19 Jun 2018 18:43:02 +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 821321778F; Tue, 19 Jun 2018 18:43:02 +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 w5JIh2eE052277; Tue, 19 Jun 2018 18:43:02 GMT (envelope-from lwhsu@FreeBSD.org) Received: (from lwhsu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JIh2B5052276; Tue, 19 Jun 2018 18:43:02 GMT (envelope-from lwhsu@FreeBSD.org) Message-Id: <201806191843.w5JIh2B5052276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lwhsu set sender to lwhsu@FreeBSD.org using -f From: Li-Wen Hsu Date: Tue, 19 Jun 2018 18:43:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335382 - head/sys/contrib/libnv X-SVN-Group: head X-SVN-Commit-Author: lwhsu X-SVN-Commit-Paths: head/sys/contrib/libnv X-SVN-Commit-Revision: 335382 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 18:43:03 -0000 Author: lwhsu (ports committer) Date: Tue Jun 19 18:43:02 2018 New Revision: 335382 URL: https://svnweb.freebsd.org/changeset/base/335382 Log: Really fix the style. Approved by: oshogbo Sponsored by: The FreeBSD Foundation Modified: head/sys/contrib/libnv/nvpair.c Modified: head/sys/contrib/libnv/nvpair.c ============================================================================== --- head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:32:06 2018 (r335381) +++ head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:43:02 2018 (r335382) @@ -1979,7 +1979,7 @@ int nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value) { nvpair_t *tmpnvp; - nvlist_t *nvl, *prev = NULL; + nvlist_t *nvl, *prev; int flags; NVPAIR_ASSERT(nvp); From owner-svn-src-all@freebsd.org Tue Jun 19 19:27:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEBA11009971; Tue, 19 Jun 2018 19:27:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8F9A672307; Tue, 19 Jun 2018 19:27:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 708F517E27; Tue, 19 Jun 2018 19:27:37 +0000 (UTC) (envelope-from feld@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JJRblY073422; Tue, 19 Jun 2018 19:27:37 GMT (envelope-from feld@FreeBSD.org) Received: (from feld@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JJRbbG073421; Tue, 19 Jun 2018 19:27:37 GMT (envelope-from feld@FreeBSD.org) Message-Id: <201806191927.w5JJRbbG073421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: feld set sender to feld@FreeBSD.org using -f From: Mark Felder Date: Tue, 19 Jun 2018 19:27:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335383 - head/share/man/man8 X-SVN-Group: head X-SVN-Commit-Author: feld X-SVN-Commit-Paths: head/share/man/man8 X-SVN-Commit-Revision: 335383 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 19:27:38 -0000 Author: feld (ports committer) Date: Tue Jun 19 19:27:37 2018 New Revision: 335383 URL: https://svnweb.freebsd.org/changeset/base/335383 Log: Document the new ${name}_env_file feature Approved by: bcr MFH: 3 days Differential Revision: https://reviews.freebsd.org/D15578 Modified: head/share/man/man8/rc.subr.8 Modified: head/share/man/man8/rc.subr.8 ============================================================================== --- head/share/man/man8/rc.subr.8 Tue Jun 19 18:43:02 2018 (r335382) +++ head/share/man/man8/rc.subr.8 Tue Jun 19 19:27:37 2018 (r335383) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 3, 2018 +.Dd June 19, 2018 .Dt RC.SUBR 8 .Os .Sh NAME @@ -554,6 +554,13 @@ with. This will be passed as arguments to the .Xr env 1 utility. +.It Va ${name}_env_file +A file to source for environmental variables to run +.Va command +with. +Note that all the variables which are being assigned in this file are going +to be exported into the environment of +.Va command . .It Va ${name}_fib FIB .Pa Routing Table From owner-svn-src-all@freebsd.org Tue Jun 19 19:57:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35199100B316 for ; Tue, 19 Jun 2018 19:57:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic303-4.consmr.mail.bf2.yahoo.com (sonic303-4.consmr.mail.bf2.yahoo.com [74.6.131.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC915736B1 for ; Tue, 19 Jun 2018 19:57:52 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1529438271; bh=p2RpPN9Q+7jGxtP4DnStcDP9sMHt2HLG1YvGFXSlIXc=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=ioXCCT6H27c0ypeBu3yrEhJKqdiqqcV7a0IHpphrKpwREM/v0DXLQOHU8v5Zi6hGx2Aonyy6Q3ILfOvv4YFErGKzWXuKaIFqdgVujgM/I8Apk86jRcS3C5Vu16ho07WMII2BDb3foJdhhntJRlZke0sgojchKHJj+UWrkRIZ1F1/F3dNFAshgUJAxVZxjq7beExN7U36RnmxdIQReCvN89CRcOTTa8C5MkDeBdHGPHZGFujYDt7XtRAtUybiq0v9Gi7+jrrYsr+yXlIkZiwBY8GiUyzxKDAoz0HHaSFvp5fnOk8czQ2ZzzWX4h52LfsmqJ2ep4GGTBeKyJOOZWvPwA== X-YMail-OSG: UhA0w4wVM1nMPdHctBTWet0FDp9qRY2_fUPsNJSuaU7DTt1wz8XC6g.Ktf5c_zx LR9LIItT8x9fHmVFer_wYG3h9kIed8RNG5KBC4Rksjo1SlaoaYr6le0.GwBmnvhCO9VP4wLq4PUk qP49EFu1.PavAIyKFIJ_Ow.6PifKe5yrk0UVp2LV2lt_uyhIrD1DL_FcD0FvhrrtuZp3ZsuRrZim 0btD7_rKzbig.9eB89M6bFfMateHAOITfksjIGCedJyJjjBEiOSLtztiBseBtT.tEi6nW4TJNSlF 8YvF4N_V1icbYU58R8gEzUAVNf_7t4kXmc5NeiMPoscd9dy7foGet8YgrjkqIJC8vMn579QPdbpt h_7KMVbNOFVUO70yXYCVZId_YXOPWePeUbtD.wRGNTOpXBc6MPc03JOBxcZwqsnrs.FGohg5wRIJ EDUhM6Gw6tRjaNARR51Xm5Wy4vW09dK9pah0F.zSz_XTsct2ML1LeifrwHu9nourgVJjiQP4SX5g i1vkzpRSXHV.9p.Eev.Paq.UIIM8q5JlQmSPH.awNm7ZRe.F.kuc7JWn9tgAJup72Fg5G0C9eU2d Lmbw7KWb.q2qLAAqF6hgXVpR948eYVL4ld2lCawQbIilzanhInQG6f673p9qp.Mpg1EirK63En80 T_UdGaKOJOzD_rcyxcqu8Cw-- Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.bf2.yahoo.com with HTTP; Tue, 19 Jun 2018 19:57:51 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp428.mail.bf1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 8d1d037a6289f9f7f3aae06c471cdccf; Tue, 19 Jun 2018 19:57:47 +0000 (UTC) Subject: Re: svn commit: r335278 - head/bin/pwd To: John Baldwin , Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> <4ad7ef96-e623-5ab8-dc47-c3178115ff24@FreeBSD.org> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Tue, 19 Jun 2018 14:57:48 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <4ad7ef96-e623-5ab8-dc47-c3178115ff24@FreeBSD.org> 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 19:57:53 -0000 On 19/06/2018 11:25, John Baldwin wrote: > On 6/18/18 10:26 PM, Eitan Adler wrote: >> On 18 June 2018 at 10:57, John Baldwin wrote: >>> On 6/16/18 10:14 PM, Eitan Adler wrote: >>>> Author: eadler >>>> Date: Sun Jun 17 05:14:50 2018 >>>> New Revision: 335278 >>>> URL: https://svnweb.freebsd.org/changeset/base/335278 >>>> >>>> Log: >>>> pwd: mark usage as dead >>> You keep committing changes like this and ignoring e-mails about them. >> I replied both the first time and this time. I may have >> (accidentally?) ignored similar emails though. The question I have is >> other than the mild code churn what's the harm? > It adds clutter. Also, fixing the tool means you fix all the places at > once rather than slowly adding workarounds one by one. > >>> What broken compiler are you using that doesn't properly inherit __dead2 >>> from the call to exit()? >> In this case, scan-build50 was getting annoyed. > Does scan-build from LLVM 6.0 handle this correctly? If so, I'd say to > just mark this warning as broken (and thus ignore it) for scan-build50 > just as we ignore certain warnings from GCC 4.2.1 because they are > broken-as-implemented. > FWIW, clang's scan-build is made to even more false positives and general noise than the regular compiler warnings. It is better to just ignore it unless it finds something real. Pedro. From owner-svn-src-all@freebsd.org Tue Jun 19 20:02:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17241100B7E3; Tue, 19 Jun 2018 20:02:05 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B987D73AD1; Tue, 19 Jun 2018 20:02:04 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9AC841847C; Tue, 19 Jun 2018 20:02:04 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JK24jj093900; Tue, 19 Jun 2018 20:02:04 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JK24Pp093893; Tue, 19 Jun 2018 20:02:04 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806192002.w5JK24Pp093893@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Tue, 19 Jun 2018 20:02:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335384 - head/sys/cam/mmc X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: head/sys/cam/mmc X-SVN-Commit-Revision: 335384 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 20:02:05 -0000 Author: kibab Date: Tue Jun 19 20:02:03 2018 New Revision: 335384 URL: https://svnweb.freebsd.org/changeset/base/335384 Log: Fix setting RCA for MMC cards Unlike SD cards, that publish RCA in response to CMD3, MMC cards expect the host to set RCA itself. Since we don't support multiple MMC cards on the bus, just assign a static RCA of 2 to the attached MMC card. Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D13063 Modified: head/sys/cam/mmc/mmc.h head/sys/cam/mmc/mmc_xpt.c Modified: head/sys/cam/mmc/mmc.h ============================================================================== --- head/sys/cam/mmc/mmc.h Tue Jun 19 19:27:37 2018 (r335383) +++ head/sys/cam/mmc/mmc.h Tue Jun 19 20:02:03 2018 (r335384) @@ -94,4 +94,12 @@ struct mmc_params { uint8_t sdio_func_count; } __packed; +/* + * Only one MMC card on bus is supported now. + * If we ever want to support multiple MMC cards on the same bus, + * mmc_xpt needs to be extended to issue new RCAs based on number + * of already probed cards. Furthermore, retuning and high-speed + * settings should also take all cards into account. + */ +#define MMC_PROPOSED_RCA 2 #endif Modified: head/sys/cam/mmc/mmc_xpt.c ============================================================================== --- head/sys/cam/mmc/mmc_xpt.c Tue Jun 19 19:27:37 2018 (r335383) +++ head/sys/cam/mmc/mmc_xpt.c Tue Jun 19 20:02:03 2018 (r335384) @@ -98,7 +98,8 @@ typedef enum { PROBE_GET_CID, PROBE_GET_CSD, PROBE_SEND_RELATIVE_ADDR, - PROBE_SELECT_CARD, + PROBE_MMC_SET_RELATIVE_ADDR, + PROBE_SELECT_CARD, PROBE_DONE, PROBE_INVALID } probe_action; @@ -114,6 +115,7 @@ static char *probe_action_text[] = { "PROBE_GET_CID", "PROBE_GET_CSD", "PROBE_SEND_RELATIVE_ADDR", + "PROBE_MMC_SET_RELATIVE_ADDR", "PROBE_SELECT_CARD", "PROBE_DONE", "PROBE_INVALID" @@ -702,7 +704,6 @@ mmcprobe_start(struct cam_periph *periph, union ccb *s mmcio->cmd.flags = MMC_RSP_R2 | MMC_CMD_BCR; mmcio->stop.opcode = 0; break; - case PROBE_SEND_RELATIVE_ADDR: init_standard_ccb(start_ccb, XPT_MMC_IO); mmcio->cmd.opcode = SD_SEND_RELATIVE_ADDR; @@ -710,6 +711,13 @@ mmcprobe_start(struct cam_periph *periph, union ccb *s mmcio->cmd.flags = MMC_RSP_R6 | MMC_CMD_BCR; mmcio->stop.opcode = 0; break; + case PROBE_MMC_SET_RELATIVE_ADDR: + init_standard_ccb(start_ccb, XPT_MMC_IO); + mmcio->cmd.opcode = MMC_SET_RELATIVE_ADDR; + mmcio->cmd.arg = MMC_PROPOSED_RCA << 16; + mmcio->cmd.flags = MMC_RSP_R1 | MMC_CMD_AC; + mmcio->stop.opcode = 0; + break; case PROBE_SELECT_CARD: init_standard_ccb(start_ccb, XPT_MMC_IO); mmcio->cmd.opcode = MMC_SELECT_CARD; @@ -985,7 +993,10 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do mmcp->card_cid[1], mmcp->card_cid[2], mmcp->card_cid[3])); - PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); + if (mmcp->card_features & CARD_FEATURE_MMC) + PROBE_SET_ACTION(softc, PROBE_MMC_SET_RELATIVE_ADDR); + else + PROBE_SET_ACTION(softc, PROBE_SEND_RELATIVE_ADDR); break; } case PROBE_SEND_RELATIVE_ADDR: { @@ -1010,6 +1021,18 @@ mmcprobe_done(struct cam_periph *periph, union ccb *do PROBE_SET_ACTION(softc, PROBE_SELECT_CARD); break; } + case PROBE_MMC_SET_RELATIVE_ADDR: + mmcio = &done_ccb->mmcio; + err = mmcio->cmd.error; + if (err != MMC_ERR_NONE) { + CAM_DEBUG(done_ccb->ccb_h.path, CAM_DEBUG_PROBE, + ("PROBE_MMC_SET_RELATIVE_ADDR: error %d\n", err)); + PROBE_SET_ACTION(softc, PROBE_INVALID); + break; + } + path->device->mmc_ident_data.card_rca = MMC_PROPOSED_RCA; + PROBE_SET_ACTION(softc, PROBE_GET_CSD); + break; case PROBE_GET_CSD: { mmcio = &done_ccb->mmcio; err = mmcio->cmd.error; From owner-svn-src-all@freebsd.org Tue Jun 19 20:23:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AF27100C7E4; Tue, 19 Jun 2018 20:23:28 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD06745D8; Tue, 19 Jun 2018 20:23:27 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5JKNNKE071164; Tue, 19 Jun 2018 13:23:23 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5JKNNfe071163; Tue, 19 Jun 2018 13:23:23 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806192023.w5JKNNfe071163@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335379 - head/sys/contrib/libnv In-Reply-To: <201806191809.w5JI9F2P031310@repo.freebsd.org> To: Sean Bruno Date: Tue, 19 Jun 2018 13:23:23 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 20:23:28 -0000 > Author: sbruno > Date: Tue Jun 19 18:09:15 2018 > New Revision: 335379 > URL: https://svnweb.freebsd.org/changeset/base/335379 > > Log: > Set prev to NULL so its garaunteed to have a value of some kind and > gcc doesn't explode. Feel free to fix this correctly or whatever for > gcc builds. > > This *should* quiesce tinderbox after r335347 for the gcc builds. > > Modified: > head/sys/contrib/libnv/nvpair.c > > Modified: head/sys/contrib/libnv/nvpair.c > ============================================================================== > --- head/sys/contrib/libnv/nvpair.c Tue Jun 19 17:41:46 2018 (r335378) > +++ head/sys/contrib/libnv/nvpair.c Tue Jun 19 18:09:15 2018 (r335379) > @@ -1979,7 +1979,7 @@ int > nvpair_append_nvlist_array(nvpair_t *nvp, const nvlist_t *value) > { > nvpair_t *tmpnvp; > - nvlist_t *nvl, *prev; > + nvlist_t *nvl, *prev = NULL; Please please please mark these so that people *can* at some time know that this was 1) done to quiet some compiler, and 2) fix it properly so all things are quiet about it. - nvlist_t *nvl, *prev; + nvlist_t *nvl; + nvlist_t *prev = NULL; /* Quiet gcc foo.bar XXX */ > int flags; > Or even less intrusive would of been to put this one line add in leaving the declarations untouched. I think this would be the prefered mothod for these types of things. + *prev = NULL; /* Quiet gcc foo.bar XXX */ > NVPAIR_ASSERT(nvp); > Thanks, -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Tue Jun 19 20:31:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A99DC100D0D6; Tue, 19 Jun 2018 20:31:40 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 23E0674CF5; Tue, 19 Jun 2018 20:31:39 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.180.76.168]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MLS74-1fVvW53C3m-000fpA; Tue, 19 Jun 2018 22:31:31 +0200 Date: Tue, 19 Jun 2018 22:30:58 +0200 From: "O. Hartmann" To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot Message-ID: <20180619223114.4a8f8426@thor.intern.walstatt.dynvpn.de> In-Reply-To: <201806170318.w5H3IvJP090557@repo.freebsd.org> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:omJtorlswvjlsqcAACs2tIpYhmcalowX5FywFtpP+Vg+0wQw5o5 4TYtxJ8Sju1oDSWtsmaPuCC1c1haarGIUvP+iqVtLiMtwVtjz8KilrBAYJvl/XbjuKZC0d7 3vlzdae5JB1ozVugny7thI7antd7MEpKhbdRaOJA6facaqhQn5iA6lzfxVKnGHOt4sm2DBX uQmPTCbfcD3gLyWwTnGPQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:YyKp0PDBpwg=:Kwm+4SOWk22x5jDCCxcHwt UXrOzJADnVd9i1GWwekyMpBoYI/YeS71IAR+mClpriZ/WwHCLH59q7BOD4PYox8hJBdcLEF4S WWb34JKGuW3MJyXMRM5fuvN8dplOPCJw6RZIQhz/mWXsJVT36Ym6ue53xHMlQgQJgS+JOOUJm snVnon9V3JuqvDpXOwJvD8gOr7ZB/sjy8aNFV7GR6bSyy6wkOy/DSOTouu8EXnvhFHaPdKJTY ABF4FnoNg5ub1MqWVZcsnO0JWL9m4NZHoafkuFKeiqe3GaQVDY+8j9+cOZqlHFrKHR5nWI1Xf DcvN14aWxz2AOMguMnkBpzcRcESl4Q5twb2fIvwrTL8trm8JDDuyHT8qQd0yZ2AbDvPwjSgT6 fJGa2Ae58HlzbesSkxgpvVBuDCZuALJlmo152CXIqQ1ii7BSmtr8goM/SzT8bgT2wz9JfSIiW YbqCVa+IhQCr5zTQpvgujyM3GlyUT7PwyVimh4wRWMXeTENF26+2mHmp/7cLjqyLgRqggyBlu qBp5pVomWG+sIDsaTlMKcdyUFZAQo60yG4e8Q9i7bbz7j7Htd+rwNNQGywSMS/PHrZGUcBHbl 0XivvnqhpsuZlBeMkVeH8TI5QBbUTBryyCdqqooSdlikF02ZVgAyVofFFW894RA1IHteITY+V vZTRSEVaFd8ofPwI+KXkUatuqi4hQxWF+c1Yyga+1qW35b7aW+NUrAjbmV7nZj6IWM+kPMTsc ozVYYE2oUBFi7LgoIz7sfxgJuCsu3S12Qi27F3WVvbKciT3vSaLup/BW7JFOzUuJvVvE32Ps8 yAsAsAy X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 20:31:40 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFN1 biwgMTcgSnVuIDIwMTggMDM6MTg6NTcgKzAwMDAgKFVUQykNCkFsbGFuIEp1ZGUgPGFsbGFuanVk ZUBGcmVlQlNELm9yZz4gc2NocmllYjoNCg0KPiBBdXRob3I6IGFsbGFuanVkZQ0KPiBEYXRlOiBT dW4gSnVuIDE3IDAzOjE4OjU2IDIwMTgNCj4gTmV3IFJldmlzaW9uOiAzMzUyNzYNCj4gVVJMOiBo dHRwczovL3N2bndlYi5mcmVlYnNkLm9yZy9jaGFuZ2VzZXQvYmFzZS8zMzUyNzYNCj4gDQo+IExv ZzoNCj4gICBncHRib290LCB6ZnNib290LCBncHR6ZnNib290OiBFbmFibGUgdGhlIHZpZGVvIGFu ZCBzZXJpYWwgY29uc29sZXMgZWFybHkNCj4gICANCj4gICBOb3JtYWxseSB0aGUgc2VyaWFsIGNv bnNvbGUgaXMgbm90IGVuYWJsZWQgdW50aWwgL2Jvb3QuY29uZmlnIGlzIHJlYWQgYW5kDQo+ICAg d2Uga25vdyBob3cgdGhlIHNlcmlhbCBjb25zb2xlIHNob3VsZCBiZSBjb25maWd1cmVkLiAgSW5p dGlhbGl6ZSB0aGUNCj4gICBjb25zb2xlcyBlYXJseSBpbiAnZHVhbCcgbW9kZSAoc2VyaWFsICYg a2V5Ym9hcmQpIHdpdGggYSBkZWZhdWx0IHNlcmlhbA0KPiAgIHJhdGUgb2YgMTE1MjAwLiBUaGVu IHNlcmlhbCBpcyByZS1pbml0aWFsaXplZCBvbmNlIHRoZSBkaXNrIGlzIGRlY3J5cHRlZA0KPiAg IGFuZCB0aGUgL2Jvb3QuY29uZmlnIGZpbGUgY2FuIGJlIHJlYWQuDQo+ICAgDQo+ICAgVGhpcyBh bGxvd3MgdGhlIEdFTElCb290IHBhc3NwaHJhc2UgdG8gYmUgcHJvdmlkZWQgdmlhIHRoZSBzZXJp YWwgY29uc29sZS4NCj4gICANCj4gICBQUjoJCTIyMTUyNg0KPiAgIFJlcXVlc3RlZCBieToJbWFu eQ0KPiAgIFJldmlld2VkIGJ5OglpbXANCj4gICBTcG9uc29yZWQgYnk6CUtsYXJhIFN5c3RlbXMN Cj4gICBEaWZmZXJlbnRpYWwgUmV2aXNpb246CWh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9E MTU4NjINCj4gDQo+IE1vZGlmaWVkOg0KPiAgIGhlYWQvc3RhbmQvaTM4Ni9ncHRib290L2dwdGJv b3QuYw0KPiAgIGhlYWQvc3RhbmQvaTM4Ni96ZnNib290L3pmc2Jvb3QuYw0KPiANCj4gTW9kaWZp ZWQ6IGhlYWQvc3RhbmQvaTM4Ni9ncHRib290L2dwdGJvb3QuYw0KPiA9PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT0NCj4gLS0tIGhlYWQvc3RhbmQvaTM4Ni9ncHRib290L2dwdGJvb3QuYwlTdW4gSnVuIDE3 IDAzOjEwOjI1IDIwMTgJKHIzMzUyNzUpDQo+ICsrKyBoZWFkL3N0YW5kL2kzODYvZ3B0Ym9vdC9n cHRib290LmMJU3VuIEp1biAxNyAwMzoxODo1NiAyMDE4CShyMzM1Mjc2KQ0KPiBAQCAtMjg1LDYg KzI4NSwxNiBAQCBtYWluKHZvaWQpDQo+ICAJYm9vdGluZm8uYmlfbWVtc2l6ZXNfdmFsaWQrKzsN Cj4gIAlib290aW5mby5iaV9iaW9zX2RldiA9IGRzay5kcml2ZTsNCj4gIA0KPiArCS8qDQo+ICsJ ICogSW5pdGlhbGl6ZSB0aGUgc2VyaWFsIGNvbnNvbGUgZWFybHkgd2l0aCBhIG1vZGVybiBkZWZh dWx0IG9mIDExNTIwMC4NCj4gKwkgKiBMYXRlciwgd2UnbGwgcmVhZCBQQVRIX0RPVENPTkZJRyBh bmQgcmVjb25maWd1cmUgc2VyaWFsIGFjY29yZGluZw0KPiArCSAqIHRvIHRoZSBjb25maWd1cmF0 aW9uIHByb3ZpZGVkLg0KPiArCSAqLw0KPiArCW9wdHMgPSBPUFRfU0VUKFJCWF9EVUFMKTsNCj4g Kwlpb2N0cmwgPSAoSU9fU0VSSUFMfElPX0tFWUJPQVJEKTsNCj4gKwlpZiAoc2lvX2luaXQoMTE1 MjAwKSAhPSAwKQ0KPiArCQlpb2N0cmwgJj0gfklPX1NFUklBTDsNCj4gKw0KPiAgI2lmZGVmIExP QURFUl9HRUxJX1NVUFBPUlQNCj4gIAlnZWxpX2luaXQoKTsNCj4gICNlbmRpZg0KPiANCj4gTW9k aWZpZWQ6IGhlYWQvc3RhbmQvaTM4Ni96ZnNib290L3pmc2Jvb3QuYw0KPiA9PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT0NCj4gLS0tIGhlYWQvc3RhbmQvaTM4Ni96ZnNib290L3pmc2Jvb3QuYwlTdW4gSnVu IDE3IDAzOjEwOjI1IDIwMTgJKHIzMzUyNzUpDQo+ICsrKyBoZWFkL3N0YW5kL2kzODYvemZzYm9v dC96ZnNib290LmMJU3VuIEp1biAxNyAwMzoxODo1NiAyMDE4CShyMzM1Mjc2KQ0KPiBAQCAtNjkz LDYgKzY5MywxNiBAQCBtYWluKHZvaWQpDQo+ICAgICAgfQ0KPiAgICAgIHNldGhlYXAoaGVhcF9u ZXh0LCBoZWFwX2VuZCk7DQo+ICANCj4gKyAgICAvKg0KPiArICAgICAqIEluaXRpYWxpemUgdGhl IHNlcmlhbCBjb25zb2xlIGVhcmx5IHdpdGggYSBtb2Rlcm4gZGVmYXVsdCBvZiAxMTUyMDAuDQo+ ICsgICAgICogTGF0ZXIsIHdlJ2xsIHJlYWQgUEFUSF9ET1RDT05GSUcgYW5kIHJlY29uZmlndXJl IHNlcmlhbCBhY2NvcmRpbmcNCj4gKyAgICAgKiB0byB0aGUgY29uZmlndXJhdGlvbiBwcm92aWRl ZC4NCj4gKyAgICAgKi8NCj4gKyAgICBvcHRzID0gT1BUX1NFVChSQlhfRFVBTCk7DQo+ICsgICAg aW9jdHJsID0gKElPX1NFUklBTHxJT19LRVlCT0FSRCk7DQo+ICsgICAgaWYgKHNpb19pbml0KDEx NTIwMCkgIT0gMCkNCj4gKwlpb2N0cmwgJj0gfklPX1NFUklBTDsNCj4gKw0KPiAgICAgIGRzayA9 IG1hbGxvYyhzaXplb2Yoc3RydWN0IGRzaykpOw0KPiAgICAgIGRzay0+ZHJpdmUgPSAqKHVpbnQ4 X3QgKilQVE9WKEFSR1MpOw0KPiAgICAgIGRzay0+dHlwZSA9IGRzay0+ZHJpdmUgJiBEUlZfSEFS RCA/IFRZUEVfQUQgOiBUWVBFX0ZEOw0KPiBfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fXw0KPiBzdm4tc3JjLWhlYWRAZnJlZWJzZC5vcmcgbWFpbGluZyBsaXN0 DQo+IGh0dHBzOi8vbGlzdHMuZnJlZWJzZC5vcmcvbWFpbG1hbi9saXN0aW5mby9zdm4tc3JjLWhl YWQNCj4gVG8gdW5zdWJzY3JpYmUsIHNlbmQgYW55IG1haWwgdG8gInN2bi1zcmMtaGVhZC11bnN1 YnNjcmliZUBmcmVlYnNkLm9yZyINCg0KVGhpcyBjb21taXQgYnJlYWtzIGJvb3Rpbmcgb2ZmIEdQ VCBwYXJ0aXRpb24gKHVzaW5nIE5hbm9CU0QsIGFzIElwb3N0ZWQgbWlzdGFrZW5seSB0bw0KY29t bWl0IHIzMzUyNTQsIHNlZSB0aGVyZSkuDQpIYXZpbmcgQ1VSUkVOVCBhcHBsaWVkIHRvIGEgU0Qg Y2FyZCBmb3IgdXNhZ2Ugb24gYSBQQ0VuZ2luZXMgQVBVIDJDNCwgdGhlIGJvb3QgcHJvY2Vzcw0K ZGllcyBpbW1lZGlhdGVseSBzaG93aW5nICJCb290aW5nIGZyb20gaGFyZGRpc2siLiByMzM1Mjc1 IGJvb3RzIHdlbGwuDQoNCi0gLS0gDQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hlIGRl ciBOdXR6dW5nIG9kZXIgw5xiZXJtaXR0bHVuZyBtZWluZXIgRGF0ZW4gZsO8cg0KV2VyYmV6d2Vj a2Ugb2RlciBmw7xyIGRpZSBNYXJrdC0gb2RlciBNZWludW5nc2ZvcnNjaHVuZyAowqcgMjggQWJz LiA0IEJEU0cpLg0KLS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUxVRUFSTUtBQjBX SVFRWlZaTXpBdHdDMlQvODZUclM1MjhmeUZoWWxBVUNXeWxvSFFBS0NSRFM1MjhmeUZoWQ0KbExP TEFnQ2NqV3pUZ2VkSE4xdFVhbHJJVi9UTnNubW80dlZocjFNdVBNTnZ6ZUtwOFZDc2VibDh5RGFJ TXduZg0KR09RMmFMeEJsN3RxcCtYV1FUdDh5TERMbGo5L0FmMFh2S2tXaUZrZjRCT0xScEtxYkNs ZXcyZ1lKUlNkTVIrNg0KUk1YRTc3SnM0d1FzbHpTWGlpZEhjd2VJRG1pUHJsbzRKeXNqUGRRZHpB QWpDbitKM1lVOQ0KPUxwWHkNCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-all@freebsd.org Tue Jun 19 21:07:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94FE0100EC40; Tue, 19 Jun 2018 21:07:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CDF175F7B; Tue, 19 Jun 2018 21:07:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 12EF818E85; Tue, 19 Jun 2018 21:07:26 +0000 (UTC) (envelope-from sbruno@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JL7PvD026110; Tue, 19 Jun 2018 21:07:25 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JL7PUH026107; Tue, 19 Jun 2018 21:07:25 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201806192107.w5JL7PUH026107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Tue, 19 Jun 2018 21:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335386 - in head: share/examples tools/build/mk usr.sbin X-SVN-Group: head X-SVN-Commit-Author: sbruno X-SVN-Commit-Paths: in head: share/examples tools/build/mk usr.sbin X-SVN-Commit-Revision: 335386 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 21:07:26 -0000 Author: sbruno Date: Tue Jun 19 21:07:25 2018 New Revision: 335386 URL: https://svnweb.freebsd.org/changeset/base/335386 Log: MK_EFI - Add uefisign and friends to this knob and ensure that we don't try to build them if MK_OPENSSL is unset. Reviewed by: emaste imp kevans Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15211 Modified: head/share/examples/Makefile head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile Modified: head/share/examples/Makefile ============================================================================== --- head/share/examples/Makefile Tue Jun 19 20:32:43 2018 (r335385) +++ head/share/examples/Makefile Tue Jun 19 21:07:25 2018 (r335386) @@ -31,7 +31,6 @@ LDIRS= BSD_daemon \ ses \ scsi_target \ sunrpc \ - uefisign \ ypldap @@ -343,8 +342,11 @@ SE_SUNRPC_SORT= \ sort.x \ sort_proc.c +.if ${MK_EFI} != "no" +LDIRS+= uefisign SE_DIRS+= uefisign SE_UEFISIGN= uefikeys +.endif SE_DIRS+= ypldap SE_YPLDAP= ypldap.conf Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 19 20:32:43 2018 (r335385) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Jun 19 21:07:25 2018 (r335386) @@ -1614,6 +1614,14 @@ OLD_DIRS+=usr/share/bsdconfig/timezone OLD_DIRS+=usr/share/bsdconfig/usermgmt .endif +.if ${MK_EFI} == no +OLD_FILES+=usr/sbin/efibootmgr +OLD_FILES+=usr/sbin/efidp +OLD_FILES+=usr/sbin/efivar +OLD_FILES+=usr/sbin/uefisign +OLD_FILES+=usr/share/examples/uefisign/uefikeys +.endif + .if ${MK_FMTREE} == no OLD_FILES+=usr/sbin/fmtree OLD_FILES+=usr/share/man/man8/fmtree.8.gz Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Jun 19 20:32:43 2018 (r335385) +++ head/usr.sbin/Makefile Tue Jun 19 21:07:25 2018 (r335386) @@ -92,7 +92,6 @@ SUBDIR= adduser \ traceroute \ trpt \ tzsetup \ - uefisign \ ugidfw \ vigr \ vipw \ @@ -126,6 +125,9 @@ SUBDIR.${MK_CTM}+= ctm SUBDIR.${MK_CXGBETOOL}+= cxgbetool SUBDIR.${MK_DIALOG}+= bsdconfig SUBDIR.${MK_EFI}+= efivar efidp efibootmgr +.if ${MK_OPENSSL} != "no" +SUBDIR.${MK_EFI}+= uefisign +.endif SUBDIR.${MK_FLOPPY}+= fdcontrol SUBDIR.${MK_FLOPPY}+= fdformat SUBDIR.${MK_FLOPPY}+= fdread From owner-svn-src-all@freebsd.org Tue Jun 19 21:26:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDF7B100FB60; Tue, 19 Jun 2018 21:26:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B1176C85; Tue, 19 Jun 2018 21:26:23 +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 7195A19203; Tue, 19 Jun 2018 21:26:23 +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 w5JLQNms036413; Tue, 19 Jun 2018 21:26:23 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JLQNB9036412; Tue, 19 Jun 2018 21:26:23 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806192126.w5JLQNB9036412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 19 Jun 2018 21:26:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335387 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 335387 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 21:26:24 -0000 Author: emaste Date: Tue Jun 19 21:26:23 2018 New Revision: 335387 URL: https://svnweb.freebsd.org/changeset/base/335387 Log: linuxulator: handle V3 capget/capset Linux 2.6.26 introduced 64-bit capability sets. Extend our stub implementation to handle both 32- and 64-bit. (We still report no capabilities in capget, and disallow any in capset.) Reviewed by: chuck Sponsored by: Turing Robotic Industries Inc. Differential Revision: https://reviews.freebsd.org/D15887 Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Tue Jun 19 21:07:25 2018 (r335386) +++ head/sys/compat/linux/linux_misc.c Tue Jun 19 21:26:23 2018 (r335387) @@ -1867,7 +1867,9 @@ linux_exit_group(struct thread *td, struct linux_exit_ /* NOTREACHED */ } -#define _LINUX_CAPABILITY_VERSION 0x19980330 +#define _LINUX_CAPABILITY_VERSION_1 0x19980330 +#define _LINUX_CAPABILITY_VERSION_2 0x20071026 +#define _LINUX_CAPABILITY_VERSION_3 0x20080522 struct l_user_cap_header { l_int version; @@ -1881,27 +1883,35 @@ struct l_user_cap_data { }; int -linux_capget(struct thread *td, struct linux_capget_args *args) +linux_capget(struct thread *td, struct linux_capget_args *uap) { struct l_user_cap_header luch; - struct l_user_cap_data lucd; - int error; + struct l_user_cap_data lucd[2]; + int error, u32s; - if (args->hdrp == NULL) + if (uap->hdrp == NULL) return (EFAULT); - error = copyin(args->hdrp, &luch, sizeof(luch)); + error = copyin(uap->hdrp, &luch, sizeof(luch)); if (error != 0) return (error); - if (luch.version != _LINUX_CAPABILITY_VERSION) { + switch (luch.version) { + case _LINUX_CAPABILITY_VERSION_1: + u32s = 1; + break; + case _LINUX_CAPABILITY_VERSION_2: + case _LINUX_CAPABILITY_VERSION_3: + u32s = 2; + break; + default: #ifdef DEBUG if (ldebug(capget)) printf(LMSG("invalid capget capability version 0x%x"), luch.version); #endif - luch.version = _LINUX_CAPABILITY_VERSION; - error = copyout(&luch, args->hdrp, sizeof(luch)); + luch.version = _LINUX_CAPABILITY_VERSION_1; + error = copyout(&luch, uap->hdrp, sizeof(luch)); if (error) return (error); return (EINVAL); @@ -1910,42 +1920,50 @@ linux_capget(struct thread *td, struct linux_capget_ar if (luch.pid) return (EPERM); - if (args->datap) { + if (uap->datap) { /* * The current implementation doesn't support setting * a capability (it's essentially a stub) so indicate * that no capabilities are currently set or available * to request. */ - bzero (&lucd, sizeof(lucd)); - error = copyout(&lucd, args->datap, sizeof(lucd)); + memset(&lucd, 0, u32s * sizeof(lucd[0])); + error = copyout(&lucd, uap->datap, u32s * sizeof(lucd[0])); } return (error); } int -linux_capset(struct thread *td, struct linux_capset_args *args) +linux_capset(struct thread *td, struct linux_capset_args *uap) { struct l_user_cap_header luch; - struct l_user_cap_data lucd; - int error; + struct l_user_cap_data lucd[2]; + int error, i, u32s; - if (args->hdrp == NULL || args->datap == NULL) + if (uap->hdrp == NULL || uap->datap == NULL) return (EFAULT); - error = copyin(args->hdrp, &luch, sizeof(luch)); + error = copyin(uap->hdrp, &luch, sizeof(luch)); if (error != 0) return (error); - if (luch.version != _LINUX_CAPABILITY_VERSION) { + switch (luch.version) { + case _LINUX_CAPABILITY_VERSION_1: + u32s = 1; + break; + case _LINUX_CAPABILITY_VERSION_2: + case _LINUX_CAPABILITY_VERSION_3: + u32s = 2; + break; + default: #ifdef DEBUG if (ldebug(capset)) printf(LMSG("invalid capset capability version 0x%x"), luch.version); #endif - luch.version = _LINUX_CAPABILITY_VERSION; - error = copyout(&luch, args->hdrp, sizeof(luch)); + luch.version = _LINUX_CAPABILITY_VERSION_1; + error = copyout(&luch, uap->hdrp, sizeof(luch)); if (error) return (error); return (EINVAL); @@ -1954,18 +1972,21 @@ linux_capset(struct thread *td, struct linux_capset_ar if (luch.pid) return (EPERM); - error = copyin(args->datap, &lucd, sizeof(lucd)); + error = copyin(uap->datap, &lucd, u32s * sizeof(lucd[0])); if (error != 0) return (error); /* We currently don't support setting any capabilities. */ - if (lucd.effective || lucd.permitted || lucd.inheritable) { - linux_msg(td, - "capset effective=0x%x, permitted=0x%x, " - "inheritable=0x%x is not implemented", - (int)lucd.effective, (int)lucd.permitted, - (int)lucd.inheritable); - return (EPERM); + for (i = 0; i < u32s; i++) { + if (lucd[i].effective || lucd[i].permitted || + lucd[i].inheritable) { + linux_msg(td, + "capset[%d] effective=0x%x, permitted=0x%x, " + "inheritable=0x%x is not implemented", i, + (int)lucd[i].effective, (int)lucd[i].permitted, + (int)lucd[i].inheritable); + return (EPERM); + } } return (0); From owner-svn-src-all@freebsd.org Tue Jun 19 21:58:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F1861011742; Tue, 19 Jun 2018 21:58:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E950F78041; Tue, 19 Jun 2018 21:58:04 +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 C36F5196FD; Tue, 19 Jun 2018 21:58:04 +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 w5JLw4Kx052097; Tue, 19 Jun 2018 21:58:04 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JLw4SQ052096; Tue, 19 Jun 2018 21:58:04 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201806192158.w5JLw4SQ052096@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 19 Jun 2018 21:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335388 - head/tools/tools/git X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/tools/tools/git X-SVN-Commit-Revision: 335388 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 21:58:05 -0000 Author: imp Date: Tue Jun 19 21:58:04 2018 New Revision: 335388 URL: https://svnweb.freebsd.org/changeset/base/335388 Log: Fix typo noticed by pstef@. Modified: head/tools/tools/git/HOWTO Modified: head/tools/tools/git/HOWTO ============================================================================== --- head/tools/tools/git/HOWTO Tue Jun 19 21:26:23 2018 (r335387) +++ head/tools/tools/git/HOWTO Tue Jun 19 21:58:04 2018 (r335388) @@ -147,7 +147,7 @@ III. git-svn-rebase git-svn-rebase is a script that helps you keep current when using git plus subversion as outline in https://wiki.freebsd.org/GitWorkflow/GitSvn -since it's otherwise a pain to have many branhes active. It will rebase +since it's otherwise a pain to have many branches active. It will rebase those branches that haven't been merged yet. Some tweaking may be needed if you have other, weird branches in your tree (including any stable branches). To run it just cd into the git subversion tree somewhere and From owner-svn-src-all@freebsd.org Tue Jun 19 22:19:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FF41101267F; Tue, 19 Jun 2018 22:19:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2588878A6B; Tue, 19 Jun 2018 22:19:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 03E0119A4A; Tue, 19 Jun 2018 22:19:43 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JMJgiB061830; Tue, 19 Jun 2018 22:19:42 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JMJgI8061829; Tue, 19 Jun 2018 22:19:42 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806192219.w5JMJgI8061829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 19 Jun 2018 22:19:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335389 - head/lib/libcasper/services/cap_pwd X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/services/cap_pwd X-SVN-Commit-Revision: 335389 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 22:19:43 -0000 Author: oshogbo Date: Tue Jun 19 22:19:42 2018 New Revision: 335389 URL: https://svnweb.freebsd.org/changeset/base/335389 Log: Fix typo. Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.3 Modified: head/lib/libcasper/services/cap_pwd/cap_pwd.3 ============================================================================== --- head/lib/libcasper/services/cap_pwd/cap_pwd.3 Tue Jun 19 21:58:04 2018 (r335388) +++ head/lib/libcasper/services/cap_pwd/cap_pwd.3 Tue Jun 19 22:19:42 2018 (r335389) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 18, 2018 +.Dd June 20, 2018 .Dt CAP_PWD 3 .Os .Sh NAME @@ -42,7 +42,7 @@ .Nm cap_pwd_limit_users .Nd "library for password database operations in capability mode" .Sh LIBRARY -.Lb libcap_grp +.Lb libcap_pwd .Sh SYNOPSIS .In libcasper.h .In casper/cap_pwd.h From owner-svn-src-all@freebsd.org Tue Jun 19 23:30:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2900510158B6; Tue, 19 Jun 2018 23:30:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D28FA7ADD6; Tue, 19 Jun 2018 23:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B54C01A57F; Tue, 19 Jun 2018 23:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNUtFx099683; Tue, 19 Jun 2018 23:30:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNUtha099682; Tue, 19 Jun 2018 23:30:55 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806192330.w5JNUtha099682@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Tue, 19 Jun 2018 23:30:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335390 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335390 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:30:56 -0000 Author: eadler Date: Tue Jun 19 23:30:55 2018 New Revision: 335390 URL: https://svnweb.freebsd.org/changeset/base/335390 Log: top(1): fix top -mio Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Tue Jun 19 22:19:42 2018 (r335389) +++ head/usr.bin/top/machine.c Tue Jun 19 23:30:55 2018 (r335390) @@ -455,6 +455,7 @@ format_header(const char *uname_field) case DISP_IO: prehead = io_header; snprintf(Header, sizeof(Header), prehead, + ps.thread_id ? " THR" : "PID", jidlength, ps.jail ? " JID" : "", namelength, namelength, uname_field); break; From owner-svn-src-all@freebsd.org Tue Jun 19 23:39:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C73B1016047; Tue, 19 Jun 2018 23:39:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E0617B359; Tue, 19 Jun 2018 23:39:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E3F721A6FC; Tue, 19 Jun 2018 23:39:55 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNdtoe002573; Tue, 19 Jun 2018 23:39:55 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNdtix002572; Tue, 19 Jun 2018 23:39:55 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806192339.w5JNdtix002572@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 23:39:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335391 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335391 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:39:56 -0000 Author: bdrewery Date: Tue Jun 19 23:39:55 2018 New Revision: 335391 URL: https://svnweb.freebsd.org/changeset/base/335391 Log: Fix X_COMPILER_* and X_LINKER_* not being passed to installworld environment. This could lead to 'sh: head: not found' warnings which were a symptom of running 'ld --version' during installworld. This was only happening with XCC or XLD set. It is intended that cc and ld do not run during installworld. The metadata for these are already stored in compiler-metadata.mk added in r316794. This also removes redundant CROSSENV additions that were for WITH_SYSTEM_COMPILER, WITHOUT_CROSS_COMPILER, and WITHOUT_TOOLCHAIN which all don't have a cc or ld in their PATH during install. Reported by: Mark Millard MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 23:30:55 2018 (r335390) +++ head/Makefile.inc1 Tue Jun 19 23:39:55 2018 (r335391) @@ -169,22 +169,6 @@ test-system-compiler: .PHONY .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. .endif -# For installworld need to ensure that the looked-up compiler metadata is -# passed along rather than trying to run cc from the restricted -# STRICTTMPPATH. -.if ${MK_CLANG_BOOTSTRAP} == "no" && ${MK_GCC_BOOTSTRAP} == "no" -.if !defined(X_COMPILER_TYPE) -CROSSENV+= COMPILER_VERSION=${COMPILER_VERSION} \ - COMPILER_TYPE=${COMPILER_TYPE} \ - COMPILER_FEATURES="${COMPILER_FEATURES}" \ - COMPILER_FREEBSD_VERSION=${COMPILER_FREEBSD_VERSION} -.else -CROSSENV+= COMPILER_VERSION=${X_COMPILER_VERSION} \ - COMPILER_FEATURES="${X_COMPILER_FEATURES}" \ - COMPILER_TYPE=${X_COMPILER_TYPE} \ - COMPILER_FREEBSD_VERSION=${X_COMPILER_FREEBSD_VERSION} -.endif -.endif # Store some compiler metadata for use in installworld where we don't # want to invoke CC at all. _COMPILER_METADATA_VARS= COMPILER_VERSION \ @@ -201,8 +185,10 @@ compiler-metadata.mk: .PHONY .META @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} .for v in ${_COMPILER_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} + @echo "X_${v}=${X_${v}}" >> ${.TARGET} .endfor @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} + @echo ".export ${_COMPILER_METADATA_VARS:C,^,X_,}" >> ${.TARGET} # Handle external binutils. .if defined(CROSS_TOOLCHAIN_PREFIX) From owner-svn-src-all@freebsd.org Tue Jun 19 23:40:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CADF1016110; Tue, 19 Jun 2018 23:40:37 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DD1037B4B9; Tue, 19 Jun 2018 23:40:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BE11B1A706; Tue, 19 Jun 2018 23:40:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNeaCQ002673; Tue, 19 Jun 2018 23:40:36 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNeaM8002672; Tue, 19 Jun 2018 23:40:36 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806192340.w5JNeaM8002672@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 23:40:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335392 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335392 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:40:37 -0000 Author: bdrewery Date: Tue Jun 19 23:40:36 2018 New Revision: 335392 URL: https://svnweb.freebsd.org/changeset/base/335392 Log: SYSTEM_COMPILER: Should use X_ vars for comparing wanted version. It is XCC used during the build of target binaries that replaces the bootstrap compiler. Also slightly tweak style. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 23:39:55 2018 (r335391) +++ head/Makefile.inc1 Tue Jun 19 23:40:36 2018 (r335392) @@ -138,10 +138,10 @@ WANT_COMPILER_VERSION!= \ .if ${MK_SYSTEM_COMPILER} == "yes" && \ (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ !make(showconfig) && !make(xdev*) && \ - ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} && \ - (${COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ - ${COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ - ${COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} + ${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \ + (${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ + ${X_COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ + ${X_COMPILER_FREEBSD_VERSION} == ${WANT_COMPILER_FREEBSD_VERSION} # Everything matches, disable the bootstrap compiler. MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no From owner-svn-src-all@freebsd.org Tue Jun 19 23:40:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DFEC1016135; Tue, 19 Jun 2018 23:40:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30BFE7B4C8; Tue, 19 Jun 2018 23:40:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 11C5A1A709; Tue, 19 Jun 2018 23:40:40 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNed9u004922; Tue, 19 Jun 2018 23:40:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNedwW004921; Tue, 19 Jun 2018 23:40:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806192340.w5JNedwW004921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 23:40:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335393 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335393 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:40:40 -0000 Author: bdrewery Date: Tue Jun 19 23:40:39 2018 New Revision: 335393 URL: https://svnweb.freebsd.org/changeset/base/335393 Log: Let CROSS_BINUTILS_PREFIX work without a trailing slash. Reported by: jhb MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 23:40:36 2018 (r335392) +++ head/Makefile.inc1 Tue Jun 19 23:40:39 2018 (r335393) @@ -211,8 +211,8 @@ CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebs XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS .for BINUTIL in ${XBINUTILS} .if defined(CROSS_BINUTILS_PREFIX) && \ - exists(${CROSS_BINUTILS_PREFIX}${${BINUTIL}}) -X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}} + exists(${CROSS_BINUTILS_PREFIX}/${${BINUTIL}}) +X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX:C,/*$,,}/${${BINUTIL}} .else X${BINUTIL}?= ${${BINUTIL}} .endif From owner-svn-src-all@freebsd.org Tue Jun 19 23:40:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C201101617E; Tue, 19 Jun 2018 23:40:45 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7ED047B594; Tue, 19 Jun 2018 23:40:44 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 432D11A70B; Tue, 19 Jun 2018 23:40:43 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNehn8004970; Tue, 19 Jun 2018 23:40:43 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNehKn004969; Tue, 19 Jun 2018 23:40:43 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806192340.w5JNehKn004969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 23:40:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335394 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335394 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:40:45 -0000 Author: bdrewery Date: Tue Jun 19 23:40:42 2018 New Revision: 335394 URL: https://svnweb.freebsd.org/changeset/base/335394 Log: Fix detection for binutils bootstrap package. The path was changed recently in the port to be the full target triple. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 23:40:39 2018 (r335393) +++ head/Makefile.inc1 Tue Jun 19 23:40:42 2018 (r335394) @@ -202,7 +202,7 @@ CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} .if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ ${MK_LLD_BOOTSTRAP} == "no" && \ !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_ARCH}-freebsd/bin/ +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ .if !exists(${CROSS_BINUTILS_PREFIX}) .error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. .endif @@ -641,6 +641,10 @@ TARGET_ABI= gnueabihf TARGET_ABI= gnueabi .endif .endif +MACHINE_ABI?= unknown +MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 +TARGET_ABI?= unknown +TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 .if ${WANT_COMPILER_TYPE} == gcc || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) # GCC requires -isystem and -L when using a cross-compiler. --sysroot @@ -658,10 +662,6 @@ XCXXFLAGS+= -isystem ${WORLDTMP}/usr/include/c++/v1 -s .endif .elif ${WANT_COMPILER_TYPE} == clang || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == clang) -MACHINE_ABI?= unknown -MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 -TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 XCFLAGS+= -target ${TARGET_TRIPLE} .endif XCFLAGS+= --sysroot=${WORLDTMP} From owner-svn-src-all@freebsd.org Tue Jun 19 23:43:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D96C41016598; Tue, 19 Jun 2018 23:43:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 826997BB9E; Tue, 19 Jun 2018 23:43:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62E091A88C; Tue, 19 Jun 2018 23:43:22 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNhMjV007906; Tue, 19 Jun 2018 23:43:22 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNhEBj007865; Tue, 19 Jun 2018 23:43:14 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806192343.w5JNhEBj007865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Tue, 19 Jun 2018 23:43:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335395 - in head: bin/dd bin/echo bin/sleep bin/uuidgen contrib/dma sbin/decryptcore sbin/dhclient sbin/dumpon sbin/md5 usr.bin/basename usr.bin/cmp usr.bin/col usr.bin/diff usr.bin/di... X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head: bin/dd bin/echo bin/sleep bin/uuidgen contrib/dma sbin/decryptcore sbin/dhclient sbin/dumpon sbin/md5 usr.bin/basename usr.bin/cmp usr.bin/col usr.bin/diff usr.bin/diff3 usr.bin/dirname usr.b... X-SVN-Commit-Revision: 335395 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:43:23 -0000 Author: oshogbo Date: Tue Jun 19 23:43:14 2018 New Revision: 335395 URL: https://svnweb.freebsd.org/changeset/base/335395 Log: Convert `cap_enter() < 0 && errno != ENOSYS` to `caph_enter() < 0`. No functional change intended. Modified: head/bin/dd/dd.c head/bin/echo/echo.c head/bin/sleep/sleep.c head/bin/uuidgen/uuidgen.c head/contrib/dma/dma-mbox-create.c head/sbin/decryptcore/decryptcore.c head/sbin/dhclient/dhclient.c head/sbin/dumpon/dumpon.c head/sbin/md5/md5.c head/usr.bin/basename/basename.c head/usr.bin/cmp/cmp.c head/usr.bin/col/col.c head/usr.bin/diff/diffreg.c head/usr.bin/diff3/diff3.c head/usr.bin/dirname/dirname.c head/usr.bin/elfdump/elfdump.c head/usr.bin/getopt/getopt.c head/usr.bin/hexdump/display.c head/usr.bin/iconv/iconv.c head/usr.bin/ident/ident.c head/usr.bin/indent/indent.c head/usr.bin/jot/jot.c head/usr.bin/kdump/kdump.c head/usr.bin/ktrdump/ktrdump.c head/usr.bin/lam/lam.c head/usr.bin/last/last.c head/usr.bin/locate/bigram/locate.bigram.c head/usr.bin/logname/logname.c head/usr.bin/ministat/ministat.c head/usr.bin/pom/pom.c head/usr.bin/primes/primes.c head/usr.bin/printenv/printenv.c head/usr.bin/rwho/rwho.c head/usr.bin/tee/tee.c head/usr.bin/tr/tr.c head/usr.bin/uniq/uniq.c head/usr.bin/units/units.c head/usr.bin/write/write.c head/usr.bin/yes/yes.c head/usr.sbin/bhyve/bhyverun.c head/usr.sbin/rwhod/rwhod.c Modified: head/bin/dd/dd.c ============================================================================== --- head/bin/dd/dd.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/bin/dd/dd.c Tue Jun 19 23:43:14 2018 (r335395) @@ -98,7 +98,7 @@ main(int argc __unused, char *argv[]) setup(); caph_cache_catpages(); - if (cap_enter() == -1 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); (void)signal(SIGINFO, siginfo_handler); Modified: head/bin/echo/echo.c ============================================================================== --- head/bin/echo/echo.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/bin/echo/echo.c Tue Jun 19 23:43:14 2018 (r335395) @@ -82,7 +82,7 @@ main(int argc, char *argv[]) char newline[] = "\n"; char *progname = argv[0]; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); /* This utility may NOT do getopt(3) option parsing. */ Modified: head/bin/sleep/sleep.c ============================================================================== --- head/bin/sleep/sleep.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/bin/sleep/sleep.c Tue Jun 19 23:43:14 2018 (r335395) @@ -70,7 +70,7 @@ main(int argc, char *argv[]) time_t original; char buf[2]; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); if (argc != 2) Modified: head/bin/uuidgen/uuidgen.c ============================================================================== --- head/bin/uuidgen/uuidgen.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/bin/uuidgen/uuidgen.c Tue Jun 19 23:43:14 2018 (r335395) @@ -86,7 +86,7 @@ main(int argc, char *argv[]) caph_cache_catpages(); if (caph_limit_stdio() < 0) err(1, "Unable to limit stdio"); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "Unable to enter capability mode"); if (count == -1) Modified: head/contrib/dma/dma-mbox-create.c ============================================================================== --- head/contrib/dma/dma-mbox-create.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/contrib/dma/dma-mbox-create.c Tue Jun 19 23:43:14 2018 (r335395) @@ -166,7 +166,7 @@ main(int argc, char **argv) err(EX_OSERR, "can't limit maildirfd rights"); /* Enter Capsicum capability sandbox */ - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(EX_OSERR, "cap_enter"); #endif Modified: head/sbin/decryptcore/decryptcore.c ============================================================================== --- head/sbin/decryptcore/decryptcore.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/sbin/decryptcore/decryptcore.c Tue Jun 19 23:43:14 2018 (r335395) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -167,7 +168,7 @@ decrypt(int ofd, const char *privkeyfile, const char * goto failed; } - if (cap_enter() < 0 && errno != ENOSYS) { + if (caph_enter() < 0) { pjdlog_errno(LOG_ERR, "Unable to enter capability mode"); goto failed; } Modified: head/sbin/dhclient/dhclient.c ============================================================================== --- head/sbin/dhclient/dhclient.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/sbin/dhclient/dhclient.c Tue Jun 19 23:43:14 2018 (r335395) @@ -64,6 +64,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include #ifndef _PATH_VAREMPTY @@ -539,7 +541,7 @@ main(int argc, char *argv[]) setproctitle("%s", ifi->name); - if (CASPER_SUPPORT && cap_enter() < 0 && errno != ENOSYS) + if (caph_enter_casper() < 0) error("can't enter capability mode: %m"); if (immediate_daemon) Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/sbin/dumpon/dumpon.c Tue Jun 19 23:43:14 2018 (r335395) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -227,7 +228,7 @@ genkey(const char *pubkeyfile, struct diocskerneldump_ if (fp == NULL) err(1, "Unable to open %s", pubkeyfile); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "Unable to enter capability mode"); pubkey = RSA_new(); Modified: head/sbin/md5/md5.c ============================================================================== --- head/sbin/md5/md5.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/sbin/md5/md5.c Tue Jun 19 23:43:14 2018 (r335395) @@ -228,8 +228,7 @@ main(int argc, char *argv[]) if (*(argv + 1) == NULL) { cap_rights_init(&rights, CAP_READ); if ((cap_rights_limit(fd, &rights) < 0 && - errno != ENOSYS) || - (cap_enter() < 0 && errno != ENOSYS)) + errno != ENOSYS) || caph_enter() < 0) err(1, "capsicum"); } if ((p = Algorithm[digest].Fd(fd, buf)) == NULL) { @@ -253,8 +252,7 @@ main(int argc, char *argv[]) } } while (*++argv); } else if (!sflag && (optind == 1 || qflag || rflag)) { - if (caph_limit_stdin() < 0 || - (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdin() < 0 || caph_enter() < 0) err(1, "capsicum"); MDFilter(&Algorithm[digest], 0); } Modified: head/usr.bin/basename/basename.c ============================================================================== --- head/usr.bin/basename/basename.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/basename/basename.c Tue Jun 19 23:43:14 2018 (r335395) @@ -67,7 +67,7 @@ main(int argc, char **argv) setlocale(LC_ALL, ""); - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); aflag = 0; Modified: head/usr.bin/cmp/cmp.c ============================================================================== --- head/usr.bin/cmp/cmp.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/cmp/cmp.c Tue Jun 19 23:43:14 2018 (r335395) @@ -188,7 +188,7 @@ main(int argc, char *argv[]) caph_cache_catpages(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(ERR_EXIT, "unable to enter capability mode"); if (!special) { Modified: head/usr.bin/col/col.c ============================================================================== --- head/usr.bin/col/col.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/col/col.c Tue Jun 19 23:43:14 2018 (r335395) @@ -144,7 +144,7 @@ main(int argc, char **argv) if (caph_limit_stdio() == -1) err(1, "unable to limit stdio"); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); max_bufd_lines = 256; Modified: head/usr.bin/diff/diffreg.c ============================================================================== --- head/usr.bin/diff/diffreg.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/diff/diffreg.c Tue Jun 19 23:43:14 2018 (r335395) @@ -334,7 +334,7 @@ diffreg(char *file1, char *file2, int flags, int capsi caph_cache_catpages(); caph_cache_tzdata(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(2, "unable to enter capability mode"); } Modified: head/usr.bin/diff3/diff3.c ============================================================================== --- head/usr.bin/diff3/diff3.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/diff3/diff3.c Tue Jun 19 23:43:14 2018 (r335395) @@ -756,7 +756,7 @@ main(int argc, char **argv) nleft++; caph_cache_catpages(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(2, "unable to enter capability mode"); /* parse diffs */ Modified: head/usr.bin/dirname/dirname.c ============================================================================== --- head/usr.bin/dirname/dirname.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/dirname/dirname.c Tue Jun 19 23:43:14 2018 (r335395) @@ -56,7 +56,7 @@ main(int argc, char **argv) char *p; int ch; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) Modified: head/usr.bin/elfdump/elfdump.c ============================================================================== --- head/usr.bin/elfdump/elfdump.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/elfdump/elfdump.c Tue Jun 19 23:43:14 2018 (r335395) @@ -579,7 +579,7 @@ main(int ac, char **av) caph_limit_stdout() < 0 || caph_limit_stderr() < 0) { err(1, "unable to limit rights for stdio"); } - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); e = mmap(NULL, sb.st_size, PROT_READ, MAP_SHARED, fd, 0); if (e == MAP_FAILED) Modified: head/usr.bin/getopt/getopt.c ============================================================================== --- head/usr.bin/getopt/getopt.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/getopt/getopt.c Tue Jun 19 23:43:14 2018 (r335395) @@ -19,7 +19,7 @@ main(int argc, char *argv[]) int c; int status = 0; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); optind = 2; /* Past the program name and the option letters. */ Modified: head/usr.bin/hexdump/display.c ============================================================================== --- head/usr.bin/hexdump/display.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/hexdump/display.c Tue Jun 19 23:43:14 2018 (r335395) @@ -372,7 +372,7 @@ next(char **argv) * We've opened our last input file; enter capsicum sandbox. */ if (statok == 0 || *(_argv + 1) == NULL) { - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); } Modified: head/usr.bin/iconv/iconv.c ============================================================================== --- head/usr.bin/iconv/iconv.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/iconv/iconv.c Tue Jun 19 23:43:14 2018 (r335395) @@ -216,7 +216,7 @@ main(int argc, char **argv) err(EXIT_FAILURE, "iconv_open(%s, %s)", opt_t, opt_f); if (argc == 0) { - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); res = do_conv(stdin, cd, opt_s, opt_c); } else { @@ -228,7 +228,7 @@ main(int argc, char **argv) err(EXIT_FAILURE, "Cannot open `%s'", argv[i]); /* Enter Capsicum sandbox for final input file. */ - if (i + 1 == argc && cap_enter() < 0 && errno != ENOSYS) + if (i + 1 == argc && caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); res |= do_conv(fp, cd, opt_s, opt_c); Modified: head/usr.bin/ident/ident.c ============================================================================== --- head/usr.bin/ident/ident.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/ident/ident.c Tue Jun 19 23:43:14 2018 (r335395) @@ -256,7 +256,7 @@ main(int argc, char **argv) } /* Enter Capsicum sandbox. */ - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); for (i = 0; i < (int)nfds; i++) { Modified: head/usr.bin/indent/indent.c ============================================================================== --- head/usr.bin/indent/indent.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/indent/indent.c Tue Jun 19 23:43:14 2018 (r335395) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -248,7 +249,7 @@ main(int argc, char **argv) cap_rights_init(&rights, CAP_FSTAT, CAP_READ); if (cap_rights_limit(fileno(input), &rights) < 0 && errno != ENOSYS) err(EXIT_FAILURE, "unable to limit rights for %s", in_name); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); if (opt.com_ind <= 1) Modified: head/usr.bin/jot/jot.c ============================================================================== --- head/usr.bin/jot/jot.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/jot/jot.c Tue Jun 19 23:43:14 2018 (r335395) @@ -123,7 +123,7 @@ main(int argc, char **argv) */ caph_cache_catpages(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); while ((ch = getopt(argc, argv, "b:cnp:rs:w:")) != -1) Modified: head/usr.bin/kdump/kdump.c ============================================================================== --- head/usr.bin/kdump/kdump.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/kdump/kdump.c Tue Jun 19 23:43:14 2018 (r335395) @@ -434,12 +434,12 @@ main(int argc, char *argv[]) } } if (resolv == 0 || (cappwd != NULL && capgrp != NULL)) { - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); } #else if (resolv == 0) { - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); } #endif Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/ktrdump/ktrdump.c Tue Jun 19 23:43:14 2018 (r335395) @@ -203,7 +203,7 @@ main(int ac, char **av) * kvm_nlist() above uses kldsym(2) for native kernels, and that isn't * allowed in the sandbox. */ - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); if (iflag) { Modified: head/usr.bin/lam/lam.c ============================================================================== --- head/usr.bin/lam/lam.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/lam/lam.c Tue Jun 19 23:43:14 2018 (r335395) @@ -99,7 +99,7 @@ main(int argc, char *argv[]) * mode. */ caph_cache_catpages(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); for (;;) { Modified: head/usr.bin/last/last.c ============================================================================== --- head/usr.bin/last/last.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/last/last.c Tue Jun 19 23:43:14 2018 (r335395) @@ -190,7 +190,7 @@ main(int argc, char *argv[]) if (setutxdb(UTXDB_LOG, file) != 0) err(1, "%s", file != NULL ? file : "(default utx db)"); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); if (sflag && width == 8) usage(); Modified: head/usr.bin/locate/bigram/locate.bigram.c ============================================================================== --- head/usr.bin/locate/bigram/locate.bigram.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/locate/bigram/locate.bigram.c Tue Jun 19 23:43:14 2018 (r335395) @@ -61,7 +61,6 @@ static char sccsid[] = "@(#)locate.bigram.c 8.1 (Berke #include #include -#include #include #include #include /* for MAXPATHLEN */ @@ -78,7 +77,7 @@ main(void) u_char *oldpath = buf1, *path = buf2; u_int i, j; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); while (fgets(path, sizeof(buf2), stdin) != NULL) { Modified: head/usr.bin/logname/logname.c ============================================================================== --- head/usr.bin/logname/logname.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/logname/logname.c Tue Jun 19 23:43:14 2018 (r335395) @@ -54,7 +54,7 @@ main(int argc, char *argv[] __unused) { char *p; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); if (argc != 1) Modified: head/usr.bin/ministat/ministat.c ============================================================================== --- head/usr.bin/ministat/ministat.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/ministat/ministat.c Tue Jun 19 23:43:14 2018 (r335395) @@ -634,7 +634,7 @@ main(int argc, char **argv) setfilenames[i]); /* Enter Capsicum sandbox. */ - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(2, "unable to enter capability mode"); for (i = 0; i < nds; i++) { Modified: head/usr.bin/pom/pom.c ============================================================================== --- head/usr.bin/pom/pom.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/pom/pom.c Tue Jun 19 23:43:14 2018 (r335395) @@ -97,7 +97,7 @@ main(int argc, char **argv) err(1, "unable to limit capabitilities for stdio"); caph_cache_catpages(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); while ((ch = getopt(argc, argv, "d:pt:")) != -1) Modified: head/usr.bin/primes/primes.c ============================================================================== --- head/usr.bin/primes/primes.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/primes/primes.c Tue Jun 19 23:43:14 2018 (r335395) @@ -61,7 +61,7 @@ static const char rcsid[] = * validation check: there are 664579 primes between 0 and 10^7 */ -#include +#include #include #include #include @@ -104,7 +104,7 @@ main(int argc, char *argv[]) /* Cache NLS data, for strerror, for err(3), before cap_enter. */ (void)catopen("libc", NL_CAT_LOCALE); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); while ((ch = getopt(argc, argv, "h")) != -1) Modified: head/usr.bin/printenv/printenv.c ============================================================================== --- head/usr.bin/printenv/printenv.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/printenv/printenv.c Tue Jun 19 23:43:14 2018 (r335395) @@ -69,7 +69,7 @@ main(int argc, char *argv[]) size_t len; int ch; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); while ((ch = getopt(argc, argv, "")) != -1) Modified: head/usr.bin/rwho/rwho.c ============================================================================== --- head/usr.bin/rwho/rwho.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/rwho/rwho.c Tue Jun 19 23:43:14 2018 (r335395) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -136,7 +137,7 @@ main(int argc, char *argv[]) */ (void) time(&ct); (void) localtime(&ct); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); (void) time(&now); cap_rights_init(&rights, CAP_READ); Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/tee/tee.c Tue Jun 19 23:43:14 2018 (r335395) @@ -109,7 +109,7 @@ main(int argc, char *argv[]) } else add(fd, *argv); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(EXIT_FAILURE, "unable to enter capability mode"); while ((rval = read(STDIN_FILENO, buf, BSIZE)) > 0) for (p = head; p; p = p->next) { Modified: head/usr.bin/tr/tr.c ============================================================================== --- head/usr.bin/tr/tr.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/tr/tr.c Tue Jun 19 23:43:14 2018 (r335395) @@ -84,7 +84,7 @@ main(int argc, char **argv) if (caph_limit_stdio() == -1) err(1, "unable to limit stdio"); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); Cflag = cflag = dflag = sflag = 0; Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/uniq/uniq.c Tue Jun 19 23:43:14 2018 (r335395) @@ -48,6 +48,7 @@ static const char rcsid[] = #include +#include #include #include #include @@ -177,7 +178,7 @@ main (int argc, char *argv[]) } strerror_init(); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); prevbuflen = thisbuflen = 0; Modified: head/usr.bin/units/units.c ============================================================================== --- head/usr.bin/units/units.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/units/units.c Tue Jun 19 23:43:14 2018 (r335395) @@ -33,7 +33,7 @@ static const char rcsid[] = #include #include -#include +#include #ifndef UNITSFILE #define UNITSFILE "/usr/share/misc/definitions.units" @@ -819,7 +819,7 @@ main(int argc, char **argv) readunits(NULL); if (optind == argc - 2) { - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); havestr = argv[optind]; @@ -843,7 +843,7 @@ main(int argc, char **argv) if (inhistory == 0) err(1, "Could not initialize history"); - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "unable to enter capability mode"); if (!quiet) Modified: head/usr.bin/write/write.c ============================================================================== --- head/usr.bin/write/write.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/write/write.c Tue Jun 19 23:43:14 2018 (r335395) @@ -137,7 +137,7 @@ main(int argc, char **argv) login = "???"; } - if (cap_enter() < 0 && errno != ENOSYS) + if (caph_enter() < 0) err(1, "cap_enter"); while (getopt(argc, argv, "") != -1) Modified: head/usr.bin/yes/yes.c ============================================================================== --- head/usr.bin/yes/yes.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.bin/yes/yes.c Tue Jun 19 23:43:14 2018 (r335395) @@ -60,7 +60,7 @@ main(int argc, char **argv) size_t more; ssize_t ret; - if (caph_limit_stdio() < 0 || (cap_enter() < 0 && errno != ENOSYS)) + if (caph_limit_stdio() < 0 || caph_enter() < 0) err(1, "capsicum"); if (argc > 1) { Modified: head/usr.sbin/bhyve/bhyverun.c ============================================================================== --- head/usr.sbin/bhyve/bhyverun.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.sbin/bhyve/bhyverun.c Tue Jun 19 23:43:14 2018 (r335395) @@ -1114,7 +1114,7 @@ main(int argc, char *argv[]) if (caph_limit_stdout() == -1 || caph_limit_stderr() == -1) errx(EX_OSERR, "Unable to apply rights for sandbox"); - if (cap_enter() == -1 && errno != ENOSYS) + if (caph_enter() == -1) errx(EX_OSERR, "cap_enter() failed"); #endif Modified: head/usr.sbin/rwhod/rwhod.c ============================================================================== --- head/usr.sbin/rwhod/rwhod.c Tue Jun 19 23:40:42 2018 (r335394) +++ head/usr.sbin/rwhod/rwhod.c Tue Jun 19 23:43:14 2018 (r335395) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -372,7 +373,7 @@ receiver_process(void) syslog(LOG_WARNING, "cap_rights_limit: %m"); exit(1); } - if (cap_enter() < 0 && errno != ENOSYS) { + if (caph_enter() < 0) { syslog(LOG_ERR, "cap_enter: %m"); exit(1); } From owner-svn-src-all@freebsd.org Tue Jun 19 23:57:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23AF8101703A for ; Tue, 19 Jun 2018 23:57:10 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C54BB7C27E for ; Tue, 19 Jun 2018 23:57:09 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f169.google.com (mail-yb0-f169.google.com [209.85.213.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id 91506208DF for ; Tue, 19 Jun 2018 23:57:09 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f169.google.com with SMTP id m199-v6so154501ybm.9 for ; Tue, 19 Jun 2018 16:57:09 -0700 (PDT) X-Gm-Message-State: APt69E1pJpp7K7j/6ct9bWXk8FbHaTZnfdPOX5YvcFmHczM2+dR3PTgk /E1Xo9DytwI/cGq6xuQlT+VG3UxEHa7kIsnpxj41zQ== X-Google-Smtp-Source: ADUXVKJ6jwQwyJm+9tU9EOODG5vhMINe9umzk3m+UByUSl/Vq9B/rQhJPFYwqx90lpilR9d/NK/Z5gbSy2nC2ukUuRo= X-Received: by 2002:a25:a05:: with SMTP id 5-v6mr9479358ybk.479.1529452628849; Tue, 19 Jun 2018 16:57:08 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 16:56:38 -0700 (PDT) In-Reply-To: References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> <4ad7ef96-e623-5ab8-dc47-c3178115ff24@FreeBSD.org> From: Eitan Adler Date: Tue, 19 Jun 2018 16:56:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335278 - head/bin/pwd To: Pedro Giffuni Cc: John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:57:10 -0000 On 19 June 2018 at 12:57, Pedro Giffuni wrote: > > > On 19/06/2018 11:25, John Baldwin wrote: >> >> On 6/18/18 10:26 PM, Eitan Adler wrote: >>> >>> On 18 June 2018 at 10:57, John Baldwin wrote: >>>> >>>> On 6/16/18 10:14 PM, Eitan Adler wrote: >>>>> >>>>> Author: eadler >>>>> Date: Sun Jun 17 05:14:50 2018 >>>>> New Revision: 335278 >>>>> URL: https://svnweb.freebsd.org/changeset/base/335278 >>>>> >>>>> Log: >>>>> pwd: mark usage as dead >>>> >>>> You keep committing changes like this and ignoring e-mails about them. >>> >>> I replied both the first time and this time. I may have >>> (accidentally?) ignored similar emails though. The question I have is >>> other than the mild code churn what's the harm? >> >> It adds clutter. Also, fixing the tool means you fix all the places at >> once rather than slowly adding workarounds one by one. >> >>>> What broken compiler are you using that doesn't properly inherit __dead2 >>>> from the call to exit()? >>> >>> In this case, scan-build50 was getting annoyed. >> >> Does scan-build from LLVM 6.0 handle this correctly? If so, I'd say to >> just mark this warning as broken (and thus ignore it) for scan-build50 >> just as we ignore certain warnings from GCC 4.2.1 because they are >> broken-as-implemented. >> > FWIW, clang's scan-build is made to even more false positives and general > noise than the regular compiler warnings. > It is better to just ignore it unless it finds something real. I don't consider this a real harm, but I'll try and remember to ignore these in the future. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Tue Jun 19 23:57:13 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5091E1017070; Tue, 19 Jun 2018 23:57:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0601D7C2A7; Tue, 19 Jun 2018 23:57:13 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD5121AA57; Tue, 19 Jun 2018 23:57:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5JNvCCi013295; Tue, 19 Jun 2018 23:57:12 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5JNvCF4013294; Tue, 19 Jun 2018 23:57:12 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806192357.w5JNvCF4013294@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 19 Jun 2018 23:57:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335396 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335396 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.26 Precedence: list List-Id: "SVN commit messages 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, 19 Jun 2018 23:57:13 -0000 Author: bdrewery Date: Tue Jun 19 23:57:12 2018 New Revision: 335396 URL: https://svnweb.freebsd.org/changeset/base/335396 Log: TARGET_TRIPLE is needed much earlier now for CROSS_BINUTILS_PREFIX check. This was missed in r335394 since the check became exists(/usr/local) in my testing. X-MFC-With: r335394 MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Tue Jun 19 23:43:14 2018 (r335395) +++ head/Makefile.inc1 Tue Jun 19 23:57:12 2018 (r335396) @@ -190,6 +190,28 @@ compiler-metadata.mk: .PHONY .META @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} @echo ".export ${_COMPILER_METADATA_VARS:C,^,X_,}" >> ${.TARGET} +.if ${TARGET} == ${MACHINE} +TARGET_CPUTYPE?=${CPUTYPE} +.else +TARGET_CPUTYPE?= +.endif +.if !empty(TARGET_CPUTYPE) +_TARGET_CPUTYPE=${TARGET_CPUTYPE} +.else +_TARGET_CPUTYPE=dummy +.endif +.if ${TARGET} == "arm" +.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" +TARGET_ABI= gnueabihf +.else +TARGET_ABI= gnueabi +.endif +.endif +MACHINE_ABI?= unknown +MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 +TARGET_ABI?= unknown +TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 + # Handle external binutils. .if defined(CROSS_TOOLCHAIN_PREFIX) CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} @@ -440,17 +462,6 @@ _t= ${TARGET_ARCH}/${TARGET} .endif .endfor -.if ${TARGET} == ${MACHINE} -TARGET_CPUTYPE?=${CPUTYPE} -.else -TARGET_CPUTYPE?= -.endif - -.if !empty(TARGET_CPUTYPE) -_TARGET_CPUTYPE=${TARGET_CPUTYPE} -.else -_TARGET_CPUTYPE=dummy -.endif _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE .if ${_CPUTYPE} != ${_TARGET_CPUTYPE} @@ -634,17 +645,6 @@ BFLAGS+= -B${CROSS_BINUTILS_PREFIX} .if !defined(CROSS_BINUTILS_PREFIX) || !exists(${CROSS_BINUTILS_PREFIX}) BFLAGS+= -B${WORLDTMP}/usr/bin .endif -.if ${TARGET} == "arm" -.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" -TARGET_ABI= gnueabihf -.else -TARGET_ABI= gnueabi -.endif -.endif -MACHINE_ABI?= unknown -MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 -TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 .if ${WANT_COMPILER_TYPE} == gcc || \ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc) # GCC requires -isystem and -L when using a cross-compiler. --sysroot From owner-svn-src-all@freebsd.org Wed Jun 20 00:13:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27C2C1017EC3; Wed, 20 Jun 2018 00:13:11 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C52BB7CCB3; Wed, 20 Jun 2018 00:13:10 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A5A6A1AD76; Wed, 20 Jun 2018 00:13:10 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0DA3f023072; Wed, 20 Jun 2018 00:13:10 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0DA1v023070; Wed, 20 Jun 2018 00:13:10 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806200013.w5K0DA1v023070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Wed, 20 Jun 2018 00:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335397 - in head/usr.bin: primes uniq X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: in head/usr.bin: primes uniq X-SVN-Commit-Revision: 335397 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:13:11 -0000 Author: oshogbo Date: Wed Jun 20 00:13:09 2018 New Revision: 335397 URL: https://svnweb.freebsd.org/changeset/base/335397 Log: Use capsicum helpers to cache NLS data. Modified: head/usr.bin/primes/primes.c head/usr.bin/uniq/uniq.c Modified: head/usr.bin/primes/primes.c ============================================================================== --- head/usr.bin/primes/primes.c Tue Jun 19 23:57:12 2018 (r335396) +++ head/usr.bin/primes/primes.c Wed Jun 20 00:13:09 2018 (r335397) @@ -101,9 +101,7 @@ main(int argc, char *argv[]) int ch; char *p; - /* Cache NLS data, for strerror, for err(3), before cap_enter. */ - (void)catopen("libc", NL_CAT_LOCALE); - + caph_cache_catpages(); if (caph_enter() < 0) err(1, "cap_enter"); Modified: head/usr.bin/uniq/uniq.c ============================================================================== --- head/usr.bin/uniq/uniq.c Tue Jun 19 23:57:12 2018 (r335396) +++ head/usr.bin/uniq/uniq.c Wed Jun 20 00:13:09 2018 (r335397) @@ -87,17 +87,6 @@ static wchar_t *skip(wchar_t *); static void obsolete(char *[]); static void usage(void); -static void -strerror_init(void) -{ - - /* - * Cache NLS data before entering capability mode. - * XXXPJD: There should be strerror_init() and strsignal_init() in libc. - */ - (void)catopen("libc", NL_CAT_LOCALE); -} - int main (int argc, char *argv[]) { @@ -177,7 +166,7 @@ main (int argc, char *argv[]) } } - strerror_init(); + caph_cache_catpages(); if (caph_enter() < 0) err(1, "unable to enter capability mode"); From owner-svn-src-all@freebsd.org Wed Jun 20 00:14:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BAE21018042; Wed, 20 Jun 2018 00:14:55 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF6457CE50; Wed, 20 Jun 2018 00:14:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BB72D1AD77; Wed, 20 Jun 2018 00:14:54 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0EsDe023179; Wed, 20 Jun 2018 00:14:54 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0Esat023178; Wed, 20 Jun 2018 00:14:54 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201806200014.w5K0Esat023178@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 20 Jun 2018 00:14:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335398 - in head/stand/i386: gptboot zfsboot X-SVN-Group: head X-SVN-Commit-Author: allanjude X-SVN-Commit-Paths: in head/stand/i386: gptboot zfsboot X-SVN-Commit-Revision: 335398 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:14:55 -0000 Author: allanjude Date: Wed Jun 20 00:14:54 2018 New Revision: 335398 URL: https://svnweb.freebsd.org/changeset/base/335398 Log: Revert r335276 This was causing issues for people booting. I will likely bring this back as an optional feature, similar to boot0sio, like gptboot-serial or something. PR: 221526 Reported by: O. Hartmann , Thomas Laus Modified: head/stand/i386/gptboot/gptboot.c head/stand/i386/zfsboot/zfsboot.c Modified: head/stand/i386/gptboot/gptboot.c ============================================================================== --- head/stand/i386/gptboot/gptboot.c Wed Jun 20 00:13:09 2018 (r335397) +++ head/stand/i386/gptboot/gptboot.c Wed Jun 20 00:14:54 2018 (r335398) @@ -285,16 +285,6 @@ main(void) bootinfo.bi_memsizes_valid++; bootinfo.bi_bios_dev = dsk.drive; - /* - * Initialize the serial console early with a modern default of 115200. - * Later, we'll read PATH_DOTCONFIG and reconfigure serial according - * to the configuration provided. - */ - opts = OPT_SET(RBX_DUAL); - ioctrl = (IO_SERIAL|IO_KEYBOARD); - if (sio_init(115200) != 0) - ioctrl &= ~IO_SERIAL; - #ifdef LOADER_GELI_SUPPORT geli_init(); #endif Modified: head/stand/i386/zfsboot/zfsboot.c ============================================================================== --- head/stand/i386/zfsboot/zfsboot.c Wed Jun 20 00:13:09 2018 (r335397) +++ head/stand/i386/zfsboot/zfsboot.c Wed Jun 20 00:14:54 2018 (r335398) @@ -693,16 +693,6 @@ main(void) } setheap(heap_next, heap_end); - /* - * Initialize the serial console early with a modern default of 115200. - * Later, we'll read PATH_DOTCONFIG and reconfigure serial according - * to the configuration provided. - */ - opts = OPT_SET(RBX_DUAL); - ioctrl = (IO_SERIAL|IO_KEYBOARD); - if (sio_init(115200) != 0) - ioctrl &= ~IO_SERIAL; - dsk = malloc(sizeof(struct dsk)); dsk->drive = *(uint8_t *)PTOV(ARGS); dsk->type = dsk->drive & DRV_HARD ? TYPE_AD : TYPE_FD; From owner-svn-src-all@freebsd.org Wed Jun 20 00:15:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 275F9101810E; Wed, 20 Jun 2018 00:15:57 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 AF86B7CFB6; Wed, 20 Jun 2018 00:15:56 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id EA2EE1A92F; Wed, 20 Jun 2018 00:15:55 +0000 (UTC) Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh , Thomas Laus References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <20180619223114.4a8f8426@thor.intern.walstatt.dynvpn.de> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Message-ID: <5172dffe-db7e-5a98-1b4b-91f31725954f@freebsd.org> Date: Tue, 19 Jun 2018 20:15:51 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20180619223114.4a8f8426@thor.intern.walstatt.dynvpn.de> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="DV56UoHscnU4WHsGdkwhs89sDyTr5Jb7F" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:15:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --DV56UoHscnU4WHsGdkwhs89sDyTr5Jb7F Content-Type: multipart/mixed; boundary="quQR89SjcXMnwM9bmxJb6qLoP2V4NzLGs"; protected-headers="v1" From: Allan Jude To: "O. Hartmann" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Warner Losh , Thomas Laus Message-ID: <5172dffe-db7e-5a98-1b4b-91f31725954f@freebsd.org> Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <20180619223114.4a8f8426@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180619223114.4a8f8426@thor.intern.walstatt.dynvpn.de> --quQR89SjcXMnwM9bmxJb6qLoP2V4NzLGs Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 2018-06-19 16:30, O. Hartmann wrote: > Am Sun, 17 Jun 2018 03:18:57 +0000 (UTC) > Allan Jude schrieb: >=20 >> Author: allanjude >> Date: Sun Jun 17 03:18:56 2018 >> New Revision: 335276 >> URL: https://svnweb.freebsd.org/changeset/base/335276 >=20 >> Log: >> gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles e= arly >=20 >> Normally the serial console is not enabled until /boot.config is rea= d and >> we know how the serial console should be configured. Initialize the= >> consoles early in 'dual' mode (serial & keyboard) with a default ser= ial >> rate of 115200. Then serial is re-initialized once the disk is decry= pted >> and the /boot.config file can be read. >=20 >> This allows the GELIBoot passphrase to be provided via the serial co= nsole. >=20 >> PR: 221526 >> Requested by: many >> Reviewed by: imp >> Sponsored by: Klara Systems >> Differential Revision: https://reviews.freebsd.org/D15862 >=20 >> Modified: >> head/stand/i386/gptboot/gptboot.c >> head/stand/i386/zfsboot/zfsboot.c >=20 >=20 > This commit breaks booting off GPT partition (using NanoBSD, as Iposted= mistakenly to > commit r335254, see there). > Having CURRENT applied to a SD card for usage on a PCEngines APU 2C4, t= he boot process > dies immediately showing "Booting from harddisk". r335275 boots well. >=20 >=20 I have reverted this commit in r335398. As I mentioned in that commit, it will likely come back as an optional feature in the near future. --=20 Allan Jude --quQR89SjcXMnwM9bmxJb6qLoP2V4NzLGs-- --DV56UoHscnU4WHsGdkwhs89sDyTr5Jb7F Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJbKZy7AAoJEBmVNT4SmAt+2iMQAOjeuZFdei28BMeth8YOAFZs H9dP9cYu/1nXU/O1u1YZZnvbWrSq0UysW9hQ8RVGvJWI83Oy1lp+UIw38tRJUAry DrL2fj6AAccSHmRgYp4ytSdaF9JA4/Kn46VUy+n9pBkrXGN+T6TV/JNqHhBMTKk2 qlvQZg1JOgMb2ZB2LOgZuZcdBhhHuhqYl3uzNyi6zHdHZCVC+ccM/PkPc2XqiMc8 fwAJ9lwm/nsxKbjAgPK33uhUSnWqnoJAFfxDk3aOuBsJic22ViYYV5gGogPsNV35 +kmRSdb12yDK/vjVuaniMDvrWe/Cd7q0JuHsXhAagDYaUQYlvdyPwRIOlfeZqa0j jIGkpm65kcdByhTznlW1yLPH9YRZEugUvazLmyjS6OxIKFP013LqZl39x653Ox5L JrK8ACYA0+YOGFH1BUzxMxkyTSVvTuDjRsPEac1gvFx4iwECrDtJOIySwScUJECg X4VUIjPB8sYWOXuGcb+j3iedcFSCAuO6ScAuBq0ixiG7jPCpmYhwNwaynnxPd8gV MMg0+Nk/UhvDHTZwYDIKFzzjCaodJ1MXrPBiYa+aQp63YqvzVDMULsbLpB+5sqE2 p52fuomdK7t1HKgMfxcpJi+rWJvHu3QUo6QkuQH75V65Wb9psHnNR9ObJ3WTpSN1 uDovh14PzFyHUwYqejIt =67uq -----END PGP SIGNATURE----- --DV56UoHscnU4WHsGdkwhs89sDyTr5Jb7F-- From owner-svn-src-all@freebsd.org Wed Jun 20 00:34:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 845CD1018E73; Wed, 20 Jun 2018 00:34:19 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) (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 2366B7DB14; Wed, 20 Jun 2018 00:34:19 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (Seawolf.HML3.ScaleEngine.net [209.51.186.28]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 788CF1A959; Wed, 20 Jun 2018 00:34:18 +0000 (UTC) Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot To: Eugene Grosbein , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> From: Allan Jude Openpgp: preference=signencrypt Autocrypt: addr=allanjude@freebsd.org; prefer-encrypt=mutual; keydata= xsFNBFVwZcYBEADwrZDH0xe0ZVjc9ORCc6PcBLwS/RTXA6NkvpD6ea02pZ8lPOVgteuuugFc D34LdDbiWr+479vfrKBh+Y38GL0oZ0/13j10tIlDMHSa5BU0y6ACtnhupFvVlQ57+XaJAb/q 7qkfSiuxVwQ3FY3PL3cl1RrIP5eGHLA9hu4eVbu+FOX/q/XVKz49HaeIaxzo2Q54572VzIo6 C28McX9m65UL5fXMUGJDDLCItLmehZlHsQQ+uBxvODLFpVV2lUgDR/0rDa0B9zHZX8jY8qQ7 ZdCSy7CwClXI054CkXZCaBzgxYh/CotdI8ezmaw7NLs5vWNTxaDEFXaFMQtMVhvqQBpHkfOD 7rjjOmFw00nJL4FuPE5Yut0CPyx8vLjVmNJSt/Y8WxxmhutsqJYFgYfWl/vaWkrFLur/Zcmz IklwLw35HLsCZytCN5A3rGKdRbQjD6QPXOTJu0JPrJF6t2xFkWAT7oxnSV0ELhl2g+JfMMz2 Z1PDmS3NRnyEdqEm7NoRGXJJ7bgxDbN+9SXTyOletqGNXj/bSrBvhvZ0RQrzdHAPwQUfVSU2 qBhQEi2apSZstgVNMan0GUPqCdbE2zpysg+zT7Yhvf9EUQbzPL4LpdK1llT9fZbrdMzEXvEF oSvwJFdV3sqKmZc7b+E3PuxK6GTsKqaukd/3Cj8aLHG1T1im1QARAQABzSJBbGxhbiBKdWRl IDxhbGxhbmp1ZGVAZnJlZWJzZC5vcmc+wsF/BBMBAgApBQJVcGXGAhsjBQkSzAMABwsJCAcD AgEGFQgCCQoLBBYCAwECHgECF4AACgkQGZU1PhKYC34Muw/+JOKpSfhhysWFYiRXynGRDe07 Z6pVsn7DzrPUMRNZfHu8Uujmmy3p2nx9FelIY9yjd2UKHhug+whM54MiIFs90eCRVa4XEsPR 4FFAm0DAWrrb7qhZFcE/GhHdRWpZ341WAElWf6Puj2devtRjfYbikvj5+1V1QmDbju7cEw5D mEET44pTuD2VMRJpu2yZZzkM0i+wKFuPxlhqreufA1VNkZXI/rIfkYWK+nkXd9Efw3YdCyCQ zUgTUCb88ttSqcyhik/li1CDbXBpkzDCKI6I/8fAb7jjOC9LAtrZJrdgONywcVFoyK9ZN7EN AVA+xvYCmuYhR/3zHWH1g4hAm1v1+gIsufhajhfo8/wY1SetlzPaYkSkVQLqD8T6zZyhf+AN bC7ci44UsiKGAplB3phAXrtSPUEqM86kbnHg3fSx37kWKUiYNOnx4AC2VXvEiKsOBlpyt3dw WQbOtOYM+vkfbBwDtoGOOPYAKxc4LOIt9r+J8aD+gTooi9Eo5tvphATf9WkCpl9+aaGbSixB tUpvQMRnSMqTqq4Z7DeiG6VMRQIjsXDSLJEUqcfhnLFo0Ko/RiaHd5xyAQ4DhQ9QpkyQjjNf /3f/dYG7JAtoD30txaQ5V8uHrz210/77DRRX+HJjEj6xCxWUGvQgvEZf5XXyxeePvqZ+zQyT DX61bYw6w6bOwU0EVXBlxgEQAMy7YVnCCLN4oAOBVLZ5nUbVPvpUhsdA94/0/P+uqCIh28Cz ar56OCX0X19N/nAWecxL4H32zFbIRyDB2V/MEh4p9Qvyu/j4i1r3Ex5GhOT2hnit43Ng46z5 29Es4TijrHJP4/l/rB2VOqMKBS7Cq8zk1cWqaI9XZ59imxDNjtLLPPM+zQ1yE3OAMb475QwN UgWxTMw8rkA7CEaqeIn4sqpTSD5C7kT1Bh26+rbgJDZ77D6Uv1LaCZZOaW52okW3bFbdozV8 yM2u+xz2Qs8bHz67p+s+BlygryiOyYytpkiK6Iy4N7FTolyj5EIwCuqzfk0SaRHeOKX2ZRjC qatkgoD/t13PNT38V9tw3qZVOJDS0W6WM8VSg+F+bkM9LgJ8CmKV+Hj0k3pfGfYPOZJ/v18i +SmZmL/Uw2RghnwDWGAsPCKu4uZR777iw7n9Io6Vfxndw2dcS0e9klvFYoaGS6H2F13Asygr WBzFNGFQscN4mUW+ZYBzpTOcHkdT7w8WS55BmXYLna+dYer9/HaAuUrONjujukN4SPS1fMJ2 /CS/idAUKyyVVX5vozoNK2JVC1h1zUAVsdnmhEzNPsvBoqcVNfyqBFROEVLIPwq+lQMGNVjH ekLTKRWf59MEhUC2ztjSKkGmwdg73d6xSXMuq45EgIJV2wPvOgWQonoHH/kxABEBAAHCwWUE GAECAA8FAlVwZcYCGwwFCRLMAwAACgkQGZU1PhKYC34w5A//YViBtZyDV5O+SJT9FFO3lb9x Zdxf0trA3ooCt7gdBkdnBM6T5EmjgVZ3KYYyFfwXZVkteuCCycMF/zVw5eE9FL1+zz9gg663 nY9q2F77TZTKXVWOLlOV2bY+xaK94U4ytogOGhh9b4UnQ/Ct3+6aviCF78Go608BXbmF/GVT 7uhddemk7ItxM1gE5Hscx3saxGKlayaOsdPKeGTVJCDEtHDuOc7/+jGh5Zxpk/Hpi+DUt1ot 8e6hPYLIQa4uVx4f1xxxV858PQ7QysSLr9pTV7FAQ18JclCaMc7JWIa3homZQL/MNKOfST0S 2e+msuRwQo7AnnfFKBUtb02KwpA4GhWryhkjUh/kbVc1wmGxaU3DgXYQ5GV5+Zf4kk/wqr/7 KG0dkTz6NLCVLyDlmAzuFhf66DJ3zzz4yIo3pbDYi3HB/BwJXVSKB3Ko0oUo+6/qMrOIS02L s++QE/z7K12CCcs7WwOjfCYHK7VtE0Sr/PfybBdTbuDncOuAyAIeIKxdI2nmQHzl035hhvQX s4CSghsP319jAOQiIolCeSbTMD4QWMK8RL/Pe1FI1jC3Nw9s+jq8Dudtbcj2UwAP/STUEbJ9 5rznzuuhPjE0e++EU/RpWmcaIMK/z1zZDMN+ce2v1qzgV936ZhJ3iaVzyqbEE81gDxg3P+IM kiYh4ZtPB4Q= Message-ID: <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> Date: Tue, 19 Jun 2018 20:34:18 -0400 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <5B2646B3.4020200@grosbein.net> 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:34:19 -0000 On 2018-06-17 07:32, Eugene Grosbein wrote: > 17.06.2018 10:18, Allan Jude wrote: > >> Author: allanjude >> Date: Sun Jun 17 03:18:56 2018 >> New Revision: 335276 >> URL: https://svnweb.freebsd.org/changeset/base/335276 >> >> Log: >> gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early >> >> Normally the serial console is not enabled until /boot.config is read and >> we know how the serial console should be configured. Initialize the >> consoles early in 'dual' mode (serial & keyboard) with a default serial >> rate of 115200. Then serial is re-initialized once the disk is decrypted >> and the /boot.config file can be read. >> >> This allows the GELIBoot passphrase to be provided via the serial console. >> >> PR: 221526 >> Requested by: many >> Reviewed by: imp >> Sponsored by: Klara Systems >> Differential Revision: https://reviews.freebsd.org/D15862 > > I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports > hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing > missing serial ports. I even could reproduce that with VirtualBox machine configured > with no serial ports (not same as existing bug inactive serial port). > > Should there be some way to disable this serial ports configuration at compile time? > > > I think what we'll do it compile it both ways, and use the non-serial one by default, because it is safer. Then you can just use 'gptboot-serial' if you want serial support. This will likely make Warner a bit sad, since we are just finally getting around to reducing the number of different bootcode files. -- Allan Jude From owner-svn-src-all@freebsd.org Wed Jun 20 00:41:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8E9FF10194D0; Wed, 20 Jun 2018 00:41:33 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 351337DEC9; Wed, 20 Jun 2018 00:41:33 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 16FE51B109; Wed, 20 Jun 2018 00:41:33 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0fWQU035874; Wed, 20 Jun 2018 00:41:32 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0fVQ1035864; Wed, 20 Jun 2018 00:41:31 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201806200041.w5K0fVQ1035864@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 00:41:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335399 - in head/sys: conf modules modules/mac_veriexec modules/mac_veriexec_rmd160 modules/mac_veriexec_sha1 modules/mac_veriexec_sha256 modules/mac_veriexec_sha384 modules/mac_veriex... X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: in head/sys: conf modules modules/mac_veriexec modules/mac_veriexec_rmd160 modules/mac_veriexec_sha1 modules/mac_veriexec_sha256 modules/mac_veriexec_sha384 modules/mac_veriexec_sha512 security/mac_ve... X-SVN-Commit-Revision: 335399 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:41:34 -0000 Author: stevek Date: Wed Jun 20 00:41:30 2018 New Revision: 335399 URL: https://svnweb.freebsd.org/changeset/base/335399 Log: MAC/veriexec implements a verified execution environment using the MAC framework. The code is organized into a few distinct pieces: * The meta-data store (in veriexec_metadata.c) which maps a file system identifier, file identifier, and generation key tuple to veriexec meta-data record. * Fingerprint management (in veriexec_fingerprint.c) which deals with calculating the cryptographic hash for a file and verifying it. It also manages the loadable fingerprint modules. * MAC policy implementation (in mac_veriexec.c) which implements the following MAC methods: mpo_init Initializes the veriexec state, meta-data store, fingerprint modules, and registers mount and unmount EVENTHANDLERs mpo_syscall Implements the following per-policy system calls: MAC_VERIEXEC_CHECK_FD_SYSCALL Check a file descriptor to see if the referenced file has a valid fingerprint. MAC_VERIEXEC_CHECK_PATH_SYSCALL Check a path to see if the referenced file has a valid fingerprint. mpo_kld_check_load Check if loading a kld is allowed. This checks if the referenced vnode has a valid fingerprint. mpo_mount_destroy_label Clears the veriexec slot data in a mount point label. mpo_mount_init_label Initializes the veriexec slot data in a mount point label. The file system identifier is saved in the veriexec slot data. mpo_priv_check Check if a process is allowed to write to /dev/kmem and /dev/mem devices. If a process is flagged as trusted, it is allowed to write. mpo_proc_check_debug Check if a process is allowed to be debugged. If a process is not flagged with VERIEXEC_NOTRACE, then debugging is allowed. mpo_vnode_check_exec Check is an exectuable is allowed to run. If veriexec is not enforcing or the executable has a valid fingerprint, then it is allowed to run. NOTE: veriexec will complain about mismatched fingerprints if it is active, regardless of the state of the enforcement. mpo_vnode_check_open Check is a file is allowed to be opened. If verification was not requested, veriexec is not enforcing, or the file has a valid fingerprint, then veriexec will allow the file to be opened. mpo_vnode_copy_label Copies the veriexec slot data from one label to another. mpo_vnode_destroy_label Clears the veriexec slot data in a vnode label. mpo_vnode_init_label Initializes the veriexec slot data in a vnode label. The fingerprint status for the file is stored in the veriexec slot data. * Some sysctls, under security.mac.veriexec, for setting debug level, fetching the current state in a human-readable form, and dumping the fingerprint database are implemented. * The MAC policy implementation source file also contains some utility functions. * A set of fingerprint modules for the following cryptographic hash algorithms: RIPEMD-160, SHA1, SHA2-256, SHA2-384, SHA2-512 * Loadable module builds for MAC/veriexec and fingerprint modules. WARNING: Using veriexec with NFS (or other network-based) file systems is not recommended as one cannot guarantee the integrity of the files served, nor the uniqueness of file system identifiers which are used as key in the meta-data store. Reviewed by: ian, jtl Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8554 Added: head/sys/modules/mac_veriexec/ head/sys/modules/mac_veriexec/Makefile (contents, props changed) head/sys/modules/mac_veriexec_rmd160/ head/sys/modules/mac_veriexec_rmd160/Makefile (contents, props changed) head/sys/modules/mac_veriexec_sha1/ head/sys/modules/mac_veriexec_sha1/Makefile (contents, props changed) head/sys/modules/mac_veriexec_sha256/ head/sys/modules/mac_veriexec_sha256/Makefile (contents, props changed) head/sys/modules/mac_veriexec_sha384/ head/sys/modules/mac_veriexec_sha384/Makefile (contents, props changed) head/sys/modules/mac_veriexec_sha512/ head/sys/modules/mac_veriexec_sha512/Makefile (contents, props changed) head/sys/security/mac_veriexec/ head/sys/security/mac_veriexec/mac_veriexec.c (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec.h (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_internal.h (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_rmd160.c (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_sha1.c (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_sha256.c (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_sha384.c (contents, props changed) head/sys/security/mac_veriexec/mac_veriexec_sha512.c (contents, props changed) head/sys/security/mac_veriexec/veriexec_fingerprint.c (contents, props changed) head/sys/security/mac_veriexec/veriexec_metadata.c (contents, props changed) Modified: head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Wed Jun 20 00:14:54 2018 (r335398) +++ head/sys/conf/files Wed Jun 20 00:41:30 2018 (r335399) @@ -3424,6 +3424,7 @@ dev/videomode/videomode.c optional videomode dev/videomode/edid.c optional videomode dev/videomode/pickmode.c optional videomode dev/videomode/vesagtf.c optional videomode +dev/veriexec/verified_exec.c optional veriexec mac_veriexec dev/vge/if_vge.c optional vge dev/viapm/viapm.c optional viapm pci dev/virtio/virtio.c optional virtio @@ -4892,6 +4893,14 @@ security/mac_portacl/mac_portacl.c optional mac_portac security/mac_seeotheruids/mac_seeotheruids.c optional mac_seeotheruids security/mac_stub/mac_stub.c optional mac_stub security/mac_test/mac_test.c optional mac_test +security/mac_veriexec/mac_veriexec.c optional mac_veriexec +security/mac_veriexec/veriexec_fingerprint.c optional mac_veriexec +security/mac_veriexec/veriexec_metadata.c optional mac_veriexec +security/mac_veriexec/mac_veriexec_rmd160.c optional mac_veriexec_rmd160 +security/mac_veriexec/mac_veriexec_sha1.c optional mac_veriexec_sha1 +security/mac_veriexec/mac_veriexec_sha256.c optional mac_veriexec_sha256 +security/mac_veriexec/mac_veriexec_sha384.c optional mac_veriexec_sha384 +security/mac_veriexec/mac_veriexec_sha512.c optional mac_veriexec_sha512 teken/teken.c optional sc | vt ufs/ffs/ffs_alloc.c optional ffs ufs/ffs/ffs_balloc.c optional ffs Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jun 20 00:14:54 2018 (r335398) +++ head/sys/modules/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -237,6 +237,12 @@ SUBDIR= \ mac_seeotheruids \ mac_stub \ mac_test \ + mac_veriexec \ + mac_veriexec_rmd160 \ + mac_veriexec_sha1 \ + mac_veriexec_sha256 \ + mac_veriexec_sha384 \ + mac_veriexec_sha512 \ malo \ md \ mdio \ Added: head/sys/modules/mac_veriexec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,40 @@ +# $FreeBSD$ + +.PATH: ${.PARSEDIR:H:H}/security/mac_veriexec + +KMOD = mac_veriexec +SRCS = \ + bus_if.h \ + device_if.h \ + vnode_if.h +SRCS += \ + opt_capsicum.h \ + opt_global.h \ + opt_mac.h \ + opt_veriexec.h +SRCS += \ + mac_veriexec.c \ + veriexec_fingerprint.c \ + veriexec_metadata.c + +EXPORT_SYMS+= ve_mutex \ + mac_veriexec_in_state \ + mac_veriexec_get_executable_flags + +.if defined(KERNBUILDDIR) +MKDEP= -include ${KERNBUILDDIR}/opt_global.h +.else +CFLAGS+= -include opt_global.h +MKDEP= -include opt_global.h +opt_mac.h: + echo "#define MAC_DEBUG 1" >> ${.TARGET} +opt_global.h: + echo "#define MAC 1" > ${.TARGET} +.endif + +.ifndef WITHOUT_VERIEXEC_DEBUG +CFLAGS+= -DVERIFIED_EXEC_DEBUG +.endif + +.include + Added: head/sys/modules/mac_veriexec_rmd160/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec_rmd160/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../security/mac_veriexec +.PATH: ${.CURDIR}/../../opencrypto + +KMOD= mac_veriexec_rmd160 +SRCS= mac_veriexec_rmd160.c rmd160.c + +.include + Added: head/sys/modules/mac_veriexec_sha1/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec_sha1/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.PARSEDIR:H:H}/security/mac_veriexec +.PATH: ${.PARSEDIR:H:H}/crypto + +KMOD= mac_veriexec_sha1 +SRCS= mac_veriexec_sha1.c sha1.c + +.include + Added: head/sys/modules/mac_veriexec_sha256/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec_sha256/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../security/mac_veriexec +.PATH: ${.CURDIR}/../../crypto/sha2 + +KMOD= mac_veriexec_sha256 +SRCS= mac_veriexec_sha256.c sha256c.c + +.include + Added: head/sys/modules/mac_veriexec_sha384/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec_sha384/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../security/mac_veriexec +.PATH: ${.CURDIR}/../../crypto/sha2 + +KMOD= mac_veriexec_sha384 +SRCS= mac_veriexec_sha384.c sha512c.c + +.include + Added: head/sys/modules/mac_veriexec_sha512/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/mac_veriexec_sha512/Makefile Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../security/mac_veriexec +.PATH: ${.CURDIR}/../../crypto/sha2 + +KMOD= mac_veriexec_sha512 +SRCS= mac_veriexec_sha512.c sha512c.c + +.include + Added: head/sys/security/mac_veriexec/mac_veriexec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/mac_veriexec/mac_veriexec.c Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,803 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 + +#include "opt_capsicum.h" +#include "opt_mac.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mac_veriexec.h" +#include "mac_veriexec_internal.h" + +#define SLOT(l) \ + mac_label_get((l), mac_veriexec_slot) +#define SLOT_SET(l, v) \ + mac_label_set((l), mac_veriexec_slot, (v)) + +#ifdef MAC_DEBUG +#define MAC_VERIEXEC_DBG(_lvl, _fmt, ...) \ + do { \ + VERIEXEC_DEBUG((_lvl), (MAC_VERIEXEC_FULLNAME ": " _fmt \ + "\n", ##__VA_ARGS__)); \ + } while(0) +#else +#define MAC_VERIEXEC_DBG(_lvl, _fmt, ...) +#endif + +static int sysctl_mac_veriexec_state(SYSCTL_HANDLER_ARGS); +static int sysctl_mac_veriexec_db(SYSCTL_HANDLER_ARGS); + +SYSCTL_DECL(_security_mac); + +SYSCTL_NODE(_security_mac, OID_AUTO, veriexec, CTLFLAG_RW, 0, + "MAC/veriexec policy controls"); + +int mac_veriexec_debug; +SYSCTL_INT(_security_mac_veriexec, OID_AUTO, debug, CTLFLAG_RW, + &mac_veriexec_debug, 0, "Debug level"); + +static int mac_veriexec_state; +SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, state, + CTLTYPE_STRING | CTLFLAG_RD, 0, 0, sysctl_mac_veriexec_state, "A", + "Verified execution subsystem state"); + +SYSCTL_PROC(_security_mac_veriexec, OID_AUTO, db, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_SKIP, 0, 0, sysctl_mac_veriexec_db, + "A", "Verified execution fingerprint database"); + +static int mac_veriexec_slot; + +MALLOC_DEFINE(M_VERIEXEC, "veriexec", "Verified execution data"); + +/** + * @internal + * @brief Handler for security.mac.veriexec.db sysctl + * + * Display a human-readable form of the current fingerprint database. + */ +static int +sysctl_mac_veriexec_db(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + int error; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); + + sbuf_new_for_sysctl(&sb, NULL, 1024, req); + mac_veriexec_print_db(&sb); + error = sbuf_finish(&sb); + sbuf_delete(&sb); + + return (error); +} + +/** + * @internal + * @brief Generate human-readable output about the current verified execution + * state. + * + * @param sbp sbuf to write output to + */ +static void +mac_veriexec_print_state(struct sbuf *sbp) +{ + + if (mac_veriexec_state & VERIEXEC_STATE_INACTIVE) + sbuf_printf(sbp, "inactive "); + if (mac_veriexec_state & VERIEXEC_STATE_LOADED) + sbuf_printf(sbp, "loaded "); + if (mac_veriexec_state & VERIEXEC_STATE_ACTIVE) + sbuf_printf(sbp, "active "); + if (mac_veriexec_state & VERIEXEC_STATE_ENFORCE) + sbuf_printf(sbp, "enforce "); + if (mac_veriexec_state & VERIEXEC_STATE_LOCKED) + sbuf_printf(sbp, "locked "); + if (mac_veriexec_state != 0) + sbuf_trim(sbp); +} + +/** + * @internal + * @brief Handler for security.mac.veriexec.state sysctl + * + * Display a human-readable form of the current verified execution subsystem + * state. + */ +static int +sysctl_mac_veriexec_state(SYSCTL_HANDLER_ARGS) +{ + struct sbuf sb; + int error; + + sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND); + mac_veriexec_print_state(&sb); + sbuf_finish(&sb); + + error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); + sbuf_delete(&sb); + return (error); +} + +/** + * @internal + * @brief Event handler called when a virtual file system is mounted. + * + * We need to record the file system identifier in the MAC per-policy slot + * assigned to veriexec, so we have a key to use in order to reference the + * mount point in the meta-data store. + * + * @param arg unused argument + * @param mp mount point that is being mounted + * @param fsrootvp vnode of the file system root + * @param td calling thread + */ +static void +mac_veriexec_vfs_mounted(void *arg __unused, struct mount *mp, + struct vnode *fsrootvp, struct thread *td) +{ + struct vattr va; + int error; + + error = VOP_GETATTR(fsrootvp, &va, td->td_ucred); + if (error) + return; + + SLOT_SET(mp->mnt_label, va.va_fsid); +#ifdef MAC_DEBUG + MAC_VERIEXEC_DBG(3, "set fsid to %u for mount %p", va.va_fsid, mp); +#endif +} + +/** + * @internal + * @brief Event handler called when a virtual file system is unmounted. + * + * If we recorded a file system identifier in the MAC per-policy slot assigned + * to veriexec, then we need to tell the meta-data store to clean up. + * + * @param arg unused argument + * @param mp mount point that is being unmounted + * @param td calling thread + */ +static void +mac_veriexec_vfs_unmounted(void *arg __unused, struct mount *mp, + struct thread *td) +{ + dev_t fsid; + + fsid = SLOT(mp->mnt_label); + if (fsid) { + MAC_VERIEXEC_DBG(3, "fsid %u, cleaning up mount", fsid); + mac_veriexec_metadata_unmounted(fsid, td); + } +} + +/** + * @internal + * @brief The mount point is being initialized, set the value in the MAC + * per-policy slot for veriexec to zero. + * + * @note A value of zero in this slot indicates no file system identifier + * is assigned. + * + * @param label the label that is being initialized + */ +static void +mac_veriexec_mount_init_label(struct label *label) +{ + + SLOT_SET(label, 0); +} + +/** + * @internal + * @brief The mount-point is being destroyed, reset the value in the MAC + * per-policy slot for veriexec back to zero. + * + * @note A value of zero in this slot indicates no file system identifier + * is assigned. + * + * @param label the label that is being destroyed + */ +static void +mac_veriexec_mount_destroy_label(struct label *label) +{ + + SLOT_SET(label, 0); +} + +/** + * @internal + * @brief The vnode label is being initialized, set the value in the MAC + * per-policy slot for veriexec to @c FINGERPRINT_INVALID + * + * @note @c FINGERPRINT_INVALID indicates the fingerprint is invalid. + * + * @param label the label that is being initialized + */ +static void +mac_veriexec_vnode_init_label(struct label *label) +{ + + SLOT_SET(label, FINGERPRINT_INVALID); +} + +/** + * @internal + * @brief The vnode label is being destroyed, reset the value in the MAC + * per-policy slot for veriexec back to @c FINGERPRINT_INVALID + * + * @note @c FINGERPRINT_INVALID indicates the fingerprint is invalid. + * + * @param label the label that is being destroyed + */ +static void +mac_veriexec_vnode_destroy_label(struct label *label) +{ + + SLOT_SET(label, FINGERPRINT_INVALID); +} + +/** + * @internal + * @brief Copy the value in the MAC per-policy slot assigned to veriexec from + * the @p src label to the @p dest label + */ +static void +mac_veriexec_copy_label(struct label *src, struct label *dest) +{ + + SLOT_SET(dest, SLOT(src)); +} + +/** + * @internal + * @brief Check if the requested process can be debugged + * + * @param cred credentials to use + * @param p process to debug + * + * @return 0 if debugging is allowed, otherwise an error code. + */ +static int +mac_veriexec_proc_check_debug(struct ucred *cred, struct proc *p) +{ + int error, flags; + + /* If we are not enforcing veriexec, nothing for us to check */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + error = mac_veriexec_metadata_get_executable_flags(cred, p, &flags, 0); + if (error != 0) + return (0); + + return ((flags & VERIEXEC_NOTRACE) ? EACCES : 0); +} + +/** + * @internal + * @brief A KLD load has been requested and needs to be validated. + * + * @param cred credentials to use + * @param vp vnode of the KLD that has been requested + * @param vlabel vnode label assigned to the vnode + * + * @return 0 if the KLD load is allowed, otherwise an error code. + */ +static int +mac_veriexec_kld_check_load(struct ucred *cred, struct vnode *vp, + struct label *vlabel) +{ + struct vattr va; + struct thread *td = curthread; + fingerprint_status_t status; + int error; + + /* + * If we are not actively enforcing, allow it + */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + /* Get vnode attributes */ + error = VOP_GETATTR(vp, &va, cred); + if (error) + return (error); + + /* + * Fetch the fingerprint status for the vnode + * (starting with files first) + */ + error = mac_veriexec_metadata_fetch_fingerprint_status(vp, &va, td, + VERIEXEC_FILES_FIRST); + if (error && error != EAUTH) + return (error); + + /* + * By now we should have status... + */ + status = mac_veriexec_get_fingerprint_status(vp); + switch (status) { + case FINGERPRINT_FILE: + case FINGERPRINT_VALID: + case FINGERPRINT_INDIRECT: + if (error) + return (error); + break; + default: + /* + * kldload should fail unless there is a valid fingerprint + * registered. + */ + MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev %u, " + "file %lu.%lu\n", status, va.va_fsid, va.va_fileid, + va.va_gen); + return (EAUTH); + } + + /* Everything is good, allow the KLD to be loaded */ + return (0); +} + +/** + * @internal + * @brief Check privileges that veriexec needs to be concerned about. + * + * The following privileges are checked by this function: + * - PRIV_KMEM_WRITE\n + * Check if writes to /dev/mem and /dev/kmem are allowed\n + * (Only trusted processes are allowed) + * + * @param cred credentials to use + * @param priv privilege to check + * + * @return 0 if the privilege is allowed, error code otherwise. + */ +static int +mac_veriexec_priv_check(struct ucred *cred, int priv) +{ + + /* If we are not enforcing veriexec, nothing for us to check */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + switch (priv) { + case PRIV_KMEM_WRITE: + if (!mac_veriexec_proc_is_trusted(cred, curproc)) + return (EPERM); + break; + default: + break; + } + return (0); +} + +/** + * @internal + * @brief A program is being executed and needs to be validated. + * + * @param cred credentials to use + * @param vp vnode of the program that is being executed + * @param label vnode label assigned to the vnode + * @param imgp parameters for the image to be executed + * @param execlabel optional exec label + * + * @return 0 if the program should be allowed to execute, otherwise an error + * code. + */ +static int +mac_veriexec_vnode_check_exec(struct ucred *cred __unused, + struct vnode *vp __unused, struct label *label __unused, + struct image_params *imgp, struct label *execlabel __unused) +{ + struct thread *td = curthread; + int error; + + error = mac_veriexec_fingerprint_check_image(imgp, 0, td); + return (error); +} + +/** + * @brief Check fingerprint for the specified vnode and validate it + * + * @param cred credentials to use + * @param vp vnode of the file + * @param accmode access mode to check (read, write, append, create, + * verify, etc.) + * + * @return 0 if the file validated, otherwise an error code. + */ +static int +mac_veriexec_check_vp(struct ucred *cred, struct vnode *vp, accmode_t accmode) +{ + struct vattr va; + struct thread *td = curthread; + fingerprint_status_t status; + int error; + + /* Get vnode attributes */ + error = VOP_GETATTR(vp, &va, cred); + if (error) + return (error); + + /* Get the fingerprint status for the file */ + error = mac_veriexec_metadata_fetch_fingerprint_status(vp, &va, td, + VERIEXEC_FILES_FIRST); + if (error && error != EAUTH) + return (error); + + /* + * By now we should have status... + */ + status = mac_veriexec_get_fingerprint_status(vp); + if (accmode & VWRITE) { + /* + * If file has a fingerprint then deny the write request, + * otherwise invalidate the status so we don't keep checking + * for the file having a fingerprint. + */ + switch (status) { + case FINGERPRINT_FILE: + case FINGERPRINT_VALID: + case FINGERPRINT_INDIRECT: + MAC_VERIEXEC_DBG(2, + "attempted write to fingerprinted file for dev " + "%u, file %lu.%lu\n", va.va_fsid, + va.va_fileid, va.va_gen); + return (EPERM); + default: + break; + } + } + if (accmode & VVERIFY) { + switch (status) { + case FINGERPRINT_FILE: + case FINGERPRINT_VALID: + case FINGERPRINT_INDIRECT: + if (error) + return (error); + break; + default: + /* + * Caller wants open to fail unless there is a valid + * fingerprint registered. + */ + MAC_VERIEXEC_DBG(2, "fingerprint status is %d for dev " + "%u, file %lu.%lu\n", status, va.va_fsid, + va.va_fileid, va.va_gen); + return (EAUTH); + } + } + return (0); +} + +/** + * @brief Opening a file has been requested and may need to be validated. + * + * @param cred credentials to use + * @param vp vnode of the file to open + * @param label vnode label assigned to the vnode + * @param accmode access mode to use for opening the file (read, write, + * append, create, verify, etc.) + * + * @return 0 if opening the file should be allowed, otherwise an error code. + */ +static int +mac_veriexec_vnode_check_open(struct ucred *cred, struct vnode *vp, + struct label *label __unused, accmode_t accmode) +{ + int error; + + /* + * Look for the file on the fingerprint lists iff it has not been seen + * before. + */ + if ((mac_veriexec_state & VERIEXEC_STATE_ENFORCE) == 0) + return (0); + + error = mac_veriexec_check_vp(cred, vp, accmode); + return (error); +} + +/** + * @internal + * @brief Initialize the mac_veriexec MAC policy + * + * @param mpc MAC policy configuration + */ +static void +mac_veriexec_init(struct mac_policy_conf *mpc __unused) +{ + /* Initialize state */ + mac_veriexec_state = VERIEXEC_STATE_INACTIVE; + + /* Initialize meta-data storage */ + mac_veriexec_metadata_init(); + + /* Initialize fingerprint ops */ + mac_veriexec_fingerprint_init(); + + /* Register event handlers */ + EVENTHANDLER_REGISTER(vfs_mounted, mac_veriexec_vfs_mounted, NULL, + EVENTHANDLER_PRI_FIRST); + EVENTHANDLER_REGISTER(vfs_unmounted, mac_veriexec_vfs_unmounted, NULL, + EVENTHANDLER_PRI_LAST); +} + +/** + * @internal + * @brief MAC policy-specific syscall for mac_veriexec + * + * The following syscalls are implemented: + * - @c MAC_VERIEXEC_CHECK_SYSCALL + * Check if the file referenced by a file descriptor has a fingerprint + * registered in the meta-data store. + * + * @param td calling thread + * @param call system call number + * @param arg arugments to the syscall + * + * @return 0 on success, otherwise an error code. + */ +static int +mac_veriexec_syscall(struct thread *td, int call, void *arg) +{ + struct image_params img; + struct nameidata nd; + cap_rights_t rights; + struct vattr va; + struct file *fp; + int error; + + switch (call) { + case MAC_VERIEXEC_CHECK_FD_SYSCALL: + /* Get the vnode associated with the file descriptor passed */ + error = getvnode(td, (uintptr_t) arg, cap_rights_init(&rights, + CAP_READ), &fp); + if (error) + return (error); + if (fp->f_type != DTYPE_VNODE) { + MAC_VERIEXEC_DBG(3, "MAC_VERIEXEC_CHECK_SYSCALL: " + "file is not vnode type (type=0x%x)", + fp->f_type); + error = EINVAL; + goto cleanup_file; + } + + /* + * setup the bits of image_params that are used by + * mac_veriexec_check_fingerprint(). + */ + bzero(&img, sizeof(img)); + img.proc = td->td_proc; + img.vp = fp->f_vnode; + img.attr = &va; + + /* + * Get vnode attributes + * (need to obtain a lock on the vnode first) + */ + vn_lock(img.vp, LK_EXCLUSIVE | LK_RETRY); + error = VOP_GETATTR(fp->f_vnode, &va, td->td_ucred); + if (error) + goto check_done; + + MAC_VERIEXEC_DBG(2, "mac_veriexec_fingerprint_check_image: " + "va_mode=%o, check_files=%d\n", va.va_mode, + ((va.va_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0)); + error = mac_veriexec_fingerprint_check_image(&img, + ((va.va_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) == 0), td); +check_done: + /* Release the lock we obtained earlier */ + VOP_UNLOCK(img.vp, 0); +cleanup_file: + fdrop(fp, td); + break; + case MAC_VERIEXEC_CHECK_PATH_SYSCALL: + /* Look up the path to get the vnode */ + NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF | AUDITVNODE1, + UIO_USERSPACE, arg, td); + error = namei(&nd); + if (error != 0) + break; + NDFREE(&nd, NDF_ONLY_PNBUF); + + /* Check the fingerprint status of the vnode */ + error = mac_veriexec_check_vp(td->td_ucred, nd.ni_vp, VVERIFY); + vput(nd.ni_vp); + break; + default: + error = EOPNOTSUPP; + } + return (error); +} + +static struct mac_policy_ops mac_veriexec_ops = +{ + .mpo_init = mac_veriexec_init, + .mpo_syscall = mac_veriexec_syscall, + .mpo_kld_check_load = mac_veriexec_kld_check_load, + .mpo_mount_destroy_label = mac_veriexec_mount_destroy_label, + .mpo_mount_init_label = mac_veriexec_mount_init_label, + .mpo_priv_check = mac_veriexec_priv_check, + .mpo_proc_check_debug = mac_veriexec_proc_check_debug, + .mpo_vnode_check_exec = mac_veriexec_vnode_check_exec, + .mpo_vnode_check_open = mac_veriexec_vnode_check_open, + .mpo_vnode_copy_label = mac_veriexec_copy_label, + .mpo_vnode_destroy_label = mac_veriexec_vnode_destroy_label, + .mpo_vnode_init_label = mac_veriexec_vnode_init_label, +}; + +MAC_POLICY_SET(&mac_veriexec_ops, mac_veriexec, MAC_VERIEXEC_FULLNAME, + MPC_LOADTIME_FLAG_NOTLATE, &mac_veriexec_slot); +MODULE_VERSION(mac_veriexec, 1); + +/** + * @brief Get the fingerprint status set on a vnode. + * + * @param vp vnode to obtain fingerprint status from + * + * @return Fingerprint status assigned to the vnode. + */ +fingerprint_status_t +mac_veriexec_get_fingerprint_status(struct vnode *vp) +{ + fingerprint_status_t fps; + + fps = SLOT(vp->v_label); + switch (fps) { + case FINGERPRINT_VALID: + case FINGERPRINT_INDIRECT: + case FINGERPRINT_FILE: + break; + default: + /* we may need to recurse */ + if (strcmp(vp->v_tag, "null") == 0) { + struct vnode *ldvp; + + ldvp = NULLVPTOLOWERVP(vp); + return mac_veriexec_get_fingerprint_status(ldvp); + } + break; + } + return fps; +} + +/** + * @brief Get the current verified execution subsystem state. + * + * @return Current set of verified execution subsystem state flags. + */ +int +mac_veriexec_get_state(void) +{ + + return (mac_veriexec_state); +} + +/** + * @brief Determine if the verified execution subsystem state has specific + * flags set. + * + * @param state mask of flags to check + * + * @return State flags set within the masked bits + */ +int +mac_veriexec_in_state(int state) +{ + + return (mac_veriexec_state & state); +} + +/** + * @brief Set the fingerprint status for a vnode + * + * Fingerprint status is stored in the MAC per-policy slot assigned to + * mac_veriexec. + * + * @param vp vnode to store the fingerprint status on + * @param fp_status fingerprint status to store + */ +void +mac_veriexec_set_fingerprint_status(struct vnode *vp, + fingerprint_status_t fp_status) +{ + + /* recurse until we find the real storage */ + if (strcmp(vp->v_tag, "null") == 0) { + struct vnode *ldvp; + + ldvp = NULLVPTOLOWERVP(vp); + mac_veriexec_set_fingerprint_status(ldvp, fp_status); + return; + } + SLOT_SET(vp->v_label, fp_status); +} + +/** + * @brief Set verified execution subsystem state flags + * + * @note Flags can only be added to the current state, not removed. + * + * @param state state flags to add to the current state + */ +void +mac_veriexec_set_state(int state) +{ + + mac_veriexec_state |= state; +} + +/** + * @brief Determine if the process is trusted + * + * @param cred credentials to use + * @param p the process in question + * + * @return 1 if the process is trusted, otherwise 0. + */ +int +mac_veriexec_proc_is_trusted(struct ucred *cred, struct proc *p) +{ + int error, flags; + + error = mac_veriexec_metadata_get_executable_flags(cred, p, &flags, 0); + + /* Any errors, deny access */ + if (error != 0) + return (0); + + /* Check that the trusted flag is set */ + return ((flags & VERIEXEC_TRUSTED) == VERIEXEC_TRUSTED); +} Added: head/sys/security/mac_veriexec/mac_veriexec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/security/mac_veriexec/mac_veriexec.h Wed Jun 20 00:41:30 2018 (r335399) @@ -0,0 +1,161 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011, 2012, 2013, 2015, 2016, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + */ + +#ifndef _SECURITY_MAC_VERIEXEC_H +#define _SECURITY_MAC_VERIEXEC_H + +#ifdef _KERNEL +#include +#include +#include +#include +#endif + +/** + * Name of the MAC module + */ +#define MAC_VERIEXEC_NAME "mac_veriexec" + *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Wed Jun 20 00:48:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 287E5101994A; Wed, 20 Jun 2018 00:48:48 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C79F77E2EF; Wed, 20 Jun 2018 00:48:47 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9F3701B25E; Wed, 20 Jun 2018 00:48:47 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0mla5039206; Wed, 20 Jun 2018 00:48:47 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0mk58039202; Wed, 20 Jun 2018 00:48:46 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201806200048.w5K0mk58039202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 00:48:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335400 - in head/sys: dev/veriexec modules modules/veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: in head/sys: dev/veriexec modules modules/veriexec X-SVN-Commit-Revision: 335400 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:48:48 -0000 Author: stevek Date: Wed Jun 20 00:48:46 2018 New Revision: 335400 URL: https://svnweb.freebsd.org/changeset/base/335400 Log: Device for user space to interface with MAC/veriexec. The veriexec device features the following ioctl commands: VERIEXEC_ACTIVE Activate veriexec functionality VERIEXEC_DEBUG_ON Enable debugging mode and increment or set the debug level VERIEXEC_DEBUG_OFF Disable debugging mode VERIEXEC_ENFORCE Enforce veriexec fingerprinting (and acitvate if not already) VERIEXEC_GETSTATE Get current veriexec state VERIEXEC_LOCK Lock changes to veriexec meta-data store VERIEXEC_LOAD Load veriexec fingerprint if secure level is not raised (and passes the checks for VERIEXEC_SIGNED_LOAD) VERIEXEC_SIGNED_LOAD Load veriexec fingerprints from loader that supports signed manifest (and thus we can be more lenient about secure level being raised.) Fingerprints can be loaded if the meta-data store is not locked. Also securelevel must not have been raised or some fingerprints must have already been loaded, otherwise it would be dangerous to allow loading. (Note: this assumes that the fingerprints in the meta-data store at least cover the fingerprint loader.) Reviewed by: jtl Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8561 Added: head/sys/dev/veriexec/ head/sys/dev/veriexec/veriexec_ioctl.h (contents, props changed) head/sys/dev/veriexec/verified_exec.c (contents, props changed) head/sys/modules/veriexec/ head/sys/modules/veriexec/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Added: head/sys/dev/veriexec/veriexec_ioctl.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/veriexec/veriexec_ioctl.h Wed Jun 20 00:48:46 2018 (r335400) @@ -0,0 +1,60 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011-2013, 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + */ + +/* + * + * Definitions for the Verified Executables kernel function. + * + */ +#ifndef _DEV_VERIEXEC_VERIEXEC_IOCTL_H +#define _DEV_VERIEXEC_VERIEXEC_IOCTL_H + +#include +#include + +#define VERIEXEC_FPTYPELEN 16 + +struct verified_exec_params { + unsigned char flags; + char fp_type[VERIEXEC_FPTYPELEN]; /* type of fingerprint */ + char file[MAXPATHLEN]; + unsigned char fingerprint[MAXFINGERPRINTLEN]; +}; + +#define VERIEXEC_LOAD _IOW('S', 0x1, struct verified_exec_params) +#define VERIEXEC_ACTIVE _IO('S', 0x2) /* start checking */ +#define VERIEXEC_ENFORCE _IO('S', 0x3) /* fail exec */ +#define VERIEXEC_LOCK _IO('S', 0x4) /* don't allow new sigs */ +#define VERIEXEC_DEBUG_ON _IOWR('S', 0x5, int) /* set/get debug level */ +#define VERIEXEC_DEBUG_OFF _IO('S', 0x6) /* reset debug */ +#define VERIEXEC_GETSTATE _IOR('S', 0x7, int) /* get state */ +#define VERIEXEC_SIGNED_LOAD _IOW('S', 0x8, struct verified_exec_params) + +#define _PATH_DEV_VERIEXEC _PATH_DEV "veriexec" + +#endif Added: head/sys/dev/veriexec/verified_exec.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/veriexec/verified_exec.c Wed Jun 20 00:48:46 2018 (r335400) @@ -0,0 +1,224 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011-2013, 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "veriexec_ioctl.h" + +/* + * We need a mutex while updating lists etc. + */ +extern struct mtx ve_mutex; + +/* + * Handle the ioctl for the device + */ +static int +verifiedexecioctl(struct cdev *dev __unused, u_long cmd, caddr_t data, + int flags, struct thread *td) +{ + struct nameidata nid; + struct vattr vattr; + struct verified_exec_params *params; + int error = 0; + + params = (struct verified_exec_params *)data; + switch (cmd) { + case VERIEXEC_ACTIVE: + mtx_lock(&ve_mutex); + if (mac_veriexec_in_state(VERIEXEC_STATE_LOADED)) + mac_veriexec_set_state(VERIEXEC_STATE_ACTIVE); + else + error = EINVAL; + mtx_unlock(&ve_mutex); + break; + case VERIEXEC_DEBUG_ON: + mtx_lock(&ve_mutex); + { + int *ip = (int *)data; + + mac_veriexec_debug++; + if (ip) { + if (*ip > 0) + mac_veriexec_debug = *ip; + *ip = mac_veriexec_debug; + } + } + mtx_unlock(&ve_mutex); + break; + case VERIEXEC_DEBUG_OFF: + mac_veriexec_debug = 0; + break; + case VERIEXEC_ENFORCE: + mtx_lock(&ve_mutex); + if (mac_veriexec_in_state(VERIEXEC_STATE_LOADED)) + mac_veriexec_set_state(VERIEXEC_STATE_ACTIVE | + VERIEXEC_STATE_ENFORCE); + else + error = EINVAL; + mtx_unlock(&ve_mutex); + break; + case VERIEXEC_GETSTATE: + { + int *ip = (int *)data; + + if (ip) + *ip = mac_veriexec_get_state(); + else + error = EINVAL; + } + break; + case VERIEXEC_LOCK: + mtx_lock(&ve_mutex); + mac_veriexec_set_state(VERIEXEC_STATE_LOCKED); + mtx_unlock(&ve_mutex); + break; + case VERIEXEC_LOAD: + if (prison0.pr_securelevel > 0) + return (EPERM); /* no updates when secure */ + + /* FALLTHROUGH */ + case VERIEXEC_SIGNED_LOAD: + /* + * If we use a loader that will only use a + * digitally signed hash list - which it verifies. + * We can load fingerprints provided veriexec is not locked. + */ + if (prison0.pr_securelevel > 0 && + !mac_veriexec_in_state(VERIEXEC_STATE_LOADED)) { + /* + * If securelevel has been raised and we + * do not have any fingerprints loaded, + * it would dangerous to do so now. + */ + return (EPERM); + } + if (mac_veriexec_in_state(VERIEXEC_STATE_LOCKED)) + error = EPERM; + else { + int flags = FREAD; + int override = (cmd == VERIEXEC_SIGNED_LOAD); + + /* + * Get the attributes for the file name passed + * stash the file's device id and inode number + * along with it's fingerprint in a list for + * exec to use later. + */ + /* + * FreeBSD seems to copy the args to kernel space + */ + NDINIT(&nid, LOOKUP, FOLLOW, UIO_SYSSPACE, + params->file, td); + if ((error = vn_open(&nid, &flags, 0, NULL)) != 0) + return (error); + + error = VOP_GETATTR(nid.ni_vp, &vattr, td->td_ucred); + if (error != 0) { + mac_veriexec_set_fingerprint_status(nid.ni_vp, + FINGERPRINT_INVALID); + VOP_UNLOCK(nid.ni_vp, 0); + (void) vn_close(nid.ni_vp, FREAD, td->td_ucred, + td); + return (error); + } + if (override) { + /* + * If the file is on a "verified" filesystem + * someone may be playing games. + */ + if ((nid.ni_vp->v_mount->mnt_flag & + MNT_VERIFIED) != 0) + override = 0; + } + + /* + * invalidate the node fingerprint status + * which will have been set in the vn_open + * and would always be FINGERPRINT_NOTFOUND + */ + mac_veriexec_set_fingerprint_status(nid.ni_vp, + FINGERPRINT_INVALID); + VOP_UNLOCK(nid.ni_vp, 0); + (void) vn_close(nid.ni_vp, FREAD, td->td_ucred, td); + + mtx_lock(&ve_mutex); + error = mac_veriexec_metadata_add_file( + ((params->flags & VERIEXEC_FILE) != 0), + vattr.va_fsid, vattr.va_fileid, vattr.va_gen, + params->fingerprint, params->flags, + params->fp_type, override); + + mac_veriexec_set_state(VERIEXEC_STATE_LOADED); + mtx_unlock(&ve_mutex); + } + break; + default: + error = ENODEV; + } + return (error); +} + +struct cdevsw veriexec_cdevsw = { + .d_version = D_VERSION, + .d_ioctl = verifiedexecioctl, + .d_name = "veriexec", +}; + +static void +veriexec_drvinit(void *unused __unused) +{ + + make_dev(&veriexec_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600, "veriexec"); +} + +SYSINIT(veriexec, SI_SUB_PSEUDO, SI_ORDER_ANY, veriexec_drvinit, NULL); +MODULE_DEPEND(veriexec, mac_veriexec, 1, 1, 1); Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Wed Jun 20 00:41:30 2018 (r335399) +++ head/sys/modules/Makefile Wed Jun 20 00:48:46 2018 (r335400) @@ -394,6 +394,7 @@ SUBDIR= \ uinput \ unionfs \ usb \ + veriexec \ ${_vesa} \ ${_virtio} \ vge \ Added: head/sys/modules/veriexec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/veriexec/Makefile Wed Jun 20 00:48:46 2018 (r335400) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.PARSEDIR:H:H}/dev/veriexec + +.include + +KMOD= veriexec +SRCS= verified_exec.c +SRCS+= bus_if.h device_if.h vnode_if.h + +.include + From owner-svn-src-all@freebsd.org Wed Jun 20 00:54:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBE271019EB3 for ; Wed, 20 Jun 2018 00:54:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 791F07E866 for ; Wed, 20 Jun 2018 00:54:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-it0-x242.google.com with SMTP id j135-v6so3171191itj.1 for ; Tue, 19 Jun 2018 17:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=em2iGhZTNWLrOktCjNXOG+Zl/rBofwrWeFVpUN66HZo=; b=WSe60ucVzm2TKScAOlJl8huQaExWdzA4Qo5+szVlBRyVzqiir4nfWivoITUI4iDLof qLlipUlctJvSecVHeYQTDQKxwJ+FaBzxlQc0tF+NSHY1p/mMJ0j3L41JoEMZAVDMSwqZ 4G6o+tTDhHs0JIrpuJmv8jUoAQabuI0t659EFfy4d5cYxYmxgsy3LWYZ5s1QNJ9ChzAS UeRmcW3ALXmuSv2XO13TrZeT/+MEngqTvhhfxuye8XNaH7CK0/aMtRdhkyq+szofyYcd VokE7C8Fu/WExPbFwhPK33fW+/Abx6JaMvMJ5f4JK4CaArjbvSBLilvj4Azr6QRkR0qy PDSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=em2iGhZTNWLrOktCjNXOG+Zl/rBofwrWeFVpUN66HZo=; b=Siy74nYPvYdc2+SuMawDIA5zw1k/CoF5WY+3DsTVpPx3qHo2IGGsp0U2UTzqJs1OE2 K6g/yVOIAA2TT+w6aq6vpD3PDBNT8wTRigXBAKpLPL1IlNSj/+LYaLGO4VdiWXUdQb8l h73HSWgwjC7q/9kyl/HqHN1RDpCii0oBWFqzAg0/OlayNlaYxa2S87qBqROFuGkzWND6 LAbJvlOT/Q1VxFkT5zw3EAns3RY6PZRxpBrNkQ+f36fsSmgpdUY4JFjkTTKYWku0aNUB evO3hfuZrPUu93M0IdKUxRSE2F+9bVuAmRGtVi4Yys6BMDcfZ2cbAN0dwsOOWRp3WeT6 cCtQ== X-Gm-Message-State: APt69E3/No/lgD8hcg7SCWQgUQogKWizOd7dAeIqRNnNrTWEnOWex7Ln V6eiaHmgiVhOtK7WcOXs9aT4SlWOojJlGlsGgvMfUg== X-Google-Smtp-Source: ADUXVKK4NXdOGdqJvIjq/Y5rsyy4lT7+RMQldrX8qhToah4chXqWlg0mG7zhr3iSBZNfbopRUmtHNeSZqLt+bpICECQ= X-Received: by 2002:a24:7c8d:: with SMTP id a135-v6mr14799212itd.73.1529456057792; Tue, 19 Jun 2018 17:54:17 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 17:54:17 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> <4ad7ef96-e623-5ab8-dc47-c3178115ff24@FreeBSD.org> From: Warner Losh Date: Tue, 19 Jun 2018 18:54:17 -0600 X-Google-Sender-Auth: MPtHmvbwNVRa9OhgMs09rTh2otw Message-ID: Subject: Re: svn commit: r335278 - head/bin/pwd To: Eitan Adler Cc: Pedro Giffuni , John Baldwin , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:54:19 -0000 On Tue, Jun 19, 2018 at 5:56 PM, Eitan Adler wrote: > On 19 June 2018 at 12:57, Pedro Giffuni wrote: > > > > > > On 19/06/2018 11:25, John Baldwin wrote: > >> > >> On 6/18/18 10:26 PM, Eitan Adler wrote: > >>> > >>> On 18 June 2018 at 10:57, John Baldwin wrote: > >>>> > >>>> On 6/16/18 10:14 PM, Eitan Adler wrote: > >>>>> > >>>>> Author: eadler > >>>>> Date: Sun Jun 17 05:14:50 2018 > >>>>> New Revision: 335278 > >>>>> URL: https://svnweb.freebsd.org/changeset/base/335278 > >>>>> > >>>>> Log: > >>>>> pwd: mark usage as dead > >>>> > >>>> You keep committing changes like this and ignoring e-mails about them. > >>> > >>> I replied both the first time and this time. I may have > >>> (accidentally?) ignored similar emails though. The question I have is > >>> other than the mild code churn what's the harm? > >> > >> It adds clutter. Also, fixing the tool means you fix all the places at > >> once rather than slowly adding workarounds one by one. > >> > >>>> What broken compiler are you using that doesn't properly inherit > __dead2 > >>>> from the call to exit()? > >>> > >>> In this case, scan-build50 was getting annoyed. > >> > >> Does scan-build from LLVM 6.0 handle this correctly? If so, I'd say to > >> just mark this warning as broken (and thus ignore it) for scan-build50 > >> just as we ignore certain warnings from GCC 4.2.1 because they are > >> broken-as-implemented. > >> > > FWIW, clang's scan-build is made to even more false positives and general > > noise than the regular compiler warnings. > > It is better to just ignore it unless it finds something real. > > I don't consider this a real harm, but I'll try and remember to ignore > these in the future. We're in danger of being nibbled to death by ducks by these sorts of things. We need to choose carefully where we annotate to accommodate the competing needs of simplicity and automated tools providing assistance in boosting our code quality. So this one may or may not matter. But it's not just this one change that we have to look at... Warner From owner-svn-src-all@freebsd.org Wed Jun 20 00:55:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DB6F101A001; Wed, 20 Jun 2018 00:55:20 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D36937EA01; Wed, 20 Jun 2018 00:55:19 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B119C1B3F9; Wed, 20 Jun 2018 00:55:19 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K0tJ4n044761; Wed, 20 Jun 2018 00:55:19 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K0tIKZ044758; Wed, 20 Jun 2018 00:55:18 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201806200055.w5K0tIKZ044758@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 00:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335401 - head/lib/libveriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/lib/libveriexec X-SVN-Commit-Revision: 335401 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 00:55:20 -0000 Author: stevek Date: Wed Jun 20 00:55:18 2018 New Revision: 335401 URL: https://svnweb.freebsd.org/changeset/base/335401 Log: This library allows for user space applications to check file descriptors or paths to see if they can be verified by MAC/veriexec. Reviewed by: jtl, wblock Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8562 Added: head/lib/libveriexec/ head/lib/libveriexec/Makefile (contents, props changed) head/lib/libveriexec/libveriexec.h (contents, props changed) head/lib/libveriexec/veriexec.3 (contents, props changed) head/lib/libveriexec/veriexec_check.c (contents, props changed) Added: head/lib/libveriexec/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libveriexec/Makefile Wed Jun 20 00:55:18 2018 (r335401) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +.include + +LIB= veriexec +MAN= veriexec.3 +INCS= libveriexec.h + +WARNS?= 2 + +SRCS= veriexec_check.c + +.include + Added: head/lib/libveriexec/libveriexec.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libveriexec/libveriexec.h Wed Jun 20 00:55:18 2018 (r335401) @@ -0,0 +1,37 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011, 2012, 2013, 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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. + */ + +#ifndef __LIBVERIEXEC_H__ +#define __LIBVERIEXEC_H__ + +int veriexec_check_fd_mode(int, unsigned int); +int veriexec_check_path_mode(const char *, unsigned int); +int veriexec_check_fd(int); +int veriexec_check_path(const char *); + +#endif /* __LIBVERIEXEC_H__ */ Added: head/lib/libveriexec/veriexec.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libveriexec/veriexec.3 Wed Jun 20 00:55:18 2018 (r335401) @@ -0,0 +1,65 @@ +.\" Copyright (c) 2018, Juniper Networks, Inc. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 19, 2018 +.Dt VERIEXEC 3 +.Os +.Sh NAME +.Nm veriexec_check_fd , +.Nm veriexec_check_path +.Nd Verified execution routines +.Sh LIBRARY +.Lb libveriexec +.Sh SYNOPSIS +.In libveriexec.h +.Ft int +.Fn veriexec_check_fd "int fd" +.Ft int +.Fn veriexec_check_path "const char *file" +.Sh DESCRIPTION +The +.Fn veriexec_check_fd +function checks the signature of the file represented by the +.Fa fd +file descriptor. +.Pp +The +.Fn veriexec_check_path +function checks the signature of the file path +.Fa file . +.Pp +The +.Fn veriexec_check_fd +and +.Fn veriexec_check_path +functions return zero on a successful signature match or if veriexec is not +enabled. +If the signature does not match, +.Va errno +is set to the reason for the mismatch. +.Sh SEE ALSO +.Xr mac_veriexec 4 +.Xr veriexec 4 Added: head/lib/libveriexec/veriexec_check.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libveriexec/veriexec_check.c Wed Jun 20 00:55:18 2018 (r335401) @@ -0,0 +1,146 @@ +/* + * $FreeBSD$ + * + * Copyright (c) 2011, 2012, 2013, 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + +#include "libveriexec.h" + + +static int +check_fd_mode(int fd, unsigned int mask) +{ + struct stat st; + + if (fstat(fd, &st) < 0) + return errno; + + if ((st.st_mode & mask) == 0) + return EAUTH; + + return 0; +} + +int +veriexec_check_fd_mode(int fd, unsigned int mask) +{ + int error; + + if (fd < 0) { + errno = EINVAL; + return -1; + } + + error = mac_syscall(MAC_VERIEXEC_NAME, MAC_VERIEXEC_CHECK_FD_SYSCALL, + (void *)(intptr_t)fd); + if (error == -1) { + switch (errno) { + case ENOSYS: /* veriexec not loaded */ + error = 0; /* ignore */ + break; + } + } + if (mask && error == 0) + error = check_fd_mode(fd, mask); + + return (error); +} + +int +veriexec_check_path_mode(const char *file, unsigned int mask) +{ + int error; + + if (!file) { + errno = EINVAL; + return -1; + } + + if (mask) { + int fd; + + if ((fd = open(file, O_RDONLY)) < 0) + return errno; + + error = veriexec_check_fd_mode(fd, mask); + close(fd); + return error; + } + + error = mac_syscall(MAC_VERIEXEC_NAME, MAC_VERIEXEC_CHECK_PATH_SYSCALL, + __DECONST(void *, file)); + if (error == -1) { + switch (errno) { + case ENOSYS: /* veriexec not loaded */ + error = 0; /* ignore */ + break; + } + } + return (error); +} + +int +veriexec_check_fd(int fd) +{ + return veriexec_check_fd_mode(fd, 0); +} + +int +veriexec_check_path(const char *file) +{ + return veriexec_check_path_mode(file, 0); +} + +#if defined(MAIN) || defined(UNIT_TEST) +int +main(int argc __unused, char *argv[] __unused) +{ + int error; + int rc = 0; + + while (*++argv) { + error = veriexec_check_path(*argv); + if (error == -1) { + rc = 1; + warn("%s", *argv); + } + } + exit(rc); +} +#endif From owner-svn-src-all@freebsd.org Wed Jun 20 01:08:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23844101AE96; Wed, 20 Jun 2018 01:08:56 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BEFFC7F391; Wed, 20 Jun 2018 01:08:55 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 833191B59F; Wed, 20 Jun 2018 01:08:55 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K18t6e050137; Wed, 20 Jun 2018 01:08:55 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K18sIR050132; Wed, 20 Jun 2018 01:08:54 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201806200108.w5K18sIR050132@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 01:08:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335402 - head/sbin/veriexecctl X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sbin/veriexecctl X-SVN-Commit-Revision: 335402 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 01:08:56 -0000 Author: stevek Date: Wed Jun 20 01:08:54 2018 New Revision: 335402 URL: https://svnweb.freebsd.org/changeset/base/335402 Log: This application (veriexecctl) handles reading a fingerprints file containing paths, fingerprints, and optional option flags which in turn get pushed into the MAC/veriexec meta-data store via the veriexec device. The format of the fingerprints file is as follows: path type fingerprint options The type of fingerprint supported depends on what MAC/veriexec fingerprint modules have been loaded into the system. The veriexecctl application is able to determine which ones are available by consulting the security.mac.veriexec.algorithms sysctl. The following options are currently supported in MAC/veriexec and by the veriexecctl application: indirect If this option is set then the executable cannot be invoked directly, it can only be used as an interpreter in shell scripts. file Indicates that the fingerprint is associated with a file, not an executable. Files have their fingerprints verified during open(2) and are automatically made read only. This option may be used to verify shared libraries have not been tampered with. no_ptrace If this option is set then the executable cannot be traced with the ptrace(2) process tracing and debugging call. trusted If this option is set then the executable is allowed to write to the mem(4) devices. By default, when verified execution is enforced, no process is allowed to write to the mem(4) devices. The options are not case sensitive. Reviewed by: jtl, wblock Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D8575 Added: head/sbin/veriexecctl/ head/sbin/veriexecctl/Makefile (contents, props changed) head/sbin/veriexecctl/veriexecctl.8 (contents, props changed) head/sbin/veriexecctl/veriexecctl.c (contents, props changed) head/sbin/veriexecctl/veriexecctl_conf.l (contents, props changed) head/sbin/veriexecctl/veriexecctl_parse.y (contents, props changed) Added: head/sbin/veriexecctl/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexecctl/Makefile Wed Jun 20 01:08:54 2018 (r335402) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +PROG= veriexecctl +MAN= veriexecctl.8 +SRCS= veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c + +WARNS?= 3 + +LIBADD= l + +.include Added: head/sbin/veriexecctl/veriexecctl.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexecctl/veriexecctl.8 Wed Jun 20 01:08:54 2018 (r335402) @@ -0,0 +1,121 @@ +.\" $NetBSD: veriexecctl.8,v 1.5 2004/03/06 23:40:13 wiz Exp $ +.\" +.\" Copyright (c) 1999 +.\" Brett Lymn - blymn@baea.com.au, brett_lymn@yahoo.com.au +.\" +.\" This code is donated to The NetBSD Foundation by the author. +.\" +.\" 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. The name of the Author may not be used to endorse or promote +.\" products derived from this software without specific prior written +.\" permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd June 19, 2018 +.Dt VERIEXECCTL 8 +.Os +.Sh NAME +.Nm veriexecctl +.Nd load verified exec fingerprints +.Sh SYNOPSIS +.Nm +.Ar fingerprints +.Sh DESCRIPTION +The +.Nm +command loads an in-kernel metadata store of the fingerprints +given in the +.Ar fingerprints +file. +The kernel can then calculate the fingerprint of programs at time of +execution or files that are opened with +.Dv O_VERIFY +and verify whether the fingerprints match. +.Pp +The +.Ar fingerprints +file contains lines of fields separated by one or more whitespace +characters: +.Pp +.Dl path type fingerprint options +.Bl -tag -width fingerprint +.It Em path +Full path to the file. +.It Em type +Type of fingerprint used. +Currently this may be any of rmd160, sha1, sha256, sha384, or sha512. +Availability of these fingerprint types is dependent on kernel support. +The +.Va security.mac.veriexec.algorithms +sysctl is consulted to determine the list of valid fingerprint types. +.It Em fingerprint +A hexadecimal representation of the fingerprint for the file. +.It Em options +Associated options for the file. +Currently there are four valid options: +.Bl -tag -width INDIRECT +.It Pa INDIRECT +If this option is set then the executable cannot be invoked directly, it +can only be used as an interpreter in shell scripts. +.It Pa FILE +Indicates that the fingerprint is associated with a file, not an +executable. +Files have their fingerprints verified during +.Xr open 2 +and are automatically made read only. +This option may be used to verify shared libraries have not been +tampered with. +.It Pa NO_PTRACE +If this option is set then the executable cannot be traced with the +.Xr ptrace 2 process tracing and debugging call. +.It Pa TRUSTED +If this option is set then the executable is allowed to write to the +.Xr mem 4 +devices. +By default, when verified execution is enforced, no process +is allowed to write to the +.Xr mem 4 +devices. +.El +.El +.Pp +There must be only one executable/fingerprint pair per line. +Comments are indicated by the first character of a line being a +.Sq \&# +character. +.Sh FILES +.Bl -tag -width /dev/veriexec -compact +.It Pa /dev/veriexec +verified executable device node +.El +.Sh SEE ALSO +.Xr sysctl 3 +.Sh HISTORY +.Nm +first appeared in +.Nx 2.0 . +.Sh NOTES +.Nm +requires the kernel to have been configured with the +.Dv MAC_VERIEXEC +option and the veriexec pseudo-device. Added: head/sbin/veriexecctl/veriexecctl.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexecctl/veriexecctl.c Wed Jun 20 01:08:54 2018 (r335402) @@ -0,0 +1,144 @@ +/*- + * $FreeBSD$ + * + * Copyright (c) 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Copyright (c) 1998-1999 Brett Lymn + * (blymn@baea.com.au, brett_lymn@yahoo.com.au) + * All rights reserved. + * + * Originally derived from: + * $NetBSD: veriexecctl.c,v 1.5 2004/03/06 11:57:14 blymn Exp $ + * + * This code has been donated to The NetBSD Foundation by the Author. + * + * 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. The name of the author may not be used to endorse or promote products + * derived from this software withough specific prior written permission + * + * 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 +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +/* globals */ +int fd; +extern FILE *yyin; +int yyparse(void); + +const char **algorithms; + +static void +parse_algorithms(void) +{ + static char buf[BUFSIZ]; + size_t len = sizeof(buf); + char *bufp; + int count, indx; + + if (sysctlbyname("security.mac.veriexec.algorithms", buf, &len, NULL, + 0) == -1) + err(EXIT_FAILURE, + "Unable to determine any available algorithms"); + if (len >= sizeof(buf)) + err(EXIT_FAILURE, "Too many algorithms"); + + bufp = buf; + count = 0; + while (strsep(&bufp, " ") != NULL) + count++; + + algorithms = malloc(sizeof(const char *) * (count + 1)); + if (algorithms == NULL) + err(EX_SOFTWARE, "memory allocation failed"); + + indx = 0; + for (bufp = buf; *bufp != '\0'; bufp += strlen(bufp) + 1) + algorithms[indx++] = bufp; +} + +int +main(int argc, char *argv[]) +{ + int ctl = 0; + int x = 0; + + if (argv[1] == NULL) { + fprintf(stderr, "usage: veriexecctl signature_file\n"); + return (1); + } + + fd = open(_PATH_DEV_VERIEXEC, O_WRONLY, 0); + if (fd < 0) { + err(EX_UNAVAILABLE, "Open of veriexec device %s failed", + _PATH_DEV_VERIEXEC); + } + + if (strncmp(argv[1], "--", 2) == 0) { + switch (argv[1][2]) { + case 'a': /* --active */ + ctl = VERIEXEC_ACTIVE; + break; + case 'd': /* --debug* */ + ctl = (strstr(argv[1], "off")) ? + VERIEXEC_DEBUG_OFF : VERIEXEC_DEBUG_ON; + if (argc > 2 && ctl == VERIEXEC_DEBUG_ON) { + x = atoi(argv[2]); + } + break; + case 'e': /* --enforce */ + ctl = VERIEXEC_ENFORCE; + break; + case 'l': /* --lock */ + ctl = VERIEXEC_LOCK; + break; + } + if (ctl) { + if (ioctl(fd, ctl, &x)) { + err(EXIT_FAILURE, "Cannot %s veriexec", + argv[1]); + } + if (ctl == VERIEXEC_DEBUG_ON) { + printf("debug is: %d\n", x); + } + return (0); + } + } else if (strcmp(argv[1], "-")) { + if ((yyin = fopen(argv[1], "r")) == NULL) { + err(EXIT_FAILURE, "Opening signature file %s failed", + argv[1]); + } + } + + parse_algorithms(); + + yyparse(); + return (0); +} Added: head/sbin/veriexecctl/veriexecctl_conf.l ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexecctl/veriexecctl_conf.l Wed Jun 20 01:08:54 2018 (r335402) @@ -0,0 +1,54 @@ +%{ +/* + * $FreeBSD$ + * + * Configuration file lexer for Verified exec + * + * + */ + +#include +#include +#include "veriexecctl_parse.h" + +int lineno = 1; + +void yyerror(const char *message); +void warning(const char *message); +int yylex __P((void)); + +%} + +%% + +path { return PATH; } +string { return STRING; } +eol { return EOL; } + +\/[^ ]+ { + yylval.string = strdup(yytext); + return PATH; +} + +[0-9a-zA-Z]+ { + yylval.string = strdup(yytext); + return STRING; +} + +\n { + lineno++; /* for error reporting */ + return EOL; +} + +[ \t\r] ; /* eat white ones */ + +#.* ; /* comment */ + +. yyerror("invalid character"); + +%% + +void yyerror(const char *string) +{ + fprintf(stderr, "%d: %s at %s\n", lineno, string, yytext); +} Added: head/sbin/veriexecctl/veriexecctl_parse.y ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sbin/veriexecctl/veriexecctl_parse.y Wed Jun 20 01:08:54 2018 (r335402) @@ -0,0 +1,184 @@ +%{ +/* + * $FreeBSD$ + * + * Copyright (c) 2015, Juniper Networks, Inc. + * All rights reserved. + * + * Originally derived from: + * $NetBSD: veriexecctl_parse.y,v 1.3 2004/03/06 11:59:30 blymn Exp $ + * + * Parser for verified exec fingerprint file. + * + * 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. The name of the author may not be used to endorse or promote products + * derived from this software withough specific prior written permission + * + * 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 +#include + +#include +#include +#include +#include + +#include + +/* yacc internal function */ +int yylex(void); +void yyerror(const char *); + +/* function prototypes */ +static int convert(char *fp, unsigned int count, unsigned char *out); +static void do_ioctl(void); + +/* ioctl parameter struct */ +static struct verified_exec_params params; +extern int fd; +extern int lineno; +extern const char **algorithms; + +%} + +%union { + char *string; + int intval; +} + +%token EOL +%token PATH +%token STRING + +%% + +statement: /* empty */ + | statement path type fingerprint flags eol + | statement error eol { + yyclearin; /* discard lookahead */ + yyerrok; /* no more error */ + fprintf(stderr, "skipping to next fingerprint\n"); + } + ; + +path: PATH +{ + if (strlen($1) >= MAXPATHLEN) { + yyerror("Path >= MAXPATHLEN"); + YYERROR; + } + strncpy(params.file, $1, MAXPATHLEN); +}; + +type: STRING +{ + const char **algop; + + for (algop = algorithms; *algop != NULL; algop++) { + if (strcasecmp($1, *algop) == 0) { + strlcpy(params.fp_type, $1, sizeof(params.fp_type)); + break; + } + } + if (*algop == NULL) { + yyerror("bad fingerprint type"); + YYERROR; + } +}; + +fingerprint: STRING +{ + if (convert($1, MAXFINGERPRINTLEN, params.fingerprint) < 0) { + yyerror("bad fingerprint"); + YYERROR; + } +}; + +flags: /* empty */ + | flag_spec flags; + +flag_spec: STRING +{ + if (strcasecmp($1, "indirect") == 0) + params.flags |= VERIEXEC_INDIRECT; + else if (strcasecmp($1, "file") == 0) + params.flags |= VERIEXEC_FILE; + else if (strcasecmp($1, "no_ptrace") == 0) + params.flags |= VERIEXEC_NOTRACE; + else if (strcasecmp($1, "trusted") == 0) + params.flags |= VERIEXEC_TRUSTED; + else { + yyeror("bad flag specification"); + YYERROR; + } +}; + +eol: EOL +{ + if (!YYRECOVERING()) /* Don't do the ioctl if we saw an error */ + do_ioctl(); +}; + +%% + +/* + * Convert: takes the hexadecimal string pointed to by fp and converts + * it to a "count" byte binary number which is stored in the array pointed to + * by out. Returns -1 if the conversion fails. + */ +static int +convert(char *fp, unsigned int count, unsigned char *out) +{ + unsigned int i; + int value; + + for (i = 0; i < count; i++) { + value = 0; + if (isdigit(fp[i * 2])) + value += fp[i * 2] - '0'; + else if (isxdigit(fp[i * 2])) + value = 10 + tolower(fp[i * 2]) - 'a'; + else + return (-1); + + value <<= 4; + if (isdigit(fp[i * 2 + 1])) + value += fp[i * 2 + 1] - '0'; + else if (isxdigit(fp[i * 2 + 1])) + value = 10 + tolower(fp[i * 2 + 1]) - 'a'; + else + return (-1); + + out[i] = value; + } + + return (i); +} + +/* + * Perform the load of the fingerprint. Assumes that the fingerprint + * pseudo-device is opened and the file handle is in fd. + */ +static void +do_ioctl(void) +{ + if (ioctl(fd, VERIEXEC_LOAD, ¶ms) < 0) + fprintf(stderr, "Ioctl failed with error `%s' on file %s\n", + strerror(errno), params.file); + bzero(¶ms, sizeof(params)); +} From owner-svn-src-all@freebsd.org Wed Jun 20 03:09:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11D6A1020D74 for ; Wed, 20 Jun 2018 03:09:07 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x22d.google.com (mail-yw0-x22d.google.com [IPv6:2607:f8b0:4002:c05::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA1283130 for ; Wed, 20 Jun 2018 03:09:06 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x22d.google.com with SMTP id r19-v6so654091ywc.10 for ; Tue, 19 Jun 2018 20:09:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/VucrOD3rV1fQ770Tyv/DrlP29lSRNaPGGk5Aq+9XrY=; b=WN/8IHEXMfEf0uSFK3LEH1/e54L2+wZgkal5j8NdEIp87Hde6oVskPmGw/rPu8KWsv Pd/jCWVb10/02E5wAt0PdoRFhtySolBtMzR3jYT+uTHG66x1sAOyuqCZF4JRclWNRLWd SOpGTKWUzXfwwRrKLD54KPvGI2ovBxaeaA8+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/VucrOD3rV1fQ770Tyv/DrlP29lSRNaPGGk5Aq+9XrY=; b=smt7vav+4qjPklwHfQHqWpWn805mFq+p6O6eaRpq0uCZ7fTL0XLXziNWRjC/q35d2Q cRhmrGh3gHSeo75pMundNeJeOStIoHLGkTTwWF8yWxpUqXTxtZQKfTw1Ee455ey6/9EO hwdBF/79RRgaVZNATSIckO+MHMO2HeNd2Ffk7Pk/XGt+AtntrjYy3i/fsVr8Fid5dXqH EHuFuMZJ88gxDXCudomB/xETzET7B1aQIf3+9LDeQ1GKwFNj/IHcHTSBYZD+1AmtRCUu FCmDqcIc04puW5UrezLP+nNmEZ9VhS00O8CBC0FAweLwcJ9MCMV3Yx5H/7lroRK3EiuR WHXA== X-Gm-Message-State: APt69E3wsgARPxR8zrdX2EnZg/pDTtkjEhSV4zCYbshsM+JVI3jac0sG s+8LrO5yFL8H9PVtVszOiQ4+S6G1jHpOvEaq1QKZeA== X-Google-Smtp-Source: ADUXVKJCYR1LdGAMsv+UF6cCR3LIdls4CJ5ccxco1xV8zgmZXIW37pBhecdwHJoFnCMfoziJJEeGKjzXBJv017GQljo= X-Received: by 2002:a81:af1d:: with SMTP id n29-v6mr9394281ywh.113.1529464145456; Tue, 19 Jun 2018 20:09:05 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 20:08:34 -0700 (PDT) In-Reply-To: <201806200108.w5K18sIR050132@repo.freebsd.org> References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Eitan Adler Date: Tue, 19 Jun 2018 20:08:34 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Stephen J. Kiernan" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:09:07 -0000 On 19 June 2018 at 18:08, Stephen J. Kiernan wrote: > Added: head/sbin/veriexecctl/Makefile > ============================================================================== > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sbin/veriexecctl/Makefile Wed Jun 20 01:08:54 2018 (r335402) > @@ -0,0 +1,11 @@ > +# $FreeBSD$ > + > +PROG= veriexecctl > +MAN= veriexecctl.8 > +SRCS= veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c > + > +WARNS?= 3 Why are we introducing new code with lower-than-6 warnings ? -- Eitan Adler From owner-svn-src-all@freebsd.org Wed Jun 20 03:10:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A54961020F0C; Wed, 20 Jun 2018 03:10:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 582EC8331E; Wed, 20 Jun 2018 03:10:50 +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 3A8971C956; Wed, 20 Jun 2018 03:10:50 +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 w5K3Ao5D012590; Wed, 20 Jun 2018 03:10:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K3Ans7012588; Wed, 20 Jun 2018 03:10:49 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806200310.w5K3Ans7012588@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Jun 2018 03:10:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335403 - in head/usr.bin/sort: . tests X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in head/usr.bin/sort: . tests X-SVN-Commit-Revision: 335403 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:10:50 -0000 Author: kevans Date: Wed Jun 20 03:10:49 2018 New Revision: 335403 URL: https://svnweb.freebsd.org/changeset/base/335403 Log: sort(1): Add bits to allow easy checking against NetBSD tests I'm looking at sort(1) failures, for better or worse. Added: head/usr.bin/sort/tests/ head/usr.bin/sort/tests/Makefile (contents, props changed) Modified: head/usr.bin/sort/Makefile Modified: head/usr.bin/sort/Makefile ============================================================================== --- head/usr.bin/sort/Makefile Wed Jun 20 01:08:54 2018 (r335402) +++ head/usr.bin/sort/Makefile Wed Jun 20 03:10:49 2018 (r335403) @@ -32,4 +32,7 @@ CFLAGS+= -DWITHOUT_NLS MAN_SUB+= -e 's|%%NLS%%|\.\\"|g' .endif +#HAS_TESTS= +#SUBDIR.${MK_TESTS}+= tests + .include Added: head/usr.bin/sort/tests/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/sort/tests/Makefile Wed Jun 20 03:10:49 2018 (r335403) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +PACKAGE= tests + +NETBSD_ATF_TESTS_SH= sort_test + +${PACKAGE}FILES+= d_any_char_dflag_out.txt +${PACKAGE}FILES+= d_any_char_fflag_out.txt +${PACKAGE}FILES+= d_any_char_iflag_out.txt +${PACKAGE}FILES+= d_any_char_in.txt + +.include + +.include From owner-svn-src-all@freebsd.org Wed Jun 20 03:16:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8BE1B10215DA; Wed, 20 Jun 2018 03:16:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3DB27839B5; Wed, 20 Jun 2018 03:16:43 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f50.google.com (mail-lf0-f50.google.com [209.85.215.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id CDCB821D1B; Wed, 20 Jun 2018 03:16:42 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f50.google.com with SMTP id t2-v6so2614983lfd.6; Tue, 19 Jun 2018 20:16:42 -0700 (PDT) X-Gm-Message-State: APt69E0PreOE+l/0juuoIOsR0noPT2zeK2ulgnKW7JZQ+v5Ym1kF35OC CE87gGusxotgMtofhfnODSqRWcLrhvQGA92bwfs= X-Google-Smtp-Source: ADUXVKJgeWolqPqWeRTJRhUMcQ2rgKT/0UuhhBWJHy9n+IvJbgjUOPO4hNlFJLMxTNPEAi/bVAgs1DbA5IST5xgM4Pw= X-Received: by 2002:a2e:1710:: with SMTP id l16-v6mr13379503lje.74.1529464601289; Tue, 19 Jun 2018 20:16:41 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:8582:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 20:16:20 -0700 (PDT) In-Reply-To: <201806200310.w5K3Ans7012588@repo.freebsd.org> References: <201806200310.w5K3Ans7012588@repo.freebsd.org> From: Kyle Evans Date: Tue, 19 Jun 2018 22:16:20 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335403 - in head/usr.bin/sort: . tests To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:16:43 -0000 On Tue, Jun 19, 2018 at 10:10 PM, Kyle Evans wrote: > Author: kevans > Date: Wed Jun 20 03:10:49 2018 > New Revision: 335403 > URL: https://svnweb.freebsd.org/changeset/base/335403 > > Log: > sort(1): Add bits to allow easy checking against NetBSD tests > > I'm looking at sort(1) failures, for better or worse. > In the past four minutes, I've learned that this isn't a sustainable long-term idea due to major differences between NetBSD sort(1) and ours. I'll look to adding FreeBSD tests and not using the NetBSD tests, but will use theirs as a baseline where it makes sense for the time being. From owner-svn-src-all@freebsd.org Wed Jun 20 03:31:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3229A1021E55; Wed, 20 Jun 2018 03:31:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D49B9841B3; Wed, 20 Jun 2018 03:31:20 +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 9B9071CCBD; Wed, 20 Jun 2018 03:31:20 +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 w5K3VKXa025715; Wed, 20 Jun 2018 03:31:20 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K3VKKx024947; Wed, 20 Jun 2018 03:31:20 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806200331.w5K3VKKx024947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Jun 2018 03:31:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335404 - head/usr.bin/sort X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/usr.bin/sort X-SVN-Commit-Revision: 335404 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:31:21 -0000 Author: kevans Date: Wed Jun 20 03:31:19 2018 New Revision: 335404 URL: https://svnweb.freebsd.org/changeset/base/335404 Log: sort(1): Fix -m when only implicit stdin is used for input Observe: printf "a\nb\nc\n" > /tmp/foo # Next command results in no output cat /tmp/foo | sort -m # Next command results in proper output cat /tmp/foo | sort -m - # Also works: sort -m /tmp/foo Some const'ification was done to simplify the actual solution of adding "-" explicitly to the file list if we didn't have any file arguments left over. PR: 190099 MFC after: 1 week Modified: head/usr.bin/sort/file.c head/usr.bin/sort/file.h head/usr.bin/sort/sort.c Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Wed Jun 20 03:10:49 2018 (r335403) +++ head/usr.bin/sort/file.c Wed Jun 20 03:31:19 2018 (r335404) @@ -227,7 +227,7 @@ file_list_init(struct file_list *fl, bool tmp) * Add a file name to the list */ void -file_list_add(struct file_list *fl, char *fn, bool allocate) +file_list_add(struct file_list *fl, const char *fn, bool allocate) { if (fl && fn) { @@ -1115,7 +1115,7 @@ file_headers_merge(size_t fnum, struct file_header **f * stdout. */ static void -merge_files_array(size_t argc, char **argv, const char *fn_out) +merge_files_array(size_t argc, const char **argv, const char *fn_out) { if (argv && fn_out) { Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Wed Jun 20 03:10:49 2018 (r335403) +++ head/usr.bin/sort/file.h Wed Jun 20 03:31:19 2018 (r335404) @@ -66,7 +66,7 @@ struct file_reader; */ struct file_list { - char **fns; + const char * *fns; size_t count; size_t sz; bool tmp; @@ -108,7 +108,7 @@ char *new_tmp_file_name(void); void tmp_file_atexit(const char *tmp_file); void file_list_init(struct file_list *fl, bool tmp); -void file_list_add(struct file_list *fl, char *fn, bool allocate); +void file_list_add(struct file_list *fl, const char *fn, bool allocate); void file_list_populate(struct file_list *fl, int argc, char **argv, bool allocate); void file_list_clean(struct file_list *fl); Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Wed Jun 20 03:10:49 2018 (r335403) +++ head/usr.bin/sort/sort.c Wed Jun 20 03:31:19 2018 (r335404) @@ -1299,7 +1299,11 @@ main(int argc, char **argv) struct file_list fl; file_list_init(&fl, false); - file_list_populate(&fl, argc, argv, true); + /* No file arguments remaining means "read from stdin." */ + if (argc == 0) + file_list_add(&fl, "-", true); + else + file_list_populate(&fl, argc, argv, true); merge_files(&fl, outfile); file_list_clean(&fl); } From owner-svn-src-all@freebsd.org Wed Jun 20 03:33:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5042510221F1; Wed, 20 Jun 2018 03:33:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DFE78449B; Wed, 20 Jun 2018 03:33:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id s26-v6so2203247ioj.4; Tue, 19 Jun 2018 20:33:37 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=1lSEkkkgbfZqDCzuUwLfJecXZxHs3pRBu6bR9dMx0sY=; b=bsU7TBOQXhpdP2qQ7cmqv/jl9rZZEdPnAc4yMGPqzgUnMT7Acikv+3KbyAjk7fdg2u CYKuWPfVKLwcA4JGhA3NZoPPDCBQzSjDCZdsZj3nWWAmJOpmIOFNYpm+UzCZAo0m5nJE 6RezBNDSWxlpk9L2xd1tKqkVybTmtgBzOeeTTHKJzfOAydv4mzkZ2G4e+isAJI2CP2v7 9sdbLCZ7wPP6bvN6UmPBh7471gEFWv9tXQ1RiEOLQelfuCnd31pr42BQq5HHl6NOdoCq a10+OEuuq0N1QqIutmyVYZo2FT6mcuhu5y0X1nXfybu9hbpKgZyYNiaCIBBHYlIKRKl2 xx3A== X-Gm-Message-State: APt69E0xD7knE6x4+Aywhss9H1lCikfJxwfq4avq42pHhs+Wk5OSCzQv dMXU2WdIlrUDecnv9jgZ6b5PNloV X-Google-Smtp-Source: ADUXVKJymyaAUTGxQoT5MRcW1pP6wkP6YQ38emUtgBMACN5bPCtoFWaGlA6hOyUXZuWGqJhOhPXcnA== X-Received: by 2002:a6b:3bcb:: with SMTP id i194-v6mr15180823ioa.86.1529465611257; Tue, 19 Jun 2018 20:33:31 -0700 (PDT) Received: from mail-it0-f51.google.com (mail-it0-f51.google.com. [209.85.214.51]) by smtp.gmail.com with ESMTPSA id 65-v6sm820011itu.6.2018.06.19.20.33.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 20:33:31 -0700 (PDT) Received: by mail-it0-f51.google.com with SMTP id u4-v6so3512829itg.0; Tue, 19 Jun 2018 20:33:31 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr237420ith.53.1529465611013; Tue, 19 Jun 2018 20:33:31 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 20:33:30 -0700 (PDT) In-Reply-To: <201806200108.w5K18sIR050132@repo.freebsd.org> References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Conrad Meyer Date: Tue, 19 Jun 2018 20:33:30 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Stephen J. Kiernan" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:33:38 -0000 On Tue, Jun 19, 2018 at 6:08 PM, Stephen J. Kiernan wr= ote: > Author: stevek > Date: Wed Jun 20 01:08:54 2018 > New Revision: 335402 > URL: https://svnweb.freebsd.org/changeset/base/335402 > > Log: > This application (veriexecctl) handles reading a fingerprints file Hi, This patchset needed design and code review prior to commit. It appears to have serious problems. First and foremost: nothing is actually signed, anywhere. The veriexecctl tool parses and tells the kernel to trust a file input. But if we don't trust other files on the filesystem, why do we trust that one? There is no embedded signature mechanism proving the hash list file is trustworthy. As a corollary to the above, the name "signature file" is used repeatedly in the code, which is misleading. The file contains hashes (digests), not signatures (MACs). The file itself is unsigned. Nothing about this has signatures. There's absolutely no reason to use sha1 or ripemd in new designs. These should be removed. The patchset is littered with style issues. One fairly obvious issue is mixed indentation styles =E2=80=94 some files vary between space and tab indentation from line to line. Please revert this patchset. It's not ready. Some suggestions for a second attempt: - Maybe use HMACs instead of raw hashes - Maybe sign the source-of-trust file - Fix the style issues - Fix the compiler warnings at 6 Thank you, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 03:52:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E6621022E88; Wed, 20 Jun 2018 03:52:31 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f171.google.com (mail-io0-f171.google.com [209.85.223.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98B4684FD6; Wed, 20 Jun 2018 03:52:30 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f171.google.com with SMTP id k3-v6so2227696iog.3; Tue, 19 Jun 2018 20:52: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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=E73/qX4afXQbjt7/JWnJHhw673GlqbY02pq1KVEv7Ps=; b=TSnoOiETYWDEsSgtZohwONYfjweXXPalDzBySq98IrBKg26ZKp+ttgyMKFhLJC4/hy OdolgfPr6urkCYNPf8v8qIfNFihloysbglUNPg5OzTbq2uKIYPl6KXpsjvg5gUshc4nV cB2IQntAfdr8vADoxRrMv5+0fTx89HEE5QuQNoaBGzPf/8Kutkbdo1HG3R8Oj1DzSixP qiviyB/k1aNixxckFjoWMxx0VuS7VF+qe1QfrfcIhM11DhEH1tzsColfjmarpEMwayyS DN2jjnwC9+egeR6vj+Sph26WMwa+tYYc7SOgN9DzPRmSy4FipEUXqWMJIw/l3tMFKsNo AE1Q== X-Gm-Message-State: APt69E2rAnt8xSqgMRTlN8v8VXhNzRWesIvSfDuaZ1GB3vkZFrYxsdhX TLKSi20dbKKFYZhVBcUDr5+Su+J4 X-Google-Smtp-Source: ADUXVKITiILL3RdFwqMVkQITKDoKkF9ETk75TX0wLR4cLmzYDUufsLBsnSTZ+un3kCRiwmWeiRn7Vg== X-Received: by 2002:a6b:c309:: with SMTP id t9-v6mr16323229iof.157.1529466327841; Tue, 19 Jun 2018 20:45:27 -0700 (PDT) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com. [209.85.214.43]) by smtp.gmail.com with ESMTPSA id i193-v6sm662294ioi.38.2018.06.19.20.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 19 Jun 2018 20:45:27 -0700 (PDT) Received: by mail-it0-f43.google.com with SMTP id a195-v6so3514725itd.3; Tue, 19 Jun 2018 20:45:27 -0700 (PDT) X-Received: by 2002:a24:100f:: with SMTP id 15-v6mr263673ity.61.1529466327548; Tue, 19 Jun 2018 20:45:27 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 20:45:27 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Conrad Meyer Date: Tue, 19 Jun 2018 20:45:27 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "cem@FreeBSD.org" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 03:52:31 -0000 I forgot to mention that the kernel code also introduces severe performance problems due to really pessimal data structures, small IO sizes, and problematic locking. Again: please revert and proceed through a round or two of design review. Thank you, Conrad On Tue, Jun 19, 2018 at 8:33 PM, Conrad Meyer wrote: > On Tue, Jun 19, 2018 at 6:08 PM, Stephen J. Kiernan = wrote: >> Author: stevek >> Date: Wed Jun 20 01:08:54 2018 >> New Revision: 335402 >> URL: https://svnweb.freebsd.org/changeset/base/335402 >> >> Log: >> This application (veriexecctl) handles reading a fingerprints file > > Hi, > > This patchset needed design and code review prior to commit. It > appears to have serious problems. > > First and foremost: nothing is actually signed, anywhere. The > veriexecctl tool parses and tells the kernel to trust a file input. > But if we don't trust other files on the filesystem, why do we trust > that one? There is no embedded signature mechanism proving the hash > list file is trustworthy. > > As a corollary to the above, the name "signature file" is used > repeatedly in the code, which is misleading. The file contains hashes > (digests), not signatures (MACs). The file itself is unsigned. > Nothing about this has signatures. > > There's absolutely no reason to use sha1 or ripemd in new designs. > These should be removed. > > The patchset is littered with style issues. One fairly obvious issue > is mixed indentation styles =E2=80=94 some files vary between space and t= ab > indentation from line to line. > > Please revert this patchset. It's not ready. > > Some suggestions for a second attempt: > > - Maybe use HMACs instead of raw hashes > - Maybe sign the source-of-trust file > - Fix the style issues > - Fix the compiler warnings at 6 > > Thank you, > Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 04:13:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 58A9E1023B85; Wed, 20 Jun 2018 04:13:16 +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 7F10385C01; Wed, 20 Jun 2018 04:13:15 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id VUS1fPlYOSzNNVUS2fQONN; Tue, 19 Jun 2018 22:10:36 -0600 X-Authority-Analysis: v=2.3 cv=KuxjJ1eN c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=8nJEP1OIZ-IA:10 a=7mUfYlMuFuIA:10 a=xfDLHkLGAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=-ZJvs42pOR2nT8F-j_UA:9 a=-gZcZOLFXhXnHIy1:21 a=s9kbt_ARPlio2ZTs:21 a=wPNLvfGTeEIA:10 a=IfaqVvZgccqrtc8gcwf2:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id BFD2B140; Tue, 19 Jun 2018 21:10: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 w5K4AWrn019388; Tue, 19 Jun 2018 21:10:32 -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 w5K4AWAt019385; Tue, 19 Jun 2018 21:10:32 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806200410.w5K4AWAt019385@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.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: "Stephen J. Kiernan" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: Message from Conrad Meyer of "Tue, 19 Jun 2018 20:33:30 -0700." Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Tue, 19 Jun 2018 21:10:32 -0700 X-CMAE-Envelope: MS4wfCsgH37Ef3dZjXKEcHztBpMQDmJAfLfeqRbK38p7jbbLQtOxIK0RI10HzFFNLRkzzmn3otyBUeCGr5dwqYTY0tW7KUzN0d3NeyASqB5xFhRghXPWVchG Ad5tT7aYFTR+OBXhYkTV+2h/BtrWzPnrgVJPlyEfOiH+QnS9nraDHXaOagCyjyrD6J7SluTU6IJVMmCESeUjAUGHR3IO+s1pNj8q56/gnioPzGgUADLufm67 RVo4l1qvl0UP/X3gmC/52P2NrixbD8bZe2JEbjCaqOVDa4f3G8LsJDwdwaPX9D82NHBsadx+idJjH9Y/y+5k7DfFudFumKBQLvjAQFaNDyA= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 04:13:16 -0000 In message , Conrad Meyer writes: > On Tue, Jun 19, 2018 at 6:08 PM, Stephen J. Kiernan wrot > e: > > Author: stevek > > Date: Wed Jun 20 01:08:54 2018 > > New Revision: 335402 > > URL: https://svnweb.freebsd.org/changeset/base/335402 > > > > Log: > > This application (veriexecctl) handles reading a fingerprints file > > Hi, > > This patchset needed design and code review prior to commit. It > appears to have serious problems. > > First and foremost: nothing is actually signed, anywhere. The > veriexecctl tool parses and tells the kernel to trust a file input. > But if we don't trust other files on the filesystem, why do we trust > that one? There is no embedded signature mechanism proving the hash > list file is trustworthy. > > As a corollary to the above, the name "signature file" is used > repeatedly in the code, which is misleading. The file contains hashes > (digests), not signatures (MACs). The file itself is unsigned. > Nothing about this has signatures. > > There's absolutely no reason to use sha1 or ripemd in new designs. > These should be removed. > > The patchset is littered with style issues. One fairly obvious issue > is mixed indentation styles — some files vary between space and tab > indentation from line to line. > > Please revert this patchset. It's not ready. > > Some suggestions for a second attempt: > > - Maybe use HMACs instead of raw hashes > - Maybe sign the source-of-trust file > - Fix the style issues > - Fix the compiler warnings at 6 - i386 format issues, build failures in multiple places -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Wed Jun 20 05:10:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59EA510000DC; Wed, 20 Jun 2018 05:10:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BC0287535; Wed, 20 Jun 2018 05:10:31 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DD5221DCA6; Wed, 20 Jun 2018 05:10:30 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K5AUAt073752; Wed, 20 Jun 2018 05:10:30 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K5AURT073751; Wed, 20 Jun 2018 05:10:30 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200510.w5K5AURT073751@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 05:10: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: r335405 - stable/11/usr.sbin/sysrc X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/sysrc X-SVN-Commit-Revision: 335405 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 05:10:31 -0000 Author: dteske Date: Wed Jun 20 05:10:30 2018 New Revision: 335405 URL: https://svnweb.freebsd.org/changeset/base/335405 Log: MFC r335277: sysrc(8): Exit with failure on API error Fix exit status when f_sysrc_set() fails. Errors in the underlying API provided by bsdconfig(8) -- /usr/share/bsdconfig/sysrc.subr -- were not being communicated back to the command-line. This was affecting ansible modules using sysrc as they were not able to accurately test for error. PR: bin/211448 Reported by: Christian Schwarz Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/sysrc/sysrc Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/sysrc/sysrc ============================================================================== --- stable/11/usr.sbin/sysrc/sysrc Wed Jun 20 03:31:19 2018 (r335404) +++ stable/11/usr.sbin/sysrc/sysrc Wed Jun 20 05:10:30 2018 (r335405) @@ -1,6 +1,6 @@ #!/bin/sh #- -# Copyright (c) 2010-2016 Devin Teske +# Copyright (c) 2010-2018 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -40,7 +40,7 @@ BSDCFG_SHARE="/usr/share/bsdconfig" # # Version information # -SYSRC_VERSION="7.1 Feb-2,2016" +SYSRC_VERSION="7.2 Jun-16,2018" # # Options @@ -842,7 +842,7 @@ while [ $# -gt 0 ]; do # if [ ! "$SHOW_VALUE" ]; then echo "$NAME" - f_sysrc_set "$NAME" "$new" + f_sysrc_set "$NAME" "$new" || status=$FAILURE else if f_sysrc_set "$NAME" "$new"; then if [ "$SHOW_FILE" ]; then @@ -854,6 +854,8 @@ while [ $# -gt 0 ]; do echo -n "$before${SHOW_EQUALS:+\" #}" echo -n " -> ${SHOW_EQUALS:+\"}$after" echo "${SHOW_EQUALS:+\"}" + else + status=$FAILURE fi fi ;; From owner-svn-src-all@freebsd.org Wed Jun 20 05:45:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E52C1001B6D; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A09E686F7; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 087C41E2F1; Wed, 20 Jun 2018 05:45:42 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K5jfLu094125; Wed, 20 Jun 2018 05:45:41 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K5jfa7094123; Wed, 20 Jun 2018 05:45:41 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200545.w5K5jfa7094123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 05:45:41 +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: r335406 - stable/11/lib/libdpv X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/lib/libdpv X-SVN-Commit-Revision: 335406 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 05:45:42 -0000 Author: dteske Date: Wed Jun 20 05:45:41 2018 New Revision: 335406 URL: https://svnweb.freebsd.org/changeset/base/335406 Log: dpv(3): MFC r330943, r335264 r330943: Fix bad error messages from dpv(3) Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: : No such file or directory Most notably, show the 2nd argument being passed to posix_spawnp(3) so we know what path/cmd failed. Also, we don't need to have "posix_spawnp(3)" in the error message nor the function because that can [a] change and [b] traversed using a debugger if necessary. r335264: Fix comparison between pointer and char literal PR: misc/204252 Reported by: David Binderman Sponsored by: Smule, Inc. Modified: stable/11/lib/libdpv/dialog_util.c stable/11/lib/libdpv/dprompt.c stable/11/lib/libdpv/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libdpv/dialog_util.c ============================================================================== --- stable/11/lib/libdpv/dialog_util.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/dialog_util.c Wed Jun 20 05:45:41 2018 (r335406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid) posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, dialog, &action, (const posix_spawnattr_t *)NULL, dargv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", dialog); /* NB: Do not free(3) *dargv[], else SIGSEGV */ Modified: stable/11/lib/libdpv/dprompt.c ============================================================================== --- stable/11/lib/libdpv/dprompt.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/dprompt.c Wed Jun 20 05:45:41 2018 (r335406) @@ -89,7 +89,7 @@ spin_char(void) { char ch; - if (spin_cp == '\0') + if (*spin_cp == '\0') spin_cp = spin; ch = *spin_cp; Modified: stable/11/lib/libdpv/util.c ============================================================================== --- stable/11/lib/libdpv/util.c Wed Jun 20 05:10:30 2018 (r335405) +++ stable/11/lib/libdpv/util.c Wed Jun 20 05:45:41 2018 (r335406) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, shellcmd, &action, (const posix_spawnattr_t *)NULL, shellcmd_argv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", shellcmd); return stdin_pipe[1]; } From owner-svn-src-all@freebsd.org Wed Jun 20 05:50:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C4941001EC5; Wed, 20 Jun 2018 05:50:56 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF2A068BE0; Wed, 20 Jun 2018 05:50:55 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C1DDF1E30B; Wed, 20 Jun 2018 05:50:55 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K5otR6094417; Wed, 20 Jun 2018 05:50:55 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K5otP1094414; Wed, 20 Jun 2018 05:50:55 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200550.w5K5otP1094414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 05:50:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335407 - stable/10/lib/libdpv X-SVN-Group: stable-10 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/10/lib/libdpv X-SVN-Commit-Revision: 335407 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 05:50:56 -0000 Author: dteske Date: Wed Jun 20 05:50:54 2018 New Revision: 335407 URL: https://svnweb.freebsd.org/changeset/base/335407 Log: dpv(3): MFC r330943, r335264 r330943: Fix bad error messages from dpv(3) Before = dpv: <__func__>: posix_spawnp(3): No such file or directory After = dpv: : No such file or directory Most notably, show the 2nd argument being passed to posix_spawnp(3) so we know what path/cmd failed. Also, we don't need to have "posix_spawnp(3)" in the error message nor the function because that can [a] change and [b] traversed using a debugger if necessary. r335264: Fix comparison between pointer and char literal PR: misc/204252 Reported by: David Binderman Sponsored by: Smule, Inc. Modified: stable/10/lib/libdpv/dialog_util.c stable/10/lib/libdpv/dprompt.c stable/10/lib/libdpv/util.c Directory Properties: stable/10/ (props changed) Modified: stable/10/lib/libdpv/dialog_util.c ============================================================================== --- stable/10/lib/libdpv/dialog_util.c Wed Jun 20 05:45:41 2018 (r335406) +++ stable/10/lib/libdpv/dialog_util.c Wed Jun 20 05:50:54 2018 (r335407) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -328,8 +328,7 @@ dialog_spawn_gauge(char *init_prompt, pid_t *pid) posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, dialog, &action, (const posix_spawnattr_t *)NULL, dargv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", dialog); /* NB: Do not free(3) *dargv[], else SIGSEGV */ Modified: stable/10/lib/libdpv/dprompt.c ============================================================================== --- stable/10/lib/libdpv/dprompt.c Wed Jun 20 05:45:41 2018 (r335406) +++ stable/10/lib/libdpv/dprompt.c Wed Jun 20 05:50:54 2018 (r335407) @@ -89,7 +89,7 @@ spin_char(void) { char ch; - if (spin_cp == '\0') + if (*spin_cp == '\0') spin_cp = spin; ch = *spin_cp; Modified: stable/10/lib/libdpv/util.c ============================================================================== --- stable/10/lib/libdpv/util.c Wed Jun 20 05:45:41 2018 (r335406) +++ stable/10/lib/libdpv/util.c Wed Jun 20 05:50:54 2018 (r335407) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2014 Devin Teske + * Copyright (c) 2013-2018 Devin Teske * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -100,8 +100,7 @@ shell_spawn_pipecmd(const char *cmd, const char *label posix_spawn_file_actions_addclose(&action, stdin_pipe[1]); error = posix_spawnp(pid, shellcmd, &action, (const posix_spawnattr_t *)NULL, shellcmd_argv, environ); - if (error != 0) - err(EXIT_FAILURE, "%s: posix_spawnp(3)", __func__); + if (error != 0) err(EXIT_FAILURE, "%s", shellcmd); return stdin_pipe[1]; } From owner-svn-src-all@freebsd.org Wed Jun 20 06:11:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9F1210031DC; Wed, 20 Jun 2018 06:11:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E558698F5; Wed, 20 Jun 2018 06:11:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 55A4B1E792; Wed, 20 Jun 2018 06:11:52 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K6BqLj008281; Wed, 20 Jun 2018 06:11:52 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6Bp4f008276; Wed, 20 Jun 2018 06:11:51 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200611.w5K6Bp4f008276@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 06:11:51 +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: r335408 - in stable/11: lib/libdpv lib/libfigpar usr.bin/dpv usr.sbin/bsdconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: in stable/11: lib/libdpv lib/libfigpar usr.bin/dpv usr.sbin/bsdconfig X-SVN-Commit-Revision: 335408 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:11:53 -0000 Author: dteske Date: Wed Jun 20 06:11:51 2018 New Revision: 335408 URL: https://svnweb.freebsd.org/changeset/base/335408 Log: MFC r330878-r330879, r330939, r330948: Man-page updates r330878: Fix typo and lint/igor warnings r330879: Fix lint/igor warnings r330939: Use full month in dpv(3), figpar(3), and bsdconfig(8) manuals r330948: Bump copyright following recent changes Sponsored by: Smule, Inc. Modified: stable/11/lib/libdpv/dpv.3 stable/11/lib/libfigpar/figpar.3 stable/11/usr.bin/dpv/dpv.1 stable/11/usr.sbin/bsdconfig/bsdconfig.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libdpv/dpv.3 ============================================================================== --- stable/11/lib/libdpv/dpv.3 Wed Jun 20 05:50:54 2018 (r335407) +++ stable/11/lib/libdpv/dpv.3 Wed Jun 20 06:11:51 2018 (r335408) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2016 Devin Teske +.\" Copyright (c) 2013-2018 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 26, 2016 +.Dd March 13, 2018 .Dt DPV 3 .Os .Sh NAME @@ -36,7 +36,8 @@ .In dpv.h .Ft int .Fo dpv -.Fa "struct dpv_config *config, struct dpv_file_node *file_list" +.Fa "struct dpv_config *config" +.Fa "struct dpv_file_node *file_list" .Fc .Ft void .Fo dpv_free @@ -60,8 +61,7 @@ or The .Fn dpv .Fa config -argument contains the following properties for configuring global display -features: +argument properties for configuring global display features: .Bd -literal -offset indent struct dpv_config { uint8_t keep_tite; /* Cleaner exit for scripts */ @@ -113,11 +113,12 @@ member of the .Fn dpv .Fa config argument is a mask of bit fields indicating various processing options. -Possible flags are as follows: +Possible flags are: .Bl -tag -width DPV_NO_OVERRUN .It Dv DPV_TEST_MODE Enable test mode. -In test mode, the +In test mode, +the .Fn action callback of the .Fa config @@ -126,18 +127,21 @@ Appends .Dq [TEST MODE] to the status line .Po -to override, set the +to override, +set the .Va status_format member of the .Fn dpv .Fa config argument; -e.g., to +for example, +to .Dv DPV_STATUS_DEFAULT .Pc . .It Dv DPV_WIDE_MODE Enable wide mode. -In wide mode, the length of the +In wide mode, +the length of the .Va aprompt and .Va pprompt @@ -169,7 +173,8 @@ does not support color environment variable is ignored .Pc . .It Dv DPV_NO_OVERRUN -When enabled, callbacks for the current +When enabled, +callbacks for the current .Vt dpv_file_node are terminated when .Fn action @@ -189,7 +194,7 @@ argument to .Fn dpv is a pointer to a .Dq linked-list , -described as follows in +described in .In dpv.h : .Bd -literal -offset indent struct dpv_file_node { @@ -206,7 +211,8 @@ struct dpv_file_node { For each of the items in the .Fa file_list .Dq linked-list -argument, the +argument, +the .Fn action callback member of the .Fn dpv @@ -214,7 +220,7 @@ callback member of the argument is called. The .Fn action -function should perform a +function performs a .Dq nominal action on the file and return. The return value of @@ -231,7 +237,7 @@ provides a reference to the current .Vt dpv_file_node being processed. .Fa out -provides a file descriptor where the data should go. +provides a file descriptor where the data goes. .Pp If the .Va output @@ -244,7 +250,7 @@ the .Fa out file descriptor of .Fn action -will be zero and should be ignored. +will be zero and can be ignored. If .Fa output was set to DPV_OUTPUT_FILE, @@ -257,14 +263,16 @@ was set to DPV_OUTPUT_SHELL, will be an open file descriptor to a pipe for a spawned shell program. When .Fa out -is greater than zero, you should write any data you have read back to +is greater than zero, +write data that has been read back to .Fa out . .Pp To abort .Fn dpv , either from the .Fn action -callback or asynchronously from a signal handler, two globals are provided via +callback or asynchronously from a signal handler, +two globals are provided via .In dpv.h : .Bd -literal -offset indent extern int dpv_interrupt; /* Set to TRUE in interrupt handler */ @@ -272,11 +280,12 @@ extern int dpv_abort; /* Set to true in callback t .Ed .Pp These globals are not automatically reset and must be manually maintained. -Don't forget to reset these globals before subsequent invocations of +Do not forget to reset these globals before subsequent invocations of .Fn dpv when making multiple calls from the same program. .Pp -In addition, the +In addition, +the .Va status member of the .Fn action @@ -284,7 +293,7 @@ member of the argument can be used to control callbacks for the current file. The .Va status -member can be set to any of the following from +member can be set to any of the below from .In dpv.h : .Bd -literal -offset indent enum dpv_status { @@ -296,13 +305,17 @@ enum dpv_status { .Pp The default .Fa status -is zero, DPV_STATUS_RUNING, which keeps the callbacks coming for the current +is zero, +DPV_STATUS_RUNNING, +which keeps the callbacks coming for the current .Fn file . Setting .Ql file->status to anything other than DPV_STATUS_RUNNING will cause .Fn dpv -to loop to the next file, effecting the next callback, if any. +to loop to the next file, +effecting the next callback, +if any. .Pp The .Fn action @@ -318,7 +331,7 @@ Percentages are reported through the return value of the .Fn action callback. -Throughput statistics are calculated from the following global +Throughput statistics are calculated from the below global .Vt int in .In dpv.h : @@ -326,7 +339,7 @@ in extern int dpv_overall_read; .Ed .Pp -This should be set to the number of bytes that have been read for all files. +Set this to the number of bytes that have been read for all files. Throughput information is displayed in the status line .Pq only available when using Xr dialog 3 at the bottom of the screen. @@ -335,18 +348,20 @@ See DPV_DISPLAY_LIBDIALOG above. Note that .Va dpv_overall_read does not have to represent bytes. -For example, you can change the +For example, +the .Va status_format -to display something other than +can be changed to display something other than .Dq Li bytes and increment .Va dpv_overall_read accordingly -.Pq e.g., counting lines . +.Pq for example, counting lines . .Pp When .Fn dpv -is processing the current file, the +is processing the current file, +the .Va length and .Va read @@ -355,7 +370,8 @@ members of the .Fa file argument are used for calculating the display of mini progress bars .Po -if enabled; see +if enabled; +see .Va pbar_size above .Pc . @@ -381,7 +397,7 @@ function performs on private global variables initialized by .Fn dpv . .Sh ENVIRONMENT -The following environment variables are referenced by +The below environment variables are referenced by .Nm : .Bl -tag -width ".Ev USE_COLOR" .It Ev DIALOG @@ -398,17 +414,20 @@ or .Ql Xdialog .Pq for Dv DPV_DISPLAY_XDIALOG . .It Ev DIALOGRC -If set and non-NULL, path to +If set and non-NULL, +path to .Ql .dialogrc file. .It Ev HOME If .Ql Ev $DIALOGRC -is either not set or NULL, used as a prefix to +is either not set or NULL, +used as a prefix to .Ql .dialogrc -.Pq i.e., Ql $HOME/.dialogrc . +.Pq that is, Ql $HOME/.dialogrc . .It Ev USE_COLOR -If set and NULL, disables the use of color when using +If set and NULL, +disables the use of color when using .Xr dialog 1 .Pq does not apply to Xr Xdialog 1 . .It Ev msg_done Ev msg_fail Ev msg_pending @@ -418,7 +437,8 @@ Internationalization strings for overriding the defaul and .Ql Pending respectively. -To prevent their usage, explicitly set the +To prevent their usage, +explicitly set the .Va msg_done , .Va msg_fail , and @@ -471,11 +491,11 @@ This is a known issue with the .Ql --gauge widget in .Xr Xdialog 1 . -Embed escaped newlines within prompt text(s) to force line breaks. +Embed escaped newlines within prompt text to force line breaks. .Pp .Xr dialog 1 does not display the first character after a series of escaped escape-sequences -(e.g., ``\\\\n'' produces ``\\'' instead of ``\\n''). +(for example, ``\\\\n'' produces ``\\'' instead of ``\\n''). This is a known issue with .Xr dialog 1 and does not affect @@ -483,10 +503,10 @@ and does not affect or .Xr Xdialog 1 . .Pp -If your application ignores +If an application ignores .Ev USE_COLOR when set and NULL before calling -.Xr dpv 3 +.Fn dpv with color escape sequences anyway, .Xr dialog 3 and Modified: stable/11/lib/libfigpar/figpar.3 ============================================================================== --- stable/11/lib/libfigpar/figpar.3 Wed Jun 20 05:50:54 2018 (r335407) +++ stable/11/lib/libfigpar/figpar.3 Wed Jun 20 06:11:51 2018 (r335408) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2013-2015 Devin Teske +.\" Copyright (c) 2013-2018 Devin Teske .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Nov 2, 2015 +.Dd March 13, 2018 .Dt FIGPAR 3 .Os .Sh NAME @@ -38,22 +38,30 @@ .In figpar.h .Ft int .Fo parse_config -.Fa "struct figpar_config options[], const char *path" -.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option, uint32_t line" -.Fa "char *directive, char *value\*[rp], uint8_t processing_options" +.Fa "struct figpar_config options[]" +.Fa "const char *path" +.Fa "int \*[lp]*unknown\*[rp]\*[lp]struct figpar_config *option" +.Fa "uint32_t line" +.Fa "char *directive" +.Fa "char *value\*[rp]" +.Fa "uint8_t processing_options" .Fc .Ft "struct figpar_config *" .Fo get_config_option -.Fa "struct figpar_config options[], const char *directive" +.Fa "struct figpar_config options[]" +.Fa "const char *directive" .Fc .In string_m.h .Ft int .Fo replaceall -.Fa "char *source, const char *find, const char *replace" +.Fa "char *source" +.Fa "const char *find" +.Fa "const char *replace" .Fc .Ft unsigned int .Fo strcount -.Fa "const char *source, const char *find" +.Fa "const char *source" +.Fa "const char *find" .Fc .Ft void .Fo strexpand @@ -70,7 +78,8 @@ .Sh DESCRIPTION The .Nm -library provides a light-weight, portable framework for parsing configuration +library provides a light-weight, +portable framework for parsing configuration files. The library uses .Xr open 2 , @@ -87,8 +96,9 @@ provides raw data to a set of callback functions. These callback functions can in-turn initiate abort through their return value, allowing custom syntax validation during parsing. .Pp -Configuration directives, types, and callback functions are provided through -data structures defined in +Configuration directives, +types, +and callback functions are provided through data structures defined in .In figpar.h : .Bd -literal -offset indent struct figpar_config { @@ -132,7 +142,7 @@ argument to .Fn parse_config is a mask of bit fields which indicate various processing options. -The possible flags are as follows: +The possible flags are: .Bl -tag -width FIGPAR_BREAK_ON_SEMICOLON .It Dv FIGPAR_BREAK_ON_EQUALS An equals sign @@ -151,7 +161,8 @@ Normally directives are matched case insensitively usi .Xr fnmatch 3 . This flag enables directive matching to be case sensitive. .It Dv FIGPAR_REQUIRE_EQUALS -If a directive is not followed by an equals, processing is aborted. +If a directive is not followed by an equals, +processing is aborted. .It Dv FIGPAR_STRICT_EQUALS Equals must be part of the directive to be considered a delimiter between directive and value. @@ -159,7 +170,7 @@ directive and value. .Pp The .Fa options -struct array pointer can be NULL and every directive will invoke the +struct array pointer can be NULL and every directive will run the .Fn unknown function argument. .Pp @@ -168,13 +179,16 @@ The directive for each figpar_config item in the options argument is matched against each parsed directive using .Xr fnmatch 3 until a match is found. -If a match is found, the +If a match is found, +the .Fn action -function for that figpar_config directive is invoked with the line number, -directive, and value. -Otherwise if no match, the +function for that figpar_config directive is run with the line number, +directive, +and value. +Otherwise if no match, +the .Fn unknown -function is invoked +function is run .Pq with the same arguments . .Pp If either @@ -197,19 +211,20 @@ is entirely optional as-is the use of .Fa "enum figpar_cfgtype" or .Fa "union figpar_cfgvalue" . -For example, you could choose to pass a NULL pointer to +For example, +a NULL pointer can be passed to .Fn parse_config -for the first argument and then provide a simple +for the first argument while providing a simple .Fa unknown function based on .Xr queue 3 -that populates a singly-linked list of your own struct containing the +that populates a singly-linked list of a struct containing the .Fa directive and .Fa value . .Pp -In addition, the following miscellaneous string manipulation routines are -provided by +In addition, +miscellaneous string manipulation routines are provided by .In string_m.h : .Bl -tag -width strexpandnl() .It Fn replaceall @@ -224,8 +239,7 @@ Count the number of occurrences of one string that app .Fa source string. Return value is the total count. -An example use would be if you need to know how large a block of memory needs -to be for a +An example use would be to show how large a block of memory needs to be for a .Fn replaceall series. .It Fn strexpand Modified: stable/11/usr.bin/dpv/dpv.1 ============================================================================== --- stable/11/usr.bin/dpv/dpv.1 Wed Jun 20 05:50:54 2018 (r335407) +++ stable/11/usr.bin/dpv/dpv.1 Wed Jun 20 06:11:51 2018 (r335408) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jan 26, 2016 +.Dd January 26, 2016 .Dt DPV 1 .Os .Sh NAME Modified: stable/11/usr.sbin/bsdconfig/bsdconfig.8 ============================================================================== --- stable/11/usr.sbin/bsdconfig/bsdconfig.8 Wed Jun 20 05:50:54 2018 (r335407) +++ stable/11/usr.sbin/bsdconfig/bsdconfig.8 Wed Jun 20 06:11:51 2018 (r335408) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Jun 5, 2013 +.Dd June 5, 2013 .Dt BSDCONFIG 8 .Os .Sh NAME From owner-svn-src-all@freebsd.org Wed Jun 20 06:21:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 822B510038EE; Wed, 20 Jun 2018 06:21:41 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFC3269F66; Wed, 20 Jun 2018 06:21:40 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108161.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5K6Icov016687; Tue, 19 Jun 2018 23:21:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-transfer-encoding : date : message-id; s=PPS1017; bh=adIUtSVMoWiUKm+GvnU3G9lWPb6lZqBcyNG8pfU463w=; b=u8r5rUfpLMRp9fErQHgFEv6A0Bw7rSj29RdXVmU2Ta3sDBuA1Z3EhVtXwQkaKfgkRKiO NSmV7i0ivg1F/Nr6+nU35F4FdslUW+NWqdJynuesmH1fI3FWX7T0h9w/MX2uJU79zsmc l4BQnlvAGB2LkvP74ZMNKGaAnGbzsTMqpgXBhPWH1j2AyqvvsPT5AzbM14PsAsZBzxDD 8nPiqJFk/TzmudYD+QyIs18BlnCLZrYQimYWWmvAfMUDvLFaEwfUUpJzC4RgTpG76hU4 Ww/yUMGDr9kPCEB1ZkLAr0o1mdSo0UufytKh2zWP/iLGHgdfMetFK59+qG686NB16jh2 yQ== Received: from nam02-cy1-obe.outbound.protection.outlook.com (mail-cys01nam02lp0056.outbound.protection.outlook.com [207.46.163.56]) by mx0b-00273201.pphosted.com with ESMTP id 2jqd66g9up-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 19 Jun 2018 23:21:39 -0700 Received: from DM5PR05CA0033.namprd05.prod.outlook.com (2603:10b6:4:39::22) by DM5PR05MB3113.namprd05.prod.outlook.com (2603:10b6:3:c6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.14; Wed, 20 Jun 2018 06:21:38 +0000 Received: from DM3NAM05FT042.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by DM5PR05CA0033.outlook.office365.com (2603:10b6:4:39::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.16 via Frontend Transport; Wed, 20 Jun 2018 06:21:38 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by DM3NAM05FT042.mail.protection.outlook.com (10.152.98.156) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 06:21:37 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Tue, 19 Jun 2018 23:21:14 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5K6LDAU011941; Tue, 19 Jun 2018 23:21:13 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 2A3C76435E; Tue, 19 Jun 2018 23:21:04 -0700 (PDT) To: CC: "Stephen J. Kiernan" , src-committers , , , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> Comments: In-reply-to: Conrad Meyer message dated "Tue, 19 Jun 2018 20:33:30 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Tue, 19 Jun 2018 23:21:04 -0700 Message-ID: <96021.1529475664@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(39380400002)(376002)(39860400002)(346002)(396003)(2980300002)(199004)(189003)(97876018)(8676002)(478600001)(5660300001)(81156014)(81166006)(8746002)(47776003)(50226002)(8936002)(356003)(305945005)(106466001)(53416004)(76506005)(105596002)(2810700001)(2906002)(68736007)(97736004)(50466002)(11346002)(446003)(6916009)(2486003)(23676004)(26005)(77096007)(7126003)(229853002)(486006)(69596002)(476003)(126002)(6266002)(450100002)(6246003)(107886003)(59450400001)(316002)(86362001)(4326008)(54906003)(9686003)(55016002)(7696005)(53936002)(76176011)(2351001)(336012)(117636001)(186003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR05MB3113; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT042; 1:rQtFoOWaBgjwMwvJG7aOv56qeeJLhtapedjfgylrbKNXWSDXrwDQ0JqSs6FI9nMVXnXvhZ8+WCqeYafrw4BHqJBGtZ66SLZ6hdXgeebKe2FjdPFtEPGLHqBMk2W27DMp X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 859790e1-5ed8-4f0c-72e0-08d5d676145f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 3:NI81tSC8hLmKf1lXDc9+Uk1wMM390B1rqzO+HefZ+0zQENMQf2t1Dym1vaWZQUkDL6TVsfFs51K4BFnlyUlKmz3kaOKOwesGClj2MeXTed0oR9rAXHD1ycfatfOMvx7lzBgnokLs2Os7Khdv4PDM1l1Zba/zyjybzcNwSPKHFzPeJDCnoBthlHf9cVpivfh1jsJ1ktLhgOyrKn7+g1DOi59lRTY7A4WtENpyCgfE2RT9Ulw6Pr1ixiEFrEWB6MdC5/X1jn761qTwLl6keJD2/y0xqi82cDX9QXSZ/6LrTD1mgbB9lXcRQlFjTSBwr+YEUzFUvSJ0kFX4PIrO6Oq8AuDTtzLUaLrxvqEfjSquFyo=; 25:Spc3fyT2GbAqayixCXPiJhq9TCTNo43XlN+1xAbqTM9/Iftm11dHi2NYuZ5aVyJFDEyLbRgYsHiANU7Iv85Ysvx5Vzp3HoEb2KMBvgMApj9EsEivPUefkvD1jToEhrbb1rzQlhGwn2FQ6zABMI+cmmC1DWwH1Yy3CuR8cfqioh+4/wcibIp+ixpPQ+IRzgNaFVTIQtzRH11p/0Lm8CvX5m+b3hOaWb6QszBqZdgAvNoKy7MwinUIe6CqgtdxG4a8Wbco7n+xqG9BNE19aBG7E3Yii+Ht2b1IF7KAooqfvZ/VMShX8dh7Z7LUB2Q7XcdGDlP50SPQx0op3a9pD6dNWw== X-MS-TrafficTypeDiagnostic: DM5PR05MB3113: X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 31:NzTHvJ5QKQmm7SlSsVcgZOWAkUTi6uTl5zqwc6Eg5DTq9psjoVgvYhbTvuFu16O9swCs1keJEOeniyb5ckicm+qV1QSpN0T5xBnGVPK29tw78CWfWeyiYCipUYCbFTMkNoufAlIPBNDTe7z6U0Y9s3lioeiNQFwVaTF770ZspiO8pmZo5DwBiDbMG0QXmicVnk8hpSR9OHdWvgnD4ROOCsKeG3TvYFlyNgXdV7Aueq0=; 20:6KJENp5bMqcPvpDKCr8UMGNrNAoVW9L5uDQdKr/EPJN/Tdiyn6VpR1/YaXoGv3iRBdmSLve8hFSM6mcciLyz7rnNY75lXcfQInqnCxyDwYAVOi8uKXeG7OAtt9eI10yP6bCvU7CyK0+AOFzbJFPpwSn1rWY46CrOYcCl9CdpFs21p/E4gnxkn1bflfOrps7XLoLta4eC73sEHW5UovtDeEP2eibZPYuxuwlrFZUCSFfn06M2FqRCnx0oph6hrCdKCIvtSKiBvQaB1QowMBfWQZHf14FGx+FVk0NJC9HvANkqv4f6UQeticx9Xrej4Vq4+bUGbnTz7mMfFU4Ok4PwYpWJfNWAgaTuFovWDcbN/9oFySxAwIALz5vHYke5w5hz/cuO03ArX8yBO0Xd61b8hvSFcB1AfLppJ6LOb0MBHSoz6ZrJ2XF2SDighg29vfrVk+6ouzBwvsoneSXRP5qwzSbKAlfWbTcdwDEUgWS5OpphpWUE8dpAA7AITSUKiCZt X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DM5PR05MB3113; BCL:0; PCL:0; RULEID:; SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 4:s0/1fz5WdvUJeN2DXrDa+HMY/g8L2+bw/cy57cDbwVvQezpEuvJuVJfjID8mLRGlWbrcuFoKkve50M+igvvdbW9dd/FXwsvBFzO05ugmKB3UJISwJLMLamVXN9X+TbyjomO9pgkTokpcmRZgp/btT3qCu1ttkZTZ6l9ujdOkLE7eLqb29u2DVSFcSUvOgeq3CEvd2k8n/hjq7SUeldib1sHc668CZ4M3tayZtFIK3SPyxGaznVpHy1v+qNqgpoM+blJ0MFjylOqdu37G+yP/+s6FXRafKHzSSCpapMOEdU9PURdDz4tS2LWSp/liRMDs X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjA1TUIzMTEzOzIzOmYwV0hFRkpmcWtQWnZFakkrUjZCRWxwTUdp?= =?utf-8?B?dktsM1krWFlwWktoQXBVNEsrOVlSOTZKZGtEUE92Ujg0NS8zQnJxY3Arc1d1?= =?utf-8?B?aXJBbXc5cUxsY2x4OW80NHdqYjdidk9CaEJLdWJSeWp5Vk8wdit2UDdtbkxZ?= =?utf-8?B?dmd0UWNRLzV1NHRtd1N6d2ZrQ1dxaEQvSHZFU3F5azlRSHlJSnl2aTlISjg3?= =?utf-8?B?WEZkbUhCQVc4dmk5eWVqU3k4cTIyNFpGbUxDMUZscS8wdkRvcVp1TDdmVXFU?= =?utf-8?B?NklzS2FMRjF3VEFYeWg5SmZuS2dTNHp4NUkzWHhlczdzaGltV1VORXNYbitH?= =?utf-8?B?WUh4UktyS21DZTNXQlRycGcxV3luRWZzZnNSajFSMmhMRWVpL3NRYmVQdTdG?= =?utf-8?B?ZjlYV1Uyc0VnUkl1WWxqQzhaSGxnNWduQ2VtSVNzMUVCZElCQ25NUTZlZHBx?= =?utf-8?B?QkJQV08xUkkyUFV2MUJML0JxWk1LV3hKVy9ML05nWTR3L2dqdDY3Ry8rYWJ1?= =?utf-8?B?ZzJqVlBkTFZ1eTVOd1V2VFc4bXpNNkErTVA2RFdLNjdlajRIMDZTdTNkQkNw?= =?utf-8?B?U0xoL05veXVQZ1E2TkRnU2NwMDFDckZsVXVzWllNdnV0TGdURmE2SDFaTGI1?= =?utf-8?B?KzRFMjZDRWZXK1QzVFo4NEhrNittMzJLaTdFUVFocG9SaFlzOU5wZjVHSk5T?= =?utf-8?B?OUQyT2hiRWJHeVFIN2xGandFZG4ybUdieDN6MFpWNkl1eVlyS29ULzFvVGRP?= =?utf-8?B?TG5xYUdpUjN3RFFQV2l5aDZsNEdqZGFPdURNK2trQVQzNmZmeDY2aEdhcWV6?= =?utf-8?B?VWRHMG9aaEVrQjQxM1JzaFhMMGt6YWtQYktNSXJkWXovS0VtN1Z5dkU3cHNQ?= =?utf-8?B?UThxMi95dWhoZzlIOWh5aGZHMG5KNkNoR1RKd2ZDMHdtUVZSSUpkd1JoeEtM?= =?utf-8?B?VDl4SVdRY2puQ0RJclJvcDExc2lFempzVGxNMURzelhDSnczQnMrVVNwdEpZ?= =?utf-8?B?Yko3c2t5R3Q4TFdSS2NuUy9xbElTYjNwTXFFMmJIaUJjVUZlQVRJOEVKbVNj?= =?utf-8?B?aVN2ZGU4M0RVeTR3STRyRy80SGxKb0QwT1BYTGxnVVRlYmEzRmxBaEpxYWlu?= =?utf-8?B?TzZDMG43V2E1TTlJWTFHaWpyS0g2V2UwY3FRVUJCTGg4aW5kVGJHcUVEU2dV?= =?utf-8?B?cCtVV2cyZ00rZ2ZTWEJHVnE4RkRTV1g2YzdWWU0xUTZBTlpRdzVDL05IVEk0?= =?utf-8?B?U0N3cm05MGZKR0hPczlJNDZvQXM4SmFudXkyK2dvd0hiNU9CSGRZY2JCS0JJ?= =?utf-8?B?WmRmangwRUowcEhtUUErWWpqWmtkakNla2tXZFpxMkN2WlFoWmsxcDdiOXMx?= =?utf-8?B?THZWSEhFMS9JMkVZUlJDVEUvb0VqZlV2cmFnUXUyRVJmV1VnS0l4a3ovOUJy?= =?utf-8?B?dEh1WnlFbDhOcE5GRjMzSnpZeHBrNVd6L1ZORmxHeGlnUTQ3RnozbGN2c3g5?= =?utf-8?B?Sm01NklNQ1NTVnIycm9va2dBTFVlU2VkZU82Tk5PRXhIdE9uOVBDajJoQld0?= =?utf-8?B?STluQWhFc0NNczV1MmE2TkVZTXpaZzc4VEdYeUNxb2tMdjlNdkttcE5sajhr?= =?utf-8?B?Y3FkUTlYVWp1RUJNdkgrb1BqMjFSampjUkhpclJDK25WMVozOFRhNVJZT3BN?= =?utf-8?B?OWxlbkhsdnJXU0VSZllCakNST0M2dlZ6enhlV1lqYm5DQWRXQ2twUU1iZ2lk?= =?utf-8?B?cnJldjlQazZEV1lDeG82THZRM3I1aDNtcThrTmJPeDMvUzRwRm1OWWMzQ2Ft?= =?utf-8?B?ZWZ1MUZsR3d4NUViVzhRdVI5WHMzbmc4UzkxYXlGS3Q2NmMxTGdBeE9UV2tQ?= =?utf-8?Q?AVMFpnmAjBo=3D?= X-Microsoft-Antispam-Message-Info: yORKhVOlGLM3wpe14sVrbJVu6zP+E8jOpitXIRKX0wjwV1xVSfC/Mto7I0jwJ96H/0nyXU2kg1dMh8e23W2So9ORTHATbCcgezMMUcvXTSsSwCIXB/Ul6OTE93bh1ypQeoUm2DvwGyTcCIXkuvuCzWdHRK2/DBp1AbMVmsuTVg4KDcqtld57IwL3C7tZ1VEMF8E/kbMT+ay3aF00jBKE6cs8g1lP/h3wVG7p7Uu9ubG9Y5uqrj0+GvwqXm6RBi9uP/GTbZA9ipDm+I87a8C+Y2Jnhr0kCYxDKw5rSffKOud6pfTIPZIb5iS9xQJjugGeRtt9Yw6QOSec/XR45MRvCQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 6:WKbxKTJ8eSdUiEM4+5J1r/241CNLU2KNbsGAlcby8a5YziaWHSQTpkGvL9CdPQX8Wj2vG6G6T517K/v/ZYsf/jLfyPxIhAoTuEnqnMhlSK0GWqcwtbcffBKwFCbve3YC40V/efjU9/YzQwo3/aPGsuvfTL8lcMhlV8ucnG7qZDg+7X/EgrG0/hHS72cLEoIHLoooVxAv90W3+T3SgJaOmX9ed4pY5LruwSlejsIgREaHE+pAW9kFVdQ0abqvT0Hq03d06ZFMwUsA2UlPKA3r26qAMQVsoLQ6cuhzZh6KZpcUWDOiTa3FuYKuMW7y5zJ/QaotUX3Of6uN9e23ZQQ+FRyabyVVmiD/zUs+CUtxpYs33cPYGgcqKxsUWRwDH5Cozx/6EdBz9ryp4I/YWS5s90IVO11iGKL3CgUmVft+xpka2qXiwq5P55KWb2HtvdTI4lqpcPFdIxsh3rg/45NB8Q==; 5:g9SBLFiQVtpPFaLvZinmKXBLyXXak74KFILUHqR74cOKuxCfAP1DrQ0PViTx+1iDYWNb0JhRsT9O8wADIIj3vw5QuxzGggANnoA8DZUpW57KZ+IwrgOb4Z+G1YwIwaU38dEiJ+YJ2jrruL6cb7JNVeFD9kTFCWdApzLqEBJSK3k=; 24:ZzAqIrmXSl6oY4I2f2yKks+qItAhZc14GhQAXA+EkZSK5VnW3orffLNc8J2R3oyDvwXglOA5aXNfzO/NpQ7ZqorQKFy7RWBe7Q1BeP0jyzY= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 7:zkwMdbGeFJC8+3hCi6FqK9hmWaebsQsdZOCc+3RCQJFz1gFqnm1ySOZVRiZIgvwBuSyf+UUbtCX2kQX36s7+Ge+DA5rTzP53jbY95/SsznJrxyAHFZnw5oCggPemljTIzJhchJGg3ylWQ0oJF3kEKONdavJrhxVxLrHxu9k4Wus27uKDUh1hh6KW0giS3QWKKpoy+ahtrWd1MSYL6Z1CrdUcMQyJw9k1KqXaxnZER1xzj43VbKqgZcQwKxqvm7JX X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 06:21:37.5952 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 859790e1-5ed8-4f0c-72e0-08d5d676145f X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3113 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_04:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200072 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:21:41 -0000 Conrad Meyer wrote: > First and foremost: nothing is actually signed, anywhere. The The signing of manifests is external. The veriexecctl tool is I assume a straight copy of what's in NetBSD (I've not looked at it in at least a decade). A veriexec loader that leverages signed manifests requires some signing infra. That's a big topic all by itself. As I mentioned in my talk at BSDCan, the signing server we use is open source and handles pretty much anything OpenSSL can, as well as OpenPGP (and others). I also made a point of suggesting that the packages for base system include signed manifests. Tweaking the veriexec loader to only process manifests after verification is not hard - one of the first things I did when pulling veriexec into Junos almost 15 years ago. > As a corollary to the above, the name "signature file" is used > repeatedly in the code, which is misleading. The file contains hashes > (digests), not signatures (MACs). The file itself is unsigned. > Nothing about this has signatures. NetBSD refers to the hashes as fingerprints - AFAIK that terminology is retained. If the term signature is used to refer to anything other than the signed manifests that should be fixed. > There's absolutely no reason to use sha1 or ripemd in new designs. > These should be removed. Sorry I disagree - not with ripem (we never supported that or any of the non-NIST approved hashes), but sha1 is still approved by NIST for firmware integrity checks - which is what this is, and sha1 is cheaper than sha256. As I mentioned in my talk we've included support for sha256 for 10+ years, but do not plan to drop sha1 until NIST deprecate it for that purpose since boot time is a very sensitive subject for us. > The patchset is littered with style issues. One fairly obvious issue > is mixed indentation styles =E2=80=94 some files vary between space and t= ab > indentation from line to line. You can probably blame me for some of that. I only recently found a style9.el that does a half decent job of formatting per style(9). > Please revert this patchset. It's not ready. >=20 > Some suggestions for a second attempt: >=20 > - Maybe use HMACs instead of raw hashes Why? > - Maybe sign the source-of-trust file We do. As noted above, we cannot upstream that until FreeBSD has suitable signing infra. > - Fix the style issues > - Fix the compiler warnings at 6 From owner-svn-src-all@freebsd.org Wed Jun 20 06:24:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 144451003C48; Wed, 20 Jun 2018 06:24:04 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BADDC6A2A4; Wed, 20 Jun 2018 06:24:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9BB641E94B; Wed, 20 Jun 2018 06:24:03 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K6O3wS015063; Wed, 20 Jun 2018 06:24:03 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6O318015062; Wed, 20 Jun 2018 06:24:03 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806200624.w5K6O318015062@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 Jun 2018 06:24: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: r335409 - stable/11/usr.sbin/sysrc X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/sysrc X-SVN-Commit-Revision: 335409 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:24:04 -0000 Author: dteske Date: Wed Jun 20 06:24:03 2018 New Revision: 335409 URL: https://svnweb.freebsd.org/changeset/base/335409 Log: MFC r334303: sysrc(8): Test variable names for invalid characters PR: bin/187461 Reported by: ebay@looksharp.net Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/sysrc/sysrc Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/sysrc/sysrc ============================================================================== --- stable/11/usr.sbin/sysrc/sysrc Wed Jun 20 06:11:51 2018 (r335408) +++ stable/11/usr.sbin/sysrc/sysrc Wed Jun 20 06:24:03 2018 (r335409) @@ -370,6 +370,18 @@ if [ "$LIST_SERVICE_CONFS" ]; then fi # +# Validate arguments +# +for name in "$@"; do + # NB: shell expansion syntax removed first + name="${name%%:[+=-]*}" + name="${name%%[%#+=-]*}" + [ "$name" = "${name#*[!$VALID_VARNAME_CHARS]}" ] || die \ + "%s: %s: name contains characters not allowed in shell" \ + "$pgm" "$name" +done + +# # Process `-s name' argument # if [ "$SERVICE" -a ! "${RC_CONFS+set}" ]; then From owner-svn-src-all@freebsd.org Wed Jun 20 06:34:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 59ED81004360; Wed, 20 Jun 2018 06:34:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A0656A86D; Wed, 20 Jun 2018 06:34:32 +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 DB1E21EAD9; Wed, 20 Jun 2018 06:34:31 +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 w5K6YVv4020399; Wed, 20 Jun 2018 06:34:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6YVcd020398; Wed, 20 Jun 2018 06:34:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200634.w5K6YVcd020398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335410 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335410 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:34:32 -0000 Author: hselasky Date: Wed Jun 20 06:34:31 2018 New Revision: 335410 URL: https://svnweb.freebsd.org/changeset/base/335410 Log: MFC r334481: Add more GFP macro definitions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Wed Jun 20 06:24:03 2018 (r335409) +++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Wed Jun 20 06:34:31 2018 (r335410) @@ -49,6 +49,9 @@ #define __GFP_NORETRY 0 #define __GFP_RECLAIM 0 #define __GFP_RECLAIMABLE 0 +#define __GFP_RETRY_MAYFAIL 0 +#define __GFP_MOVABLE 0 +#define __GFP_COMP 0 #define __GFP_IO 0 #define __GFP_NO_KSWAPD 0 @@ -56,6 +59,7 @@ #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ #define __GFP_BITS_SHIFT 25 #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) +#define __GFP_NOFAIL M_WAITOK #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -68,6 +72,7 @@ #define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) +#define GFP_TRANSHUGE 0 CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); From owner-svn-src-all@freebsd.org Wed Jun 20 06:35:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8758210044D2; Wed, 20 Jun 2018 06:35:38 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38B006A9FB; Wed, 20 Jun 2018 06:35:38 +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 19C121EADA; Wed, 20 Jun 2018 06:35:38 +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 w5K6ZbxZ020514; Wed, 20 Jun 2018 06:35:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6ZbNN020513; Wed, 20 Jun 2018 06:35:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200635.w5K6ZbNN020513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:35:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335411 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 335411 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:35:38 -0000 Author: hselasky Date: Wed Jun 20 06:35:37 2018 New Revision: 335411 URL: https://svnweb.freebsd.org/changeset/base/335411 Log: MFC r334482: Improve high resolution timer support in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/hrtimer.h stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/hrtimer.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/hrtimer.h Wed Jun 20 06:34:31 2018 (r335410) +++ stable/11/sys/compat/linuxkpi/common/include/linux/hrtimer.h Wed Jun 20 06:35:37 2018 (r335411) @@ -37,6 +37,7 @@ enum hrtimer_mode { HRTIMER_MODE_REL, + HRTIMER_MODE_REL_PINNED = HRTIMER_MODE_REL, }; enum hrtimer_restart { @@ -48,31 +49,42 @@ struct hrtimer { enum hrtimer_restart (*function)(struct hrtimer *); struct mtx mtx; struct callout callout; + s64 expires; /* relative time in nanoseconds */ + s64 precision; /* in nanoseconds */ }; #define hrtimer_active(hrtimer) linux_hrtimer_active(hrtimer) #define hrtimer_cancel(hrtimer) linux_hrtimer_cancel(hrtimer) + #define hrtimer_init(hrtimer, clock, mode) do { \ CTASSERT((clock) == CLOCK_MONOTONIC); \ CTASSERT((mode) == HRTIMER_MODE_REL); \ linux_hrtimer_init(hrtimer); \ } while (0) + #define hrtimer_set_expires(hrtimer, time) \ linux_hrtimer_set_expires(hrtimer, time) + #define hrtimer_start(hrtimer, time, mode) do { \ CTASSERT((mode) == HRTIMER_MODE_REL); \ linux_hrtimer_start(hrtimer, time); \ } while (0) + #define hrtimer_start_range_ns(hrtimer, time, prec, mode) do { \ CTASSERT((mode) == HRTIMER_MODE_REL); \ linux_hrtimer_start_range_ns(hrtimer, time, prec); \ } while (0) +#define hrtimer_forward_now(hrtimer, interval) do { \ + linux_hrtimer_forward_now(hrtimer, interval); \ +} while (0) + bool linux_hrtimer_active(struct hrtimer *); int linux_hrtimer_cancel(struct hrtimer *); void linux_hrtimer_init(struct hrtimer *); void linux_hrtimer_set_expires(struct hrtimer *, ktime_t); void linux_hrtimer_start(struct hrtimer *, ktime_t); void linux_hrtimer_start_range_ns(struct hrtimer *, ktime_t, int64_t); +void linux_hrtimer_forward_now(struct hrtimer *, ktime_t); #endif /* _LINUX_HRTIMER_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Wed Jun 20 06:34:31 2018 (r335410) +++ stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Wed Jun 20 06:35:37 2018 (r335411) @@ -45,8 +45,13 @@ hrtimer_call_handler(void *arg) hrtimer = arg; ret = hrtimer->function(hrtimer); - MPASS(ret == HRTIMER_NORESTART); - callout_deactivate(&hrtimer->callout); + + if (ret == HRTIMER_RESTART) { + callout_schedule_sbt(&hrtimer->callout, + nstosbt(hrtimer->expires), nstosbt(hrtimer->precision), 0); + } else { + callout_deactivate(&hrtimer->callout); + } } bool @@ -57,6 +62,7 @@ linux_hrtimer_active(struct hrtimer *hrtimer) mtx_lock(&hrtimer->mtx); ret = callout_active(&hrtimer->callout); mtx_unlock(&hrtimer->mtx); + return (ret); } @@ -75,15 +81,16 @@ void linux_hrtimer_init(struct hrtimer *hrtimer) { - hrtimer->function = NULL; - mtx_init(&hrtimer->mtx, "hrtimer", NULL, MTX_DEF | MTX_RECURSE); + memset(hrtimer, 0, sizeof(*hrtimer)); + mtx_init(&hrtimer->mtx, "hrtimer", NULL, + MTX_DEF | MTX_RECURSE | MTX_NOWITNESS); callout_init_mtx(&hrtimer->callout, &hrtimer->mtx, 0); } void -linux_hrtimer_set_expires(struct hrtimer *hrtimer __unused, - ktime_t time __unused) +linux_hrtimer_set_expires(struct hrtimer *hrtimer, ktime_t time) { + hrtimer->expires = ktime_to_ns(time); } void @@ -94,11 +101,24 @@ linux_hrtimer_start(struct hrtimer *hrtimer, ktime_t t } void -linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, ktime_t time, int64_t nsec) +linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, ktime_t time, + int64_t nsec) { mtx_lock(&hrtimer->mtx); - callout_reset_sbt(&hrtimer->callout, nstosbt(time), nstosbt(nsec), - hrtimer_call_handler, hrtimer, 0); + hrtimer->precision = nsec; + callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(time)), + nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); mtx_unlock(&hrtimer->mtx); } + +void +linux_hrtimer_forward_now(struct hrtimer *hrtimer, ktime_t interval) +{ + + mtx_lock(&hrtimer->mtx); + callout_reset_sbt(&hrtimer->callout, nstosbt(ktime_to_ns(interval)), + nstosbt(hrtimer->precision), hrtimer_call_handler, hrtimer, 0); + mtx_unlock(&hrtimer->mtx); +} + From owner-svn-src-all@freebsd.org Wed Jun 20 06:36:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 94E0310045C0; Wed, 20 Jun 2018 06:36:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A4CC6AB70; Wed, 20 Jun 2018 06:36:26 +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 2B5E21EADB; Wed, 20 Jun 2018 06:36:26 +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 w5K6aQW3020608; Wed, 20 Jun 2018 06:36:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6aPSH020607; Wed, 20 Jun 2018 06:36:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200636.w5K6aPSH020607@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:36: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: r335412 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 335412 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:36:26 -0000 Author: hselasky Date: Wed Jun 20 06:36:25 2018 New Revision: 335412 URL: https://svnweb.freebsd.org/changeset/base/335412 Log: MFC r334483: Implement radix_tree_iter_delete() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Wed Jun 20 06:35:37 2018 (r335411) +++ stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Wed Jun 20 06:36:25 2018 (r335412) @@ -79,5 +79,6 @@ void *radix_tree_lookup(struct radix_tree_root *, unsi void *radix_tree_delete(struct radix_tree_root *, unsigned long); int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); bool radix_tree_iter_find(struct radix_tree_root *, struct radix_tree_iter *, void ***); +void radix_tree_iter_delete(struct radix_tree_root *, struct radix_tree_iter *, void **); #endif /* _LINUX_RADIX_TREE_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_radix.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Wed Jun 20 06:35:37 2018 (r335411) +++ stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Wed Jun 20 06:36:25 2018 (r335412) @@ -162,6 +162,13 @@ out: return (item); } +void +radix_tree_iter_delete(struct radix_tree_root *root, + struct radix_tree_iter *iter, void **slot) +{ + radix_tree_delete(root, iter->index); +} + int radix_tree_insert(struct radix_tree_root *root, unsigned long index, void *item) { From owner-svn-src-all@freebsd.org Wed Jun 20 06:37:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E5E810046B8; Wed, 20 Jun 2018 06:37:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2C1FA6ACE9; Wed, 20 Jun 2018 06:37:16 +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 E8BF31EAE0; Wed, 20 Jun 2018 06:37:15 +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 w5K6bF8B020700; Wed, 20 Jun 2018 06:37:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6bFFV020699; Wed, 20 Jun 2018 06:37:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200637.w5K6bFFV020699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335413 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335413 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:37:16 -0000 Author: hselasky Date: Wed Jun 20 06:37:15 2018 New Revision: 335413 URL: https://svnweb.freebsd.org/changeset/base/335413 Log: MFC r334484: Implement the __sg_alloc_table_from_pages() function based on the existing sg_alloc_table_from_pages() function in the LinuxKPI. This basically allow segments to have a limit, max_segment. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Wed Jun 20 06:36:25 2018 (r335412) +++ stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Wed Jun 20 06:37:15 2018 (r335413) @@ -64,6 +64,8 @@ struct sg_page_iter { } internal; }; +#define SCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1)) + #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) #define SG_MAGIC 0x87654321UL @@ -286,18 +288,26 @@ sg_alloc_table(struct sg_table *table, unsigned int ne } static inline int -sg_alloc_table_from_pages(struct sg_table *sgt, +__sg_alloc_table_from_pages(struct sg_table *sgt, struct page **pages, unsigned int count, unsigned long off, unsigned long size, - gfp_t gfp_mask) + unsigned int max_segment, gfp_t gfp_mask) { - unsigned int i, segs, cur; + unsigned int i, segs, cur, len; int rc; struct scatterlist *s; + if (__predict_false(!max_segment || offset_in_page(max_segment))) + return (-EINVAL); + + len = 0; for (segs = i = 1; i < count; ++i) { - if (page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1) + len += PAGE_SIZE; + if (len >= max_segment || + page_to_pfn(pages[i]) != page_to_pfn(pages[i - 1]) + 1) { ++segs; + len = 0; + } } if (__predict_false((rc = sg_alloc_table(sgt, segs, gfp_mask)))) return (rc); @@ -307,10 +317,13 @@ sg_alloc_table_from_pages(struct sg_table *sgt, unsigned long seg_size; unsigned int j; - for (j = cur + 1; j < count; ++j) - if (page_to_pfn(pages[j]) != + len = 0; + for (j = cur + 1; j < count; ++j) { + len += PAGE_SIZE; + if (len >= max_segment || page_to_pfn(pages[j]) != page_to_pfn(pages[j - 1]) + 1) break; + } seg_size = ((j - cur) << PAGE_SHIFT) - off; sg_set_page(s, pages[cur], min(size, seg_size), off); @@ -321,6 +334,16 @@ sg_alloc_table_from_pages(struct sg_table *sgt, return (0); } +static inline int +sg_alloc_table_from_pages(struct sg_table *sgt, + struct page **pages, unsigned int count, + unsigned long off, unsigned long size, + gfp_t gfp_mask) +{ + + return (__sg_alloc_table_from_pages(sgt, pages, count, off, size, + SCATTERLIST_MAX_SEGMENT, gfp_mask)); +} static inline int sg_nents(struct scatterlist *sg) From owner-svn-src-all@freebsd.org Wed Jun 20 06:38:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 942F710047E4; Wed, 20 Jun 2018 06:38:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 462856AE5A; Wed, 20 Jun 2018 06:38:04 +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 27EA91EAE1; Wed, 20 Jun 2018 06:38:04 +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 w5K6c4na020793; Wed, 20 Jun 2018 06:38:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6c4hn020792; Wed, 20 Jun 2018 06:38:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200638.w5K6c4hn020792@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:38: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: r335414 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335414 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:38:04 -0000 Author: hselasky Date: Wed Jun 20 06:38:03 2018 New Revision: 335414 URL: https://svnweb.freebsd.org/changeset/base/335414 Log: MFC r334658: Implement timer_setup() and from_timer() function macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/timer.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/timer.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/timer.h Wed Jun 20 06:37:15 2018 (r335413) +++ stable/11/sys/compat/linuxkpi/common/include/linux/timer.h Wed Jun 20 06:38:03 2018 (r335414) @@ -39,7 +39,10 @@ struct timer_list { struct callout callout; - void (*function) (unsigned long); + union { + void (*function) (unsigned long); /* < v4.15 */ + void (*function_415) (struct timer_list *); + }; unsigned long data; int expires; }; @@ -47,6 +50,16 @@ struct timer_list { extern unsigned long linux_timer_hz_mask; #define TIMER_IRQSAFE 0x0001 + +#define from_timer(var, arg, field) \ + container_of(arg, typeof(*(var)), field) + +#define timer_setup(timer, func, flags) do { \ + CTASSERT(((flags) & ~TIMER_IRQSAFE) == 0); \ + (timer)->function_415 = (func); \ + (timer)->data = (unsigned long)(timer); \ + callout_init(&(timer)->callout, 1); \ +} while (0) #define setup_timer(timer, func, dat) do { \ (timer)->function = (func); \ From owner-svn-src-all@freebsd.org Wed Jun 20 06:38:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD9E210048D1; Wed, 20 Jun 2018 06:38:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F5FE6AFA2; Wed, 20 Jun 2018 06:38:47 +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 503E11EAE5; Wed, 20 Jun 2018 06:38:47 +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 w5K6clYu020883; Wed, 20 Jun 2018 06:38:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6cle4020882; Wed, 20 Jun 2018 06:38:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200638.w5K6cle4020882@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:38:47 +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: r335415 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335415 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:38:47 -0000 Author: hselasky Date: Wed Jun 20 06:38:46 2018 New Revision: 335415 URL: https://svnweb.freebsd.org/changeset/base/335415 Log: MFC r334659: Implement mul_u32_u32() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Wed Jun 20 06:38:03 2018 (r335414) +++ stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Wed Jun 20 06:38:46 2018 (r335415) @@ -84,4 +84,11 @@ div_u64(uint64_t dividend, uint32_t divisor) return (dividend / divisor); } +static inline uint64_t +mul_u32_u32(uint32_t a, uint32_t b) +{ + + return ((uint64_t)a * b); +} + #endif /* _LINUX_MATH64_H */ From owner-svn-src-all@freebsd.org Wed Jun 20 06:39:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38B1210049C9; Wed, 20 Jun 2018 06:39:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DEAE06B0F6; Wed, 20 Jun 2018 06:39:32 +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 C0EAC1EAE6; Wed, 20 Jun 2018 06:39:32 +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 w5K6dWDV020976; Wed, 20 Jun 2018 06:39:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6dW9n020975; Wed, 20 Jun 2018 06:39:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200639.w5K6dW9n020975@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:39:32 +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: r335416 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335416 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:39:33 -0000 Author: hselasky Date: Wed Jun 20 06:39:32 2018 New Revision: 335416 URL: https://svnweb.freebsd.org/changeset/base/335416 Log: MFC r334660: Add "access" function pointer to the "vm_operations_struct" structure in the LinuxKPI. While at it document when to use the "virtual_address" or the "address" field in the "vm_fault" structure. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Wed Jun 20 06:38:46 2018 (r335415) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Wed Jun 20 06:39:32 2018 (r335416) @@ -120,8 +120,8 @@ struct vm_fault { pgoff_t pgoff; union { /* user-space address */ - void *virtual_address; - unsigned long address; + void *virtual_address; /* < 4.11 */ + unsigned long address; /* >= 4.11 */ }; struct page *page; struct vm_area_struct *vma; @@ -131,6 +131,7 @@ struct vm_operations_struct { void (*open) (struct vm_area_struct *); void (*close) (struct vm_area_struct *); int (*fault) (struct vm_area_struct *, struct vm_fault *); + int (*access) (struct vm_area_struct *, unsigned long, void *, int, int); }; /* From owner-svn-src-all@freebsd.org Wed Jun 20 06:40:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 103F61004A7F; Wed, 20 Jun 2018 06:40:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B65566B245; Wed, 20 Jun 2018 06:40:19 +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 979961EAEA; Wed, 20 Jun 2018 06:40:19 +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 w5K6eJlq021093; Wed, 20 Jun 2018 06:40:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6eJB0021092; Wed, 20 Jun 2018 06:40:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200640.w5K6eJB0021092@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:40:19 +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: r335417 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335417 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:40:20 -0000 Author: hselasky Date: Wed Jun 20 06:40:19 2018 New Revision: 335417 URL: https://svnweb.freebsd.org/changeset/base/335417 Log: MFC r334661: Implement the task_pid_vnr() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Wed Jun 20 06:39:32 2018 (r335416) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Wed Jun 20 06:40:19 2018 (r335417) @@ -89,6 +89,7 @@ struct task_struct { #define task_pid_group_leader(task) (task)->task_thread->td_proc->p_pid #define task_pid(task) ((task)->pid) #define task_pid_nr(task) ((task)->pid) +#define task_pid_vnr(task) ((task)->pid) #define get_pid(x) (x) #define put_pid(x) do { } while (0) #define current_euid() (curthread->td_ucred->cr_uid) From owner-svn-src-all@freebsd.org Wed Jun 20 06:41:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3EF51004B5C; Wed, 20 Jun 2018 06:41:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8EDA6B41D; Wed, 20 Jun 2018 06:41:15 +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 8B8CC1EB22; Wed, 20 Jun 2018 06:41:15 +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 w5K6fF5b021194; Wed, 20 Jun 2018 06:41:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6fFKs021193; Wed, 20 Jun 2018 06:41:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200641.w5K6fFKs021193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:41:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335418 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335418 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:41:16 -0000 Author: hselasky Date: Wed Jun 20 06:41:15 2018 New Revision: 335418 URL: https://svnweb.freebsd.org/changeset/base/335418 Log: MFC r334663: Implement the INIT_DELAYED_WORK_ONSTACK() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Jun 20 06:40:19 2018 (r335417) +++ stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Jun 20 06:41:15 2018 (r335418) @@ -117,6 +117,9 @@ do { \ #define INIT_DELAYED_WORK(dwork, fn) \ linux_init_delayed_work(dwork, fn) +#define INIT_DELAYED_WORK_ONSTACK(dwork, fn) \ + linux_init_delayed_work(dwork, fn) + #define INIT_DEFERRABLE_WORK(dwork, fn) \ INIT_DELAYED_WORK(dwork, fn) From owner-svn-src-all@freebsd.org Wed Jun 20 06:42:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D58E1004D7E; Wed, 20 Jun 2018 06:42:05 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DFE686B6E7; Wed, 20 Jun 2018 06:42:04 +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 A7EE91EC65; Wed, 20 Jun 2018 06:42:04 +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 w5K6g4id025770; Wed, 20 Jun 2018 06:42:04 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6g43G025768; Wed, 20 Jun 2018 06:42:04 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200642.w5K6g43G025768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:42: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: r335419 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 335419 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:42:05 -0000 Author: hselasky Date: Wed Jun 20 06:42:04 2018 New Revision: 335419 URL: https://svnweb.freebsd.org/changeset/base/335419 Log: MFC r334664: Declare and set the global "system_highpri_wq" workqueue structure pointer in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h stable/11/sys/compat/linuxkpi/common/src/linux_work.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Jun 20 06:41:15 2018 (r335418) +++ stable/11/sys/compat/linuxkpi/common/include/linux/workqueue.h Wed Jun 20 06:42:04 2018 (r335419) @@ -214,6 +214,7 @@ do { \ extern struct workqueue_struct *system_wq; extern struct workqueue_struct *system_long_wq; extern struct workqueue_struct *system_unbound_wq; +extern struct workqueue_struct *system_highpri_wq; extern struct workqueue_struct *system_power_efficient_wq; extern void linux_init_delayed_work(struct delayed_work *, work_func_t); Modified: stable/11/sys/compat/linuxkpi/common/src/linux_work.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_work.c Wed Jun 20 06:41:15 2018 (r335418) +++ stable/11/sys/compat/linuxkpi/common/src/linux_work.c Wed Jun 20 06:42:04 2018 (r335419) @@ -55,6 +55,7 @@ static struct workqueue_struct *linux_system_long_wq; struct workqueue_struct *system_wq; struct workqueue_struct *system_long_wq; struct workqueue_struct *system_unbound_wq; +struct workqueue_struct *system_highpri_wq; struct workqueue_struct *system_power_efficient_wq; static int linux_default_wq_cpus = 4; @@ -598,6 +599,7 @@ linux_work_init(void *arg) system_wq = linux_system_short_wq; system_power_efficient_wq = linux_system_short_wq; system_unbound_wq = linux_system_short_wq; + system_highpri_wq = linux_system_short_wq; } SYSINIT(linux_work_init, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_init, NULL); @@ -612,5 +614,6 @@ linux_work_uninit(void *arg) system_wq = NULL; system_power_efficient_wq = NULL; system_unbound_wq = NULL; + system_highpri_wq = NULL; } SYSUNINIT(linux_work_uninit, SI_SUB_TASKQ, SI_ORDER_THIRD, linux_work_uninit, NULL); From owner-svn-src-all@freebsd.org Wed Jun 20 06:42:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CF361004E2C; Wed, 20 Jun 2018 06:42:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C712B6B87A; Wed, 20 Jun 2018 06:42: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 A805A1EC8C; Wed, 20 Jun 2018 06:42: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 w5K6gpGn025858; Wed, 20 Jun 2018 06:42:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6gpOF025857; Wed, 20 Jun 2018 06:42:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200642.w5K6gpOF025857@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:42:51 +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: r335420 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 335420 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:42:52 -0000 Author: hselasky Date: Wed Jun 20 06:42:51 2018 New Revision: 335420 URL: https://svnweb.freebsd.org/changeset/base/335420 Log: MFC r334710: Implement the rdmsrl_safe() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/asm/msr.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/msr.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/msr.h Wed Jun 20 06:42:04 2018 (r335419) +++ stable/11/sys/compat/linuxkpi/common/include/asm/msr.h Wed Jun 20 06:42:51 2018 (r335420) @@ -32,5 +32,6 @@ #include #define rdmsrl(msr, val) ((val) = rdmsr(msr)) +#define rdmsrl_safe(msr, val) rdmsr_safe(msr, val) #endif /* _ASM_MSR_H_ */ From owner-svn-src-all@freebsd.org Wed Jun 20 06:43:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66DF91004F37; Wed, 20 Jun 2018 06:43:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 13DCD6B9D4; Wed, 20 Jun 2018 06:43:42 +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 E96E01EC8D; Wed, 20 Jun 2018 06:43:41 +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 w5K6hfkS025952; Wed, 20 Jun 2018 06:43:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6hfA8025951; Wed, 20 Jun 2018 06:43:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200643.w5K6hfA8025951@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:43:41 +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: r335421 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335421 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:43:42 -0000 Author: hselasky Date: Wed Jun 20 06:43:41 2018 New Revision: 335421 URL: https://svnweb.freebsd.org/changeset/base/335421 Log: MFC r334711: Implement the ktime_compare() and ktime_after() functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:42:51 2018 (r335420) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:43:41 2018 (r335421) @@ -127,6 +127,25 @@ ktime_add(ktime_t lhs, ktime_t rhs) return (lhs + rhs); } +static inline int +ktime_compare(const ktime_t cmp1, const ktime_t cmp2) +{ + + if (cmp1 > cmp2) + return (1); + else if (cmp1 < cmp2) + return (-1); + else + return (0); +} + +static inline bool +ktime_after(const ktime_t cmp1, const ktime_t cmp2) +{ + + return (ktime_compare(cmp1, cmp2) > 0); +} + static inline ktime_t timespec_to_ktime(struct timespec ts) { From owner-svn-src-all@freebsd.org Wed Jun 20 06:46:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 583291005131; Wed, 20 Jun 2018 06:46:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 08EE36BB78; Wed, 20 Jun 2018 06:46:55 +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 D3DC61EC8E; Wed, 20 Jun 2018 06:46:54 +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 w5K6kshf026185; Wed, 20 Jun 2018 06:46:54 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6ksIP026184; Wed, 20 Jun 2018 06:46:54 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200646.w5K6ksIP026184@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:46:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335422 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 335422 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:46:55 -0000 Author: hselasky Date: Wed Jun 20 06:46:54 2018 New Revision: 335422 URL: https://svnweb.freebsd.org/changeset/base/335422 Log: MFC r334712 and r334718: Implement the atomic_dec_if_positive() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 20 06:43:41 2018 (r335421) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Wed Jun 20 06:46:54 2018 (r335422) @@ -235,6 +235,23 @@ atomic_cmpxchg(atomic_t *v, int old, int new) __ret.val; \ }) +static inline int +atomic_dec_if_positive(atomic_t *v) +{ + int retval; + int old; + + old = atomic_read(v); + for (;;) { + retval = old - 1; + if (unlikely(retval < 0)) + break; + if (likely(atomic_fcmpset_int(&v->counter, &old, retval))) + break; + } + return (retval); +} + #define LINUX_ATOMIC_OP(op, c_op) \ static inline void atomic_##op(int i, atomic_t *v) \ { \ From owner-svn-src-all@freebsd.org Wed Jun 20 06:47:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37EC11005205; Wed, 20 Jun 2018 06:47:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E16396BCB6; Wed, 20 Jun 2018 06:47:49 +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 C28281EC8F; Wed, 20 Jun 2018 06:47:49 +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 w5K6lnCF026283; Wed, 20 Jun 2018 06:47:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6lnt4026282; Wed, 20 Jun 2018 06:47:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200647.w5K6lnt4026282@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:47:49 +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: r335423 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 335423 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:47:50 -0000 Author: hselasky Date: Wed Jun 20 06:47:49 2018 New Revision: 335423 URL: https://svnweb.freebsd.org/changeset/base/335423 Log: MFC r334713: Implement the init_wait_entry() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:46:54 2018 (r335422) +++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:47:49 2018 (r335423) @@ -106,8 +106,11 @@ extern wait_queue_func_t default_wake_function; INIT_LIST_HEAD(&(wqh)->task_list); \ } while (0) +void linux_init_wait_entry(wait_queue_t *, int); void linux_wake_up(wait_queue_head_t *, unsigned int, int, bool); +#define init_wait_entry(wq, flags) \ + linux_init_wait_entry(wq, flags) #define wake_up(wqh) \ linux_wake_up(wqh, TASK_NORMAL, 1, false) #define wake_up_all(wqh) \ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Jun 20 06:46:54 2018 (r335422) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Wed Jun 20 06:47:49 2018 (r335423) @@ -188,6 +188,17 @@ default_wake_function(wait_queue_t *wq, unsigned int s } void +linux_init_wait_entry(wait_queue_t *wq, int flags) +{ + + memset(wq, 0, sizeof(*wq)); + wq->flags = flags; + wq->private = current; + wq->func = autoremove_wake_function; + INIT_LIST_HEAD(&wq->task_list); +} + +void linux_wake_up(wait_queue_head_t *wqh, unsigned int state, int nr, bool locked) { wait_queue_t *pos, *next; From owner-svn-src-all@freebsd.org Wed Jun 20 06:48:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C480C100530C; Wed, 20 Jun 2018 06:48:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 796906BE0B; Wed, 20 Jun 2018 06:48:42 +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 5A4BE1EC90; Wed, 20 Jun 2018 06:48:42 +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 w5K6mgJh026379; Wed, 20 Jun 2018 06:48:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6mgcK026378; Wed, 20 Jun 2018 06:48:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200648.w5K6mgcK026378@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:48:42 +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: r335424 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335424 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:48:42 -0000 Author: hselasky Date: Wed Jun 20 06:48:41 2018 New Revision: 335424 URL: https://svnweb.freebsd.org/changeset/base/335424 Log: MFC r334714: Rename two structure field members while keeping backwards compatibility in the LinuxKPI. Add a comment saying in which Linux version this change was made. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:47:49 2018 (r335423) +++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:48:41 2018 (r335424) @@ -63,12 +63,18 @@ struct wait_queue { unsigned int flags; /* always 0 */ void *private; wait_queue_func_t *func; - struct list_head task_list; + union { + struct list_head task_list; /* < v4.13 */ + struct list_head entry; /* >= v4.13 */ + }; }; struct wait_queue_head { spinlock_t lock; - struct list_head task_list; + union { + struct list_head task_list; /* < v4.13 */ + struct list_head head; /* >= v4.13 */ + }; }; /* From owner-svn-src-all@freebsd.org Wed Jun 20 06:49:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B997410053F2; Wed, 20 Jun 2018 06:49:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B00F6BF54; Wed, 20 Jun 2018 06:49:27 +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 4C18C1EC91; Wed, 20 Jun 2018 06:49:27 +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 w5K6nRFP026470; Wed, 20 Jun 2018 06:49:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6nROe026469; Wed, 20 Jun 2018 06:49:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200649.w5K6nROe026469@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335425 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335425 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:49:27 -0000 Author: hselasky Date: Wed Jun 20 06:49:26 2018 New Revision: 335425 URL: https://svnweb.freebsd.org/changeset/base/335425 Log: MFC r334715: Implement the might_sleep_if() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:48:41 2018 (r335424) +++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:49:26 2018 (r335425) @@ -47,6 +47,10 @@ #define might_sleep() \ WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "might_sleep()") +#define might_sleep_if(cond) do { \ + if (cond) { might_sleep(); } \ +} while (0) + struct wait_queue; struct wait_queue_head; From owner-svn-src-all@freebsd.org Wed Jun 20 06:50:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CACD10054DB; Wed, 20 Jun 2018 06:50:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 060C16C16D; Wed, 20 Jun 2018 06:50:13 +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 61DC01ECCE; Wed, 20 Jun 2018 06:50:12 +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 w5K6oBwB026712; Wed, 20 Jun 2018 06:50:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6oBDw026711; Wed, 20 Jun 2018 06:50:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200650.w5K6oBDw026711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:50:11 +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: r335426 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335426 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:50:15 -0000 Author: hselasky Date: Wed Jun 20 06:50:11 2018 New Revision: 335426 URL: https://svnweb.freebsd.org/changeset/base/335426 Log: MFC r334717: Implement the __add_wait_queue_entry_tail() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/wait.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:49:26 2018 (r335425) +++ stable/11/sys/compat/linuxkpi/common/include/linux/wait.h Wed Jun 20 06:50:11 2018 (r335426) @@ -54,7 +54,10 @@ struct wait_queue; struct wait_queue_head; +#define wait_queue_entry wait_queue + typedef struct wait_queue wait_queue_t; +typedef struct wait_queue_entry wait_queue_entry_t; typedef struct wait_queue_head wait_queue_head_t; typedef int wait_queue_func_t(wait_queue_t *, unsigned int, int, void *); @@ -246,6 +249,12 @@ static inline void __add_wait_queue_tail(wait_queue_head_t *wqh, wait_queue_t *wq) { list_add_tail(&wq->task_list, &wqh->task_list); +} + +static inline void +__add_wait_queue_entry_tail(wait_queue_head_t *wqh, wait_queue_entry_t *wq) +{ + list_add_tail(&wq->entry, &wqh->head); } static inline void From owner-svn-src-all@freebsd.org Wed Jun 20 06:50:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D32E6100559B; Wed, 20 Jun 2018 06:50:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 826FD6C3FE; Wed, 20 Jun 2018 06:50:57 +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 6363E1ECF8; Wed, 20 Jun 2018 06:50:57 +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 w5K6ovgV026801; Wed, 20 Jun 2018 06:50:57 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6ov0c026800; Wed, 20 Jun 2018 06:50:57 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200650.w5K6ov0c026800@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:50:57 +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: r335427 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335427 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:50:58 -0000 Author: hselasky Date: Wed Jun 20 06:50:56 2018 New Revision: 335427 URL: https://svnweb.freebsd.org/changeset/base/335427 Log: MFC r334720: Make some list functions RCU safe in the LinuxKPI. While at it rename hlist_add_after() into hlist_add_behind(). Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Wed Jun 20 06:50:11 2018 (r335426) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Wed Jun 20 06:50:56 2018 (r335427) @@ -337,16 +337,16 @@ static inline int hlist_empty(const struct hlist_head *h) { - return !h->first; + return !READ_ONCE(h->first); } static inline void hlist_del(struct hlist_node *n) { - if (n->next) + WRITE_ONCE(*(n->pprev), n->next); + if (n->next != NULL) n->next->pprev = n->pprev; - *n->pprev = n->next; } static inline void @@ -364,9 +364,9 @@ hlist_add_head(struct hlist_node *n, struct hlist_head { n->next = h->first; - if (h->first) + if (h->first != NULL) h->first->pprev = &n->next; - h->first = n; + WRITE_ONCE(h->first, n); n->pprev = &h->first; } @@ -377,18 +377,19 @@ hlist_add_before(struct hlist_node *n, struct hlist_no n->pprev = next->pprev; n->next = next; next->pprev = &n->next; - *(n->pprev) = n; + WRITE_ONCE(*(n->pprev), n); } static inline void -hlist_add_after(struct hlist_node *n, struct hlist_node *next) +hlist_add_behind(struct hlist_node *n, struct hlist_node *prev) { - next->next = n->next; - n->next = next; - next->pprev = &n->next; - if (next->next) - next->next->pprev = &next->next; + n->next = prev->next; + WRITE_ONCE(prev->next, n); + n->pprev = &prev->next; + + if (n->next != NULL) + n->next->pprev = &n->next; } static inline void From owner-svn-src-all@freebsd.org Wed Jun 20 06:51:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5169110057ED; Wed, 20 Jun 2018 06:51:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ECA7C6C5F0; Wed, 20 Jun 2018 06:51:41 +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 CDE021ED2F; Wed, 20 Jun 2018 06:51:41 +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 w5K6pfY5029788; Wed, 20 Jun 2018 06:51:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6pf6O029787; Wed, 20 Jun 2018 06:51:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200651.w5K6pf6O029787@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:51:41 +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: r335428 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335428 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:51:42 -0000 Author: hselasky Date: Wed Jun 20 06:51:41 2018 New Revision: 335428 URL: https://svnweb.freebsd.org/changeset/base/335428 Log: MFC r334774: Implement the dev_pm_set_driver_flags() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/device.h Wed Jun 20 06:50:56 2018 (r335427) +++ stable/11/sys/compat/linuxkpi/common/include/linux/device.h Wed Jun 20 06:51:41 2018 (r335428) @@ -461,6 +461,9 @@ device_destroy(struct class *class, dev_t devt) device_unregister(device_get_softc(bsddev)); } +#define dev_pm_set_driver_flags(dev, flags) do { \ +} while (0) + static inline void linux_class_kfree(struct class *class) { From owner-svn-src-all@freebsd.org Wed Jun 20 06:52:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05AA41005900; Wed, 20 Jun 2018 06:52:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A93846C828; Wed, 20 Jun 2018 06:52:33 +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 8A8BF1EE5D; Wed, 20 Jun 2018 06:52:33 +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 w5K6qXtw031360; Wed, 20 Jun 2018 06:52:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6qXwo031358; Wed, 20 Jun 2018 06:52:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200652.w5K6qXwo031358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:52:33 +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: r335429 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335429 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:52:34 -0000 Author: hselasky Date: Wed Jun 20 06:52:32 2018 New Revision: 335429 URL: https://svnweb.freebsd.org/changeset/base/335429 Log: MFC r334777: Wrap timespec64 into timespec in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h stable/11/sys/compat/linuxkpi/common/include/linux/time.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:51:41 2018 (r335428) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Wed Jun 20 06:52:32 2018 (r335429) @@ -159,6 +159,7 @@ timeval_to_ktime(struct timeval tv) } #define ktime_to_timespec(kt) ns_to_timespec(kt) +#define ktime_to_timespec64(kt) ns_to_timespec(kt) #define ktime_to_timeval(kt) ns_to_timeval(kt) #define ktime_to_ns(kt) (kt) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/time.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/time.h Wed Jun 20 06:51:41 2018 (r335428) +++ stable/11/sys/compat/linuxkpi/common/include/linux/time.h Wed Jun 20 06:52:32 2018 (r335429) @@ -35,6 +35,8 @@ #define USEC_PER_MSEC 1000L #define USEC_PER_SEC 1000000L +#define timespec64 timespec + #include #include From owner-svn-src-all@freebsd.org Wed Jun 20 06:54:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162611005B42; Wed, 20 Jun 2018 06:54:40 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE9F76CA9A; Wed, 20 Jun 2018 06:54:39 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FDC11EE64; Wed, 20 Jun 2018 06:54:39 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K6sdUA031718; Wed, 20 Jun 2018 06:54:39 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6scEs031715; Wed, 20 Jun 2018 06:54:38 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <201806200654.w5K6scEs031715@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 06:54:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335430 - head/sys/security/mac_veriexec X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/sys/security/mac_veriexec X-SVN-Commit-Revision: 335430 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:54:40 -0000 Author: stevek Date: Wed Jun 20 06:54:38 2018 New Revision: 335430 URL: https://svnweb.freebsd.org/changeset/base/335430 Log: Fix build breakage in veriexec for 32-bit architectures. fsid_t and ino_t are 64-bit entities, use uintmax_t typecast to ensure we can print it on 32-bit or 64-bit architectures by using the %ju format for prints. Obtained from: Juniper Networks, Inc. Modified: head/sys/security/mac_veriexec/veriexec_fingerprint.c head/sys/security/mac_veriexec/veriexec_metadata.c Modified: head/sys/security/mac_veriexec/veriexec_fingerprint.c ============================================================================== --- head/sys/security/mac_veriexec/veriexec_fingerprint.c Wed Jun 20 06:52:32 2018 (r335429) +++ head/sys/security/mac_veriexec/veriexec_fingerprint.c Wed Jun 20 06:54:38 2018 (r335430) @@ -108,11 +108,12 @@ identify_error (struct image_params *imgp, struct thre gppid = (parent != NULL && parent->p_pptr != NULL) ? parent->p_pptr->p_pid : 0; - log(LOG_ERR, MAC_VERIEXEC_FULLNAME ": %s (file=%s fsid=%lu fileid=%lu " + log(LOG_ERR, MAC_VERIEXEC_FULLNAME ": %s (file=%s fsid=%ju fileid=%ju " "gen=%lu uid=%u pid=%u ppid=%u gppid=%u)", msg, (imgp->args != NULL) ? imgp->args->fname : "", - imgp->attr->va_fsid, imgp->attr->va_fileid, imgp->attr->va_gen, - td->td_ucred->cr_ruid, imgp->proc->p_pid, ppid, gppid); + (uintmax_t)imgp->attr->va_fsid, (uintmax_t)imgp->attr->va_fileid, + imgp->attr->va_gen, td->td_ucred->cr_ruid, imgp->proc->p_pid, + ppid, gppid); } /** @@ -217,8 +218,9 @@ mac_veriexec_fingerprint_check_vnode(struct vnode *vp, return (ETXTBSY); if ((vp->v_mount->mnt_flag & MNT_VERIFIED) != 0) { - VERIEXEC_DEBUG(2, ("file %lu.%lu on verified %s mount\n", - ip->fileid, ip->gen, vp->v_mount->mnt_vfc->vfc_name)); + VERIEXEC_DEBUG(2, ("file %ju.%lu on verified %s mount\n", + (uintmax_t)ip->fileid, ip->gen, + vp->v_mount->mnt_vfc->vfc_name)); /* * The VFS is backed by a file which has been verified. Modified: head/sys/security/mac_veriexec/veriexec_metadata.c ============================================================================== --- head/sys/security/mac_veriexec/veriexec_metadata.c Wed Jun 20 06:52:32 2018 (r335429) +++ head/sys/security/mac_veriexec/veriexec_metadata.c Wed Jun 20 06:54:38 2018 (r335430) @@ -110,8 +110,8 @@ get_veriexec_file(struct veriexec_devhead *head, dev_t if (found_dev != NULL) *found_dev = 0; - VERIEXEC_DEBUG(3, ("searching for file %lu.%lu on device %lu," - " files=%d\n", fileid, gen, (unsigned long)fsid, + VERIEXEC_DEBUG(3, ("searching for file %ju.%lu on device %ju," + " files=%d\n", (uintmax_t)fileid, gen, (uintmax_t)fsid, (head == &veriexec_file_dev_head))); /* Get a lock to access the list */ @@ -124,8 +124,8 @@ get_veriexec_file(struct veriexec_devhead *head, dev_t /* We found the file system in the list */ if (lp != NULL) { - VERIEXEC_DEBUG(3, ("found matching dev number %lu\n", - lp->fsid)); + VERIEXEC_DEBUG(3, ("found matching dev number %ju\n", + (uintmax_t)lp->fsid)); /* If found_dev is non-NULL, store true there */ if (found_dev != NULL) @@ -182,8 +182,8 @@ find_veriexec_file(dev_t fsid, long fileid, unsigned l } search[2] = NULL; - VERIEXEC_DEBUG(3, ("%s: searching for dev %lu, file %lu\n", - __func__, fsid, fileid)); + VERIEXEC_DEBUG(3, ("%s: searching for dev %ju, file %lu\n", + __func__, (uintmax_t)fsid, fileid)); /* Search for the specified file */ for (ip = NULL, x = 0; ip == NULL && search[x]; x++) @@ -226,7 +226,7 @@ mac_veriexec_print_db_head(struct sbuf *sbp, struct ve struct veriexec_dev_list *lp; for (lp = LIST_FIRST(head); lp != NULL; lp = LIST_NEXT(lp, entries)) { - sbuf_printf(sbp, " FS id: %lu\n", lp->fsid); + sbuf_printf(sbp, " FS id: %ju\n", (uintmax_t)lp->fsid); mac_veriexec_print_db_dev_list(sbp, lp); } @@ -524,9 +524,9 @@ mac_veriexec_metadata_fetch_fingerprint_status(struct status = (found_dev) ? FINGERPRINT_NOENTRY : FINGERPRINT_NODEV; VERIEXEC_DEBUG(3, - ("fingerprint status is %d for dev %lu, file " - "%lu.%lu\n", status, vap->va_fsid, vap->va_fileid, - vap->va_gen)); + ("fingerprint status is %d for dev %ju, file " + "%ju.%lu\n", status, (uintmax_t)vap->va_fsid, + (uintmax_t)vap->va_fileid, vap->va_gen)); } else { /* * evaluate and compare fingerprint @@ -543,13 +543,13 @@ mac_veriexec_metadata_fetch_fingerprint_status(struct else status = FINGERPRINT_VALID; VERIEXEC_DEBUG(2, - ("%sfingerprint matches for dev %lu, file " - "%lu.%lu\n", + ("%sfingerprint matches for dev %ju, file " + "%ju.%lu\n", (status == FINGERPRINT_INDIRECT) ? "indirect " : (status == FINGERPRINT_FILE) ? - "file " : "", vap->va_fsid, - vap->va_fileid, vap->va_gen)); + "file " : "", (uintmax_t)vap->va_fsid, + (uintmax_t)vap->va_fileid, vap->va_gen)); break; case EAUTH: @@ -567,9 +567,11 @@ mac_veriexec_metadata_fetch_fingerprint_status(struct digest[i]); } log(LOG_ERR, MAC_VERIEXEC_FULLNAME - ": fingerprint for dev %lu, file " - "%lu.%lu %s != %s\n", vap->va_fsid, - vap->va_fileid, vap->va_gen, + ": fingerprint for dev %ju, file " + "%ju.%lu %s != %s\n", + (uintmax_t)vap->va_fsid, + (uintmax_t)vap->va_fileid, + vap->va_gen, have, want); } #endif @@ -696,7 +698,8 @@ search: ip->gen = gen; memcpy(ip->fingerprint, fingerprint, fpops->digest_len); - VERIEXEC_DEBUG(3, ("add file %lu.%lu (files=%d)\n", ip->fileid, + VERIEXEC_DEBUG(3, ("add file %ju.%lu (files=%d)\n", + (uintmax_t)ip->fileid, ip->gen, file_dev)); /* Add the entry to the list */ From owner-svn-src-all@freebsd.org Wed Jun 20 06:56:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39AB21005C82; Wed, 20 Jun 2018 06:56:19 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D89726CC11; Wed, 20 Jun 2018 06:56:18 +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 B9CEE1EE65; Wed, 20 Jun 2018 06:56:18 +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 w5K6uI3Z031872; Wed, 20 Jun 2018 06:56:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6uIVD031871; Wed, 20 Jun 2018 06:56:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200656.w5K6uIVD031871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:56: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: r335431 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335431 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:56:19 -0000 Author: hselasky Date: Wed Jun 20 06:56:18 2018 New Revision: 335431 URL: https://svnweb.freebsd.org/changeset/base/335431 Log: MFC r334778: Define ARCH_KMALLOC_MINALIGN in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jun 20 06:54:38 2018 (r335430) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Wed Jun 20 06:56:18 2018 (r335431) @@ -85,6 +85,9 @@ struct linux_kmem_cache { #define SLAB_DESTROY_BY_RCU \ SLAB_TYPESAFE_BY_RCU +#define ARCH_KMALLOC_MINALIGN \ + __alignof(unsigned long long) + static inline gfp_t linux_check_m_flags(gfp_t flags) { From owner-svn-src-all@freebsd.org Wed Jun 20 06:57:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E9671005D61; Wed, 20 Jun 2018 06:57:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E45EE6CD58; Wed, 20 Jun 2018 06:57:14 +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 C6F251EE66; Wed, 20 Jun 2018 06:57:14 +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 w5K6vERw031969; Wed, 20 Jun 2018 06:57:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6vE9G031968; Wed, 20 Jun 2018 06:57:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200657.w5K6vE9G031968@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:57:14 +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: r335432 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 335432 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:57:15 -0000 Author: hselasky Date: Wed Jun 20 06:57:14 2018 New Revision: 335432 URL: https://svnweb.freebsd.org/changeset/base/335432 Log: MFC r334953: Implement the user_access_begin(), user_access_end(), usafe_get_user() and unsafe_put_user() function macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed Jun 20 06:56:18 2018 (r335431) +++ stable/11/sys/compat/linuxkpi/common/include/asm/uaccess.h Wed Jun 20 06:57:14 2018 (r335432) @@ -52,4 +52,17 @@ copy_from_user(void *to, const void *from, unsigned lo #define __copy_from_user(...) copy_from_user(__VA_ARGS__) #define __copy_in_user(...) copy_from_user(__VA_ARGS__) +#define user_access_begin() do { } while (0) +#define user_access_end() do { } while (0) + +#define unsafe_get_user(x, ptr, err) do { \ + if (unlikely(__get_user(x, ptr))) \ + goto err; \ +} while (0) + +#define unsafe_put_user(x, ptr, err) do { \ + if (unlikely(__put_user(x, ptr))) \ + goto err; \ +} while (0) + #endif /* _ASM_UACCESS_H_ */ From owner-svn-src-all@freebsd.org Wed Jun 20 06:58:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9F4EC1005E25; Wed, 20 Jun 2018 06:58:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 508D06CE96; Wed, 20 Jun 2018 06:58:00 +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 321211EE67; Wed, 20 Jun 2018 06:58:00 +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 w5K6vx3A032056; Wed, 20 Jun 2018 06:57:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6vxe2032055; Wed, 20 Jun 2018 06:57:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200657.w5K6vxe2032055@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:57: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: r335433 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335433 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:58:00 -0000 Author: hselasky Date: Wed Jun 20 06:57:59 2018 New Revision: 335433 URL: https://svnweb.freebsd.org/changeset/base/335433 Log: MFC r334958: Implement the kstrtobool() and kstrtobool_from_user() functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Wed Jun 20 06:57:14 2018 (r335432) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Wed Jun 20 06:57:59 2018 (r335433) @@ -50,7 +50,9 @@ #include #include #include + #include +#include #include @@ -370,6 +372,46 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) if (temp != (u32)temp) return (-ERANGE); return (0); +} + +static inline int +kstrtobool(const char *s, bool *res) +{ + int len; + + if (s == NULL || (len = strlen(s)) == 0 || res == NULL) + return (-EINVAL); + + /* skip newline character, if any */ + if (s[len - 1] == '\n') + len--; + + if (len == 1 && strchr("yY1", s[0]) != NULL) + *res = true; + else if (len == 1 && strchr("nN0", s[0]) != NULL) + *res = false; + else if (strncasecmp("on", s, len) == 0) + *res = true; + else if (strncasecmp("off", s, len) == 0) + *res = false; + else + return (-EINVAL); + + return (0); +} + +static inline int +kstrtobool_from_user(const char __user *s, size_t count, bool *res) +{ + char buf[8] = {}; + + if (count > (sizeof(buf) - 1)) + count = (sizeof(buf) - 1); + + if (copy_from_user(buf, s, count)) + return (-EFAULT); + + return (kstrtobool(buf, res)); } #define min(x, y) ((x) < (y) ? (x) : (y)) From owner-svn-src-all@freebsd.org Wed Jun 20 06:58:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A9201005F83; Wed, 20 Jun 2018 06:58:52 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AD406D007; Wed, 20 Jun 2018 06:58:52 +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 E0BF81EE68; Wed, 20 Jun 2018 06:58: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 w5K6wplu032149; Wed, 20 Jun 2018 06:58:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6wpH0032148; Wed, 20 Jun 2018 06:58:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200658.w5K6wpH0032148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:58:51 +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: r335434 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335434 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:58:52 -0000 Author: hselasky Date: Wed Jun 20 06:58:51 2018 New Revision: 335434 URL: https://svnweb.freebsd.org/changeset/base/335434 Log: MFC r334662: Define the __kernel_size_t type in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/types.h Wed Jun 20 06:57:59 2018 (r335433) +++ stable/11/sys/compat/linuxkpi/common/include/linux/types.h Wed Jun 20 06:58:51 2018 (r335434) @@ -62,6 +62,8 @@ typedef unsigned long pgoff_t; typedef u64 phys_addr_t; +typedef size_t __kernel_size_t; + #define DECLARE_BITMAP(n, bits) \ unsigned long n[howmany(bits, sizeof(long) * 8)] From owner-svn-src-all@freebsd.org Wed Jun 20 06:59:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DBA810060C5; Wed, 20 Jun 2018 06:59:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BC0E66D164; Wed, 20 Jun 2018 06:59:40 +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 9D4311EE69; Wed, 20 Jun 2018 06:59:40 +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 w5K6xegV032241; Wed, 20 Jun 2018 06:59:40 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K6xexT032239; Wed, 20 Jun 2018 06:59:40 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200659.w5K6xexT032239@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 06:59:40 +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: r335435 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 335435 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 06:59:41 -0000 Author: hselasky Date: Wed Jun 20 06:59:39 2018 New Revision: 335435 URL: https://svnweb.freebsd.org/changeset/base/335435 Log: MFC r334775: Move the EXPORT_SYMBOL_XXX() function macros into own header file. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Added: stable/11/sys/compat/linuxkpi/common/include/linux/export.h - copied unchanged from r334775, head/sys/compat/linuxkpi/common/include/linux/export.h Modified: stable/11/sys/compat/linuxkpi/common/include/linux/module.h Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/compat/linuxkpi/common/include/linux/export.h (from r334775, head/sys/compat/linuxkpi/common/include/linux/export.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/export.h Wed Jun 20 06:59:39 2018 (r335435, copy of r334775, head/sys/compat/linuxkpi/common/include/linux/export.h) @@ -0,0 +1,33 @@ +/*- + * Copyright (c) 2018 Johannes Lundberg + * + * 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 unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ +#ifndef _LINUX_EXPORT_H +#define _LINUX_EXPORT_H + +#define EXPORT_SYMBOL(name) +#define EXPORT_SYMBOL_GPL(name) + +#endif Modified: stable/11/sys/compat/linuxkpi/common/include/linux/module.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Jun 20 06:58:51 2018 (r335434) +++ stable/11/sys/compat/linuxkpi/common/include/linux/module.h Wed Jun 20 06:59:39 2018 (r335435) @@ -42,6 +42,7 @@ #include #include #include +#include #define MODULE_AUTHOR(name) #define MODULE_DESCRIPTION(name) @@ -51,8 +52,6 @@ #define THIS_MODULE ((struct module *)0) -#define EXPORT_SYMBOL(name) -#define EXPORT_SYMBOL_GPL(name) #define __MODULE_STRING(x) __stringify(x) /* OFED pre-module initialization */ From owner-svn-src-all@freebsd.org Wed Jun 20 07:02:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 194511006414; Wed, 20 Jun 2018 07:02:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B93106D531; Wed, 20 Jun 2018 07:02:19 +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 9AF771EFE2; Wed, 20 Jun 2018 07:02:19 +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 w5K72Jj0037049; Wed, 20 Jun 2018 07:02:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K72JV5037048; Wed, 20 Jun 2018 07:02:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806200702.w5K72JV5037048@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 07:02:19 +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: r335436 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 335436 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 07:02:20 -0000 Author: hselasky Date: Wed Jun 20 07:02:19 2018 New Revision: 335436 URL: https://svnweb.freebsd.org/changeset/base/335436 Log: Bump the __FreeBSD_version after recent LinuxKPI updates to force recompilation of external kernel modules. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Wed Jun 20 06:59:39 2018 (r335435) +++ stable/11/sys/sys/param.h Wed Jun 20 07:02:19 2018 (r335436) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1102500 /* Master, propagated to newvers */ +#define __FreeBSD_version 1102501 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-all@freebsd.org Wed Jun 20 08:34:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8306B100AFDC; Wed, 20 Jun 2018 08:34:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3135970791; Wed, 20 Jun 2018 08:34:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0E9011FE2D; Wed, 20 Jun 2018 08:34:30 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5K8YTS3082991; Wed, 20 Jun 2018 08:34:29 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5K8YThd082989; Wed, 20 Jun 2018 08:34:29 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201806200834.w5K8YThd082989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 20 Jun 2018 08:34:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335437 - in head: share/man/man4 sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head: share/man/man4 sys/kern X-SVN-Commit-Revision: 335437 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 08:34:30 -0000 Author: bz Date: Wed Jun 20 08:34:29 2018 New Revision: 335437 URL: https://svnweb.freebsd.org/changeset/base/335437 Log: Sometimes it is helpful to get the path for a vnode. Implement a ddb function walking the namecache to do this. Reviewed by: jhb, mjg Inspired by: gdb macro from jhb (old version) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D14898 Modified: head/share/man/man4/ddb.4 head/sys/kern/vfs_cache.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Wed Jun 20 07:02:19 2018 (r335436) +++ head/share/man/man4/ddb.4 Wed Jun 20 08:34:29 2018 (r335437) @@ -60,7 +60,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 24, 2017 +.Dd June 20, 2018 .Dt DDB 4 .Os .Sh NAME @@ -1121,6 +1121,11 @@ header file. .Pp .It Ic show Cm vnodebufs Ar addr Shows clean/dirty buffer lists of the vnode located at +.Ar addr . +.\" +.Pp +.It Ic show Cm vpath Ar addr +Walk the namecache to lookup the pathname of the vnode located at .Ar addr . .\" .Pp Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Wed Jun 20 07:02:19 2018 (r335436) +++ head/sys/kern/vfs_cache.c Wed Jun 20 08:34:29 2018 (r335437) @@ -37,6 +37,7 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" #include "opt_ktrace.h" #include @@ -62,6 +63,10 @@ __FBSDID("$FreeBSD$"); #include #endif +#ifdef DDB +#include +#endif + #include SDT_PROVIDER_DECLARE(vfs); @@ -2529,3 +2534,54 @@ out: free(fbuf, M_TEMP); return (error); } + +#ifdef DDB +static void +db_print_vpath(struct vnode *vp) +{ + + while (vp != NULL) { + db_printf("%p: ", vp); + if (vp == rootvnode) { + db_printf("/"); + vp = NULL; + } else { + if (vp->v_vflag & VV_ROOT) { + db_printf(""); + vp = vp->v_mount->mnt_vnodecovered; + } else { + struct namecache *ncp; + char *ncn; + int i; + + ncp = TAILQ_FIRST(&vp->v_cache_dst); + if (ncp != NULL) { + ncn = ncp->nc_name; + for (i = 0; i < ncp->nc_nlen; i++) + db_printf("%c", *ncn++); + vp = ncp->nc_dvp; + } else { + vp = NULL; + } + } + } + db_printf("\n"); + } + + return; +} + +DB_SHOW_COMMAND(vpath, db_show_vpath) +{ + struct vnode *vp; + + if (!have_addr) { + db_printf("usage: show vpath \n"); + return; + } + + vp = (struct vnode *)addr; + db_print_vpath(vp); +} + +#endif From owner-svn-src-all@freebsd.org Wed Jun 20 09:22:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 17B46100D8B0; Wed, 20 Jun 2018 09:22:54 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 956ED729D2; Wed, 20 Jun 2018 09:22:53 +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 ESMTP id w5K9McSa026699; Wed, 20 Jun 2018 12:22:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5K9McSa026699 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5K9McfK026698; Wed, 20 Jun 2018 12:22:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Jun 2018 12:22:38 +0300 From: Konstantin Belousov To: Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot Message-ID: <20180620092238.GK2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 09:22:54 -0000 On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > On 2018-06-17 07:32, Eugene Grosbein wrote: > > 17.06.2018 10:18, Allan Jude wrote: > > > >> Author: allanjude > >> Date: Sun Jun 17 03:18:56 2018 > >> New Revision: 335276 > >> URL: https://svnweb.freebsd.org/changeset/base/335276 > >> > >> Log: > >> gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early > >> > >> Normally the serial console is not enabled until /boot.config is read and > >> we know how the serial console should be configured. Initialize the > >> consoles early in 'dual' mode (serial & keyboard) with a default serial > >> rate of 115200. Then serial is re-initialized once the disk is decrypted > >> and the /boot.config file can be read. > >> > >> This allows the GELIBoot passphrase to be provided via the serial console. > >> > >> PR: 221526 > >> Requested by: many > >> Reviewed by: imp > >> Sponsored by: Klara Systems > >> Differential Revision: https://reviews.freebsd.org/D15862 > > > > I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports > > hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing > > missing serial ports. I even could reproduce that with VirtualBox machine configured > > with no serial ports (not same as existing bug inactive serial port). > > > > Should there be some way to disable this serial ports configuration at compile time? > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > one by default, because it is safer. Then you can just use > 'gptboot-serial' if you want serial support. > > This will likely make Warner a bit sad, since we are just finally > getting around to reducing the number of different bootcode files. I think we should follow the hardware trends there and apply a policy where new features are not added to the CSM boot. All modern machines can be booted in UEFI mode, and if some modern machine cannot, then we need it fixed. We should encourage users to make new installs boot by UEFI. The feature from the commit is only relevant for machines that require CSM boot or do not have UEFI option at all, am I right ? With the policy applied, an additional CSM-boot bootblock would be not shipped. From owner-svn-src-all@freebsd.org Wed Jun 20 09:27:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24EA7100DB93; Wed, 20 Jun 2018 09:27:48 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: from mail-ot0-x241.google.com (mail-ot0-x241.google.com [IPv6:2607:f8b0:4003:c0f::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB05672BEC; Wed, 20 Jun 2018 09:27:47 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: by mail-ot0-x241.google.com with SMTP id p95-v6so2966801ota.5; Wed, 20 Jun 2018 02:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VcoSmBC4x8/2E8zfmfSguD8MRvEpJF8gxvN/zXItAJ0=; b=QxvZwomEhnlMvHItL7+ktMimtE/TekqvND/Xz8I0HT10C3dCXUWy+YO0YCqh8aR2rY wRT+njrkBy7XKOlTITLFxuDps5Y64Oy0+xo5SwQlxtQIe0w24+vMjKbnKFSVr1TcBMWm yVT1czxIfzAdR4B0s7xBvlO6lMynT0/0tbxEkiyNdopMfJ2Gt6aP72asAZX0PRooJWCC l1OBqaS0CokqzUfs4EaO4+T0qPuI/D5pvykYN+urDobgO2nEbY/VINZ8Ud+wCpEe7YUb 35RaJ06pBYQnVWbGe9VwIDbsf9giwFOpFQPvBJvXA+jUlRRI0hgHRChjkpx/lSxNdkBg Fgdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=VcoSmBC4x8/2E8zfmfSguD8MRvEpJF8gxvN/zXItAJ0=; b=KX8wBAYevbRxCCNjp463fy92Xqh70gcUEOgRBtSeAG7AlwmD5MjKYqwrgLoh0oY//s hwb3yxiwavQpTLLpJ5wJdvk26VCIn1X5X2JTqVLZtSEPY8Sj1M01xnSHcW//Ep7X1NJk KHAe8QNGvVz2dOAQsTf3Nmp0PWprodQw/QUYxzAcNSNBl4xVJIbnmN630Q+r3T5/IIMs ZFfokLlMfXx5Od136y8p0BCdJcwG8EpBDCtMWwqQV2VT4Vaj6ZPQG3I9kYlf0jT7mzs4 QwiKnXtERklmg8ZJhcElTAOkn1nJ1h2SMXb5Iyzn4r1T1Eh+n6f0WFroD8YuBO/fKocE EbRg== X-Gm-Message-State: APt69E3B46Cb4Bx8X5OapiEk/L0xMUwIox+/gM1Jg71gXS+W0JF8W3fp d0m1utPSyj+vn13pTatTScVnthl3wIxdAuSeFXc= X-Google-Smtp-Source: ADUXVKIZBvX5KRwMetewl74tLeQpBpEpzVLt8setQ1DLsSyBgMwQz9E8hxIE+D71GFqbn9vqh2p65z2z/UZ7nBLChi0= X-Received: by 2002:a9d:2106:: with SMTP id i6-v6mr11637472otb.222.1529486867109; Wed, 20 Jun 2018 02:27:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1918:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 02:27:46 -0700 (PDT) In-Reply-To: <96021.1529475664@kaos.jnpr.net> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> From: Stephen Kiernan Date: Wed, 20 Jun 2018 02:27:46 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Simon J. Gerraty" Cc: cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 09:27:48 -0000 On Tue, Jun 19, 2018 at 11:21 PM, Simon J. Gerraty wrote: > Conrad Meyer wrote: > > > As a corollary to the above, the name "signature file" is used > > repeatedly in the code, which is misleading. The file contains hashes > > (digests), not signatures (MACs). The file itself is unsigned. > > Nothing about this has signatures. > I think you mean "signature". I belive the only place that says "signature file" is the veriexecctl. And that was in the original sources from NetBSD. For example, see the currentl veriexecctl in NetBSD and it still uses the terminology "signature file". http://cvsweb.netbsd.org/bsdweb.cgi/src/sbin/veriexecctl/veriexecctl.c?rev=1.40 But yes, I agree that it's the wrong term that they're using there. > NetBSD refers to the hashes as fingerprints - AFAIK that terminology is > retained. > > If the term signature is used to refer to anything other than the signed > manifests that should be fixed. > That was in the veriexec that was the basis for the MAC conversion. I know I had corrected some before, but probably missed the fact that it was used in some other places. Easy to happen when you've seen the same code for a number of years. From owner-svn-src-all@freebsd.org Wed Jun 20 10:02:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4B8100F755; Wed, 20 Jun 2018 10:02:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FD377414B; Wed, 20 Jun 2018 10:02:51 +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 F040320CD8; Wed, 20 Jun 2018 10:02:50 +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 w5KA2oST029152; Wed, 20 Jun 2018 10:02:50 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KA2oI0029151; Wed, 20 Jun 2018 10:02:50 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806201002.w5KA2oI0029151@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Jun 2018 10:02:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335438 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335438 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 10:02:51 -0000 Author: andrew Date: Wed Jun 20 10:02:50 2018 New Revision: 335438 URL: https://svnweb.freebsd.org/changeset/base/335438 Log: Fix the SMCCC signatures, they are all 32-bit calls. This fixes SMCCC version detection. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/smccc.h Modified: head/sys/dev/psci/smccc.h ============================================================================== --- head/sys/dev/psci/smccc.h Wed Jun 20 08:34:29 2018 (r335437) +++ head/sys/dev/psci/smccc.h Wed Jun 20 10:02:50 2018 (r335438) @@ -54,11 +54,11 @@ * These are documented in the document ARM DEN 0070A. */ #define SMCCC_VERSION \ - SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0) + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_32BIT_CALL, 0, 0) #define SMCCC_ARCH_FEATURES \ - SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 1) + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_32BIT_CALL, 0, 1) #define SMCCC_ARCH_WORKAROUND_1 \ - SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_64BIT_CALL, 0, 0x8000) + SMCCC_FUNC_ID(SMCCC_FAST_CALL, SMCCC_32BIT_CALL, 0, 0x8000) /* The return values from ARM DEN 0070A. */ #define SMCCC_RET_SUCCESS 0 From owner-svn-src-all@freebsd.org Wed Jun 20 10:57:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569D01011F3A; Wed, 20 Jun 2018 10:57:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED3E175D2F; Wed, 20 Jun 2018 10:57:29 +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 CB08C214E1; Wed, 20 Jun 2018 10:57:29 +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 w5KAvTqI055313; Wed, 20 Jun 2018 10:57:29 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KAvT5E055312; Wed, 20 Jun 2018 10:57:29 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806201057.w5KAvT5E055312@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Jun 2018 10:57:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335439 - head/sys/dev/psci X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/dev/psci X-SVN-Commit-Revision: 335439 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 10:57:30 -0000 Author: andrew Date: Wed Jun 20 10:57:29 2018 New Revision: 335439 URL: https://svnweb.freebsd.org/changeset/base/335439 Log: Move the SMCCC SYSINIT later in the boot so the psci driver has attached. Sponsored by: DARPA, AFRL Modified: head/sys/dev/psci/smccc.c Modified: head/sys/dev/psci/smccc.c ============================================================================== --- head/sys/dev/psci/smccc.c Wed Jun 20 10:02:50 2018 (r335438) +++ head/sys/dev/psci/smccc.c Wed Jun 20 10:57:29 2018 (r335439) @@ -67,7 +67,7 @@ smccc_init(void *dummy) SMCCC_VERSION_MINOR(smccc_version)); } } -SYSINIT(smccc_start, SI_SUB_DRIVERS, SI_ORDER_ANY, smccc_init, NULL); +SYSINIT(smccc_start, SI_SUB_CONFIGURE, SI_ORDER_ANY, smccc_init, NULL); int32_t smccc_arch_features(uint32_t smccc_func_id) From owner-svn-src-all@freebsd.org Wed Jun 20 11:13:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38C841012BC9; Wed, 20 Jun 2018 11:13:11 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D9FD3766F0; Wed, 20 Jun 2018 11:13:10 +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 BB27721809; Wed, 20 Jun 2018 11:13:10 +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 w5KBDAWu065502; Wed, 20 Jun 2018 11:13:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KBDAPI065501; Wed, 20 Jun 2018 11:13:10 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201806201113.w5KBDAPI065501@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 20 Jun 2018 11:13:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335440 - head/sys/arm/arm X-SVN-Group: head X-SVN-Commit-Author: andrew X-SVN-Commit-Paths: head/sys/arm/arm X-SVN-Commit-Revision: 335440 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 11:13:11 -0000 Author: andrew Date: Wed Jun 20 11:13:10 2018 New Revision: 335440 URL: https://svnweb.freebsd.org/changeset/base/335440 Log: Move the SYSINIT to allow userspace access to the ARM generic timer later in the boot. It doesn't need to be early, so move it to the SI_ORDER_ANY stage of SI_SUB_SMP. Sponsored by: DARPA, AFRL Modified: head/sys/arm/arm/generic_timer.c Modified: head/sys/arm/arm/generic_timer.c ============================================================================== --- head/sys/arm/arm/generic_timer.c Wed Jun 20 10:57:29 2018 (r335439) +++ head/sys/arm/arm/generic_timer.c Wed Jun 20 11:13:10 2018 (r335440) @@ -243,7 +243,7 @@ tmr_setup_user_access(void *arg __unused) if (arm_tmr_sc != NULL) smp_rendezvous(NULL, setup_user_access, NULL, NULL); } -SYSINIT(tmr_ua, SI_SUB_SMP, SI_ORDER_SECOND, tmr_setup_user_access, NULL); +SYSINIT(tmr_ua, SI_SUB_SMP, SI_ORDER_ANY, tmr_setup_user_access, NULL); static unsigned arm_tmr_get_timecount(struct timecounter *tc) From owner-svn-src-all@freebsd.org Wed Jun 20 11:42:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7142101418B; Wed, 20 Jun 2018 11:42:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 79460772E6; Wed, 20 Jun 2018 11:42:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5BCF221C9F; Wed, 20 Jun 2018 11:42:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KBg7qU077244; Wed, 20 Jun 2018 11:42:07 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KBg6vN077241; Wed, 20 Jun 2018 11:42:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201806201142.w5KBg6vN077241@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Wed, 20 Jun 2018 11:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335441 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335441 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 11:42:08 -0000 Author: bz Date: Wed Jun 20 11:42:06 2018 New Revision: 335441 URL: https://svnweb.freebsd.org/changeset/base/335441 Log: Instead of using hand-rolled loops where not needed switch them to FOREACH_PROC_IN_SYSTEM() to have a single pattern to look for. Reviewed by: kib MFC after: 2 weeks Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D15916 Modified: head/sys/kern/kern_jail.c head/sys/kern/kern_proc.c head/sys/kern/subr_kdb.c Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Jun 20 11:13:10 2018 (r335440) +++ head/sys/kern/kern_jail.c Wed Jun 20 11:42:06 2018 (r335441) @@ -2286,7 +2286,7 @@ prison_remove_one(struct prison *pr) * Kill all processes unfortunate enough to be attached to this prison. */ sx_slock(&allproc_lock); - LIST_FOREACH(p, &allproc, p_list) { + FOREACH_PROC_IN_SYSTEM(p) { PROC_LOCK(p); if (p->p_state != PRS_NEW && p->p_ucred && p->p_ucred->cr_prison == pr) Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Wed Jun 20 11:13:10 2018 (r335440) +++ head/sys/kern/kern_proc.c Wed Jun 20 11:42:06 2018 (r335441) @@ -3176,7 +3176,7 @@ again: } } /* Did the loop above missed any stopped process ? */ - LIST_FOREACH(p, &allproc, p_list) { + FOREACH_PROC_IN_SYSTEM(p) { /* No need for proc lock. */ if ((p->p_flag & P_TOTAL_STOP) != 0) goto again; Modified: head/sys/kern/subr_kdb.c ============================================================================== --- head/sys/kern/subr_kdb.c Wed Jun 20 11:13:10 2018 (r335440) +++ head/sys/kern/subr_kdb.c Wed Jun 20 11:42:06 2018 (r335441) @@ -580,14 +580,12 @@ kdb_thr_first(void) struct proc *p; struct thread *thr; - p = LIST_FIRST(&allproc); - while (p != NULL) { + FOREACH_PROC_IN_SYSTEM(p) { if (p->p_flag & P_INMEM) { thr = FIRST_THREAD_IN_PROC(p); if (thr != NULL) return (thr); } - p = LIST_NEXT(p, p_list); } return (NULL); } @@ -597,11 +595,9 @@ kdb_thr_from_pid(pid_t pid) { struct proc *p; - p = LIST_FIRST(&allproc); - while (p != NULL) { + FOREACH_PROC_IN_SYSTEM(p) { if (p->p_flag & P_INMEM && p->p_pid == pid) return (FIRST_THREAD_IN_PROC(p)); - p = LIST_NEXT(p, p_list); } return (NULL); } From owner-svn-src-all@freebsd.org Wed Jun 20 13:30:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98F2D10198D0; Wed, 20 Jun 2018 13:30:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8967A981; Wed, 20 Jun 2018 13:30:36 +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 2E15E22CF5; Wed, 20 Jun 2018 13:30:36 +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 w5KDUa48032814; Wed, 20 Jun 2018 13:30:36 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KDUa5L032813; Wed, 20 Jun 2018 13:30:36 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806201330.w5KDUa5L032813@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Wed, 20 Jun 2018 13:30:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335442 - head/sys/dev/ofw X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/dev/ofw X-SVN-Commit-Revision: 335442 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 13:30:36 -0000 Author: jhibbits Date: Wed Jun 20 13:30:35 2018 New Revision: 335442 URL: https://svnweb.freebsd.org/changeset/base/335442 Log: Attach dev.cpu nodes on powerpc SMT cores, using only the first found thread Summary: In order to use cpufreq(4), a dev.cpu attachment must be created. If the IBM property is found denoting SMT, attach only to the first thread setup, so that a cpufreq device can bind. Reviewed by: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15921 Modified: head/sys/dev/ofw/ofw_cpu.c Modified: head/sys/dev/ofw/ofw_cpu.c ============================================================================== --- head/sys/dev/ofw/ofw_cpu.c Wed Jun 20 11:42:06 2018 (r335441) +++ head/sys/dev/ofw/ofw_cpu.c Wed Jun 20 13:30:35 2018 (r335442) @@ -191,10 +191,6 @@ ofw_cpu_probe(device_t dev) if (type == NULL || strcmp(type, "cpu") != 0) return (ENXIO); - /* Skip SMT CPUs, which we can't reasonably represent with this code */ - if (OF_hasprop(ofw_bus_get_node(dev), "ibm,ppc-interrupt-server#s")) - return (ENXIO); - device_set_desc(dev, "Open Firmware CPU"); return (0); } @@ -233,6 +229,43 @@ ofw_cpu_attach(device_t dev) } else sc->sc_reg_valid = true; +#ifdef __powerpc__ + /* + * On powerpc, "interrupt-servers" denotes a SMT CPU. Look for any + * thread on this CPU, and assign that. + */ + if (OF_hasprop(node, "ibm,ppc-interrupt-server#s")) { + struct cpuref cpuref; + cell_t *servers; + int i, nservers, rv; + + if ((nservers = OF_getencprop_alloc(node, + "ibm,ppc-interrupt-server#s", (void **)&servers)) < 0) + return (ENXIO); + nservers /= sizeof(cell_t); + for (i = 0; i < nservers; i++) { + for (rv = platform_smp_first_cpu(&cpuref); rv == 0; + rv = platform_smp_next_cpu(&cpuref)) { + if (cpuref.cr_hwref == servers[i]) { + sc->sc_cpu_pcpu = + pcpu_find(cpuref.cr_cpuid); + if (sc->sc_cpu_pcpu == NULL) { + OF_prop_free(servers); + return (ENXIO); + } + break; + } + } + if (rv != ENOENT) + break; + } + OF_prop_free(servers); + if (sc->sc_cpu_pcpu == NULL) { + device_printf(dev, "No CPU found for this device.\n"); + return (ENXIO); + } + } else +#endif sc->sc_cpu_pcpu = pcpu_find(device_get_unit(dev)); if (OF_getencprop(node, "clock-frequency", &cell, sizeof(cell)) < 0) { From owner-svn-src-all@freebsd.org Wed Jun 20 13:33:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0C0061019C07; Wed, 20 Jun 2018 13:33:35 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x242.google.com (mail-oi0-x242.google.com [IPv6:2607:f8b0:4003:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EF6F7ADC2; Wed, 20 Jun 2018 13:33:34 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x242.google.com with SMTP id i205-v6so3031678oib.1; Wed, 20 Jun 2018 06:33:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=x4PryzQQlw6Ni1tFgMQ5yjoxkYtoLyGGfK71WqYVlL0=; b=MNyLVUGKyZdcvmj8/5t0gl7kRrnEZhLXuRifMfmRklrrNswHAbdnuu8mCosHogb6y2 MlEMCFm0iSgMVKxMZKEiVsERovUjEGYIBai5VuoxQ6IH6ktJPsiD6CSwR9h8aInbRpkQ OK1R/oqJHEOXmF8yaEweSVXFCHIznd0RNsgaEF/um+CWVF+H59VuyIGIOMsJ0IUfuBP+ /m/nnETL71vo5HZx6HRE/CI/qPf7hYgifur/1Jr6TCy8l1popL3zJkYWvTrkK3emPW5I Zy3YF5v4D14SKu6pT8zBJNJhss43lrALxogndQepv+RANHay5OLII7f57/N8jwM7aRzK ZQJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=x4PryzQQlw6Ni1tFgMQ5yjoxkYtoLyGGfK71WqYVlL0=; b=WRVRy5PET394WoY7hnTouPAO21vqzv24N+hO6sWofZ7ZXSBJ6I8Zp6lKOR9BGWekTk YUQg3UQ9ea/ee3zUQFalqNL+UUhQW2Eyc+7V3wHIi/pr3X7E+RgkJ/5VwsS9C97eL8/N 73RCstuW7O63JJgFjlolDcHDAwV8as4qAfbbcjkUTLeHEGaI1+WKwREXls9JApW7oNzt ykbHCw6AngijfYtRdrQW5TSyXN/eTSFAhHHJ2UAgQMqZYoaorrDpoeGRQnO1wYEGgknY fXwriJn0KZ9cVVeJmGgRtAdC4ufiwgFkuNZg3G7eKM+XegQWWatm48zsUw1R9qcEwWt7 dm4g== X-Gm-Message-State: APt69E0lIQcTUH+mBQsh9UHZNIfipFtxyDkzRzAYrQwdNomvtIfAYHTT LHE/qXsLw1lmwnLZsmEtCWkEinfu5GiVrI+B2XU= X-Google-Smtp-Source: ADUXVKKi2pwUcLU4weU+PTIg8H+LKK+vEDW3eNqMOGg450bsTxhZrai7/7XvYJuzG96uIdsDnK1tWZ3Mo+IFnnBmuos= X-Received: by 2002:aca:e34b:: with SMTP id a72-v6mr12380245oih.117.1529501613895; Wed, 20 Jun 2018 06:33:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:4e8c:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 06:33:33 -0700 (PDT) In-Reply-To: <96021.1529475664@kaos.jnpr.net> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> From: Benjamin Kaduk Date: Wed, 20 Jun 2018 08:33:33 -0500 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Simon J. Gerraty" Cc: "cem@FreeBSD.org" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Stephen J. Kiernan" Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 13:33:35 -0000 On Wed, Jun 20, 2018 at 1:21 AM, Simon J. Gerraty wrote: > Conrad Meyer wrote: > > > There's absolutely no reason to use sha1 or ripemd in new designs. > > These should be removed. > > Sorry I disagree - not with ripem (we never supported that or any of the > non-NIST approved hashes), but sha1 is still approved by NIST for > firmware integrity checks - which is what this is, and sha1 is cheaper > than sha256. > > As I mentioned in my talk we've included support for sha256 for 10+ > years, but do not plan to drop sha1 until NIST deprecate it for that > purpose since boot time is a very sensitive subject for us. > With all due respect, NIST is hardly the sole authority on this topic. Over in the IETF, we have the SUIT working group that is even considering hash-based signatures for firmware updates for post-quantum resistance (so that devices can be shipped now that have 20-year lifecycles can have some expectation of retaining the ability to securely take updates over that lifecycle, admittedly). With my IETF Security Area Director hat on, any greenfield proposal coming in to the IESG that included sha1 support would get extremely strong pushback, and I don't expect that "reducing boot time" would be seen as sufficiently compelling. -Ben From owner-svn-src-all@freebsd.org Wed Jun 20 13:42:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0B4B101A40B; Wed, 20 Jun 2018 13:42:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.12]) (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 3D0CF7B533; Wed, 20 Jun 2018 13:42:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id VdNSfkthg8PStVdNUf7WO9; Wed, 20 Jun 2018 07:42:29 -0600 X-Authority-Analysis: v=2.3 cv=QP1GuDDL c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=ymjG5ZiqAAAA:8 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=NxPGeo7nSd0n1sbUrqUA:9 a=CjuIK1q_8ugA:10 a=qFiGSpHtfMUA:10 a=9NY4Jsdw3mG8vwb630s1:22 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 7AC5B3CF; Wed, 20 Jun 2018 06:42:23 -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 w5KDgM0N040041; Wed, 20 Jun 2018 06:42:22 -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 w5KDgMeS040038; Wed, 20 Jun 2018 06:42:22 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806201342.w5KDgMeS040038@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: "Simon J. Gerraty" cc: cem@freebsd.org, "Stephen J. Kiernan" , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: Message from "Simon J. Gerraty" of "Tue, 19 Jun 2018 23:21:04 -0700." <96021.1529475664@kaos.jnpr.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Jun 2018 06:42:22 -0700 X-CMAE-Envelope: MS4wfGrJMd8hUlxuEc7oXdIJeQegVjkKdyuiRgAob0JgJoEZQoiXe9IPCQnrq+6JhIC53v9fe20+qiNMyf+3S5i2Wjqqp7Y0MGSiUs3u7ayiRY97LS0Vgrxm 2afLBHQC2aRWrjZfzQLCOpSeEyFqBOYVhMo2dlApeIvM7+f0RurGBN5Cy9XkPgcgoyuZktoZN3IZG5qJGG12Y00THbBAV7PPn4Sf/GVu3+XeaAo+iJ3dwbCS DYaM2MOLkqXL8UeMoUfDFq2lu2xtuCt74ENG/O/Ov/viOy53vK+W7R2sE8+8lbuz X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 13:42:38 -0000 In message <96021.1529475664@kaos.jnpr.net>, "Simon J. Gerraty" writes: > Conrad Meyer wrote: > > First and foremost: nothing is actually signed, anywhere. The > > The signing of manifests is external. The veriexecctl tool is I assume > a straight copy of what's in NetBSD (I've not looked at it in at least a > decade). If this is correct, should it not be imported into the vendor branches first? What are the criteria to import through the vendor branches v.s. direct import into HEAD? Do I fail to understand a missing piece of information or is there an inconsistency? -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Wed Jun 20 14:17:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51E0C101B886 for ; Wed, 20 Jun 2018 14:17:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BE4757C374 for ; Wed, 20 Jun 2018 14:17:15 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x242.google.com with SMTP id g7-v6so3583322ioh.11 for ; Wed, 20 Jun 2018 07:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=76ASKp0+EP/iQjW5fH6cESMwvHXAR6sRr0uH6N+lTPg=; b=K0RPqOSYalxo9NS+4tJ8tFNW5Vwo+f/tmS84RwmbM9cpktVNUp2w3hZ6GKeVZuXqGg dsNjtmwCtfQZ+7dEcC/mJeypQ7v4AwaiNSw2NKQep/lWCSRTB1DCwCa8mDsof28pPEEv AteDR1ZmoeHUAQrhOq5KzJjw7+z/UuPHUHn90P46FhbDGq8mKamCB5Pp2u5IfDp8vIuF VUrUEZtSHrUFGT30blz+c6+2RS9pxU/cs3bAxc66ZkrTLPZs0yCKwQ0JrUPyx+lGfRCi vfnVzlQA/X5DsDZPJ7arMWQmCTBb72MB3mEmm5NeaILCzChOt+YdQ6KijWsy5JN1Uq+R 5WJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=76ASKp0+EP/iQjW5fH6cESMwvHXAR6sRr0uH6N+lTPg=; b=XgV3yYmQs61YtYrquFl6A1Mwrvp1sfnp4Ie0zZ/yvHgG1hPIA9zLtbchMvBP53qpIY 0II1ByFDxjOVFYO+kuO7HGqedAbSIsDWGyXmWUeTK88HRdq8ghe/kGhAEFonrUBsUkAt oZIaB7ZES64xDk377MmHbultBHLeWKD3DdVzPkXLqYxVfE4vBGsKcGQj/EqGqv5vyehW nOVL1q1szZPGneIpTBBtti5ViWSW41C180cNsREMwyNekTJ6+hQ9dDc6qbqkXugiQrYn D3kVdlT/smCI+H3Bcd6+qNl+ge3Wh1lUzQ0MYfgz7jMvEcSV+a+mmf8U7dsmdPYU+INV LO1w== X-Gm-Message-State: APt69E0LlVMoct4/8BLFc1DbUQVT2QUiH0bwjVunBe7+wbNAMSD6yIpj TfCR7INCO+IIhP4ukGIXTPOYqyzlE8/TxFoFixYHqg== X-Google-Smtp-Source: ADUXVKJvJOGLyzDCWkrmYZatxzDag3OuKnwrWyxMBLgIYyQi1j+SlNWWTwSqIjjqcOZ2H6vt4frvjf0WuGWk/rQmOCM= X-Received: by 2002:a6b:d40c:: with SMTP id l12-v6mr17628348iog.37.1529504234660; Wed, 20 Jun 2018 07:17:14 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 07:17:14 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:1052:acc7:f9de:2b6d] In-Reply-To: <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> From: Warner Losh Date: Wed, 20 Jun 2018 08:17:14 -0600 X-Google-Sender-Auth: xU-hVnGKeNX5FI0UG_iT6JmUSn4 Message-ID: Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot To: Allan Jude Cc: Eugene Grosbein , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 14:17:16 -0000 On Tue, Jun 19, 2018 at 6:34 PM, Allan Jude wrote: > On 2018-06-17 07:32, Eugene Grosbein wrote: > > 17.06.2018 10:18, Allan Jude wrote: > > > >> Author: allanjude > >> Date: Sun Jun 17 03:18:56 2018 > >> New Revision: 335276 > >> URL: https://svnweb.freebsd.org/changeset/base/335276 > >> > >> Log: > >> gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles > early > >> > >> Normally the serial console is not enabled until /boot.config is read > and > >> we know how the serial console should be configured. Initialize the > >> consoles early in 'dual' mode (serial & keyboard) with a default > serial > >> rate of 115200. Then serial is re-initialized once the disk is > decrypted > >> and the /boot.config file can be read. > >> > >> This allows the GELIBoot passphrase to be provided via the serial > console. > >> > >> PR: 221526 > >> Requested by: many > >> Reviewed by: imp > >> Sponsored by: Klara Systems > >> Differential Revision: https://reviews.freebsd.org/D15862 > > > > I had several cases when booting FreeBSD/amd64 with motherboard having > no serial ports > > hang hard early at boot unless I rebuilt boot media configuring it to > NOT try accessing > > missing serial ports. I even could reproduce that with VirtualBox > machine configured > > with no serial ports (not same as existing bug inactive serial port). > > > > Should there be some way to disable this serial ports configuration at > compile time? > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > one by default, because it is safer. Then you can just use > 'gptboot-serial' if you want serial support. > > This will likely make Warner a bit sad, since we are just finally > getting around to reducing the number of different bootcode files. > I think we should *NOT* do that. There is a niche market for this stuff, and we should support building serial-enabled bootblocks on an opt-in basis. The support is really already there, this just enables it early. I agree with kib@ that the target market here is too small to justify a proliferation of new boot blocks. Warner From owner-svn-src-all@freebsd.org Wed Jun 20 14:45:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E679101CBED; Wed, 20 Jun 2018 14:45:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 121097D1B1; Wed, 20 Jun 2018 14:45:27 +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 E4D8E239CB; Wed, 20 Jun 2018 14:45:26 +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 w5KEjQdg072281; Wed, 20 Jun 2018 14:45:26 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KEjQai072280; Wed, 20 Jun 2018 14:45:26 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806201445.w5KEjQai072280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 20 Jun 2018 14:45:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335443 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 335443 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 14:45:27 -0000 Author: manu Date: Wed Jun 20 14:45:26 2018 New Revision: 335443 URL: https://svnweb.freebsd.org/changeset/base/335443 Log: if_rk_dwc: Fix delays handling The property are named {t,r}x_delay and not {t,r}-delay. The upper bits of the register are a mask of which bits is allowed to be written, set it otherwise we write nothing. OF_getencprop returns <0 = for an error. Pointy Hat: myself Reported by: jmcneill (delay and mask bits) Modified: head/sys/arm64/rockchip/if_dwc_rk.c Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 13:30:35 2018 (r335442) +++ head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 14:45:26 2018 (r335443) @@ -70,16 +70,17 @@ rk3328_set_delays(struct syscon *grf, phandle_t node) { uint32_t tx, rx; - if (OF_getencprop(node, "tx-delay", &tx, sizeof(tx)) >= 0) + if (OF_getencprop(node, "tx_delay", &tx, sizeof(tx)) <= 0) tx = 0x30; - if (OF_getencprop(node, "rx-delay", &rx, sizeof(rx)) >= 0) + if (OF_getencprop(node, "rx_delay", &rx, sizeof(rx)) <= 0) rx = 0x10; tx = ((tx & RK3328_GRF_MAC_CON0_TX_MASK) << RK3328_GRF_MAC_CON0_TX_SHIFT); rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << RK3328_GRF_MAC_CON0_RX_SHIFT); - SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx); + + SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); } static int From owner-svn-src-all@freebsd.org Wed Jun 20 14:46:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A908101CC64; Wed, 20 Jun 2018 14:46:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AC3F7D303; Wed, 20 Jun 2018 14:46:08 +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 DFAE6239CC; Wed, 20 Jun 2018 14:46:07 +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 w5KEk7VE072353; Wed, 20 Jun 2018 14:46:07 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KEk71m072352; Wed, 20 Jun 2018 14:46:07 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806201446.w5KEk71m072352@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 20 Jun 2018 14:46:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335444 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 335444 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 14:46:08 -0000 Author: manu Date: Wed Jun 20 14:46:07 2018 New Revision: 335444 URL: https://svnweb.freebsd.org/changeset/base/335444 Log: rk_gpio: Read the correct register for gpio read Reported by: jmcneill Modified: head/sys/arm64/rockchip/rk_gpio.c Modified: head/sys/arm64/rockchip/rk_gpio.c ============================================================================== --- head/sys/arm64/rockchip/rk_gpio.c Wed Jun 20 14:45:26 2018 (r335443) +++ head/sys/arm64/rockchip/rk_gpio.c Wed Jun 20 14:46:07 2018 (r335444) @@ -277,7 +277,7 @@ rk_gpio_pin_get(device_t dev, uint32_t pin, unsigned i sc = device_get_softc(dev); RK_GPIO_LOCK(sc); - reg = RK_GPIO_READ(sc, RK_GPIO_SWPORTA_DR); + reg = RK_GPIO_READ(sc, RK_GPIO_EXT_PORTA); RK_GPIO_UNLOCK(sc); *val = reg & (1 << pin) ? 1 : 0; From owner-svn-src-all@freebsd.org Wed Jun 20 15:05:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D5E6B101DBA6; Wed, 20 Jun 2018 15:05:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7592B7E24B; Wed, 20 Jun 2018 15:05:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f41.google.com with SMTP id a3-v6so112792itd.0; Wed, 20 Jun 2018 08:05:20 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=2AY7jskXb2j9CT2ehQKDTdL7wt3ry/1lU0Zu8g9U0+8=; b=NJ0e/OkU00a6TWON6IazLEDyFRHHE4Dr4P6zNmVg44CO2xKXhuGAKIDIuyu3rhn0As UvOOq6510gwhPBgZoarn86Cnf6+tDXCivFq1kfv60PYf2wf2h+uKaJ1Az6yMxauLnNoz tThu1a7mM7akfGw2JnShP7PeINQ0vJHBFQqmjQ9+e3VHlPj35OI6JEBW5Oc5Y0d7D2SS TmtDVpwTILERbF4y6jSCIFksrb5gT91A3N8c68qMFLQ0wqUIYc/xQdridWy81xX9wPJ0 ySEPFO028E9tSYOkr2xGxnseIX8ZVwnW+IYRSr8Q+WY2DO4BFBrMwrBUckq9mtc4DM/U lmzg== X-Gm-Message-State: APt69E0XI+0IwMCOos2oPgEbSObKs0iovj3KZgSsxef7F/YPhFpjfYxg ZJM7HzOyST5qnG6kJsMSjdzeTBQO X-Google-Smtp-Source: ADUXVKLKW6kCbWj0RXz3HSyPzA2uRUsJJ0SO5MHZJZmZl+pMP9APGT/NWPn9A73F8sYwkVYOZGM9yw== X-Received: by 2002:a24:6041:: with SMTP id i62-v6mr1974756itc.153.1529507113727; Wed, 20 Jun 2018 08:05:13 -0700 (PDT) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com. [209.85.214.41]) by smtp.gmail.com with ESMTPSA id f3-v6sm1006999iob.49.2018.06.20.08.05.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 08:05:13 -0700 (PDT) Received: by mail-it0-f41.google.com with SMTP id a3-v6so112676itd.0; Wed, 20 Jun 2018 08:05:13 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr1867022ith.53.1529507113089; Wed, 20 Jun 2018 08:05:13 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 08:05:12 -0700 (PDT) In-Reply-To: <201806200834.w5K8YThd082989@repo.freebsd.org> References: <201806200834.w5K8YThd082989@repo.freebsd.org> From: Conrad Meyer Date: Wed, 20 Jun 2018 08:05:12 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335437 - in head: share/man/man4 sys/kern To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:05:21 -0000 Hi Bjoern, It might be nice to be explicit that the vnode was not in the namecache (in the ddb output) rather than failing silently. The name of the ddb method does not suggest that only entries in the namecache may be found, and users (developers :)) do not always read manual pages thoroughly. All the best, Conrad On Wed, Jun 20, 2018 at 1:34 AM, Bjoern A. Zeeb wrote: > Author: bz > Date: Wed Jun 20 08:34:29 2018 > New Revision: 335437 > URL: https://svnweb.freebsd.org/changeset/base/335437 > > Log: > Sometimes it is helpful to get the path for a vnode. > Implement a ddb function walking the namecache to do this. > > Reviewed by: jhb, mjg > Inspired by: gdb macro from jhb (old version) > Sponsored by: iXsystems, Inc. > Differential Revision: https://reviews.freebsd.org/D14898 > > Modified: > head/share/man/man4/ddb.4 > head/sys/kern/vfs_cache.c > > Modified: head/share/man/man4/ddb.4 > ============================================================================== > --- head/share/man/man4/ddb.4 Wed Jun 20 07:02:19 2018 (r335436) > +++ head/share/man/man4/ddb.4 Wed Jun 20 08:34:29 2018 (r335437) > @@ -60,7 +60,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd August 24, 2017 > +.Dd June 20, 2018 > .Dt DDB 4 > .Os > .Sh NAME > @@ -1121,6 +1121,11 @@ header file. > .Pp > .It Ic show Cm vnodebufs Ar addr > Shows clean/dirty buffer lists of the vnode located at > +.Ar addr . > +.\" > +.Pp > +.It Ic show Cm vpath Ar addr > +Walk the namecache to lookup the pathname of the vnode located at > .Ar addr . > .\" > .Pp > > Modified: head/sys/kern/vfs_cache.c > ============================================================================== > --- head/sys/kern/vfs_cache.c Wed Jun 20 07:02:19 2018 (r335436) > +++ head/sys/kern/vfs_cache.c Wed Jun 20 08:34:29 2018 (r335437) > @@ -37,6 +37,7 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_ddb.h" > #include "opt_ktrace.h" > > #include > @@ -62,6 +63,10 @@ __FBSDID("$FreeBSD$"); > #include > #endif > > +#ifdef DDB > +#include > +#endif > + > #include > > SDT_PROVIDER_DECLARE(vfs); > @@ -2529,3 +2534,54 @@ out: > free(fbuf, M_TEMP); > return (error); > } > + > +#ifdef DDB > +static void > +db_print_vpath(struct vnode *vp) > +{ > + > + while (vp != NULL) { > + db_printf("%p: ", vp); > + if (vp == rootvnode) { > + db_printf("/"); > + vp = NULL; > + } else { > + if (vp->v_vflag & VV_ROOT) { > + db_printf(""); > + vp = vp->v_mount->mnt_vnodecovered; > + } else { > + struct namecache *ncp; > + char *ncn; > + int i; > + > + ncp = TAILQ_FIRST(&vp->v_cache_dst); > + if (ncp != NULL) { > + ncn = ncp->nc_name; > + for (i = 0; i < ncp->nc_nlen; i++) > + db_printf("%c", *ncn++); > + vp = ncp->nc_dvp; > + } else { > + vp = NULL; > + } > + } > + } > + db_printf("\n"); > + } > + > + return; > +} > + > +DB_SHOW_COMMAND(vpath, db_show_vpath) > +{ > + struct vnode *vp; > + > + if (!have_addr) { > + db_printf("usage: show vpath \n"); > + return; > + } > + > + vp = (struct vnode *)addr; > + db_print_vpath(vp); > +} > + > +#endif > From owner-svn-src-all@freebsd.org Wed Jun 20 15:13:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C85F101E56E; Wed, 20 Jun 2018 15:13:34 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 753D37F033; Wed, 20 Jun 2018 15:13:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108160.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KFDWb7020352; Wed, 20 Jun 2018 08:13:32 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=bqZAWPfvxx6o9oh1n+104SsoI4MI9jrlrCF1rRu0YcU=; b=oeQcTzLuIyzvYoDSloF9fpyz8Sr7GUw3aktBfvpATG9BghM64g3AzqbiiqjP/qX4hsC+ k2tBdtphOvrxW2YGk+AetbUqZ+hRrC4ko0JwTpzY6EKM14sQ9HWBIsvakE18fCjA+Emy AVncEXrkDY70ipdA4wu7qNyJqaSCwmeXTdfBu/qqzjo7CCcEOqvouDutP21LRXs9Spxt ESilAfZJd7S4gTNgOALYdyKP30FpoPXK+tI1yigoA9W2jPfrIEMJy86hXZwajg0+BaHz Txp/TirKEOkVnK/kAS9ZWsM3TBH3Z3wk4Y97z7lo5eEWPkfjM3sJi4TMt2cBtx5WqUzp 3A== Received: from nam04-bn3-obe.outbound.protection.outlook.com (mail-bn3nam04lp0120.outbound.protection.outlook.com [216.32.180.120]) by mx0b-00273201.pphosted.com with ESMTP id 2jqrq5835g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Jun 2018 08:13:29 -0700 Received: from SN4PR0501CA0013.namprd05.prod.outlook.com (2603:10b6:803:40::26) by DM2PR05MB624.namprd05.prod.outlook.com (2a01:111:e400:2441::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.16; Wed, 20 Jun 2018 15:13:27 +0000 Received: from BY2NAM05FT061.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::201) by SN4PR0501CA0013.outlook.office365.com (2603:10b6:803:40::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 15:13:27 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by BY2NAM05FT061.mail.protection.outlook.com (10.152.100.198) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 15:13:26 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Jun 2018 08:10:08 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5KFA8PB027354; Wed, 20 Jun 2018 08:10:08 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id C6747644D5; Wed, 20 Jun 2018 08:09:58 -0700 (PDT) To: , "Stephen J. Kiernan" , src-committers , , , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: <96021.1529475664@kaos.jnpr.net> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> Comments: In-reply-to: "Simon J. Gerraty" message dated "Tue, 19 Jun 2018 23:21:04 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13045.1529507398.1@kaos.jnpr.net> Date: Wed, 20 Jun 2018 08:09:58 -0700 Message-ID: <16106.1529507398@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(346002)(39380400002)(39860400002)(376002)(2980300002)(199004)(189003)(97876018)(76506005)(2810700001)(97736004)(2906002)(97756001)(2201001)(9686003)(53416004)(5660300001)(47776003)(105596002)(46406003)(478600001)(106466001)(50466002)(476003)(23726003)(11346002)(126002)(50226002)(86362001)(7126003)(68736007)(69596002)(486006)(1941001)(446003)(229853002)(8936002)(6346003)(316002)(16586007)(8676002)(59450400001)(6266002)(356003)(6246003)(55016002)(450100002)(81156014)(81166006)(76176011)(26005)(186003)(305945005)(7696005)(336012)(77096007)(117636001)(110136005)(53936002)(2101003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR05MB624; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT061; 1:d5nqVOcZHJPnrkzjYpQs3KeV8u8pvRfj3XlxwBTErUVzUxhXOryeZLkiYN6dNbI35ItdwVzZr2SEmAHs1AZAtP+n/p4mgrqBVqJ6snz0pNXNkYLKBLYjayrO5cm4aP/V X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfa8e428-8885-47af-fcf1-08d5d6c05f9f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:DM2PR05MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB624; 3:+XqQk/i8mPDo+HHO7JbbdamPNRhHsOSbU7hHSV2dIe7mr+rTybKRO8SCD9pf5KphoXUaSpE+er6xiCLb++/UDxtnwaWr9tJpt5gIhNVVsWR1JnyZdpW2/RV1N/MvikOvsHky64QZGtqRgH3euUaXSAWrNO4qd2dm4KhY0uWIW2ROork6LaTxQmAlDAGrRWRNhHaddCw80eEoFTi9qqbbyMxAP3wIluU/CgpOXSuZsXGEhIAG2El8G6+F2a3E4raNuJxV4hUHov61BZN2uLSsCPUL5Z59/zGx3Q1xK2eIni7U27+HXUdFmwEyik8ZIGTjBKDauHcJ+2XuQrPDCc66vUzxLrrxlAN7d4B85F2bjRE=; 25:9iGbA7DawyMxcUu+rA65iA/GFBlqyb/nc486V23Q9YPEdc07prVC+JoMy0VEm1hFoUMKyROMkRt0n5r2V1kGkbfrVqTZjHqKHxqgjpF93RrjyAKuzpL+F76eIucw/JzIkpAoKyWCWRrorZeh+UCR9noTKOhr+umW/EvFf0D5jfqG0++HJDOeM5hUi2KZuRMgPJ2B8yWh/nXyMq/yF1fbWtyA3I8468/PGzCFmKWBCmvt1oYOInj2kCD+VktB1cKpS+BXlvgx4XqNnSyJWooqJJLayogvvsCqpFnS29y9Kd9qVkFYgBeOdeyET7k16jWmPHP65esI5AomBYtqa2lttQ== X-MS-TrafficTypeDiagnostic: DM2PR05MB624: X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB624; 31:+7+HHMa7Y/equCaKjMyGyDf0XeAD7TIW6ZqojPK3Ojn2aDTeh9eQtS7nbSl8/A6pDW6HTuuCrdkAfZ18yYJF4NXWrzefbniBEaHxaAMpgoUeU7LtFhn9sMcYU4cvc7NHYlPb5yhmHpFlpJcAUYyBrnEN9S2I45HF9tw+z1SezMrS/5YNPNJaDFU40PmB/gwCG82xQIdRzEsjM3fEhy2wgUSFftflrpVubXLxqkomvUM=; 20:KPFqyQpczv/bKQ3PxlFctvpZZA2neNGqXcMJeWveTIbYBUPlo2/+f/AoAxEIJRKeGklFuZx4k1JcidM1cEpFEayJENHuJlqfkdtVub6Z+t+NG2p45iEHlQ/pepDGrLn5A6D6Cin1UGT38dwNfOowZBOMDy5iv8D1HN9aEyWYNYDzKBr2El/xEi3F/sRgcknDPcu+MAXbk/LswPGyStuXzEZh9NPZ2Nd7m8evSGENZHhfBKssVevliFRY+jB23QJFFb9O/Q1GkVFjMSEVHD2abnM0qeut2lXBmCGulnq9qj9waFgNV6ngyXe7V6n0g6iRR6gJnUCmkiMXfMX9Oj/Dl3ityxZbPm8xH9yFM4kUyyZtILViiXzUqAtVFxvOeZjMg6PggPIRn1XZtsPm7Av9J4K9kwzL3PfNckELeN3L/xualEyxs9TqIGC5VwiyT/Kg7wr464PJlhnKNB/R5EL3+iyT9mn5JqJTbjj7SNlQNyGg9ZmwwLqB/ePN9gEkB9r+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(138986009662008); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DM2PR05MB624; BCL:0; PCL:0; RULEID:; SRVR:DM2PR05MB624; X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB624; 4:LrbMs7xhzhH7pFeg0sFjfGrAubFBqHQ9YWIlm980D1u923IcyUQD+7gcEGsHhAm1nTJzj4vEZD1/3wmFceiQafIk8cgS4ufpXyRPegJm3YPgGlyvAbZR+9IwPXzcS5DCRwW0tn6T9RZbGANV9h8wEkX+3EE9GBsNAiQMP6VMefPEMopDEpr0IKa2FFiZJKRNvQVYm50F1yjK7dMxiAjnFkNE96SAaOfXwRq/iKnpYHXnY3F44gLvU5g7DBQsuDd+1HtE2mZX/9BBzkEuVQZ/zl+Z092Noyc+SiWuCacQ7nGQLrwsEhcpEbnh+n34a9y7 X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR05MB624; 23:PnLoABjHzkR5fzZ0Uz6wc9ZQHIYe8fxg34x7708uMd?= =?us-ascii?Q?m4CYZar6TF1xl3Dxc7fuT/GpaBF+LXdeu3bpHMzejggZuxnVS794XiRlyw+/?= =?us-ascii?Q?Mm9Cdxht1ToBrgn9fk8imNK+ZeA+EneaUfX8W6CjufgypIEJEOpujCLUnF6T?= =?us-ascii?Q?Mog/m/gQZn3YPlvt8b00Ob1/Z6KNG7sTJ3RGFEXMJMwuCq4wRxCNWNxnp7ZQ?= =?us-ascii?Q?K/fJFteMehZowc9HPYXW3wTOtB/l5y/98b8g6cSAt24igkxBgfD02VoNfyVe?= =?us-ascii?Q?spv3k7CtJEF4PRozS3hUhGF1lGiCFnmwYmz+kYVH4dJghRijhnmkESgOW4dD?= =?us-ascii?Q?erZj+nY52mhtRs2uQRwPZaFTSLQdyJlo6ebjyxf7MTJIbnPlKdGmhyZTNVx1?= =?us-ascii?Q?l1isCtxR5OtIxEkzDskAus9/sgSfVxrHi6HEmAlkmtxEsyP1bRis7YqF21kM?= =?us-ascii?Q?ZCnMULbXOgND9f/OyyL2Cjc+gCCrZr+/QP5pYCdL2frecy8U6GVoObM4Yi1+?= =?us-ascii?Q?JtZEyPS9Y2IoKh0Ow8NquPsUTl3sr9YXOotYNa69EM2W/2+uSZYB4eBnSq9I?= =?us-ascii?Q?4DISWpXy0eVdUeZmusPK4Pyn9OO/QdMYxv19KAHIAvtzIPJIS9N7+9RcZ+29?= =?us-ascii?Q?vxkYZQCqXwML5eZyyvPMIyNk3bj+8IiUJgD924pvQ9BtK5HsfcPlY4VqCoKJ?= =?us-ascii?Q?JoMB6BCDMVoAeTqIbXkvniQYx1Uq7gFliMIARRxn1iJ38w090sm1vODR3jje?= =?us-ascii?Q?Kt92NJ60V3aNS+Vw6NLfCyvJQ+RwmG39q2xJNwSN1V/vk9OEIJRlK5njYMVl?= =?us-ascii?Q?pXUYd0I+UPuUE0u/LTdASu03Si8cO7IFX5Y64YYZYdav9wTIvhXEW6PhXei0?= =?us-ascii?Q?Sc9xrUGp2Utue/bx6QNJM5jI/31Z63OshvQRjpf2RF4k+iej5/1qncujRE+s?= =?us-ascii?Q?32XXB2cc6RIEgOj1VCba5ruEwRQMRj3qoy6e5G+y+FRjhbqdeGX6iCrU8cLi?= =?us-ascii?Q?m8BdkSUi2HHQqg5e0JsIICu6cFUM3M38ojAxO82cI3gJotup8ovi0P89Bnxh?= =?us-ascii?Q?tY6FgC6EnKxVs+zGF4jnS67xCnlMczOSG0H4YXG52dMDM0MBFuBBUog5icT0?= =?us-ascii?Q?Tqos+HJrxP/kvubyuEkpCfMoT/q3x6eDrWLC2fJKH7Ofk2yYje6RwJPnTXNu?= =?us-ascii?Q?UcUQSdhbPsNVSasKhE23QXXgyqWv2SKeEl9tghk9gh8afXuYT3dPbkjAT8ww?= =?us-ascii?Q?8VYClHU5w2s4Rrq3UnjUBmjC64HpHVIbtyNti32lelWTxAm5o1S+rMe60MrR?= =?us-ascii?Q?oo/1bAZqD03eBRJkXwrz6khBjEwymO1v02GDtjWIT9Xg68FniqDZY7ASb7Wm?= =?us-ascii?Q?xDBMG9moB5dMOePh7Jh5RA6905JMoonrdbqedFaNnea3aV?= X-Microsoft-Antispam-Message-Info: BtKsj6f+RjX49X2qhRi1j/cx8Ea8J8cCDZEfKn8Ul/jG5fFKbjlLRvvyuLzPeSUbLF9mVrcI6OBRF9MkSZauk1pv8eZApn0HacGgqXUMipMudE54HewQdSekkx1JlJAIgCXf7afVgrkTsX2X6GpJcPLBM7npl0YzasTyXh4u1iKtCyJzas92SVDF7QvAwldl1iaTVd4HR5kiuvPwxg/BfFWZ3u2VBFOO6R+w6NP7o5RAE/rbwc47qw6KFbcsrpmZT0znu5X1f10WGu+AeRWPiQXQ5iUBEQsun60ILkClmzWCds6V9dlzaKpwJSrU64hK05HENyxaeIZpvhaSpW7sbw== X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB624; 6:0G+Ve+yje/dW8Luidhi9vZ03UZWdH9T6gFK9nrmwFu0N1TWcUjt5pN+WFgkN/l3P1tV/9i+zyaF7rDFpOhlD/dQVs3V/7JUOCbWPVg7wIIJLqQxXTpPpzOOMU7uOtwXXEz9B6LEp3TuSig9lzu+KiAadPDWqylDbns7Jt9cxugtkbnMPLMNUkE5x5/gaV1qN/s4dNkS/OTb7KP4olEgdN0EH3maMYl5OOJ78nVjRtQEV4bEcaUS4XonPdBN8r9gQk+2b4Em/b6YuXxugSeblANnzumNswd3POwJCHbHCmc7dHnLgt7tuSfUaH1+8W3xh7tfSxVPTfQLLRqtOMT/CEo+OLn4Cmkr88xfJEuvJwgKbTwroG102rpeWlrpvXqKPiImBRxJEVpPOZeR778xOkOlYWRFBsvc5PMuFI6P3py1u0mmsqXzdbHCTiEba6a0n//SWA1GNcdHLIhrJ2u5gMg==; 5:E3lQmMLEsdUHdoDVWj+WeUsV824hS+dyfh6nUupe3Rae8kqk6rvW49cW59d+Wxkfe5Hp6Wy8qxuYO9da2SP/OFKd/TyO06pqFLxs4eNRKqN5HmCDCnQRIlFsIHykNh5fSrYN+EE43+qVHGjif7U00rJvIpKbmv7DbQXghL4nNEk=; 24:ukD3M+sf4TNELxRKM42v+Vmh5+jZdL8pGzM5OBU3aD3ZszrS1akAxojLBIbisdkx06Q/7pf/p+FBKdCyGkiAoGLQy+FJny7T6YbZZYmFJ1o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR05MB624; 7:GNpeJ/fJMsf7i5oTWYDvpV5On9hCXVF7gCJQCyw3ICw/BMfKTkNyuu0hfeI7c0s+7yQf7vvjlOgGOzxbukJISgCa4KlVY2VRy/3urf6+luryY8yc+89a1oxAswc7+iq2CJE86aAiTUIl8BtI/5d4ncCP7jZkvEh60Q6FYp/HRuHc906cuJ1n2FqlVxt64oVP7dj0kMrnjwYnE65NQnEHQCj63smNBTLvSewJCzeRggy+vSVnSkik/FIhrAvzJdEI X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 15:13:26.6991 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfa8e428-8885-47af-fcf1-08d5d6c05f9f X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR05MB624 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=917 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200170 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:13:34 -0000 Simon J. Gerraty wrote: > > - Maybe sign the source-of-trust file > > We do. As noted above, we cannot upstream that until FreeBSD has > suitable signing infra. It occurred to me, that since I'll be upstreaming a library that uses BearSSL to do the necessary manifest verification for the loader, the same could be leveraged for the veriexec loader. That may impact where the two libs should go - will discuss with imp. From owner-svn-src-all@freebsd.org Wed Jun 20 15:16:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CB56101E8B2; Wed, 20 Jun 2018 15:16:34 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: from mail-ot0-x236.google.com (mail-ot0-x236.google.com [IPv6:2607:f8b0:4003:c0f::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D7EE7F380; Wed, 20 Jun 2018 15:16:34 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: by mail-ot0-x236.google.com with SMTP id v24-v6so4074525otk.13; Wed, 20 Jun 2018 08:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=LmKj4vhNwzxGfVTjR2sGurvtw0eDzWwm8BwK1VI9RDg=; b=Y3LGTLbnp2/oF141Aha7lYHaBMYWfFnhq9VYEJqoamkWkBtURLRrihMzurLFz24U5s AG6JtRCbxs4Cv3hhWjHGDdi5EgI1iQgl9BjS2pIsFAHRZlTjKUw7y/TdRg1jdlGIHwIW aEabtEj1vfiCyD6PZMgOQ2lrpZrkR9Dq/dz7LyP1pb0gc55GIlicsAit1IXNwXJ5QqsU 88Whwnnj0+57mVWTmbAcEphrXYjNDS9ae3SgAKnSpfh7Jgi/d0bdO+G4QY1ies0BZIAA m6dulc4yDsU1nSQxbP3Fw2rrtn6lxRnwdUwN/0MPkOfu8ECW3IiOz1XkjCs22jmUfJow xf9g== 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=LmKj4vhNwzxGfVTjR2sGurvtw0eDzWwm8BwK1VI9RDg=; b=dVm2we85t6S/XhakVNDLJlIP5OYkTFbaLTDNhZcJEJcWOwLUh559Itl7S+A7gDFX99 ANWNu72xS5QLZCKiySIzd34A/9NtWU9cvdTqyEsXFkfiJunOBv1KxyT6uvKUA2dLjbYf rswdixaAylUsop8aLncOA3QDdYGFVUQ3vYaaTDn//RseabtmqbtPHTTqXPaMY/NJQ8pI V7m8uDrRlP7RN55l5kM9UHOuyFXd2hMcP6bj7nmggIccOg7K273/lxm2SOQfSWq1mmoB e9130Rzmi+45Sv1JWE8Yfwf7r8Ht2c5wfKOffXwY+IN8uUgXrdNTAO+VoyoOieCz7wL8 TeqQ== X-Gm-Message-State: APt69E0NoON+LzG17muv/x05EcqMIF7hnMZ1jEpEX54E093yQhfhe9Q1 R+zm27fTI9GoQNWHw+iAcw+sdRS/ait8rZXuFbSp9xg0 X-Google-Smtp-Source: ADUXVKJYLwL+MtStsVFZpob0rtrAnEGbOFKtO1/aUhHsv5PNo4BlG9DBlMQnp+xjQmsu+6XHDyYA0LTmgqyIwcboHOI= X-Received: by 2002:a9d:2106:: with SMTP id i6-v6mr12353641otb.222.1529507793173; Wed, 20 Jun 2018 08:16:33 -0700 (PDT) MIME-Version: 1.0 References: <96021.1529475664@kaos.jnpr.net> <201806201342.w5KDgMeS040038@slippy.cwsent.com> In-Reply-To: <201806201342.w5KDgMeS040038@slippy.cwsent.com> From: Stephen Kiernan Date: Wed, 20 Jun 2018 08:16:21 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Cy Schubert Cc: "Simon J. Gerraty" , cem@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:16:34 -0000 On Wed, Jun 20, 2018, 6:42 AM Cy Schubert wrote: > In message <96021.1529475664@kaos.jnpr.net>, "Simon J. Gerraty" writes: > > Conrad Meyer wrote: > > > First and foremost: nothing is actually signed, anywhere. The > > > > The signing of manifests is external. The veriexecctl tool is I assume > > a straight copy of what's in NetBSD (I've not looked at it in at least a > > decade). > > If this is correct, should it not be imported into the vendor branches > first? > It's not a straight copy. But much of it is from the NetBSD version. > What are the criteria to import through the vendor branches v.s. direct > import into HEAD? Do I fail to understand a missing piece of > information or is there an inconsistency? > I asked about it at BSDCan 3 years ago and pointed people my github branch (before review was created) to get opinions on what to do about it (vendor or directly put it in sbin) and the consensus was to submit it the way I did. -Steve From owner-svn-src-all@freebsd.org Wed Jun 20 15:27:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C93F7101F02A; Wed, 20 Jun 2018 15:27:10 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BE377F9A2; Wed, 20 Jun 2018 15:27:10 +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 59EA0240D0; Wed, 20 Jun 2018 15:27:10 +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 w5KFRAux092990; Wed, 20 Jun 2018 15:27:10 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KFRAaD092989; Wed, 20 Jun 2018 15:27:10 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806201527.w5KFRAaD092989@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 20 Jun 2018 15:27:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335445 - head/sys/arm64/rockchip X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm64/rockchip X-SVN-Commit-Revision: 335445 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:27:11 -0000 Author: manu Date: Wed Jun 20 15:27:09 2018 New Revision: 335445 URL: https://svnweb.freebsd.org/changeset/base/335445 Log: if_rk_dwc: Disable setting delays for now The values for tx/rx delays differs accross the different DTS. Mainline Linux set it to 0x24/0x18 Mostly-Vendor u-boot (the one maintained and developped) to 0x18/0x18 Mostly-Vendor linux (the one maintained and developped) to 0x26/0x11 By experience only 0x18/0x18 works so until the issue is resolved rely on the bootloader settings. Modified: head/sys/arm64/rockchip/if_dwc_rk.c Modified: head/sys/arm64/rockchip/if_dwc_rk.c ============================================================================== --- head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 14:46:07 2018 (r335444) +++ head/sys/arm64/rockchip/if_dwc_rk.c Wed Jun 20 15:27:09 2018 (r335445) @@ -80,7 +80,8 @@ rk3328_set_delays(struct syscon *grf, phandle_t node) rx = ((rx & RK3328_GRF_MAC_CON0_TX_MASK) << RK3328_GRF_MAC_CON0_RX_SHIFT); - SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); + /* Disable delays as values conflict between DTS */ + /* SYSCON_WRITE_4(grf, RK3328_GRF_MAC_CON0, tx | rx | 0xFFFF0000); */ } static int From owner-svn-src-all@freebsd.org Wed Jun 20 15:30:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35718101F57A; Wed, 20 Jun 2018 15:30:49 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9297E7FCCB; Wed, 20 Jun 2018 15:30:48 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108161.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KFOVZK030444; Wed, 20 Jun 2018 08:30:47 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=IZpaO3VQRlxiAO6j3stF6vhZAITqSHocALieZwCPluc=; b=EDbrRNlDnoPtu3FdGgnm+ux+fmDtk2C73Nlgfpahbgm7OnUErJrEB8L4qJe8WAAnXntf H+zTa18h2s2Bb3Owg3htGyebtoTpzhiIAoclgqEtuvxhT7lnZUNRYIIYJPQMKttMJiy+ wm9Sstm48Q/oQOfTnF5Vq/y/j6y4TOQipZNJ4nAYS55MwbvQccgRP0QEtcNqgrJ56aqn VcyUAOIYRXopo28NRKSuqLVM4CxijHvuS2uzGX50ZRY+2TP63MJ78k9rccIuBF3TF+EV Ixo9CFey3AcYeTa6L14ZgUYE45bcnTVei9/QK8KN9MeduaGHab84qulhdkBd4SCAfvB/ Yg== Received: from nam05-by2-obe.outbound.protection.outlook.com (mail-by2nam05lp0239.outbound.protection.outlook.com [216.32.181.239]) by mx0b-00273201.pphosted.com with ESMTP id 2jqrjp04mn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Jun 2018 08:30:47 -0700 Received: from CO2PR05CA0083.namprd05.prod.outlook.com (2603:10b6:102:2::51) by DM5PR05MB3113.namprd05.prod.outlook.com (2603:10b6:3:c6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.14; Wed, 20 Jun 2018 15:30:45 +0000 Received: from DM3NAM05FT018.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::207) by CO2PR05CA0083.outlook.office365.com (2603:10b6:102:2::51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.15 via Frontend Transport; Wed, 20 Jun 2018 15:30:45 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by DM3NAM05FT018.mail.protection.outlook.com (10.152.98.127) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 15:30:43 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Jun 2018 08:28:49 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5KFSmxh030855; Wed, 20 Jun 2018 08:28:48 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 0A1E6644E9; Wed, 20 Jun 2018 08:28:39 -0700 (PDT) To: Benjamin Kaduk CC: "cem@FreeBSD.org" , , , src-committers , "Stephen J. Kiernan" , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> Comments: In-reply-to: Benjamin Kaduk message dated "Wed, 20 Jun 2018 08:33:33 -0500." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13501.1529508518.1@kaos.jnpr.net> Date: Wed, 20 Jun 2018 08:28:39 -0700 Message-ID: <17033.1529508519@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(346002)(396003)(376002)(39860400002)(39380400002)(2980300002)(199004)(189003)(69596002)(77096007)(126002)(476003)(117636001)(16586007)(486006)(39060400002)(86362001)(316002)(6266002)(6246003)(107886003)(59450400001)(229853002)(50466002)(6916009)(446003)(11346002)(26005)(7126003)(186003)(93886005)(55016002)(7696005)(53936002)(9686003)(336012)(561944003)(4326008)(54906003)(76176011)(50226002)(356003)(46406003)(8936002)(47776003)(106466001)(97756001)(305945005)(81166006)(8676002)(97876018)(81156014)(478600001)(5660300001)(1411001)(97736004)(2906002)(68736007)(53416004)(76506005)(23726003)(2810700001)(105596002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR05MB3113; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT018; 1:dTzlaZINb8naFPWUb/ugqzi0sLrE1OSSOk3eOOvKhDFbQiuKSGjEgKDWHYVrJDWwoFyZsZ7gbUYjtu88VJ1hWKjG7oz/UTfXMAeTINyx7Zv/TR5DvmVWwd+H27O8h7pc X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b3f4c3ba-38aa-4e5e-9dbe-08d5d6c2c9ff X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 3:Q5Ev+4T8NkHNe/HeaxbZCzOjFoUmsxWuz6Y4oiIlZvZrw2pbD13mvQWqff47qLvKR0T/Phm7EjvLvnSC8h5JKCU/XdY83f+m5mC13Zwu3ExPpi/7mbTO3Z3gdhknDQGSe7h1/z2IB+DBXNZywsE9id1+OZA3Ra5nN+RY23n6AWMGVcPdOOoiPsOqZEm4IO2+hGHfAZGMNCTXNmfUTNzpglf/sWCBAl+3fgTC45XMObSMV0G4U6dyOeS6JsJ3EjNDvDE5HVS1Va4OZEtK0BIEmksjm7RWVZ0wuvFXgm17nTrEt3tM4RazdCLAxZ5RRRjyE6qqnVDi8yNKZu5FdtPpY6Uu0k0lSa1rV+gWRkonkfI=; 25:C/4StmW9cOgYp+eT+HRmPEVdh7q1iPfSvQthhUGmna+mVeeHdD+GoTeK3dUKG6kyt1gxCGtmj4ZDxBE1+7NEUPxYogGEP7InPi8JJDYBV32upsz2CG+gU6bvK12Gq3pswcfj8HqniJaHxQcNC7JYga36aI9KhmaxhLuKApNFfucykkocYGHPCqMF+qdjdrrOPAL1PJoxOWwAwQIH0GhOx+FZdB0T+nzsrRRY8MQG5qVNiy/VbixW0pUp6FOKAFycmA6cGAv39oqpl04IIRSISpZKZKD2rB6ydjgwD64OuGPXQmHH4QEsX81iOGJpdiN7Dl1ucuzU61XcJLiJK0jyjw== X-MS-TrafficTypeDiagnostic: DM5PR05MB3113: X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 31:3pii8fBcgGqxzqUYIVfJWVebSOhq+XuI6ABMYCyuPtQ1UNzEK+1IZE6jngxJVAzFgFlnl7iA2JGYwMTV+8gtkhz7h6cgPkqOITkBCclk18iweHWxRRaGPlJffpJ4+y3TQHA5zZi0LNDUv3z4SuJgBU5AGONNg1vC6nESe1ouJG0r5W9DFKn3xe+cj7FLjxM0WQ70f2gC8MU0w/JZvaUALpI2/aLJcE7mSsuvxiEqvrg=; 20:9gr5giVSGvmi8UDu8bbtkNlg73b/IcDrg0KdUylTz60ci6q+mj9U/IIZkXeQYp9RxE1W+CHYTolaHrXFhctwTV/4kNMr63gkr05xo5YLJtVRIRjqwp4EFNm+BYAC36G4Dc/91whVhpayR7FszsvUryPiz0OuBE8GQX7428ATUequeiNWG6OIuemwQPOZIh31gDpdXFZc59o9YYecI842+Oumg6jyJljmDUg92fjsVSrtHdZcMmDmf/cQhKKQDUKPba+oZ/q27vRSUmRsrY6LmzM1uX+oaiItP2OeMcwnriq2mHpN7J00XdaxwWh1jNwsGdRhe3htjVBMifchQSSzILehdHCRd9Lt201pU4Uphtb48KTyS4dmZCCVdBxA4xqa/krf1ZyEHty9xNKsi1hMpfK/7M65TWExy8kiiRFyqp16syvEqHrW6sC2qYRoU3Dv7NpJI1+erasM1OipPblBfmemnpzh9FTlcfwC7i5KmGpW8zn5xZYS+qV7PrCdMfna X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705)(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:DM5PR05MB3113; BCL:0; PCL:0; RULEID:; SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 4:mprROlr5Akf6pxdgujnwx1rN/7G25Thvbw15X0NIBLNwpZZ8e/dyiz4/ID59qytCeYnacJQObF3Wv1BBcq++nN619CMcKdngy2Je7Ne3pLNbSf1k4ZNiEUFJi33JnK5MKj+NL2AFs+4TsUW7pkfGbc56SJTiSVWsnhBTZAnSmciOn1gbvj1HGIh0RBeVMLlxfFjhFS0iGkm5Q0iU2HEmMK3gVKO/GJI0tUx5Bqwuv/aK6Zs9jJTuglJgYTaSwtO11gdVHAiqElH+uVdL3QzCH9UDLeHBdOs7qY5+mw5OFv+fQR809LbyRzArE6k58CT0/Fj5UFSB0W/Y/rz0ge7tnYk/0Kit5ajyIM1dF7Cp9PU= X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR05MB3113; 23:obp13ArZyoByC/ChcMO+ewAqfBTxfd09tz33SWTBq?= =?us-ascii?Q?PBkyw81eF4HukqNsn1MTuR+n/ld2hYDwjxPSsII/cHLIQGJ0MXw+pjk6aFoH?= =?us-ascii?Q?Mv1Q32wCnyCDL/05nePGc44J5a5JVUitArNmAtSytSHRnx4fB0vo+UGwbHYB?= =?us-ascii?Q?Ybsq9g9yfn8t1MfF1dgUZ9Abth+yDy16WUHT+9gs8tRC1ld5PMLwnVP02C0G?= =?us-ascii?Q?YymH085m+1qVlnCW1rBrnaBKjMLjJQDu5MibuyLmI+xp4FwlUZI8sQCGa62q?= =?us-ascii?Q?jvejjLJIrR1UxHajdK0bF5+jx6TzN/l/3BvHf7Lo3/QWwCcc+fNHSQdJyWKG?= =?us-ascii?Q?tUaufMp0/KDc5+i8Wcd7c7dG2OqtNJTi9JifxzpEmSWWlJ0mVgU7T12OAakW?= =?us-ascii?Q?Q14uYhD65alptsRKRGB+1MC0b50tTVIMl+LSa5SVBtOkk0ZC7LW/nMWxU5gy?= =?us-ascii?Q?hM5f4UPd50vVTSU0KDv/dFIyvuGqzOxyASZc1Ubb7uQ8qe+D6TskuT+tM/+C?= =?us-ascii?Q?V+XP9yGuAek6GE53dK7uScwF+qNWhrNfvafskuhyLClu7UyzXSxgsHStwfho?= =?us-ascii?Q?QuoabuHTmFi+D7uFlo06egz9pLWUmlmSWMBtewUjnSBgreGwuq+30blGcTHf?= =?us-ascii?Q?T0BtGu2T29EWYsUTMQkJj181vUc/0/d2L7TqWAZEveAA7MUr+aQE8hOJ6oCk?= =?us-ascii?Q?TJ1ljanlCoaoisqhhHveU+icdlbZW3aNCtvnRQgBo3MABlCcapOFmNmeVTeU?= =?us-ascii?Q?NL9sLqaxS1jkHOmmyPREWCLP5ZEuyYGTypjRQsrRFXSQ6wj5i0wwPffrhTuA?= =?us-ascii?Q?qxrKaABcl8V2TdOYL10hHYbv6Qmmv3DaG3p3f/P2cgqprRrUyjy2MPYHPOQM?= =?us-ascii?Q?0mL28zv949RJxlnS73oWVAywjyZJRJiyVIU8jVFMPHAs0o2Gifpqh7oKe3x0?= =?us-ascii?Q?rVMmVS0s3Q5Wtam3KsjUrWA6+uRMciTmEFcIigNrkY+6YYZVxGkH+T6kvFNx?= =?us-ascii?Q?0cGlbq1xpZJO/t40FSZD3a0NBYZ/r0prwrc7OP/VIVwCeK7B6LDUTcdY92LK?= =?us-ascii?Q?75ldg7tfEBEeJoSi+dOqeh6YeEWV5mJl3Ui+xdU4vWwA1fwam3tW7H/cg/bT?= =?us-ascii?Q?vLaC/ctj6nx4ZQgDuRWKzasp8dvThboj6ptcUmarTDja0Joqz88eS1jLtGmI?= =?us-ascii?Q?w72v/f3x4IfZ9iSUfWefrqGZHFI6dZos7MBCbyAoxja5Ybn7k+vWZAA9+uip?= =?us-ascii?Q?mY3IChCto5tWXkpM7H72Dq6uBe96ZfAQWkSNAolaes/Lf30nv75y9vBH0xnc?= =?us-ascii?Q?/ys6jLcjZnBC6n2EK8p7nulzyVUBotST6oEU2T+I9Waws5NcfW3ID0/nHXKn?= =?us-ascii?Q?XDIFt+Adp9bpfI4EcToPdaPgOu7eRjaO4Lgc9mNUUjYiOdZqqBZ+Q+HRyJYX?= =?us-ascii?Q?sxQszkQsQcAZb0qLf5gPxAx+YkcQ1w=3D?= X-Microsoft-Antispam-Message-Info: YYb+9mKin/1bBPf7wUQSThbxHSu+xIYNhBBeRy8Edp6QFrQ8YYaktmD0qxH+bvX+3THCESswoQXIHTNL8QlIQmVhD5dc5KlTA9y0dlJldd7Q+BZCbBhTAbWuNZTdWZSil0WHJQjB+gM3ov9V4l29LPFerHtWYTVsqz82OP0Vm4bNLsXPg3k+Z7ieAsfym30JKZ3Ms61Y0I594UBwXg0Ls+9j1165V6AXDRCfjtgPIwe0tQ2kwFEe4slfRe4RIJA+9ULqKtF0zxhUkwfQxod43qujqdf/YLLQYCzgl2Y89rZ4J2H1EtRK4dKok8SpPo1a3pD7+/ca63EBa4HKbHBhZg== X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 6:wsABmGs1UtzdCxZ/DWK/rFrvQywJDFqfq7BwrOWAgdRANZwhlEFIFU4Z77jkjVv7/XvZWUP6Bmk3GooNfaaepFrB2inx3Z88mIHfoGE2pmXs7uTilC+ZAKvxzLR2ETwsrpLHH4lMVi8ST32w7epM+Pp5ZONc31VEZneahuLey8p57mQUpbLl1KvUIivOWFvu3/ovsyhAmRQCz8+2aPA9nMRvu0FRFaRWynmkKeg0KjA5OG+FoN0LRVDf00aC9DfgYUE40DPIhYO7kt/CswbWd+ySC/vV9usmbwNHibBHS3X+3hr8FYQuPiQJ7hwH4efU2vLbKOOvDqLvQFE4uHfp4cZDAcPn83PQPFOxpS9d/Dh2ObsUZbCB0vKMzNjgqWEbs8mHiHBmr1lmvAW6vJwk/3DeIUwlRKY17xVXCtcHStxfNc6fWLjh/VEmSEg5vrWB9RrgfElHandbRQKTFaSVVw==; 5:44sZJXbsAzghffALKq1HyHBSxlc7lsrAYO1rXHcum1U/Ayu5PeALwK853cHTqVb7vkUpFZh9G8yVfjWKV4yTQpb/6jzda8kS0+71ybCfX3Tsqvyhnq48DdgHn8p1MWkRh8JwN/oNm6eloaKp5nOso0Rp4hlcMMfZRxGU/lox+SA=; 24:DwwBQoiRGw4Dz71wKe7ceAnov8nyLCmG/Zhq8qkiHpKUzBYzIItqHQx/XyoWfk6fe2JKxHYYtOxksgUOOLQS8tr95rwmZAEl/M9YDGnq5n0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 7:Rbn1RoYdpsTV2mtKNw/65j9WYBRExQmqaHmryNeZbZDy7vOhDa4xWbduc1FcCvV45qePmHHO3pnGz/dwWhZsurdpKU58TK9xWns/XAWMWXrSPn0RMnr3Xk+HBJxMvORLFgqc+cOOJaiHNFTU+8zjp7D1mM26W3SPHrygepJ+xcGiCGRqCSviObC/Cd6VXixzzGdtSMc1lbinGJtl+nDxP6Dpfxa794M7gM4xmO4PAymTcF772GGCdwtG3929gLbR X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 15:30:43.7983 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3f4c3ba-38aa-4e5e-9dbe-08d5d6c2c9ff X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3113 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=31 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=31 clxscore=1011 lowpriorityscore=0 mlxscore=31 impostorscore=0 mlxlogscore=34 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200172 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:30:49 -0000 Benjamin Kaduk wrote: > With all due respect, NIST is hardly the sole authority on this topic. True, unless of course you sell to US govt. > With my IETF Security Area Director hat on, any greenfield proposal coming > in > to the IESG that included sha1 support would get extremely strong pushback, > and I don't expect that "reducing boot time" would be seen as sufficiently > compelling. Well that's unfortunate, because reality (and sales teams) can be a pain. The number of customers who would trade boot time for improved security is depressingly small. From owner-svn-src-all@freebsd.org Wed Jun 20 15:35:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3023101F9B4; Wed, 20 Jun 2018 15:35:09 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28432801A8; Wed, 20 Jun 2018 15:35:09 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108160.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KFNsgx030828; Wed, 20 Jun 2018 08:35:06 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=NiN0V/fELmGx5OsNLJx6ZlpWuZ4Yd+OA0md941tJ+0U=; b=JCEi6w/CX520b/WwuhNd6LiLeBLPVDymstGzpUQOAA3hDtsSk/O3z63t7NH+CJWd7mXm XdgsydGxfi7IOyGmSNgM5g+wb88sBChecVER37vu4YYvTf59c+V+6mxtFjFfbYphf6SI 0Sy/twhfqE5q9Es1qSYv0FI9uzdHyGhIg0C2QN2W1twBMVZF8bQMgzOkWP7lXzi/rLv4 nQ2yeHNF0plyAz510CPQu17WvATMpcaZ2Ful8BmUd1URiIfxzD4sCygSv81dyF/7X3BV mums5+uYa8TlBvjjqi72yC4/5Bn5ZwjjUu1BRAG/1ceGr0nH95JK0pNWvChKyF0BcaQ3 /g== Received: from nam01-sn1-obe.outbound.protection.outlook.com (mail-sn1nam01lp0117.outbound.protection.outlook.com [207.46.163.117]) by mx0b-00273201.pphosted.com with ESMTP id 2jqrq584bk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Jun 2018 08:35:06 -0700 Received: from BN6PR05CA0026.namprd05.prod.outlook.com (2603:10b6:405:39::39) by BN6PR05MB3106.namprd05.prod.outlook.com (2603:10b6:404:bb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.12; Wed, 20 Jun 2018 15:35:04 +0000 Received: from BY2NAM05FT047.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::209) by BN6PR05CA0026.outlook.office365.com (2603:10b6:405:39::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.906.9 via Frontend Transport; Wed, 20 Jun 2018 15:35:04 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by BY2NAM05FT047.mail.protection.outlook.com (10.152.100.184) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 15:35:03 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Jun 2018 08:33:56 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5KFXtx7031947; Wed, 20 Jun 2018 08:33:55 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 66526644F1; Wed, 20 Jun 2018 08:33:46 -0700 (PDT) To: Cy Schubert CC: , "Stephen J. Kiernan" , src-committers , , , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: <201806201342.w5KDgMeS040038@slippy.cwsent.com> References: <201806201342.w5KDgMeS040038@slippy.cwsent.com> Comments: In-reply-to: Cy Schubert message dated "Wed, 20 Jun 2018 06:42:22 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <78785.1529508826.1@kaos.jnpr.net> Date: Wed, 20 Jun 2018 08:33:46 -0700 Message-ID: <80645.1529508826@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(39860400002)(39380400002)(396003)(376002)(346002)(2980300002)(189003)(199004)(7696005)(305945005)(478600001)(50466002)(54906003)(59450400001)(68736007)(97736004)(8936002)(55016002)(77096007)(50226002)(26005)(8676002)(76176011)(53936002)(6916009)(69596002)(5660300001)(229853002)(86362001)(81156014)(81166006)(446003)(97756001)(105596002)(7126003)(6246003)(486006)(6266002)(356003)(186003)(97876018)(126002)(476003)(23726003)(106466001)(4326008)(16586007)(316002)(9686003)(336012)(46406003)(47776003)(76506005)(53416004)(11346002)(2906002)(107886003)(117636001)(2810700001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR05MB3106; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT047; 1:Ts6yX2aXYCMdDnkb2mNq9nGd6KH0xRtfeE59YWAi4qwxKwDiw8RjcBJuP6OJmA3XeHJPqy4JedX27yCuP05p+UMjewXzLE5+e3pcKQsERC7G05Wba/qqwHXhMemGppEx X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55ef8c22-1dfe-425f-6e8d-08d5d6c364da X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:BN6PR05MB3106; X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 3:hstZhkcFyZtfJT/BhCsn33WPjPcDN83gIqEmv+EUw5u3Dp4rzJbj7hfo54Ruu+kSC1ZbTy26PkBS4EaNsb3f56Fjg7crlSnOZe6vbIrEeE1PrI6rivYifWcqyah4apFi+OEHbDNe6u8i7x077fSj+h0ShIVeSI79TowoTi3GCAHwtIaFradj6YrDN8XNzxF8oy7+/3qudUdWSGdmJmS31iQCHurI5/cl7eySV1M60jDMpdu+GK8ksY06ny5LgZ5PsQTloMgVkS0AASho+7UOT9YV8ZSag6RomuGKrjpDl31g84HDmm8o2n6gHWQqTcXyrYx+EALW4yLicawL++XV/OYUDk/S9thHbvaSC1S0kgE=; 25:gfynLY2pbPkEJIyE/tnIZ3d2c06qB6hlVDDCS2kCs3MA1YF4UQdlA1tT7N70hFCeAH3sx6i9ZoGXVnyWudYqJH6qUJp8hinChh+yQDLawz9bou7p53nk57U2FwJhYGEJoblCxi1COpS3UKUQbOVoetzkxl0vwDI9NRM0yWKUAKr4Jr6YJjZJowvwTBAkb0yarsXJcRj6MfZ0XbHx8mLZCplOTRA//BU/QFkmt3+oe647quVYV+GVieEb2AM02/AGQ9k3JhSTlBtQiXgv/of0U5awR0I3cCFCZ6dpNPjd9zW8g3xdiOuQg1kLG22R31t0QGk/cTzw9Edu7muzkU9ByQ== X-MS-TrafficTypeDiagnostic: BN6PR05MB3106: X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 31:g9AJTBb4g6hzKPvuDD4irJOakxxsnzO/sdVqiAQ89h5hjkcL/OqiQN8rc7wwjEEjPKPrh2rnu6N0fUUiXqTKpgOyQ1itbLp82HDZbms3RMTctFu0RtpWdNIK0iEU5M/kvKYIdLfZFyaA6joRZSpLL1cBB2ouEXoRO3PcKF6DW3gBeyJNRu7CyqodWBCBSzOVgcjwVnrkwk1R2Q9BWvfaOVjYE1eZC1WUcyobc7FNbto=; 20:j4Zrwws/0jJFrtjCoCOJ8YMxOjmrFa8/9P5pj6+YLSKWfH/fSEkmvbBiRx4xkOCyOa8iNphWuTpXKkmmiCSQfAA1VDXPtEa1PijqyzjJJn/ExVJV1iArm/dXaJ9UGn4W7nHJTyTGIhThuiMGYASrfmOKxYm5geUsYqQ+ipiZ3bkNL3gBCW5kze5b6qrBHV61AtNN9FbdvIGRgjhy+m72b6GGBXomOKWr85LUYw4qOs1f0darfb8vfVmxwA4tScHvX+HTlDhm/dP8B0btD/F9dHHWEZkeW8/1yij2OM7LfxMM7ZZ4dLA4N63M7wPXs9OcHWG8+BL4AEwMjmjt4V2LHlLd43qXoTR1Zr9YCzDjBpm4SqyTwnjfdd5g2Bd/0YWvXaaECjnC2ABEtAvRzteeNEShmWvqLJLo90R2ArN1hP4HHevaK4toNS9nFQb9NwLQSHLCbD5qDD1riaLKRZl2t8OvbyLJ7z+lK6M1clUPFvTIo6oONqO1JLr+zFLorF+d X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:BN6PR05MB3106; BCL:0; PCL:0; RULEID:; SRVR:BN6PR05MB3106; X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 4:BkQ+/buFNWyzHoWU6HFnyuq6Znt4VbW35jGE/TmhnP7jlgK7HFbylCX8+qUmeuwYIAS5PVPvOx78RfXVgtxid1IF7Hwh1s9m5kRvVeqUyDUgYk6AlqxI2RlIVpPfJK1sAAMiMYIIQ4sQKXTqAfCHFQBQ59+cjlYrZUNWZ0fvVhms12YW7vk5Y9skMhl4DvNL61PwLd6F9QhIf/T9BiDJgw+fVgXBZfDrb9hJtlZDG/Ciwpmjy0yGVhTFJ4RAm968zDNqHOVJHsnBzyRa8q46YeDBhXL1y2sJk8Wp0O3rDq85dSY0BNtSnmRUTgWJJPuw X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR05MB3106; 23:W5cKSqvdzKKaSQwmO5RGtYnyAgWZnn0JwcrRNndJ5?= =?us-ascii?Q?jSjrCZ1t4HT0FooD0ekK6Z4GddXlPBkSErJPzHKo75dOYXzERjfTZ/IVsBqg?= =?us-ascii?Q?+uA79paFGurVYANaXYKJWldbgoAzknvOweg3mA5W/A90PBwM6HcD9juTYhdX?= =?us-ascii?Q?XZejCz4iHov4ZZacnIHzvFqDm5YxDHWjVU49dyBB1D9C96n0efGn2D5L4DBS?= =?us-ascii?Q?eC9NDwNvTFCcemmdj6Wk9Px1iPZqL7v9wIIPSwjgJTx9lzkrHKLbnK9MqWI5?= =?us-ascii?Q?Q7vFjkcUTpHjgiZM/wvNqQN3fhYw0rrPaaqyntqpipsHkv7ow2y3fiI7dGW6?= =?us-ascii?Q?oKr0aa1Quk6ILMQ/Kqd/NNsIXJwQrzd48Kqwm12dDHk8FW15LGnwrKiYqBAo?= =?us-ascii?Q?RYRp1uKA/McfQij3XbdtjTA4n6mILj+nJ0IpGsL0Db5FyvrsXlNDA1enxktB?= =?us-ascii?Q?+zQqrwU911njrTnTq6n06SOM3P0OETh26pl35XzQN3xKuyLUuzT87qKPm3yq?= =?us-ascii?Q?fMMiblP7Jon6K3HEVavk2gfUVAM21aTMG0z27NgEvAav5wrehVBOTifwR8dO?= =?us-ascii?Q?rN9WIqi9u6gl8b/ZkYCfL4oh2Tg815Fn1PD7QvfiTuDvD+Y/VgvgIwrOOOow?= =?us-ascii?Q?W6YncxYvnPX2tV6lGmPt34MH3fNzfxrGIg2YDxj//O7D9My5gJkO7CHE3VZ9?= =?us-ascii?Q?HsWSPIO1TorrtV/V8vXA7LHOsUkoX8oGNs397xD0NlmBfxo9Aq4sn1hDXzFD?= =?us-ascii?Q?E0uyoE3PhSnmQBVfESvh0KSr2ejtw82TH8oOGm/9Or/5qI/MirE3iDcXCsq7?= =?us-ascii?Q?XRtl6aYa/S4oKUexN5NIE+aZUNvQMhGI4ohEsMUmOg2M1wOHUueN/HJIKKpL?= =?us-ascii?Q?fd+feciW9psDSFso42N+mhbxnuMKMtL2hMKu+3Ns+6X27ogc9XQwEF1F29+z?= =?us-ascii?Q?rcFNtJAY5Ja0XDPQpuqGDU8IW3md1Kjgwx8MkNmY6d5eyi5O66JqenlMfvEz?= =?us-ascii?Q?kglZUpi0s5fsFxDuYpHCq/a5M5BSsAVtMvs32XNyxF0cnd0IVL2mczf1g8h6?= =?us-ascii?Q?+7XMcZ9mEYqWTJfeaRIjAc7m6OhXDTchX8tACGJIrONaK7UqHKyRQHM2HoKu?= =?us-ascii?Q?Aq2sfCCCYk5VGYJ/lQF3TjzCmb2x0ISzEzkUex5zb26g8dywxRtPyuolu4/b?= =?us-ascii?Q?qCR+6W6GcLaOe4n35HN6erXkBgPedhM7SFsvBJ59zz56Fo7PD97WWniRI3Aa?= =?us-ascii?Q?5Pe8ZBT2MskevrbSAhuOSRAHTeQluIXbHMLExef0pWYDIxXCRTKIfnQyHdo7?= =?us-ascii?Q?a8YjVsOWCz+RzyhnMKJQI78Zp05LYuU1EAsp8qoh4o9UPAhFK8C5Z+dwiNnV?= =?us-ascii?Q?TNkpg=3D=3D?= X-Microsoft-Antispam-Message-Info: +gx480JDvzwXN1z41AnZNe84pBeb1o98kyaz+OPgKJ0M1lV4NICjsrHCYcZ9m3xKr5o+9EhxWX9CqoFoUae8ReFgvGXe2WWm2puhRCKjmUZfOX9hq7XUQAhF9BIzBNlt45p2XN2Ref0m6I375axrT+4MEvU9107XZDSISwnTf+XJ2kRZPMB6qSf8JFDz5wIXaO1wwkZ7u+RkE4VhPOky2f17y0knpG6jQe64r3PvlbmdcQnEA1yr2ErWmDG4p/qIld8DjewcASxD6C1NmfImFF//9dj8EPFixBAZjZxYRoo9iLKsh5TKkBC/GQLiAlyaqJiNUUf2BV0BT8te4T+5Jw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 6:J8oRTgt/hKZ3Hpsnn9D5GaK9+TvYF/tsODx+IX03LyhWifChxqBKxWjFS/3qY9qtKqL9tzaTtXpCWbYdHCTrcqCZe829+5SN0l+3gFzb3DgBSVYQrrVlxHOGT30/7e08q5z3YKU7p+7TcYCJvf1BUzXwv8DM6a7m2CIknqE5sUnTpmjCFR2i8V2IMT8nbcAmlfQ7Ij97lW9CDUqKP1kcYUQzXifd/uAjFlnlxawDviQcXz1IfWQFTJWEXUBpBIu0+2JGGsY0MWNvGoZXyOt6XjT00+URQrzuw4KH3nsFj70FsbwcRUWGBx7GqfK7zQZw76HQxyZ4R+LE7Ea4uFRjMFxAlJtCAirxBpEGpwWX25NR48csGIaudyTljVMzzFu72A0h/E1BBU72KeGd3kWehmkxX/UDOvzQC49sGgJ009iIWAqx/2H/MvcWsD3MFik31XbHnXJ33MLzmvbRg84ysA==; 5:liRyGHw0lEnk91Vc4emlW6EIpML4g+RXuaNfddxnqa5ttsvAvllE6eo/+sjLkkPWELDrCRMdmLs8gZhFv0OmHpCSrt+IAZFNwMuHsxYo6sEIXocGqC6ucNywGpxNXgh5zkfyAV66nGeVJTvNSXUNK28tyqil2f1sX90Iv5X0USA=; 24:4QJdD983c0ysLX4VLfbyRrPVHRTTrawzEvRIM29rEGrCT3hWYswJOOnouIHqlVZgHV/r5TBp6elK+aBm6xUxqJ0NueEudh27bKf6JQKW7bg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 7:SAPYeATlat3E5mGgOJoAq+WqjR0DE5Sx/ZzXtani0jteDk88HqezcobmkeD2lfUHub0r/dYI3PQgoBMRxWEt9DqEaZoVdq36AQ0jPejNevQ5vhhVpyod8ttY+pFbaEd9umEOizUfFPDxgf8lMdW4FqPm33/VPdbZp8Wh0pLoqii9wxgdMmX7juoubU+eOM0+Ltzes1SG+2lFHmJznht/M9tAGDauL+tkyT2MgGrEUpFdillgp8X/6JV/rqXUiIH9 X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 15:35:03.9140 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55ef8c22-1dfe-425f-6e8d-08d5d6c364da X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR05MB3106 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200172 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:35:10 -0000 Cy Schubert wrote: > > The signing of manifests is external. The veriexecctl tool is I assume > > a straight copy of what's in NetBSD (I've not looked at it in at least a > > decade). > > If this is correct, should it not be imported into the vendor branches > first? > > What are the criteria to import through the vendor branches v.s. direct > import into HEAD? Do I fail to understand a missing piece of > information or is there an inconsistency? AFAIK the key is whether there is an upstream project that will be tracked, which is not the case here. The ctl tool is the only bit that bears any relationship to the NetBSD code - because we never used it. Once I commit the loader stuff, we can replace the above with something more useful - can leverage the same library to verify manifest signatures. From owner-svn-src-all@freebsd.org Wed Jun 20 15:36:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3150A101FB42; Wed, 20 Jun 2018 15:36:45 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id BCB258037E; Wed, 20 Jun 2018 15:36:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 5BD2F25D38A5; Wed, 20 Jun 2018 15:36:42 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id BB0A1D1F804; Wed, 20 Jun 2018 15:36:41 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id y0gWMBmL3cof; Wed, 20 Jun 2018 15:36:40 +0000 (UTC) Received: from [192.168.124.1] (unknown [IPv6:fde9:577b:c1a9:31:2ef0:eeff:fe03:ee34]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 952C6D1F800; Wed, 20 Jun 2018 15:36:40 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Conrad Meyer" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335437 - in head: share/man/man4 sys/kern Date: Wed, 20 Jun 2018 15:36:40 +0000 X-Mailer: MailMate (2.0BETAr6113) Message-ID: <4A6E03A6-B870-46C0-A1BD-76B09FE15CE5@FreeBSD.org> In-Reply-To: References: <201806200834.w5K8YThd082989@repo.freebsd.org> 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:36:45 -0000 On 20 Jun 2018, at 15:05, Conrad Meyer wrote: > Hi Bjoern, > > It might be nice to be explicit that the vnode was not in the > namecache (in the ddb output) rather than failing silently. The name > of the ddb method does not suggest that only entries in the namecache > may be found, and users (developers :)) do not always read manual > pages thoroughly. It’s not failing silently; it ends with an address w/o name. /bz From owner-svn-src-all@freebsd.org Wed Jun 20 15:53:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 048031020A96; Wed, 20 Jun 2018 15:53:03 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f44.google.com (mail-it0-f44.google.com [209.85.214.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A5B0811A0; Wed, 20 Jun 2018 15:53:02 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f44.google.com with SMTP id 188-v6so296672ita.5; Wed, 20 Jun 2018 08:53:02 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=dygelkcvzKirwgc7EP5sxXYpgJX9Dna6eJXDYvRZZ9s=; b=KYsYHeLWA0l3XlibyioRR0ehkgP+OaVYWxbo9HyyETVh+0aGSL02tgo8e9s4+rXW4f H/SvQigfxQYzJucgTFYDU4fkoZc888ged8xhdNVOg+3Zlo1Jj62lA8hUbOJ7HhlnwQMM UiJDxM8SRPW3wictvAGfiLkSsPVUnV2oKzdfAvtZNW4ttBHdIp6y1B5lIo0+yUdVmnqE BazWbBhgdLN9Gbhs+f1AvuH4JePAjRlit2SYDIt3TSAefyQ99xinH4atSPmLat++55Ux XGOxp52krhOY/0j6IEV6cG0DOLWGvBd2tk9DghlH+Q8XJ4/PkyTFVwvI4FMcQEbgHcAA Jblg== X-Gm-Message-State: APt69E141dc5oYebWYqSzuHEwSJUSSHsa2LcMnxAL+q2s/PX96COcg5V 0DNQodZ+Hd2vAJe33lSXpJaI5vRj X-Google-Smtp-Source: ADUXVKL19a4ol8Cbw2S8kDbG299j4xNs7PMqPcWMsCk4Q7pkLlI43dMptQz9wwOOy4iEX8ILfnv6tQ== X-Received: by 2002:a24:9ec5:: with SMTP id p188-v6mr1991553itd.79.1529509554384; Wed, 20 Jun 2018 08:45:54 -0700 (PDT) Received: from mail-io0-f176.google.com (mail-io0-f176.google.com. [209.85.223.176]) by smtp.gmail.com with ESMTPSA id k8-v6sm1002497ioj.55.2018.06.20.08.45.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 08:45:54 -0700 (PDT) Received: by mail-io0-f176.google.com with SMTP id f1-v6so167660ioh.6; Wed, 20 Jun 2018 08:45:54 -0700 (PDT) X-Received: by 2002:a6b:1a53:: with SMTP id a80-v6mr17106473ioa.143.1529509554006; Wed, 20 Jun 2018 08:45:54 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 08:45:53 -0700 (PDT) In-Reply-To: <17033.1529508519@kaos.jnpr.net> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> From: Conrad Meyer Date: Wed, 20 Jun 2018 08:45:53 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Simon J. Gerraty" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Stephen J. Kiernan" Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:53:03 -0000 You can keep these poor security modes in your downstream product if you want, but don't put them in the tree. On Wed, Jun 20, 2018 at 8:28 AM, Simon J. Gerraty wrote: > Benjamin Kaduk wrote: >> With all due respect, NIST is hardly the sole authority on this topic. > > True, unless of course you sell to US govt. > >> With my IETF Security Area Director hat on, any greenfield proposal coming >> in >> to the IESG that included sha1 support would get extremely strong pushback, >> and I don't expect that "reducing boot time" would be seen as sufficiently >> compelling. > > Well that's unfortunate, because reality (and sales teams) can be a > pain. The number of customers who would trade boot time for improved > security is depressingly small. > From owner-svn-src-all@freebsd.org Wed Jun 20 15:56:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAED51020DE1; Wed, 20 Jun 2018 15:56:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f43.google.com (mail-it0-f43.google.com [209.85.214.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6037981411; Wed, 20 Jun 2018 15:56:55 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f43.google.com with SMTP id j135-v6so356034itj.1; Wed, 20 Jun 2018 08:56:55 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=AnJJG9N+glmZUa9M3knJzhqILgUqBskuaNv8DbysHYY=; b=ZmRdyiHjjd3QH9WNbHh6VCWlpELhJhL3bb4eNu+iQcgpNWnJRsDFj9pDLivbfQ+935 ouMi9xAEvcpXN8kJSddYUgkLMms7srqiccaA2VcLCcQBOpup/6Aa8UayI1ZoN3vsiMVz gFH9iTe3j20BJyJ2c3lRFLuVp0pNGoFEgrXGH1pl4DluPk+cqp6XRL9Q7C396Bp8dp1e HoLx0s/aKgHiNUd1S8JqiKI3Ml0HxX6ILPrcKLrH9JXG+/LUBRy7HRYMZQ1+Xgs64YPx kp+c53KTpJDGzetYEAObPypgKAzlCrn+dIcywa2seisn74BZZyA1UeudwRN0VKyuWEhE 6XAw== X-Gm-Message-State: APt69E3tEF5pnSMLwg56FcEVOkQIoK/e+L5b/5IgO/UGb3N0JZbKRZZn fFtvbkZk2f7LRQdxzpVPKdWLd48X X-Google-Smtp-Source: ADUXVKKv0cwFlGYucnMBZheAgLU06cuh7QJF0KuxT1d6kp+8KwSCeQcca/LFrZdG14fVDpW20bv7OA== X-Received: by 2002:a24:ed84:: with SMTP id r126-v6mr1886815ith.59.1529509723117; Wed, 20 Jun 2018 08:48:43 -0700 (PDT) Received: from mail-it0-f49.google.com (mail-it0-f49.google.com. [209.85.214.49]) by smtp.gmail.com with ESMTPSA id t13-v6sm1005293ioa.72.2018.06.20.08.48.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 08:48:43 -0700 (PDT) Received: by mail-it0-f49.google.com with SMTP id a195-v6so291746itd.3; Wed, 20 Jun 2018 08:48:43 -0700 (PDT) X-Received: by 2002:a02:8509:: with SMTP id g9-v6mr17997982jai.54.1529509722901; Wed, 20 Jun 2018 08:48:42 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 08:48:42 -0700 (PDT) In-Reply-To: <4A6E03A6-B870-46C0-A1BD-76B09FE15CE5@FreeBSD.org> References: <201806200834.w5K8YThd082989@repo.freebsd.org> <4A6E03A6-B870-46C0-A1BD-76B09FE15CE5@FreeBSD.org> From: Conrad Meyer Date: Wed, 20 Jun 2018 08:48:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335437 - in head: share/man/man4 sys/kern To: "Bjoern A. Zeeb" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:56:56 -0000 On Wed, Jun 20, 2018 at 8:36 AM, Bjoern A. Zeeb wrote: > On 20 Jun 2018, at 15:05, Conrad Meyer wrote: > >> Hi Bjoern, >> >> It might be nice to be explicit that the vnode was not in the >> namecache (in the ddb output) rather than failing silently. The name >> of the ddb method does not suggest that only entries in the namecache >> may be found, and users (developers :)) do not always read manual >> pages thoroughly. > > It=E2=80=99s not failing silently; it ends with an address w/o name. Hi, To provide a more concrete proposal, would you object to the following? 0xfoobarbaz: Thanks, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 15:58:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AD8791020EF9 for ; Wed, 20 Jun 2018 15:58:22 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3681481593 for ; Wed, 20 Jun 2018 15:58:22 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c07792fc-74a2-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id c07792fc-74a2-11e8-8837-614b7c574d04; Wed, 20 Jun 2018 15:58:20 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5KFwJdH082031; Wed, 20 Jun 2018 09:58:19 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529510299.24573.5.camel@freebsd.org> Subject: Re: svn commit: r335402 - head/sbin/veriexecctl From: Ian Lepore To: cem@freebsd.org, "Simon J. Gerraty" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 09:58:19 -0600 In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:58:22 -0000 On Wed, 2018-06-20 at 08:45 -0700, Conrad Meyer wrote: > You can keep these poor security modes in your downstream product if > you want, but don't put them in the tree. > And I request exactly the opposite: reject the complaining of people who think all the world is a 256-core 5ghz server and leave in the option to use faster algorithms on real-world hardware used by real- world vendors who need some option other than "rev your hardware every 18 months to keep up with the software or get out of the business." Stronger algorithm options, yes. Even making stronger options the default, yes. But removing viable options which are endorsed by the people who actually set the standards, no. - Ian > On Wed, Jun 20, 2018 at 8:28 AM, Simon J. Gerraty > wrote: > > > > Benjamin Kaduk wrote: > > > > > > With all due respect, NIST is hardly the sole authority on this > > > topic. > > True, unless of course you sell to US govt. > > > > > > > > With my IETF Security Area Director hat on, any greenfield > > > proposal coming > > > in > > > to the IESG that included sha1 support would get extremely strong > > > pushback, > > > and I don't expect that "reducing boot time" would be seen as > > > sufficiently > > > compelling. > > Well that's unfortunate, because reality (and sales teams) can be a > > pain.   The number of customers who would trade boot time for > > improved > > security is depressingly small. > > From owner-svn-src-all@freebsd.org Wed Jun 20 15:59:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B68841021003 for ; Wed, 20 Jun 2018 15:59:37 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 357C78170B for ; Wed, 20 Jun 2018 15:59:37 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: aee83174-74a0-11e8-8837-614b7c574d04 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.ore.mailhop.org (Halon) with ESMTPSA id aee83174-74a0-11e8-8837-614b7c574d04; Wed, 20 Jun 2018 15:43:32 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5KFhV4q081984; Wed, 20 Jun 2018 09:43:31 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529509411.20460.83.camel@freebsd.org> Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot From: Ian Lepore To: Konstantin Belousov , Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Jun 2018 09:43:31 -0600 In-Reply-To: <20180620092238.GK2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 15:59:38 -0000 On Wed, 2018-06-20 at 12:22 +0300, Konstantin Belousov wrote: > On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > > > > On 2018-06-17 07:32, Eugene Grosbein wrote: > > > > > > 17.06.2018 10:18, Allan Jude wrote: > > > > > > > > > > > Author: allanjude > > > > Date: Sun Jun 17 03:18:56 2018 > > > > New Revision: 335276 > > > > URL: https://svnweb.freebsd.org/changeset/base/335276 > > > > > > > > Log: > > > >   gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early > > > >    > > > >   Normally the serial console is not enabled until /boot.config is read and > > > >   we know how the serial console should be configured.  Initialize the > > > >   consoles early in 'dual' mode (serial & keyboard) with a default serial > > > >   rate of 115200. Then serial is re-initialized once the disk is decrypted > > > >   and the /boot.config file can be read. > > > >    > > > >   This allows the GELIBoot passphrase to be provided via the serial console. > > > >    > > > >   PR: 221526 > > > >   Requested by: many > > > >   Reviewed by: imp > > > >   Sponsored by: Klara Systems > > > >   Differential Revision: https://reviews.freebsd.org/D15862 > > > I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports > > > hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing > > > missing serial ports. I even could reproduce that with VirtualBox machine configured > > > with no serial ports (not same as existing bug inactive serial port). > > > > > > Should there be some way to disable this serial ports configuration at compile time? > > > > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > > one by default, because it is safer. Then you can just use > > 'gptboot-serial' if you want serial support. > > > > This will likely make Warner a bit sad, since we are just finally > > getting around to reducing the number of different bootcode files. > I think we should follow the hardware trends there and apply a policy > where new features are not added to the CSM boot. All modern machines > can be booted in UEFI mode, and if some modern machine cannot, then we > need it fixed.  We should encourage users to make new installs boot by > UEFI. > > The feature from the commit is only relevant for machines that require > CSM boot or do not have UEFI option at all, am I right ? With the policy > applied, an additional CSM-boot bootblock would be not shipped. > I think it is far too early to say that the code for booting without efi is abandonware. I have half a dozen x86 boxes in use here, and only one of them is even able to boot efi, and its default resolution in efi mode confuses the kvm switch it's connected to, so even on that I have to use legacy bios boot. However, I'm not sure we need to make a prepackaged gptboot binary that has serial prompting for geli passwords. That's a pretty specialized need that can be handled by people building WITH_GPTBOOT_SERIAL or some similar option and installing it themselves. -- Ian From owner-svn-src-all@freebsd.org Wed Jun 20 16:00:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA3EE1021079 for ; Wed, 20 Jun 2018 16:00:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 0BC6A81853 for ; Wed, 20 Jun 2018 16:00:01 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: f5b54d26-74a2-11e8-afd2-4ddcc8249dd4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id f5b54d26-74a2-11e8-afd2-4ddcc8249dd4; Wed, 20 Jun 2018 15:59:50 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5KFxm8U082038; Wed, 20 Jun 2018 09:59:48 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529510388.24573.6.camel@freebsd.org> Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot From: Ian Lepore To: Konstantin Belousov , Allan Jude Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Jun 2018 09:59:48 -0600 In-Reply-To: <20180620092238.GK2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:00:03 -0000 On Wed, 2018-06-20 at 12:22 +0300, Konstantin Belousov wrote: > On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > > > > On 2018-06-17 07:32, Eugene Grosbein wrote: > > > > > > 17.06.2018 10:18, Allan Jude wrote: > > > > > > > > > > > Author: allanjude > > > > Date: Sun Jun 17 03:18:56 2018 > > > > New Revision: 335276 > > > > URL: https://svnweb.freebsd.org/changeset/base/335276 > > > > > > > > Log: > > > >   gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early > > > >    > > > >   Normally the serial console is not enabled until /boot.config is read and > > > >   we know how the serial console should be configured.  Initialize the > > > >   consoles early in 'dual' mode (serial & keyboard) with a default serial > > > >   rate of 115200. Then serial is re-initialized once the disk is decrypted > > > >   and the /boot.config file can be read. > > > >    > > > >   This allows the GELIBoot passphrase to be provided via the serial console. > > > >    > > > >   PR: 221526 > > > >   Requested by: many > > > >   Reviewed by: imp > > > >   Sponsored by: Klara Systems > > > >   Differential Revision: https://reviews.freebsd.org/D15862 > > > I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports > > > hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing > > > missing serial ports. I even could reproduce that with VirtualBox machine configured > > > with no serial ports (not same as existing bug inactive serial port). > > > > > > Should there be some way to disable this serial ports configuration at compile time? > > > > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > > one by default, because it is safer. Then you can just use > > 'gptboot-serial' if you want serial support. > > > > This will likely make Warner a bit sad, since we are just finally > > getting around to reducing the number of different bootcode files. > I think we should follow the hardware trends there and apply a policy > where new features are not added to the CSM boot. All modern machines > can be booted in UEFI mode, and if some modern machine cannot, then we > need it fixed.  We should encourage users to make new installs boot by > UEFI. > > The feature from the commit is only relevant for machines that require > CSM boot or do not have UEFI option at all, am I right ? With the policy > applied, an additional CSM-boot bootblock would be not shipped. > I think it is far too early to say that the code for booting without efi is abandonware. I have half a dozen x86 boxes in use here, and only one of them is even able to boot efi, and its default resolution in efi mode confuses the kvm switch it's connected to, so even on that I have to use legacy bios boot. However, I'm not sure we need to make a prepackaged gptboot binary that has serial prompting for geli passwords. That's a pretty specialized need that can be handled by people building WITH_GPTBOOT_SERIAL or some similar option and installing it themselves.  -- Ian From owner-svn-src-all@freebsd.org Wed Jun 20 16:03:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E9F201021492; Wed, 20 Jun 2018 16:03:26 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52BE881D20; Wed, 20 Jun 2018 16:03:26 +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 ESMTP id w5KG3FqI018451; Wed, 20 Jun 2018 19:03:18 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5KG3FqI018451 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5KG3FT7018450; Wed, 20 Jun 2018 19:03:15 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Jun 2018 19:03:15 +0300 From: Konstantin Belousov To: Ian Lepore Cc: Allan Jude , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot Message-ID: <20180620160315.GO2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> <1529509411.20460.83.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1529509411.20460.83.camel@freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:03:27 -0000 On Wed, Jun 20, 2018 at 09:43:31AM -0600, Ian Lepore wrote: > On Wed, 2018-06-20 at 12:22 +0300, Konstantin Belousov wrote: > > On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > > > > > > On 2018-06-17 07:32, Eugene Grosbein wrote: > > > > > > > > 17.06.2018 10:18, Allan Jude wrote: > > > > > > > > > > > > > > Author: allanjude > > > > > Date: Sun Jun 17 03:18:56 2018 > > > > > New Revision: 335276 > > > > > URL: https://svnweb.freebsd.org/changeset/base/335276 > > > > > > > > > > Log: > > > > > š gptboot, zfsboot, gptzfsboot: Enable the video and serial consoles early > > > > > šš > > > > > š Normally the serial console is not enabled until /boot.config is read and > > > > > š we know how the serial console should be configured.ššInitialize the > > > > > š consoles early in 'dual' mode (serial & keyboard) with a default serial > > > > > š rate of 115200. Then serial is re-initialized once the disk is decrypted > > > > > š and the /boot.config file can be read. > > > > > šš > > > > > š This allows the GELIBoot passphrase to be provided via the serial console. > > > > > šš > > > > > š PR: 221526 > > > > > š Requested by: many > > > > > š Reviewed by: imp > > > > > š Sponsored by: Klara Systems > > > > > š Differential Revision: https://reviews.freebsd.org/D15862 > > > > I had several cases when booting FreeBSD/amd64 with motherboard having no serial ports > > > > hang hard early at boot unless I rebuilt boot media configuring it to NOT try accessing > > > > missing serial ports. I even could reproduce that with VirtualBox machine configured > > > > with no serial ports (not same as existing bug inactive serial port). > > > > > > > > Should there be some way to disable this serial ports configuration at compile time? > > > > > > > > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > > > one by default, because it is safer. Then you can just use > > > 'gptboot-serial' if you want serial support. > > > > > > This will likely make Warner a bit sad, since we are just finally > > > getting around to reducing the number of different bootcode files. > > I think we should follow the hardware trends there and apply a policy > > where new features are not added to the CSM boot. All modern machines > > can be booted in UEFI mode, and if some modern machine cannot, then we > > need it fixed.ššWe should encourage users to make new installs boot by > > UEFI. > > > > The feature from the commit is only relevant for machines that require > > CSM boot or do not have UEFI option at all, am I right ? With the policy > > applied, an additional CSM-boot bootblock would be not shipped. > > > > I think it is far too early to say that the code for booting without > efi is abandonware. I have half a dozen x86 boxes in use here, and only > one of them is even able to boot efi, and its default resolution in efi > mode confuses the kvm switch it's connected to, so even on that I have > to use legacy bios boot. I do not propose to abandon bios boot, or even to declare it legacy with the proper meaning. I mean that CSM is disappearing on the newest platforms, and should become only used on old machines or i386. With that attitude, adding a features for it, esp. by the cost of the user confusion, is not worth the efforts. It still should be maintained for the foreseable future. If the machines where you get the trouble is newer than say 5 years, then they should boot with UEFI. If not, the problem in loader.efi needs to be fixed. From owner-svn-src-all@freebsd.org Wed Jun 20 16:05:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A0301021633 for ; Wed, 20 Jun 2018 16:05:18 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22f.google.com (mail-io0-x22f.google.com [IPv6:2607:f8b0:4001:c06::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BBC3981EC9 for ; Wed, 20 Jun 2018 16:05:17 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22f.google.com with SMTP id e15-v6so246311iog.1 for ; Wed, 20 Jun 2018 09:05:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iGxP+kmEZ3/inUNZaBAPW0+ZedymMIc/mPlWUoepGKw=; b=K6zfz02daisV3pFR/12p1zhFInGlqOvC2DAGLktAwudZrloJw5JOIox6YXZZn12SLb DH8F8jnYBJLP2v/EXQ/con4Q36U+oqYccEHoETy1CCynfIvknaoYGx9i1HtyRSEZzbuS xK3UAJIQViEjL00xg2Hyl6Mg5tTUGhjtPIc542FGXWE11S64KNeL6ALp089cX82iTBxx +n7qeArAigBNVt3hh2zFfZH1XrctDcW5qtWDoaIss/vLnyep4kzR2er+ZUglHO5blXUD eXEvTw6oILSlbmZv2aE5w/3HilqywURTZQvlb3zsGDMHwfQ+SK9GucWn0JGqza4vLzJd QFaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=iGxP+kmEZ3/inUNZaBAPW0+ZedymMIc/mPlWUoepGKw=; b=RVR0/lhSgrh/sAK0tp+aEoO9Co4daWvHAiWiZtSfyNVMv1XbT8tT/TlUxQOMaYDa1f ecGt//8QrHSk8lMU5KSI6QHduyMbemUndcV54lVO8y+XFbq9wh5JsAySzxs2SAUkYp62 d8PJMxOYbHRbjiYRlVXoKgybsZHdWuLq6lIA3ZWXRaFksdgSjfJA6d2GXX1gMT4caig1 E0NYCTo5k6IJjP6WGcTNzHYFFgQ0xh28T6S3LLG0lGRbMtnl9Nkki3LvPeDHYfFopobh CqX4rw6wveqDMdmnbDQCJn1qqkZIY0A4eoJCkEdBSfttLQ6PKgixQH52KmzjcBlCEJpZ +mPw== X-Gm-Message-State: APt69E3WAo//VlnsGp2LDvQ/DWZutgWXBbq8XxO4ybJbIJwSlTt0+E8P KCUSe/d3SXnxAGcReGmVmL7u0pL7t5o1RRv5gve9qw== X-Google-Smtp-Source: ADUXVKKjakZxJmLmQXHOxRvAb8AuCYod25qMysb09ncT+WpAk+qVGJCWXNMKfxC1EHueUT1h6GJGlQTiKZjV3mRNHPg= X-Received: by 2002:a6b:29c4:: with SMTP id p187-v6mr17122563iop.299.1529510716963; Wed, 20 Jun 2018 09:05:16 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 09:05:16 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <20180620160315.GO2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> <1529509411.20460.83.camel@freebsd.org> <20180620160315.GO2430@kib.kiev.ua> From: Warner Losh Date: Wed, 20 Jun 2018 10:05:16 -0600 X-Google-Sender-Auth: 5FU9VODdaeCuYaGXXy0IujqMp1s Message-ID: Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot To: Konstantin Belousov Cc: Ian Lepore , Allan Jude , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:05:18 -0000 On Wed, Jun 20, 2018 at 10:03 AM, Konstantin Belousov wrote: > On Wed, Jun 20, 2018 at 09:43:31AM -0600, Ian Lepore wrote: > > On Wed, 2018-06-20 at 12:22 +0300, Konstantin Belousov wrote: > > > On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > > > > > > > > On 2018-06-17 07:32, Eugene Grosbein wrote: > > > > > > > > > > 17.06.2018 10:18, Allan Jude wrote: > > > > > > > > > > > > > > > > > Author: allanjude > > > > > > Date: Sun Jun 17 03:18:56 2018 > > > > > > New Revision: 335276 > > > > > > URL: https://svnweb.freebsd.org/changeset/base/335276 > > > > > > > > > > > > Log: > > > > > > gptboot, zfsboot, gptzfsboot: Enable the video and serial > consoles early > > > > > > > > > > > > Normally the serial console is not enabled until /boot.config > is read and > > > > > > we know how the serial console should be > configured. Initialize the > > > > > > consoles early in 'dual' mode (serial & keyboard) with a > default serial > > > > > > rate of 115200. Then serial is re-initialized once the disk is > decrypted > > > > > > and the /boot.config file can be read. > > > > > > > > > > > > This allows the GELIBoot passphrase to be provided via the > serial console. > > > > > > > > > > > > PR: 221526 > > > > > > Requested by: many > > > > > > Reviewed by: imp > > > > > > Sponsored by: Klara Systems > > > > > > Differential Revision: https://reviews.freebsd.org/D15862 > > > > > I had several cases when booting FreeBSD/amd64 with motherboard > having no serial ports > > > > > hang hard early at boot unless I rebuilt boot media configuring it > to NOT try accessing > > > > > missing serial ports. I even could reproduce that with VirtualBox > machine configured > > > > > with no serial ports (not same as existing bug inactive serial > port). > > > > > > > > > > Should there be some way to disable this serial ports > configuration at compile time? > > > > > > > > > > > > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > > > > one by default, because it is safer. Then you can just use > > > > 'gptboot-serial' if you want serial support. > > > > > > > > This will likely make Warner a bit sad, since we are just finally > > > > getting around to reducing the number of different bootcode files. > > > I think we should follow the hardware trends there and apply a policy > > > where new features are not added to the CSM boot. All modern machines > > > can be booted in UEFI mode, and if some modern machine cannot, then we > > > need it fixed. We should encourage users to make new installs boot by > > > UEFI. > > > > > > The feature from the commit is only relevant for machines that require > > > CSM boot or do not have UEFI option at all, am I right ? With the > policy > > > applied, an additional CSM-boot bootblock would be not shipped. > > > > > > > I think it is far too early to say that the code for booting without > > efi is abandonware. I have half a dozen x86 boxes in use here, and only > > one of them is even able to boot efi, and its default resolution in efi > > mode confuses the kvm switch it's connected to, so even on that I have > > to use legacy bios boot. > I do not propose to abandon bios boot, or even to declare it legacy > with the proper meaning. I mean that CSM is disappearing on the newest > platforms, and should become only used on old machines or i386. With that > attitude, adding a features for it, esp. by the cost of the user confusion, > is not worth the efforts. It still should be maintained for the foreseable > future. > > If the machines where you get the trouble is newer than say 5 years, > then they should boot with UEFI. If not, the problem in loader.efi > needs to be fixed. > There is no problem in loader.efi that's specific to geli. It already uses the UEFI boot loader config. While there's some issues downstream (eg kernel messages), this specific issue is a non-issue for loader.efi. Warer From owner-svn-src-all@freebsd.org Wed Jun 20 16:07:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD2D11021815; Wed, 20 Jun 2018 16:07:36 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E46B820A1; Wed, 20 Jun 2018 16:07:36 +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 30E9824742; Wed, 20 Jun 2018 16:07:36 +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 w5KG7apT013719; Wed, 20 Jun 2018 16:07:36 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KG7ZvL013716; Wed, 20 Jun 2018 16:07:35 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806201607.w5KG7ZvL013716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Wed, 20 Jun 2018 16:07:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335446 - in head/sys: arm64/arm64 arm64/include kern X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in head/sys: arm64/arm64 arm64/include kern X-SVN-Commit-Revision: 335446 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:07:37 -0000 Author: manu Date: Wed Jun 20 16:07:35 2018 New Revision: 335446 URL: https://svnweb.freebsd.org/changeset/base/335446 Log: Add pmap_mapdev_attr for arm64 This is needed for efifb. arm and ricv pmap (the two arch with arm64 that uses subr_devmap) have very different implementation so for now only add this for arm64. Tested with efifb on Pine64 with a few other patches. Reviewed by: cognet Differential Revision: https://reviews.freebsd.org/D15294 Modified: head/sys/arm64/arm64/pmap.c head/sys/arm64/include/pmap.h head/sys/kern/subr_devmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Wed Jun 20 15:27:09 2018 (r335445) +++ head/sys/arm64/arm64/pmap.c Wed Jun 20 16:07:35 2018 (r335446) @@ -1142,7 +1142,7 @@ pmap_kextract(vm_offset_t va) * Low level mapping routines..... ***************************************************/ -static void +void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode) { pd_entry_t *pde; Modified: head/sys/arm64/include/pmap.h ============================================================================== --- head/sys/arm64/include/pmap.h Wed Jun 20 15:27:09 2018 (r335445) +++ head/sys/arm64/include/pmap.h Wed Jun 20 16:07:35 2018 (r335446) @@ -140,10 +140,12 @@ extern vm_offset_t virtual_end; ((((va) | (pa)) & L1_OFFSET) == 0 && (size) >= L1_SIZE) void pmap_bootstrap(vm_offset_t, vm_offset_t, vm_paddr_t, vm_size_t); +void pmap_kenter(vm_offset_t sva, vm_size_t size, vm_paddr_t pa, int mode); void pmap_kenter_device(vm_offset_t, vm_size_t, vm_paddr_t); vm_paddr_t pmap_kextract(vm_offset_t va); void pmap_kremove(vm_offset_t); void pmap_kremove_device(vm_offset_t, vm_size_t); +void *pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma); void *pmap_mapdev(vm_offset_t, vm_size_t); void *pmap_mapbios(vm_paddr_t, vm_size_t); Modified: head/sys/kern/subr_devmap.c ============================================================================== --- head/sys/kern/subr_devmap.c Wed Jun 20 15:27:09 2018 (r335445) +++ head/sys/kern/subr_devmap.c Wed Jun 20 16:07:35 2018 (r335446) @@ -287,6 +287,37 @@ pmap_mapdev(vm_offset_t pa, vm_size_t size) return ((void *)(va + offset)); } +#if defined(__aarch64__) +void * +pmap_mapdev_attr(vm_offset_t pa, vm_size_t size, vm_memattr_t ma) +{ + vm_offset_t va, offset; + void * rva; + + /* First look in the static mapping table. */ + if ((rva = devmap_ptov(pa, size)) != NULL) + return (rva); + + offset = pa & PAGE_MASK; + pa = trunc_page(pa); + size = round_page(size + offset); + + if (early_boot) { + akva_devmap_vaddr = trunc_page(akva_devmap_vaddr - size); + va = akva_devmap_vaddr; + KASSERT(va >= VM_MAX_KERNEL_ADDRESS - L2_SIZE, + ("Too many early devmap mappings")); + } else + va = kva_alloc(size); + if (!va) + panic("pmap_mapdev: Couldn't alloc kernel virtual memory"); + + pmap_kenter(va, size, pa, ma); + + return ((void *)(va + offset)); +} +#endif + /* * Unmap device memory and free the kva space. */ From owner-svn-src-all@freebsd.org Wed Jun 20 16:10:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A4A41021A19; Wed, 20 Jun 2018 16:10:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1AE1B8228F; Wed, 20 Jun 2018 16:10:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3AA82474F; Wed, 20 Jun 2018 16:10:03 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KGA38T013891; Wed, 20 Jun 2018 16:10:03 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KGA32U013888; Wed, 20 Jun 2018 16:10:03 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201610.w5KGA32U013888@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 16:10:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335447 - in head: . gnu/usr.bin/binutils/ld usr.bin/clang/lld X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . gnu/usr.bin/binutils/ld usr.bin/clang/lld X-SVN-Commit-Revision: 335447 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:10:04 -0000 Author: bdrewery Date: Wed Jun 20 16:10:02 2018 New Revision: 335447 URL: https://svnweb.freebsd.org/changeset/base/335447 Log: Rework how the ld link is handled in WORLDTMP from r322811. LLD_BOOTSTRAP (build) is independent of LLD_IS_LD (installed) so they should not be based on each other. This is related to upcoming WITH_SYSTEM_LINKER work. Reviewed by: emaste Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15836 Modified: head/Makefile.inc1 head/gnu/usr.bin/binutils/ld/Makefile head/usr.bin/clang/lld/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 20 16:07:35 2018 (r335446) +++ head/Makefile.inc1 Wed Jun 20 16:10:02 2018 (r335447) @@ -586,7 +586,7 @@ TMAKE= \ # TOOLS_PREFIX set in BMAKE XMAKE= ${BMAKE} \ TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \ - MK_GDB=no MK_LLD_IS_LD=${MK_LLD_BOOTSTRAP} MK_TESTS=no + MK_GDB=no MK_TESTS=no # kernel-tools stage KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \ Modified: head/gnu/usr.bin/binutils/ld/Makefile ============================================================================== --- head/gnu/usr.bin/binutils/ld/Makefile Wed Jun 20 16:07:35 2018 (r335446) +++ head/gnu/usr.bin/binutils/ld/Makefile Wed Jun 20 16:10:02 2018 (r335447) @@ -7,8 +7,10 @@ ELF_SCR_EXT= x xbn xc xd xdc xdw xn xr xs xsc xsw xu x .PATH: ${SRCDIR}/ld PROG= ld.bfd -.if ${MK_LLD_IS_LD} == "no" +.if (!defined(TOOLS_PREFIX) && ${MK_LLD_IS_LD} == "no") || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} == "no") MAN= ld.1 +LINKS= ${BINDIR}/ld.bfd ${BINDIR}/ld .else MAN= ld.bfd.1 CLEANFILES+= ld.bfd.1 @@ -57,9 +59,6 @@ CLEANFILES+= ldemul-list.h stringify.sed FILES= ${LDSCRIPTS:S|^|ldscripts/|} FILESDIR= ${SCRIPTDIR} -.if ${MK_LLD_IS_LD} == "no" -LINKS= ${BINDIR}/ld.bfd ${BINDIR}/ld -.endif HOST= ${TARGET_TUPLE} LIBSEARCHPATH= \"=/lib\":\"=/usr/lib\" Modified: head/usr.bin/clang/lld/Makefile ============================================================================== --- head/usr.bin/clang/lld/Makefile Wed Jun 20 16:07:35 2018 (r335446) +++ head/usr.bin/clang/lld/Makefile Wed Jun 20 16:10:02 2018 (r335447) @@ -8,7 +8,8 @@ LLD_SRCS= ${LLVM_SRCS}/tools/lld PACKAGE= lld PROG_CXX= ld.lld -.if ${MK_LLD_IS_LD} != "no" +.if (!defined(TOOLS_PREFIX) && ${MK_LLD_IS_LD} != "no") || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SYMLINKS= ${PROG_CXX} ${BINDIR}/ld MLINKS= ld.lld.1 ld.1 .endif From owner-svn-src-all@freebsd.org Wed Jun 20 16:10:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D43E1021A3B; Wed, 20 Jun 2018 16:10:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E60AB822A5; Wed, 20 Jun 2018 16:10:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C3A6C24750; Wed, 20 Jun 2018 16:10:07 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KGA7FQ013940; Wed, 20 Jun 2018 16:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KGA7wd013938; Wed, 20 Jun 2018 16:10:07 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201610.w5KGA7wd013938@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 16:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335448 - in head: . lib/clang/libllvm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . lib/clang/libllvm X-SVN-Commit-Revision: 335448 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:10:08 -0000 Author: bdrewery Date: Wed Jun 20 16:10:07 2018 New Revision: 335448 URL: https://svnweb.freebsd.org/changeset/base/335448 Log: Rework WITHOUT_LLD/TOOLCHAIN fix from r327892 for cross-tools. MK_LLD is for the installed lld while MK_LLD_BOOTSTRAP is for the build tool. For WITH_SYSTEM_LINKER it is necesarry to separate the logic of these two. When building libllvm TOOLS_PREFIX will be defined and MK_LLD_BOOTSTRAP should be checked instead. Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15837 Modified: head/Makefile.inc1 head/lib/clang/libllvm/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 20 16:10:02 2018 (r335447) +++ head/Makefile.inc1 Wed Jun 20 16:10:07 2018 (r335448) @@ -562,7 +562,6 @@ BSARGS= DESTDIR= \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ - MK_LLD=${MK_LLD_BOOTSTRAP} \ MK_INCLUDES=yes BMAKE= \ Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Wed Jun 20 16:10:02 2018 (r335447) +++ head/lib/clang/libllvm/Makefile Wed Jun 20 16:10:07 2018 (r335448) @@ -1284,16 +1284,19 @@ SRCS_ALL+= ${SRCS_EXT} .if ${MK_CLANG_FULL} != "no" SRCS_ALL+= ${SRCS_FUL} .endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLD} != "no" +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_EXL} .endif -.if ${MK_LLD} != "no" +.if ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_LLD} .endif .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" SRCS_ALL+= ${SRCS_XDB} .endif -.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || ${MK_LLD} != "no" || \ + (defined(TOOLS_PREFIX) && ${MK_LLD_BOOTSTRAP} != "no") SRCS_ALL+= ${SRCS_XDL} .endif .if ${MK_CLANG_EXTRAS} != "no" || ${MK_LLDB} != "no" || !defined(TOOLS_PREFIX) From owner-svn-src-all@freebsd.org Wed Jun 20 16:10:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B98C1021A5B; Wed, 20 Jun 2018 16:10:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B8BB82369; Wed, 20 Jun 2018 16:10:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 95C7424751; Wed, 20 Jun 2018 16:10:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KGABQ2013985; Wed, 20 Jun 2018 16:10:11 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KGABGb013984; Wed, 20 Jun 2018 16:10:11 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201610.w5KGABGb013984@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 16:10:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335449 - head/lib/clang/libllvm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/lib/clang/libllvm X-SVN-Commit-Revision: 335449 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:10:12 -0000 Author: bdrewery Date: Wed Jun 20 16:10:10 2018 New Revision: 335449 URL: https://svnweb.freebsd.org/changeset/base/335449 Log: Fix sources needed for lld. lld always needs these DWARF sources, as well as other default and extra tools. XDL seems to be the best fit list. Remove MK_LLD_IS_LD check from SRCS_MIW which is now reduced to just a few files for llvm-objdump. Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15915 Modified: head/lib/clang/libllvm/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Wed Jun 20 16:10:07 2018 (r335448) +++ head/lib/clang/libllvm/Makefile Wed Jun 20 16:10:10 2018 (r335449) @@ -371,30 +371,30 @@ SRCS_MIN+= DebugInfo/CodeView/TypeIndexDiscovery.cpp SRCS_MIN+= DebugInfo/CodeView/TypeRecordMapping.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableCollection.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDataExtractor.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugPubTable.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFDie.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFExpression.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFGdbIndex.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_MIW+= DebugInfo/DWARF/DWARFVerifier.cpp -SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDataExtractor.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugPubTable.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFDie.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFExpression.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFGdbIndex.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_XDL+= DebugInfo/DWARF/DWARFVerifier.cpp +SRCS_XDL+= DebugInfo/DWARF/SyntaxHighlighting.cpp SRCS_MIN+= DebugInfo/MSF/MSFBuilder.cpp SRCS_MIN+= DebugInfo/MSF/MSFCommon.cpp SRCS_MIN+= DebugInfo/MSF/MSFError.cpp @@ -1275,7 +1275,7 @@ SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_EXT+= XRay/InstrumentationMap.cpp SRCS_ALL+= ${SRCS_MIN} -.if !defined(TOOLS_PREFIX) || ${MK_LLD_IS_LD} != "no" +.if !defined(TOOLS_PREFIX) SRCS_ALL+= ${SRCS_MIW} .endif .if ${MK_CLANG_EXTRAS} != "no" From owner-svn-src-all@freebsd.org Wed Jun 20 16:10:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E03F1021A8E; Wed, 20 Jun 2018 16:10:18 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB758245B; Wed, 20 Jun 2018 16:10:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FCBB24752; Wed, 20 Jun 2018 16:10:16 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KGAGdS014039; Wed, 20 Jun 2018 16:10:16 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KGAFrO014032; Wed, 20 Jun 2018 16:10:15 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201610.w5KGAFrO014032@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 16:10:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335450 - in head: . share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . share/mk tools/build/options X-SVN-Commit-Revision: 335450 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:10:18 -0000 Author: bdrewery Date: Wed Jun 20 16:10:14 2018 New Revision: 335450 URL: https://svnweb.freebsd.org/changeset/base/335450 Log: Add WITH_SYSTEM_LINKER, on by default, that avoids building lld when possible. This works similar to WITH_SYSTEM_COMPILER added in r300354. It only supports lld via WITH_LLD_BOOTSTRAP. When both SYSTEM_COMPILER and SYSTEM_LINKER logic passes then libclang will not build in cross-tools. If either check fails though then libclang is built. The .info is reworked to notify when libclang will be built since if either clang or lld needs to be rebuilt, but not the other, the notification can lead to confusion on why "clang is building". -fuse-ld= is not used with this method so some combinations of compiler and linker are expected to fail. A new 'make test-system-linker' target is added to see the logic results. Makefile.inc1: CROSS_BINUTILS_PREFIX support had to be moved higher up so that XLD could be set and MK_LLD_BOOTSTRAP disabled before checking SYSTEM_LINKER logic as done with SYSTEM_COMPILER. This also required moving where bsd.linker.mk was read since XLD needs to be set before parsing it. This creates a situation where src.opts.mk can not test LINKER_FEATURES or add LLD_BOOTSTAP to BROKEN_OPTIONS. Reviewed by: emaste (earlier version) Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D15894 Added: head/tools/build/options/WITHOUT_SYSTEM_LINKER (contents, props changed) head/tools/build/options/WITH_SYSTEM_LINKER (contents, props changed) Modified: head/Makefile head/Makefile.inc1 head/share/mk/bsd.compiler.mk head/share/mk/bsd.linker.mk head/share/mk/src.opts.mk Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jun 20 16:10:10 2018 (r335449) +++ head/Makefile Wed Jun 20 16:10:14 2018 (r335450) @@ -143,7 +143,7 @@ TGTS= all all-man buildenv buildenvvars buildkernel bu stage-packages \ create-packages-world create-packages-kernel create-packages \ packages installconfig real-packages sign-packages package-pkg \ - print-dir test-system-compiler + print-dir test-system-compiler test-system-linker # These targets require a TARGET and TARGET_ARCH be defined. XTGTS= native-xtools native-xtools-install xdev xdev-build xdev-install \ @@ -168,7 +168,7 @@ META_TGT_WHITELIST+= \ _* build32 buildfiles buildincludes buildkernel buildsoft \ buildworld everything kernel-toolchain kernel-toolchains kernel \ kernels libraries native-xtools showconfig test-system-compiler \ - tinderbox toolchain \ + test-system-linker tinderbox toolchain \ toolchains universe world worlds xdev xdev-build .ORDER: buildworld installworld Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 20 16:10:10 2018 (r335449) +++ head/Makefile.inc1 Wed Jun 20 16:10:14 2018 (r335450) @@ -97,9 +97,74 @@ MK_GCC_BOOTSTRAP= no # Pull in COMPILER_TYPE and COMPILER_FREEBSD_VERSION early. Pull it from the # tree to be friendlier to foreign OS builds. It's safe to do so unconditionally # here since we will always have the right make, unlike in src/Makefile +# Don't include bsd.linker.mk yet until XBINUTILS is handled (after src.opts.mk) +_NO_INCLUDE_LINKERMK= t .include "share/mk/bsd.compiler.mk" +.undef _NO_INCLUDE_LINKERMK +# src.opts.mk depends on COMPILER_FEATURES .include "share/mk/src.opts.mk" +.if ${TARGET} == ${MACHINE} +TARGET_CPUTYPE?=${CPUTYPE} +.else +TARGET_CPUTYPE?= +.endif +.if !empty(TARGET_CPUTYPE) +_TARGET_CPUTYPE=${TARGET_CPUTYPE} +.else +_TARGET_CPUTYPE=dummy +.endif +.if ${TARGET} == "arm" +.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" +TARGET_ABI= gnueabihf +.else +TARGET_ABI= gnueabi +.endif +.endif +MACHINE_ABI?= unknown +MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 +TARGET_ABI?= unknown +TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 + +# Handle external binutils. +.if defined(CROSS_TOOLCHAIN_PREFIX) +CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} +.endif +# If we do not have a bootstrap binutils (because the in-tree one does not +# support the target architecture), provide a default cross-binutils prefix. +# This allows riscv64 builds, for example, to automatically use the +# riscv64-binutils port or package. +.if !make(showconfig) +.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ + ${MK_LLD_BOOTSTRAP} == "no" && \ + !defined(CROSS_BINUTILS_PREFIX) +CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ +.if !exists(${CROSS_BINUTILS_PREFIX}) +.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. +.endif +.endif +.endif +XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS +.for BINUTIL in ${XBINUTILS} +.if defined(CROSS_BINUTILS_PREFIX) && \ + exists(${CROSS_BINUTILS_PREFIX}/${${BINUTIL}}) +X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX:C,/*$,,}/${${BINUTIL}} +.else +X${BINUTIL}?= ${${BINUTIL}} +.endif +.endfor + +# If a full path to an external linker is given, don't build lld. +.if ${XLD:M/*} +MK_LLD_BOOTSTRAP= no +.endif + +.include "share/mk/bsd.linker.mk" + +# Begin WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD + +# WITH_SYSTEM_COMPILER - Pull in needed values and make a decision. + # Check if there is a local compiler that can satisfy as an external compiler. # Which compiler is expected to be used? .if ${MK_CLANG_BOOTSTRAP} == "yes" @@ -109,6 +174,7 @@ WANT_COMPILER_TYPE= gcc .else WANT_COMPILER_TYPE= .endif + .if !defined(WANT_COMPILER_FREEBSD_VERSION) .if ${WANT_COMPILER_TYPE} == "clang" WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h @@ -131,6 +197,7 @@ WANT_COMPILER_VERSION!= \ .endif .export WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_VERSION .endif # !defined(WANT_COMPILER_FREEBSD_VERSION) + # It needs to be the same revision as we would build for the bootstrap. # If the expected vs CC is different then we can't skip. # GCC cannot be used for cross-arch yet. For clang we pass -target later if @@ -147,7 +214,52 @@ MK_CLANG_BOOTSTRAP= no MK_GCC_BOOTSTRAP= no USING_SYSTEM_COMPILER= yes .endif # ${WANT_COMPILER_TYPE} == ${COMPILER_TYPE} + +# WITH_SYSTEM_LD - Pull in needed values and make a decision. + +# Check if there is a local linker that can satisfy as an external linker. +# Which linker is expected to be used? +.if ${MK_LLD_BOOTSTRAP} == "yes" +WANT_LINKER_TYPE= lld +.elif ${MK_BINUTILS_BOOTSTRAP} == "yes" +# Note that there's no support for bfd in WITH_SYSTEM_LINKER. +WANT_LINKER_TYPE= bfd +.else +WANT_LINKER_TYPE= +.endif + +.if !defined(WANT_LINKER_FREEBSD_VERSION) +.if ${WANT_LINKER_TYPE} == "lld" +WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/lld/Common/Version.inc +WANT_LINKER_FREEBSD_VERSION!= \ + awk '$$2 == "LLD_REVISION_STRING" {gsub(/"/, "", $$3); print $$3}' \ + ${SRCDIR}/${WANT_LINKER_FREEBSD_VERSION_FILE} || echo unknown +WANT_LINKER_VERSION_FILE= lib/clang/include/lld/Common/Version.inc +WANT_LINKER_VERSION!= \ + awk '$$2 == "LLD_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \ + ${SRCDIR}/${WANT_LINKER_VERSION_FILE} || echo unknown +.else +WANT_LINKER_FREEBSD_VERSION_FILE= +WANT_LINKER_FREEBSD_VERSION= +.endif +.export WANT_LINKER_FREEBSD_VERSION WANT_LINKER_VERSION +.endif # !defined(WANT_LINKER_FREEBSD_VERSION) + +.if ${MK_SYSTEM_LINKER} == "yes" && \ + (${MK_LLD_BOOTSTRAP} == "yes") && \ + !make(showconfig) && !make(xdev*) && \ + ${X_LINKER_TYPE} == ${WANT_LINKER_TYPE} && \ + ${X_LINKER_VERSION} == ${WANT_LINKER_VERSION} && \ + ${X_LINKER_FREEBSD_VERSION} == ${WANT_LINKER_FREEBSD_VERSION} +# Everything matches, disable the bootstrap linker. +MK_LLD_BOOTSTRAP= no +USING_SYSTEM_LINKER= yes +.endif # ${WANT_LINKER_TYPE} == ${LINKER_TYPE} + +# WITH_SYSTEM_COMPILER / WITH_SYSTEM_LINKER - Handle defaults and debug. USING_SYSTEM_COMPILER?= no +USING_SYSTEM_LINKER?= no + TEST_SYSTEM_COMPILER_VARS= \ USING_SYSTEM_COMPILER MK_SYSTEM_COMPILER \ MK_CROSS_COMPILER MK_CLANG_BOOTSTRAP MK_GCC_BOOTSTRAP \ @@ -155,20 +267,40 @@ TEST_SYSTEM_COMPILER_VARS= \ WANT_COMPILER_FREEBSD_VERSION WANT_COMPILER_FREEBSD_VERSION_FILE \ CC COMPILER_TYPE COMPILER_FEATURES COMPILER_VERSION \ COMPILER_FREEBSD_VERSION \ - X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ - X_COMPILER_FREEBSD_VERSION \ - LINKER_TYPE LINKER_FEATURES LINKER_VERSION \ - X_LINKER_TYPE X_LINKER_FEATURES X_LINKER_VERSION -test-system-compiler: .PHONY -.for v in ${TEST_SYSTEM_COMPILER_VARS} + XCC X_COMPILER_TYPE X_COMPILER_FEATURES X_COMPILER_VERSION \ + X_COMPILER_FREEBSD_VERSION +TEST_SYSTEM_LINKER_VARS= \ + USING_SYSTEM_LINKER MK_SYSTEM_LINKER \ + MK_LLD_BOOTSTRAP MK_BINUTILS_BOOTSTRAP \ + WANT_LINKER_TYPE WANT_LINKER_VERSION WANT_LINKER_VERSION_FILE \ + WANT_LINKER_FREEBSD_VERSION WANT_LINKER_FREEBSD_VERSION_FILE \ + LD LINKER_TYPE LINKER_FEATURES LINKER_VERSION \ + LINKER_FREEBSD_VERSION \ + XLD X_LINKER_TYPE X_LINKER_FEATURES X_LINKER_VERSION \ + X_LINKER_FREEBSD_VERSION + +.for _t in compiler linker +test-system-${_t}: .PHONY +.for v in ${TEST_SYSTEM_${_t:tu}_VARS} ${_+_}@printf "%-35s= %s\n" "${v}" "${${v}}" .endfor -.if ${USING_SYSTEM_COMPILER} == "yes" && \ - (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \ +.endfor +.if (make(buildworld) || make(buildkernel) || make(kernel-toolchain) || \ make(toolchain) || make(_cross-tools)) +.if ${USING_SYSTEM_COMPILER} == "yes" .info SYSTEM_COMPILER: Determined that CC=${CC} matches the source tree. Not bootstrapping a cross-compiler. +.elif ${MK_CLANG_BOOTSTRAP} == "yes" +.info SYSTEM_COMPILER: libclang will be built for bootstrapping a cross-compiler. .endif +.if ${USING_SYSTEM_LINKER} == "yes" +.info SYSTEM_LINKER: Determined that LD=${LD} matches the source tree. Not bootstrapping a cross-linker. +.elif ${MK_LLD_BOOTSTRAP} == "yes" +.info SYSTEM_LINKER: libclang will be built for bootstrapping a cross-linker. +.endif +.endif +# End WITH_SYSTEM_COMPILER / WITH_SYSTEM_LD + # Store some compiler metadata for use in installworld where we don't # want to invoke CC at all. _COMPILER_METADATA_VARS= COMPILER_VERSION \ @@ -177,7 +309,8 @@ _COMPILER_METADATA_VARS= COMPILER_VERSION \ COMPILER_FREEBSD_VERSION \ LINKER_VERSION \ LINKER_FEATURES \ - LINKER_TYPE + LINKER_TYPE \ + LINKER_FREEBSD_VERSION compiler-metadata.mk: .PHONY .META @: > ${.TARGET} @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ @@ -190,61 +323,7 @@ compiler-metadata.mk: .PHONY .META @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} @echo ".export ${_COMPILER_METADATA_VARS:C,^,X_,}" >> ${.TARGET} -.if ${TARGET} == ${MACHINE} -TARGET_CPUTYPE?=${CPUTYPE} -.else -TARGET_CPUTYPE?= -.endif -.if !empty(TARGET_CPUTYPE) -_TARGET_CPUTYPE=${TARGET_CPUTYPE} -.else -_TARGET_CPUTYPE=dummy -.endif -.if ${TARGET} == "arm" -.if ${TARGET_ARCH:Marmv[67]*} != "" && ${TARGET_CPUTYPE:M*soft*} == "" -TARGET_ABI= gnueabihf -.else -TARGET_ABI= gnueabi -.endif -.endif -MACHINE_ABI?= unknown -MACHINE_TRIPLE?=${MACHINE_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${MACHINE_ABI}-freebsd12.0 -TARGET_ABI?= unknown -TARGET_TRIPLE?= ${TARGET_ARCH:S/amd64/x86_64/:C/hf$//:S/mipsn32/mips64/}-${TARGET_ABI}-freebsd12.0 -# Handle external binutils. -.if defined(CROSS_TOOLCHAIN_PREFIX) -CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX} -.endif -# If we do not have a bootstrap binutils (because the in-tree one does not -# support the target architecture), provide a default cross-binutils prefix. -# This allows riscv64 builds, for example, to automatically use the -# riscv64-binutils port or package. -.if !make(showconfig) -.if !empty(BROKEN_OPTIONS:MBINUTILS_BOOTSTRAP) && \ - ${MK_LLD_BOOTSTRAP} == "no" && \ - !defined(CROSS_BINUTILS_PREFIX) -CROSS_BINUTILS_PREFIX=/usr/local/${TARGET_TRIPLE}/bin/ -.if !exists(${CROSS_BINUTILS_PREFIX}) -.error In-tree binutils does not support the ${TARGET_ARCH} architecture. Install the ${TARGET_ARCH}-binutils port or package or set CROSS_BINUTILS_PREFIX. -.endif -.endif -.endif -XBINUTILS= AS AR LD NM OBJCOPY RANLIB SIZE STRINGS -.for BINUTIL in ${XBINUTILS} -.if defined(CROSS_BINUTILS_PREFIX) && \ - exists(${CROSS_BINUTILS_PREFIX}/${${BINUTIL}}) -X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX:C,/*$,,}/${${BINUTIL}} -.else -X${BINUTIL}?= ${${BINUTIL}} -.endif -.endfor - -# If a full path to an external linker is given, don't build lld. -.if ${XLD:M/*} -MK_LLD_BOOTSTRAP= no -.endif - # We must do lib/ and libexec/ before bin/ in case of a mid-install error to # keep the users system reasonably usable. For static->dynamic root upgrades, # we don't want to install a dynamic binary without rtld and the needed @@ -857,6 +936,9 @@ _worldtmp: .PHONY fi .endfor .endif # ${USING_SYSTEM_COMPILER} == "yes" +.if ${USING_SYSTEM_LINKER} == "yes" + @rm -f ${WORLDTMP}/usr/bin/ld ${WORLDTMP}/usr/bin/ld.lld +.endif # ${USING_SYSTEM_LINKER} == "yes" .endif # !defined(NO_CLEAN) @mkdir -p ${WORLDTMP} @touch ${WORLDTMP}/${.TARGET} Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Jun 20 16:10:10 2018 (r335449) +++ head/share/mk/bsd.compiler.mk Wed Jun 20 16:10:14 2018 (r335450) @@ -208,5 +208,7 @@ ${var}.${${X_}_cc_hash}:= ${${var}} .endif # ${cc} == "CC" || !empty(XCC) .endfor # .for cc in CC XCC +.if !defined(_NO_INCLUDE_LINKERMK) .include +.endif .endif # !target(____) Modified: head/share/mk/bsd.linker.mk ============================================================================== --- head/share/mk/bsd.linker.mk Wed Jun 20 16:10:10 2018 (r335449) +++ head/share/mk/bsd.linker.mk Wed Jun 20 16:10:14 2018 (r335450) @@ -16,6 +16,8 @@ # - retpoline: support for generating PLT with retpoline speculative # execution vulnerability mitigation # +# LINKER_FREEBSD_VERSION is the linker's internal source version. +# # These variables with an X_ prefix will also be provided if XLD is set. # # This file may be included multiple times, but only has effect the first time. @@ -29,7 +31,8 @@ ____: # Try to import LINKER_TYPE and LINKER_VERSION from parent make. # The value is only used/exported for the same environment that impacts # LD and LINKER_* settings here. -_exported_vars= ${X_}LINKER_TYPE ${X_}LINKER_VERSION ${X_}LINKER_FEATURES +_exported_vars= ${X_}LINKER_TYPE ${X_}LINKER_VERSION ${X_}LINKER_FEATURES \ + ${X_}LINKER_FREEBSD_VERSION ${X_}_ld_hash= ${${ld}}${MACHINE}${PATH} ${X_}_ld_hash:= ${${X_}_ld_hash:hash} # Only import if none of the vars are set somehow else. @@ -55,10 +58,14 @@ _ld_version!= (${${ld}} --version || echo none) | sed .endif .if ${_ld_version:[1..2]} == "GNU ld" ${X_}LINKER_TYPE= bfd +${X_}LINKER_FREEBSD_VERSION= 0 _v= ${_ld_version:M[1-9].[0-9]*:[1]} .elif ${_ld_version:[1]} == "LLD" ${X_}LINKER_TYPE= lld _v= ${_ld_version:[2]} +${X_}LINKER_FREEBSD_VERSION!= \ + ${${ld}} --version | \ + awk '$$3 ~ /FreeBSD/ {print substr($$4, 1, length($$4)-1)}' .else .warning Unknown linker from ${ld}=${${ld}}: ${_ld_version}, defaulting to bfd ${X_}LINKER_TYPE= bfd @@ -85,6 +92,7 @@ ${X_}LINKER_FEATURES+= retpoline X_LINKER_TYPE= ${LINKER_TYPE} X_LINKER_VERSION= ${LINKER_VERSION} X_LINKER_FEATURES= ${LINKER_FEATURES} +X_LINKER_FREEBSD_VERSION= ${LINKER_FREEBSD_VERSION} .endif # ${ld} == "LD" || (${ld} == "XLD" && ${XLD} != ${LD}) # Export the values so sub-makes don't have to look them up again, using the Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jun 20 16:10:10 2018 (r335449) +++ head/share/mk/src.opts.mk Wed Jun 20 16:10:14 2018 (r335450) @@ -168,6 +168,7 @@ __DEFAULT_YES_OPTIONS = \ SVNLITE \ SYSCONS \ SYSTEM_COMPILER \ + SYSTEM_LINKER \ TALK \ TCP_WRAPPERS \ TCSH \ Added: head/tools/build/options/WITHOUT_SYSTEM_LINKER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_SYSTEM_LINKER Wed Jun 20 16:10:14 2018 (r335450) @@ -0,0 +1,16 @@ +.\" $FreeBSD$ +Set to not opportunistically skip building a cross-linker during the +bootstrap phase of the build. +Normally, if the currently installed linker matches the planned bootstrap +linker type and revision, then it will not be built. +This does not prevent a linker from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_LLD +and +.Va WITHOUT_BINUTILS +options control those. +.Pp +This option is only relevant when +.Va WITH_LLD_BOOTSTRAP +is set. Added: head/tools/build/options/WITH_SYSTEM_LINKER ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_SYSTEM_LINKER Wed Jun 20 16:10:14 2018 (r335450) @@ -0,0 +1,16 @@ +.\" $FreeBSD$ +Set to opportunistically skip building a cross-linker during the +bootstrap phase of the build. +If the currently installed linker matches the planned bootstrap linker +type and revision, then it will not be built. +This does not prevent a linker from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_LLD +and +.Va WITHOUT_BINUTILS +options control those. +.Pp +This option is only relevant when +.Va WITH_LLD_BOOTSTRAP +is set. From owner-svn-src-all@freebsd.org Wed Jun 20 16:10:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 163671021C3A; Wed, 20 Jun 2018 16:10:53 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f66.google.com (mail-it0-f66.google.com [209.85.214.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A447B82714; Wed, 20 Jun 2018 16:10:52 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f66.google.com with SMTP id y127-v6so372474itd.1; Wed, 20 Jun 2018 09:10:52 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=zuDBVgnUAhriBR0dqjkuHLcl6Ty3pd1p3Als1CSbdmk=; b=cV7vg2VLIVuQ6Zn52V5kfuKNTCEb9wpdtXdPdbqIR0+L9fYk2z2sDB2EwlRTHmcheM 8xOTLd2GT0/KhaCSyzCy2t27ZT3Yb8B3uCHkSFHNO5Aop0zh8kxDDkbTOA8KYLcnnN9K A4b2RX35RTOgLnH4gPg6tgnY+WnomO1lDFVOQN6FOibKzwIswNyl8swkH8ekUCMTH8BM WWiBvvU/CvPtWZwe7sm625oF6VWSD8rHbiDI3/PTOMdpPUKxd3U8t+mHcGpXUp5ekThC ymvQZVIiZ7yculWBHc8bhp7PDDUbGsm34PDeXturdDyL/+AIRrrfdDl9QaZQyFGmJr2S UtTA== X-Gm-Message-State: APt69E1Q9FQCTSAgrmCjgk4oVHwCrJglikKjmN1+F+x25WQiBo/WqAt6 FPTEdulJHCNAZ7PfJSPudYJ83Gap X-Google-Smtp-Source: ADUXVKK1jswHEQhaFbNZYRSzStYFSpP1rMydpicF2l6p6QdBGYpgaMXaBDwGOAlt4TZz3n6ZbHf0Jg== X-Received: by 2002:a24:690f:: with SMTP id e15-v6mr1990711itc.70.1529509410458; Wed, 20 Jun 2018 08:43:30 -0700 (PDT) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com. [209.85.214.50]) by smtp.gmail.com with ESMTPSA id n204-v6sm1230582itg.7.2018.06.20.08.43.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 08:43:30 -0700 (PDT) Received: by mail-it0-f50.google.com with SMTP id y127-v6so304733itd.1; Wed, 20 Jun 2018 08:43:30 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr1999052ith.53.1529509409886; Wed, 20 Jun 2018 08:43:29 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 08:43:29 -0700 (PDT) In-Reply-To: <96021.1529475664@kaos.jnpr.net> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> From: Conrad Meyer Date: Wed, 20 Jun 2018 08:43:29 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Simon J. Gerraty" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:10:53 -0000 I want to preface this by saying: this discussion should be happening in either arch@ or phabricator, after the patch series was temporarily reverted pending necessary improvements. I have asked for the series to be reverted and am still waiting on that. I am happy to promise to respond promptly to updates on this particular series so you are not waiting for two years again. I think it's quite close to something reasonably general, but as-is, it is worse than useless =E2=80=94 it promises a security feature but _does not deliver it_, which is the "emperor's new clothes" of security. On Tue, Jun 19, 2018 at 11:21 PM, Simon J. Gerraty wrote: > Conrad Meyer wrote: >> First and foremost: nothing is actually signed, anywhere. The > > The signing of manifests is external. The veriexecctl tool is I assume > a straight copy of what's in NetBSD (I've not looked at it in at least a > decade). The signing of manifests does not exist in the patch series committed. (If NetBSD does something broken, that is not an excuse to copy it.) > A veriexec loader that leverages signed manifests requires some signing > infra. That's a big topic all by itself. It *may* require that. However, even without that, admins could reasonably manage their own PKI in some fashion, independent of FreeBSD's infra. But it requires the support code to verify signatures, as in the "verify" part of veriexec, which is wholly absent. > As I mentioned in my talk at BSDCan, (FWIW, I was not at your talk, and it is not a justification for bad design or implementation anyway.) > the signing server we use is open > source and handles pretty much anything OpenSSL can, as well as OpenPGP > (and others). It doesn't really matter if there's a signing server, because nothing in the patch series *verifies* signatures. > Tweaking the veriexec loader to only process manifests after > verification is not hard Then I even more do not understand why it was not done prior to commit. > - one of the first things I did when pulling > veriexec into Junos almost 15 years ago. > >> As a corollary to the above, the name "signature file" is used >> repeatedly in the code, which is misleading. The file contains hashes >> (digests), not signatures (MACs). The file itself is unsigned. >> Nothing about this has signatures. > > NetBSD refers to the hashes as fingerprints - AFAIK that terminology is > retained. Fingerprints is fine, "signatures" is not. "Signatures file" is used to refer to the manifest file, which only contains fingerprints, in multiple locations in the code. > If the term signature is used to refer to anything other than the signed > manifests that should be fixed. Should have been fixed prior to commit, yes. >> There's absolutely no reason to use sha1 or ripemd in new designs. >> These should be removed. > > Sorry I disagree - not with ripem (we never supported that or any of the > non-NIST approved hashes), but sha1 is still approved by NIST for > firmware integrity checks - which is what this is, and sha1 is cheaper > than sha256. Again =E2=80=94 this is a discussion for arch or phabricator, with the seri= es reverted first. I reckon you're wrong. If you're unwilling to trust me, I believe you should get and accept input from a 3rd party vaguely familiar with cryptography (maybe cperciva@ or gordon@ or delphij@) before introducing SHA1 or Ripe-MD in a novel integrity-protection design. (Some modern Intel and AMD CPUs have intrinsics support for SHA-2, and on those machines SHA-2 256 is about the same performance as SHA-1.) Performance is absolutely not a reason to use a known weak hash algorithm in 2018, especially when the feature as-committed has so many other glaring performance problems. If you care about MAC performance in a secure algorithm in 2018, perhaps look at any of these great options: * SHA-3 (Keccak) * Blake2-b * Poly1305-{AES,Salsa,ChaCha} All have highly efficient software implementations that smoke SHA-2 and don't have SHA-1's known weakness. Blake2 is even in-tree already. > As I mentioned in my talk we've included support for sha256 for 10+ > years, FreeBSD has had this code for 0 years. It's a novel feature here. There is no reason to introduce SHA-1 in novel security features in 2018. > but do not plan to drop sha1 until NIST deprecate it for that > purpose since boot time is a very sensitive subject for us. See above. There are lots of secure hashes faster than SHA-1 without its known weaknesses. >> The patchset is littered with style issues. One fairly obvious issue >> is mixed indentation styles =E2=80=94 some files vary between space and = tab >> indentation from line to line. > > You can probably blame me for some of that. > I only recently found a style9.el that does a half decent job of > formatting per style(9). To commit to the tree, you are supposed to be able to get it right, or at least close to right. >> Please revert this patchset. It's not ready. >> - Maybe use HMACs instead of raw hashes > > Why? Again, this design discussion is for arch or phab. HMAC have a number of advantages over raw SHA-1/-2: * Key verification * No length extension attacks Neither of these may apply here IFF the manifest is signed and trusted, and there aren't other implementation flaws. But as-committed, there is no signed manifest. A MAC implementation would enable just storing these values as extended attributes on-disk instead of a separate file that gets loaded. Another design question for arch. >> - Maybe sign the source-of-trust file > > We do. As noted above, we cannot upstream that until FreeBSD has > suitable signing infra. I disagree. What was committed absolutely does not sign nor verify the source-of-trust file. And no, upstreaming the signature verification code is completely orthogonal to implementing signing infrastructure. The "veriexec" patchset in FreeBSD today: 1. Does not verify anything in a cryptographically sound manner 2. Slows down all concurrent access to associated filesystems Why is this either necessary or helpful to be in the FreeBSD tree as-is? I don't think it is, and you should revert it. Please. I don't know if there's a maintainer timeout on this kind of thing, but, you are forewarned. Thank you, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 16:15:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B20A91021FD6; Wed, 20 Jun 2018 16:15:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6509C82CF7; Wed, 20 Jun 2018 16:15:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 463192490A; Wed, 20 Jun 2018 16:15:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KGF4Do018907; Wed, 20 Jun 2018 16:15:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KGF4Co018906; Wed, 20 Jun 2018 16:15:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201615.w5KGF4Co018906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 16:15:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335451 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 335451 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:15:04 -0000 Author: bdrewery Date: Wed Jun 20 16:15:03 2018 New Revision: 335451 URL: https://svnweb.freebsd.org/changeset/base/335451 Log: Regenerate for SYSTEM_LINKER Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Wed Jun 20 16:10:14 2018 (r335450) +++ head/share/man/man5/src.conf.5 Wed Jun 20 16:15:03 2018 (r335451) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd June 15, 2018 +.Dd June 20, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1481,6 +1481,22 @@ The and .Va WITHOUT_GCC options control those. +.It Va WITHOUT_SYSTEM_LINKER +Set to not opportunistically skip building a cross-linker during the +bootstrap phase of the build. +Normally, if the currently installed linker matches the planned bootstrap +linker type and revision, then it will not be built. +This does not prevent a linker from being built for installation though, +only for building one for the build itself. +The +.Va WITHOUT_LLD +and +.Va WITHOUT_BINUTILS +options control those. +.Pp +This option is only relevant when +.Va WITH_LLD_BOOTSTRAP +is set. .It Va WITHOUT_TALK Set to not build or install .Xr talk 1 From owner-svn-src-all@freebsd.org Wed Jun 20 16:35:43 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D68991022DF1; Wed, 20 Jun 2018 16:35:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f46.google.com (mail-it0-f46.google.com [209.85.214.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6869883945; Wed, 20 Jun 2018 16:35:42 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f46.google.com with SMTP id p185-v6so509675itp.4; Wed, 20 Jun 2018 09:35:42 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=kVJ60U747G96q+kU7Er0syfzEaKHSzz/0FHBbjVlIbE=; b=Ow4FznQ+gMwKxM8a1IWzh5WUuHK8t3rsxmv01wuNkRf/itp1uR1A4KT0cB0HFD0QVA IctF0efSxsdTHYsxc5uoPxolNSq7i3xcNt1nR80pM6ym3O1UsgRrcvRr1Ja0vtb3Tkdd LXrFosdgooEm/yW8y8wD7DneprDCc9SK9/hLUGd/XApq8s43PojcV9i6U4T8d1PjuBog RTp7OD7CayTlIza800hEIyqnPtSFbX/vtvXFzGuY7NV7cNeZpnGJw3WGOfOOTrcH6xnL Ab0sIYTIokjVR2eMYY1Xbqi8pMkW56DyVxS8FZA9ruti4Mepw5KLFa3oeSOyqpPBF711 Bx3A== X-Gm-Message-State: APt69E1h33w6J782xA1p8AKajY9PSfHHnDANhMQjdesc/Zun6iVmqk+w /q6Kb8VHWVL2TTF4BGFLctkUxOxg X-Google-Smtp-Source: ADUXVKLEuko3Etbii0+lh0K6OG5gfQQp0+mwZL4mcZYApv3J7YaKJNPXFRGq1yXNZFkaE+JFBqd2WQ== X-Received: by 2002:a24:e4c8:: with SMTP id o191-v6mr2029419ith.93.1529512215428; Wed, 20 Jun 2018 09:30:15 -0700 (PDT) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com. [209.85.214.54]) by smtp.gmail.com with ESMTPSA id y64-v6sm1380388itb.33.2018.06.20.09.30.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 09:30:15 -0700 (PDT) Received: by mail-it0-f54.google.com with SMTP id k17-v6so426818ita.0; Wed, 20 Jun 2018 09:30:15 -0700 (PDT) X-Received: by 2002:a24:100f:: with SMTP id 15-v6mr2200443ity.61.1529512214911; Wed, 20 Jun 2018 09:30:14 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 09:30:14 -0700 (PDT) In-Reply-To: <1529510299.24573.5.camel@freebsd.org> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> From: Conrad Meyer Date: Wed, 20 Jun 2018 09:30:14 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Ian Lepore Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Stephen J. Kiernan" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:35:43 -0000 Ian, On Wed, Jun 20, 2018 at 8:58 AM, Ian Lepore wrote: > And I request exactly the opposite: reject the complaining of people > who think all the world is a 256-core 5ghz server First: no need to be so rude to other committers. The hyperbole doesn't help anyone and doesn't help communicate your point clearly. It's just verbal diarrhea. Please try to be excellent to each other. > and leave in the > option to use faster algorithms on real-world hardware used by real- > world vendors who need some option other than "rev your hardware every > 18 months to keep up with the software or get out of the business." Second: You have very much misread my complaints and very much misunderstand the cryptographic algorithm landscape if that is your conclusion. See my earlier email, https://lists.freebsd.org/pipermail/svn-src-all/2018-June/166107.html ; in particular I would quote: > Performance is absolutely not a reason to use a known weak hash > algorithm in 2018, especially when the feature as-committed has so > many other glaring performance problems. If you care about MAC > performance in a secure algorithm in 2018, perhaps look at any of > these great options: > > * Blake2-b > * Poly1305-{AES,Salsa,ChaCha} > > They have highly efficient software implementations *that smoke SHA-2 > and don't have SHA-1's known weakness*. Blake2 is even in-tree > already. (Removing Keccak, which I had forgotten has crap performance in software =E2=80=94 mea culpa.) > Stronger algorithm options, yes. Even making stronger options the > default, yes. "More secure than SHA1" and "faster than SHA1" are *not* mutually exclusive= . > But removing viable options which are endorsed by the > people who actually set the standards, no. No one actually endorses SHA1 in new designs. No one endorses RIPEMD at al= l. Please look at the actual code size and layout of the sha1 support module and tell me that is a burden for Juniper to maintain in their downstream tree, rather than just getting angry about the suggestion we don't introduce novel, insecurity cryptographic designs. Thank you, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 16:38:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DD3610232D8; Wed, 20 Jun 2018 16:38:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B64483C7A; Wed, 20 Jun 2018 16:38:23 +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 ESMTP id w5KGc8pg026443; Wed, 20 Jun 2018 19:38:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5KGc8pg026443 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5KGc8nK026442; Wed, 20 Jun 2018 19:38:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Jun 2018 19:38:07 +0300 From: Konstantin Belousov To: Warner Losh Cc: Ian Lepore , Allan Jude , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot Message-ID: <20180620163807.GP2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> <1529509411.20460.83.camel@freebsd.org> <20180620160315.GO2430@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:38:25 -0000 On Wed, Jun 20, 2018 at 10:05:16AM -0600, Warner Losh wrote: > On Wed, Jun 20, 2018 at 10:03 AM, Konstantin Belousov > wrote: > > > On Wed, Jun 20, 2018 at 09:43:31AM -0600, Ian Lepore wrote: > > > On Wed, 2018-06-20 at 12:22 +0300, Konstantin Belousov wrote: > > > > On Tue, Jun 19, 2018 at 08:34:18PM -0400, Allan Jude wrote: > > > > > > > > > > On 2018-06-17 07:32, Eugene Grosbein wrote: > > > > > > > > > > > > 17.06.2018 10:18, Allan Jude wrote: > > > > > > > > > > > > > > > > > > > > Author: allanjude > > > > > > > Date: Sun Jun 17 03:18:56 2018 > > > > > > > New Revision: 335276 > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/335276 > > > > > > > > > > > > > > Log: > > > > > > > gptboot, zfsboot, gptzfsboot: Enable the video and serial > > consoles early > > > > > > > > > > > > > > Normally the serial console is not enabled until /boot.config > > is read and > > > > > > > we know how the serial console should be > > configured. Initialize the > > > > > > > consoles early in 'dual' mode (serial & keyboard) with a > > default serial > > > > > > > rate of 115200. Then serial is re-initialized once the disk is > > decrypted > > > > > > > and the /boot.config file can be read. > > > > > > > > > > > > > > This allows the GELIBoot passphrase to be provided via the > > serial console. > > > > > > > > > > > > > > PR: 221526 > > > > > > > Requested by: many > > > > > > > Reviewed by: imp > > > > > > > Sponsored by: Klara Systems > > > > > > > Differential Revision: https://reviews.freebsd.org/D15862 > > > > > > I had several cases when booting FreeBSD/amd64 with motherboard > > having no serial ports > > > > > > hang hard early at boot unless I rebuilt boot media configuring it > > to NOT try accessing > > > > > > missing serial ports. I even could reproduce that with VirtualBox > > machine configured > > > > > > with no serial ports (not same as existing bug inactive serial > > port). > > > > > > > > > > > > Should there be some way to disable this serial ports > > configuration at compile time? > > > > > > > > > > > > > > > > > > > > > > > I think what we'll do it compile it both ways, and use the non-serial > > > > > one by default, because it is safer. Then you can just use > > > > > 'gptboot-serial' if you want serial support. > > > > > > > > > > This will likely make Warner a bit sad, since we are just finally > > > > > getting around to reducing the number of different bootcode files. > > > > I think we should follow the hardware trends there and apply a policy > > > > where new features are not added to the CSM boot. All modern machines > > > > can be booted in UEFI mode, and if some modern machine cannot, then we > > > > need it fixed. We should encourage users to make new installs boot by > > > > UEFI. > > > > > > > > The feature from the commit is only relevant for machines that require > > > > CSM boot or do not have UEFI option at all, am I right ? With the > > policy > > > > applied, an additional CSM-boot bootblock would be not shipped. > > > > > > > > > > I think it is far too early to say that the code for booting without > > > efi is abandonware. I have half a dozen x86 boxes in use here, and only > > > one of them is even able to boot efi, and its default resolution in efi > > > mode confuses the kvm switch it's connected to, so even on that I have > > > to use legacy bios boot. > > I do not propose to abandon bios boot, or even to declare it legacy > > with the proper meaning. I mean that CSM is disappearing on the newest > > platforms, and should become only used on old machines or i386. With that > > attitude, adding a features for it, esp. by the cost of the user confusion, > > is not worth the efforts. It still should be maintained for the foreseable > > future. > > > > If the machines where you get the trouble is newer than say 5 years, > > then they should boot with UEFI. If not, the problem in loader.efi > > needs to be fixed. > > > > There is no problem in loader.efi that's specific to geli. It already uses > the UEFI boot loader config. While there's some issues downstream (eg > kernel messages), this specific issue is a non-issue for loader.efi. I referenced the problems that Ian has with UEFI boot on his machines, not the serial console and geli change above. From owner-svn-src-all@freebsd.org Wed Jun 20 16:39:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EC2C1023402 for ; Wed, 20 Jun 2018 16:39:34 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 DB94B83E14 for ; Wed, 20 Jun 2018 16:39:33 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 7e05acdf-74a8-11e8-afd2-4ddcc8249dd4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 7e05acdf-74a8-11e8-afd2-4ddcc8249dd4; Wed, 20 Jun 2018 16:39:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5KGdOZ0082159; Wed, 20 Jun 2018 10:39:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529512764.24573.8.camel@freebsd.org> Subject: Re: svn commit: r335402 - head/sbin/veriexecctl From: Ian Lepore To: cem@freebsd.org Cc: "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers , "Stephen J. Kiernan" Date: Wed, 20 Jun 2018 10:39:24 -0600 In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> Content-Type: text/plain; charset="windows-1251" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:39:34 -0000 On Wed, 2018-06-20 at 09:30 -0700, Conrad Meyer wrote: > Ian, > > On Wed, Jun 20, 2018 at 8:58 AM, Ian Lepore wrote: > > > > And I request exactly the opposite: reject the complaining of people > > who think all the world is a 256-core 5ghz server > First: no need to be so rude to other committers.  The hyperbole > doesn't help anyone and doesn't help communicate your point clearly. > It's just verbal diarrhea.  Please try to be excellent to each other. > > > > > and leave in the > > option to use faster algorithms on real-world hardware used by real- > > world vendors who need some option other than "rev your hardware every > > 18 months to keep up with the software or get out of the business." > Second: You have very much misread my complaints and very much > misunderstand the cryptographic algorithm landscape if that is your > conclusion. > > See my earlier email, > https://lists.freebsd.org/pipermail/svn-src-all/2018-June/166107.html > ; in particular I would quote: > > > > > Performance is absolutely not a reason to use a known weak hash > > algorithm in 2018, especially when the feature as-committed has so > > many other glaring performance problems.  If you care about MAC > > performance in a secure algorithm in 2018, perhaps look at any of > > these great options: > > > > * Blake2-b > > * Poly1305-{AES,Salsa,ChaCha} > > > > They have highly efficient software implementations *that smoke SHA-2 > > and don't have SHA-1's known weakness*.  Blake2 is even in-tree > > already. > (Removing Keccak, which I had forgotten has crap performance in > software — mea culpa.) > > > > > Stronger algorithm options, yes. Even making stronger options the > > default, yes. > "More secure than SHA1" and "faster than SHA1" are *not* mutually exclusive. > > > > > But removing viable options which are endorsed by the > > people who actually set the standards, no. > No one actually endorses SHA1 in new designs.  No one endorses RIPEMD at all. > > Please look at the actual code size and layout of the sha1 support > module and tell me that is a burden for Juniper to maintain in their > downstream tree, rather than just getting angry about the suggestion > we don't introduce novel, insecurity cryptographic designs. > > Thank you, > Conrad > I have zero interest in arguing with you (or anybody) about this. I've expessed my opinion on the subject and have nothing more to say. -- Ian From owner-svn-src-all@freebsd.org Wed Jun 20 16:49:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B99911023C87; Wed, 20 Jun 2018 16:49:05 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: from mail-oi0-x241.google.com (mail-oi0-x241.google.com [IPv6:2607:f8b0:4003:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 434D58469E; Wed, 20 Jun 2018 16:49:05 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: by mail-oi0-x241.google.com with SMTP id k190-v6so201968oib.9; Wed, 20 Jun 2018 09:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yx92tdzr0zYpXn6JlaJ5khIGU3gUiksNUeRMeyZaSUI=; b=rLpkVNTncr0s5m3JcX0F2zfDpyYp2Jsn3RQEb3t4bRog08ZIoBqc9uwW4vcDCS8bh4 ubIHWA1dYSGdElFYZMnm2kG9TT7PL02LsE9GdQ3II5Yj+AfMpev6EuYTqfLcht2BxPog WILkuL1ZqzYsh0b62E2O0MJPWGf3EMHQ4DLSpvEC6jq7DVfnjtHX6T6z9auCFsPCVee7 +x53knWDZHKbfziRJ1N27N4Sc+Fev7Qf/PUfQEYGfZL1U2yJz9qZBhQM99/uVX6BrdGX CXWN3qOQqnHo39S40kngltvnM8x7NFmD6WTo8KJf7dJQw8+i6i9o23uP9JOOkpzuIjsz 8b/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yx92tdzr0zYpXn6JlaJ5khIGU3gUiksNUeRMeyZaSUI=; b=Pc/F0ATBstF6XIiSWAREs4HjqC0E6xXEBLDZm3INHhxm8ssOOU5LivYY57bdXHCYDM 8K+pk4L5Gi8EasJYs9n76Ax7j4aSLhg1HWIByNn/Vi+GMnDehLqua09LnW8xDri2+9vE 4vVmnV4p7sutFZY9l74JpLH43gzQrtOxavf7WrOVmmbq13xA8OlH+KXtdBGoo7ynRVLC rX7a4L2sbrG4s6p8B5eN5rF9ObA0qsTe0hSIAgySMVE3qoIIpP2Xo07Ow+fDFwzak786 6iAspfrznKB1VcYLnoQCdTA4dbjkR3SejJp57Bv9YKXExHRpbAZReCwENhQVvphJr1vN 7JBw== X-Gm-Message-State: APt69E3e50AoSvXz2RoXMtzTTQm+fI5A2nlRDRIJn3x+VGr7H2LX2WJt ehdmoPYclmkqYpl+bbeeRqS2Y0RFA0AgWa0u8l6w1hkAF0E= X-Google-Smtp-Source: ADUXVKKptpeoxaRCQ0Ru6ZmMl3dvQ9dpy5n0Y9/s3K2vCiKNWGUVwUJN0Mj2IgxT7INp90h3ikJ+/CyqiZTdOIdv+pw= X-Received: by 2002:aca:5d43:: with SMTP id r64-v6mr11631016oib.1.1529513344306; Wed, 20 Jun 2018 09:49:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1918:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 09:49:03 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> From: Stephen Kiernan Date: Wed, 20 Jun 2018 09:49:03 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: cem@freebsd.org Cc: Ian Lepore , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 16:49:06 -0000 On Wed, Jun 20, 2018 at 9:30 AM, Conrad Meyer wrote: > > Please look at the actual code size and layout of the sha1 support > module and tell me that is a burden for Juniper to maintain in their > downstream tree, rather than just getting angry about the suggestion > we don't introduce novel, insecurity cryptographic designs. > I have no problem removing the SHA1 and RIPEMD implementations. It's a minor change and very little code for others to have to maintain if needed. That was the intention of fingerprint module implementation, to try to make it easy to add/remote different algorithms. It could even potentially be done as a port, if people are keen to having to pre-load a module to get the support (I know that that's a bit of a grey area without a verified loader and secureboot or similar functionality to protect integrity.) I think some of the issue was this code has been looking for eyes to give a good look for over 2 years (even before the review was posted, it was available in my GitHub branch for at least 1 year prior, if not longer.) As for some of the other issues, note my comment in the review https://reviews.freebsd.org/D8554: "Note I have some updates that I have been working on to handle the meta-data store better in SMP environments. So there will be updates to these reviews, hopefully in the near future, time permitting." And I was working on those sets of changes, when work and family didn't steal away time. I was told that some discussion happened at BSDCan this year in such that veriexec should go in as-is so it would be there, which is why the commit happened (given the review was approved to land back in January.) I suppose I should have just kept with my original intention to fix the issues and update the review(s). Hopefully now it will mean it will get the right eyes on it. I don't believe I need to dig up all the e-mail threads and chat logs for IRC where I asked for help and was given pointers to folks to contact and we ended up here. It's a better use of everyone's time to just cool down, back things out, get new reviews updated and provide constructive feedback. So far this experience (I am not pointing at you here) has been a mixed set of constructive comments and outright flaming. The latter of which is never going to help get the right results and could be one of the reasons that a number of folks give up contributing to FreeBSD. -Steve From owner-svn-src-all@freebsd.org Wed Jun 20 17:00:28 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74A0A102454D; Wed, 20 Jun 2018 17:00:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1565D84F3A; Wed, 20 Jun 2018 17:00:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 8A0BE10A87D; Wed, 20 Jun 2018 13:00:26 -0400 (EDT) Subject: Re: svn commit: r335394 - head To: Bryan Drewery , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806192340.w5JNehKn004969@repo.freebsd.org> From: John Baldwin Message-ID: <54db8611-cca5-0753-9905-9213afe06e65@FreeBSD.org> Date: Wed, 20 Jun 2018 10:00:25 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806192340.w5JNehKn004969@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 20 Jun 2018 13:00:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:00:28 -0000 On 6/19/18 4:40 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Tue Jun 19 23:40:42 2018 > New Revision: 335394 > URL: https://svnweb.freebsd.org/changeset/base/335394 > > Log: > Fix detection for binutils bootstrap package. > > The path was changed recently in the port to be the full target triple. Except this doesn't work either. The TARGET_TRIPLE the package uses is based on the build _host_ machine, so if you are building a current MIPS world on an 11.2 host (for example), TARGET_TRIPLE will use '12.0' but won't work because the package installed on the host will be using '11.2'. I want to revert the cross binutils packages back to the old naming scheme as that makes more sense (and it is what configure scripts keep looking for, I have to create symlinks for gdb's ./configure script to DTRT when cross-building for example.) -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 20 17:09:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8216E1024B50; Wed, 20 Jun 2018 17:09:33 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [96.47.72.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F00658577A; Wed, 20 Jun 2018 17:09:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id B4E731253A; Wed, 20 Jun 2018 17:09:32 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id B3851D8B; Wed, 20 Jun 2018 17:09:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id fHqw1V-asOoi; Wed, 20 Jun 2018 17:09:29 +0000 (UTC) Subject: Re: svn commit: r335394 - head DKIM-Filter: OpenDKIM Filter v2.10.3 mail.xzibition.com D5E33D85 To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806192340.w5JNehKn004969@repo.freebsd.org> <54db8611-cca5-0753-9905-9213afe06e65@FreeBSD.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Autocrypt: addr=bdrewery@FreeBSD.org; prefer-encrypt=mutual; keydata= xsBNBFJphmsBCADiFgmS4bIzwZijrS31SjEMzg+n5zNellgM+HkShwehpqCiyhXdWrvH6dTZ a6u50pbUIX7doTR7W7PQHCjCTqtpwvcj0eulZva+iHFp+XrbgSFHn+VVXgkYP2MFySyZRFab D2qqzJBEJofhpv4HvY6uQI5K99pMqKr1Z/lHqsijYYu4RH2OfwB5PinId7xeldzWEonVoCr+ rfxzO/UrgA6v/3layGZcKNHFjmc3NqoN1DXtdaEHqtjIozzbndVkH6lkFvIpIrI6i5ox8pwp VxsxLCr/4Musd5CWgHiet5kSw2SzNeA8FbxdLYCpXNVu+uBACEbCUP+CSNy3NVfEUxsBABEB AAHNJEJyeWFuIERyZXdlcnkgPGJkcmV3ZXJ5QEZyZWVCU0Qub3JnPsLAgAQTAQoAKgIbAwUL CQgHAwUVCgkICwUWAwIBAAIeAQIXgAIZAQUCWujOIgUJCmB7NwAKCRA113G7bkaXz/xpB/9b /UWIPbieY1IeIuHF2pyYPE7Hytkh3HVsxMA0F5Ma2AYQsXZZeKNKWrF7RPyDyDwUklLHJkhm k3EfClBbHxf08kMIm1vWCJRtgxic9knY/bzYGiWMpHjg3cSd1XfrYH1autYqTZAjDwIkgOjU dR//Tbn4V36sY7y2jz+kdMVWvK53U32aZqiwBbCn4DPe1wSZcUs17mV/0uZdIoGdj74B1orN A/0py5vHYo6HcbBNoaR8pKRLf5VZNRsxqGIMhTucx4SJWcHpuRBWYyvJSFzwvxdK4ZD4Yqoc kFGPVtOXktVMai9exrLvP3G77fKMu8DI6j4QRU4wCesnHuIfRPFuzsBNBFJphmsBCACiVFPf kNfaFtUSuY0395ueo/rMyHPGPQ2iwvERFCpeFGSQSgagpenNHLpFQKTg/dl6FOoST5tqyxMq fyHGHDzzU51bvA/IfaGoNi/BIhTe/toZNMRvpcI3PLjiGcnJnuwCCbAVOAGdb+t5cZtpNdOI cKYmrYG3u9RiBpe6dTF+qLrD/8Bs1wjhduQ8fcNNgnkXu8xDH4ZxY0lIc3QgvYWp9vimlQe6 iKjUd2/DX28ETZcD5h6pYV331KMPTrEI0p0yvFijUZce8c1XHFyL1j9sBAha5qpszJl6Uq5i LolhKRcGfcdmtD72vHQjUYglUyudSJUVyo2gMYjdbiFKzJulABEBAAHCwGUEGAEKAA8CGwwF AlrozigFCQpgez0ACgkQNddxu25Gl8+m5Af/R3VEdxNMAcDIes9ADhQyofj20SPV3eCJ3HYR OebTSuNdOudGt4AAyA8Ks94u9hiIp5IGsc6RDsT9W7O2vgXhd6eV3eiY5Oif5xLIYrIDVu1Y 1GyRxRrPEn/QOqDN6uFZCPwK1aOapGcYCrO9lB0gMuTVfgHanU61rgC9tMX0OoAOyRd+V3/M 8lDNhjJdF/IpO3SdYzKfkwduy4qamw4Gphcx/RfYQvYLq/eDkP8d50PphWdboqWBwNRHayro W/07OGzfxM5fJ5mBsXPQcO2QcRjkyHf6xCM6Hi1qQL4OnXMNE/ZTX0lnOj1/pH93TlzSHZMP TaiiA/MBD3vGsXBmBg== Organization: FreeBSD Message-ID: <2acdfa6d-5809-62ef-e4fb-4ca924b32ded@FreeBSD.org> Date: Wed, 20 Jun 2018 10:09:28 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <54db8611-cca5-0753-9905-9213afe06e65@FreeBSD.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZHhQeECp9xfALs3QejKJ9l1mSV1gnHc9h" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:09:33 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --ZHhQeECp9xfALs3QejKJ9l1mSV1gnHc9h Content-Type: multipart/mixed; boundary="R9ZZJHDOdqrrbI8M4jHyBXVGhU47LxF4G"; protected-headers="v1" From: Bryan Drewery To: John Baldwin , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <2acdfa6d-5809-62ef-e4fb-4ca924b32ded@FreeBSD.org> Subject: Re: svn commit: r335394 - head References: <201806192340.w5JNehKn004969@repo.freebsd.org> <54db8611-cca5-0753-9905-9213afe06e65@FreeBSD.org> In-Reply-To: <54db8611-cca5-0753-9905-9213afe06e65@FreeBSD.org> --R9ZZJHDOdqrrbI8M4jHyBXVGhU47LxF4G Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable On 6/20/2018 10:00 AM, John Baldwin wrote: > On 6/19/18 4:40 PM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Tue Jun 19 23:40:42 2018 >> New Revision: 335394 >> URL: https://svnweb.freebsd.org/changeset/base/335394 >> >> Log: >> Fix detection for binutils bootstrap package. >> =20 >> The path was changed recently in the port to be the full target trip= le. >=20 > Except this doesn't work either. The TARGET_TRIPLE the package uses is= based > on the build _host_ machine, so if you are building a current MIPS worl= d > on an 11.2 host (for example), TARGET_TRIPLE will use '12.0' but won't = work > because the package installed on the host will be using '11.2'. >=20 Oops... > I want to revert the cross binutils packages back to the old naming sch= eme > as that makes more sense (and it is what configure scripts keep looking= for, > I have to create symlinks for gdb's ./configure script to DTRT when cro= ss-building > for example.) >=20 I'm all for reverting that. --=20 Regards, Bryan Drewery --R9ZZJHDOdqrrbI8M4jHyBXVGhU47LxF4G-- --ZHhQeECp9xfALs3QejKJ9l1mSV1gnHc9h Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJbKopIAAoJEDXXcbtuRpfPRC8H/3JQ5arUH8hhhJTrAPKkZYsd RvuviK0B3Z+kRWlQzusjNXhk38HJYUf6ycA9UPx3PF7cqNGdb/9V8IWUYd+okGOx cJVBFTlg65d6rsAqZ6ceclS+BCSvlLuynraDoHy5Meq3tf+jndHf8UIcq2Lh/Afc Il5qMpQpKPlu+SykW+irGqgnQNqt36rTw+IXuAqIp3zNVQmbFjfhQarD+8SmyPhw OFnnxNH83DkZkIGtYQZ16mkCPTPsFXnFbQ43AoWVOD8mKZ097dsqJBibHrMijCQ1 0t1gvs+xgSg+jID2xf2axR6KnIvTqIO8PORuCZlqytBBsvRfXLf7j1HdOKUYBlg= =kQsU -----END PGP SIGNATURE----- --ZHhQeECp9xfALs3QejKJ9l1mSV1gnHc9h-- From owner-svn-src-all@freebsd.org Wed Jun 20 17:20:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BAFA1025280; Wed, 20 Jun 2018 17:20:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BD0285FE5; Wed, 20 Jun 2018 17:20:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E6E825348; Wed, 20 Jun 2018 17:20:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KHKfP3085836; Wed, 20 Jun 2018 17:20:41 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KHKdG5085829; Wed, 20 Jun 2018 17:20:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201720.w5KHKdG5085829@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 17:20:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335452 - in head: . share/mk X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: in head: . share/mk X-SVN-Commit-Revision: 335452 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:20:42 -0000 Author: bdrewery Date: Wed Jun 20 17:20:39 2018 New Revision: 335452 URL: https://svnweb.freebsd.org/changeset/base/335452 Log: Reduce exec and fstat overhead for non-build targets. This is mostly targetting 'make showconfig' and 'make test-system-*' for the benefit of makeman and universe-one-clang work. Sponsored by: Dell EMC Modified: head/Makefile.inc1 head/Makefile.libcompat head/share/mk/bsd.compiler.mk head/share/mk/bsd.init.mk head/share/mk/local.meta.sys.mk head/share/mk/src.sys.obj.mk head/share/mk/sys.mk Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 20 16:15:03 2018 (r335451) +++ head/Makefile.inc1 Wed Jun 20 17:20:39 2018 (r335452) @@ -50,6 +50,10 @@ .error "Both TARGET and TARGET_ARCH must be defined." .endif +.if make(showconfig) || make(test-system-*) +_MKSHOWCONFIG= t +.endif + SRCDIR?= ${.CURDIR} LOCALBASE?= /usr/local @@ -175,7 +179,8 @@ WANT_COMPILER_TYPE= gcc WANT_COMPILER_TYPE= .endif -.if !defined(WANT_COMPILER_FREEBSD_VERSION) +.if !defined(WANT_COMPILER_FREEBSD_VERSION) && !make(showconfig) && \ + !make(test-system-linker) .if ${WANT_COMPILER_TYPE} == "clang" WANT_COMPILER_FREEBSD_VERSION_FILE= lib/clang/freebsd_cc_version.h WANT_COMPILER_FREEBSD_VERSION!= \ @@ -203,8 +208,9 @@ WANT_COMPILER_VERSION!= \ # GCC cannot be used for cross-arch yet. For clang we pass -target later if # TARGET_ARCH!=MACHINE_ARCH. .if ${MK_SYSTEM_COMPILER} == "yes" && \ + defined(WANT_COMPILER_FREEBSD_VERSION) && \ (${MK_CLANG_BOOTSTRAP} == "yes" || ${MK_GCC_BOOTSTRAP} == "yes") && \ - !make(showconfig) && !make(xdev*) && \ + !make(xdev*) && \ ${X_COMPILER_TYPE} == ${WANT_COMPILER_TYPE} && \ (${X_COMPILER_TYPE} == "clang" || ${TARGET_ARCH} == ${MACHINE_ARCH}) && \ ${X_COMPILER_VERSION} == ${WANT_COMPILER_VERSION} && \ @@ -228,7 +234,8 @@ WANT_LINKER_TYPE= bfd WANT_LINKER_TYPE= .endif -.if !defined(WANT_LINKER_FREEBSD_VERSION) +.if !defined(WANT_LINKER_FREEBSD_VERSION) && !make(showconfig) && \ + !make(test-system-compiler) .if ${WANT_LINKER_TYPE} == "lld" WANT_LINKER_FREEBSD_VERSION_FILE= lib/clang/include/lld/Common/Version.inc WANT_LINKER_FREEBSD_VERSION!= \ @@ -246,8 +253,9 @@ WANT_LINKER_FREEBSD_VERSION= .endif # !defined(WANT_LINKER_FREEBSD_VERSION) .if ${MK_SYSTEM_LINKER} == "yes" && \ + defined(WANT_LINKER_FREEBSD_VERSION) && \ (${MK_LLD_BOOTSTRAP} == "yes") && \ - !make(showconfig) && !make(xdev*) && \ + !make(xdev*) && \ ${X_LINKER_TYPE} == ${WANT_LINKER_TYPE} && \ ${X_LINKER_VERSION} == ${WANT_LINKER_VERSION} && \ ${X_LINKER_FREEBSD_VERSION} == ${WANT_LINKER_FREEBSD_VERSION} @@ -437,6 +445,7 @@ BUILDENV_SHELL?=${SHELL} BUILDENV_SHELL?=/bin/sh .endif +.if !defined(_MKSHOWCONFIG) .if !defined(SVN_CMD) || empty(SVN_CMD) . for _P in /usr/bin /usr/local/bin . for _S in svn svnlite @@ -505,6 +514,7 @@ EXTRA_REVISION= _${_BRANCH:C/.*-p([0-9]+$)/\1/} .endif PKG_VERSION= ${_REVISION}${EXTRA_REVISION} .endif +.endif # !defined(_MKSHOWCONFIG) KNOWN_ARCHES?= aarch64/arm64 \ amd64 \ @@ -541,11 +551,13 @@ _t= ${TARGET_ARCH}/${TARGET} .endif .endfor +.if !defined(_MKSHOWCONFIG) _CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} -f /dev/null \ -m ${.CURDIR}/share/mk MK_AUTO_OBJ=no -V CPUTYPE .if ${_CPUTYPE} != ${_TARGET_CPUTYPE} .error CPUTYPE global should be set with ?=. .endif +.endif .if make(buildworld) BUILD_ARCH!= uname -p .if ${MACHINE_ARCH} != ${BUILD_ARCH} @@ -763,7 +775,7 @@ LIBCOMPAT= SOFT # to get updated host tools. .if ${MK_META_MODE} == "yes" && defined(NO_CLEAN) && \ !defined(NO_META_IGNORE_HOST) && !defined(NO_META_IGNORE_HOST_HEADERS) && \ - !make(showconfig) + !defined(_MKSHOWCONFIG) # r318736 - ino64 major ABI breakage META_MODE_BAD_ABI_VERS+= 1200031 @@ -881,37 +893,33 @@ _cleanobj_fast_depend_hack: .PHONY # 20180525 r334224 vadvise # 20180604 r334626 brk sbrk .for f in brk exect fstat fstatat fstatfs getdirentries getfsstat sbrk setlogin shmat sigreturn statfs vadvise -.if exists(${OBJTOP}/lib/libc/.depend.${f}.o) - @if egrep -qw '${f}\.[sS]' \ - ${OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo Removing stale dependencies for ${f} syscall wrappers; \ + @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ + egrep -qw '${f}\.[sS]' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ + echo "Removing stale dependencies for ${f} syscall wrappers"; \ rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi -.endif .endfor # 20170607 remove stale dependencies for utimens* wrappers removed in r319663 .for f in futimens utimensat -.if exists(${OBJTOP}/lib/libc/.depend.${f}.o) - @if egrep -q '/${f}.c' \ - ${OBJTOP}/lib/libc/.depend.${f}.o; then \ - echo Removing stale dependencies for ${f} syscall wrappers; \ + @if [ -e "${OBJTOP}/lib/libc/.depend.${f}.o" ] && \ + egrep -q '/${f}.c' ${OBJTOP}/lib/libc/.depend.${f}.o; then \ + echo "Removing stale dependencies for ${f} syscall wrappers"; \ rm -f ${OBJTOP}/lib/libc/.depend.${f}.* \ ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ fi -.endif .endfor # 20170523 remove stale generated asm files for functions which are no longer # syscalls after r302092 (pipe) and r318736 (others) .for f in getdents lstat mknod pipe stat -.if exists(${OBJTOP}/lib/libc/${f}.s) || \ - exists(${OBJTOP}/lib/libc/${f}.S) - @echo Removing stale generated ${f} syscall files - @rm -f ${OBJTOP}/lib/libc/${f}.* \ - ${OBJTOP}/lib/libc/.depend.${f}.* \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/${f}.*} \ - ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*} -.endif + @if [ -e "${OBJTOP}/lib/libc/${f}.s" ] || \ + [ -e "${OBJTOP}/lib/libc/${f}.S" ] ; then \ + echo "Removing stale generated ${f} syscall files"; \ + rm -f ${OBJTOP}/lib/libc/${f}.* \ + ${OBJTOP}/lib/libc/.depend.${f}.* \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/${f}.*} \ + ${LIBCOMPAT:D${LIBCOMPAT_OBJTOP}/lib/libc/.depend.${f}.*}; \ + fi .endfor _worldtmp: .PHONY @@ -922,11 +930,11 @@ _worldtmp: .PHONY .if !defined(NO_CLEAN) rm -rf ${WORLDTMP} .else -.if exists(${WORLDTMP}) - @echo ">>> Deleting stale files in build tree..." - ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ - delete-old delete-old-libs >/dev/null -.endif + ${_+_}@if [ -e "${WORLDTMP}" ]; then \ + echo ">>> Deleting stale files in build tree..."; \ + cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + delete-old delete-old-libs >/dev/null; \ + fi rm -rf ${WORLDTMP}/legacy/usr/include .if ${USING_SYSTEM_COMPILER} == "yes" .for cc in cc c++ @@ -1460,7 +1468,7 @@ INSTALLKERNEL= BUILDKERNELS+= dummy .endif .for _kernel in ${KERNCONF} -.if exists(${KERNCONFDIR}/${_kernel}) +.if !defined(_MKSHOWCONFIG) && exists(${KERNCONFDIR}/${_kernel}) BUILDKERNELS+= ${_kernel} .if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL) INSTALLKERNEL= ${_kernel} @@ -1474,11 +1482,11 @@ INSTALLKERNEL= ${_kernel} _cleankernobj_fast_depend_hack: .PHONY # 20180320 remove stale generated assym.s after renaming to .inc in r331254 -.if exists(${OBJTOP}/sys/${KERNCONF}/assym.s) - @echo Removing stale generated assym files - @rm -f ${OBJTOP}/sys/${KERNCONF}/assym.* \ - ${OBJTOP}/sys/${KERNCONF}/.depend.assym.* -.endif + @if [ -e "${OBJTOP}/sys/${KERNCONF}/assym.s" ]; then \ + echo "Removing stale generated assym files"; \ + rm -f ${OBJTOP}/sys/${KERNCONF}/assym.* \ + ${OBJTOP}/sys/${KERNCONF}/.depend.assym.*; \ + fi ${WMAKE_TGTS:N_worldtmp:Nbuild${libcompat}} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY @@ -1685,7 +1693,7 @@ PKGSIGNKEY?= # empty .ORDER: create-packages sign-packages _pkgbootstrap: .PHONY -.if !exists(${LOCALBASE}/sbin/pkg) +.if make(*package*) && !exists(${LOCALBASE}/sbin/pkg) @env ASSUME_ALWAYS_YES=YES pkg bootstrap .endif @@ -1771,7 +1779,7 @@ create-world-package-${pkgname}: .PHONY create-kernel-packages: .PHONY _default_flavor= -default -.if exists(${KSTAGEDIR}/kernel.meta) +.if make(*package*) && exists(${KSTAGEDIR}/kernel.meta) . if ${MK_DEBUG_FILES} != "no" _debug=-debug . endif @@ -2669,7 +2677,7 @@ lib/libproc__L: gnu/lib/libsupc++__L .for _lib in ${_prereq_libs} ${_lib}__PL: .PHONY .MAKE -.if exists(${.CURDIR}/${_lib}) +.if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ cd ${.CURDIR}/${_lib}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \ @@ -2682,7 +2690,7 @@ ${_lib}__PL: .PHONY .MAKE .for _lib in ${_startup_libs} ${_prebuild_libs} ${_generic_libs} ${_lib}__L: .PHONY .MAKE -.if exists(${.CURDIR}/${_lib}) +.if !defined(_MKSHOWCONFIG) && exists(${.CURDIR}/${_lib}) ${_+_}@${ECHODIR} "===> ${_lib} (obj,all,install)"; \ cd ${.CURDIR}/${_lib}; \ if [ -z "${NO_OBJWALK}" ]; then ${MAKE} MK_TESTS=no DIRPRFX=${_lib}/ obj; fi; \ @@ -2888,7 +2896,7 @@ showconfig: .PHONY DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/ .if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE) -.if exists(${KERNCONFDIR}/${KERNCONF}) +.if !defined(_MKSHOWCONFIG) && exists(${KERNCONFDIR}/${KERNCONF}) FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \ '${KERNCONFDIR}/${KERNCONF}' ; echo .endif Modified: head/Makefile.libcompat ============================================================================== --- head/Makefile.libcompat Wed Jun 20 16:15:03 2018 (r335451) +++ head/Makefile.libcompat Wed Jun 20 17:20:39 2018 (r335452) @@ -172,11 +172,12 @@ build${libcompat}: .PHONY .if !defined(NO_CLEAN) rm -rf ${LIBCOMPATTMP} .else -.if exists(${LIBCOMPATTMP}) - ${_+_}cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ - DESTDIR=${LIBCOMPATTMP} \ - delete-old delete-old-libs >/dev/null -.endif + ${_+_}@if [ -e "${LIBCOMPATTMP}" ]; then \ + echo ">>> Deleting stale files in build${libcompat} tree..."; \ + cd ${.CURDIR}; ${WMAKE} -DBATCH_DELETE_OLD_FILES \ + DESTDIR=${LIBCOMPATTMP} \ + delete-old delete-old-libs >/dev/null; \ + fi .endif # !defined(NO_CLEAN) mkdir -p ${LIBCOMPATTMP}/usr/include Modified: head/share/mk/bsd.compiler.mk ============================================================================== --- head/share/mk/bsd.compiler.mk Wed Jun 20 16:15:03 2018 (r335451) +++ head/share/mk/bsd.compiler.mk Wed Jun 20 17:20:39 2018 (r335452) @@ -39,7 +39,7 @@ CCACHE_BUILD_TYPE?= command # Handle ccache after CC is determined, but not if CC/CXX are already # overridden with a manual setup. .if ${MK_CCACHE_BUILD:Uno} == "yes" && \ - !make(showconfig) && \ + !make(test-system-*) && !make(print-dir) && !make(showconfig) && \ (${CC:M*ccache/world/*} == "" || ${CXX:M*ccache/world/*} == "") # CC is always prepended with the ccache wrapper rather than modifying # PATH since it is more clear that ccache is used and avoids wasting time Modified: head/share/mk/bsd.init.mk ============================================================================== --- head/share/mk/bsd.init.mk Wed Jun 20 16:15:03 2018 (r335451) +++ head/share/mk/bsd.init.mk Wed Jun 20 17:20:39 2018 (r335452) @@ -81,7 +81,8 @@ all: beforebuild .WAIT .if ${MK_META_MODE} == "yes" .if !exists(/dev/filemon) && \ ${UPDATE_DEPENDFILE:Uyes:tl} != "no" && !defined(NO_FILEMON) && \ - !make(showconfig) && !make(print-dir) && ${.MAKEFLAGS:M-V} == "" + !make(test-system-*) && !make(showconfig) && !make(print-dir) && \ + ${.MAKEFLAGS:M-V} == "" .warning The filemon module (/dev/filemon) is not loaded. .warning META_MODE is less useful for incremental builds without filemon. .warning 'kldload filemon' or pass -DNO_FILEMON to suppress this warning. Modified: head/share/mk/local.meta.sys.mk ============================================================================== --- head/share/mk/local.meta.sys.mk Wed Jun 20 16:15:03 2018 (r335451) +++ head/share/mk/local.meta.sys.mk Wed Jun 20 17:20:39 2018 (r335452) @@ -212,7 +212,7 @@ BTOOLSPATH= ${HOST_OBJTOP}/tools${.CURDIR} # Don't use the bootstrap tools logic on itself. .if ${.TARGETS:Mbootstrap-tools} == "" && \ - !make(showconfig) && \ + !make(test-system-*) && !make(showconfig) && !make(print-dir) && \ !defined(BOOTSTRAPPING_TOOLS) && !empty(TOOLSDIR) && ${.MAKE.LEVEL} == 0 .for dir in /sbin /bin /usr/sbin /usr/bin PATH:= ${TOOLSDIR}${dir}:${PATH} Modified: head/share/mk/src.sys.obj.mk ============================================================================== --- head/share/mk/src.sys.obj.mk Wed Jun 20 16:15:03 2018 (r335451) +++ head/share/mk/src.sys.obj.mk Wed Jun 20 17:20:39 2018 (r335452) @@ -132,6 +132,7 @@ __objdir:= ${MAKEOBJDIR} .if ${.MAKE.LEVEL} == 0 && \ ${MK_AUTO_OBJ} == "no" && empty(.MAKEOVERRIDES:MMK_AUTO_OBJ) && \ !defined(WITHOUT_AUTO_OBJ) && !make(showconfig) && !make(print-dir) && \ + !make(test-system-*) && \ !defined(NO_OBJ) && \ empty(RELDIR:Msys/*/compile/*) # Find the last existing directory component and check if we can write to it. Modified: head/share/mk/sys.mk ============================================================================== --- head/share/mk/sys.mk Wed Jun 20 16:15:03 2018 (r335451) +++ head/share/mk/sys.mk Wed Jun 20 17:20:39 2018 (r335452) @@ -118,7 +118,8 @@ NO_META_IGNORE_HOST_HEADERS= 1 # This needs to be done early - before .PATH is computed # Don't do this for 'make showconfig' as it enables all options where meta mode # is not expected. -.if !make(showconfig) && !make(print-dir) && empty(.MAKEFLAGS:M-[nN]) +.if !make(showconfig) && !make(print-dir) && !make(test-system-*) && \ + empty(.MAKEFLAGS:M-[nN]) .sinclude .endif .endif # ${MK_AUTO_OBJ} == "yes" From owner-svn-src-all@freebsd.org Wed Jun 20 17:37:56 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A83491025F93; Wed, 20 Jun 2018 17:37:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5AD1186EE8; Wed, 20 Jun 2018 17:37:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D4C02567F; Wed, 20 Jun 2018 17:37:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KHbual095444; Wed, 20 Jun 2018 17:37:56 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KHbueT095443; Wed, 20 Jun 2018 17:37:56 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806201737.w5KHbueT095443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Jun 2018 17:37:56 +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: r335453 - stable/11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/amd64 X-SVN-Commit-Revision: 335453 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:37:56 -0000 Author: kib Date: Wed Jun 20 17:37:55 2018 New Revision: 335453 URL: https://svnweb.freebsd.org/changeset/base/335453 Log: MFC r332994 (by tychon): Handle potential alignment adjustment of the exception frame by hardware. Modified: stable/11/sys/amd64/amd64/exception.S Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/exception.S ============================================================================== --- stable/11/sys/amd64/amd64/exception.S Wed Jun 20 17:20:39 2018 (r335452) +++ stable/11/sys/amd64/amd64/exception.S Wed Jun 20 17:37:55 2018 (r335453) @@ -341,6 +341,9 @@ page_cr2: * On the stack, we have the hardware interrupt frame to return * to usermode (faulted) and another frame with error code, for * fault. For PTI, copy both frames to the main thread stack. + * Handle the potential 16-byte alignment adjustment incurred + * during the second fault by copying both frames independently + * while unwinding the stack in between. */ .macro PROTF_ENTRY name,trapno \name\()_pti_doreti: @@ -351,7 +354,11 @@ page_cr2: movq %rax,%cr3 movq PCPU(RSP0),%rax subq $2*PTI_SIZE-3*8,%rax /* no err, %rax, %rdx in faulted frame */ - MOVE_STACKS (PTI_SIZE / 4 - 3) + MOVE_STACKS (PTI_SIZE / 8) + addq $PTI_SIZE,%rax + movq PTI_RSP(%rsp),%rsp + MOVE_STACKS (PTI_SIZE / 8 - 3) + subq $PTI_SIZE,%rax movq %rax,%rsp popq %rdx popq %rax From owner-svn-src-all@freebsd.org Wed Jun 20 17:54:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52C8A10011CB; Wed, 20 Jun 2018 17:54:20 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f54.google.com (mail-it0-f54.google.com [209.85.214.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CBE366A97B; Wed, 20 Jun 2018 17:54:19 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f54.google.com with SMTP id k17-v6so166082ita.0; Wed, 20 Jun 2018 10:54:19 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc:content-transfer-encoding; bh=cotO2IyVsn+M1/xcGWjf2TyAg17vuUaKCbJDuSbxNFw=; b=jcheoo6H2tiU1cCuPbI6RKA2xuiEnRjBp5KNmNK6b/YazB9kW0EnFpjMmYp2dhyZIP 2q/1wPLMyLkzduDfXiMrd1dRG7ULtk2T8bkTAc4CP5OBlDRNThK55lUNleEbGK/zGviW XfLQPwhLdJV18rL+tQZwS1GyjXZFgk6YDiTFYBZakSaM9HWPOcnLKb1m46Skuqgkw93W Os/04C7oLyOg6V/LfTP7KruwcVMMt3X5Qnp48LpLHI42K2slDPJ7h/rOM+HWzu7xlGrF 486QYG4xzqb+qTjl4dQZjVxIC17odwlxbP+/tktW8oGgQUmxLqxdtScj/3j7In+PIWO5 FSLw== X-Gm-Message-State: APt69E1kqXk6KHCKTFZ9smemF6pOwwqe0lcDNhA0+Zh2ccsQADPPUxbx oqgFzgtHrZwypWElGmRXJnVLvcEU X-Google-Smtp-Source: ADUXVKIyuiY1Hk8SlNabjYoIfeH3Zpu42MZFGNLT/ErozBkAF8O9NfE1GB7tKGciV7j2EKdYtyk6mg== X-Received: by 2002:a24:c246:: with SMTP id i67-v6mr2549721itg.45.1529517258545; Wed, 20 Jun 2018 10:54:18 -0700 (PDT) Received: from mail-it0-f48.google.com (mail-it0-f48.google.com. [209.85.214.48]) by smtp.gmail.com with ESMTPSA id e202-v6sm1313417ioe.0.2018.06.20.10.54.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 10:54:18 -0700 (PDT) Received: by mail-it0-f48.google.com with SMTP id 188-v6so840361ita.5; Wed, 20 Jun 2018 10:54:18 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr2394866ith.53.1529517258283; Wed, 20 Jun 2018 10:54:18 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 10:54:17 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> From: Conrad Meyer Date: Wed, 20 Jun 2018 10:54:17 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Simon J. Gerraty" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:54:20 -0000 Hi Simon, Jonathan points out some of my comments were more acerbic than necessary. I apologize for that. I'd like to try to rephrase them in a more clear way. On Wed, Jun 20, 2018 at 8:43 AM, Conrad Meyer wrote: > On Tue, Jun 19, 2018 at 11:21 PM, Simon J. Gerraty wrot= e: >> As I mentioned in my talk at BSDCan, > > (FWIW, I was not at your talk, and it is not a justification for bad > design or implementation anyway.) I said before and I'll repeat: I think this design is pretty close to a reasonable security feature. I think it currently has a number of serious =E2=80=94 but addressable =E2=80=94 flaws, some of which I have tri= ed to outline. > ... > Why is this either necessary or helpful to be in the FreeBSD tree > as-is? I don't think it is, and you should revert it. Please. I > don't know if there's a maintainer timeout on this kind of thing, but, > you are forewarned. Sorry, this was a poor choice of words. I mean to say something like: I asked for a revert in an earlier email, and this reply did not address the primary reason for the revert, so I am still asking for a revert. I can do it myself, but I would like to give the committer the opportunity to do it themselves. (In private, Stephen has let me know he will do so when he gets back to his FreeBSD machines, so there's no need for that anyway.) All the best, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 17:57:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7589B10013BF; Wed, 20 Jun 2018 17:57:57 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E6C886AB5E; Wed, 20 Jun 2018 17:57:56 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f42.google.com with SMTP id r125-v6so1084116wmg.2; Wed, 20 Jun 2018 10:57: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:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ugSG2QX2VLc0fdEFPglQeEeTLgeD2IMFROmeBRcvhK4=; b=AkjotIbo+HDYJRENa/Dvq/zoq6CW7gWmN5aJh2cqZJuma9DT2iBru5FEmDs2kDxfk8 bbervQ70iocpTfMVozDxqGPuDlVAxyTim8F92juDbfJzrk7YjQxqTRwZC2FVnV6AMjHK viGjbRNn7ilTdHno9Ghn+PBssPUCSI5RJ0idrRaq+E+04KqqS2Id3wnAZtWXngvNQkLu mpDVUzhExKjfg1VIK/PRC0I7sUmielsG4AC+eusXYyqrCzmnrmLM29Sn8bXipB1H66Rp rmgPc6f2pDJeVaZGQsKW1SRVW+iAGqvXI1klnItPTaoyMPFzPNcG82scE+QcUZEVhqGz goYg== X-Gm-Message-State: APt69E3ikJn07iT1vTBoTyrfOuoMOYLANjUipiEc2LsRw0Fa5cXvti9g o6Y021Jv4y5LLfdAMhHYZe8lh3no X-Google-Smtp-Source: ADUXVKIeptLuDZvZcznxKAnqDb+ByJALYdiBBQZ3sFiD/z3CLk7VOg8+zQhPjqS9BI4KnkQiAipMsA== X-Received: by 2002:a50:c9c1:: with SMTP id c1-v6mr19269001edi.40.1529517470328; Wed, 20 Jun 2018 10:57:50 -0700 (PDT) Received: from mail-wm0-f50.google.com (mail-wm0-f50.google.com. [74.125.82.50]) by smtp.gmail.com with ESMTPSA id f11-v6sm1516975edb.54.2018.06.20.10.57.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 10:57:50 -0700 (PDT) Received: by mail-wm0-f50.google.com with SMTP id v131-v6so1095016wma.1; Wed, 20 Jun 2018 10:57:50 -0700 (PDT) X-Received: by 2002:a1c:c687:: with SMTP id w129-v6mr2578089wmf.66.1529517470027; Wed, 20 Jun 2018 10:57:50 -0700 (PDT) MIME-Version: 1.0 References: <201806200108.w5K18sIR050132@repo.freebsd.org> In-Reply-To: From: "Jonathan T. Looney" Date: Wed, 20 Jun 2018 10:57:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Conrad Meyer Cc: stevek@freebsd.org, src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 17:57:57 -0000 On Tue, Jun 19, 2018 at 8:34 PM Conrad Meyer wrote: > Please revert this patchset. It's not ready. > I'm not sure I understand the need to revert the patches. They may need some refinement, but they also do provide some functionality upon which you can build the tooling that Simon discussed. Unless I missed something, this feature only impacts the system when it is specifically compiled in. In cases like that, I think its reasonable to give the committer some time to refine them in place prior to the code slush/freeze, at which point we can decide what to do. Jonathan From owner-svn-src-all@freebsd.org Wed Jun 20 18:03:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA36E1001854; Wed, 20 Jun 2018 18:03:04 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com [74.125.82.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D8446B035; Wed, 20 Jun 2018 18:03:04 +0000 (UTC) (envelope-from jonlooney@gmail.com) Received: by mail-wm0-f41.google.com with SMTP id v16-v6so923907wmh.5; Wed, 20 Jun 2018 11:03: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=3gbLfR7wBWWCwstijfaRR85j1Y6fi9dJvbkXPKIqwEk=; b=LSbSDLgRnTH9EBrG6ru8rBPGm6M414EKY9Fhapm6QM3MHtPUvgHFX7deSAhfQz98bx 77wZfE8WXsj9Uq2hcYvPipQ4f4s1y6PBsx9NbVn6Ey1x0I8OWrvpIYfXf+nkTzj6y8l1 gR5e5n7qF/HS97ncGW+HN73xtvf7t8vPIvw2VbyfAcWosHq+93/1+oiivPfN7jkk9Wd4 d5Twp+pxLDepaLK41IDD/hFWOjFzFofXp5fRK8/XA+LuyuyEdhaAT0KGFMShU2i+ex5Y Vw6pXmQsmOqFFfOvrl00ZDBopFhSuchmN7edQUbVDRY1HE9w6slGsDhEuSmiKLKzzSdw vr+Q== X-Gm-Message-State: APt69E0nR8ifXBPpk8qRok9qRhF4DsqDP1sFoPu+xXitdmVE2ovxCo7h ONPY2ngp8UCFH702G3vnVHDzc+T0iSI= X-Google-Smtp-Source: ADUXVKLeRutQu6lguYX8vtUci3hUQNr0NA4BFQ9TT1rZ8QZytGt6PmCT/3JFjUXY0361iYeKUXOjwQ== X-Received: by 2002:a50:88a6:: with SMTP id d35-v6mr19385630edd.239.1529517777254; Wed, 20 Jun 2018 11:02:57 -0700 (PDT) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com. [74.125.82.46]) by smtp.gmail.com with ESMTPSA id h15-v6sm1175378edr.4.2018.06.20.11.02.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 11:02:57 -0700 (PDT) Received: by mail-wm0-f46.google.com with SMTP id 69-v6so1099438wmf.3; Wed, 20 Jun 2018 11:02:56 -0700 (PDT) X-Received: by 2002:a1c:c687:: with SMTP id w129-v6mr2591030wmf.66.1529517776793; Wed, 20 Jun 2018 11:02:56 -0700 (PDT) MIME-Version: 1.0 References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> In-Reply-To: From: "Jonathan T. Looney" Date: Wed, 20 Jun 2018 11:02:45 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: hackagadget@gmail.com Cc: Conrad Meyer , Ian Lepore , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:03:05 -0000 On Wed, Jun 20, 2018 at 9:49 AM Stephen Kiernan wrote: > And I was working on those sets of changes, when work and family didn't > steal away time. I was told that some discussion happened at BSDCan this > year in such that veriexec should go in as-is so it would be there, which is why > the commit happened (given the review was approved to land back in January.) I will readily admit that I was probably the source of this. My reasoning was fairly simple: when a review has been open for over a year with no action, it seems like the submitter should be able to commit it without waiting for more review, if they are confident in their change. I stand by that (and, in fact, would substitute something shorter for "over a year"). (Of course, if the submitter has other reasons for delaying the commit, that's their prerogative, and I wasn't intending to push Steve to commit this before he was ready.) Jonathan From owner-svn-src-all@freebsd.org Wed Jun 20 18:09:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EECA31001C94; Wed, 20 Jun 2018 18:09:23 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68E046B3DE; Wed, 20 Jun 2018 18:09:23 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-it0-x230.google.com with SMTP id a3-v6so963950itd.0; Wed, 20 Jun 2018 11:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ZiFLRClMsk4szyaujuHDh9r9UuXc/VZu1vkha2Zj61A=; b=h7raXzBf622gxPbz3cyKg/t4AQqHyE+a8fydneQSEIKJWmI3wmc8JJpsu3FwnAvgrJ L4o3GcdFTSXUTk5tGbFEUiT2ZzVQLDWMobu3HjLZoH+IA9t9f3cLYtzpACwvF9mJnbU+ gPT86sqaFXK0Lhf8uALz63I+DrBM6KsHgu/nPim6cWqh4lDBt5/MquLbx3ZJX7cqRr2o GyUv0CsuAQbKnoNCCKGMmeb7CEw/DWjBeLi/ROvotWwTEiEfqCjBwnsrnJvIl4dnXsn3 uwOS8R5MmDKvfQogqb08t95+b5TkLe7Y7Rq4YqdO7nFSkewhURYIgIIT4yaJTXBpsfhS Hogw== 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=ZiFLRClMsk4szyaujuHDh9r9UuXc/VZu1vkha2Zj61A=; b=TCZSsChHc/6jBmHjHyDUMDgKHZK3avBfrTNN9hwXGd97xEKfSJM63XxNUm560EBrmX x92im6Z6D/vf926TWS2Hm3hSqR9Fs8DYJ5cXsFOgcIWq3wzO/WR1FyaYcLcGdEM+Dw4R DxQMqCNVOSGBniQX+16nbg2bknNCtCIzHGtvn/O5eXgDp0YOMNQXtCE6ndF6hpQlHDhR 1vn2JehASv6sCmrDC6Nuum5M+QBRBVDoUyO2KsOsG4xbxB5robENpqOm6pvE6Zhf8Wi2 dr3xBoRiR49c3EHjYR4LJHt7Da/y8hoWq1ikjJ1eb0yotMltTeq7eXZjNGs7DVXLXAxS zx2Q== X-Gm-Message-State: APt69E3kh+L51f6A92B57sCXBc4/Nhln0CSM1AKAkoZ+z9Ykrb9o4+E+ 99Cpic3MCLycCOz8Dg2dIPZ7PqgAE23+DNCltmqEJa+N X-Google-Smtp-Source: AAOMgpeHLvco/Rtkeo0ELwRP9kDFvMv0O54dEvdQtZ6HE8hvjZ7rHjD4gWX6eIq5WtqB/O1hWbcEBhJXhj13G47eThw= X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr2443009ith.53.1529518162186; Wed, 20 Jun 2018 11:09:22 -0700 (PDT) MIME-Version: 1.0 References: <201806200108.w5K18sIR050132@repo.freebsd.org> In-Reply-To: From: Xin LI Date: Wed, 20 Jun 2018 11:09:10 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Jonathan T. Looney" Cc: Conrad Meyer , stevek@freebsd.org, "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:09:24 -0000 On Wed, Jun 20, 2018 at 10:58 AM Jonathan T. Looney wrote= : > > On Tue, Jun 19, 2018 at 8:34 PM Conrad Meyer wrote: >> >> Please revert this patchset. It's not ready. > > > I'm not sure I understand the need to revert the patches. They may need s= ome refinement, but they also do provide some functionality upon which you = can build the tooling that Simon discussed. > > Unless I missed something, this feature only impacts the system when it i= s specifically compiled in. In cases like that, I think its reasonable to g= ive the committer some time to refine them in place prior to the code slush= /freeze, at which point we can decide what to do. +1 for all points. I do agree with others that SHA-1 support should not be included (unless I have missed something, but I think firmware integrity check counts as a "Digital signature" verification, according to SP 800-131A "9 Hash algorithms", SHA-1 verification should only be used for legacy usage, which does not apply on FreeBSD because this is new feature). But even that, given the code only impacts systems that have it explicitly compiled in, it's reasonable to give the committer more time to make further improvements rather than reverting it as a whole as this would give the code more exposure. Cheers, From owner-svn-src-all@freebsd.org Wed Jun 20 18:15:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27EAD100215B; Wed, 20 Jun 2018 18:15:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mail.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B0A726B920; Wed, 20 Jun 2018 18:15:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro-2.local (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 5FD0610AFAD; Wed, 20 Jun 2018 14:14:57 -0400 (EDT) Subject: Re: svn commit: r335278 - head/bin/pwd To: Eitan Adler References: <201806170514.w5H5Epts050842@repo.freebsd.org> <77224f10-7633-1122-8099-466f2a35942f@FreeBSD.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: John Baldwin Message-ID: <4fc7f1df-ba00-0213-d3f4-2ab5c5114b6c@FreeBSD.org> Date: Wed, 20 Jun 2018 11:14:56 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (mail.baldwin.cx); Wed, 20 Jun 2018 14:14:57 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.99.2 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:15:05 -0000 On 6/18/18 10:26 PM, Eitan Adler wrote: > On 18 June 2018 at 10:57, John Baldwin wrote: >> On 6/16/18 10:14 PM, Eitan Adler wrote: >>> Author: eadler >>> Date: Sun Jun 17 05:14:50 2018 >>> New Revision: 335278 >>> URL: https://svnweb.freebsd.org/changeset/base/335278 >>> >>> Log: >>> pwd: mark usage as dead >> >> You keep committing changes like this and ignoring e-mails about them. > > I replied both the first time and this time. I may have > (accidentally?) ignored similar emails though. The question I have is > other than the mild code churn what's the harm? > >> What broken compiler are you using that doesn't properly inherit __dead2 >> from the call to exit()? > > In this case, scan-build50 was getting annoyed. In this case, someone in a private reply suggested that marking usage 'static' is probably the better fix than marking it __dead2. If that change satisfies scan-build then I think that is a better approach. Also, the proper place for __dead2 if you were going to use it would be on the prototype, not the definition. That is, if usage() were intended to be an exported function like abort() or exit(), then you want to mark the prototype in the header as __dead2 so that the compiler will understand that those functions don't return. However, that annotation is only useful on the prototype, not the definition. -- John Baldwin From owner-svn-src-all@freebsd.org Wed Jun 20 18:26:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27ADC10029A7; Wed, 20 Jun 2018 18:26:01 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "mout.gmx.net", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E2F66C0D6; Wed, 20 Jun 2018 18:26:00 +0000 (UTC) (envelope-from ohartmann@walstatt.org) Received: from thor.intern.walstatt.dynvpn.de ([77.180.76.168]) by mail.gmx.com (mrgmx101 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MLzXM-1fYyWZ2fZE-007oJ0; Wed, 20 Jun 2018 20:25:51 +0200 Date: Wed, 20 Jun 2018 20:25:17 +0200 From: "O. Hartmann" To: Konstantin Belousov Cc: Ian Lepore , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Allan Jude Subject: Re: svn commit: r335276 - in head/stand/i386: gptboot zfsboot Message-ID: <20180620202544.01a44004@thor.intern.walstatt.dynvpn.de> In-Reply-To: <20180620160315.GO2430@kib.kiev.ua> References: <201806170318.w5H3IvJP090557@repo.freebsd.org> <5B2646B3.4020200@grosbein.net> <93b03eb5-326b-5df1-5d41-ae3da163e894@freebsd.org> <20180620092238.GK2430@kib.kiev.ua> <1529509411.20460.83.camel@freebsd.org> <20180620160315.GO2430@kib.kiev.ua> Organization: WALSTATT User-Agent: OutScare 3.1415926 X-Operating-System: ImNotAnOperatingSystem 3.141592527 MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: base64 X-Provags-ID: V03:K1:2QVNho7DXXslY5x+4Cd8NnVuNBrRkPM/bd8n2vMszw6zMosFge3 LxuabpxjZhHKkJioUl4aa/5k5jdBI8uy3PTcDPSZaiZG4nIJWIM5DxDpJFmA4MCvmrNjsKl MQNoXLnLEklRUAixuFd9K1b5ydtay0afF05oafRiDPvoKcdwfiYJupcAydntl0/V8ZjXCCq URWMN3xYuOCLFumsH5u7w== X-UI-Out-Filterresults: notjunk:1;V01:K0:ZoWZJ1OanWU=:5+aIWr1RqWqNrAh5frkBZM zDsAOLN/20J8M6ynjHFHGdkuZqm63SNr31SOv/QwPy7izL+dAwIRCjOUbi6uli+5zypZig/mH HZ2XMsxpOil+w/O7adbbpAZwEYtCPPfWcsfWzLrI3gCG8+EpmH+j7DdfAF5pdaOxFXOnpisrE ryHhG8cWmsZFFmBtbKgov/zj2nh122MgM2xh2CW1GE7h61Rx3Lca8iMKa0cQBxqEUmL5ZT1pJ KVi6ym5TMwp4nSySVDQfPxz9wPMjQuni9y5JkWA4BQKVg9qAR+JjUVK8V835kzDtzHWVxvtri PGlq2s0iYDsf0jhVqFSS+J2P74JzpSS9M8sb4iSU7m2NPBroUFAoqrEFUgBR3F1pBibsdOm8w K4MzKuoWw8p+/ZB819eTFUofKQtIypXu785BAHpFGnnPhDDQQP7kyG70QtJv3E0KewvV/wA8N 6t5TI0tPySlrK/PDBXQXovVzx+6P3FCe1uXauCCFSTn+xz+v/zkac8giEXqRtDMmdx0CB8vM2 br/QLaDDpv8jVZYzzijYiN4AashVxcGzrHeWMu0fhdBafWVIMcVKjideFTszWS6LzHl386grX VTdOw11JtOXy25nptht9bqaNaZtSJPwetnbNyARt4UWK4ZpdO+kLB65QiXlnXX4kTpEvlqZ+q u7srmP8jleDL6YcSib8l4BHyMCfbzUrINTrh56Xx/OvV7PHGET8hyxCsNA4SEzjYzRML7ultu fR/tBG3gYvAjhd74gSI5lfnBdC4/Z/SFMZbzvh2L5R79YllGOiQNf2WTNiYZ0xqXYT6PL61uU 1CBwmMJ X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:26:01 -0000 LS0tLS1CRUdJTiBQR1AgU0lHTkVEIE1FU1NBR0UtLS0tLQ0KSGFzaDogU0hBNTEyDQoNCkFtIFdl ZCwgMjAgSnVuIDIwMTggMTk6MDM6MTUgKzAzMDANCktvbnN0YW50aW4gQmVsb3Vzb3YgPGtvc3Rp a2JlbEBnbWFpbC5jb20+IHNjaHJpZWI6DQoNCj4gT24gV2VkLCBKdW4gMjAsIDIwMTggYXQgMDk6 NDM6MzFBTSAtMDYwMCwgSWFuIExlcG9yZSB3cm90ZToNCj4gPiBPbiBXZWQsIDIwMTgtMDYtMjAg YXQgMTI6MjIgKzAzMDAsIEtvbnN0YW50aW4gQmVsb3Vzb3Ygd3JvdGU6ICANCj4gPiA+IE9uIFR1 ZSwgSnVuIDE5LCAyMDE4IGF0IDA4OjM0OjE4UE0gLTA0MDAsIEFsbGFuIEp1ZGUgd3JvdGU6ICAN Cj4gPiA+ID4gDQo+ID4gPiA+IE9uIDIwMTgtMDYtMTcgMDc6MzIsIEV1Z2VuZSBHcm9zYmVpbiB3 cm90ZTogIA0KPiA+ID4gPiA+IA0KPiA+ID4gPiA+IDE3LjA2LjIwMTggMTA6MTgsIEFsbGFuIEp1 ZGUgd3JvdGU6DQo+ID4gPiA+ID4gICANCj4gPiA+ID4gPiA+IA0KPiA+ID4gPiA+ID4gQXV0aG9y OiBhbGxhbmp1ZGUNCj4gPiA+ID4gPiA+IERhdGU6IFN1biBKdW4gMTcgMDM6MTg6NTYgMjAxOA0K PiA+ID4gPiA+ID4gTmV3IFJldmlzaW9uOiAzMzUyNzYNCj4gPiA+ID4gPiA+IFVSTDogaHR0cHM6 Ly9zdm53ZWIuZnJlZWJzZC5vcmcvY2hhbmdlc2V0L2Jhc2UvMzM1Mjc2DQo+ID4gPiA+ID4gPiAN Cj4gPiA+ID4gPiA+IExvZzoNCj4gPiA+ID4gPiA+IJogZ3B0Ym9vdCwgemZzYm9vdCwgZ3B0emZz Ym9vdDogRW5hYmxlIHRoZSB2aWRlbyBhbmQgc2VyaWFsIGNvbnNvbGVzIGVhcmx5DQo+ID4gPiA+ ID4gPiCamg0KPiA+ID4gPiA+ID4gmiBOb3JtYWxseSB0aGUgc2VyaWFsIGNvbnNvbGUgaXMgbm90 IGVuYWJsZWQgdW50aWwgL2Jvb3QuY29uZmlnIGlzIHJlYWQgYW5kDQo+ID4gPiA+ID4gPiCaIHdl IGtub3cgaG93IHRoZSBzZXJpYWwgY29uc29sZSBzaG91bGQgYmUgY29uZmlndXJlZC6amkluaXRp YWxpemUgdGhlDQo+ID4gPiA+ID4gPiCaIGNvbnNvbGVzIGVhcmx5IGluICdkdWFsJyBtb2RlIChz ZXJpYWwgJiBrZXlib2FyZCkgd2l0aCBhIGRlZmF1bHQgc2VyaWFsDQo+ID4gPiA+ID4gPiCaIHJh dGUgb2YgMTE1MjAwLiBUaGVuIHNlcmlhbCBpcyByZS1pbml0aWFsaXplZCBvbmNlIHRoZSBkaXNr IGlzIGRlY3J5cHRlZA0KPiA+ID4gPiA+ID4gmiBhbmQgdGhlIC9ib290LmNvbmZpZyBmaWxlIGNh biBiZSByZWFkLg0KPiA+ID4gPiA+ID4gmpoNCj4gPiA+ID4gPiA+IJogVGhpcyBhbGxvd3MgdGhl IEdFTElCb290IHBhc3NwaHJhc2UgdG8gYmUgcHJvdmlkZWQgdmlhIHRoZSBzZXJpYWwgY29uc29s ZS4NCj4gPiA+ID4gPiA+IJqaDQo+ID4gPiA+ID4gPiCaIFBSOgkJMjIxNTI2DQo+ID4gPiA+ID4g PiCaIFJlcXVlc3RlZCBieToJbWFueQ0KPiA+ID4gPiA+ID4gmiBSZXZpZXdlZCBieToJaW1wDQo+ ID4gPiA+ID4gPiCaIFNwb25zb3JlZCBieToJS2xhcmEgU3lzdGVtcw0KPiA+ID4gPiA+ID4gmiBE aWZmZXJlbnRpYWwgUmV2aXNpb246CWh0dHBzOi8vcmV2aWV3cy5mcmVlYnNkLm9yZy9EMTU4NjIg IA0KPiA+ID4gPiA+IEkgaGFkIHNldmVyYWwgY2FzZXMgd2hlbiBib290aW5nIEZyZWVCU0QvYW1k NjQgd2l0aCBtb3RoZXJib2FyZCBoYXZpbmcgbm8NCj4gPiA+ID4gPiBzZXJpYWwgcG9ydHMgaGFu ZyBoYXJkIGVhcmx5IGF0IGJvb3QgdW5sZXNzIEkgcmVidWlsdCBib290IG1lZGlhIGNvbmZpZ3Vy aW5nIGl0DQo+ID4gPiA+ID4gdG8gTk9UIHRyeSBhY2Nlc3NpbmcgbWlzc2luZyBzZXJpYWwgcG9y dHMuIEkgZXZlbiBjb3VsZCByZXByb2R1Y2UgdGhhdCB3aXRoDQo+ID4gPiA+ID4gVmlydHVhbEJv eCBtYWNoaW5lIGNvbmZpZ3VyZWQgd2l0aCBubyBzZXJpYWwgcG9ydHMgKG5vdCBzYW1lIGFzIGV4 aXN0aW5nIGJ1Zw0KPiA+ID4gPiA+IGluYWN0aXZlIHNlcmlhbCBwb3J0KS4NCj4gPiA+ID4gPiAN Cj4gPiA+ID4gPiBTaG91bGQgdGhlcmUgYmUgc29tZSB3YXkgdG8gZGlzYWJsZSB0aGlzIHNlcmlh bCBwb3J0cyBjb25maWd1cmF0aW9uIGF0IGNvbXBpbGUNCj4gPiA+ID4gPiB0aW1lPw0KPiA+ID4g PiA+IA0KPiA+ID4gPiA+IA0KPiA+ID4gPiA+ICAgDQo+ID4gPiA+IEkgdGhpbmsgd2hhdCB3ZSds bCBkbyBpdCBjb21waWxlIGl0IGJvdGggd2F5cywgYW5kIHVzZSB0aGUgbm9uLXNlcmlhbA0KPiA+ ID4gPiBvbmUgYnkgZGVmYXVsdCwgYmVjYXVzZSBpdCBpcyBzYWZlci4gVGhlbiB5b3UgY2FuIGp1 c3QgdXNlDQo+ID4gPiA+ICdncHRib290LXNlcmlhbCcgaWYgeW91IHdhbnQgc2VyaWFsIHN1cHBv cnQuDQo+ID4gPiA+IA0KPiA+ID4gPiBUaGlzIHdpbGwgbGlrZWx5IG1ha2UgV2FybmVyIGEgYml0 IHNhZCwgc2luY2Ugd2UgYXJlIGp1c3QgZmluYWxseQ0KPiA+ID4gPiBnZXR0aW5nIGFyb3VuZCB0 byByZWR1Y2luZyB0aGUgbnVtYmVyIG9mIGRpZmZlcmVudCBib290Y29kZSBmaWxlcy4gIA0KPiA+ ID4gSSB0aGluayB3ZSBzaG91bGQgZm9sbG93IHRoZSBoYXJkd2FyZSB0cmVuZHMgdGhlcmUgYW5k IGFwcGx5IGEgcG9saWN5DQo+ID4gPiB3aGVyZSBuZXcgZmVhdHVyZXMgYXJlIG5vdCBhZGRlZCB0 byB0aGUgQ1NNIGJvb3QuIEFsbCBtb2Rlcm4gbWFjaGluZXMNCj4gPiA+IGNhbiBiZSBib290ZWQg aW4gVUVGSSBtb2RlLCBhbmQgaWYgc29tZSBtb2Rlcm4gbWFjaGluZSBjYW5ub3QsIHRoZW4gd2UN Cj4gPiA+IG5lZWQgaXQgZml4ZWQumppXZSBzaG91bGQgZW5jb3VyYWdlIHVzZXJzIHRvIG1ha2Ug bmV3IGluc3RhbGxzIGJvb3QgYnkNCj4gPiA+IFVFRkkuDQo+ID4gPiANCj4gPiA+IFRoZSBmZWF0 dXJlIGZyb20gdGhlIGNvbW1pdCBpcyBvbmx5IHJlbGV2YW50IGZvciBtYWNoaW5lcyB0aGF0IHJl cXVpcmUNCj4gPiA+IENTTSBib290IG9yIGRvIG5vdCBoYXZlIFVFRkkgb3B0aW9uIGF0IGFsbCwg YW0gSSByaWdodCA/IFdpdGggdGhlIHBvbGljeQ0KPiA+ID4gYXBwbGllZCwgYW4gYWRkaXRpb25h bCBDU00tYm9vdCBib290YmxvY2sgd291bGQgYmUgbm90IHNoaXBwZWQuDQo+ID4gPiAgIA0KPiA+ IA0KPiA+IEkgdGhpbmsgaXQgaXMgZmFyIHRvbyBlYXJseSB0byBzYXkgdGhhdCB0aGUgY29kZSBm b3IgYm9vdGluZyB3aXRob3V0DQo+ID4gZWZpIGlzIGFiYW5kb253YXJlLiBJIGhhdmUgaGFsZiBh IGRvemVuIHg4NiBib3hlcyBpbiB1c2UgaGVyZSwgYW5kIG9ubHkNCj4gPiBvbmUgb2YgdGhlbSBp cyBldmVuIGFibGUgdG8gYm9vdCBlZmksIGFuZCBpdHMgZGVmYXVsdCByZXNvbHV0aW9uIGluIGVm aQ0KPiA+IG1vZGUgY29uZnVzZXMgdGhlIGt2bSBzd2l0Y2ggaXQncyBjb25uZWN0ZWQgdG8sIHNv IGV2ZW4gb24gdGhhdCBJIGhhdmUNCj4gPiB0byB1c2UgbGVnYWN5IGJpb3MgYm9vdC4gIA0KPiBJ IGRvIG5vdCBwcm9wb3NlIHRvIGFiYW5kb24gYmlvcyBib290LCBvciBldmVuIHRvIGRlY2xhcmUg aXQgbGVnYWN5DQo+IHdpdGggdGhlIHByb3BlciBtZWFuaW5nLiBJIG1lYW4gdGhhdCBDU00gaXMg ZGlzYXBwZWFyaW5nIG9uIHRoZSBuZXdlc3QNCj4gcGxhdGZvcm1zLCBhbmQgc2hvdWxkIGJlY29t ZSBvbmx5IHVzZWQgb24gb2xkIG1hY2hpbmVzIG9yIGkzODYuICBXaXRoIHRoYXQNCj4gYXR0aXR1 ZGUsIGFkZGluZyBhIGZlYXR1cmVzIGZvciBpdCwgZXNwLiBieSB0aGUgY29zdCBvZiB0aGUgdXNl ciBjb25mdXNpb24sDQo+IGlzIG5vdCB3b3J0aCB0aGUgZWZmb3J0cy4gIEl0IHN0aWxsIHNob3Vs ZCBiZSBtYWludGFpbmVkIGZvciB0aGUgZm9yZXNlYWJsZQ0KPiBmdXR1cmUuDQo+IA0KPiBJZiB0 aGUgbWFjaGluZXMgd2hlcmUgeW91IGdldCB0aGUgdHJvdWJsZSBpcyBuZXdlciB0aGFuIHNheSA1 IHllYXJzLCANCj4gdGhlbiB0aGV5IHNob3VsZCBib290IHdpdGggVUVGSS4gIElmIG5vdCwgdGhl IHByb2JsZW0gaW4gbG9hZGVyLmVmaQ0KPiBuZWVkcyB0byBiZSBmaXhlZC4NCj4gX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18NCj4gc3ZuLXNyYy1oZWFkQGZy ZWVic2Qub3JnIG1haWxpbmcgbGlzdA0KPiBodHRwczovL2xpc3RzLmZyZWVic2Qub3JnL21haWxt YW4vbGlzdGluZm8vc3ZuLXNyYy1oZWFkDQo+IFRvIHVuc3Vic2NyaWJlLCBzZW5kIGFueSBtYWls IHRvICJzdm4tc3JjLWhlYWQtdW5zdWJzY3JpYmVAZnJlZWJzZC5vcmciDQoNCg0KSSdtIGEgYml0 IGNvbmZ1c2VkIHJpZ2h0IG5vdy4gSSBsaXZlZCB1bmRlciB0aGUgaW1wcmVzc2lvbiB0aGF0IHRo ZSBQQ2VuZ2luZXMgQVBVIDJDIGlzIGENCnZlcnkgY29tbW9uIHBpZWNlIG9mIGhhcmR3YXJlIGFt b25nc3QgRnJlZUJTRCB1c2VycyBhbmQgZGV2ZWxvcGVyczoNCg0KIGh0dHBzOi8vd3d3LnBjZW5n aW5lcy5jaC9hcHUyYzQuaHRtDQoNClRoaXMgcGllY2Ugb2YgaGFyZHdhcmUgaXMgc3RpbGwgbm9u LVVFRkksIGFsdGhvdWdoIGNvcmVib290IHNlZW1zIHRvIHN1cHBvcnQgVUVGSS4gU28sDQppbiB0 aGUgIm9wZW5zb3VyY2UgbWFya2V0IiwgdGhlcmUgaXMgc3RpbGwgcHJldHR5IHJlY2VudCBoYWR3 YXJlIGFyb3VuZCB3aXRoIG5vbi1VRUZJDQpjYXBhYmlsaXRpZXMuIA0KDQpJIHdhcyB3b25kZXJp bmcgd2h5IHRoZSBBUFUgd2Fzbid0IGFibGUgdG8gYm9vdCB3aXRoIGFuIGVhcmx5IGVuYWJsZWQg c2VyaWFsIGNvbnNvbGUsDQphbHRob3VnaCB0aGlzIHBpZWNlIG9mIGhhcmR3YXJlIGlzIHNlcmlh bC1jb25zb2xlIG9ubHkgYW5kIHdlIHVzZSAidGlwIiB0byBjb25uZWN0Lg0KDQpUaGUga2VybmVs IEkgdXNlIGlzIGlzIGN1c3RvbWlzZWQgLSBzbyBpZiB0aGVyZSBpcyBhIHByZXJlcXVpc2l0ZSB0 byBoYXZlIGNvbXBpbGVkIGluLA0KcGxlYXNlIGxldCBtZSBrbm93Lg0KDQpSZWdhcmRzLA0KT2xp dmVyDQoNCi0gLS0gDQpPLiBIYXJ0bWFubg0KDQpJY2ggd2lkZXJzcHJlY2hlIGRlciBOdXR6dW5n IG9kZXIgIlViZXJtaXR0bHVuZyBtZWluZXIgRGF0ZW4gZiJ1cg0KV2VyYmV6d2Vja2Ugb2RlciBm InVyIGRpZSBNYXJrdC0gb2RlciBNZWludW5nc2ZvcnNjaHVuZyAoU1MgMjggQWJzLiA0IEJEU0cp Lg0KLS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0NCg0KaUxVRUFSTUtBQjBXSVFRWlZaTXpB dHdDMlQvODZUclM1MjhmeUZoWWxBVUNXeXFjS0FBS0NSRFM1MjhmeUZoWQ0KbERsN0FmOUltU0dq VzJxRXZIeFFiVStoUXV1Yk53cDlKcWplSDdxQ3VHeC9PTHNYS1Q0UG1jQXIzTHJZdlRtcg0KRGZj OFArRjlyVVJoY0VSVnVaRFRqbmxVYzBhaUFnQ09VQjZxZXZyZ1QyRXRLNFgySWMzWjlLQWVVaml3 Y3hhTA0KTnA2dFozaXl6TEQrVmRSbVhXY3VNTWlRQ3hXRHd5eS8xaU9jOVJ5UGNqWGNjRVJwSGFa cg0KPTZuVnMNCi0tLS0tRU5EIFBHUCBTSUdOQVRVUkUtLS0tLQ0K From owner-svn-src-all@freebsd.org Wed Jun 20 18:43:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E862D100388D; Wed, 20 Jun 2018 18:43:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9575D6CC95; Wed, 20 Jun 2018 18:43:18 +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 768CA26257; Wed, 20 Jun 2018 18:43:18 +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 w5KIhIlp032031; Wed, 20 Jun 2018 18:43:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KIhHNu032028; Wed, 20 Jun 2018 18:43:17 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806201843.w5KIhHNu032028@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jun 2018 18:43:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335454 - head/usr.bin/ar X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.bin/ar X-SVN-Commit-Revision: 335454 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:43:19 -0000 Author: emaste Date: Wed Jun 20 18:43:17 2018 New Revision: 335454 URL: https://svnweb.freebsd.org/changeset/base/335454 Log: usr.bin/ar: use standard 2-Clause FreeBSD license Many licenses on ar files contained small variations from the standard FreeBSD license text. To avoid license proliferation switch to the usual 2-clause FreeBSD license after obtaining permission from all copyright holders. Approved by: jkoshy, kaiw, kientzle Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D14561 Modified: head/usr.bin/ar/ar.c head/usr.bin/ar/read.c head/usr.bin/ar/util.c Modified: head/usr.bin/ar/ar.c ============================================================================== --- head/usr.bin/ar/ar.c Wed Jun 20 17:37:55 2018 (r335453) +++ head/usr.bin/ar/ar.c Wed Jun 20 18:43:17 2018 (r335454) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (c) 2007 Kai Wang * Copyright (c) 2007 Tim Kientzle * Copyright (c) 2007 Joseph Koshy @@ -8,22 +10,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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. */ /*- Modified: head/usr.bin/ar/read.c ============================================================================== --- head/usr.bin/ar/read.c Wed Jun 20 17:37:55 2018 (r335453) +++ head/usr.bin/ar/read.c Wed Jun 20 18:43:17 2018 (r335454) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2007 Kai Wang * Copyright (c) 2007 Tim Kientzle * All rights reserved. @@ -7,22 +9,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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 Modified: head/usr.bin/ar/util.c ============================================================================== --- head/usr.bin/ar/util.c Wed Jun 20 17:37:55 2018 (r335453) +++ head/usr.bin/ar/util.c Wed Jun 20 18:43:17 2018 (r335454) @@ -1,4 +1,6 @@ /*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * * Copyright (c) 2003-2007 Tim Kientzle * All rights reserved. * @@ -6,22 +8,22 @@ * 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 - * in this position and unchanged. + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * THIS 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 From owner-svn-src-all@freebsd.org Wed Jun 20 18:51:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6EDD21003FE4; Wed, 20 Jun 2018 18:51: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2392F6D33A; Wed, 20 Jun 2018 18:51:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 062B6263C3; Wed, 20 Jun 2018 18:51:40 +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 w5KIpdZG036763; Wed, 20 Jun 2018 18:51:39 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KIpdjS036760; Wed, 20 Jun 2018 18:51:39 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806201851.w5KIpdjS036760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Wed, 20 Jun 2018 18:51:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335455 - in stable/10/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Group: stable-10 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/10/sys: amd64/amd64 i386/i386 i386/isa X-SVN-Commit-Revision: 335455 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:51:40 -0000 Author: kib Date: Wed Jun 20 18:51:38 2018 New Revision: 335455 URL: https://svnweb.freebsd.org/changeset/base/335455 Log: MFC r335072, r335089, r335131, r335132: Enable eager FPU context switch on i386 and amd64. CVE: CVE-2018-3665 Tested by: emaste (smoke boot) Modified: stable/10/sys/amd64/amd64/cpu_switch.S stable/10/sys/amd64/amd64/fpu.c stable/10/sys/i386/i386/swtch.s stable/10/sys/i386/isa/npx.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/10/sys/amd64/amd64/cpu_switch.S Wed Jun 20 18:43:17 2018 (r335454) +++ stable/10/sys/amd64/amd64/cpu_switch.S Wed Jun 20 18:51:38 2018 (r335455) @@ -111,10 +111,10 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) - jne 3f + jne 2f movq PCB_SAVEFPU(%r8),%r8 clts - cmpl $0,use_xsave + cmpl $0,use_xsave(%rip) jne 1f fxsave (%r8) jmp 2f @@ -126,12 +126,7 @@ ctx_switch_xsave: /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ xsave (%r8) movq %rcx,%rdx -2: smsw %ax - orb $CR0_TS,%al - lmsw %ax - xorl %eax,%eax - movq %rax,PCPU(FPCURTHREAD) -3: +2: /* Save is done. Now fire up new thread. Leave old vmspace. */ movq TD_PCB(%rsi),%r8 @@ -255,6 +250,8 @@ done_load_dr: movq PCB_RBX(%r8),%rbx movq PCB_RIP(%r8),%rax movq %rax,(%rsp) + movq PCPU(CURTHREAD),%rdi + call fpu_activate_sw ret /* Modified: stable/10/sys/amd64/amd64/fpu.c ============================================================================== --- stable/10/sys/amd64/amd64/fpu.c Wed Jun 20 18:43:17 2018 (r335454) +++ stable/10/sys/amd64/amd64/fpu.c Wed Jun 20 18:51:38 2018 (r335455) @@ -139,6 +139,11 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -204,6 +209,7 @@ fpuinit_bsp1(void) u_int cp[4]; uint64_t xsave_mask_user; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if ((cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); @@ -611,6 +617,45 @@ fputrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } +static void +restore_fpu_curthread(struct thread *td) +{ + struct pcb *pcb; + + /* + * Record new context early in case frstor causes a trap. + */ + PCPU_SET(fpcurthread, td); + + stop_emulating(); + fpu_clean_state(); + pcb = td->td_pcb; + + if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + /* + * This is the first time this thread has used the FPU or + * the PCB doesn't contain a clean FPU state. Explicitly + * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. + */ + bcopy(fpu_initialstate, pcb->pcb_save, + cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); + if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(pcb->pcb_initial_fpucw); + if (PCB_USER_FPU(pcb)) + set_pcb_flags(pcb, PCB_FPUINITDONE | + PCB_USERFPUINITDONE); + else + set_pcb_flags(pcb, PCB_FPUINITDONE); + } else + fpurestore(pcb->pcb_save); +} + /* * Device Not Available (DNA, #NM) exception handler. * @@ -621,7 +666,9 @@ fputrap_sse(void) void fpudna(void) { + struct thread *td; + td = curthread; /* * This handler is entered with interrupts enabled, so context * switches may occur before critical_enter() is executed. If @@ -633,49 +680,38 @@ fpudna(void) */ critical_enter(); - if (PCPU_GET(fpcurthread) == curthread) { - printf("fpudna: fpcurthread == curthread\n"); + if (__predict_false(PCPU_GET(fpcurthread) == td)) { + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ stop_emulating(); - critical_exit(); - return; + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + panic( + "fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_tid, td, td->td_tid); + } + restore_fpu_curthread(td); } - if (PCPU_GET(fpcurthread) != NULL) { - panic("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, - curthread, curthread->td_tid); - } - stop_emulating(); - /* - * Record new context early in case frstor causes a trap. - */ - PCPU_SET(fpcurthread, curthread); + critical_exit(); +} - fpu_clean_state(); +void fpu_activate_sw(struct thread *td); /* Called from the context switch */ +void +fpu_activate_sw(struct thread *td) +{ - if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { - /* - * This is the first time this thread has used the FPU or - * the PCB doesn't contain a clean FPU state. Explicitly - * load an initial state. - * - * We prefer to restore the state from the actual save - * area in PCB instead of directly loading from - * fpu_initialstate, to ignite the XSAVEOPT - * tracking engine. - */ - bcopy(fpu_initialstate, curpcb->pcb_save, - cpu_max_ext_state_size); - fpurestore(curpcb->pcb_save); - if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(curpcb->pcb_initial_fpucw); - if (PCB_USER_FPU(curpcb)) - set_pcb_flags(curpcb, - PCB_FPUINITDONE | PCB_USERFPUINITDONE); - else - set_pcb_flags(curpcb, PCB_FPUINITDONE); - } else - fpurestore(curpcb->pcb_save); - critical_exit(); + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(td->td_pcb)) { + PCPU_SET(fpcurthread, NULL); + start_emulating(); + } else if (PCPU_GET(fpcurthread) != td) { + restore_fpu_curthread(td); + } } void Modified: stable/10/sys/i386/i386/swtch.s ============================================================================== --- stable/10/sys/i386/i386/swtch.s Wed Jun 20 18:43:17 2018 (r335454) +++ stable/10/sys/i386/i386/swtch.s Wed Jun 20 18:51:38 2018 (r335455) @@ -314,6 +314,12 @@ sw1: cpu_switch_load_gs: mov PCB_GS(%edx),%gs + pushl %edx + pushl PCPU(CURTHREAD) + call npxswitch + popl %edx + popl %edx + /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%edx) jz 1f Modified: stable/10/sys/i386/isa/npx.c ============================================================================== --- stable/10/sys/i386/isa/npx.c Wed Jun 20 18:43:17 2018 (r335454) +++ stable/10/sys/i386/isa/npx.c Wed Jun 20 18:51:38 2018 (r335455) @@ -219,6 +219,11 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + #ifdef CPU_ENABLE_SSE int use_xsave; uint64_t xsave_mask; @@ -360,6 +365,7 @@ npxinit_bsp1(void) u_int cp[4]; uint64_t xsave_mask_user; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (cpu_fxsr && (cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); @@ -840,49 +846,22 @@ npxtrap_sse(void) } #endif -/* - * Implement device not available (DNA) exception - * - * It would be better to switch FP context here (if curthread != fpcurthread) - * and not necessarily for every context switch, but it is too hard to - * access foreign pcb's. - */ - -static int err_count = 0; - -int -npxdna(void) +static void +restore_npx_curthread(struct thread *td, struct pcb *pcb) { - if (!hw_float) - return (0); - critical_enter(); - if (PCPU_GET(fpcurthread) == curthread) { - printf("npxdna: fpcurthread == curthread %d times\n", - ++err_count); - stop_emulating(); - critical_exit(); - return (1); - } - if (PCPU_GET(fpcurthread) != NULL) { - printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), - PCPU_GET(fpcurthread)->td_proc->p_pid, - curthread, curthread->td_proc->p_pid); - panic("npxdna"); - } - stop_emulating(); /* * Record new context early in case frstor causes a trap. */ - PCPU_SET(fpcurthread, curthread); + PCPU_SET(fpcurthread, td); + stop_emulating(); #ifdef CPU_ENABLE_SSE if (cpu_fxsr) fpu_clean_state(); #endif - if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { + if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly @@ -893,18 +872,54 @@ npxdna(void) * npx_initialstate, to ignite the XSAVEOPT * tracking engine. */ - bcopy(npx_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); - fpurstor(curpcb->pcb_save); - if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) - fldcw(curpcb->pcb_initial_npxcw); - curpcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(curpcb)) - curpcb->pcb_flags |= PCB_NPXUSERINITDONE; + bcopy(npx_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurstor(pcb->pcb_save); + if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(pcb->pcb_initial_npxcw); + pcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_NPXUSERINITDONE; } else { - fpurstor(curpcb->pcb_save); + fpurstor(pcb->pcb_save); } - critical_exit(); +} +/* + * Implement device not available (DNA) exception + * + * It would be better to switch FP context here (if curthread != fpcurthread) + * and not necessarily for every context switch, but it is too hard to + * access foreign pcb's. + */ +int +npxdna(void) +{ + struct thread *td; + + if (!hw_float) + return (0); + td = curthread; + critical_enter(); + if (__predict_false(PCPU_GET(fpcurthread) == td)) { + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ + stop_emulating(); + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + printf( + "npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_proc->p_pid, + td, td->td_proc->p_pid); + panic("npxdna"); + } + restore_npx_curthread(td, td->td_pcb); + } + critical_exit(); return (1); } @@ -928,8 +943,20 @@ npxsave(addr) else #endif fpusave(addr); - start_emulating(); - PCPU_SET(fpcurthread, NULL); +} + +void npxswitch(struct thread *td, struct pcb *pcb); +void +npxswitch(struct thread *td, struct pcb *pcb) +{ + + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(pcb)) { + start_emulating(); + PCPU_SET(fpcurthread, NULL); + } else if (PCPU_GET(fpcurthread) != td) { + restore_npx_curthread(td, pcb); + } } /* From owner-svn-src-all@freebsd.org Wed Jun 20 18:58:50 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DE4A100464B; Wed, 20 Jun 2018 18:58:50 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49F316D729; Wed, 20 Jun 2018 18:58:50 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) Received: from [134.153.27.124] (jacob.engr.mun.ca [134.153.27.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: jonathan/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 97E1827C4F; Wed, 20 Jun 2018 18:58:49 +0000 (UTC) (envelope-from jonathan@FreeBSD.org) From: "Jonathan Anderson" To: "Jonathan T. Looney" Cc: hackagadget@gmail.com, "Conrad Meyer" , "Ian Lepore" , "Simon J. Gerraty" , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r335402 - head/sbin/veriexecctl Date: Wed, 20 Jun 2018 16:28:46 -0230 X-Mailer: MailMate (1.11.2r5479) Message-ID: In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 18:58:51 -0000 On 20 Jun 2018, at 15:32, Jonathan T. Looney wrote: > On Wed, Jun 20, 2018 at 9:49 AM Stephen Kiernan > > wrote: >> And I was working on those sets of changes, when work and family >> didn't >> steal away time. I was told that some discussion happened at BSDCan >> this >> year in such that veriexec should go in as-is so it would be there, >> which > is why >> the commit happened (given the review was approved to land back in > January.) > > I will readily admit that I was probably the source of this. My > reasoning > was fairly simple: when a review has been open for over a year with no > action, it seems like the submitter should be able to commit it > without > waiting for more review, if they are confident in their change. I > stand by > that (and, in fact, would substitute something shorter for "over a > year"). > > ([...] I wasn't intending to push Steve to commit > this before he was ready.) I suspect I was part of that push, and while it's provoked some discussion I still think it was the right course of action. Simon and I chatted about these changes at BSDCan (starting with my apologies for not doing the asked-for review two years ago!) and I suggested that, since the changes had been accepted in Phabricator in January and nobody had raised any objections since then (see: D85{61,62,75}), it would probably be better to commit and iterate than to continue waiting for an unspecified number of additional reviews that might never come. Now that the code has landed it's sparked some lively discussion about potential improvements, but that's a much better situation than the silence Steve heard for a long time in Phabricator. So: is there a strong reason why a backout-and-re-commit approach is superior to iterating on the code in-tree? SHA-1 doesn't give me the warm fuzzies either, but I don't see why the whole framework has to be backed out rather than just receive incremental improvements, e.g., disabling or removing SHA-1 while keeping it easy for downstream consumers to re-enable/re-add whatever algorithms their customers want. Jon -- jonathan@FreeBSD.org From owner-svn-src-all@freebsd.org Wed Jun 20 19:16:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B6F310053D5; Wed, 20 Jun 2018 19:16:52 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3AD96E3D8; Wed, 20 Jun 2018 19:16:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9253B2674D; Wed, 20 Jun 2018 19:16:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KJGpoN048233; Wed, 20 Jun 2018 19:16:51 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KJGpFg048232; Wed, 20 Jun 2018 19:16:51 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806201916.w5KJGpFg048232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 20 Jun 2018 19:16:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335456 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335456 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:16:52 -0000 Author: trasz Date: Wed Jun 20 19:16:51 2018 New Revision: 335456 URL: https://svnweb.freebsd.org/changeset/base/335456 Log: Improve wording. MFC after: 2 weeks Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Wed Jun 20 18:51:38 2018 (r335455) +++ head/share/man/man7/development.7 Wed Jun 20 19:16:51 2018 (r335456) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 11, 2018 +.Dd June 20, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -81,7 +81,7 @@ Build instructions can be found in .Xr build 7 and .Xr release 7 . -Kernel APIs are usually documented, use +Kernel APIs are documented in section 9 manual pages; use .Ql "apropos -s 9 ''" for a list. Regression test suite is described in From owner-svn-src-all@freebsd.org Wed Jun 20 19:22:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A553510058F6; Wed, 20 Jun 2018 19:22:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 55B326E9A2; Wed, 20 Jun 2018 19:22:34 +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 36D35268F5; Wed, 20 Jun 2018 19:22:34 +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 w5KJMX3m053398; Wed, 20 Jun 2018 19:22:33 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KJMXdC053397; Wed, 20 Jun 2018 19:22:33 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201806201922.w5KJMXdC053397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 20 Jun 2018 19:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335457 - head X-SVN-Group: head X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335457 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:22:34 -0000 Author: jhb Date: Wed Jun 20 19:22:33 2018 New Revision: 335457 URL: https://svnweb.freebsd.org/changeset/base/335457 Log: Correct path to removed asf(8) binary. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Wed Jun 20 19:16:51 2018 (r335456) +++ head/ObsoleteFiles.inc Wed Jun 20 19:22:33 2018 (r335457) @@ -39,7 +39,7 @@ # done # 20180615: asf(8) removed -OLD_FILES+=usr/bin/asf +OLD_FILES+=usr/sbin/asf OLD_FILES+=usr/share/man/man8/asf.8.gz # 20180609: obsolete libc++ files missed from the 5.0.0 import OLD_FILES+=usr/include/c++/v1/__refstring From owner-svn-src-all@freebsd.org Wed Jun 20 19:23:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DA7D1005AA7; Wed, 20 Jun 2018 19:23:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9F2A66EB54; Wed, 20 Jun 2018 19:23:56 +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 80026268FE; Wed, 20 Jun 2018 19:23:56 +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 w5KJNu0D053507; Wed, 20 Jun 2018 19:23:56 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KJNuvO053506; Wed, 20 Jun 2018 19:23:56 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806201923.w5KJNuvO053506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 20 Jun 2018 19:23:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335458 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335458 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:23:57 -0000 Author: kevans Date: Wed Jun 20 19:23:56 2018 New Revision: 335458 URL: https://svnweb.freebsd.org/changeset/base/335458 Log: Add debug.verbose_sysinit tunable for VERBOSE_SYSINIT VERBOSE_SYSINIT is currently an all-or-nothing option. debug.verbose_sysinit adds an option to have the code compiled in but quiet by default so that getting this information from a device in the field doesn't necessarily require distributing a recompiled kernel. Its default is VERBOSE_SYSINIT's value as defined in the kernconf. As such, the default behavior for simply omitting or including this option is unchanged. MFC after: 1 week Modified: head/sys/kern/init_main.c Modified: head/sys/kern/init_main.c ============================================================================== --- head/sys/kern/init_main.c Wed Jun 20 19:22:33 2018 (r335457) +++ head/sys/kern/init_main.c Wed Jun 20 19:23:56 2018 (r335458) @@ -119,6 +119,18 @@ int bootverbose = BOOTVERBOSE; SYSCTL_INT(_debug, OID_AUTO, bootverbose, CTLFLAG_RW, &bootverbose, 0, "Control the output of verbose kernel messages"); +#ifdef VERBOSE_SYSINIT +/* + * We'll use the defined value of VERBOSE_SYSINIT from the kernel config to + * dictate the default VERBOSE_SYSINIT behavior. Significant values for this + * option and associated tunable are: + * - 0, 'compiled in but silent by default' + * - 1, 'compiled in but verbose by default' (default) + */ +int verbose_sysinit = VERBOSE_SYSINIT; +TUNABLE_INT("debug.verbose_sysinit", &verbose_sysinit); +#endif + #ifdef INVARIANTS FEATURE(invariants, "Kernel compiled with INVARIANTS, may affect performance"); #endif @@ -268,7 +280,7 @@ restart: continue; #if defined(VERBOSE_SYSINIT) - if ((*sipp)->subsystem > last) { + if ((*sipp)->subsystem > last && verbose_sysinit != 0) { verbose = 1; last = (*sipp)->subsystem; printf("subsystem %x\n", last); From owner-svn-src-all@freebsd.org Wed Jun 20 19:40:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CADC10070A8; Wed, 20 Jun 2018 19:40:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31D00714AB; Wed, 20 Jun 2018 19:40:55 +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 10B5926AD3; Wed, 20 Jun 2018 19:40:55 +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 w5KJesI7065125; Wed, 20 Jun 2018 19:40:54 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KJesPP065124; Wed, 20 Jun 2018 19:40:54 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806201940.w5KJesPP065124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 20 Jun 2018 19:40:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335459 - head/usr.sbin/acpi/acpidump X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/usr.sbin/acpi/acpidump X-SVN-Commit-Revision: 335459 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:40:55 -0000 Author: emaste Date: Wed Jun 20 19:40:54 2018 New Revision: 335459 URL: https://svnweb.freebsd.org/changeset/base/335459 Log: acpidump.8: include NFIT in the man page list of tables Was missed in r321298. Reported by: Ben Widawsky (in review D15931) MFC after: 1 week Modified: head/usr.sbin/acpi/acpidump/acpidump.8 Modified: head/usr.sbin/acpi/acpidump/acpidump.8 ============================================================================== --- head/usr.sbin/acpi/acpidump/acpidump.8 Wed Jun 20 19:23:56 2018 (r335458) +++ head/usr.sbin/acpi/acpidump/acpidump.8 Wed Jun 20 19:40:54 2018 (r335459) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 14, 2005 +.Dd June 20, 2018 .Dt ACPIDUMP 8 .Os .Sh NAME @@ -105,6 +105,7 @@ utility dumps contents of the following tables: .It HPET .It MADT .It MCFG +.It NFIT .It RSD PTR .It RSDT .It WDDT From owner-svn-src-all@freebsd.org Wed Jun 20 19:45:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 611591007363; Wed, 20 Jun 2018 19:45:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1250671942; Wed, 20 Jun 2018 19:45:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E438526C4F; Wed, 20 Jun 2018 19:45:04 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5KJj4XJ067776; Wed, 20 Jun 2018 19:45:04 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KJj4KF067775; Wed, 20 Jun 2018 19:45:04 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806201945.w5KJj4KF067775@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 20 Jun 2018 19:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335460 - head X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335460 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:45:05 -0000 Author: bdrewery Date: Wed Jun 20 19:45:04 2018 New Revision: 335460 URL: https://svnweb.freebsd.org/changeset/base/335460 Log: Only look for NOTES as needed. Sponsored by: Dell EMC Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Wed Jun 20 19:40:54 2018 (r335459) +++ head/Makefile Wed Jun 20 19:45:04 2018 (r335460) @@ -573,13 +573,13 @@ universe_${target}_${target_arch}: universe_${target}_ universe_${target}_done: universe_${target}_kernels .PHONY universe_${target}_kernels: universe_${target}_worlds .PHONY universe_${target}_kernels: universe_${target}_prologue .MAKE .PHONY -.if exists(${KERNSRCDIR}/${target}/conf/NOTES) - @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ + @if [ -e "${KERNSRCDIR}/${target}/conf/NOTES" ]; then \ + (cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ ${SUB_MAKE} LINT \ > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ - "check _.${target}.makeLINT for details"| ${MAKEFAIL})) -.endif + "check _.${target}.makeLINT for details"| ${MAKEFAIL})); \ + fi @cd ${.CURDIR}; ${SUB_MAKE} ${.MAKEFLAGS} TARGET=${target} \ universe_kernels .endif # !MAKE_JUST_WORLDS From owner-svn-src-all@freebsd.org Wed Jun 20 19:54:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9384E1007B30; Wed, 20 Jun 2018 19:54:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D919C71FBE; Wed, 20 Jun 2018 19:54:17 +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 ESMTP id w5KJs79h070824; Wed, 20 Jun 2018 22:54:10 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua w5KJs79h070824 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id w5KJs7ob070823; Wed, 20 Jun 2018 22:54:07 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 20 Jun 2018 22:54:07 +0300 From: Konstantin Belousov To: Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335456 - head/share/man/man7 Message-ID: <20180620195407.GS2430@kib.kiev.ua> References: <201806201916.w5KJGpFg048232@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806201916.w5KJGpFg048232@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 19:54:18 -0000 On Wed, Jun 20, 2018 at 07:16:51PM +0000, Edward Tomasz Napierala wrote: > Author: trasz > Date: Wed Jun 20 19:16:51 2018 > New Revision: 335456 > URL: https://svnweb.freebsd.org/changeset/base/335456 > > Log: > Improve wording. > > MFC after: 2 weeks > > Modified: > head/share/man/man7/development.7 > > Modified: head/share/man/man7/development.7 > ============================================================================== > --- head/share/man/man7/development.7 Wed Jun 20 18:51:38 2018 (r335455) > +++ head/share/man/man7/development.7 Wed Jun 20 19:16:51 2018 (r335456) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd May 11, 2018 > +.Dd June 20, 2018 > .Dt DEVELOPMENT 7 > .Os > .Sh NAME > @@ -81,7 +81,7 @@ Build instructions can be found in > .Xr build 7 > and > .Xr release 7 . > -Kernel APIs are usually documented, use > +Kernel APIs are documented in section 9 manual pages; use Kernel API is an oxymoron. Section 9 describes Kernel Programming Interfaces, the A from Application is not needed. We usually abbreviate it as KPI. Kernel API are syscalls, if anything. > .Ql "apropos -s 9 ''" > for a list. > Regression test suite is described in From owner-svn-src-all@freebsd.org Wed Jun 20 20:04:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E93E9100922E; Wed, 20 Jun 2018 20:04:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ED47724F5; Wed, 20 Jun 2018 20:04:21 +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 6DCB026F9E; Wed, 20 Jun 2018 20:04:21 +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 w5KK4LQb077784; Wed, 20 Jun 2018 20:04:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KK4KN2077781; Wed, 20 Jun 2018 20:04:20 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201806202004.w5KK4KN2077781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 20 Jun 2018 20:04:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335461 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 335461 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 20:04:22 -0000 Author: hselasky Date: Wed Jun 20 20:04:20 2018 New Revision: 335461 URL: https://svnweb.freebsd.org/changeset/base/335461 Log: Permit the kernel environment to set an array of numeric values for a single sysctl(9) node. Reviewed by: kib@, imp@, jhb@ Differential Revision: https://reviews.freebsd.org/D15802 MFC after: 1 week Sponsored by: Mellanox Technologies Modified: head/sys/kern/kern_environment.c head/sys/kern/kern_sysctl.c head/sys/sys/systm.h Modified: head/sys/kern/kern_environment.c ============================================================================== --- head/sys/kern/kern_environment.c Wed Jun 20 19:45:04 2018 (r335460) +++ head/sys/kern/kern_environment.c Wed Jun 20 20:04:20 2018 (r335461) @@ -53,6 +53,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -514,6 +515,141 @@ getenv_string(const char *name, char *data, int size) strlcpy(data, cp, size); } return (cp != NULL); +} + +/* + * Return an array of integers at the given type size and signedness. + */ +int +getenv_array(const char *name, void *pdata, int size, int *psize, + int type_size, bool allow_signed) +{ + char buf[KENV_MNAMELEN + 1 + KENV_MVALLEN + 1]; + uint8_t shift; + int64_t value; + int64_t old; + char *end; + char *ptr; + int n; + + if (getenv_string(name, buf, sizeof(buf)) == 0) + return (0); + + /* get maximum number of elements */ + size /= type_size; + + n = 0; + + for (ptr = buf; *ptr != 0; ) { + + value = strtoq(ptr, &end, 0); + + /* check if signed numbers are allowed */ + if (value < 0 && !allow_signed) + goto error; + + /* check for invalid value */ + if (ptr == end) + goto error; + + /* check for valid suffix */ + switch (*end) { + case 't': + case 'T': + shift = 40; + end++; + break; + case 'g': + case 'G': + shift = 30; + end++; + break; + case 'm': + case 'M': + shift = 20; + end++; + break; + case 'k': + case 'K': + shift = 10; + end++; + break; + case ' ': + case '\t': + case ',': + case 0: + shift = 0; + break; + default: + /* garbage after numeric value */ + goto error; + } + + /* skip till next value, if any */ + while (*end == '\t' || *end == ',' || *end == ' ') + end++; + + /* update pointer */ + ptr = end; + + /* apply shift */ + old = value; + value <<= shift; + + /* overflow check */ + if ((value >> shift) != old) + goto error; + + /* check for buffer overflow */ + if (n >= size) + goto error; + + /* store value according to type size */ + switch (type_size) { + case 1: + if (allow_signed) { + if (value < SCHAR_MIN || value > SCHAR_MAX) + goto error; + } else { + if (value < 0 || value > UCHAR_MAX) + goto error; + } + ((uint8_t *)pdata)[n] = (uint8_t)value; + break; + case 2: + if (allow_signed) { + if (value < SHRT_MIN || value > SHRT_MAX) + goto error; + } else { + if (value < 0 || value > USHRT_MAX) + goto error; + } + ((uint16_t *)pdata)[n] = (uint16_t)value; + break; + case 4: + if (allow_signed) { + if (value < INT_MIN || value > INT_MAX) + goto error; + } else { + if (value > UINT_MAX) + goto error; + } + ((uint32_t *)pdata)[n] = (uint32_t)value; + break; + case 8: + ((uint64_t *)pdata)[n] = (uint64_t)value; + break; + default: + goto error; + } + n++; + } + *psize = n * type_size; + + if (n != 0) + return (1); /* success */ +error: + return (0); /* failure */ } /* Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Jun 20 19:45:04 2018 (r335460) +++ head/sys/kern/kern_sysctl.c Wed Jun 20 20:04:20 2018 (r335461) @@ -192,13 +192,8 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o char path[96]; ssize_t rem = sizeof(path); ssize_t len; - uint8_t val_8; - uint16_t val_16; - uint32_t val_32; - int val_int; - long val_long; - int64_t val_64; - quad_t val_quad; + uint8_t data[512] __aligned(sizeof(uint64_t)); + int size; int error; path[--rem] = 0; @@ -226,85 +221,88 @@ sysctl_load_tunable_by_oid_locked(struct sysctl_oid *o switch (oidp->oid_kind & CTLTYPE) { case CTLTYPE_INT: - if (getenv_int(path + rem, &val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int), GETENV_SIGNED) == 0) return; - req.newlen = sizeof(val_int); - req.newptr = &val_int; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_UINT: - if (getenv_uint(path + rem, (unsigned int *)&val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int), GETENV_UNSIGNED) == 0) return; - req.newlen = sizeof(val_int); - req.newptr = &val_int; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_LONG: - if (getenv_long(path + rem, &val_long) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(long), GETENV_SIGNED) == 0) return; - req.newlen = sizeof(val_long); - req.newptr = &val_long; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_ULONG: - if (getenv_ulong(path + rem, (unsigned long *)&val_long) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(long), GETENV_UNSIGNED) == 0) return; - req.newlen = sizeof(val_long); - req.newptr = &val_long; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_S8: - if (getenv_int(path + rem, &val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int8_t), GETENV_SIGNED) == 0) return; - val_8 = val_int; - req.newlen = sizeof(val_8); - req.newptr = &val_8; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_S16: - if (getenv_int(path + rem, &val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int16_t), GETENV_SIGNED) == 0) return; - val_16 = val_int; - req.newlen = sizeof(val_16); - req.newptr = &val_16; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_S32: - if (getenv_long(path + rem, &val_long) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int32_t), GETENV_SIGNED) == 0) return; - val_32 = val_long; - req.newlen = sizeof(val_32); - req.newptr = &val_32; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_S64: - if (getenv_quad(path + rem, &val_quad) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(int64_t), GETENV_SIGNED) == 0) return; - val_64 = val_quad; - req.newlen = sizeof(val_64); - req.newptr = &val_64; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_U8: - if (getenv_uint(path + rem, (unsigned int *)&val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(uint8_t), GETENV_UNSIGNED) == 0) return; - val_8 = val_int; - req.newlen = sizeof(val_8); - req.newptr = &val_8; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_U16: - if (getenv_uint(path + rem, (unsigned int *)&val_int) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(uint16_t), GETENV_UNSIGNED) == 0) return; - val_16 = val_int; - req.newlen = sizeof(val_16); - req.newptr = &val_16; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_U32: - if (getenv_ulong(path + rem, (unsigned long *)&val_long) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(uint32_t), GETENV_UNSIGNED) == 0) return; - val_32 = val_long; - req.newlen = sizeof(val_32); - req.newptr = &val_32; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_U64: - /* XXX there is no getenv_uquad() */ - if (getenv_quad(path + rem, &val_quad) == 0) + if (getenv_array(path + rem, data, sizeof(data), &size, + sizeof(uint64_t), GETENV_UNSIGNED) == 0) return; - val_64 = val_quad; - req.newlen = sizeof(val_64); - req.newptr = &val_64; + req.newlen = size; + req.newptr = data; break; case CTLTYPE_STRING: penv = kern_getenv(path + rem); Modified: head/sys/sys/systm.h ============================================================================== --- head/sys/sys/systm.h Wed Jun 20 19:45:04 2018 (r335460) +++ head/sys/sys/systm.h Wed Jun 20 20:04:20 2018 (r335461) @@ -353,6 +353,11 @@ int kern_setenv(const char *name, const char *value); int kern_unsetenv(const char *name); int testenv(const char *name); +int getenv_array(const char *name, void *data, int size, int *psize, + int type_size, bool allow_signed); +#define GETENV_UNSIGNED false /* negative numbers not allowed */ +#define GETENV_SIGNED true /* negative numbers allowed */ + typedef uint64_t (cpu_tick_f)(void); void set_cputicker(cpu_tick_f *func, uint64_t freq, unsigned var); extern cpu_tick_f *cpu_ticks; From owner-svn-src-all@freebsd.org Wed Jun 20 20:07:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE5AF10095CA; Wed, 20 Jun 2018 20:07:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f53.google.com (mail-it0-f53.google.com [209.85.214.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 81C6672814; Wed, 20 Jun 2018 20:07:35 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f53.google.com with SMTP id l6-v6so1460136iti.2; Wed, 20 Jun 2018 13:07:35 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=3nhREAJuObgi78gtOmN7HUr+KbLA39/fuB25kdoYtKw=; b=tFw15PWgpjBH02AZN6nwg5ZI9bB1NoGrIbpluPpi49tW337vhJ+MFQcrlUh00sLsyo M43dprErMhL/DSuxgLJDzjZa/hfno3t4zcdsXDQWfaJpMShf+mqQvMM6haSjzWHlpMdg O8AJE+Z+1tidEpGwKSHD4eiYwigIeJMUenK5BRbIvf9ArOEwIszQGk6fWrLTVO1tQh1w YOrpehwHDZr1qMAcb6SFs0WWf5Uos7BNbRGkgMFcVh/UCvAyM4d8kiAjhBIdVxSeD221 fp2GtXyWpTqB9Rvm3wNfMJR9VpFiMfJpLWY6iBHSasjhaxyZ899wB6HZJpFm+AVUg4dT LSUg== X-Gm-Message-State: APt69E3v3tVmxIFzc/nb2lqEjVpEDnzsKpVie+JCUBx3fE/3xhtS2O+g c5TWnS37JApSXwalUxcQSgOlNaJS X-Google-Smtp-Source: ADUXVKLDh3ieF8MYRp53RWAFKrJBIoaajZ6lh6w0nur7MC26JFbcfsZmoyKNEE3Pjxhp+K4ri8zoAQ== X-Received: by 2002:a02:62ce:: with SMTP id d197-v6mr18485361jac.36.1529525249503; Wed, 20 Jun 2018 13:07:29 -0700 (PDT) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id h81-v6sm197598ith.2.2018.06.20.13.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Jun 2018 13:07:29 -0700 (PDT) Received: by mail-io0-f177.google.com with SMTP id f1-v6so887439ioh.6; Wed, 20 Jun 2018 13:07:29 -0700 (PDT) X-Received: by 2002:a6b:da0e:: with SMTP id x14-v6mr18078270iob.19.1529525249058; Wed, 20 Jun 2018 13:07:29 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 13:07:28 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> From: Conrad Meyer Date: Wed, 20 Jun 2018 13:07:28 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Jonathan Anderson Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 20:07:36 -0000 Hi Jon, On Wed, Jun 20, 2018 at 11:58 AM, Jonathan Anderson wrote: > On 20 Jun 2018, at 15:32, Jonathan T. Looney wrote: >> My reasoning >> was fairly simple: when a review has been open for over a year with no >> action, it seems like the submitter should be able to commit it without >> waiting for more review, if they are confident in their change. I stand by >> that (and, in fact, would substitute something shorter for "over a year"). For this as a question of general process, I think "it depends." For minor fixes? Of course! Less than one year. For minor improvements or enhancements? Also yes, also probably less than 1yr. For large features like this, I think the answer is more nuanced. Sometimes being in a review for a year means the reviewers are overloaded and don't have time. In that case, maybe they shouldn't block progress. Sometimes being in review for a year just means the right reviewers haven't been found. I think that was more the case here. I would suggest anyone submitting a large feature and not getting feedback in a reasonable timeframe to solicit feedback from a wider audience much sooner than one year, and also indicate intention to merge the unreviewed change with some time window (1-2 weeks?) on giving feedback or at least asking for more time to review. > So: is there a strong reason why a backout-and-re-commit approach is > superior to iterating on the code in-tree? Yeah: > Any disputed change must be backed out pending resolution of the dispute > if requested by a maintainer. Security related changes may override a > maintainer's wishes at the Security Officer's discretion. > > This may be hard to swallow in times of conflict (when each side is > convinced that they are in the right, of course) but a version control > system makes it unnecessary to have an ongoing dispute raging when it is > far easier to simply reverse the disputed change, get everyone calmed > down again and then try to figure out what is the best way to proceed. > If the change turns out to be the best thing after all, it can be easily > brought back. If it turns out not to be, then the users did not have to > live with the bogus change in the tree while everyone was busily > debating its merits. People very rarely call for back-outs in the > repository since discussion generally exposes bad or controversial > changes before the commit even happens, but on such rare occasions the > back-out should be done without argument so that we can get immediately > on to the topic of figuring out whether it was bogus or not. In particular, SHA1 was never the primary reason the backout was requested, just one design smell in the aggregate. This change introduces a security feature that doesn't provide the security guarantees it claims to. That should be a major red flag. All the best, Conrad From owner-svn-src-all@freebsd.org Wed Jun 20 20:09:02 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC121009881 for ; Wed, 20 Jun 2018 20:09:02 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 0B8DF72AEC for ; Wed, 20 Jun 2018 20:09:00 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: c0f4eda5-74c5-11e8-afd2-4ddcc8249dd4 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id c0f4eda5-74c5-11e8-afd2-4ddcc8249dd4; Wed, 20 Jun 2018 20:08:54 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5KK8qXD082729; Wed, 20 Jun 2018 14:08:52 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529525332.24573.13.camel@freebsd.org> Subject: Re: svn commit: r335456 - head/share/man/man7 From: Ian Lepore To: Konstantin Belousov , Edward Tomasz Napierala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Wed, 20 Jun 2018 14:08:52 -0600 In-Reply-To: <20180620195407.GS2430@kib.kiev.ua> References: <201806201916.w5KJGpFg048232@repo.freebsd.org> <20180620195407.GS2430@kib.kiev.ua> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 20:09:02 -0000 On Wed, 2018-06-20 at 22:54 +0300, Konstantin Belousov wrote: > On Wed, Jun 20, 2018 at 07:16:51PM +0000, Edward Tomasz Napierala wrote: > > > > Author: trasz > > Date: Wed Jun 20 19:16:51 2018 > > New Revision: 335456 > > URL: https://svnweb.freebsd.org/changeset/base/335456 > > > > Log: > >   Improve wording. > >    > >   MFC after: 2 weeks > > > > Modified: > >   head/share/man/man7/development.7 > > > > Modified: head/share/man/man7/development.7 > > ============================================================================== > > --- head/share/man/man7/development.7 Wed Jun 20 18:51:38 2018 (r335455) > > +++ head/share/man/man7/development.7 Wed Jun 20 19:16:51 2018 (r335456) > > @@ -24,7 +24,7 @@ > >  .\" > >  .\" $FreeBSD$ > >  .\" > > -.Dd May 11, 2018 > > +.Dd June 20, 2018 > >  .Dt DEVELOPMENT 7 > >  .Os > >  .Sh NAME > > @@ -81,7 +81,7 @@ Build instructions can be found in > >  .Xr build 7 > >  and > >  .Xr release 7 . > > -Kernel APIs are usually documented, use > > +Kernel APIs are documented in section 9 manual pages; use > Kernel API is an oxymoron.  Section 9 describes Kernel Programming > Interfaces, the A from Application is not needed.  We usually abbreviate > it as KPI. This is the manpage a new developer is going to look at, and if you throw an abbreviation like KPI at them and they search for what it means, they're going to find "Key Performance Indicator" and nothing about kernels. This might be a good place to introduce and define that acronym, maybe something like "Kernel programming interfaces (KPIs) are documented...". -- Ian From owner-svn-src-all@freebsd.org Wed Jun 20 20:20:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAAF9100A128; Wed, 20 Jun 2018 20:20:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 33AB3731D3; Wed, 20 Jun 2018 20:20:32 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108157.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KKJ0QG025994; Wed, 20 Jun 2018 13:20:31 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=lp9eVcGxGD499uqGbFisu7hF3N2KYFLF8JSgUvd7B1c=; b=mKTfqEi7XpBN8qWHM3KM0RCg3uE9p8whfFxaKJTOlNWPT4Nd+fy/0DqP4crJwymY2Gbb x+uixatZ4+JVawdRxaKpj4ktCid9qhnFJB4BViLBKXQZ0zM9NUNfANKieanpDiYxhLj2 M8iRrfDUHmAlYjfTaUbnajdbnvvZnzIDZdTAg6t5zGkNW6Ny00SDkJFwtFeK+GTXAiBj mzRaFY1MMXWoqyqSnzpf9bm5WKZem/VA/5prTrBl/VCzTM9a9QtPkGTF0Im4aw8iegy7 suzRmyTeal+BggFsTeVKCknUgI6dnuNuKLR3PftoUrdIDLDNuBsMeh8iaW7QwpIgPG3+ 4Q== Received: from nam05-by2-obe.outbound.protection.outlook.com (mail-by2nam05lp0244.outbound.protection.outlook.com [216.32.181.244]) by mx0a-00273201.pphosted.com with ESMTP id 2jqwfwg13n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Jun 2018 13:20:31 -0700 Received: from SN4PR0501CA0103.namprd05.prod.outlook.com (2603:10b6:803:42::20) by BN6PR05MB3106.namprd05.prod.outlook.com (2603:10b6:404:bb::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.12; Wed, 20 Jun 2018 20:20:30 +0000 Received: from CO1NAM05FT010.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e50::204) by SN4PR0501CA0103.outlook.office365.com (2603:10b6:803:42::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.906.10 via Frontend Transport; Wed, 20 Jun 2018 20:20:29 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by CO1NAM05FT010.mail.protection.outlook.com (10.152.96.117) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.884.14 via Frontend Transport; Wed, 20 Jun 2018 20:20:28 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Jun 2018 13:19:49 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5KKJnNh025800; Wed, 20 Jun 2018 13:19:49 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id A06E264605; Wed, 20 Jun 2018 13:19:39 -0700 (PDT) To: Xin LI CC: "Jonathan T. Looney" , Conrad Meyer , , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> Comments: In-reply-to: Xin LI message dated "Wed, 20 Jun 2018 11:09:10 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <8056.1529525979.1@kaos.jnpr.net> Date: Wed, 20 Jun 2018 13:19:39 -0700 Message-ID: <11191.1529525979@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(396003)(346002)(376002)(39380400002)(39860400002)(2980300002)(189003)(199004)(476003)(4326008)(106466001)(126002)(23726003)(6246003)(6266002)(486006)(97876018)(186003)(356003)(105596002)(7126003)(446003)(97756001)(39060400002)(53416004)(11346002)(2810700001)(117636001)(2906002)(76506005)(107886003)(316002)(9686003)(16586007)(93886005)(47776003)(336012)(46406003)(68736007)(59450400001)(97736004)(305945005)(7696005)(54906003)(50466002)(478600001)(229853002)(86362001)(5660300001)(69596002)(6916009)(26005)(81166006)(81156014)(8936002)(77096007)(50226002)(53936002)(55016002)(1411001)(8676002)(76176011)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR05MB3106; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM05FT010; 1:5a+VgD0ZdiqbAdZ+2c03v9HahuZdKaH2o4t0AwqbD0aTs/QXe4fFm4O3wNutoEcVVrUw07cvs1HTGnn+GFF0ir30xQ9Z92GT8epfYFchEX2Xcxp1+f+9fUJzlJUxEVXI X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ce44f19b-a96a-4c7a-b10a-08d5d6eb4423 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:BN6PR05MB3106; X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 3:q3cWkRgF8pwhqU6KIxEwUTiOZr61Prp/4eI8gsNK6aku0VV3LdHaEp2P6q1yETTnYzO1+xxBPTmEZoe5Vv5iO2SLnDRFRdIn1D7UHr9r5BO392ElJ/PxFoUIJfL3GgULPYvpXeYACoALC+uzsI0k2jkjyVKUSqdZJVndtil385F59sMg2twKOJcYoB+AujpWbULk10BytS3sJ7ymCnsijZ3+0HxeejvYY+Li5P2GmFf1pnUDM4qtsC8+9Fwk6qiuQPM5zHIFj9XzFu6vb0dRTzzut9ERGcyfB/sT3GuHLa+2drdUwjTNLsNoDHwwO4JE2YoeQIgHaII8oxxSFxTV7i0C+1D01kgFm5NEg6BHKkM=; 25:jyPUddHLQNLbHGYB7AJbyhgnMC2T8h7sLNUHxd51dt5U7dQto6IW2MODgmrSHrBzdkfn9Af3bq9E/RwxKcsPAHn/+LWEzDRL9nBooYNQCEFH2PZkpOIMRd1oMjpIjoG4ieR19o2EQyemCGI+R/oRnk/Q6reFWiWj1juO4EmrstvvIzoh1Q8mYWPQJJlsdDTutFtZ8APtP57rU5AdxfBwjsNTYcCTnwikhTIWnbqZZ1WBPws34BABj2vZVJYTgPASmC4DKJOgQyY1NxPM3OMFtAGf+Dshp5P+TJzZT/zQK9NDoGV2gvthwIJnxsEylegQ8A7TwU5jVqHcTf3a7wCXDg== X-MS-TrafficTypeDiagnostic: BN6PR05MB3106: X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 31:w16xldIBW/HUvF4RcJdLrkZLlBfiYD2SlNIUAlDn62E5q3R+4/nFNWIGEcjBSq8/Z/95yvXhjRxZG1igdUGliIVd7USs8pr0M7/7QuuK3cc3UjbvS7+Cd2JAIue8WwTWgtaAwH3frj5HEGvZtT6tYNcI3gR7qEQ5PnrednCT+TzjHcunHyohkjUuVWvbHnfxlQe5ivdUCt2ovzqoWvi/ad2mcX5ZzJ73c02gZV8xrOM=; 20:dPlgL6pfu+51VJPXPGphPtnBkvKiFLqLpIA6yPSZiUmm6bleS71qp1WS3+GjII5oS/lKTNZGrrG8fmIijDbg1kn7hyukHo1VrFsecG45ZrznBlb/xqgi5JIwyrixrS/buEubQ6hbzxg/mpf6JcpSb3Vn/QfmYqrwyKpglvE5NKLKqUIdS6wwZsjSDlCja48IJ7sT8lL1YUQAtDC0DZM75BYUksVJhkM2AnDJKkN9yxR6IHdATbsDeXmRDqJK4swpm8xCw1LcDWapDkrREWTfhlx+e3Dt+BtxrdAGLJr3IQvHdCTglGT5dhqzhmbMujNB5BzzijJfGN8KTz/sqPdeueVezPFIfDda9iUptFyT/Nlrz6GPD21+9V5M5Ue21kHb18rKWs5+/NnSMRhdHtLo6fTkS+DBRYV9FjL47yi1+Or9RcMDU5pmBfxKz6Vn5AvhcNBypnFaoc7jbdf7+CTHPk6dw748yV+iRLxx6Su+cWwTl/zIOjwfo7cl6tn2W7+o X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(85827821059158); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231254)(944501410)(52105095)(93006095)(93001095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:BN6PR05MB3106; BCL:0; PCL:0; RULEID:; SRVR:BN6PR05MB3106; X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 4:wy0SXmQc9JMRSNuIxJ7r7AHYEBCbpAJvC06XNCMNC8gsGBEztAU8GiH8I/L6Wf02qrnMXQJIlgn0JUNbuDSB8AAiNMMxU6V5qDmNL8crim9Vy4XtIzr+Guzn2i+eUmgCy2/Cn7MR8vnNsuelyY3YaS5Hs3jeiNherAkv3L2kd3ePpwKgsK8H8YjFwjgRgTX4jaRVA2XDBTU9T70ud7dBTzjd+iUJFy/UIyn8x4TKmwyHUZJhTa3oXfXTpjXISosATfOnA7kelXXdotTyYykNuPwS8+lKsWrNivWTHhuqeRg0a/YqY+CaiC9S+z7V9VqA X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR05MB3106; 23:KNlIeCtsyu6wuMCGtoHrRsHbbNaJa4zNbx2hDSN2Z?= =?us-ascii?Q?oOrW5Slk7fUupKb37uotIPEPbWNSKnamvT/GiOAsh6Wj7+cx5Wp/xzZBgyfQ?= =?us-ascii?Q?wE6mXh0AG4rk8OEv/zSBJh+8iMd6mWvfv9StGkQ0JzbePM41MstXMnyKjHk1?= =?us-ascii?Q?3vUK4uTjp0VlDYqx42Kvv7WVhEaTrs6UKtVcnfPOFfZ0SZJJj143SGod73o2?= =?us-ascii?Q?6i3+xygere4lqSwOpeeH60b0JWXBE0qf2qGXdtv0vYf56yKqqC8NGi5+A6QZ?= =?us-ascii?Q?3Wk4OzAl9SJ8MjWuUH9Gn67Ag4KnlPNodzhnlezUhZT6j6lBlBdJEJyUk7rj?= =?us-ascii?Q?j3NGAR8CnMQaxCOz2XWR6fgBNO5HDPr5cxhr8YQR40jrx0GvqqUMVFhbolDP?= =?us-ascii?Q?IU+7tYckFYSwLJNI02r2pZBNQUkJdbjsZmCo0330jYDRZGbrOsiWKREoz9OM?= =?us-ascii?Q?7PyR9YjOi8CHTyGRsGnLWp3jLTcefKcQGd94bgJzJrkeLx5176Htl/l/TXDy?= =?us-ascii?Q?Ugg6BmuzOd5WO4+drFu6XDMW81vPKbHo+MWoIr0Np8RzwF7oE8RRNKnpIXrP?= =?us-ascii?Q?dwrrzcaj7T83bZKyEotMb1z0SyyMOrn5lP/lT6uOV8OqKynwm7ngx3+jF9xa?= =?us-ascii?Q?yIpbTzDLb3RVMwRtRcqDDOa+Vvudd/PgPN/P3zA48ZiYW6XR0EWNKmfQ9+Zb?= =?us-ascii?Q?2+UQxypI5BK83/fhxu0Dbkg7HBLaVxSN7XFdG5PEendS9pJcZrutt6nD2Snf?= =?us-ascii?Q?2d6ptQRDAO0D3Sf9jzqYVEN7iJvh5l1y5/HKqbK1RwMiKkjmmrezwZ62BC3W?= =?us-ascii?Q?74D6shbyJk20QJgaIyxfhfmqdY5A3acClkQ3C0EeP1m5RzbzTxmCo/Qy2ZyN?= =?us-ascii?Q?vWbsbVaD+/6viCxaMmSRaMMw2Dra5k2dDvFCyH2nJaBoekGtLa+2Fpzpi4j6?= =?us-ascii?Q?2cDwsCbwbMQ6x7ymBeYU62au3RHIqRcUGPWswECOcwFUSwBr6E/CyTYMo1cZ?= =?us-ascii?Q?UQbtyRqI4BjtmCAIq7ywuWKId+aw4dR633SquUgGUwbPWnrW/1rpRLlLPKn1?= =?us-ascii?Q?0PWgDNcm4Jbb92C2H7h9M6c4vKAsqjStpibcbjCJTdikqcYwVfFvBiRI/VgR?= =?us-ascii?Q?m3g5yvckL45s3i0Gy8RkJK+uWdb+atGK8HlwK1vfucc9tgT+VxtWWJ4DX3oP?= =?us-ascii?Q?azXkldF5fmSgwXxLWscoGQtzrisc77dOgAV9vDAEWaEw4weWOgn/Lc3SG6NB?= =?us-ascii?Q?MFna+UWbZXZR/8JMkB9O/V3W4GCfpQ5JQJztr+stjZx0b42I/zwK7yA9XC31?= =?us-ascii?Q?yRtfVphKvaaXDBlxjOWkJuocRglMDwCE5TNeeQokci5If/1FVuUf7Uos93Gj?= =?us-ascii?Q?kt8UpxDmfbN1yGXTNTRIhStqGkFzI0kLwGd9eAmjMPSE1quZ//ti03BRSeMk?= =?us-ascii?Q?OeNR3hkLw=3D=3D?= X-Microsoft-Antispam-Message-Info: FVDinMvt0hYdHzmKs9SKK0Dbi/zKYuHcjSVS+cIwctYB8rzDroR3ycODEq3PIFYYF6WOPi/jc9DeHHHJj38+wAr0TP/y1cLsRBkkeyWhuE2o64C2AnmYVLZQuCjM6m8PXTGd9aOcKAfl/kn3SaDeakojwqhLHLrXdKOgqgmJYuiNuorebm/3ZoPuq/DXqJF3yNjBTaBuQon7vJJ4b0hWESu5ZYTl3Xbw/QaSdzJcB67Bif2LKrgFyWiaVAVvaxuM1GtvEKKsMXtqDBwGADd9tCGDMO+61QJ0ciyLIWpFRmUEblZdVgfHAtRsgMO1c51GKDRRoML9NSLEWQWc3OLNmw== X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 6:JdOKO+wGTJfpW9C7Nks18xNsGcGS+5vMyNc3vhFboqo9W9R6fQH0tMrL1ur1GoJIJ0hYZrRY0xASjaz/v+VPqs/IuFDxNHVMjd5cQfCobM6Ro1FP0VBol/G23/yorG+Gx/vWBOYzjfr5Y5hhhMic7qwxbsHBwm2cHnpzu+/CZdkcjbCR+7sDy1HC6l2ufghZr2TrjmEv2XkSKbzONdXtyuh7JrPdQhq3Avfw0sYLSrj/VyPpcWXwnjXWw3H84HaKn5xyYKzP+XRCcrP3PiCMy1BICEnc4eSuNa2hbHH5BywoNCowJf2WMWKGc7K18ZLIzgIXpjUcLWa329T1uKFAwsOUojSwvZ9Zya/8uLh+JDiBSAEyD2hOeQbz7OIE4H87JmNtwbsn5q1PQHsX4ZsHncDLLfoj/keqUJvbypXcAmnNW2CVegagCp4bJcBOs+ojv42GpX+TYI8JgTBXNbz25g==; 5:T/LKG5gOD6exl+AoVKKRPqrXDvv6fgj+/Po6OI3j8/S3g9EdUD+w88JnG7gMAzu6S4lkKOg0fen9hAwyicaY/t18jq/T1WIlDpgKbjVHdKyagVcw9GptYFeatJQbhUlyYuI+iNof3T4vvtVIFD001uJ8l9AyrQWrBx8hp5IxYOM=; 24:AQCr+qt7LMoHOTsdc7e8CXDYvP2I5ZwLIOXclehPIXMDYYSKwz6V+mNyvLa1ockl+DiT98eqiUWGwr8bPfvIYJBKnOBsFHQP+XZQJxuBMTU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR05MB3106; 7:oQqhEUMb839k5FthHoszoEaUnNrycIwWM2xaYyNRUHNRWf9dtyf4VKGNKIdnjaSU3navx/e9Dkk6LNitVIDBYalG/tjqS5vReSxWvStiuOvGXNxfhXqORNlZYiRxweZ2nccy3oi9hIrl+U03XzAwYJMgPSzSLz1QQi4Lle3wUZ0nfyu1S+wP406GLnyqM41mCXBDVW4PPyY5DfuCcwQnkKU3khrhPlJgja3USZt1E6FotiMJ5ugu5p5dM9djbrJz X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 20:20:28.8985 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce44f19b-a96a-4c7a-b10a-08d5d6eb4423 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR05MB3106 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=734 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200221 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 20:20:34 -0000 Xin LI wrote: > I do agree with others that SHA-1 support should not be included It can certainly be disabled by default. > (unless I have missed something, but I think firmware integrity check > counts as a "Digital signature" verification, according to SP 800-131A A "Digital signature" verification is an accepted form of firmware integrity check, but a simple hash (inlcuding SHA-1) is also acceptible. We of course perform both - and the Digital signature does *not* use SHA-1, it has been deprecated for that purpose for some years now. > "9 Hash algorithms", SHA-1 verification should only be used for legacy > usage, which does not apply on FreeBSD because this is new feature). I've managed to get out of having to memorize all those SP's, so will check with one of the pour souls who still does - as to whether we are claiming "legacy" status... > But even that, given the code only impacts systems that have it > explicitly compiled in, it's reasonable to give the committer more > time to make further improvements rather than reverting it as a whole > as this would give the code more exposure. Indeed - thanks --sjg From owner-svn-src-all@freebsd.org Wed Jun 20 21:23:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CC20100D346; Wed, 20 Jun 2018 21:23:11 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0a-00273201.pphosted.com (mx0a-00273201.pphosted.com [208.84.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4E4875B19; Wed, 20 Jun 2018 21:23:10 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108159.ppops.net [127.0.0.1]) by mx0a-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5KLIvNK014405; Wed, 20 Jun 2018 14:23:09 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-transfer-encoding : date : message-id; s=PPS1017; bh=P64gD9F7/mtuvrpG6M6oCKm570DiloYkjBy59amYiEs=; b=u4yeSz0cc4l4lENz9YKVopiEke4314gOHSOz5T0GIBKwc9ooXpFEuyzTJhTtPI+fi8BH jTfVnJnZ5hQLEvEwGaluymrKFjjFhbYw2fJBxd4hL3c/5U5xIetaA+H2IwsuIsmEVnht 68bCOLSBRwo4O02g96Ppl+MiJBbx8hfat26+FlioxeORjRtbTco2bTlpOMlyysZeYmvm TuWLHK/0a/IR4FTAmtg6bfq4EJJoxOFQ6ceJAzowQCo0flzcmuC0NjWvyp3PNIb2tOXX axxBWjaMOPe65NivDbIjJqwLqhWndxCIc8h1m1zn7oL4EON6Dl5t+fgZ4xMD7D4/yl5j vA== Received: from nam05-dm3-obe.outbound.protection.outlook.com (mail-dm3nam05lp0112.outbound.protection.outlook.com [216.32.181.112]) by mx0a-00273201.pphosted.com with ESMTP id 2jqwfbr3x0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 20 Jun 2018 14:23:09 -0700 Received: from CO2PR05CA0104.namprd05.prod.outlook.com (2603:10b6:104:1::30) by DM5PR05MB3113.namprd05.prod.outlook.com (2603:10b6:3:c6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.14; Wed, 20 Jun 2018 21:23:07 +0000 Received: from BY2NAM05FT030.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by CO2PR05CA0104.outlook.office365.com (2603:10b6:104:1::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.884.16 via Frontend Transport; Wed, 20 Jun 2018 21:23:07 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by BY2NAM05FT030.mail.protection.outlook.com (10.152.100.167) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P256) id 15.20.906.10 via Frontend Transport; Wed, 20 Jun 2018 21:23:06 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Wed, 20 Jun 2018 14:23:00 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5KLMxVK009203; Wed, 20 Jun 2018 14:22:59 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id C6DB964638; Wed, 20 Jun 2018 14:22:49 -0700 (PDT) To: CC: src-committers , , , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> Comments: In-reply-to: Conrad Meyer message dated "Wed, 20 Jun 2018 08:43:29 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Wed, 20 Jun 2018 14:22:49 -0700 Message-ID: <32898.1529529769@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(39380400002)(376002)(39860400002)(346002)(396003)(2980300002)(189003)(199004)(81166006)(97876018)(478600001)(5660300001)(81156014)(8746002)(47776003)(50226002)(8936002)(305945005)(356003)(106466001)(8676002)(2810700001)(76506005)(53416004)(105596002)(97736004)(68736007)(2906002)(476003)(23676004)(2486003)(50466002)(11346002)(229853002)(446003)(26005)(6916009)(117636001)(486006)(77096007)(126002)(69596002)(316002)(6246003)(450100002)(107886003)(59450400001)(6266002)(86362001)(7126003)(9686003)(55016002)(7696005)(53936002)(2351001)(4326008)(76176011)(186003)(54906003)(336012)(93886005)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DM5PR05MB3113; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2NAM05FT030; 1:9ekfsTbL4bj2U5Qntn0tmDQI6SJCJCuyiUz/snlP4rQ6iPCXIPj5TqpixJqemwaHCvZEQGjX9zx0c1xN5qKzJXDcIU/UW1aYM2/o4xklayb/FSxBsJxDjxAr5YqtKmJ9 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8598f6ee-d1ef-4ef9-7385-08d5d6f40411 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 3:kjfiXrRcTpuN94q3sjGwmp/CUop5ROBL+2iiMHmjy01hnTitVImUhSASTQz1Ypp15sTgZwyQByfSWBwY3XWhmE2kxFyOsXQLJWBzwxTRVv50fnKJAc+IL4k17kptybC9K5e3Z+5AXJu5PqvikQ6xJAeErvn7mRbgcb8PwnccaTmEwsGjx2izdZ4OCPRIKHc070zftKYOYE0sJViTIpyme59ltFhzFnOrbfE8Vv1sR6Lnv4GmQ/7sGbHKccvrk7z1ZpWbncwolkFnMAwbAoPRS6bA1IQF37xfP8x+C5+6GYLRz4l9Ua/443pXUofNbafDofkzf3+lEJDSRurIra7mANj6Kd00oLN4QdxDDI5dltE=; 25:3+nXMfnHqiwOeyY6+VxHDXpcpKyeBh2T6CkqrAWzYJdRVXfI6KW58eucQj9aL13aQZwMhwB+AvsS5JwV1pQFSUAXFVXJfFc9ed6zgX3L+i1h24ALl1YYoCR0mgdip3kYQRjLH0tfIPnu8iCV7tRqtKjiMo2s5HMkbzTvvxnL71+fkNqZwqpG7eDZ1mb491R9KY/Xixv4cTIopzFbr3lMfSHXKjSGP+oVdyekrzqKM5sHtNWvLEYRUhpjRqLbAL2IC2zAPpjMkva2g5haBffgXSEGGImkgt9TGvAzt7PKZzHutkyFXXTbG3v7N7oLLkz80MhNOwbQtHjS+XlmUGN+dw== X-MS-TrafficTypeDiagnostic: DM5PR05MB3113: X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 31:1xr2NPPZlduYFya75diaDiAbTeabozaoFG6olpuyQcFA83rvdSeheaQp39xPibVs2LABZBPfvbkgDvuOEbkN1MraEjwvoXec8+RGDb/sGG5/mJUmYJL7uV9Si5FhLD8l/B+qLcnJzeZKaDSHDzxjlqi55V47Zb16Nyp1wmu38AkVR4xta3XCK1yVb0Krosz2YI9jkGOK2ry5J3Ef1liD0ctXBGiY/qY+Kv3UasZ7iSo=; 20:/hn+nAL3bua6lOScBh0HrbueKji0WdkZVb5DvR7QeQ7nTVvmYjaEjdRDB8Q2sT2hhogKIEXJxk3wlV0BSXFugIHReAdfoPdeVzREZFpc3Uyb9vqZo2v3/SmQcpwcma4aA/PGnd1/oNM28DEvJc3e8urCiON+5tb/7MKKW0MxiQ1WoIWycmt1tZI+eWa6I49cB0gTI2EvxiPP6of2h7WIilc2i5RkY0TUr325SQIl4+Eg0f9LAsthWZIBW7ecmLNeHnbZH/dCuBcTzL6U8W0OF3BtKgDaiE3rt58rbzrqj8DNKGjqJarZXmjwt8s7JnrBNl/+KM5XOgdb4ERGKIkt00iI0Rn0+qxejJgjGVSip5+1jhzWqkGvuJLSkQU69ek/qcNDekPimOzE80B0jERsnGW8sgnyHgdAI4Swq3Ay6c29H/nqPQAONyZSq+Sj6vLCwWh6BY+Thz7eRU6FPHU9E6/7jIQ1KwhtbzjP/eaK8VVlFOS/v8VwLpMXACr/oBmI X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192374486261705); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DM5PR05MB3113; BCL:0; PCL:0; RULEID:; SRVR:DM5PR05MB3113; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 4:Nr2MlFGNrQ/bO+U5fUDn/dIB9uxTqkJjb07XCDfldhRXs382Jsn/4iCKq1xNeBwhtDax8h6c2jAQn0z+xAnQrsmv1dmmbky9XGEbvI21XUovlUpKqy8QYROvWumbPBx/v2P+xiZTegKgq3qdtHK/caSwr/HjUJlyyVrNWNyvxknn79ga85bVfb9TOpxydXGSJNnf0NTVjqvuC95HLuNR/fm4mzyv2y0lEGfa0LVAxoqWbEcbtjq2fR9Sq7Fuqdu7i/1l99Wyk22yi+aNwl/PZlhdv1p68OoKqckUY7DgwQC8f3Iqw+hK2kpCgMaHYexE X-Forefront-PRVS: 070912876F X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtETTVQUjA1TUIzMTEzOzIzOjE3V3ZmSzJyK3pDTzZHUndGWnB4a3k3ZXhp?= =?utf-8?B?QTE0NFk0UjErUmtseW9CN3JnN3phS3FFVk1vcjYxcVVTWDFMaGxFcUhYcjF3?= =?utf-8?B?ZDBhTVJQaWFwaExwWEJxVjdCWGh5bmtuaVJDd09lQ0d0MDdzYW5NV29RYTNh?= =?utf-8?B?YkQwcHVYZXZGbHlHVTlIQjhSMmhqeC9URm9KNkJkL2YxL1ZIbUcxOFcwQm91?= =?utf-8?B?VnR0WXlQTzN0UGxaMkplNXhyNEk5dGFHM09ZS0c1VWMyM2xGNVJKWlVjYTFB?= =?utf-8?B?K1krQUJVMjhuOStxbFc4WWljQlNuZUl3ZzRwUTErMXNoZmJ0bmM3Z3Q0elhB?= =?utf-8?B?RG5oNVhoOUlCNW1Pa3NxbnBtRWlVaWU5QWpJL3pLZnpXWXZmeFFnaDdsYzhx?= =?utf-8?B?QTJ6MnJPNGZtR1d0UEZYU3FUKzNNOG1vVnBuUnl2YVk4eVBqR2pDNzNPTE01?= =?utf-8?B?T3dURTFadVFqcU5BWWJrLzVGUjU4SlJpY1ZBSVNkeUFjMXRRalI3REVuOW42?= =?utf-8?B?Q1R6ekJ0SFRNUGI1R2VIWER6MXFKMllZZ0xpZ2ZHczJJbnpZOTM3TTAxSzVy?= =?utf-8?B?d3doSms4N0Q4T3c1YUUzWTVsVEFDUWh5L1IzTG5PK0tweUltRk1yV1dXUUhw?= =?utf-8?B?MTc3U3BiYUFxai8xQnhoMCthaHZRQlNnZi8yU3NuV0tqaHlYYXhUVGJMZkxW?= =?utf-8?B?S0JTc3hDem1UZ3U0MjgwQ2ZSSnNORk91Y005dGJmSUJqbjhrWndpNE1ja0pH?= =?utf-8?B?WHRmYytuTTQ0SUFOMUxmamxlNTVoNnE0WkRQaUU2a0xaT3lHREN6YW9VTzNi?= =?utf-8?B?SUxiMDZhNHRSNEs1aUFWSHFaSTFOSzlMR3hlZDJLdHBENDVST0N0c3E3UUcy?= =?utf-8?B?NXVMV09TdEtpQ1Q4aFF6UVpyelJVOEE4TURxNlhOd2JZSEh3VlBaajBwcWpz?= =?utf-8?B?eEtWcm83dVZXZGJPUUFLQlhwcDBLenhTZkRzWHQybytrNk9Ga1lvbWIyaDhD?= =?utf-8?B?YlpzY2JZOTBpY3dKL3JHSS9xWFFZdHBmZGdjeEl3dGlkRzZTd0JFYTFFbnc1?= =?utf-8?B?cVAyS3Z6NjQxY3RPMFZpSEdzYldXVVNLY25DM2ZHUFRJZEY4cVBvRGpxWWZL?= =?utf-8?B?UEZIaG41aGZTbDUxNUZsVFFvdEcrVkxRNGl2eXdwMEt0Z1FyOVE0a3hKb3NK?= =?utf-8?B?UVZhaWRvS1BsU2pUWWtSL01sWGpFa05sTzlGNVBrRlFpYUI4b2lzU3pqOW5Y?= =?utf-8?B?dlpPOU01MDNIb2hSelYyK2RHRDd3VkxHbEd5V2ZlVmFya2g1YnpnVUZRSGJC?= =?utf-8?B?djcwTDJIaW1oRm9GSzBOS2RIa1hxY2h2c2FSTU80S2FJdjdtRit0bW9FWC9J?= =?utf-8?B?WFZqQVBsUmwxc1NUTGNpRDE3bmtNbHAyalRzbndJMU1iVUZ3dnNFK0F5UGJG?= =?utf-8?B?bU4wZTJDRGJ1dXc1Q3NQa3JNc0EyakYwdDBLTTU0QURoVnJkTG8xc1J2Y2Nu?= =?utf-8?B?T3dYcHp5RllSWlVBajV0aEc0czlGKytWUHBQSU5iMUR2cGN2c3J1TU9aelRC?= =?utf-8?B?U3hKNmxGNERSSFFEeG56UXNQMnBqSnBwaFRLZUZGZlRWTmxtbDBoWDA4Wnc4?= =?utf-8?B?YTEwaFFudnJrVG5idUtOc3NJOVVNTjNleStldE1nU0ZEcVE4Y05HSHE5VEFx?= =?utf-8?B?QkFUb084Z2Mxa2lrRHNtN3pWYlE4U1FyMDU3cjV4ZEJuT29qTTRuRDdYOHdn?= =?utf-8?B?MDBlMk56Y0t0S1BYWEorU3RZeGFqbWE3QkpZeWIyT0VDTWRKdEVTZjdpK3F5?= =?utf-8?B?eUNLQVVwR05majVYcm52SUNSa1l1emNGVXpkKzhTdkdGZHJZS0NickgzVlRG?= =?utf-8?Q?/lRSAC8Q/of99nKhrAiXCyb86vEuRrSW?= X-Microsoft-Antispam-Message-Info: +2v/q1Yq4KlJ/Bwjh6i5hdD43iTkVNF4iBEd/RCI4L4bgArA9LgodutVG/1cC7uffu9umlvmZENen88g8jHogThrG2D2fDqaEwtRbztlv8V20zlELzhej3mvi/AqYwV2H0vnEKN7D/Y+VUZao+UUwGsdfr3xW8e1JETuiuaYwRzr3vYPCF9j4p78tkse0yyVFSPM4XCkKV9prISuwUX3EjDjA2hlS0OIqblgpehPDxn7449gv7d7cVO/vgzL+4gEE/2JSFm7Z5zFEKyrcZb12wkJvOMh4a2QnSEGv6SX6IWhyXZEVb+Mt07uc6Rz+MoP4ouUq4eAeAW2V8bc+E2lWQ== X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 6:5DccIsxcd4RkVlsriZczfEzrh9ISH3cVvFnWgAvM3iRMRXgBmh6aynP2g+O2lLVbSWSa6Mg1Qf1BqRwQXxauQ1ZakO/m5JmyBtDKbf1k2WiLca3G0UjjSyhqrt3DjUeXVERgiEpWbD/9LqkPY+G244Vtq7A2Q8/2rg1h+GzuAce5KzN+BM3F4dirFSqps34jyaOFYwnODd7QdQReMsGCtmXDX4+TbO4CfEZ6r+AFu2Ew5VcnlZnHTGFBih5sJIAawxyuzLz9mIK4prnXKVAgHu6axaWZUD8cvS2On8ptp/PqA/Vz7LJK4+NhoGKucLqRLI/et4wAvREWXjQuWiFuhaFhtQrB4IOeG41Ujn+oMXXTvkdH0Fk4ItZu9bi2vJ/QbpKUkT+74b60XqsDyNVNHg7Ql1xw6gn40gkAIRJ96g7FHjN/IzDYQiTeVv6Rmg1sCypiTsTyIbl6k/LwoDtoBw==; 5:W0XljA0tz5Sa356ozKZgic9ltmjHpNFlWptt3DwRNN1icnExOblaUbegYIJw52Xq7G0RQPPZ6nmpKx3mrXvQLSx8WYFjKZShUWuNYaY9k3E3/JdKk803XAkL46Bbs4lxHQ6X2szN9GETVZcbIfLGj0AjIbpOGFotRA3qK/V+1rg=; 24:OUWyrjEXtzreNuUtb4uBOTPzt+7teBRtf9078gl2ThBN3+aKBwi+IFdKvbW3Q/aJjS6x6Oqvdnjd6lyiATmmDDTjhG+e1ZmFQnEm0P/HuIE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3113; 7:46yRqswvsvQEXoWcoHKeIfyO0A1PDpdLxSHGmo+ouhVAJOXBDN6DY6rXHsRHL7dYynwbN8npYRI5sDmJkYSCjtAd1EGYkuoVDuFokAcvezgzTpz6iLmvS207SXFo6cqJhM/jNklH0WmJojZCL2SYMdHDB5sEoOqTwBMQHI3Rn6lG5f3MnXRpoSeQD0T677GMmVUe84vRYvEMU4qnSsfvgn/1gI5FOjS0h4TMMyuFohUQmPpNgdPqt/1sfEAAAHTc X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 21:23:06.9222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8598f6ee-d1ef-4ef9-7385-08d5d6f40411 X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3113 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-20_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806200229 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 21:23:11 -0000 Conrad Meyer wrote: > The signing of manifests does not exist in the patch series committed. Nor will it, the singing of manifests is a build thing. But as I mentioned earlier I think the loader verification code can be leveraged for a verifying userland veriexec tool similar to that in Junos. > (If NetBSD does something broken, that is not an excuse to copy it.) How about we backout the veriexecctl tool - which is the only bit your comments apply to - and which we do not use. All the signing etc discussion is orthogonal to the kernel part. > > A veriexec loader that leverages signed manifests requires some signing > > infra. That's a big topic all by itself. >=20 > It *may* require that. However, even without that, admins could > reasonably manage their own PKI in some fashion, independent of There still needs to be a tool that they can use. The work I've done on the loader should make this simple since it provides for OpenPGP signatures as well as X.509 based certs. > FreeBSD's infra. But it requires the support code to verify > signatures, as in the "verify" part of veriexec, which is wholly > absent. Yes. As above, reverting the veriexecctl tool would be fine, I'll commit a proper verifying tool along with the loader bits. I have to do some tweaking of one of my libs first. > Again =E2=80=94 this is a discussion for arch or phabricator, with the se= ries > reverted first. For code that's off by default why is reverting a requirement? > many other glaring performance problems. If you care about MAC > performance in a secure algorithm in 2018, perhaps look at any of > these great options: >=20 > * SHA-3 (Keccak) > * Blake2-b > * Poly1305-{AES,Salsa,ChaCha} The framework allows folk to add any hashes they like. For us, anything which is not NIST approved is of little interest. Obviously many people have the luxury of not haveing to bow to NIST, so again the framework provides. > FreeBSD has had this code for 0 years. It's a novel feature here. > There is no reason to introduce SHA-1 in novel security features in > 2018. As mentioned earlier (in this thread? hard to say), no reason it needs to be enabled by default. FreeBSD.org if they are going to sign the packages they ship, need to make a decision about the hashes they want to support. > And no, upstreaming the signature verification code is completely > orthogonal to implementing signing infrastructure. Not really since one dictates the other. From owner-svn-src-all@freebsd.org Wed Jun 20 21:28:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5EFD100D6F2; Wed, 20 Jun 2018 21:28:17 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: from mail-ot0-x243.google.com (mail-ot0-x243.google.com [IPv6:2607:f8b0:4003:c0f::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 53B1075D20; Wed, 20 Jun 2018 21:28:17 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: by mail-ot0-x243.google.com with SMTP id d19-v6so1164824oti.8; Wed, 20 Jun 2018 14:28:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Vqd+77iwXqqbaOVEm7nm4isJRl1ymIOPF3kQXz7NHmU=; b=Vfj0l3BgICSVJneeAJHcCgNom5bB/fRN5QHjblm7lYBmyJWCMo0gdglV5rcipMywp8 yB49D5RQn7/OCmPzxKlHCmYkhcz9OY9P0UcBnvLJ8ySF7U0q9FLawQuZyo7R/fxC5xg4 uJUwPNXLawitP6hVvxtkkcAFIWd2C++GDWTglctekP5Ejh0efbqHqpZZ/1FJEgtKP1A/ dGZJLgX/wkh0eEqrfNmXX+pnVlxoGBUqF0r3WWjqgr1qctA+OFOHVYeppMUK/9QmIvAK dEPVEhlN/jGTv5mGBwG5GE2BawuVSd2EaatirZPHTTP95AWPs7w6rYhtzMiYTp8d8OEm +Gbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Vqd+77iwXqqbaOVEm7nm4isJRl1ymIOPF3kQXz7NHmU=; b=gyrPhGOZi8tBHbigvhoCOD2WhAq/ATK6rKcLK8bZqYis8yPddbJXmLpsM19FQWStN1 84NHqd2TS/V8Jz81TEUFKlBDerK3le8yPgIx6pGotQjOzmZjm+I2+OsVa4Rwm4J4Vkfe vBK7pj+p8TsHIPK+uTOmXhK64nxN/3rILALNq5uu0niMfaS3OjLytj0A354RFCvTKNkV Ju0WJw2wqpldh2mZART2wzOVXLLoNVmX87KcG0swStrWlyMeLfvdc9OI2MpL3WrHQ6qV wL3zQYS/BlWbkn6sZxzKQvkfuJE/p//Tuf01a4QuVgdWX7G8sIkZ5KZODi3AVCB/EppK fDzA== X-Gm-Message-State: APt69E22YNYDvFHTw4f3sge4SDbjRRaCtar9tgjcEAgF64gYNOmaF+3M IHNlWLG2q63cQITiau94o8ZVjiEX/nqMksr5Xc/M9J+rYg4= X-Google-Smtp-Source: ADUXVKLE+9JxilGoTINI3cQj4yA9iFOUjqpPNd/0KOp8V0iK/6u5vf0VvCkEHLT36+Pg82sbgShKp+416kRxiJdmnKE= X-Received: by 2002:a9d:5190:: with SMTP id y16-v6mr14867764otg.252.1529530096533; Wed, 20 Jun 2018 14:28:16 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1918:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 14:28:15 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> <96021.1529475664@kaos.jnpr.net> <17033.1529508519@kaos.jnpr.net> <1529510299.24573.5.camel@freebsd.org> From: Stephen Kiernan Date: Wed, 20 Jun 2018 14:28:15 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: cem@freebsd.org Cc: Jonathan Anderson , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 21:28:18 -0000 (Apologies to cem@ for the duplicate in his inbox, Gmail decided to not reply-all in my reply.) On Wed, Jun 20, 2018 at 1:07 PM, Conrad Meyer wrote: > Hi Jon, > > On Wed, Jun 20, 2018 at 11:58 AM, Jonathan Anderson > wrote: > > On 20 Jun 2018, at 15:32, Jonathan T. Looney wrote: > >> My reasoning > >> was fairly simple: when a review has been open for over a year with no > >> action, it seems like the submitter should be able to commit it without > >> waiting for more review, if they are confident in their change. I stand > by > >> that (and, in fact, would substitute something shorter for "over a > year"). > > For this as a question of general process, I think "it depends." For > minor fixes? Of course! Less than one year. For minor improvements > or enhancements? Also yes, also probably less than 1yr. For large > features like this, I think the answer is more nuanced. > > Sometimes being in a review for a year means the reviewers are > overloaded and don't have time. In that case, maybe they shouldn't > block progress. Sometimes being in review for a year just means the > right reviewers haven't been found. I think that was more the case > here. > > I would suggest anyone submitting a large feature and not getting > feedback in a reasonable timeframe to solicit feedback from a wider > audience much sooner than one year, and also indicate intention to > merge the unreviewed change with some time window (1-2 weeks?) on > giving feedback or at least asking for more time to review. > That was the problem. I soliticted feedback many times over at least 3 years. The first set was in my GitHub branch and I had discussed with various people starting at BSDCan 3 or 4 years ago. I had even sent an early version of the changes to rwatson (whom I had previously worked with at TIS/NAI/McAfee) and was provided some feedback based on a cursory look over of the code, which was integrated into the branch. At MeetBSD 2016, I also discussed the code with some people and that was when it was suggested that I create an account of Phabricator and put the code up for review. Some members of core and/or the Foundation had suggested who to talk to get reviews and I had also spoken with rwatson again to see if he had any suggestions. Once the code had landed in review, I also talked with people during vBSDcon last year in an effort to try to find out who else should put eyes on it. I even talked about it during one of the BoF sessions and pointed out both my GitHub branch and the set of reviews on Phabricator, which is when there started to get some additional feedback and/or watchers on the review. Also, after I had received my commit bit and the reviews were still collecting dust in Phabricator, on numberous occassions I solicited feedback or suggestions on who to contact on the IRC channel. I'm guessing that people had not looked at the reviews before suggesting who to talk to or they did not realize the areas of interest that the changes might cover. I think this experience illustrates the need for some better way for someone contributing to be able to find out who the correct parties are that need to be contacted. It was 3+ year struggle for me to find people to put eyes on the code and it was not just a fire it off and wait forever thing. One can only listen to crickets in response for requests for help for so long. -Steve From owner-svn-src-all@freebsd.org Wed Jun 20 22:16:47 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ECCD100F5A0; Wed, 20 Jun 2018 22:16:47 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 393D277308; Wed, 20 Jun 2018 22:16:47 +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 1A7E7566; Wed, 20 Jun 2018 22:16:47 +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 w5KMGkYw043989; Wed, 20 Jun 2018 22:16:46 GMT (envelope-from erj@FreeBSD.org) Received: (from erj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5KMGkQX043988; Wed, 20 Jun 2018 22:16:46 GMT (envelope-from erj@FreeBSD.org) Message-Id: <201806202216.w5KMGkQX043988@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: erj set sender to erj@FreeBSD.org using -f From: Eric Joyner Date: Wed, 20 Jun 2018 22:16:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335462 - head/sys/dev/ixl X-SVN-Group: head X-SVN-Commit-Author: erj X-SVN-Commit-Paths: head/sys/dev/ixl X-SVN-Commit-Revision: 335462 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.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 22:16:47 -0000 Author: erj Date: Wed Jun 20 22:16:46 2018 New Revision: 335462 URL: https://svnweb.freebsd.org/changeset/base/335462 Log: ixl(4): Fix gcc build errors By removing redundant function declarations. Reported by: ci.freebsd.org via Mark Millard MFC after: 1 month Modified: head/sys/dev/ixl/ixl.h head/sys/dev/ixl/ixl_pf.h Modified: head/sys/dev/ixl/ixl.h ============================================================================== --- head/sys/dev/ixl/ixl.h Wed Jun 20 20:04:20 2018 (r335461) +++ head/sys/dev/ixl/ixl.h Wed Jun 20 22:16:46 2018 (r335462) @@ -542,7 +542,6 @@ extern const uint8_t ixl_bcast_addr[ETHER_ADDR_LEN]; /* Common function prototypes between PF/VF driver */ void ixl_init_tx_ring(struct ixl_vsi *vsi, struct ixl_tx_queue *que); -void ixl_set_queue_rx_itr(struct ixl_rx_queue *que); void ixl_get_default_rss_key(u32 *); const char * i40e_vc_stat_str(struct i40e_hw *hw, enum virtchnl_status_code stat_err); Modified: head/sys/dev/ixl/ixl_pf.h ============================================================================== --- head/sys/dev/ixl/ixl_pf.h Wed Jun 20 20:04:20 2018 (r335461) +++ head/sys/dev/ixl/ixl_pf.h Wed Jun 20 22:16:46 2018 (r335462) @@ -401,7 +401,5 @@ s32 ixl_write_i2c_byte_aq(struct ixl_pf *pf, u8 byte_o int ixl_get_fw_lldp_status(struct ixl_pf *pf); int ixl_attach_get_link_status(struct ixl_pf *); -u64 ixl_max_aq_speed_to_value(u8); -void ixl_handle_vflr(void *, int); #endif /* _IXL_PF_H_ */ From owner-svn-src-all@freebsd.org Wed Jun 20 22:42:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75D321010C38; Wed, 20 Jun 2018 22:42:20 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CFAF378219; Wed, 20 Jun 2018 22:42:19 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5KMg9aN076510; Wed, 20 Jun 2018 15:42:09 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5KMg9qf076509; Wed, 20 Jun 2018 15:42:09 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806202242.w5KMg9qf076509@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335454 - head/usr.bin/ar In-Reply-To: <201806201843.w5KIhHNu032028@repo.freebsd.org> To: Ed Maste Date: Wed, 20 Jun 2018 15:42:09 -0700 (PDT) CC: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 22:42:20 -0000 > Author: emaste > Date: Wed Jun 20 18:43:17 2018 > New Revision: 335454 > URL: https://svnweb.freebsd.org/changeset/base/335454 > > Log: > usr.bin/ar: use standard 2-Clause FreeBSD license > > Many licenses on ar files contained small variations from the standard > FreeBSD license text. To avoid license proliferation switch to the usual > 2-clause FreeBSD license after obtaining permission from all copyright > holders. > > Approved by: jkoshy, kaiw, kientzle > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D14561 > > Modified: > head/usr.bin/ar/ar.c > head/usr.bin/ar/read.c > head/usr.bin/ar/util.c > > Modified: head/usr.bin/ar/ar.c > ============================================================================== > --- head/usr.bin/ar/ar.c Wed Jun 20 17:37:55 2018 (r335453) > +++ head/usr.bin/ar/ar.c Wed Jun 20 18:43:17 2018 (r335454) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-3-Clause > + * I think there may be an error above, commit message says 2 clause, license below appears to be 2 clause, yet above we have 3? > * Copyright (c) 2007 Kai Wang > * Copyright (c) 2007 Tim Kientzle > * Copyright (c) 2007 Joseph Koshy > @@ -8,22 +10,22 @@ > * 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 > - * in this position and unchanged. > + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, > - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * THIS 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. > */ > > /*- > > Modified: head/usr.bin/ar/read.c > ============================================================================== > --- head/usr.bin/ar/read.c Wed Jun 20 17:37:55 2018 (r335453) > +++ head/usr.bin/ar/read.c Wed Jun 20 18:43:17 2018 (r335454) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > * Copyright (c) 2007 Kai Wang > * Copyright (c) 2007 Tim Kientzle > * All rights reserved. > @@ -7,22 +9,22 @@ > * 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 > - * in this position and unchanged. > + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, > - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * THIS 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 > > Modified: head/usr.bin/ar/util.c > ============================================================================== > --- head/usr.bin/ar/util.c Wed Jun 20 17:37:55 2018 (r335453) > +++ head/usr.bin/ar/util.c Wed Jun 20 18:43:17 2018 (r335454) > @@ -1,4 +1,6 @@ > /*- > + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD > + * > * Copyright (c) 2003-2007 Tim Kientzle > * All rights reserved. > * > @@ -6,22 +8,22 @@ > * 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 > - * in this position and unchanged. > + * 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(S) ``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(S) BE LIABLE FOR ANY DIRECT, INDIRECT, > - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT > - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, > - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY > - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT > - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF > - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. > + * THIS 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 > > -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Wed Jun 20 23:28:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D06441012811 for ; Wed, 20 Jun 2018 23:28:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from sonic316-21.consmr.mail.ne1.yahoo.com (sonic316-21.consmr.mail.ne1.yahoo.com [66.163.187.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 63EC879561 for ; Wed, 20 Jun 2018 23:28:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1529537302; bh=JQ9Ib/X4fuHt0D2+CmmXKRwBUa6aER0pi5t8TDMy/X0=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From:Subject; b=SzZ799nEk5EaeoGfisZYtK/hxPpGJ/HPWL3cvEvBGNzG/C9aldiK3dCWKgURioBKUZ2BmV7UIs/lxV5RAR2Y0LYavRrC6Sx7d3UZiMWgibHT2NtjoiySU2e26X1tManL3YIeu0gqpJipbS0dxhWCsF69j9NAjUNOCLXokVjpkFXzBLl5M7rPU/CFVBVI1tKapQBSZpDwAGG8jWbUv0etOgKhIn7PEPXr7ifaz4TS1icC9LRbfaVJMKeJsq4VJ0e/zkPQ2mL390fvNEFYueBopHv+E0ceiWkgw7E8bmgEo2lnKJVhwStiTZGvuD8wBUFAYmJ8v1T/w4azyN3Eju66Ag== X-YMail-OSG: b6zPbkAVM1nZ167zqexfkJZLVPzf56Y.KQec_7XUx7XxQp4V_emBZ.eUr9S4ZIR Xtd2DuF3VBM24P97CuvfECXa2DHOFkS2S5aHwaf0T4TH.I2z5Y0SL9uPVJeaaJEdXKzi0q3py3Cq hKaEdNxYOCpF5YbYOUv45vKGcbADZVs46PcgyDp53mjyqt2uSEH1wEG3nsBOopFW9m3ByshTQa4q d1RGPoxHyHImVDRp1M60svKHYS5griGOkfLgReGEDy9WJDTaSTf3HIowJEuXJ_wL2Bri5Wr5aG_L p9pnGsmH7fkiBVukPkdTpliHe7siVXn_5oCzmtjNVZy.qJQhXUCHmxpp6MFsjOuD_xsrTqAv7nnS nostkN9hMC8IVAum5isPYL34DL6AptuXIoZDIqrXjZ86bhZHkDXKJMd.W2FmC8wvrrK1IbyVrbve IkZOESGnQRUPQZ5LNOphi02QhxNGwFUGDr6.DQWPj7DSNTCtqyVZHcZpMDF5MIlPZJUVeK_CC2Jf 0G_LoBURxkCp7Z8PTXy5is7xatBo9KoPHIZIMc57zS3kzNZ5h0ZjSekSbeuhP98qQV0AtZ25Y5CI Z89Gh_PC2XGUjWNA.71r46yugpr3k0aBgHa6BRfKWzjbIwXcUcvixMctV59R6Btzc4aZqlD4p_dK cKGs0_saIuYVnPhKFP.GnA6VLBqqvP.9hp_Yyx4mNnHAzt.Ir9l8KokXINjpxFBXAQ1hCUChr_oR veifVktiQSlHMnUwOeM5Y1HNY_Q1xLYUiqm358Czdm.tZmxQHcSIyYL9C5GYrrVVT5QQw5yjcAvR 9QixJsiImEx7XPQR.aeaBZLuYULLE3RpsDxmRcPH_l5BIu3TMnLvneufCpMg5c6KFjsjPBmDZPDR Gp6b06CBrPpwQcFjsFUhIJPRcmAAQja76HzF29SXd5Ye_VboG5MaZh1k5FcySfe_9xeBczY3JfqZ LqjhEFTtR Received: from sonic.gate.mail.ne1.yahoo.com by sonic316.consmr.mail.ne1.yahoo.com with HTTP; Wed, 20 Jun 2018 23:28:22 +0000 Received: from 181.52.72.201 (EHLO [192.168.0.6]) ([181.52.72.201]) by smtp423.mail.ne1.yahoo.com (Oath Hermes SMTP Server) with ESMTPA ID 3ce0e274f21346a9a9438dd3389368c8; Wed, 20 Jun 2018 23:28:19 +0000 (UTC) Subject: Re: svn commit: r335454 - head/usr.bin/ar To: rgrimes@freebsd.org, Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806202242.w5KMg9qf076509@pdx.rh.CN85.dnsmgr.net> From: Pedro Giffuni Organization: FreeBSD Project Message-ID: Date: Wed, 20 Jun 2018 18:28:16 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <201806202242.w5KMg9qf076509@pdx.rh.CN85.dnsmgr.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 20 Jun 2018 23:28:30 -0000 On 20/06/2018 17:42, Rodney W. Grimes wrote: >> Author: emaste >> Date: Wed Jun 20 18:43:17 2018 >> New Revision: 335454 >> URL: https://svnweb.freebsd.org/changeset/base/335454 >> >> Log: >> usr.bin/ar: use standard 2-Clause FreeBSD license >> >> Many licenses on ar files contained small variations from the standard >> FreeBSD license text. To avoid license proliferation switch to the usual >> 2-clause FreeBSD license after obtaining permission from all copyright >> holders. >> >> Approved by: jkoshy, kaiw, kientzle >> Sponsored by: The FreeBSD Foundation >> Differential Revision: https://reviews.freebsd.org/D14561 >> >> Modified: >> head/usr.bin/ar/ar.c >> head/usr.bin/ar/read.c >> head/usr.bin/ar/util.c >> >> Modified: head/usr.bin/ar/ar.c >> ============================================================================== >> --- head/usr.bin/ar/ar.c Wed Jun 20 17:37:55 2018 (r335453) >> +++ head/usr.bin/ar/ar.c Wed Jun 20 18:43:17 2018 (r335454) >> @@ -1,4 +1,6 @@ >> /*- >> + * SPDX-License-Identifier: BSD-3-Clause >> + * > I think there may be an error above, commit message says 2 clause, > license below appears to be 2 clause, yet above we have 3? Look at all the file: there are two licenses there. Pedro. From owner-svn-src-all@freebsd.org Thu Jun 21 00:48:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F3E11016CF5; Thu, 21 Jun 2018 00:48:48 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9B77F7C6A7; Thu, 21 Jun 2018 00:48:47 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5L0mhI3076927; Wed, 20 Jun 2018 17:48:43 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5L0mhv8076926; Wed, 20 Jun 2018 17:48:43 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806210048.w5L0mhv8076926@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335454 - head/usr.bin/ar In-Reply-To: To: Pedro Giffuni Date: Wed, 20 Jun 2018 17:48:43 -0700 (PDT) CC: rgrimes@freebsd.org, Ed Maste , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 00:48:48 -0000 > On 20/06/2018 17:42, Rodney W. Grimes wrote: > >> Author: emaste > >> Date: Wed Jun 20 18:43:17 2018 > >> New Revision: 335454 > >> URL: https://svnweb.freebsd.org/changeset/base/335454 > >> > >> Log: > >> usr.bin/ar: use standard 2-Clause FreeBSD license > >> > >> Many licenses on ar files contained small variations from the standard > >> FreeBSD license text. To avoid license proliferation switch to the usual > >> 2-clause FreeBSD license after obtaining permission from all copyright > >> holders. > >> > >> Approved by: jkoshy, kaiw, kientzle > >> Sponsored by: The FreeBSD Foundation > >> Differential Revision: https://reviews.freebsd.org/D14561 > >> > >> Modified: > >> head/usr.bin/ar/ar.c > >> head/usr.bin/ar/read.c > >> head/usr.bin/ar/util.c > >> > >> Modified: head/usr.bin/ar/ar.c > >> ============================================================================== > >> --- head/usr.bin/ar/ar.c Wed Jun 20 17:37:55 2018 (r335453) > >> +++ head/usr.bin/ar/ar.c Wed Jun 20 18:43:17 2018 (r335454) > >> @@ -1,4 +1,6 @@ > >> /*- > >> + * SPDX-License-Identifier: BSD-3-Clause > >> + * > > I think there may be an error above, commit message says 2 clause, > > license below appears to be 2 clause, yet above we have 3? > Look at all the file: there are two licenses there. My claim still stands, the commit message and reality do not match, Ed claimed that he was switching to 2-clause FreeBSD license, yet it does not appear to actually do that. It further claims that he obtained permission from ALL copyright holders, which also appears to not be true, or he could of removed the 3 clause. The dual license is an even bigger can of worms, as then technically this file is neither BSD-2-Clause nor BSD-3-Clause, but some hybrid that has to be treated specially. Does SPDX have rules for dual tagging a file? I seem to recall that there was some way to do that at least. I am unclear as to it even be legal or valid to have added the 2 clause license on top of the BSD 3 clause license. > Pedro. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 21 02:18:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8EB2C101E4CF; Thu, 21 Jun 2018 02:18:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E5728135F; Thu, 21 Jun 2018 02:18:45 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-it0-x232.google.com with SMTP id j135-v6so2586092itj.1; Wed, 20 Jun 2018 19:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4pPcyRhCVd42SJzTdk6q1wC5UmyPVy0MCEkVx/5XE+A=; b=umIuOcLdaZuZlakyREj3MwhL8PQTH4xCN93UpqC9B6SP84asjB0+PXPsp8sU63+gNF 1sDkfp4wS/whRBuhRkJrXC/7aUq0+5lh73lE8iMYTTB7/4ZQ8uEeb/wAxKNe5eoaDHaj /jj8e26u+g8Cv9Vvhja9eU38jQFZYNrs4bmFCpr0c5eEnJTCpaWuxXVh4fTcEKw1/sxf D6edUnRI5s8fszGHdyOedbxk6qyhoxLBJ1Fqn11F/GwmwC6zkpLXigIkyjVsNox6p4Vp vUf7cVQaqc4h8VGVt1sKvY5kYOIo7ne14zlF+vM6JrNXrW4vBDcuKe9t7VShM3hasYu+ 8tng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4pPcyRhCVd42SJzTdk6q1wC5UmyPVy0MCEkVx/5XE+A=; b=J0/Qcq2MrU94TdllNfu4NU29utgv86Zcf3BeViwCmVYBdqwWoCPxuPzpuw8ZIhVAmW g8ajyBS0uO6VGcUhIj5i2tQv+5cG7IMHhrUQ7DhF+KMmi1uf5qhW4nf7PRzK+jypc24a SdwYUQTliOMOC9AT5gOm+C38T/3jBP6gsviAJQmS21t04F8BMCiXh2lm+JcGnvU99ctl TE7IgiMEuYYWOH2VK9RKHOlZzRArgArPWV6gcVbQQ7CafeQFhy4PShEZF1Yjvik/0jek Fa+n0r9JSDOBHciMqk5WAbISzkNfJqVzWZljzTC7DuWtxI/zyj2KVincTiS3bmcCEfPn xmUw== X-Gm-Message-State: APt69E01OlyQ07YQ3RkHgeracKmwM3zDbAAPhfegP760VDtz74DzuBvu 69LhI9k+8lZEmjZR6yCBwDIdhELTGmGZAJJKZocszA== X-Google-Smtp-Source: ADUXVKKbHMH4GgLQazJg0O8Vz8aYVjtMhQmnk1T7QvFWWN1fr8UK/L/54QjUTEF0Sllb4u5JOd6km1mhWs1VOgKQplU= X-Received: by 2002:a24:1fce:: with SMTP id d197-v6mr3431529itd.52.1529547524931; Wed, 20 Jun 2018 19:18:44 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 2002:a6b:c6c6:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 19:18:24 -0700 (PDT) In-Reply-To: <201806210048.w5L0mhv8076926@pdx.rh.CN85.dnsmgr.net> References: <201806210048.w5L0mhv8076926@pdx.rh.CN85.dnsmgr.net> From: Ed Maste Date: Wed, 20 Jun 2018 22:18:24 -0400 X-Google-Sender-Auth: FDkCQQIExIfVb5Wj2hkmInnlCIs Message-ID: Subject: Re: svn commit: r335454 - head/usr.bin/ar To: "Rodney W. Grimes" Cc: Pedro Giffuni , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 02:18:46 -0000 On 20 June 2018 at 20:48, Rodney W. Grimes wrote: > > My claim still stands, the commit message and reality do not match, > Ed claimed that he was switching to 2-clause FreeBSD license, yet > it does not appear to actually do that. The commit message could have been more clear indeed. > Does SPDX have rules for dual tagging a file? I seem to recall that > there was some way to do that at least. It does (using license1 AND/OR license2), but in this case one of the licenses is a subset of the other. From owner-svn-src-all@freebsd.org Thu Jun 21 02:15:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13B97101E052; Thu, 21 Jun 2018 02:15:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0F488101F; Thu, 21 Jun 2018 02:15:50 +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 9147530B2; Thu, 21 Jun 2018 02:15:50 +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 w5L2Fohg067153; Thu, 21 Jun 2018 02:15:50 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L2FoJv067152; Thu, 21 Jun 2018 02:15:50 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806210215.w5L2FoJv067152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Jun 2018 02:15:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335464 - head X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head X-SVN-Commit-Revision: 335464 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 02:15:51 -0000 Author: emaste Date: Thu Jun 21 02:15:50 2018 New Revision: 335464 URL: https://svnweb.freebsd.org/changeset/base/335464 Log: Makefile.inc1: rename build metadata file to toolchain-metadata.mk The metadata file contains more than just compiler metadata. Discussed with: bdrewery Modified: head/Makefile.inc1 Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 21 01:22:35 2018 (r335463) +++ head/Makefile.inc1 Thu Jun 21 02:15:50 2018 (r335464) @@ -92,8 +92,8 @@ MK_GCC_BOOTSTRAP= no # running CC from bsd.compiler.mk. .if make(installworld) || make(install) || make(distributeworld) || \ make(stageworld) -.-include "${OBJTOP}/compiler-metadata.mk" -.if !defined(_LOADED_COMPILER_METADATA) +.-include "${OBJTOP}/toolchain-metadata.mk" +.if !defined(_LOADED_TOOLCHAIN_METADATA) .error A build is required first. You may have the wrong MAKEOBJDIRPREFIX set. .endif .endif @@ -311,7 +311,7 @@ test-system-${_t}: .PHONY # Store some compiler metadata for use in installworld where we don't # want to invoke CC at all. -_COMPILER_METADATA_VARS= COMPILER_VERSION \ +_TOOLCHAIN_METADATA_VARS= COMPILER_VERSION \ COMPILER_TYPE \ COMPILER_FEATURES \ COMPILER_FREEBSD_VERSION \ @@ -319,17 +319,17 @@ _COMPILER_METADATA_VARS= COMPILER_VERSION \ LINKER_FEATURES \ LINKER_TYPE \ LINKER_FREEBSD_VERSION -compiler-metadata.mk: .PHONY .META +toolchain-metadata.mk: .PHONY .META @: > ${.TARGET} - @echo ".info Using cached compiler metadata from build at $$(hostname) on $$(date)" \ + @echo ".info Using cached toolchain metadata from build at $$(hostname) on $$(date)" \ > ${.TARGET} - @echo "_LOADED_COMPILER_METADATA=t" >> ${.TARGET} -.for v in ${_COMPILER_METADATA_VARS} + @echo "_LOADED_TOOLCHAIN_METADATA=t" >> ${.TARGET} +.for v in ${_TOOLCHAIN_METADATA_VARS} @echo "${v}=${${v}}" >> ${.TARGET} @echo "X_${v}=${X_${v}}" >> ${.TARGET} .endfor - @echo ".export ${_COMPILER_METADATA_VARS}" >> ${.TARGET} - @echo ".export ${_COMPILER_METADATA_VARS:C,^,X_,}" >> ${.TARGET} + @echo ".export ${_TOOLCHAIN_METADATA_VARS}" >> ${.TARGET} + @echo ".export ${_TOOLCHAIN_METADATA_VARS:C,^,X_,}" >> ${.TARGET} # We must do lib/ and libexec/ before bin/ in case of a mid-install error to @@ -1015,7 +1015,7 @@ _cross-tools: @echo "--------------------------------------------------------------" @echo ">>> stage 3: cross tools" @echo "--------------------------------------------------------------" - @rm -f ${OBJTOP}/compiler-metadata.mk + @rm -f ${OBJTOP}/toolchain-metadata.mk ${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools ${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools _build-metadata: @@ -1023,7 +1023,7 @@ _build-metadata: @echo "--------------------------------------------------------------" @echo ">>> stage 3.1: recording build metadata" @echo "--------------------------------------------------------------" - ${_+_}cd ${.CURDIR}; ${WMAKE} compiler-metadata.mk + ${_+_}cd ${.CURDIR}; ${WMAKE} toolchain-metadata.mk ${_+_}cd ${.CURDIR}; ${WMAKE} host-osreldate.h _includes: @echo From owner-svn-src-all@freebsd.org Thu Jun 21 05:18:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED2A510055E7; Thu, 21 Jun 2018 05:18:08 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9B72089BA4; Thu, 21 Jun 2018 05:18:08 +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 7CE4855F1; Thu, 21 Jun 2018 05:18:08 +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 w5L5I81x059896; Thu, 21 Jun 2018 05:18:08 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L5I87s059895; Thu, 21 Jun 2018 05:18:08 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201806210518.w5L5I87s059895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Thu, 21 Jun 2018 05:18:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r335466 - releng/11.1/sys/x86/xen X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: releng/11.1/sys/x86/xen X-SVN-Commit-Revision: 335466 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 05:18:09 -0000 Author: gordon Date: Thu Jun 21 05:18:08 2018 New Revision: 335466 URL: https://svnweb.freebsd.org/changeset/base/335466 Log: Fix TLB shootdown for Xen based guests. [EN-18:07.pmap] Approved by: so Security: FreeBSD-EN-18:07.pmap Modified: releng/11.1/sys/x86/xen/xen_apic.c Modified: releng/11.1/sys/x86/xen/xen_apic.c ============================================================================== --- releng/11.1/sys/x86/xen/xen_apic.c Thu Jun 21 05:17:13 2018 (r335465) +++ releng/11.1/sys/x86/xen/xen_apic.c Thu Jun 21 05:18:08 2018 (r335466) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -439,6 +440,46 @@ xen_invltlb_pcid(void *arg) invltlb_pcid_handler(); return (FILTER_HANDLED); } + +static int +xen_invltlb_invpcid_pti(void *arg) +{ + + invltlb_invpcid_pti_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_invpcid_handler(void *arg) +{ + + invlpg_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlpg_pcid_handler(void *arg) +{ + + invlpg_pcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_invpcid_handler(void *arg) +{ + + invlrng_invpcid_handler(); + return (FILTER_HANDLED); +} + +static int +xen_invlrng_pcid_handler(void *arg) +{ + + invlrng_pcid_handler(); + return (FILTER_HANDLED); +} #endif static int @@ -529,8 +570,18 @@ xen_setup_cpus(void) #ifdef __amd64__ if (pmap_pcid_enabled) { - xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = invpcid_works ? - xen_invltlb_invpcid : xen_invltlb_pcid; + if (pti) + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid_pti : + xen_invltlb_pcid; + else + xen_ipis[IPI_TO_IDX(IPI_INVLTLB)].filter = + invpcid_works ? xen_invltlb_invpcid : + xen_invltlb_pcid; + xen_ipis[IPI_TO_IDX(IPI_INVLPG)].filter = invpcid_works ? + xen_invlpg_invpcid_handler : xen_invlpg_pcid_handler; + xen_ipis[IPI_TO_IDX(IPI_INVLRNG)].filter = invpcid_works ? + xen_invlrng_invpcid_handler : xen_invlrng_pcid_handler; } #endif CPU_FOREACH(i) From owner-svn-src-all@freebsd.org Thu Jun 21 05:17:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B183100538C; Thu, 21 Jun 2018 05:17: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFC9D89A1D; Thu, 21 Jun 2018 05:17:14 +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 AB2C055F0; Thu, 21 Jun 2018 05:17:14 +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 w5L5HErv059814; Thu, 21 Jun 2018 05:17:14 GMT (envelope-from gordon@FreeBSD.org) Received: (from gordon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L5HDbu059808; Thu, 21 Jun 2018 05:17:13 GMT (envelope-from gordon@FreeBSD.org) Message-Id: <201806210517.w5L5HDbu059808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gordon set sender to gordon@FreeBSD.org using -f From: Gordon Tetlow Date: Thu, 21 Jun 2018 05:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r335465 - in releng/11.1: . sys/amd64/amd64 sys/conf sys/i386/i386 sys/i386/isa X-SVN-Group: releng X-SVN-Commit-Author: gordon X-SVN-Commit-Paths: in releng/11.1: . sys/amd64/amd64 sys/conf sys/i386/i386 sys/i386/isa X-SVN-Commit-Revision: 335465 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 05:17:15 -0000 Author: gordon Date: Thu Jun 21 05:17:13 2018 New Revision: 335465 URL: https://svnweb.freebsd.org/changeset/base/335465 Log: Fix Lazy FPU information disclosure. [SA-18:07.lazyfpu] Bump newvers.sh and UPDATING for today's patches. Approved by: so Security: CVE-2018-3665 Security: FreeBSD-SA-18:07.lazyfpu Sponsored by: The FreeBSD Foundation Modified: releng/11.1/UPDATING releng/11.1/sys/amd64/amd64/cpu_switch.S releng/11.1/sys/amd64/amd64/fpu.c releng/11.1/sys/conf/newvers.sh releng/11.1/sys/i386/i386/swtch.s releng/11.1/sys/i386/isa/npx.c Modified: releng/11.1/UPDATING ============================================================================== --- releng/11.1/UPDATING Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/UPDATING Thu Jun 21 05:17:13 2018 (r335465) @@ -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. +20180621 p11 FreeBSD-SA-18:07.lazyfpu + FreeBSD-EN-18:07.pmap + + Fix Lazy FPU information disclosure. [SA-18:07.lazyfpu] + + Fix TLB shootdown for Xen based guests. [EN-18:07.pmap] + 20180508 p10 FreeBSD-SA-18:06.debugreg FreeBSD-EN-18:05.mem FreeBSD-EN-18:06.tzdata Modified: releng/11.1/sys/amd64/amd64/cpu_switch.S ============================================================================== --- releng/11.1/sys/amd64/amd64/cpu_switch.S Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/sys/amd64/amd64/cpu_switch.S Thu Jun 21 05:17:13 2018 (r335465) @@ -105,10 +105,10 @@ done_store_dr: /* have we used fp, and need a save? */ cmpq %rdi,PCPU(FPCURTHREAD) - jne 3f + jne 2f movq PCB_SAVEFPU(%r8),%r8 clts - cmpl $0,use_xsave + cmpl $0,use_xsave(%rip) jne 1f fxsave (%r8) jmp 2f @@ -120,12 +120,7 @@ ctx_switch_xsave: /* This is patched to xsaveopt if supported, see fpuinit_bsp1() */ xsave (%r8) movq %rcx,%rdx -2: smsw %ax - orb $CR0_TS,%al - lmsw %ax - xorl %eax,%eax - movq %rax,PCPU(FPCURTHREAD) -3: +2: /* Save is done. Now fire up new thread. Leave old vmspace. */ movq %rsi,%r12 movq %rdi,%r13 @@ -212,6 +207,8 @@ done_load_dr: movq PCB_RBX(%r8),%rbx movq PCB_RIP(%r8),%rax movq %rax,(%rsp) + movq PCPU(CURTHREAD),%rdi + call fpu_activate_sw ret /* Modified: releng/11.1/sys/amd64/amd64/fpu.c ============================================================================== --- releng/11.1/sys/amd64/amd64/fpu.c Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/sys/amd64/amd64/fpu.c Thu Jun 21 05:17:13 2018 (r335465) @@ -139,6 +139,11 @@ static void fpu_clean_state(void); SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, SYSCTL_NULL_INT_PTR, 1, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + int use_xsave; /* non-static for cpu_switch.S */ uint64_t xsave_mask; /* the same */ static uma_zone_t fpu_save_area_zone; @@ -204,6 +209,7 @@ fpuinit_bsp1(void) u_int cp[4]; uint64_t xsave_mask_user; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if ((cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); @@ -611,6 +617,45 @@ fputrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } +static void +restore_fpu_curthread(struct thread *td) +{ + struct pcb *pcb; + + /* + * Record new context early in case frstor causes a trap. + */ + PCPU_SET(fpcurthread, td); + + stop_emulating(); + fpu_clean_state(); + pcb = td->td_pcb; + + if ((pcb->pcb_flags & PCB_FPUINITDONE) == 0) { + /* + * This is the first time this thread has used the FPU or + * the PCB doesn't contain a clean FPU state. Explicitly + * load an initial state. + * + * We prefer to restore the state from the actual save + * area in PCB instead of directly loading from + * fpu_initialstate, to ignite the XSAVEOPT + * tracking engine. + */ + bcopy(fpu_initialstate, pcb->pcb_save, + cpu_max_ext_state_size); + fpurestore(pcb->pcb_save); + if (pcb->pcb_initial_fpucw != __INITIAL_FPUCW__) + fldcw(pcb->pcb_initial_fpucw); + if (PCB_USER_FPU(pcb)) + set_pcb_flags(pcb, PCB_FPUINITDONE | + PCB_USERFPUINITDONE); + else + set_pcb_flags(pcb, PCB_FPUINITDONE); + } else + fpurestore(pcb->pcb_save); +} + /* * Device Not Available (DNA, #NM) exception handler. * @@ -621,7 +666,9 @@ fputrap_sse(void) void fpudna(void) { + struct thread *td; + td = curthread; /* * This handler is entered with interrupts enabled, so context * switches may occur before critical_enter() is executed. If @@ -635,49 +682,38 @@ fpudna(void) KASSERT((curpcb->pcb_flags & PCB_FPUNOSAVE) == 0, ("fpudna while in fpu_kern_enter(FPU_KERN_NOCTX)")); - if (PCPU_GET(fpcurthread) == curthread) { - printf("fpudna: fpcurthread == curthread\n"); + if (__predict_false(PCPU_GET(fpcurthread) == td)) { + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ stop_emulating(); - critical_exit(); - return; + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + panic( + "fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_tid, td, td->td_tid); + } + restore_fpu_curthread(td); } - if (PCPU_GET(fpcurthread) != NULL) { - panic("fpudna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), PCPU_GET(fpcurthread)->td_tid, - curthread, curthread->td_tid); - } - stop_emulating(); - /* - * Record new context early in case frstor causes a trap. - */ - PCPU_SET(fpcurthread, curthread); + critical_exit(); +} - fpu_clean_state(); +void fpu_activate_sw(struct thread *td); /* Called from the context switch */ +void +fpu_activate_sw(struct thread *td) +{ - if ((curpcb->pcb_flags & PCB_FPUINITDONE) == 0) { - /* - * This is the first time this thread has used the FPU or - * the PCB doesn't contain a clean FPU state. Explicitly - * load an initial state. - * - * We prefer to restore the state from the actual save - * area in PCB instead of directly loading from - * fpu_initialstate, to ignite the XSAVEOPT - * tracking engine. - */ - bcopy(fpu_initialstate, curpcb->pcb_save, - cpu_max_ext_state_size); - fpurestore(curpcb->pcb_save); - if (curpcb->pcb_initial_fpucw != __INITIAL_FPUCW__) - fldcw(curpcb->pcb_initial_fpucw); - if (PCB_USER_FPU(curpcb)) - set_pcb_flags(curpcb, - PCB_FPUINITDONE | PCB_USERFPUINITDONE); - else - set_pcb_flags(curpcb, PCB_FPUINITDONE); - } else - fpurestore(curpcb->pcb_save); - critical_exit(); + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(td->td_pcb)) { + PCPU_SET(fpcurthread, NULL); + start_emulating(); + } else if (PCPU_GET(fpcurthread) != td) { + restore_fpu_curthread(td); + } } void Modified: releng/11.1/sys/conf/newvers.sh ============================================================================== --- releng/11.1/sys/conf/newvers.sh Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/sys/conf/newvers.sh Thu Jun 21 05:17:13 2018 (r335465) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.1" -BRANCH="RELEASE-p10" +BRANCH="RELEASE-p11" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi Modified: releng/11.1/sys/i386/i386/swtch.s ============================================================================== --- releng/11.1/sys/i386/i386/swtch.s Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/sys/i386/i386/swtch.s Thu Jun 21 05:17:13 2018 (r335465) @@ -293,6 +293,12 @@ sw1: cpu_switch_load_gs: mov PCB_GS(%edx),%gs + pushl %edx + pushl PCPU(CURTHREAD) + call npxswitch + popl %edx + popl %edx + /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%edx) jz 1f Modified: releng/11.1/sys/i386/isa/npx.c ============================================================================== --- releng/11.1/sys/i386/isa/npx.c Thu Jun 21 02:15:50 2018 (r335464) +++ releng/11.1/sys/i386/isa/npx.c Thu Jun 21 05:17:13 2018 (r335465) @@ -191,6 +191,11 @@ int hw_float; SYSCTL_INT(_hw, HW_FLOATINGPT, floatingpoint, CTLFLAG_RD, &hw_float, 0, "Floating point instructions executed in hardware"); +int lazy_fpu_switch = 0; +SYSCTL_INT(_hw, OID_AUTO, lazy_fpu_switch, CTLFLAG_RWTUN | CTLFLAG_NOFETCH, + &lazy_fpu_switch, 0, + "Lazily load FPU context after context switch"); + int use_xsave; uint64_t xsave_mask; static uma_zone_t fpu_save_area_zone; @@ -327,6 +332,7 @@ npxinit_bsp1(void) u_int cp[4]; uint64_t xsave_mask_user; + TUNABLE_INT_FETCH("hw.lazy_fpu_switch", &lazy_fpu_switch); if (cpu_fxsr && (cpu_feature2 & CPUID2_XSAVE) != 0) { use_xsave = 1; TUNABLE_INT_FETCH("hw.use_xsave", &use_xsave); @@ -785,47 +791,20 @@ npxtrap_sse(void) return (fpetable[(mxcsr & (~mxcsr >> 7)) & 0x3f]); } -/* - * Implement device not available (DNA) exception - * - * It would be better to switch FP context here (if curthread != fpcurthread) - * and not necessarily for every context switch, but it is too hard to - * access foreign pcb's. - */ - -static int err_count = 0; - -int -npxdna(void) +static void +restore_npx_curthread(struct thread *td, struct pcb *pcb) { - if (!hw_float) - return (0); - critical_enter(); - if (PCPU_GET(fpcurthread) == curthread) { - printf("npxdna: fpcurthread == curthread %d times\n", - ++err_count); - stop_emulating(); - critical_exit(); - return (1); - } - if (PCPU_GET(fpcurthread) != NULL) { - printf("npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", - PCPU_GET(fpcurthread), - PCPU_GET(fpcurthread)->td_proc->p_pid, - curthread, curthread->td_proc->p_pid); - panic("npxdna"); - } - stop_emulating(); /* * Record new context early in case frstor causes a trap. */ - PCPU_SET(fpcurthread, curthread); + PCPU_SET(fpcurthread, td); + stop_emulating(); if (cpu_fxsr) fpu_clean_state(); - if ((curpcb->pcb_flags & PCB_NPXINITDONE) == 0) { + if ((pcb->pcb_flags & PCB_NPXINITDONE) == 0) { /* * This is the first time this thread has used the FPU or * the PCB doesn't contain a clean FPU state. Explicitly @@ -836,18 +815,54 @@ npxdna(void) * npx_initialstate, to ignite the XSAVEOPT * tracking engine. */ - bcopy(npx_initialstate, curpcb->pcb_save, cpu_max_ext_state_size); - fpurstor(curpcb->pcb_save); - if (curpcb->pcb_initial_npxcw != __INITIAL_NPXCW__) - fldcw(curpcb->pcb_initial_npxcw); - curpcb->pcb_flags |= PCB_NPXINITDONE; - if (PCB_USER_FPU(curpcb)) - curpcb->pcb_flags |= PCB_NPXUSERINITDONE; + bcopy(npx_initialstate, pcb->pcb_save, cpu_max_ext_state_size); + fpurstor(pcb->pcb_save); + if (pcb->pcb_initial_npxcw != __INITIAL_NPXCW__) + fldcw(pcb->pcb_initial_npxcw); + pcb->pcb_flags |= PCB_NPXINITDONE; + if (PCB_USER_FPU(pcb)) + pcb->pcb_flags |= PCB_NPXUSERINITDONE; } else { - fpurstor(curpcb->pcb_save); + fpurstor(pcb->pcb_save); } - critical_exit(); +} +/* + * Implement device not available (DNA) exception + * + * It would be better to switch FP context here (if curthread != fpcurthread) + * and not necessarily for every context switch, but it is too hard to + * access foreign pcb's. + */ +int +npxdna(void) +{ + struct thread *td; + + if (!hw_float) + return (0); + td = curthread; + critical_enter(); + if (__predict_false(PCPU_GET(fpcurthread) == td)) { + /* + * Some virtual machines seems to set %cr0.TS at + * arbitrary moments. Silently clear the TS bit + * regardless of the eager/lazy FPU context switch + * mode. + */ + stop_emulating(); + } else { + if (__predict_false(PCPU_GET(fpcurthread) != NULL)) { + printf( + "npxdna: fpcurthread = %p (%d), curthread = %p (%d)\n", + PCPU_GET(fpcurthread), + PCPU_GET(fpcurthread)->td_proc->p_pid, + td, td->td_proc->p_pid); + panic("npxdna"); + } + restore_npx_curthread(td, td->td_pcb); + } + critical_exit(); return (1); } @@ -869,8 +884,20 @@ npxsave(addr) xsaveopt((char *)addr, xsave_mask); else fpusave(addr); - start_emulating(); - PCPU_SET(fpcurthread, NULL); +} + +void npxswitch(struct thread *td, struct pcb *pcb); +void +npxswitch(struct thread *td, struct pcb *pcb) +{ + + if (lazy_fpu_switch || (td->td_pflags & TDP_KTHREAD) != 0 || + !PCB_USER_FPU(pcb)) { + start_emulating(); + PCPU_SET(fpcurthread, NULL); + } else if (PCPU_GET(fpcurthread) != td) { + restore_npx_curthread(td, pcb); + } } /* From owner-svn-src-all@freebsd.org Thu Jun 21 05:36:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E222410070B9 for ; Thu, 21 Jun 2018 05:36:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yb0-x22c.google.com (mail-yb0-x22c.google.com [IPv6:2607:f8b0:4002:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7DE038AACE for ; Thu, 21 Jun 2018 05:36:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yb0-x22c.google.com with SMTP id q62-v6so749253ybg.5 for ; Wed, 20 Jun 2018 22:36:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mnfYCWFPr/iUpTLu2o0PqcdXSoiF5+srKsapDGijv4k=; b=JLA7fuWSWWLx9Tx8yclNrBhj0/oXVs7g/PsXgunOiMi6YEg535LY6gcjlHQoBzxxHT ZyBGVqWsHnb1Jr8txhNx0H4S94Ge44InshfGnnLj+4rrBKrI8GEt1C5WEWwZVl8GuCOH JOy3LV/TsU79Wgu5UpBXJCjxfZ+3BTR66WNAw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mnfYCWFPr/iUpTLu2o0PqcdXSoiF5+srKsapDGijv4k=; b=dggxIRmOZNRgtWIkZmNKx2ocAWb+3q9Xlyky1Ozd9jO47H/gDevWeOnRwxPlLE8DbY UyDZ5h9b9xXcXL5QsXxEJf/TPV6Lz61pVjR/S+FrRvA5GhYyLxAQwesA4wa/zNzmUZ4A 57aufsOV8nAu4Ut2yMqyXIJUc050CaGgMVZpZGCb4Zv7iaFwBKN6jOLIOhWZb5XeY4y4 GQleftl7AiFpPA7h1WJUeXy4mVqvrEbYbp97lgdTA0Z5uj05UC5NqFqCWjK8oJ6cv1WK n/vywFax9ciRfU9FElSAiIta4j83qz2yNo+MMHTOeumv/xMMdLjDt8XZSjJcqk/PYEOx wm/g== X-Gm-Message-State: APt69E1nr56rY//HwBIEuqLLwncJEu2utCXY5GH72kWPSeFTweO1uoL/ 1mvqDGmrtvcrQvNNWUBJyFjwKbqbi2vDIzrciQipvQ== X-Google-Smtp-Source: ADUXVKJNrROZw/4acg7BsXOuVGZLKN91185oS+2PlT5B1Zq8V0sp7oUIfHMlayCqF5YRS0ntcNaSDrDbJb/gGlqSuOk= X-Received: by 2002:a5b:64c:: with SMTP id o12-v6mr11556727ybq.460.1529559393572; Wed, 20 Jun 2018 22:36:33 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Wed, 20 Jun 2018 22:36:02 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Eitan Adler Date: Wed, 20 Jun 2018 22:36:02 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Stephen J. Kiernan" Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 05:36:35 -0000 On 19 June 2018 at 20:08, Eitan Adler wrote: > On 19 June 2018 at 18:08, Stephen J. Kiernan wrote: >> Added: head/sbin/veriexecctl/Makefile >> ============================================================================== >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> +++ head/sbin/veriexecctl/Makefile Wed Jun 20 01:08:54 2018 (r335402) >> @@ -0,0 +1,11 @@ >> +# $FreeBSD$ >> + >> +PROG= veriexecctl >> +MAN= veriexecctl.8 >> +SRCS= veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c >> + >> +WARNS?= 3 > > Why are we introducing new code with lower-than-6 warnings ? In all the commotion about the more important issues this fell through. Also its argument parsing appears to not be using getopt[_long] ? -- Eitan Adler From owner-svn-src-all@freebsd.org Thu Jun 21 05:28:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B99910063B0; Thu, 21 Jun 2018 05:28:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB26C8A2E9; Thu, 21 Jun 2018 05:28:00 +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 A2FAA5785; Thu, 21 Jun 2018 05:28:00 +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 w5L5S0BR065083; Thu, 21 Jun 2018 05:28:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L5S0fZ065082; Thu, 21 Jun 2018 05:28:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806210528.w5L5S0fZ065082@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Jun 2018 05:28:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335467 - head/tools/build/mk X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/tools/build/mk X-SVN-Commit-Revision: 335467 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 05:28:01 -0000 Author: kevans Date: Thu Jun 21 05:28:00 2018 New Revision: 335467 URL: https://svnweb.freebsd.org/changeset/base/335467 Log: Don't remove loader.conf(5) when built WITHOUT_FORTH The new stand/ structure installs loader.conf(5) and defaults/loader.conf regardless of interpreter. The only thing gating installation now is MK_BOOT. Reported by: eadler Modified: head/tools/build/mk/OptionalObsoleteFiles.inc Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 21 05:18:08 2018 (r335466) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Thu Jun 21 05:28:00 2018 (r335467) @@ -2335,7 +2335,6 @@ OLD_FILES+=usr/share/man/man8/fdcontrol.8.gz .endif .if ${MK_FORTH} == no -OLD_FILES+=usr/share/man/man5/loader.conf.5.gz OLD_FILES+=usr/share/man/man8/beastie.4th.8.gz OLD_FILES+=usr/share/man/man8/brand.4th.8.gz OLD_FILES+=usr/share/man/man8/check-password.4th.8.gz From owner-svn-src-all@freebsd.org Thu Jun 21 06:10:53 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B46D6100AA66; Thu, 21 Jun 2018 06:10:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 651BE8C249; Thu, 21 Jun 2018 06:10:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 471F25E1D; Thu, 21 Jun 2018 06:10:53 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5L6Arg9086375; Thu, 21 Jun 2018 06:10:53 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L6ArWm086374; Thu, 21 Jun 2018 06:10:53 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806210610.w5L6ArWm086374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 21 Jun 2018 06:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335468 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335468 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 06:10:53 -0000 Author: mmacy Date: Thu Jun 21 06:10:52 2018 New Revision: 335468 URL: https://svnweb.freebsd.org/changeset/base/335468 Log: udp_ctlinput: don't refer to unpcb after we drop the lock Reported by: pho@ Modified: head/sys/netinet/udp_usrreq.c Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Thu Jun 21 05:28:00 2018 (r335467) +++ head/sys/netinet/udp_usrreq.c Thu Jun 21 06:10:52 2018 (r335468) @@ -802,14 +802,15 @@ udp_common_ctlinput(int cmd, struct sockaddr *sa, void INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB, NULL); if (inp != NULL) { struct udpcb *up; + void *ctx; + udp_tun_icmp_t func; up = intoudpcb(inp); - if (up->u_icmp_func != NULL) { - INP_RUNLOCK(inp); - (*up->u_icmp_func)(cmd, sa, vip, up->u_tun_ctx); - } else { - INP_RUNLOCK(inp); - } + ctx = up->u_tun_ctx; + func = up->u_icmp_func; + INP_RUNLOCK(inp); + if (func != NULL) + (*func)(cmd, sa, vip, ctx); } } } else From owner-svn-src-all@freebsd.org Thu Jun 21 07:42:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91D1910123D6; Thu, 21 Jun 2018 07:42:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4743270DF6; Thu, 21 Jun 2018 07:42:29 +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 2870E6DD7; Thu, 21 Jun 2018 07:42:29 +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 w5L7gS7v036525; Thu, 21 Jun 2018 07:42:28 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L7gSO1036524; Thu, 21 Jun 2018 07:42:28 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806210742.w5L7gSO1036524@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Thu, 21 Jun 2018 07:42:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335469 - head/usr.bin/systat X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/usr.bin/systat X-SVN-Commit-Revision: 335469 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 07:42:29 -0000 Author: delphij Date: Thu Jun 21 07:42:28 2018 New Revision: 335469 URL: https://svnweb.freebsd.org/changeset/base/335469 Log: Don't leak tmpstr. MFC after: 2 weeks Modified: head/usr.bin/systat/cmds.c Modified: head/usr.bin/systat/cmds.c ============================================================================== --- head/usr.bin/systat/cmds.c Thu Jun 21 06:10:52 2018 (r335468) +++ head/usr.bin/systat/cmds.c Thu Jun 21 07:42:28 2018 (r335469) @@ -61,7 +61,7 @@ command(const char *cmd) if (*cp) *cp++ = '\0'; if (*tmpstr1 == '\0') - return; + goto done; for (; *cp && isspace(*cp); cp++) ; if (strcmp(tmpstr1, "quit") == 0 || strcmp(tmpstr1, "q") == 0) From owner-svn-src-all@freebsd.org Thu Jun 21 08:19:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C6FF91014663; Thu, 21 Jun 2018 08:19:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74D947281B; Thu, 21 Jun 2018 08:19:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5569672D3; Thu, 21 Jun 2018 08:19:12 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5L8JCZ9053153; Thu, 21 Jun 2018 08:19:12 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L8JC03053152; Thu, 21 Jun 2018 08:19:12 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201806210819.w5L8JC03053152@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Thu, 21 Jun 2018 08:19:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335470 - head/share/man/man7 X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: head/share/man/man7 X-SVN-Commit-Revision: 335470 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 08:19:13 -0000 Author: trasz Date: Thu Jun 21 08:19:11 2018 New Revision: 335470 URL: https://svnweb.freebsd.org/changeset/base/335470 Log: "Kernel APIs" is a misnomer; use the proper name instead. Suggested by: kib@, ian@ MFC after: 2 weeks Modified: head/share/man/man7/development.7 Modified: head/share/man/man7/development.7 ============================================================================== --- head/share/man/man7/development.7 Thu Jun 21 07:42:28 2018 (r335469) +++ head/share/man/man7/development.7 Thu Jun 21 08:19:11 2018 (r335470) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 20, 2018 +.Dd June 21, 2018 .Dt DEVELOPMENT 7 .Os .Sh NAME @@ -81,7 +81,8 @@ Build instructions can be found in .Xr build 7 and .Xr release 7 . -Kernel APIs are documented in section 9 manual pages; use +Kernel programming interfaces (KPIs) are documented in section 9 +manual pages; use .Ql "apropos -s 9 ''" for a list. Regression test suite is described in From owner-svn-src-all@freebsd.org Thu Jun 21 08:20:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ACEC8101498C; Thu, 21 Jun 2018 08:20:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1C237729DA; Thu, 21 Jun 2018 08:20:38 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wr0-x242.google.com with SMTP id d2-v6so2151424wrm.10; Thu, 21 Jun 2018 01:20:38 -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:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=DVA5aHZ2srgNUpPWyDsTGxWCE/80v148Oe1oYl43AFc=; b=Rfq+XxaVHQLDvY2/9rTPKK6UyeWxFwqWeOcHaWTpx0JMVSj5JDwsPETmQ1hi6fNaa+ bCGdWRDnwX9pPh2Ou/pRZdpByvgG9A4gRUu+Dg62tBxBGKLevuja7ggob540pWmAIYim XyOVvAfHZ6WYwntUt1Ou3rFeB3GM30uVXJp1IKUk7DRX5OWoJ36tFTHFlN3vwiUrAzOL 76kRxC0A9kWZvlXTA4F303iizZvMzN6uwBN3FYXlIRFTy+LXwniV/2RQwiUcyqGAfqvz MX0QsAFrdNg0iDZfZuS4F35f1UWGO/BmYwJPvnIRgQl0NjhnPJKbN4n1CkP4WniGQuoq iekQ== 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 :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=DVA5aHZ2srgNUpPWyDsTGxWCE/80v148Oe1oYl43AFc=; b=Xlayz5BlTsXQHPAvdsXpI09BUW/UA2S8sZ81QXsxxufLDzmb8zDLjcIhVHr9Mdf9or uXpXDy3okSL2gSEcy/SBUESOKAXrUlwlm5xhcHH/nVSJWd+B3Jm0UdxOmv+r+TEri8uA exqIRGT5wc8oBYQ8S6180/uxBORsy9fUho2easWztN1PpEXBnOB7Ct+BccCF+qp9d8/y 78xEN55zbDsAHMS+PglKgXYdBp8JqsIjdkF7263CoktqrAE52XskegHlbUdwwUrRpP/b zhBruJGG6iLlG83K0uf7T5MPp/+VZLQUXGG5H6Y5xzhXr+H/RxBwVgnp7KGeWXHMRyca Gx1A== X-Gm-Message-State: APt69E2dAB0yABAlRcO/KSYYZPj+dw2n4e2neQMQ2v9PRD4CRC6nQegB 5Wal+fi34QGQcMEBhdr3L+vT5S0L X-Google-Smtp-Source: ADUXVKKmV7i00rqw4dO73jEmgeQuGyYkPTsbnzAYre5JKz7vawlGKLzPNGCf/Cg+Q8/8z1PttbSYOg== X-Received: by 2002:adf:c892:: with SMTP id k18-v6mr5304009wrh.6.1529569236920; Thu, 21 Jun 2018 01:20:36 -0700 (PDT) Received: from brick (cpc92302-cmbg19-2-0-cust461.5-4.cable.virginm.net. [82.1.209.206]) by smtp.gmail.com with ESMTPSA id m145-v6sm4156185wma.19.2018.06.21.01.20.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 01:20:36 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Thu, 21 Jun 2018 09:20:33 +0100 From: Edward Tomasz Napierala To: Ian Lepore Cc: Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335456 - head/share/man/man7 Message-ID: <20180621082033.GA1820@brick> Mail-Followup-To: Ian Lepore , Konstantin Belousov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201806201916.w5KJGpFg048232@repo.freebsd.org> <20180620195407.GS2430@kib.kiev.ua> <1529525332.24573.13.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1529525332.24573.13.camel@freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 08:20:38 -0000 On 0620T1408, Ian Lepore wrote: > On Wed, 2018-06-20 at 22:54 +0300, Konstantin Belousov wrote: > > On Wed, Jun 20, 2018 at 07:16:51PM +0000, Edward Tomasz Napierala wrote: > > > > > > Author: trasz > > > Date: Wed Jun 20 19:16:51 2018 > > > New Revision: 335456 > > > URL: https://svnweb.freebsd.org/changeset/base/335456 > > > > > > Log: > > >   Improve wording. > > >    > > >   MFC after: 2 weeks > > > > > > Modified: > > >   head/share/man/man7/development.7 > > > > > > Modified: head/share/man/man7/development.7 > > > ============================================================================== > > > --- head/share/man/man7/development.7 Wed Jun 20 18:51:38 2018 (r335455) > > > +++ head/share/man/man7/development.7 Wed Jun 20 19:16:51 2018 (r335456) > > > @@ -24,7 +24,7 @@ > > >  .\" > > >  .\" $FreeBSD$ > > >  .\" > > > -.Dd May 11, 2018 > > > +.Dd June 20, 2018 > > >  .Dt DEVELOPMENT 7 > > >  .Os > > >  .Sh NAME > > > @@ -81,7 +81,7 @@ Build instructions can be found in > > >  .Xr build 7 > > >  and > > >  .Xr release 7 . > > > -Kernel APIs are usually documented, use > > > +Kernel APIs are documented in section 9 manual pages; use > > Kernel API is an oxymoron.  Section 9 describes Kernel Programming > > Interfaces, the A from Application is not needed.  We usually abbreviate > > it as KPI. > > This is the manpage a new developer is going to look at, and if you > throw an abbreviation like KPI at them and they search for what it > means, they're going to find "Key Performance Indicator" and nothing > about kernels. This might be a good place to introduce and define that > acronym, maybe something like "Kernel programming interfaces (KPIs) are > documented...". Thank you both, fixed. From owner-svn-src-all@freebsd.org Thu Jun 21 09:41:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EA2C1018570; Thu, 21 Jun 2018 09:41:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 30B0175829; Thu, 21 Jun 2018 09: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 11D6610056; Thu, 21 Jun 2018 09: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 w5L9fiKu098585; Thu, 21 Jun 2018 09:41:44 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L9fiKR098584; Thu, 21 Jun 2018 09:41:44 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806210941.w5L9fiKR098584@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Jun 2018 09:41: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: r335471 - stable/11/sys/dev/acpi_support X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/dev/acpi_support X-SVN-Commit-Revision: 335471 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 09:41:45 -0000 Author: dim Date: Thu Jun 21 09:41:44 2018 New Revision: 335471 URL: https://svnweb.freebsd.org/changeset/base/335471 Log: MFC r335296: Fix build of aibs with base gcc on i386 Add a few intermediate casts to intptr_t to suppress "cast to pointer from integer of different size" warnings from gcc. In this case, the 'arg2' part of SYSCTL_HANDLER_ARGS is used to pass in a pointer, via an intermediate intmax_t, so no information is lost. Reviewed by: avg Differential Revision: https://reviews.freebsd.org/D15725 Modified: stable/11/sys/dev/acpi_support/atk0110.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/acpi_support/atk0110.c ============================================================================== --- stable/11/sys/dev/acpi_support/atk0110.c Thu Jun 21 08:19:11 2018 (r335470) +++ stable/11/sys/dev/acpi_support/atk0110.c Thu Jun 21 09:41:44 2018 (r335471) @@ -453,7 +453,7 @@ static int aibs_sysctl(SYSCTL_HANDLER_ARGS) { struct aibs_softc *sc = arg1; - struct aibs_sensor *sensor = (void *)arg2; + struct aibs_sensor *sensor = (void *)(intptr_t)arg2; int i = oidp->oid_number; ACPI_STATUS rs; ACPI_OBJECT p, *bp; @@ -519,7 +519,7 @@ static int aibs_sysctl_ggrp(SYSCTL_HANDLER_ARGS) { struct aibs_softc *sc = arg1; - struct aibs_sensor *sensor = (void *)arg2; + struct aibs_sensor *sensor = (void *)(intptr_t)arg2; ACPI_STATUS rs; ACPI_OBJECT p, *bp; ACPI_OBJECT_LIST arg; From owner-svn-src-all@freebsd.org Thu Jun 21 09:45:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3895810188E3; Thu, 21 Jun 2018 09:45:04 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDED775AA1; Thu, 21 Jun 2018 09:45:03 +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 BE5F610199; Thu, 21 Jun 2018 09:45:03 +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 w5L9j389099513; Thu, 21 Jun 2018 09:45:03 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5L9j3HK099512; Thu, 21 Jun 2018 09:45:03 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806210945.w5L9j3HK099512@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Thu, 21 Jun 2018 09:45: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: r335472 - stable/11/sys/compat/ndis X-SVN-Group: stable-11 X-SVN-Commit-Author: dim X-SVN-Commit-Paths: stable/11/sys/compat/ndis X-SVN-Commit-Revision: 335472 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 09:45:04 -0000 Author: dim Date: Thu Jun 21 09:45:03 2018 New Revision: 335472 URL: https://svnweb.freebsd.org/changeset/base/335472 Log: MFC r335297: Fix build of ndis with base gcc on i386 Casting from rman_res_t to a pointer results in "cast to pointer from integer of different size" warnings with base gcc on i386, so use an intermediate cast to uintptr_t to suppress it. In this case, the I/O port range is effectively limited to the range of 0..65535. Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D15746 Modified: stable/11/sys/compat/ndis/subr_ndis.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/ndis/subr_ndis.c ============================================================================== --- stable/11/sys/compat/ndis/subr_ndis.c Thu Jun 21 09:41:44 2018 (r335471) +++ stable/11/sys/compat/ndis/subr_ndis.c Thu Jun 21 09:45:03 2018 (r335472) @@ -1285,7 +1285,7 @@ NdisMRegisterIoPortRange(offset, adapter, port, numpor if (rman_get_size(sc->ndis_res_io) < numports) return (NDIS_STATUS_INVALID_LENGTH); - *offset = (void *)rman_get_start(sc->ndis_res_io); + *offset = (void *)(uintptr_t)rman_get_start(sc->ndis_res_io); return (NDIS_STATUS_SUCCESS); } From owner-svn-src-all@freebsd.org Thu Jun 21 10:51:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41F04101A97B; Thu, 21 Jun 2018 10:51:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E729777339; Thu, 21 Jun 2018 10:51:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C864410B64; Thu, 21 Jun 2018 10:51:25 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LApPV3033350; Thu, 21 Jun 2018 10:51:25 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LApP35033349; Thu, 21 Jun 2018 10:51:25 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806211051.w5LApP35033349@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 21 Jun 2018 10:51: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: r335473 - stable/11/sys/netinet/libalias X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netinet/libalias X-SVN-Commit-Revision: 335473 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 10:51:26 -0000 Author: ae Date: Thu Jun 21 10:51:25 2018 New Revision: 335473 URL: https://svnweb.freebsd.org/changeset/base/335473 Log: MFC r335133: In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested. It is better to try allocate a big mbuf, than just silently drop a big packet. A better solution could be reworking of libalias modules to be able use m_copydata()/m_copyback() instead of requiring the single contiguous buffer. PR: 229006 Modified: stable/11/sys/netinet/libalias/alias.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/libalias/alias.c ============================================================================== --- stable/11/sys/netinet/libalias/alias.c Thu Jun 21 09:45:03 2018 (r335472) +++ stable/11/sys/netinet/libalias/alias.c Thu Jun 21 10:51:25 2018 (r335473) @@ -1749,7 +1749,8 @@ LibAliasUnLoadAllModule(void) * the input packet, on failure NULL. The input packet is always consumed. */ struct mbuf * -m_megapullup(struct mbuf *m, int len) { +m_megapullup(struct mbuf *m, int len) +{ struct mbuf *mcl; if (len > m->m_pkthdr.len) @@ -1758,7 +1759,14 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m)) return (m); - mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + if (len <= MJUMPAGESIZE) + mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + else if (len <= MJUM9BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + else if (len <= MJUM16BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); + else + goto bad; if (mcl == NULL) goto bad; m_align(mcl, len); From owner-svn-src-all@freebsd.org Thu Jun 21 11:24:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE580101B46E; Thu, 21 Jun 2018 11:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A10EC781B5; Thu, 21 Jun 2018 11:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7EAFC11193; Thu, 21 Jun 2018 11:24:21 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LBOLA4050492; Thu, 21 Jun 2018 11:24:21 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LBOLhs050491; Thu, 21 Jun 2018 11:24:21 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201806211124.w5LBOLhs050491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 21 Jun 2018 11:24:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335474 - stable/10/sys/netinet/libalias X-SVN-Group: stable-10 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/10/sys/netinet/libalias X-SVN-Commit-Revision: 335474 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 11:24:22 -0000 Author: ae Date: Thu Jun 21 11:24:20 2018 New Revision: 335474 URL: https://svnweb.freebsd.org/changeset/base/335474 Log: MFC r335133: In m_megapullup() use m_getjcl() to allocate 9k or 16k mbuf when requested. It is better to try allocate a big mbuf, than just silently drop a big packet. A better solution could be reworking of libalias modules to be able use m_copydata()/m_copyback() instead of requiring the single contiguous buffer. PR: 229006 Modified: stable/10/sys/netinet/libalias/alias.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/netinet/libalias/alias.c ============================================================================== --- stable/10/sys/netinet/libalias/alias.c Thu Jun 21 10:51:25 2018 (r335473) +++ stable/10/sys/netinet/libalias/alias.c Thu Jun 21 11:24:20 2018 (r335474) @@ -1749,7 +1749,8 @@ LibAliasUnLoadAllModule(void) * the input packet, on failure NULL. The input packet is always consumed. */ struct mbuf * -m_megapullup(struct mbuf *m, int len) { +m_megapullup(struct mbuf *m, int len) +{ struct mbuf *mcl; if (len > m->m_pkthdr.len) @@ -1758,7 +1759,14 @@ m_megapullup(struct mbuf *m, int len) { if (m->m_next == NULL && M_WRITABLE(m)) return (m); - mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + if (len <= MJUMPAGESIZE) + mcl = m_get2(len, M_NOWAIT, MT_DATA, M_PKTHDR); + else if (len <= MJUM9BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM9BYTES); + else if (len <= MJUM16BYTES) + mcl = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES); + else + goto bad; if (mcl == NULL) goto bad; m_align(mcl, len); From owner-svn-src-all@freebsd.org Thu Jun 21 11:43:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78176101BA10; Thu, 21 Jun 2018 11:43:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1172778DC6; Thu, 21 Jun 2018 11:43:55 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1DCE114CE; Thu, 21 Jun 2018 11:43:54 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LBhsas060901; Thu, 21 Jun 2018 11:43:54 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LBhsZT060900; Thu, 21 Jun 2018 11:43:54 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806211143.w5LBhsZT060900@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 21 Jun 2018 11:43:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335475 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335475 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 11:43:55 -0000 Author: br Date: Thu Jun 21 11:43:54 2018 New Revision: 335475 URL: https://svnweb.freebsd.org/changeset/base/335475 Log: Fix uma_zalloc_pcpu_arg() operation in case of !SMP build. Reviewed by: mjg Sponsored by: DARPA, AFRL Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Thu Jun 21 11:24:20 2018 (r335474) +++ head/sys/vm/uma_core.c Thu Jun 21 11:43:54 2018 (r335475) @@ -2234,13 +2234,19 @@ void * uma_zalloc_pcpu_arg(uma_zone_t zone, void *udata, int flags) { void *item; +#ifdef SMP int i; MPASS(zone->uz_flags & UMA_ZONE_PCPU); +#endif item = uma_zalloc_arg(zone, udata, flags &~ M_ZERO); if (item != NULL && (flags & M_ZERO)) { +#ifdef SMP CPU_FOREACH(i) bzero(zpcpu_get_cpu(item, i), zone->uz_size); +#else + bzero(item, zone->uz_size); +#endif } return (item); } From owner-svn-src-all@freebsd.org Thu Jun 21 11:49:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5FAD101BB63; Thu, 21 Jun 2018 11:49:22 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A9317900D; Thu, 21 Jun 2018 11:49:22 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 25F99114D0; Thu, 21 Jun 2018 11:49:22 +0000 (UTC) (envelope-from kibab@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LBnMIE061188; Thu, 21 Jun 2018 11:49:22 GMT (envelope-from kibab@FreeBSD.org) Received: (from kibab@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LBnLl9061185; Thu, 21 Jun 2018 11:49:21 GMT (envelope-from kibab@FreeBSD.org) Message-Id: <201806211149.w5LBnLl9061185@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kibab set sender to kibab@FreeBSD.org using -f From: Ilya Bakulin Date: Thu, 21 Jun 2018 11:49:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335476 - in head/sys: arm/allwinner conf X-SVN-Group: head X-SVN-Commit-Author: kibab X-SVN-Commit-Paths: in head/sys: arm/allwinner conf X-SVN-Commit-Revision: 335476 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 11:49:23 -0000 Author: kibab Date: Thu Jun 21 11:49:21 2018 New Revision: 335476 URL: https://svnweb.freebsd.org/changeset/base/335476 Log: Add MMCCAM support to AllWinner MMC driver Using MMCCAM on AllWinner boards is now possible, reaching highest possible data transfer speed. For now, MMCCAM doesn't scan cards on boot. This means that scanning has to be done manually and that it's not possible to mount root FS from MMC/SD card since there is no block device at the boot time. For manually scanning the cards, run: # camcontrol rescan X:0:0 Where X is the bus number (look at camcontrol devlist to determine bus number assigned to the MMC controller). Reviewed by: manu Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15891 Modified: head/sys/arm/allwinner/aw_mmc.c head/sys/arm/allwinner/files.allwinner head/sys/conf/files.arm64 Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Thu Jun 21 11:43:54 2018 (r335475) +++ head/sys/arm/allwinner/aw_mmc.c Thu Jun 21 11:49:21 2018 (r335476) @@ -55,6 +55,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include "opt_mmccam.h" + +#ifdef MMCCAM +#include +#include +#include +#include +#include +#endif + #define AW_MMC_MEMRES 0 #define AW_MMC_IRQRES 1 #define AW_MMC_RESSZ 2 @@ -112,7 +122,14 @@ struct aw_mmc_softc { int aw_timeout; struct callout aw_timeoutc; struct mmc_host aw_host; +#ifdef MMCCAM + union ccb * ccb; + struct cam_devq * devq; + struct cam_sim * sim; + struct mtx sim_mtx; +#else struct mmc_request * aw_req; +#endif struct mtx aw_mtx; struct resource * aw_res[AW_MMC_RESSZ]; struct aw_mmc_conf * aw_mmc_conf; @@ -148,11 +165,19 @@ static int aw_mmc_init(struct aw_mmc_softc *); static void aw_mmc_intr(void *); static int aw_mmc_update_clock(struct aw_mmc_softc *, uint32_t); +static void aw_mmc_print_error(uint32_t); static int aw_mmc_update_ios(device_t, device_t); static int aw_mmc_request(device_t, device_t, struct mmc_request *); static int aw_mmc_get_ro(device_t, device_t); static int aw_mmc_acquire_host(device_t, device_t); static int aw_mmc_release_host(device_t, device_t); +#ifdef MMCCAM +static void aw_mmc_cam_action(struct cam_sim *, union ccb *); +static void aw_mmc_cam_poll(struct cam_sim *); +static int aw_mmc_cam_settran_settings(struct aw_mmc_softc *, union ccb *); +static int aw_mmc_cam_request(struct aw_mmc_softc *, union ccb *); +static void aw_mmc_cam_handle_mmcio(struct cam_sim *, union ccb *); +#endif #define AW_MMC_LOCK(_sc) mtx_lock(&(_sc)->aw_mtx) #define AW_MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->aw_mtx) @@ -161,7 +186,201 @@ static int aw_mmc_release_host(device_t, device_t); #define AW_MMC_WRITE_4(_sc, _reg, _value) \ bus_write_4((_sc)->aw_res[AW_MMC_MEMRES], _reg, _value) +#ifdef MMCCAM +static void +aw_mmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) +{ + struct aw_mmc_softc *sc; + + sc = cam_sim_softc(sim); + + aw_mmc_cam_request(sc, ccb); +} + +static void +aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) +{ + struct aw_mmc_softc *sc; + + sc = cam_sim_softc(sim); + if (sc == NULL) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + return; + } + + mtx_assert(&sc->sim_mtx, MA_OWNED); + + switch (ccb->ccb_h.func_code) { + case XPT_PATH_INQ: + { + struct ccb_pathinq *cpi; + + cpi = &ccb->cpi; + cpi->version_num = 1; + cpi->hba_inquiry = 0; + cpi->target_sprt = 0; + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; + cpi->hba_eng_cnt = 0; + cpi->max_target = 0; + cpi->max_lun = 0; + cpi->initiator_id = 1; + cpi->maxio = (sc->aw_mmc_conf->dma_xferlen * + AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); + strncpy(cpi->hba_vid, "Deglitch Networks", HBA_IDLEN); + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); + cpi->unit_number = cam_sim_unit(sim); + cpi->bus_id = cam_sim_bus(sim); + cpi->protocol = PROTO_MMCSD; + cpi->protocol_version = SCSI_REV_0; + cpi->transport = XPORT_MMCSD; + cpi->transport_version = 1; + + cpi->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_GET_TRAN_SETTINGS: + { + struct ccb_trans_settings *cts = &ccb->cts; + + if (bootverbose) + device_printf(sc->aw_dev, "Got XPT_GET_TRAN_SETTINGS\n"); + + cts->protocol = PROTO_MMCSD; + cts->protocol_version = 1; + cts->transport = XPORT_MMCSD; + cts->transport_version = 1; + cts->xport_specific.valid = 0; + cts->proto_specific.mmc.host_ocr = sc->aw_host.host_ocr; + cts->proto_specific.mmc.host_f_min = sc->aw_host.f_min; + cts->proto_specific.mmc.host_f_max = sc->aw_host.f_max; + cts->proto_specific.mmc.host_caps = sc->aw_host.caps; + memcpy(&cts->proto_specific.mmc.ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_SET_TRAN_SETTINGS: + { + if (bootverbose) + device_printf(sc->aw_dev, "Got XPT_SET_TRAN_SETTINGS\n"); + aw_mmc_cam_settran_settings(sc, ccb); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + } + case XPT_RESET_BUS: + if (bootverbose) + device_printf(sc->aw_dev, "Got XPT_RESET_BUS, ACK it...\n"); + ccb->ccb_h.status = CAM_REQ_CMP; + break; + case XPT_MMC_IO: + /* + * Here is the HW-dependent part of + * sending the command to the underlying h/w + * At some point in the future an interrupt comes. + * Then the request will be marked as completed. + */ + ccb->ccb_h.status = CAM_REQ_INPROG; + + aw_mmc_cam_handle_mmcio(sim, ccb); + return; + /* NOTREACHED */ + break; + default: + ccb->ccb_h.status = CAM_REQ_INVALID; + break; + } + xpt_done(ccb); + return; +} + +static void +aw_mmc_cam_poll(struct cam_sim *sim) +{ + return; +} + static int +aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) +{ + struct mmc_ios *ios; + struct mmc_ios *new_ios; + struct ccb_trans_settings_mmc *cts; + + ios = &sc->aw_host.ios; + + cts = &ccb->cts.proto_specific.mmc; + new_ios = &cts->ios; + + /* Update only requested fields */ + if (cts->ios_valid & MMC_CLK) { + ios->clock = new_ios->clock; + device_printf(sc->aw_dev, "Clock => %d\n", ios->clock); + } + if (cts->ios_valid & MMC_VDD) { + ios->vdd = new_ios->vdd; + device_printf(sc->aw_dev, "VDD => %d\n", ios->vdd); + } + if (cts->ios_valid & MMC_CS) { + ios->chip_select = new_ios->chip_select; + device_printf(sc->aw_dev, "CS => %d\n", ios->chip_select); + } + if (cts->ios_valid & MMC_BW) { + ios->bus_width = new_ios->bus_width; + device_printf(sc->aw_dev, "Bus width => %d\n", ios->bus_width); + } + if (cts->ios_valid & MMC_PM) { + ios->power_mode = new_ios->power_mode; + device_printf(sc->aw_dev, "Power mode => %d\n", ios->power_mode); + } + if (cts->ios_valid & MMC_BT) { + ios->timing = new_ios->timing; + device_printf(sc->aw_dev, "Timing => %d\n", ios->timing); + } + if (cts->ios_valid & MMC_BM) { + ios->bus_mode = new_ios->bus_mode; + device_printf(sc->aw_dev, "Bus mode => %d\n", ios->bus_mode); + } + + return (aw_mmc_update_ios(sc->aw_dev, NULL)); +} + +static int +aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb *ccb) +{ + struct ccb_mmcio *mmcio; + + mmcio = &ccb->mmcio; + + AW_MMC_LOCK(sc); + +#ifdef DEBUG + if (__predict_false(bootverbose)) { + device_printf(sc->aw_dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", + mmcio->cmd.opcode, mmcio->cmd.arg, mmcio->cmd.flags, + mmcio->cmd.data != NULL ? (unsigned int) mmcio->cmd.data->len : 0, + mmcio->cmd.data != NULL ? mmcio->cmd.data->flags: 0); + } +#endif + if (mmcio->cmd.data != NULL) { + if (mmcio->cmd.data->len == 0 || mmcio->cmd.data->flags == 0) + panic("data->len = %d, data->flags = %d -- something is b0rked", + (int)mmcio->cmd.data->len, mmcio->cmd.data->flags); + } + if (sc->ccb != NULL) { + device_printf(sc->aw_dev, "Controller still has an active command\n"); + return (EBUSY); + } + sc->ccb = ccb; + /* aw_mmc_request locks again */ + AW_MMC_UNLOCK(sc); + aw_mmc_request(sc->aw_dev, NULL, NULL); + + return (0); +} +#endif /* MMCCAM */ + +static int aw_mmc_probe(device_t dev) { @@ -192,7 +411,9 @@ aw_mmc_attach(device_t dev) sc->aw_mmc_conf = (struct aw_mmc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; +#ifndef MMCCAM sc->aw_req = NULL; +#endif if (bus_alloc_resources(dev, aw_mmc_res_spec, sc->aw_res) != 0) { device_printf(dev, "cannot allocate device resources\n"); return (ENXIO); @@ -295,6 +516,35 @@ aw_mmc_attach(device_t dev) if (bus_width >= 8) sc->aw_host.caps |= MMC_CAP_8_BIT_DATA; +#ifdef MMCCAM + child = NULL; /* Not used by MMCCAM, need to silence compiler warnings */ + sc->ccb = NULL; + if ((sc->devq = cam_simq_alloc(1)) == NULL) { + goto fail; + } + + mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); + sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, + "aw_mmc_sim", sc, device_get_unit(dev), + &sc->sim_mtx, 1, 1, sc->devq); + + if (sc->sim == NULL) { + cam_simq_free(sc->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + goto fail; + } + + mtx_lock(&sc->sim_mtx); + if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { + device_printf(dev, "cannot register SCSI pass-through bus\n"); + cam_sim_free(sc->sim, FALSE); + cam_simq_free(sc->devq); + mtx_unlock(&sc->sim_mtx); + goto fail; + } + + mtx_unlock(&sc->sim_mtx); +#else /* !MMCCAM */ child = device_add_child(dev, "mmc", -1); if (child == NULL) { device_printf(dev, "attaching MMC bus failed!\n"); @@ -305,7 +555,7 @@ aw_mmc_attach(device_t dev) device_delete_child(dev, child); goto fail; } - +#endif /* MMCCAM */ return (0); fail: @@ -314,6 +564,17 @@ fail: bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); +#ifdef MMCCAM + if (sc->sim != NULL) { + mtx_lock(&sc->sim_mtx); + xpt_bus_deregister(cam_sim_path(sc->sim)); + cam_sim_free(sc->sim, FALSE); + mtx_unlock(&sc->sim_mtx); + } + + if (sc->devq != NULL) + cam_simq_free(sc->devq); +#endif return (ENXIO); } @@ -437,7 +698,11 @@ aw_mmc_prepare_dma(struct aw_mmc_softc *sc) struct mmc_command *cmd; uint32_t val; +#ifdef MMCCAM + cmd = &sc->ccb->mmcio.cmd; +#else cmd = sc->aw_req->cmd; +#endif if (cmd->data->len > (sc->aw_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS)) return (EFBIG); error = bus_dmamap_load(sc->aw_dma_buf_tag, sc->aw_dma_buf_map, @@ -549,11 +814,25 @@ static void aw_mmc_req_done(struct aw_mmc_softc *sc) { struct mmc_command *cmd; +#ifdef MMCCAM + union ccb *ccb; +#else struct mmc_request *req; +#endif uint32_t val, mask; int retry; +#ifdef MMCCAM + ccb = sc->ccb; + cmd = &ccb->mmcio.cmd; +#else cmd = sc->aw_req->cmd; +#endif +#ifdef DEBUG + if (bootverbose) { + device_printf(sc->aw_dev, "%s: cmd %d err %d\n", __func__, cmd->opcode, cmd->error); + } +#endif if (cmd->error != MMC_ERR_NONE) { /* Reset the FIFO and DMA engines. */ mask = AW_MMC_GCTL_FIFO_RST | AW_MMC_GCTL_DMA_RST; @@ -573,14 +852,21 @@ aw_mmc_req_done(struct aw_mmc_softc *sc) aw_mmc_update_clock(sc, 1); } - req = sc->aw_req; callout_stop(&sc->aw_timeoutc); - sc->aw_req = NULL; sc->aw_intr = 0; sc->aw_resid = 0; sc->aw_dma_map_err = 0; sc->aw_intr_wait = 0; +#ifdef MMCCAM + sc->ccb = NULL; + ccb->ccb_h.status = + (ccb->mmcio.cmd.error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); + xpt_done(ccb); +#else + req = sc->aw_req; + sc->aw_req = NULL; req->done(req); +#endif } static void @@ -597,7 +883,11 @@ aw_mmc_req_ok(struct aw_mmc_softc *sc) break; DELAY(1000); } +#ifdef MMCCAM + cmd = &sc->ccb->mmcio.cmd; +#else cmd = sc->aw_req->cmd; +#endif if (timeout == 0) { cmd->error = MMC_ERR_FAILED; aw_mmc_req_done(sc); @@ -618,15 +908,30 @@ aw_mmc_req_ok(struct aw_mmc_softc *sc) aw_mmc_req_done(sc); } + +static inline void +set_mmc_error(struct aw_mmc_softc *sc, int error_code) +{ +#ifdef MMCCAM + sc->ccb->mmcio.cmd.error = error_code; +#else + sc->aw_req->cmd->error = error_code; +#endif +} + static void aw_mmc_timeout(void *arg) { struct aw_mmc_softc *sc; sc = (struct aw_mmc_softc *)arg; +#ifdef MMCCAM + if (sc->ccb != NULL) { +#else if (sc->aw_req != NULL) { +#endif device_printf(sc->aw_dev, "controller timeout\n"); - sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; + set_mmc_error(sc, MMC_ERR_TIMEOUT); aw_mmc_req_done(sc); } else device_printf(sc->aw_dev, @@ -634,6 +939,28 @@ aw_mmc_timeout(void *arg) } static void +aw_mmc_print_error(uint32_t err) +{ + if(err & AW_MMC_INT_RESP_ERR) + printf("AW_MMC_INT_RESP_ERR "); + if (err & AW_MMC_INT_RESP_CRC_ERR) + printf("AW_MMC_INT_RESP_CRC_ERR "); + if (err & AW_MMC_INT_DATA_CRC_ERR) + printf("AW_MMC_INT_DATA_CRC_ERR "); + if (err & AW_MMC_INT_RESP_TIMEOUT) + printf("AW_MMC_INT_RESP_TIMEOUT "); + if (err & AW_MMC_INT_FIFO_RUN_ERR) + printf("AW_MMC_INT_FIFO_RUN_ERR "); + if (err & AW_MMC_INT_CMD_BUSY) + printf("AW_MMC_INT_CMD_BUSY "); + if (err & AW_MMC_INT_DATA_START_ERR) + printf("AW_MMC_INT_DATA_START_ERR "); + if (err & AW_MMC_INT_DATA_END_BIT_ERR) + printf("AW_MMC_INT_DATA_END_BIT_ERR"); + printf("\n"); +} + +static void aw_mmc_intr(void *arg) { bus_dmasync_op_t sync_op; @@ -654,31 +981,41 @@ aw_mmc_intr(void *arg) device_printf(sc->aw_dev, "idst: %#x, imask: %#x, rint: %#x\n", idst, imask, rint); #endif +#ifdef MMCCAM + if (sc->ccb == NULL) { +#else if (sc->aw_req == NULL) { +#endif device_printf(sc->aw_dev, "Spurious interrupt - no active request, rint: 0x%08X\n", rint); + aw_mmc_print_error(rint); goto end; } if (rint & AW_MMC_INT_ERR_BIT) { if (bootverbose) device_printf(sc->aw_dev, "error rint: 0x%08X\n", rint); + aw_mmc_print_error(rint); if (rint & AW_MMC_INT_RESP_TIMEOUT) - sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; + set_mmc_error(sc, MMC_ERR_TIMEOUT); else - sc->aw_req->cmd->error = MMC_ERR_FAILED; + set_mmc_error(sc, MMC_ERR_FAILED); aw_mmc_req_done(sc); goto end; } if (idst & AW_MMC_IDST_ERROR) { device_printf(sc->aw_dev, "error idst: 0x%08x\n", idst); - sc->aw_req->cmd->error = MMC_ERR_FAILED; + set_mmc_error(sc, MMC_ERR_FAILED); aw_mmc_req_done(sc); goto end; } sc->aw_intr |= rint; +#ifdef MMCCAM + data = sc->ccb->mmcio.cmd.data; +#else data = sc->aw_req->cmd->data; +#endif if (data != NULL && (idst & AW_MMC_IDST_COMPLETE) != 0) { if (data->flags & MMC_DATA_WRITE) sync_op = BUS_DMASYNC_POSTWRITE; @@ -712,13 +1049,29 @@ aw_mmc_request(device_t bus, device_t child, struct mm sc = device_get_softc(bus); AW_MMC_LOCK(sc); +#ifdef MMCCAM + KASSERT(req == NULL, ("req should be NULL in MMCCAM case!")); + /* + * For MMCCAM, sc->ccb has been NULL-checked and populated + * by aw_mmc_cam_request() already. + */ + cmd = &sc->ccb->mmcio.cmd; +#else if (sc->aw_req) { AW_MMC_UNLOCK(sc); return (EBUSY); } - sc->aw_req = req; cmd = req->cmd; + +#ifdef DEBUG + if (bootverbose) + device_printf(sc->aw_dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", + cmd->opcode, cmd->arg, cmd->flags, + cmd->data != NULL ? (unsigned int)cmd->data->len : 0, + cmd->data != NULL ? cmd->data->flags: 0); +#endif +#endif cmdreg = AW_MMC_CMDR_LOAD; imask = AW_MMC_INT_ERR_BIT; sc->aw_intr_wait = 0; @@ -1163,4 +1516,6 @@ static driver_t aw_mmc_driver = { DRIVER_MODULE(aw_mmc, simplebus, aw_mmc_driver, aw_mmc_devclass, NULL, NULL); +#ifndef MMCCAM MMC_DECLARE_BRIDGE(aw_mmc); +#endif Modified: head/sys/arm/allwinner/files.allwinner ============================================================================== --- head/sys/arm/allwinner/files.allwinner Thu Jun 21 11:43:54 2018 (r335475) +++ head/sys/arm/allwinner/files.allwinner Thu Jun 21 11:49:21 2018 (r335476) @@ -10,7 +10,7 @@ arm/allwinner/a10_sramc.c standard arm/allwinner/aw_gpio.c optional gpio arm/allwinner/aw_if_dwc.c optional dwc arm/allwinner/aw_machdep.c standard -arm/allwinner/aw_mmc.c optional mmc +arm/allwinner/aw_mmc.c optional mmc | mmccam arm/allwinner/aw_mp.c optional smp arm/allwinner/aw_nmi.c optional intrng arm/allwinner/aw_rsb.c optional rsb | p2wi Modified: head/sys/conf/files.arm64 ============================================================================== --- head/sys/conf/files.arm64 Thu Jun 21 11:43:54 2018 (r335475) +++ head/sys/conf/files.arm64 Thu Jun 21 11:49:21 2018 (r335476) @@ -27,7 +27,7 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ # Allwinner common files arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt -arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt +arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt arm/allwinner/aw_nmi.c optional aw_nmi fdt \ compile-with "${NORMAL_C} -I$S/gnu/dts/include" arm/allwinner/aw_rsb.c optional aw_rsb fdt From owner-svn-src-all@freebsd.org Thu Jun 21 11:52:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2D4FA101BDC9; Thu, 21 Jun 2018 11:52:10 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D35DD792CF; Thu, 21 Jun 2018 11:52:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B62BA11550; Thu, 21 Jun 2018 11:52:09 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LBq9CF065741; Thu, 21 Jun 2018 11:52:09 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LBq9n2065740; Thu, 21 Jun 2018 11:52:09 GMT (envelope-from br@FreeBSD.org) Message-Id: <201806211152.w5LBq9n2065740@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Thu, 21 Jun 2018 11:52:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335477 - head/sys/riscv/riscv X-SVN-Group: head X-SVN-Commit-Author: br X-SVN-Commit-Paths: head/sys/riscv/riscv X-SVN-Commit-Revision: 335477 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 11:52:10 -0000 Author: br Date: Thu Jun 21 11:52:09 2018 New Revision: 335477 URL: https://svnweb.freebsd.org/changeset/base/335477 Log: PLIC driver was sponsored by ECATS contract, not CTSRD one. Modified: head/sys/riscv/riscv/plic.c Modified: head/sys/riscv/riscv/plic.c ============================================================================== --- head/sys/riscv/riscv/plic.c Thu Jun 21 11:49:21 2018 (r335476) +++ head/sys/riscv/riscv/plic.c Thu Jun 21 11:52:09 2018 (r335477) @@ -5,8 +5,9 @@ * All rights reserved. * * This software was developed by SRI International and the University of - * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 - * ("CTSRD"), as part of the DARPA CRASH research programme. + * Cambridge Computer Laboratory (Department of Computer Science and + * Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the + * DARPA SSITH research programme. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions From owner-svn-src-all@freebsd.org Thu Jun 21 12:41:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8342C101DB5D for ; Thu, 21 Jun 2018 12:41:32 +0000 (UTC) (envelope-from pdk@semihalf.com) Received: from mail-it0-x242.google.com (mail-it0-x242.google.com [IPv6:2607:f8b0:4001:c0b::242]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20F3B7AF92 for ; Thu, 21 Jun 2018 12:41:32 +0000 (UTC) (envelope-from pdk@semihalf.com) Received: by mail-it0-x242.google.com with SMTP id 16-v6so4402940itl.5 for ; Thu, 21 Jun 2018 05:41:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=A751eqDvkARweRnS9KPxRxBZDczWWn97DkTRHC5qYas=; b=U07uagzkbweJLPymSyJiX4eFJzqsRHkeUlxIAMBgb52/6LhauWgZaBwNGeVlMJ/FqD c+rSzWpxzT5stD/K3D7xFJsPxzQ8U+vK84aOQ0z2ZGMn3qPJVBgVdAdNq0Z8C0uV1CZy BQ4TLN01ecMdMVhW3L/XEQFx0Tz6/3ld3Ygyv+ztasmvh8ZiwbuLQQebm9BMnixyXL1e NuKxAMvyP56GcxXoVUjC6Sjws0XvU1Y7oXpgfDmcDFOcL9RAVFUhLTMwsoKQ+4WYca6I +rifAbOJgvTYlpJHnuvMbQkicKi9sGihYDIHeAJ9ufWeeZw6gymeWqODEZH4UfYdJQj9 fHfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=A751eqDvkARweRnS9KPxRxBZDczWWn97DkTRHC5qYas=; b=EIMGdMXX0Sa3jnoaMvhvzyY+RZ7NvWo1loQCfvx1e6bg/GCOJgQa0/r/+vcyAhAqWc vu0ClUZoHLPxbWPQwLqkitgbUu8N4J5Hjr5z6iEvR8YcMvkQKch0RcuIYXZbFPREUTMn hBZuYzghIfJlKlP3UOnyPBKKfViMEKAQi0dGMEYnBOFNse3R79V58b97Whxiu3XdUeOV yCqlNXV5nnTi6oDB0tjtjVLQcWFdgK/Ow5QxbNG9H/cTFaFl2MPI1uTKYQFj6ra3P17j b6L93+DdZL6zSkgTnYQjHJUR9XORgAixG+w7YeicnnI6ea9+6pjdlBjuoFOZKH7Zp8sB fmUQ== X-Gm-Message-State: APt69E2sJXVRm3koO0TINvEtUfhU8JDzNgI+5DiLZ3vOjfpPo7s60gn9 GLapUZNxB5gEnxFuuUhaRGpna4c68Z9kPgvIzUoo4hpVEz0= X-Google-Smtp-Source: ADUXVKLy+hk3Oad1p6p+zHXdHyqLCtl3a9M0UEFIOaY275hK/pjb/exaKAl5OSNrGCS3mDUFiQ0uuB0cbwwdfWQNfMU= X-Received: by 2002:a02:2341:: with SMTP id u62-v6mr20790296jau.62.1529584891440; Thu, 21 Jun 2018 05:41:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:1545:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 05:41:30 -0700 (PDT) In-Reply-To: <201805291352.w4TDqPur045848@repo.freebsd.org> References: <201805291352.w4TDqPur045848@repo.freebsd.org> From: Patryk Duda Date: Thu, 21 Jun 2018 14:41:30 +0200 Message-ID: Subject: Re: svn commit: r334329 - head/sys/arm64/arm64 To: Andrew Turner Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 12:41:32 -0000 Hi, I'm trying to boot kernel on ThunderX2 but I've got following error: panic: efi_init: PA out of range, PA: 0xfafd0018 This error comes from PHYS_TO_DMAP macro. I can workaround this issue by disabling EFI Runtime Services in kernel config but it seems to be a problem with discontignous DMAP mapping. 2018-05-29 15:52 GMT+02:00 Andrew Turner : > Author: andrew > Date: Tue May 29 13:52:25 2018 > New Revision: 334329 > URL: https://svnweb.freebsd.org/changeset/base/334329 > > Log: > On ThunderX2 we need to be careful to only map the memory the firmware > lists in the EFI memory map. As such we need to reduce the mappings to > restrict them to not be the full 1G block. For now reduce this to a 2M > block, however this may be further restricted to be 4k page aligned as > other SoCs may require. > > This allows ThunderX2 to boot reliably to userspace without performing > any speculative memory accesses to invalid physical memory. > > This is a recommit of r334035 now that we can access the EFI Runtime data > through the DMAP region. > > Tested by: tuexen > Sponsored by: DARPA, AFRL > > Modified: > head/sys/arm64/arm64/pmap.c > > Modified: head/sys/arm64/arm64/pmap.c > ============================================================================== > --- head/sys/arm64/arm64/pmap.c Tue May 29 13:43:16 2018 (r334328) > +++ head/sys/arm64/arm64/pmap.c Tue May 29 13:52:25 2018 (r334329) > @@ -590,33 +590,100 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va) > return ((l2[l2_slot] & ~ATTR_MASK) + (va & L2_OFFSET)); > } > > -static void > -pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t min_pa, vm_paddr_t max_pa) > +static vm_offset_t > +pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t min_pa, > + vm_offset_t freemempos) > { > + pt_entry_t *l2; > vm_offset_t va; > - vm_paddr_t pa; > - u_int l1_slot; > + vm_paddr_t l2_pa, pa; > + u_int l1_slot, l2_slot, prev_l1_slot; > int i; > > dmap_phys_base = min_pa & ~L1_OFFSET; > dmap_phys_max = 0; > dmap_max_addr = 0; > + l2 = NULL; > + prev_l1_slot = -1; > > +#define DMAP_TABLES ((DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS) >> L0_SHIFT) > + memset(pagetable_dmap, 0, PAGE_SIZE * DMAP_TABLES); > + > for (i = 0; i < (physmap_idx * 2); i += 2) { > - pa = physmap[i] & ~L1_OFFSET; > + pa = physmap[i] & ~L2_OFFSET; > va = pa - dmap_phys_base + DMAP_MIN_ADDRESS; > > - for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1]; > + /* Create L2 mappings at the start of the region */ > + if ((pa & L1_OFFSET) != 0) { > + l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); > + if (l1_slot != prev_l1_slot) { > + prev_l1_slot = l1_slot; > + l2 = (pt_entry_t *)freemempos; > + l2_pa = pmap_early_vtophys(kern_l1, > + (vm_offset_t)l2); > + freemempos += PAGE_SIZE; > + > + pmap_load_store(&pagetable_dmap[l1_slot], > + (l2_pa & ~Ln_TABLE_MASK) | L1_TABLE); > + > + memset(l2, 0, PAGE_SIZE); > + } > + KASSERT(l2 != NULL, > + ("pmap_bootstrap_dmap: NULL l2 map")); > + for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1]; > + pa += L2_SIZE, va += L2_SIZE) { > + /* > + * We are on a boundary, stop to > + * create a level 1 block > + */ > + if ((pa & L1_OFFSET) == 0) > + break; > + > + l2_slot = pmap_l2_index(va); > + KASSERT(l2_slot != 0, ("...")); > + pmap_load_store(&l2[l2_slot], > + (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | > + ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); > + } > + KASSERT(va == (pa - dmap_phys_base + DMAP_MIN_ADDRESS), > + ("...")); > + } > + > + for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1] && > + (physmap[i + 1] - pa) >= L1_SIZE; > pa += L1_SIZE, va += L1_SIZE) { > l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); > - /* We already have an entry */ > - if (pagetable_dmap[l1_slot] != 0) > - continue; > pmap_load_store(&pagetable_dmap[l1_slot], > (pa & ~L1_OFFSET) | ATTR_DEFAULT | ATTR_XN | > ATTR_IDX(CACHED_MEMORY) | L1_BLOCK); > } > > + /* Create L2 mappings at the end of the region */ > + if (pa < physmap[i + 1]) { > + l1_slot = ((va - DMAP_MIN_ADDRESS) >> L1_SHIFT); > + if (l1_slot != prev_l1_slot) { > + prev_l1_slot = l1_slot; > + l2 = (pt_entry_t *)freemempos; > + l2_pa = pmap_early_vtophys(kern_l1, > + (vm_offset_t)l2); > + freemempos += PAGE_SIZE; > + > + pmap_load_store(&pagetable_dmap[l1_slot], > + (l2_pa & ~Ln_TABLE_MASK) | L1_TABLE); > + > + memset(l2, 0, PAGE_SIZE); > + } > + KASSERT(l2 != NULL, > + ("pmap_bootstrap_dmap: NULL l2 map")); > + for (; va < DMAP_MAX_ADDRESS && pa < physmap[i + 1]; > + pa += L2_SIZE, va += L2_SIZE) { > + l2_slot = pmap_l2_index(va); > + pmap_load_store(&l2[l2_slot], > + (pa & ~L2_OFFSET) | ATTR_DEFAULT | ATTR_XN | > + ATTR_IDX(CACHED_MEMORY) | L2_BLOCK); > + } > + } > + > if (pa > dmap_phys_max) { > dmap_phys_max = pa; > dmap_max_addr = va; > @@ -624,6 +691,8 @@ pmap_bootstrap_dmap(vm_offset_t kern_l1, vm_paddr_t mi > } > > cpu_tlb_flushID(); > + > + return (freemempos); > } > > static vm_offset_t > @@ -729,8 +798,11 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ > max_pa = physmap[i + 1]; > } > > + freemempos = KERNBASE + kernlen; > + freemempos = roundup2(freemempos, PAGE_SIZE); > + > /* Create a direct map region early so we can use it for pa -> va */ > - pmap_bootstrap_dmap(l1pt, min_pa, max_pa); > + freemempos = pmap_bootstrap_dmap(l1pt, min_pa, freemempos); > > va = KERNBASE; > start_pa = pa = KERNBASE - kern_delta; > @@ -762,8 +834,6 @@ pmap_bootstrap(vm_offset_t l0pt, vm_offset_t l1pt, vm_ > > va = roundup2(va, L1_SIZE); > > - freemempos = KERNBASE + kernlen; > - freemempos = roundup2(freemempos, PAGE_SIZE); > /* Create the l2 tables up to VM_MAX_KERNEL_ADDRESS */ > freemempos = pmap_bootstrap_l2(l1pt, va, freemempos); > /* And the l3 tables for the early devmap */ > _______________________________________________ > svn-src-all@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-all > To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" From owner-svn-src-all@freebsd.org Thu Jun 21 13:26:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1BFF101F054; Thu, 21 Jun 2018 13:26:32 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2B1C97C883; Thu, 21 Jun 2018 13:26:31 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5LDQSaf079523; Thu, 21 Jun 2018 06:26:28 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5LDQSUx079522; Thu, 21 Jun 2018 06:26:28 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806211326.w5LDQSUx079522@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335454 - head/usr.bin/ar In-Reply-To: To: Ed Maste Date: Thu, 21 Jun 2018 06:26:28 -0700 (PDT) CC: "Rodney W. Grimes" , Pedro Giffuni , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 13:26:32 -0000 > On 20 June 2018 at 20:48, Rodney W. Grimes > wrote: > > > > My claim still stands, the commit message and reality do not match, > > Ed claimed that he was switching to 2-clause FreeBSD license, yet > > it does not appear to actually do that. > > The commit message could have been more clear indeed. Thanks for acknowledging that. > > > Does SPDX have rules for dual tagging a file? I seem to recall that > > there was some way to do that at least. > > It does (using license1 AND/OR license2), but in this case one of the > licenses is a subset of the other. I think it would be best to indicate that both exist in the SPDX tag so that decisions can be made about this rather bad situation of licenses. Though it may be a subset it is still unclear as to exactly what this means, or how to apply them seperatly. Technically the 2 clause "authors" are above the 3 clause license in the file, does that mean that clause 3 applies to them too? I do not believe that was the original intent, but that is the literal fact. Use of above and below in the license is probably bad legal form and should have an absolute reference rather than an ambibous relative reference. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 21 14:04:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C761D101FE42; Thu, 21 Jun 2018 14:04:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7CE547DD33; Thu, 21 Jun 2018 14:04:03 +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 5E05E12B57; Thu, 21 Jun 2018 14:04:03 +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 w5LE438g032149; Thu, 21 Jun 2018 14:04:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LE43eX032148; Thu, 21 Jun 2018 14:04:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806211404.w5LE43eX032148@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Jun 2018 14:04:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335479 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335479 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:04:04 -0000 Author: kevans Date: Thu Jun 21 14:04:02 2018 New Revision: 335479 URL: https://svnweb.freebsd.org/changeset/base/335479 Log: subr_hints: simplify a little bit Some complexity exists in these bits that isn't needed. The sysctl handler, upon change to '2', runs through the current set of hints and sets them in the kenv. However, this isn't at all necessary if we're pulling hints from the kenv, static or dynamic, as the former will get added to the latter in init_dynamic_kenv (see: kern_environment.c). We can reduce this configuration to just adding static_hints to the kenv if we were previously using them. The changes in res_find are minimal and based on the observation that once use_kenv gets set to '1' it will never be reset to '0', and it gets set to '1' as soon as we hit fallback mode. Later work will refactor res_find a little bit and eliminate this now-local, because it's become clear that there's some funkiness revolving around use_kenv=1 and it being used to imply that we're certainly looking at the dynamic_kenv. Reviewed by: ray MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D15940 Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jun 21 13:14:52 2018 (r335478) +++ head/sys/kern/subr_hints.c Thu Jun 21 14:04:02 2018 (r335479) @@ -37,12 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +#define HINTMODE_KENV 0 +#define HINTMODE_STATIC 1 +#define HINTMODE_FALLBACK 2 + /* * Access functions for device resources. */ static int checkmethod = 1; -static int use_kenv; static char *hintp; /* @@ -56,10 +59,8 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) { const char *cp; char *line, *eq; - int eqidx, error, from_kenv, i, value; + int eqidx, error, i, value; - from_kenv = 0; - cp = kern_envp; value = hintmode; /* Fetch candidate for new hintmode value */ @@ -67,47 +68,33 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) if (error || req->newptr == NULL) return (error); - if (value != 2) + if (value != HINTMODE_FALLBACK) /* Only accept swithing to hintmode 2 */ return (EINVAL); - /* Migrate from static to dynamic hints */ - switch (hintmode) { - case 0: - if (dynamic_kenv) { - /* - * Already here. But assign hintmode to 2, to not - * check it in the future. - */ - hintmode = 2; - return (0); - } - from_kenv = 1; - cp = kern_envp; - break; - case 1: - cp = static_hints; - break; - case 2: - /* Nothing to do, hintmode already 2 */ + /* + * The rest of the sysctl handler is just making sure that our + * environment is consistent with the world we've already seen. + * If we came from kenv at all, then we have nothing to do: static + * kenv will get merged into dynamic kenv as soon as kmem becomes + * available, dynamic kenv is the environment we'd be setting these + * things in anyways. Therefore, we have nothing left to do unless + * we came from a static hints configuration. + */ + if (hintmode != HINTMODE_STATIC) { + hintmode = value; return (0); } - while (cp) { - i = strlen(cp); - if (i == 0) - break; - if (from_kenv) { - if (strncmp(cp, "hint.", 5) != 0) - /* kenv can have not only hints */ - continue; - } + cp = static_hints; + while (cp && *cp != '\0') { eq = strchr(cp, '='); if (eq == NULL) /* Bad hint value */ continue; eqidx = eq - cp; + i = strlen(cp); line = malloc(i+1, M_TEMP, M_WAITOK); strcpy(line, cp); line[eqidx] = '\0'; @@ -117,7 +104,6 @@ sysctl_hintmode(SYSCTL_HANDLER_ARGS) } hintmode = value; - use_kenv = 1; return (0); } @@ -137,7 +123,7 @@ res_find(int *line, int *startln, { int n = 0, hit, i = 0; char r_name[32]; - int r_unit; + int r_unit, use_kenv = (hintmode == HINTMODE_FALLBACK); char r_resname[32]; char r_value[128]; const char *s, *cp; @@ -147,13 +133,13 @@ res_find(int *line, int *startln, hintp = NULL; switch (hintmode) { - case 0: /* loader hints in environment only */ + case HINTMODE_KENV: /* loader hints in environment only */ break; - case 1: /* static hints only */ + case HINTMODE_STATIC: /* static hints only */ hintp = static_hints; checkmethod = 0; break; - case 2: /* fallback mode */ + case HINTMODE_FALLBACK: /* fallback mode */ if (dynamic_kenv) { mtx_lock(&kenv_lock); cp = kenvp[0]; From owner-svn-src-all@freebsd.org Thu Jun 21 14:21:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53919102052C; Thu, 21 Jun 2018 14:21:12 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F23A37E76B; Thu, 21 Jun 2018 14:21:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D389912E37; Thu, 21 Jun 2018 14:21:11 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LELBIk039733; Thu, 21 Jun 2018 14:21:11 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LELBGS039732; Thu, 21 Jun 2018 14:21:11 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806211421.w5LELBGS039732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 21 Jun 2018 14:21:11 +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: r335480 - stable/11/share/examples X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/share/examples X-SVN-Commit-Revision: 335480 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:21:12 -0000 Author: dteske Date: Thu Jun 21 14:21:11 2018 New Revision: 335480 URL: https://svnweb.freebsd.org/changeset/base/335480 Log: MFC r330886: Install files added in SVN's r295373, r295457, r295542 Reported by: woodsb02 Sponsored by: Smule, Inc. Modified: stable/11/share/examples/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/examples/Makefile ============================================================================== --- stable/11/share/examples/Makefile Thu Jun 21 14:04:02 2018 (r335479) +++ stable/11/share/examples/Makefile Thu Jun 21 14:21:11 2018 (r335480) @@ -76,6 +76,12 @@ XFILES= BSD_daemon/FreeBSD.pfa \ indent/indent.pro \ ipfw/change_rules.sh \ jails/README \ + jails/VIMAGE \ + jails/jail.xxx.conf \ + jails/jib \ + jails/jng \ + jails/rc.conf.jails \ + jails/rcjail.xxx.conf \ kld/Makefile \ kld/cdev/Makefile \ kld/cdev/README \ From owner-svn-src-all@freebsd.org Thu Jun 21 14:26:44 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8A0601020884; Thu, 21 Jun 2018 14:26:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 35C4F7EAC4; Thu, 21 Jun 2018 14:26:44 +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 1553F12E9F; Thu, 21 Jun 2018 14:26:44 +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 w5LEQhUx042235; Thu, 21 Jun 2018 14:26:43 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LEQhO6042232; Thu, 21 Jun 2018 14:26:43 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806211426.w5LEQhO6042232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 21 Jun 2018 14:26:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335481 - in head/sys: kern powerpc/cpufreq sys X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: kern powerpc/cpufreq sys X-SVN-Commit-Revision: 335481 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:26:44 -0000 Author: jhibbits Date: Thu Jun 21 14:26:43 2018 New Revision: 335481 URL: https://svnweb.freebsd.org/changeset/base/335481 Log: Introduce PMCR-based cpufreq(4) driver, for IBM POWER8 and POWER9 systems Summary: POWER8 and POWER9 use a single CPU register, per core, to change clock speed. Everything else is handled by the on-chip controller. This change necessitates a change to the cpufreq global kernel driver to bump supported levels, as the device tree for these systems can have theoretically 256 different options. On my POWER9 Talos, the list consists of 100 items. At 16.67MHz intervals, that allows for a change of roughly 1.67GHz between lowest and highest. This has only been tested on the POWER9. However, since they're similar, this should work on POWER8 as well. Reviewed By: nwhitehorn Differential Revision: https://reviews.freebsd.org/D15932 Added: head/sys/powerpc/cpufreq/pmcr.c (contents, props changed) Modified: head/sys/kern/kern_cpu.c head/sys/sys/cpu.h Modified: head/sys/kern/kern_cpu.c ============================================================================== --- head/sys/kern/kern_cpu.c Thu Jun 21 14:21:11 2018 (r335480) +++ head/sys/kern/kern_cpu.c Thu Jun 21 14:26:43 2018 (r335481) @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); * Number of levels we can handle. Levels are synthesized from settings * so for M settings and N drivers, there may be M*N levels. */ -#define CF_MAX_LEVELS 64 +#define CF_MAX_LEVELS 256 struct cf_saved_freq { struct cf_level level; Added: head/sys/powerpc/cpufreq/pmcr.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/powerpc/cpufreq/pmcr.c Thu Jun 21 14:26:43 2018 (r335481) @@ -0,0 +1,248 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 Justin Hibbits + * + * 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 "cpufreq_if.h" + +static int pstate_ids[256]; +static int pstate_freqs[256]; +static int npstates; + +static void parse_pstates(void) +{ + phandle_t node; + + node = OF_finddevice("/ibm,opal/power-mgt"); + + /* If this fails, npstates will remain 0, and any attachment will bail. */ + if (node == -1) + return; + + npstates = OF_getencprop(node, "ibm,pstate-ids", pstate_ids, + sizeof(pstate_ids)); + if (npstates < 0) { + npstates = 0; + return; + } + + if (OF_getencprop(node, "ibm,pstate-frequencies-mhz", pstate_freqs, + sizeof(pstate_freqs)) != npstates) { + npstates = 0; + return; + } + npstates /= sizeof(cell_t); + +} + +/* Make this a sysinit so it runs before the cpufreq driver attaches. */ +SYSINIT(parse_pstates, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, parse_pstates, NULL); + +#define PMCR_UPPERPS_MASK 0xff00000000000000UL +#define PMCR_UPPERPS_SHIFT 56 +#define PMCR_LOWERPS_MASK 0x00ff000000000000UL +#define PMCR_LOWERPS_SHIFT 48 +#define PMCR_VERSION_MASK 0x0000000f +#define PMCR_VERSION_1 1 + +struct pmcr_softc { + device_t dev; +}; + +static void pmcr_identify(driver_t *driver, device_t parent); +static int pmcr_probe(device_t dev); +static int pmcr_attach(device_t dev); +static int pmcr_settings(device_t dev, struct cf_setting *sets, int *count); +static int pmcr_set(device_t dev, const struct cf_setting *set); +static int pmcr_get(device_t dev, struct cf_setting *set); +static int pmcr_type(device_t dev, int *type); + +static device_method_t pmcr_methods[] = { + /* Device interface */ + DEVMETHOD(device_identify, pmcr_identify), + DEVMETHOD(device_probe, pmcr_probe), + DEVMETHOD(device_attach, pmcr_attach), + + /* cpufreq interface */ + DEVMETHOD(cpufreq_drv_set, pmcr_set), + DEVMETHOD(cpufreq_drv_get, pmcr_get), + DEVMETHOD(cpufreq_drv_type, pmcr_type), + DEVMETHOD(cpufreq_drv_settings, pmcr_settings), + + {0, 0} +}; + +static driver_t pmcr_driver = { + "pmcr", + pmcr_methods, + sizeof(struct pmcr_softc) +}; + +static devclass_t pmcr_devclass; +DRIVER_MODULE(pmcr, cpu, pmcr_driver, pmcr_devclass, 0, 0); + +static void +pmcr_identify(driver_t *driver, device_t parent) +{ + + /* Make sure we're not being doubly invoked. */ + if (device_find_child(parent, "pmcr", -1) != NULL) + return; + + /* + * We attach a child for every CPU since settings need to + * be performed on every CPU in the SMP case. + */ + if (BUS_ADD_CHILD(parent, 10, "pmcr", -1) == NULL) + device_printf(parent, "add pmcr child failed\n"); +} + +static int +pmcr_probe(device_t dev) +{ + if (resource_disabled("pmcr", 0)) + return (ENXIO); + + if (npstates == 0) + return (ENXIO); + + device_set_desc(dev, "Power Management Control Register"); + return (0); +} + +static int +pmcr_attach(device_t dev) +{ + struct pmcr_softc *sc; + + sc = device_get_softc(dev); + sc->dev = dev; + + cpufreq_register(dev); + return (0); +} + +static int +pmcr_settings(device_t dev, struct cf_setting *sets, int *count) +{ + struct pmcr_softc *sc; + int i; + + sc = device_get_softc(dev); + if (sets == NULL || count == NULL) + return (EINVAL); + if (*count < npstates) + return (E2BIG); + + /* Return a list of valid settings for this driver. */ + memset(sets, CPUFREQ_VAL_UNKNOWN, sizeof(*sets) * npstates); + + for (i = 0; i < npstates; i++) { + sets[i].freq = pstate_freqs[i]; + sets[i].spec[0] = pstate_ids[i]; + sets[i].dev = dev; + } + *count = npstates; + + return (0); +} + +static int +pmcr_set(device_t dev, const struct cf_setting *set) +{ + register_t pmcr; + + if (set == NULL) + return (EINVAL); + + if (set->spec[0] < 0 || set->spec[0] > npstates) + return (EINVAL); + + pmcr = ((long)pstate_ids[set->spec[0]] << PMCR_LOWERPS_SHIFT) & + PMCR_LOWERPS_MASK; + pmcr |= ((long)pstate_ids[set->spec[0]] << PMCR_UPPERPS_SHIFT) & + PMCR_UPPERPS_MASK + pmcr |= PMCR_VERSION_1; + + mtspr(SPR_PMCR, pmcr); + powerpc_sync(); isync(); + + return (0); +} + +static int +pmcr_get(device_t dev, struct cf_setting *set) +{ + struct pmcr_softc *sc; + register_t pmcr; + int i, pstate; + + if (set == NULL) + return (EINVAL); + sc = device_get_softc(dev); + + memset(set, CPUFREQ_VAL_UNKNOWN, sizeof(*set)); + + pmcr = mfspr(SPR_PMCR); + + pstate = (pmcr & PMCR_LOWERPS_MASK) >> PMCR_LOWERPS_SHIFT; + + for (i = 0; i < npstates && pstate_ids[i] != pstate; i++) + ; + + if (i == npstates) + return (EINVAL); + + set->spec[0] = pstate; + set->freq = pstate_freqs[i]; + + set->dev = dev; + + return (0); +} + +static int +pmcr_type(device_t dev, int *type) +{ + + if (type == NULL) + return (EINVAL); + + *type = CPUFREQ_TYPE_ABSOLUTE; + return (0); +} + Modified: head/sys/sys/cpu.h ============================================================================== --- head/sys/sys/cpu.h Thu Jun 21 14:21:11 2018 (r335480) +++ head/sys/sys/cpu.h Thu Jun 21 14:26:43 2018 (r335481) @@ -87,7 +87,7 @@ struct cf_setting { }; /* Maximum number of settings a given driver can have. */ -#define MAX_SETTINGS 24 +#define MAX_SETTINGS 256 /* A combination of settings is a level. */ struct cf_level { From owner-svn-src-all@freebsd.org Thu Jun 21 14:28:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255FA1020936; Thu, 21 Jun 2018 14:28:21 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA0567F15F; Thu, 21 Jun 2018 14:28: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 AB11112EA3; Thu, 21 Jun 2018 14:28: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 w5LESKfQ042347; Thu, 21 Jun 2018 14:28:20 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LESKkp042345; Thu, 21 Jun 2018 14:28:20 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806211428.w5LESKkp042345@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Thu, 21 Jun 2018 14:28:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335482 - in head: . usr.bin usr.bin/elfcopy usr.bin/objcopy X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: in head: . usr.bin usr.bin/elfcopy usr.bin/objcopy X-SVN-Commit-Revision: 335482 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:28:21 -0000 Author: emaste Date: Thu Jun 21 14:28:20 2018 New Revision: 335482 URL: https://svnweb.freebsd.org/changeset/base/335482 Log: Rename usr.bin/elfcopy to usr.bin/objcopy We always install ELF Tool Chain's elfcopy as objcopy, so to avoid confusion rename the src directory containing our reach-over Makefile to match. Requested by: jhb Sponsored by: The FreeBSD Foundation Added: head/usr.bin/objcopy/ - copied from r335481, head/usr.bin/elfcopy/ Deleted: head/usr.bin/elfcopy/ Modified: head/Makefile.inc1 head/usr.bin/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Thu Jun 21 14:26:43 2018 (r335481) +++ head/Makefile.inc1 Thu Jun 21 14:28:20 2018 (r335482) @@ -2182,7 +2182,7 @@ _binutils= gnu/usr.bin/binutils .if ${MK_ELFTOOLCHAIN_BOOTSTRAP} != "no" _elftctools= lib/libelftc \ lib/libpe \ - usr.bin/elfcopy \ + usr.bin/objcopy \ usr.bin/nm \ usr.bin/size \ usr.bin/strings @@ -2195,7 +2195,7 @@ _elftctools+= usr.bin/addr2line # the target (for at least crunchide). _elftctools= lib/libelftc \ lib/libpe \ - usr.bin/elfcopy + usr.bin/objcopy .endif .if ${MK_CLANG_BOOTSTRAP} != "no" @@ -2280,7 +2280,7 @@ NXBDIRS+= \ usr.bin/cmp \ usr.bin/diff \ usr.bin/dirname \ - usr.bin/elfcopy \ + usr.bin/objcopy \ usr.bin/env \ usr.bin/fetch \ usr.bin/find \ Modified: head/usr.bin/Makefile ============================================================================== --- head/usr.bin/Makefile Thu Jun 21 14:26:43 2018 (r335481) +++ head/usr.bin/Makefile Thu Jun 21 14:28:20 2018 (r335482) @@ -264,7 +264,7 @@ SUBDIR.${MK_TOOLCHAIN}+= c89 SUBDIR.${MK_TOOLCHAIN}+= c99 SUBDIR.${MK_TOOLCHAIN}+= ctags SUBDIR.${MK_TOOLCHAIN}+= cxxfilt -SUBDIR.${MK_TOOLCHAIN}+= elfcopy +SUBDIR.${MK_TOOLCHAIN}+= objcopy SUBDIR.${MK_TOOLCHAIN}+= file2c # ARM64TODO gprof does not build # RISCVTODO gprof does not build From owner-svn-src-all@freebsd.org Thu Jun 21 14:30:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 350D51020A16; Thu, 21 Jun 2018 14:30:15 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D53327F2F4; Thu, 21 Jun 2018 14:30:14 +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 B4CBE12EAC; Thu, 21 Jun 2018 14:30:14 +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 w5LEUEdZ042496; Thu, 21 Jun 2018 14:30:14 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LEUEVf042494; Thu, 21 Jun 2018 14:30:14 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806211430.w5LEUEVf042494@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 21 Jun 2018 14:30:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335483 - in head/sys: conf powerpc/include X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: in head/sys: conf powerpc/include X-SVN-Commit-Revision: 335483 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:30:15 -0000 Author: jhibbits Date: Thu Jun 21 14:30:14 2018 New Revision: 335483 URL: https://svnweb.freebsd.org/changeset/base/335483 Log: Add the rest of the files for r335481 Missed hooking PMCR cpufreq(4) to the build, and adding the SPR to the header. Modified: head/sys/conf/files.powerpc head/sys/powerpc/include/spr.h Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Thu Jun 21 14:28:20 2018 (r335482) +++ head/sys/conf/files.powerpc Thu Jun 21 14:30:14 2018 (r335483) @@ -121,6 +121,7 @@ powerpc/booke/spe.c optional powerpcspe powerpc/cpufreq/dfs.c optional cpufreq powerpc/cpufreq/mpc85xx_jog.c optional cpufreq mpc85xx powerpc/cpufreq/pcr.c optional cpufreq aim +powerpc/cpufreq/pmcr.c optional cpufreq aim powerpc64 powerpc/cpufreq/pmufreq.c optional cpufreq aim pmu powerpc/fpu/fpu_add.c optional fpu_emu powerpc/fpu/fpu_compare.c optional fpu_emu Modified: head/sys/powerpc/include/spr.h ============================================================================== --- head/sys/powerpc/include/spr.h Thu Jun 21 14:28:20 2018 (r335482) +++ head/sys/powerpc/include/spr.h Thu Jun 21 14:30:14 2018 (r335483) @@ -384,6 +384,7 @@ #define SPR_MD_RAM0 0x339 /* ..8 IMMU RAM entry read reg 0 */ #define SPR_MD_RAM1 0x33a /* ..8 IMMU RAM entry read reg 1 */ #define SPR_PSSCR 0x357 /* Processor Stop Status and Control Register (ISA 3.0) */ +#define SPR_PMCR 0x374 /* Processor Management Control Register */ #define SPR_UMMCR2 0x3a0 /* .6. User Monitor Mode Control Register 2 */ #define SPR_UMMCR0 0x3a8 /* .6. User Monitor Mode Control Register 0 */ #define SPR_USIA 0x3ab /* .6. User Sampled Instruction Address */ From owner-svn-src-all@freebsd.org Thu Jun 21 14:41:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33ED71020E77; Thu, 21 Jun 2018 14:41:59 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DAFD17F8FD; Thu, 21 Jun 2018 14:41:58 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B1A2131B1; Thu, 21 Jun 2018 14:41:58 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LEfwTG050958; Thu, 21 Jun 2018 14:41:58 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LEfwg8050957; Thu, 21 Jun 2018 14:41:58 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806211441.w5LEfwg8050957@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 21 Jun 2018 14:41: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: r335484 - stable/11/usr.sbin/bsdconfig/share X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/bsdconfig/share X-SVN-Commit-Revision: 335484 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:41:59 -0000 Author: dteske Date: Thu Jun 21 14:41:58 2018 New Revision: 335484 URL: https://svnweb.freebsd.org/changeset/base/335484 Log: MFC r335280-r335281, r335302: sysrc.subr updates r335280: Fix handling of files with missing newline at EOF r335302: Fix a comment for accuracy PR: bin/203435 Reported by: Andreas Sommer r335281: Fix display when value is "-n" PR: bin/226406 Reported by: Marius Halden Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/bsdconfig/share/sysrc.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/share/sysrc.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/share/sysrc.subr Thu Jun 21 14:30:14 2018 (r335483) +++ stable/11/usr.sbin/bsdconfig/share/sysrc.subr Thu Jun 21 14:41:58 2018 (r335484) @@ -200,7 +200,7 @@ f_sysrc_get() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) } @@ -338,7 +338,7 @@ f_sysrc_get_default() # such as "${varname?}" and "${varname:?}" (see "Parameter # Expansion" in sh(1) for more information). # - eval echo '"${'"$1"'}"' 2> /dev/null + eval printf "'%s\\n'" '"${'"$1"'}"' 2> /dev/null ) } @@ -556,9 +556,16 @@ f_sysrc_set() fi # - # If not found, append new value to last file and return. + # If not found, append new value to first file and return. # if [ "$not_found" ]; then + # Add a newline if missing before appending to the file + awk 'BEGIN { wc = 0 } NR == 1 { + (cmd = "wc -l " FILENAME) | getline + close(cmd) + wc = $1 + } END { exit wc != NR }' "$file" || + echo >> "$file" || return $? echo "$varname=\"$new_value\"" >> "$file" return $? fi @@ -606,8 +613,11 @@ f_sysrc_set() # # Operate on the matching file, replacing only the last occurrence. # + # Use awk to ensure LF at end of each line, else files without ending + # LF will trigger a bug in `tail -r' where last two lines are joined. + # local new_contents retval - new_contents=$( tail -r $file 2> /dev/null ) + new_contents=$( awk 1 "$file" 2> /dev/null | tail -r ) new_contents=$( echo "$new_contents" | awk -v varname="$varname" \ -v new_value="$new_value" "$f_sysrc_set_awk" ) retval=$? From owner-svn-src-all@freebsd.org Thu Jun 21 14:55:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 66814102135C; Thu, 21 Jun 2018 14:55:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 130C5801B1; Thu, 21 Jun 2018 14:55:27 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E846C133AA; Thu, 21 Jun 2018 14:55:26 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LEtQoA057614; Thu, 21 Jun 2018 14:55:26 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LEtQn7057613; Thu, 21 Jun 2018 14:55:26 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806211455.w5LEtQn7057613@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 21 Jun 2018 14:55: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: r335485 - stable/11/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/bsdconfig/usermgmt/share X-SVN-Commit-Revision: 335485 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:55:27 -0000 Author: dteske Date: Thu Jun 21 14:55:26 2018 New Revision: 335485 URL: https://svnweb.freebsd.org/changeset/base/335485 Log: MFC r335308: bsdconfig: Fix a bug when editing users The usermgmt API was stomping on a global ($user_gid to be specific) so things would appear to work fine until you tried to make a second pass into the API with the now-tainted variable contents. Fixed by localizing menu-specific contents as to not leak outside API. PR: bin/208774 Reported by: Martin Waschbuesch Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 14:41:58 2018 (r335484) +++ stable/11/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 14:55:26 2018 (r335485) @@ -1020,13 +1020,6 @@ f_dialog_menu_user_add() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1038,6 +1031,14 @@ f_dialog_menu_user_add() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_add/$msg_exit' '1' '$msg_login: $_user_name' @@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_delete/$msg_exit' '1' '$msg_login: $_user_name' @@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit() local _user_$var eval f_shell_escape \"\$user_$var\" _user_$var done + + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi menu_list=" 'X' '$msg_save/$msg_exit' From owner-svn-src-all@freebsd.org Thu Jun 21 14:59:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA5D1102148E; Thu, 21 Jun 2018 14:59:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5BB2E80463; Thu, 21 Jun 2018 14:59:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3DFA9133BC; Thu, 21 Jun 2018 14:59:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LExOYW057926; Thu, 21 Jun 2018 14:59:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LExNr4057925; Thu, 21 Jun 2018 14:59:23 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806211459.w5LExNr4057925@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 21 Jun 2018 14:59:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335486 - head/sys/conf X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/conf X-SVN-Commit-Revision: 335486 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 14:59:24 -0000 Author: ian Date: Thu Jun 21 14:59:23 2018 New Revision: 335486 URL: https://svnweb.freebsd.org/changeset/base/335486 Log: Add a note about using option VERBOSE_SYSINIT=0 to get the verbose code compiled in but disabled by default. Modified: head/sys/conf/NOTES Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jun 21 14:55:26 2018 (r335485) +++ head/sys/conf/NOTES Thu Jun 21 14:59:23 2018 (r335486) @@ -2861,7 +2861,9 @@ options IFMEDIA_DEBUG # enable debugging in net/if_me # # Make the SYSINIT process performed by mi_startup() verbose. This is very # useful when porting to a new architecture. If DDB is also enabled, this -# will print function names instead of addresses. +# will print function names instead of addresses. If defined with a value +# of zero, the verbose code is compiled-in but disabled by default, and can +# be enabled with the debug.verbose_sysinit=1 tunable. options VERBOSE_SYSINIT ##################################################################### From owner-svn-src-all@freebsd.org Thu Jun 21 15:02:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB25210216CE; Thu, 21 Jun 2018 15:02:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 648C780895; Thu, 21 Jun 2018 15:02:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 46EB113550; Thu, 21 Jun 2018 15:02:18 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LF2IlD062623; Thu, 21 Jun 2018 15:02:18 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LF2IjT062622; Thu, 21 Jun 2018 15:02:18 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806211502.w5LF2IjT062622@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 21 Jun 2018 15:02:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335487 - stable/10/usr.sbin/bsdconfig/usermgmt/share X-SVN-Group: stable-10 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/10/usr.sbin/bsdconfig/usermgmt/share X-SVN-Commit-Revision: 335487 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 15:02:19 -0000 Author: dteske Date: Thu Jun 21 15:02:17 2018 New Revision: 335487 URL: https://svnweb.freebsd.org/changeset/base/335487 Log: MFC r335308: bsdconfig: Fix a bug when editing users The usermgmt API was stomping on a global ($user_gid to be specific) so things would appear to work fine until you tried to make a second pass into the API with the now-tainted variable contents. Fixed by localizing menu-specific contents as to not leak outside API. PR: bin/208774 Reported by: Martin Waschbuesch Sponsored by: Smule, Inc. Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Directory Properties: stable/10/ (props changed) Modified: stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr ============================================================================== --- stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 14:59:23 2018 (r335486) +++ stable/10/usr.sbin/bsdconfig/usermgmt/share/user_input.subr Thu Jun 21 15:02:17 2018 (r335487) @@ -1020,13 +1020,6 @@ f_dialog_menu_user_add() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1038,6 +1031,14 @@ f_dialog_menu_user_add() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_add/$msg_exit' '1' '$msg_login: $_user_name' @@ -1137,13 +1138,6 @@ f_dialog_menu_user_delete() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1155,6 +1149,14 @@ f_dialog_menu_user_delete() eval f_shell_escape \"\$user_$var\" _user_$var done + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi + menu_list=" 'X' '$msg_delete/$msg_exit' '1' '$msg_login: $_user_name' @@ -1254,13 +1256,6 @@ f_dialog_menu_user_edit() user_password_expires_on="$user_password_expire" fi - # Attempt to translate a numeric GID into `number (name)' - if f_isinteger "$user_gid"; then - local user_group - user_group=$( pw groupshow -g "$user_gid" 2> /dev/null ) && - user_gid="$user_gid (${user_group%%:*})" - fi - # Localize potentially hostile variables and escape their values # to the local variable (see f_shell_escape() of `strings.subr') local var @@ -1271,6 +1266,14 @@ f_dialog_menu_user_edit() local _user_$var eval f_shell_escape \"\$user_$var\" _user_$var done + + # Attempt to translate a numeric GID into `number (name)' + if f_isinteger "$_user_gid"; then + local _user_group + _user_group=$( pw groupshow -g "$_user_gid" 2> /dev/null ) && + _user_group="${_user_group%%:*}" && + f_shell_escape "$_user_gid ($_user_group)" _user_gid + fi menu_list=" 'X' '$msg_save/$msg_exit' From owner-svn-src-all@freebsd.org Thu Jun 21 15:11:15 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E83731021A38; Thu, 21 Jun 2018 15:11:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9D24E80BB3; Thu, 21 Jun 2018 15:11:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7F1AD135A2; Thu, 21 Jun 2018 15:11:14 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LFBEcM064795; Thu, 21 Jun 2018 15:11:14 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LFBEoa064794; Thu, 21 Jun 2018 15:11:14 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <201806211511.w5LFBEoa064794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Thu, 21 Jun 2018 15:11:14 +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: r335488 - stable/11/usr.sbin/bsdconfig X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/bsdconfig X-SVN-Commit-Revision: 335488 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 15:11:15 -0000 Author: dteske Date: Thu Jun 21 15:11:14 2018 New Revision: 335488 URL: https://svnweb.freebsd.org/changeset/base/335488 Log: MFC r335306: bsdconfig: Make examples optional PR: bin/228485 Submitted by: Dmitry Wagin Reported by: Dmitry Wagin Sponsored by: Smule, Inc. Modified: stable/11/usr.sbin/bsdconfig/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/Makefile ============================================================================== --- stable/11/usr.sbin/bsdconfig/Makefile Thu Jun 21 15:02:17 2018 (r335487) +++ stable/11/usr.sbin/bsdconfig/Makefile Thu Jun 21 15:11:14 2018 (r335488) @@ -1,10 +1,11 @@ # $FreeBSD$ +.include + SUBDIR= console \ diskmgmt \ docsinstall \ dot \ - examples \ include \ includes \ mouse \ @@ -17,6 +18,10 @@ SUBDIR= console \ timezone \ ttys \ usermgmt + +.if ${MK_EXAMPLES} != "no" +SUBDIR+= examples +.endif FILESDIR= ${LIBEXECDIR}/bsdconfig FILES= USAGE From owner-svn-src-all@freebsd.org Thu Jun 21 15:21:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A8051021CF4; Thu, 21 Jun 2018 15:21:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1839D811F1; Thu, 21 Jun 2018 15:21:18 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED8F813746; Thu, 21 Jun 2018 15:21:17 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LFLHp9069328; Thu, 21 Jun 2018 15:21:17 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LFLHNH069327; Thu, 21 Jun 2018 15:21:17 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806211521.w5LFLHNH069327@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 21 Jun 2018 15:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335489 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 335489 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 15:21:18 -0000 Author: ian Date: Thu Jun 21 15:21:17 2018 New Revision: 335489 URL: https://svnweb.freebsd.org/changeset/base/335489 Log: Add some words clarifying that rename(2) does nothing when the 'from' and 'to' args are the same file. Wording borrowed from POSIX.1-2017, but the freebsd code to implement this behavior was added in 2002 (r103180). Modified: head/lib/libc/sys/rename.2 Modified: head/lib/libc/sys/rename.2 ============================================================================== --- head/lib/libc/sys/rename.2 Thu Jun 21 15:11:14 2018 (r335488) +++ head/lib/libc/sys/rename.2 Thu Jun 21 15:21:17 2018 (r335489) @@ -28,7 +28,7 @@ .\" @(#)rename.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 15, 2017 +.Dd June 21, 2018 .Dt RENAME 2 .Os .Sh NAME @@ -75,6 +75,15 @@ If the final component of is a symbolic link, the symbolic link is renamed, not the file or directory to which it points. +.Pp +If +.Fa from +and +.Fa to +resolve to the same directory entry, or to different directory +entries for the same existing file, +.Fn rename +returns success without taking any further action. .Pp The .Fn renameat From owner-svn-src-all@freebsd.org Thu Jun 21 15:47:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5B0C1022510; Thu, 21 Jun 2018 15:47:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 971EA822BD; Thu, 21 Jun 2018 15:47:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 793CD13BF4; Thu, 21 Jun 2018 15:47:47 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LFllP2084138; Thu, 21 Jun 2018 15:47:47 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LFllAn084136; Thu, 21 Jun 2018 15:47:47 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201806211547.w5LFllAn084136@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Thu, 21 Jun 2018 15:47:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335490 - head/sys/dev/xen/grant_table X-SVN-Group: head X-SVN-Commit-Author: royger X-SVN-Commit-Paths: head/sys/dev/xen/grant_table X-SVN-Commit-Revision: 335490 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 15:47:48 -0000 Author: royger Date: Thu Jun 21 15:47:47 2018 New Revision: 335490 URL: https://svnweb.freebsd.org/changeset/base/335490 Log: xen: check if there are clients waiting in gnttab_end_foreign_access_references Without a call to check_free_callbacks() clients waiting for grant references would not be woken up even when there are sufficient grant references available. The check was likely left out as a mistake when the function was first added. Note that other functions used to free grant references already call check_free_callbacks. Submitted by: pratyush Reviewed by: royger Differential review: https://reviews.freebsd.org/D15899 Modified: head/sys/dev/xen/grant_table/grant_table.c Modified: head/sys/dev/xen/grant_table/grant_table.c ============================================================================== --- head/sys/dev/xen/grant_table/grant_table.c Thu Jun 21 15:21:17 2018 (r335489) +++ head/sys/dev/xen/grant_table/grant_table.c Thu Jun 21 15:47:47 2018 (r335490) @@ -245,6 +245,7 @@ gnttab_end_foreign_access_references(u_int count, gran gnttab_free_count += count; gnttab_entry(tail) = gnttab_free_head; gnttab_free_head = head; + check_free_callbacks(); mtx_unlock(&gnttab_list_lock); } } From owner-svn-src-all@freebsd.org Thu Jun 21 15:59:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AF7C11022886; Thu, 21 Jun 2018 15:59:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E2AA82A07; Thu, 21 Jun 2018 15:59:06 +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 3B54713DA5; Thu, 21 Jun 2018 15:59:06 +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 w5LFx69s089744; Thu, 21 Jun 2018 15:59:06 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LFx6a6089743; Thu, 21 Jun 2018 15:59:06 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806211559.w5LFx6a6089743@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Thu, 21 Jun 2018 15:59:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335491 - head/sys/powerpc/cpufreq X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/cpufreq X-SVN-Commit-Revision: 335491 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 15:59:06 -0000 Author: jhibbits Date: Thu Jun 21 15:59:05 2018 New Revision: 335491 URL: https://svnweb.freebsd.org/changeset/base/335491 Log: Fix the build post-PMCR addition. Submitted by: lwhsu Modified: head/sys/powerpc/cpufreq/pmcr.c Modified: head/sys/powerpc/cpufreq/pmcr.c ============================================================================== --- head/sys/powerpc/cpufreq/pmcr.c Thu Jun 21 15:47:47 2018 (r335490) +++ head/sys/powerpc/cpufreq/pmcr.c Thu Jun 21 15:59:05 2018 (r335491) @@ -195,7 +195,7 @@ pmcr_set(device_t dev, const struct cf_setting *set) pmcr = ((long)pstate_ids[set->spec[0]] << PMCR_LOWERPS_SHIFT) & PMCR_LOWERPS_MASK; pmcr |= ((long)pstate_ids[set->spec[0]] << PMCR_UPPERPS_SHIFT) & - PMCR_UPPERPS_MASK + PMCR_UPPERPS_MASK; pmcr |= PMCR_VERSION_1; mtspr(SPR_PMCR, pmcr); From owner-svn-src-all@freebsd.org Thu Jun 21 16:12:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B797A1022C3D; Thu, 21 Jun 2018 16:12:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D55B831BD; Thu, 21 Jun 2018 16:12:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4E579140D6; Thu, 21 Jun 2018 16:12:31 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LGCV3e099304; Thu, 21 Jun 2018 16:12:31 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LGCVJZ099303; Thu, 21 Jun 2018 16:12:31 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201806211612.w5LGCVJZ099303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Thu, 21 Jun 2018 16:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335492 - stable/11/usr.sbin/syslogd X-SVN-Group: stable-11 X-SVN-Commit-Author: ed X-SVN-Commit-Paths: stable/11/usr.sbin/syslogd X-SVN-Commit-Revision: 335492 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 16:12:31 -0000 Author: ed Date: Thu Jun 21 16:12:30 2018 New Revision: 335492 URL: https://svnweb.freebsd.org/changeset/base/335492 Log: MFC r335314: Fix bad logic in iovlist_truncate(). To conform to RFC 5426, this function is intended to truncate messages if they exceed the message size limits. Unfortunately, the amount of space was computed the wrong way around, causing messages to be truncated entirely. Reported by: Michael Grimm on stable@ Modified: stable/11/usr.sbin/syslogd/syslogd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/syslogd/syslogd.c ============================================================================== --- stable/11/usr.sbin/syslogd/syslogd.c Thu Jun 21 15:59:05 2018 (r335491) +++ stable/11/usr.sbin/syslogd/syslogd.c Thu Jun 21 16:12:30 2018 (r335492) @@ -1611,8 +1611,8 @@ iovlist_truncate(struct iovlist *il, size_t size) struct iovec *last; size_t diff; - while (size > il->totalsize) { - diff = size - il->totalsize; + while (il->totalsize > size) { + diff = il->totalsize - size; last = &il->iov[il->iovcnt - 1]; if (diff >= last->iov_len) { /* Remove the last iovec entirely. */ From owner-svn-src-all@freebsd.org Thu Jun 21 16:39:39 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2E6110236B6; Thu, 21 Jun 2018 16:39:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 505F283FD2; Thu, 21 Jun 2018 16:39:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2E84F14435; Thu, 21 Jun 2018 16:39:39 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LGddlG010174; Thu, 21 Jun 2018 16:39:39 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LGddNS010173; Thu, 21 Jun 2018 16:39:39 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806211639.w5LGddNS010173@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Jun 2018 16:39:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335493 - head/share/man/man5 X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/share/man/man5 X-SVN-Commit-Revision: 335493 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 16:39:39 -0000 Author: bdrewery Date: Thu Jun 21 16:39:38 2018 New Revision: 335493 URL: https://svnweb.freebsd.org/changeset/base/335493 Log: ino64 uses 8 byte padding now. Modified: head/share/man/man5/dir.5 Modified: head/share/man/man5/dir.5 ============================================================================== --- head/share/man/man5/dir.5 Thu Jun 21 16:12:30 2018 (r335492) +++ head/share/man/man5/dir.5 Thu Jun 21 16:39:38 2018 (r335493) @@ -28,7 +28,7 @@ .\" @(#)dir.5 8.3 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd February 13, 2017 +.Dd June 20, 2018 .Dt DIR 5 .Os .Sh NAME @@ -90,7 +90,7 @@ The directory entry format is defined in the file * * A directory entry has a struct dirent at the front of it, containing its * inode number, the length of the entry, and the length of the name - * contained in the entry. These are followed by the name padded to a 4 + * contained in the entry. These are followed by the name padded to a 8 * byte boundary with null bytes. All names are guaranteed null terminated. * The maximum length of a name in a directory is MAXNAMLEN. * Explicit pad is added between the last member of the header and From owner-svn-src-all@freebsd.org Thu Jun 21 16:40:08 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 98787102371A; Thu, 21 Jun 2018 16:40:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AB238412A; Thu, 21 Jun 2018 16:40:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2BCD61443F; Thu, 21 Jun 2018 16:40:08 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LGe8ji010267; Thu, 21 Jun 2018 16:40:08 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LGe8Xt010266; Thu, 21 Jun 2018 16:40:08 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806211640.w5LGe8Xt010266@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 21 Jun 2018 16:40:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335494 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 335494 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 16:40:08 -0000 Author: bdrewery Date: Thu Jun 21 16:40:07 2018 New Revision: 335494 URL: https://svnweb.freebsd.org/changeset/base/335494 Log: Minor comment fix d_namelen -> d_namlen Modified: head/sys/sys/dirent.h Modified: head/sys/sys/dirent.h ============================================================================== --- head/sys/sys/dirent.h Thu Jun 21 16:39:38 2018 (r335493) +++ head/sys/sys/dirent.h Thu Jun 21 16:40:07 2018 (r335494) @@ -58,7 +58,7 @@ typedef __off_t off_t; * byte boundary with null bytes. All names are guaranteed null terminated. * The maximum length of a name in a directory is MAXNAMLEN. * - * Explicit padding between the last member of the header (d_namelen) and + * Explicit padding between the last member of the header (d_namlen) and * d_name avoids ABI padding at the end of dirent on LP64 architectures. * There is code depending on d_name being last. */ From owner-svn-src-all@freebsd.org Thu Jun 21 16:51:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E9431023E56; Thu, 21 Jun 2018 16:51:37 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: from mail-oi0-x235.google.com (mail-oi0-x235.google.com [IPv6:2607:f8b0:4003:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD67184B29; Thu, 21 Jun 2018 16:51:36 +0000 (UTC) (envelope-from hackagadget@gmail.com) Received: by mail-oi0-x235.google.com with SMTP id t133-v6so3531348oif.10; Thu, 21 Jun 2018 09:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Q6tG6a444d+qn3AsU7UbjZRfXPHjnqhG7U0TRamHXaY=; b=q43QYXyplWhaRDBDBBrMXVfh6rGYc7tqcYHIf6xfEOZJT0QZ56Es+bKzjMjr2XtrDU 8IXrR2uGMpgaXhRoKvsoKCEhfc4zbHDt9ncB+6uAsBR9Khxi+cV/OLrzQ+20PTWF0z0F 0e06QZT/9RYbZfg3tTtVj6dsLIpjiVftBDrCNMK74rOPCYKbToDSm8pBaq6rINwj7jyk ZjhdqMe47XJOIKLsq2r7IPwpqA0LeXxTgW19GakihYgr2jp7J8FIxfpjJzrU6boYQ0hW N4XERnEZLLx+ggpV07xmuXpfiQ/i9+KMGziLKKSen7+xLZ3JRHxIlc9OS6urBfosIZ0O L9rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Q6tG6a444d+qn3AsU7UbjZRfXPHjnqhG7U0TRamHXaY=; b=cStjac0O/dX3UWZ6eml6yyU7YC/aB+bk7RCHi+qJqjS+MqdXPL0sqgstAw5K4ep5Nb iSdwmovO8ZkP5fC1Wy+HSG9WNcKiEe3nO69Bm7r0rWkNAhdgFoEP2eJfptsJnbhlGD7x y66QZYGIPeICTGklMSKdVOL7Z0k/FPYHOStnizFnj+MKp8j6SeMRY3ETwMHFouDdc0px Th8OF2zosrt7vaIwkabp0Os5DoSVyODyGEY80YvRohUDnA9ihlHpDJ22BXOx1YjHt7qe NcBcC35kXgGjkFaSkVPnFeHPbSoJFdgh+acb5ti6cyzrL1rIMET0yUqLp1nAy+KrCO2D sq4g== X-Gm-Message-State: APt69E0uha0BQlc0WCM2MYwJvwxl/5Zvu9AZAzvJ54e5oIgDTsie3t3d i2cutUsTr1XrHf/U57mVeExB66tDVyASRCaTCwA= X-Google-Smtp-Source: ADUXVKKJZtG+cf6WNtP83EZlTTkfICgux5Lfn5V6jixUk4CY9CUfkwKE1aO2OBfUsVVzYcMz5QP2LL22opxOsviuhmY= X-Received: by 2002:aca:51cb:: with SMTP id f194-v6mr15805955oib.110.1529599895749; Thu, 21 Jun 2018 09:51:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1918:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 09:51:35 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Stephen Kiernan Date: Thu, 21 Jun 2018 09:51:35 -0700 Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Eitan Adler Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 16:51:37 -0000 On Wed, Jun 20, 2018 at 10:36 PM, Eitan Adler wrote: > On 19 June 2018 at 20:08, Eitan Adler wrote: > > On 19 June 2018 at 18:08, Stephen J. Kiernan wrote: > >> Added: head/sbin/veriexecctl/Makefile > >> ============================================================ > ================== > >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) > >> +++ head/sbin/veriexecctl/Makefile Wed Jun 20 01:08:54 2018 > (r335402) > >> @@ -0,0 +1,11 @@ > >> +# $FreeBSD$ > >> + > >> +PROG= veriexecctl > >> +MAN= veriexecctl.8 > >> +SRCS= veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c > >> + > >> +WARNS?= 3 > > > > Why are we introducing new code with lower-than-6 warnings ? > > In all the commotion about the more important issues this fell > through. Also its argument parsing appears to not be using > getopt[_long] ? > I replied to this 2 days ago with: "veriexecctl came from NetBSD originally and that is what they had, but I believe it should be able to be bumped up." However, there has been some discussion about just not putting in veriexecctl for now and wait for some work that Simon Gerraty has been doing, using some of the work for the verified loader, instead. However, it would also mean that in the meantime, there would be nothing available to be able to people to try out veriexec to provide some feedback until that utility was completed and committed. -Steve From owner-svn-src-all@freebsd.org Thu Jun 21 16:53:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B86B610240C9; Thu, 21 Jun 2018 16:53:49 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B60784FAE; Thu, 21 Jun 2018 16:53:49 +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 4C6FB147C9; Thu, 21 Jun 2018 16:53:49 +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 w5LGrn2D022005; Thu, 21 Jun 2018 16:53:49 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LGrmTh022003; Thu, 21 Jun 2018 16:53:48 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806211653.w5LGrmTh022003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 16:53:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335495 - 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: 335495 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 16:53:49 -0000 Author: gjb Date: Thu Jun 21 16:53:48 2018 New Revision: 335495 URL: https://svnweb.freebsd.org/changeset/base/335495 Log: Document EN-18:07, SA-18:07. Sponsored by: The FreeBSD Foundation 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 Thu Jun 21 16:40:07 2018 (r335494) +++ stable/11/release/doc/share/xml/errata.xml Thu Jun 21 16:53:48 2018 (r335495) @@ -88,6 +88,13 @@ Update timezone database information + + + FreeBSD-EN-18:07.pmap + 21 June 2018 + Fix TLB for Xen guests + Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Thu Jun 21 16:40:07 2018 (r335494) +++ stable/11/release/doc/share/xml/security.xml Thu Jun 21 16:53:48 2018 (r335495) @@ -114,6 +114,14 @@ Mishandling of x86 debug exceptions + + + FreeBSD-SA-18:07.lazyfpu + 21 June 2018 + Fix Lazy FPU information + disclosure + From owner-svn-src-all@freebsd.org Thu Jun 21 17:05:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9944F102438C; Thu, 21 Jun 2018 17: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DC508578D; Thu, 21 Jun 2018 17: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 2A250149E1; Thu, 21 Jun 2018 17: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 w5LH5WQR027041; Thu, 21 Jun 2018 17:05:32 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LH5WcK027037; Thu, 21 Jun 2018 17:05:32 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806211705.w5LH5WcK027037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 17:05:32 +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: r335496 - in stable/11/release/doc/en_US.ISO8859-1: errata hardware readme relnotes X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable/11/release/doc/en_US.ISO8859-1: errata hardware readme relnotes X-SVN-Commit-Revision: 335496 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 17:05:33 -0000 Author: gjb Date: Thu Jun 21 17:05:31 2018 New Revision: 335496 URL: https://svnweb.freebsd.org/changeset/base/335496 Log: Add xml:id attributes for future diff reduction. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml stable/11/release/doc/en_US.ISO8859-1/readme/article.xml stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 16:53:48 2018 (r335495) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 17:05:31 2018 (r335496) @@ -14,6 +14,7 @@
&os; &release; Errata Modified: stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Jun 21 16:53:48 2018 (r335495) +++ stable/11/release/doc/en_US.ISO8859-1/hardware/article.xml Thu Jun 21 17:05:31 2018 (r335496) @@ -7,7 +7,9 @@ %devauto; ]>
+ xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="top" + version="5.0"> &os; &release.current; Hardware Notes Modified: stable/11/release/doc/en_US.ISO8859-1/readme/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/readme/article.xml Thu Jun 21 16:53:48 2018 (r335495) +++ stable/11/release/doc/en_US.ISO8859-1/readme/article.xml Thu Jun 21 17:05:31 2018 (r335496) @@ -13,7 +13,9 @@ End: -->
+ xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="top" + version="5.0"> &os; &release.current; README @@ -70,7 +72,7 @@ &release.current;, the latest point along the &release.branch; branch. - + About &os; &os; is an operating system based on 4.4 BSD Lite for @@ -107,7 +109,7 @@ be quickly installed from the installation program. - + Target Audience This &release.type; is aimed @@ -163,7 +165,7 @@ complete &os; distribution, rather than updating an existing installation. - + CDROM and DVD &os; -RELEASE distributions may be ordered on CDROM or DVD @@ -180,7 +182,7 @@ &os; appendix to the Handbook. - + HTTPS &os; releases may be downloaded via @@ -189,7 +191,7 @@ which is the official &os; release site. - + FTP You can use FTP to retrieve &os; and any or all of its @@ -222,7 +224,7 @@ Contacting the &os; Project - + Email and Mailing Lists For any questions or general technical support issues, @@ -265,7 +267,7 @@ - + Submitting Problem Reports Suggestions, bug reports and contributions of code are @@ -369,7 +371,7 @@ - + Manual Pages As with almost all &unix; like operating systems, &os; @@ -387,7 +389,7 @@ and &man.style.9; (a style guide to kernel coding). - + Books and Articles Two highly-useful collections of &os;-related information, Modified: stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 21 16:53:48 2018 (r335495) +++ stable/11/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 21 17:05:31 2018 (r335496) @@ -11,7 +11,9 @@ ]>
+ xmlns:xlink="http://www.w3.org/1999/xlink" + xml:id="top" + version="5.0"> &os; &release.current; Release Notes From owner-svn-src-all@freebsd.org Thu Jun 21 17:16:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDF0B1024667; Thu, 21 Jun 2018 17:16:25 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.blih.net", Issuer "mail.blih.net" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 2827385D86; Thu, 21 Jun 2018 17:16:24 +0000 (UTC) (envelope-from manu@bidouilliste.com) Received: from mail.blih.net (mail.blih.net [212.83.177.182]) by mail.blih.net (OpenSMTPD) with ESMTP id 72f4849d; Thu, 21 Jun 2018 19:16:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=mail; bh=R3u4sZqj+ADNQxsStiKjLLZ48Ss=; b=GTB0MDzvdLZoIGCrf2gnMlb8b1Wy ROKdiyF1h8+XrjTJDK99P1igwn+hi/F6jZS2WRbv4g8mis/eg4Hp3aexYChBsbQA kON/LCxpfPYV5DgrFrStuN6zp7PxJAsfxwn+D8VBxjgmtpHix1Yau+/K6bbQ9f0I 920XjFmYW/QckFw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=bidouilliste.com; h=date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; q=dns; s= mail; b=aIOnl6j6DEfLaw9fxxdnrDRaPah24NkoLsh/16bpxTamLAmCaIQkkL9a MYJ0PqtACoarDFmn7yJKhz/oM20BoM8eArluYR/Wn623uX3JxFjlSILCwdGyNtQq JRca5vlUyHX0NWLpPWk8YFYKuVtpkNjKYIZFeLhuAaA4OMgHLo4= Received: from skull.home.blih.net (ip-9.net-89-3-105.rev.numericable.fr [89.3.105.9]) by mail.blih.net (OpenSMTPD) with ESMTPSA id 8b294ddc TLS version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO; Thu, 21 Jun 2018 19:16:16 +0200 (CEST) Date: Thu, 21 Jun 2018 19:16:15 +0200 From: Emmanuel Vadot To: Ilya Bakulin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335476 - in head/sys: arm/allwinner conf Message-Id: <20180621191615.a407caac02bd671c267f40aa@bidouilliste.com> In-Reply-To: <201806211149.w5LBnLl9061185@repo.freebsd.org> References: <201806211149.w5LBnLl9061185@repo.freebsd.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 17:16:26 -0000 On Thu, 21 Jun 2018 11:49:21 +0000 (UTC) Ilya Bakulin wrote: > Author: kibab > Date: Thu Jun 21 11:49:21 2018 > New Revision: 335476 > URL: https://svnweb.freebsd.org/changeset/base/335476 > > Log: > Add MMCCAM support to AllWinner MMC driver > > Using MMCCAM on AllWinner boards is now possible, reaching highest > possible data transfer speed. > > For now, MMCCAM doesn't scan cards on boot. This means that scanning > has to be done manually and that it's not possible to mount root FS > from MMC/SD card since there is no block device at the boot time. > > For manually scanning the cards, run: > # camcontrol rescan X:0:0 > Where X is the bus number (look at camcontrol devlist to determine > bus number assigned to the MMC controller). > > Reviewed by: manu No, as I said in the review I haven't reviewed it since I know nothing about CAM. > Approved by: imp (mentor) > Differential Revision: https://reviews.freebsd.org/D15891 > > Modified: > head/sys/arm/allwinner/aw_mmc.c > head/sys/arm/allwinner/files.allwinner > head/sys/conf/files.arm64 > > Modified: head/sys/arm/allwinner/aw_mmc.c > ============================================================================== > --- head/sys/arm/allwinner/aw_mmc.c Thu Jun 21 11:43:54 2018 (r335475) > +++ head/sys/arm/allwinner/aw_mmc.c Thu Jun 21 11:49:21 2018 (r335476) > @@ -55,6 +55,16 @@ __FBSDID("$FreeBSD$"); > #include > #include > > +#include "opt_mmccam.h" > + > +#ifdef MMCCAM > +#include > +#include > +#include > +#include > +#include > +#endif > + > #define AW_MMC_MEMRES 0 > #define AW_MMC_IRQRES 1 > #define AW_MMC_RESSZ 2 > @@ -112,7 +122,14 @@ struct aw_mmc_softc { > int aw_timeout; > struct callout aw_timeoutc; > struct mmc_host aw_host; > +#ifdef MMCCAM > + union ccb * ccb; > + struct cam_devq * devq; > + struct cam_sim * sim; > + struct mtx sim_mtx; > +#else > struct mmc_request * aw_req; > +#endif > struct mtx aw_mtx; > struct resource * aw_res[AW_MMC_RESSZ]; > struct aw_mmc_conf * aw_mmc_conf; > @@ -148,11 +165,19 @@ static int aw_mmc_init(struct aw_mmc_softc *); > static void aw_mmc_intr(void *); > static int aw_mmc_update_clock(struct aw_mmc_softc *, uint32_t); > > +static void aw_mmc_print_error(uint32_t); > static int aw_mmc_update_ios(device_t, device_t); > static int aw_mmc_request(device_t, device_t, struct mmc_request *); > static int aw_mmc_get_ro(device_t, device_t); > static int aw_mmc_acquire_host(device_t, device_t); > static int aw_mmc_release_host(device_t, device_t); > +#ifdef MMCCAM > +static void aw_mmc_cam_action(struct cam_sim *, union ccb *); > +static void aw_mmc_cam_poll(struct cam_sim *); > +static int aw_mmc_cam_settran_settings(struct aw_mmc_softc *, union ccb *); > +static int aw_mmc_cam_request(struct aw_mmc_softc *, union ccb *); > +static void aw_mmc_cam_handle_mmcio(struct cam_sim *, union ccb *); > +#endif > > #define AW_MMC_LOCK(_sc) mtx_lock(&(_sc)->aw_mtx) > #define AW_MMC_UNLOCK(_sc) mtx_unlock(&(_sc)->aw_mtx) > @@ -161,7 +186,201 @@ static int aw_mmc_release_host(device_t, device_t); > #define AW_MMC_WRITE_4(_sc, _reg, _value) \ > bus_write_4((_sc)->aw_res[AW_MMC_MEMRES], _reg, _value) > > +#ifdef MMCCAM > +static void > +aw_mmc_cam_handle_mmcio(struct cam_sim *sim, union ccb *ccb) > +{ > + struct aw_mmc_softc *sc; > + > + sc = cam_sim_softc(sim); > + > + aw_mmc_cam_request(sc, ccb); > +} > + > +static void > +aw_mmc_cam_action(struct cam_sim *sim, union ccb *ccb) > +{ > + struct aw_mmc_softc *sc; > + > + sc = cam_sim_softc(sim); > + if (sc == NULL) { > + ccb->ccb_h.status = CAM_SEL_TIMEOUT; > + xpt_done(ccb); > + return; > + } > + > + mtx_assert(&sc->sim_mtx, MA_OWNED); > + > + switch (ccb->ccb_h.func_code) { > + case XPT_PATH_INQ: > + { > + struct ccb_pathinq *cpi; > + > + cpi = &ccb->cpi; > + cpi->version_num = 1; > + cpi->hba_inquiry = 0; > + cpi->target_sprt = 0; > + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; > + cpi->hba_eng_cnt = 0; > + cpi->max_target = 0; > + cpi->max_lun = 0; > + cpi->initiator_id = 1; > + cpi->maxio = (sc->aw_mmc_conf->dma_xferlen * > + AW_MMC_DMA_SEGS) / MMC_SECTOR_SIZE; > + strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN); > + strncpy(cpi->hba_vid, "Deglitch Networks", HBA_IDLEN); > + strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN); > + cpi->unit_number = cam_sim_unit(sim); > + cpi->bus_id = cam_sim_bus(sim); > + cpi->protocol = PROTO_MMCSD; > + cpi->protocol_version = SCSI_REV_0; > + cpi->transport = XPORT_MMCSD; > + cpi->transport_version = 1; > + > + cpi->ccb_h.status = CAM_REQ_CMP; > + break; > + } > + case XPT_GET_TRAN_SETTINGS: > + { > + struct ccb_trans_settings *cts = &ccb->cts; > + > + if (bootverbose) > + device_printf(sc->aw_dev, "Got XPT_GET_TRAN_SETTINGS\n"); > + > + cts->protocol = PROTO_MMCSD; > + cts->protocol_version = 1; > + cts->transport = XPORT_MMCSD; > + cts->transport_version = 1; > + cts->xport_specific.valid = 0; > + cts->proto_specific.mmc.host_ocr = sc->aw_host.host_ocr; > + cts->proto_specific.mmc.host_f_min = sc->aw_host.f_min; > + cts->proto_specific.mmc.host_f_max = sc->aw_host.f_max; > + cts->proto_specific.mmc.host_caps = sc->aw_host.caps; > + memcpy(&cts->proto_specific.mmc.ios, &sc->aw_host.ios, sizeof(struct mmc_ios)); > + ccb->ccb_h.status = CAM_REQ_CMP; > + break; > + } > + case XPT_SET_TRAN_SETTINGS: > + { > + if (bootverbose) > + device_printf(sc->aw_dev, "Got XPT_SET_TRAN_SETTINGS\n"); > + aw_mmc_cam_settran_settings(sc, ccb); > + ccb->ccb_h.status = CAM_REQ_CMP; > + break; > + } > + case XPT_RESET_BUS: > + if (bootverbose) > + device_printf(sc->aw_dev, "Got XPT_RESET_BUS, ACK it...\n"); > + ccb->ccb_h.status = CAM_REQ_CMP; > + break; > + case XPT_MMC_IO: > + /* > + * Here is the HW-dependent part of > + * sending the command to the underlying h/w > + * At some point in the future an interrupt comes. > + * Then the request will be marked as completed. > + */ > + ccb->ccb_h.status = CAM_REQ_INPROG; > + > + aw_mmc_cam_handle_mmcio(sim, ccb); > + return; > + /* NOTREACHED */ > + break; > + default: > + ccb->ccb_h.status = CAM_REQ_INVALID; > + break; > + } > + xpt_done(ccb); > + return; > +} > + > +static void > +aw_mmc_cam_poll(struct cam_sim *sim) > +{ > + return; > +} > + > static int > +aw_mmc_cam_settran_settings(struct aw_mmc_softc *sc, union ccb *ccb) > +{ > + struct mmc_ios *ios; > + struct mmc_ios *new_ios; > + struct ccb_trans_settings_mmc *cts; > + > + ios = &sc->aw_host.ios; > + > + cts = &ccb->cts.proto_specific.mmc; > + new_ios = &cts->ios; > + > + /* Update only requested fields */ > + if (cts->ios_valid & MMC_CLK) { > + ios->clock = new_ios->clock; > + device_printf(sc->aw_dev, "Clock => %d\n", ios->clock); > + } > + if (cts->ios_valid & MMC_VDD) { > + ios->vdd = new_ios->vdd; > + device_printf(sc->aw_dev, "VDD => %d\n", ios->vdd); > + } > + if (cts->ios_valid & MMC_CS) { > + ios->chip_select = new_ios->chip_select; > + device_printf(sc->aw_dev, "CS => %d\n", ios->chip_select); > + } > + if (cts->ios_valid & MMC_BW) { > + ios->bus_width = new_ios->bus_width; > + device_printf(sc->aw_dev, "Bus width => %d\n", ios->bus_width); > + } > + if (cts->ios_valid & MMC_PM) { > + ios->power_mode = new_ios->power_mode; > + device_printf(sc->aw_dev, "Power mode => %d\n", ios->power_mode); > + } > + if (cts->ios_valid & MMC_BT) { > + ios->timing = new_ios->timing; > + device_printf(sc->aw_dev, "Timing => %d\n", ios->timing); > + } > + if (cts->ios_valid & MMC_BM) { > + ios->bus_mode = new_ios->bus_mode; > + device_printf(sc->aw_dev, "Bus mode => %d\n", ios->bus_mode); > + } > + > + return (aw_mmc_update_ios(sc->aw_dev, NULL)); > +} > + > +static int > +aw_mmc_cam_request(struct aw_mmc_softc *sc, union ccb *ccb) > +{ > + struct ccb_mmcio *mmcio; > + > + mmcio = &ccb->mmcio; > + > + AW_MMC_LOCK(sc); > + > +#ifdef DEBUG > + if (__predict_false(bootverbose)) { > + device_printf(sc->aw_dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", > + mmcio->cmd.opcode, mmcio->cmd.arg, mmcio->cmd.flags, > + mmcio->cmd.data != NULL ? (unsigned int) mmcio->cmd.data->len : 0, > + mmcio->cmd.data != NULL ? mmcio->cmd.data->flags: 0); > + } > +#endif > + if (mmcio->cmd.data != NULL) { > + if (mmcio->cmd.data->len == 0 || mmcio->cmd.data->flags == 0) > + panic("data->len = %d, data->flags = %d -- something is b0rked", > + (int)mmcio->cmd.data->len, mmcio->cmd.data->flags); > + } > + if (sc->ccb != NULL) { > + device_printf(sc->aw_dev, "Controller still has an active command\n"); Should be under a ifdef DEBUG > + return (EBUSY); > + } > + sc->ccb = ccb; > + /* aw_mmc_request locks again */ > + AW_MMC_UNLOCK(sc); > + aw_mmc_request(sc->aw_dev, NULL, NULL); > + > + return (0); > +} > +#endif /* MMCCAM */ > + > +static int > aw_mmc_probe(device_t dev) > { > > @@ -192,7 +411,9 @@ aw_mmc_attach(device_t dev) > > sc->aw_mmc_conf = (struct aw_mmc_conf *)ofw_bus_search_compatible(dev, compat_data)->ocd_data; > > +#ifndef MMCCAM > sc->aw_req = NULL; > +#endif > if (bus_alloc_resources(dev, aw_mmc_res_spec, sc->aw_res) != 0) { > device_printf(dev, "cannot allocate device resources\n"); > return (ENXIO); > @@ -295,6 +516,35 @@ aw_mmc_attach(device_t dev) > if (bus_width >= 8) > sc->aw_host.caps |= MMC_CAP_8_BIT_DATA; > > +#ifdef MMCCAM > + child = NULL; /* Not used by MMCCAM, need to silence compiler warnings */ > + sc->ccb = NULL; > + if ((sc->devq = cam_simq_alloc(1)) == NULL) { > + goto fail; > + } > + > + mtx_init(&sc->sim_mtx, "awmmcsim", NULL, MTX_DEF); > + sc->sim = cam_sim_alloc(aw_mmc_cam_action, aw_mmc_cam_poll, > + "aw_mmc_sim", sc, device_get_unit(dev), > + &sc->sim_mtx, 1, 1, sc->devq); > + > + if (sc->sim == NULL) { > + cam_simq_free(sc->devq); > + device_printf(dev, "cannot allocate CAM SIM\n"); > + goto fail; > + } > + > + mtx_lock(&sc->sim_mtx); > + if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { > + device_printf(dev, "cannot register SCSI pass-through bus\n"); > + cam_sim_free(sc->sim, FALSE); > + cam_simq_free(sc->devq); > + mtx_unlock(&sc->sim_mtx); > + goto fail; > + } > + > + mtx_unlock(&sc->sim_mtx); > +#else /* !MMCCAM */ > child = device_add_child(dev, "mmc", -1); > if (child == NULL) { > device_printf(dev, "attaching MMC bus failed!\n"); > @@ -305,7 +555,7 @@ aw_mmc_attach(device_t dev) > device_delete_child(dev, child); > goto fail; > } > - > +#endif /* MMCCAM */ > return (0); > > fail: > @@ -314,6 +564,17 @@ fail: > bus_teardown_intr(dev, sc->aw_res[AW_MMC_IRQRES], sc->aw_intrhand); > bus_release_resources(dev, aw_mmc_res_spec, sc->aw_res); > > +#ifdef MMCCAM > + if (sc->sim != NULL) { > + mtx_lock(&sc->sim_mtx); > + xpt_bus_deregister(cam_sim_path(sc->sim)); > + cam_sim_free(sc->sim, FALSE); > + mtx_unlock(&sc->sim_mtx); > + } > + > + if (sc->devq != NULL) > + cam_simq_free(sc->devq); > +#endif > return (ENXIO); > } > > @@ -437,7 +698,11 @@ aw_mmc_prepare_dma(struct aw_mmc_softc *sc) > struct mmc_command *cmd; > uint32_t val; > > +#ifdef MMCCAM > + cmd = &sc->ccb->mmcio.cmd; > +#else > cmd = sc->aw_req->cmd; > +#endif > if (cmd->data->len > (sc->aw_mmc_conf->dma_xferlen * AW_MMC_DMA_SEGS)) > return (EFBIG); > error = bus_dmamap_load(sc->aw_dma_buf_tag, sc->aw_dma_buf_map, > @@ -549,11 +814,25 @@ static void > aw_mmc_req_done(struct aw_mmc_softc *sc) > { > struct mmc_command *cmd; > +#ifdef MMCCAM > + union ccb *ccb; > +#else > struct mmc_request *req; > +#endif > uint32_t val, mask; > int retry; > > +#ifdef MMCCAM > + ccb = sc->ccb; > + cmd = &ccb->mmcio.cmd; > +#else > cmd = sc->aw_req->cmd; > +#endif > +#ifdef DEBUG > + if (bootverbose) { > + device_printf(sc->aw_dev, "%s: cmd %d err %d\n", __func__, cmd->opcode, cmd->error); > + } > +#endif > if (cmd->error != MMC_ERR_NONE) { > /* Reset the FIFO and DMA engines. */ > mask = AW_MMC_GCTL_FIFO_RST | AW_MMC_GCTL_DMA_RST; > @@ -573,14 +852,21 @@ aw_mmc_req_done(struct aw_mmc_softc *sc) > aw_mmc_update_clock(sc, 1); > } > > - req = sc->aw_req; > callout_stop(&sc->aw_timeoutc); > - sc->aw_req = NULL; > sc->aw_intr = 0; > sc->aw_resid = 0; > sc->aw_dma_map_err = 0; > sc->aw_intr_wait = 0; > +#ifdef MMCCAM > + sc->ccb = NULL; > + ccb->ccb_h.status = > + (ccb->mmcio.cmd.error == 0 ? CAM_REQ_CMP : CAM_REQ_CMP_ERR); > + xpt_done(ccb); > +#else > + req = sc->aw_req; > + sc->aw_req = NULL; > req->done(req); > +#endif > } > > static void > @@ -597,7 +883,11 @@ aw_mmc_req_ok(struct aw_mmc_softc *sc) > break; > DELAY(1000); > } > +#ifdef MMCCAM > + cmd = &sc->ccb->mmcio.cmd; > +#else > cmd = sc->aw_req->cmd; > +#endif > if (timeout == 0) { > cmd->error = MMC_ERR_FAILED; > aw_mmc_req_done(sc); > @@ -618,15 +908,30 @@ aw_mmc_req_ok(struct aw_mmc_softc *sc) > aw_mmc_req_done(sc); > } > > + > +static inline void > +set_mmc_error(struct aw_mmc_softc *sc, int error_code) > +{ > +#ifdef MMCCAM > + sc->ccb->mmcio.cmd.error = error_code; > +#else > + sc->aw_req->cmd->error = error_code; > +#endif > +} > + > static void > aw_mmc_timeout(void *arg) > { > struct aw_mmc_softc *sc; > > sc = (struct aw_mmc_softc *)arg; > +#ifdef MMCCAM > + if (sc->ccb != NULL) { > +#else > if (sc->aw_req != NULL) { > +#endif > device_printf(sc->aw_dev, "controller timeout\n"); > - sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; > + set_mmc_error(sc, MMC_ERR_TIMEOUT); > aw_mmc_req_done(sc); > } else > device_printf(sc->aw_dev, > @@ -634,6 +939,28 @@ aw_mmc_timeout(void *arg) > } > > static void > +aw_mmc_print_error(uint32_t err) > +{ > + if(err & AW_MMC_INT_RESP_ERR) > + printf("AW_MMC_INT_RESP_ERR "); > + if (err & AW_MMC_INT_RESP_CRC_ERR) > + printf("AW_MMC_INT_RESP_CRC_ERR "); > + if (err & AW_MMC_INT_DATA_CRC_ERR) > + printf("AW_MMC_INT_DATA_CRC_ERR "); > + if (err & AW_MMC_INT_RESP_TIMEOUT) > + printf("AW_MMC_INT_RESP_TIMEOUT "); > + if (err & AW_MMC_INT_FIFO_RUN_ERR) > + printf("AW_MMC_INT_FIFO_RUN_ERR "); > + if (err & AW_MMC_INT_CMD_BUSY) > + printf("AW_MMC_INT_CMD_BUSY "); > + if (err & AW_MMC_INT_DATA_START_ERR) > + printf("AW_MMC_INT_DATA_START_ERR "); > + if (err & AW_MMC_INT_DATA_END_BIT_ERR) > + printf("AW_MMC_INT_DATA_END_BIT_ERR"); > + printf("\n"); > +} > + > +static void > aw_mmc_intr(void *arg) > { > bus_dmasync_op_t sync_op; > @@ -654,31 +981,41 @@ aw_mmc_intr(void *arg) > device_printf(sc->aw_dev, "idst: %#x, imask: %#x, rint: %#x\n", > idst, imask, rint); > #endif > +#ifdef MMCCAM > + if (sc->ccb == NULL) { > +#else > if (sc->aw_req == NULL) { > +#endif > device_printf(sc->aw_dev, > "Spurious interrupt - no active request, rint: 0x%08X\n", > rint); > + aw_mmc_print_error(rint); > goto end; > } > if (rint & AW_MMC_INT_ERR_BIT) { > if (bootverbose) > device_printf(sc->aw_dev, "error rint: 0x%08X\n", rint); > + aw_mmc_print_error(rint); > if (rint & AW_MMC_INT_RESP_TIMEOUT) > - sc->aw_req->cmd->error = MMC_ERR_TIMEOUT; > + set_mmc_error(sc, MMC_ERR_TIMEOUT); > else > - sc->aw_req->cmd->error = MMC_ERR_FAILED; > + set_mmc_error(sc, MMC_ERR_FAILED); > aw_mmc_req_done(sc); > goto end; > } > if (idst & AW_MMC_IDST_ERROR) { > device_printf(sc->aw_dev, "error idst: 0x%08x\n", idst); > - sc->aw_req->cmd->error = MMC_ERR_FAILED; > + set_mmc_error(sc, MMC_ERR_FAILED); > aw_mmc_req_done(sc); > goto end; > } > > sc->aw_intr |= rint; > +#ifdef MMCCAM > + data = sc->ccb->mmcio.cmd.data; > +#else > data = sc->aw_req->cmd->data; > +#endif > if (data != NULL && (idst & AW_MMC_IDST_COMPLETE) != 0) { > if (data->flags & MMC_DATA_WRITE) > sync_op = BUS_DMASYNC_POSTWRITE; > @@ -712,13 +1049,29 @@ aw_mmc_request(device_t bus, device_t child, struct mm > sc = device_get_softc(bus); > > AW_MMC_LOCK(sc); > +#ifdef MMCCAM > + KASSERT(req == NULL, ("req should be NULL in MMCCAM case!")); > + /* > + * For MMCCAM, sc->ccb has been NULL-checked and populated > + * by aw_mmc_cam_request() already. > + */ > + cmd = &sc->ccb->mmcio.cmd; > +#else > if (sc->aw_req) { > AW_MMC_UNLOCK(sc); > return (EBUSY); > } > - > sc->aw_req = req; > cmd = req->cmd; > + > +#ifdef DEBUG > + if (bootverbose) > + device_printf(sc->aw_dev, "CMD%u arg %#x flags %#x dlen %u dflags %#x\n", > + cmd->opcode, cmd->arg, cmd->flags, > + cmd->data != NULL ? (unsigned int)cmd->data->len : 0, > + cmd->data != NULL ? cmd->data->flags: 0); > +#endif > +#endif > cmdreg = AW_MMC_CMDR_LOAD; > imask = AW_MMC_INT_ERR_BIT; > sc->aw_intr_wait = 0; > @@ -1163,4 +1516,6 @@ static driver_t aw_mmc_driver = { > > DRIVER_MODULE(aw_mmc, simplebus, aw_mmc_driver, aw_mmc_devclass, NULL, > NULL); > +#ifndef MMCCAM > MMC_DECLARE_BRIDGE(aw_mmc); > +#endif > > Modified: head/sys/arm/allwinner/files.allwinner > ============================================================================== > --- head/sys/arm/allwinner/files.allwinner Thu Jun 21 11:43:54 2018 (r335475) > +++ head/sys/arm/allwinner/files.allwinner Thu Jun 21 11:49:21 2018 (r335476) > @@ -10,7 +10,7 @@ arm/allwinner/a10_sramc.c standard > arm/allwinner/aw_gpio.c optional gpio > arm/allwinner/aw_if_dwc.c optional dwc > arm/allwinner/aw_machdep.c standard > -arm/allwinner/aw_mmc.c optional mmc > +arm/allwinner/aw_mmc.c optional mmc | mmccam > arm/allwinner/aw_mp.c optional smp > arm/allwinner/aw_nmi.c optional intrng > arm/allwinner/aw_rsb.c optional rsb | p2wi > > Modified: head/sys/conf/files.arm64 > ============================================================================== > --- head/sys/conf/files.arm64 Thu Jun 21 11:43:54 2018 (r335475) > +++ head/sys/conf/files.arm64 Thu Jun 21 11:49:21 2018 (r335476) > @@ -27,7 +27,7 @@ cloudabi64_vdso_blob.o optional compat_cloudabi64 \ > # Allwinner common files > arm/allwinner/a10_ehci.c optional ehci aw_ehci fdt > arm/allwinner/aw_gpio.c optional gpio aw_gpio fdt > -arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt > +arm/allwinner/aw_mmc.c optional mmc aw_mmc fdt | mmccam aw_mmc fdt > arm/allwinner/aw_nmi.c optional aw_nmi fdt \ > compile-with "${NORMAL_C} -I$S/gnu/dts/include" > arm/allwinner/aw_rsb.c optional aw_rsb fdt -- Emmanuel Vadot From owner-svn-src-all@freebsd.org Thu Jun 21 17:24:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D732510249E4; Thu, 21 Jun 2018 17:24:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85F1786585; Thu, 21 Jun 2018 17:24:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6705014D54; Thu, 21 Jun 2018 17:24:11 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LHOBHJ037812; Thu, 21 Jun 2018 17:24:11 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LHOBTp037811; Thu, 21 Jun 2018 17:24:11 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806211724.w5LHOBTp037811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 21 Jun 2018 17:24:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335497 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335497 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 17:24:12 -0000 Author: mmacy Date: Thu Jun 21 17:24:10 2018 New Revision: 335497 URL: https://svnweb.freebsd.org/changeset/base/335497 Log: raw_ip: validate inp Post r335356 it is possible to have an inpcb on the hash lists that is partially torn down. Validate before using. Reported by: pho Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Jun 21 17:05:31 2018 (r335496) +++ head/sys/netinet/raw_ip.c Thu Jun 21 17:24:10 2018 (r335497) @@ -331,6 +331,10 @@ rip_input(struct mbuf **mp, int *offp, int proto) } INP_RLOCK(inp); last = inp; + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + last = NULL; + INP_RUNLOCK(inp); + } } CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[0], inp_hash) { if (inp->inp_ip_p && inp->inp_ip_p != proto) From owner-svn-src-all@freebsd.org Thu Jun 21 17:35:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87ED91024F1F; Thu, 21 Jun 2018 17:35:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2F92A86D82; Thu, 21 Jun 2018 17:35:14 +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 06F4214F25; Thu, 21 Jun 2018 17:35:14 +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 w5LHZD3a043154; Thu, 21 Jun 2018 17:35:13 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LHZDCl043153; Thu, 21 Jun 2018 17:35:13 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806211735.w5LHZDCl043153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Thu, 21 Jun 2018 17:35:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335498 - head/sys/libkern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/libkern X-SVN-Commit-Revision: 335498 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 17:35:14 -0000 Author: cem Date: Thu Jun 21 17:35:13 2018 New Revision: 335498 URL: https://svnweb.freebsd.org/changeset/base/335498 Log: Sync strlcpy with userland version, again No functional change. Please remember to update libkern copies of libc functions when you update libc. Sponsored by: Dell EMC Isilon Modified: head/sys/libkern/strlcpy.c Modified: head/sys/libkern/strlcpy.c ============================================================================== --- head/sys/libkern/strlcpy.c Thu Jun 21 17:24:10 2018 (r335497) +++ head/sys/libkern/strlcpy.c Thu Jun 21 17:35:13 2018 (r335498) @@ -1,7 +1,7 @@ -/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.12 2015/01/15 03:54:12 millert Exp $ */ -/*- - * Copyright (c) 1998 Todd C. Miller +/* + * Copyright (c) 1998, 2015 Todd C. Miller * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -23,32 +23,31 @@ __FBSDID("$FreeBSD$"); #include /* - * Copy src to string dst of size siz. At most siz-1 characters - * will be copied. Always NUL terminates (unless siz == 0). - * Returns strlen(src); if retval >= siz, truncation occurred. + * Copy string src to buffer dst of size dsize. At most dsize-1 + * chars will be copied. Always NUL terminates (unless dsize == 0). + * Returns strlen(src); if retval >= dsize, truncation occurred. */ size_t -strlcpy(char * __restrict dst, const char * __restrict src, size_t siz) +strlcpy(char * __restrict dst, const char * __restrict src, size_t dsize) { - char *d = dst; - const char *s = src; - size_t n = siz; + const char *osrc = src; + size_t nleft = dsize; - /* Copy as many bytes as will fit */ - if (n != 0) { - while (--n != 0) { - if ((*d++ = *s++) == '\0') + /* Copy as many bytes as will fit. */ + if (nleft != 0) { + while (--nleft != 0) { + if ((*dst++ = *src++) == '\0') break; } } - /* Not enough room in dst, add NUL and traverse rest of src */ - if (n == 0) { - if (siz != 0) - *d = '\0'; /* NUL-terminate dst */ - while (*s++) + /* Not enough room in dst, add NUL and traverse rest of src. */ + if (nleft == 0) { + if (dsize != 0) + *dst = '\0'; /* NUL-terminate dst */ + while (*src++) ; } - return(s - src - 1); /* count does not include NUL */ + return(src - osrc - 1); /* count does not include NUL */ } From owner-svn-src-all@freebsd.org Thu Jun 21 18:13:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 645BC102599F; Thu, 21 Jun 2018 18:13:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 18BD588EAD; Thu, 21 Jun 2018 18:13:06 +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 EE14E15607; Thu, 21 Jun 2018 18:13:05 +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 w5LID5Sv064081; Thu, 21 Jun 2018 18:13:05 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LID5B7064078; Thu, 21 Jun 2018 18:13:05 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806211813.w5LID5B7064078@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 18:13:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r335499 - in releng/11.2/release/doc: en_US.ISO8859-1/errata en_US.ISO8859-1/installation en_US.ISO8859-1/relnotes share/xml X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/11.2/release/doc: en_US.ISO8859-1/errata en_US.ISO8859-1/installation en_US.ISO8859-1/relnotes share/xml X-SVN-Commit-Revision: 335499 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 18:13:06 -0000 Author: gjb Date: Thu Jun 21 18:13:04 2018 New Revision: 335499 URL: https://svnweb.freebsd.org/changeset/base/335499 Log: Final touches to 11.2-RELEASE release notes: - Remove an empty section that was left over from a previous commit to prune empty sections. - Add a note about a late discovered issue with zfsd(8) (Bugzilla 228750). Fix a sentence stop while here. - Document SA-18:07, which had been included in RC3. - Fix FreeBSD versions in the installation.html page. Approved by: re (implicit, relnotes) Sponsored by: The FreeBSD Foundation Modified: releng/11.2/release/doc/en_US.ISO8859-1/errata/article.xml releng/11.2/release/doc/en_US.ISO8859-1/installation/article.xml releng/11.2/release/doc/en_US.ISO8859-1/relnotes/article.xml releng/11.2/release/doc/share/xml/security.xml Modified: releng/11.2/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- releng/11.2/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 17:35:13 2018 (r335498) +++ releng/11.2/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 18:13:04 2018 (r335499) @@ -57,7 +57,7 @@ Introduction This errata document contains late-breaking - news about &os; &release; Before installing this + news about &os; &release;. Before installing this version, it is important to consult this document to learn about any post-release discoveries or problems that may already have been found and fixed. @@ -155,6 +155,23 @@ boot invocation of vagrant up will allow the virtual machine to successfully boot, allowing access via vagrant ssh. + + + + [2018-06-21] An issue had been discovered late in the + release cycle where removing ZFS vdevs + from a pool under certain conditions would cause a system + crash when &man.zfsd.8; is enabled in + &man.rc.conf.5;. + + At present, it is believed to be limited to removal of + a mirror vdev from a pool consisting of + multiple mirror vdevs. + + See PR 228750 + for more information and updates as the issue is + investigated. Modified: releng/11.2/release/doc/en_US.ISO8859-1/installation/article.xml ============================================================================== --- releng/11.2/release/doc/en_US.ISO8859-1/installation/article.xml Thu Jun 21 17:35:13 2018 (r335498) +++ releng/11.2/release/doc/en_US.ISO8859-1/installation/article.xml Thu Jun 21 18:13:04 2018 (r335499) @@ -82,8 +82,8 @@ 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: + 10.4-RELEASE or + 11.1-RELEASE can upgrade as follows: &prompt.root; freebsd-update fetch &prompt.root; freebsd-update install Modified: releng/11.2/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- releng/11.2/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 21 17:35:13 2018 (r335498) +++ releng/11.2/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Jun 21 18:13:04 2018 (r335499) @@ -458,13 +458,6 @@ updated to default to UEFI-only boot. - - - <filename class="directory">/etc/rc.d</filename> - Scripts - -   - Modified: releng/11.2/release/doc/share/xml/security.xml ============================================================================== --- releng/11.2/release/doc/share/xml/security.xml Thu Jun 21 17:35:13 2018 (r335498) +++ releng/11.2/release/doc/share/xml/security.xml Thu Jun 21 18:13:04 2018 (r335499) @@ -113,6 +113,14 @@ Mishandling of x86 debug exceptions + + + FreeBSD-SA-18:07.lazyfpu + 21 June 2018 + Fix Lazy FPU information + disclosure + From owner-svn-src-all@freebsd.org Thu Jun 21 18:14:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCF911025A0D; Thu, 21 Jun 2018 18:14:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com [209.85.214.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 70C6589037; Thu, 21 Jun 2018 18:14:05 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-it0-f47.google.com with SMTP id p185-v6so6055134itp.4; Thu, 21 Jun 2018 11:14:05 -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:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=M5x9gYY/J3jOKH1R5bf1gHuJ79HkFqS2LVn84D37xkg=; b=DjMJoVC7RrPDQKCzVy/TIQVTfTsZLElOaY7t2ovinShSGFiBquEbdEn3iDvjvwtKN5 xvvXCcRBUedT1KfkrGI6+SN3kB9LrWvresFbgbRhEONPcicsMhkFyhysW6sQI+kqhSE5 aXI0ZalcIfXGoacS30bG0f+zbuv812VHqt15/jUY5VEoH8mWoRHoQ04gil5NZXAPzzLO sALmjKBsoij6RsXw8Wpen+Huy8IsNAk3SC+6UMvINwyy5iQLBiffhEhv1OMQxIEO3ZSj 9viSYo+xPMr2ztomIOmXNSstpdo0InFW3EOND7Ziaj+0QARgLJC1XbeKHfHuHLHiunRd 9DrA== X-Gm-Message-State: APt69E1GcZ32L/JuiV5j+0xYJVcmXkSn+M8gopWtxqkNRV7P8cdYIgFB A/Svl8C4tjOFp3GcpkyL2cy9Ije7 X-Google-Smtp-Source: ADUXVKIAmnlPY11oM0h9bO+JrqsSmzt4AS+9yzipY18kMU5AwalB/MoWVyFXTXm8KPKjOXG+gR16bQ== X-Received: by 2002:a02:8d29:: with SMTP id h38-v6mr22121825jak.30.1529604839401; Thu, 21 Jun 2018 11:13:59 -0700 (PDT) Received: from mail-it0-f47.google.com (mail-it0-f47.google.com. [209.85.214.47]) by smtp.gmail.com with ESMTPSA id w5-v6sm793744ioc.26.2018.06.21.11.13.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jun 2018 11:13:58 -0700 (PDT) Received: by mail-it0-f47.google.com with SMTP id m194-v6so6014957itg.2; Thu, 21 Jun 2018 11:13:58 -0700 (PDT) X-Received: by 2002:a24:ed4a:: with SMTP id r71-v6mr6075244ith.53.1529604838787; Thu, 21 Jun 2018 11:13:58 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 2002:a02:5995:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 11:13:58 -0700 (PDT) In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> From: Conrad Meyer Date: Thu, 21 Jun 2018 11:13:58 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: Stephen Kiernan Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 18:14:06 -0000 On Thu, Jun 21, 2018 at 9:51 AM, Stephen Kiernan wrote: > On Wed, Jun 20, 2018 at 10:36 PM, Eitan Adler wrote: >> >> On 19 June 2018 at 20:08, Eitan Adler wrote: >> > On 19 June 2018 at 18:08, Stephen J. Kiernan wrote: >> >> Added: head/sbin/veriexecctl/Makefile >> >> >> >> ============================================================================== >> >> --- /dev/null 00:00:00 1970 (empty, because file is newly added) >> >> +++ head/sbin/veriexecctl/Makefile Wed Jun 20 01:08:54 2018 >> >> (r335402) >> >> @@ -0,0 +1,11 @@ >> >> +# $FreeBSD$ >> >> + >> >> +PROG= veriexecctl >> >> +MAN= veriexecctl.8 >> >> +SRCS= veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c >> >> + >> >> +WARNS?= 3 >> > >> > Why are we introducing new code with lower-than-6 warnings ? >> >> In all the commotion about the more important issues this fell >> through. Also its argument parsing appears to not be using >> getopt[_long] ? > > > I replied to this 2 days ago with: > "veriexecctl came from NetBSD originally and that is what they had, > but I believe it should be able to be bumped up." > > However, there has been some discussion about just not putting in > veriexecctl for now and wait for some work that Simon Gerraty has been > doing, using some of the work for the verified loader, instead. However, it > would also mean that in the meantime, there would be nothing available > to be able to people to try out veriexec to provide some feedback until > that utility was completed and committed. Hi, While the code is out of HEAD, it can be posted to a github branch (or a projects/ branch if you prefer SVN) for people to try. Best regards, Conrad From owner-svn-src-all@freebsd.org Thu Jun 21 18:33:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1399F1025EC1 for ; Thu, 21 Jun 2018 18:33:41 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 8F4C089973 for ; Thu, 21 Jun 2018 18:33:40 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 96b42ecd-7581-11e8-aa1a-954dbaed88ca X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound1.eu.mailhop.org (Halon) with ESMTPSA id 96b42ecd-7581-11e8-aa1a-954dbaed88ca; Thu, 21 Jun 2018 18:33:28 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5LIXQ32085389; Thu, 21 Jun 2018 12:33:27 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529606006.24573.30.camel@freebsd.org> Subject: Re: svn commit: r335402 - head/sbin/veriexecctl From: Ian Lepore To: cem@freebsd.org, Stephen Kiernan Cc: Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Thu, 21 Jun 2018 12:33:26 -0600 In-Reply-To: References: <201806200108.w5K18sIR050132@repo.freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 18:33:41 -0000 On Thu, 2018-06-21 at 11:13 -0700, Conrad Meyer wrote: > On Thu, Jun 21, 2018 at 9:51 AM, Stephen Kiernan om> wrote: > > > > On Wed, Jun 20, 2018 at 10:36 PM, Eitan Adler > > wrote: > > > > > > > > > On 19 June 2018 at 20:08, Eitan Adler > > > wrote: > > > > > > > > On 19 June 2018 at 18:08, Stephen J. Kiernan > > > g> wrote: > > > > > > > > > > Added: head/sbin/veriexecctl/Makefile > > > > > > > > > > ============================================================= > > > > > ================= > > > > > --- /dev/null   00:00:00 1970   (empty, because file is newly > > > > > added) > > > > > +++ head/sbin/veriexecctl/Makefile      Wed Jun 20 01:08:54 > > > > > 2018 > > > > > (r335402) > > > > > @@ -0,0 +1,11 @@ > > > > > +# $FreeBSD$ > > > > > + > > > > > +PROG=  veriexecctl > > > > > +MAN=   veriexecctl.8 > > > > > +SRCS=  veriexecctl_parse.y veriexecctl_conf.l veriexecctl.c > > > > > + > > > > > +WARNS?=        3 > > > > Why are we introducing new code with lower-than-6 warnings ? > > > In all the commotion about the more important issues this fell > > > through.  Also its argument parsing appears to not be using > > > getopt[_long] ? > > > > I replied to this 2 days ago with: > > "veriexecctl came from NetBSD originally and that is what they had, > > but I believe it should be able to be bumped up." > > > > However, there has been some discussion about just not putting in > > veriexecctl for now and wait for some work that Simon Gerraty has > > been > > doing, using some of the work for the verified loader, instead. > > However, it > > would also mean that in the meantime, there would be nothing > > available > > to be able to people to try out veriexec to provide some feedback > > until > > that utility was completed and committed. > Hi, > > While the code is out of HEAD, it can be posted to a github branch > (or > a projects/ branch if you prefer SVN) for people to try. > > Best regards, > Conrad > Yeah, put it on a branch where it'll get ignored for another two years. If this code had been committed long ago, as it probably should have been, then people would have been playing with it, and by time I needed it a few months ago there would have been all kinds of useful info in mailing lists and blogs about how to set it up and what was good and bad about it and so on.  Iterative refinement would have been underway. Instead what I found was a bunch of patches and a big steep learning curve with no existing information about using it in the real world. With that info available, I/we ($work) would have been in a position to quickly adopt it and begin contributing to the ongoing refinement. Instead I had to conclude that product deadlines just didn't allow us to even try to get it working from a standing start as first-adopters, so we had to move in a different direction. Even though this is a better solution than what we did, business practicalities will likely prevent us from circling back and changing everything over to this scheme in the future, so now we'll end up never contributing much to this work. So, IMO, all this calling for things to be reverted isn't just inappropriate, it's actively harmful. This is -current where development happens and imperfection is expected. Hiding work in patchsets and reviews and alternate branches and other shadowy places because it's not perfect is just a way of ensuring it never gets any better. -- Ian From owner-svn-src-all@freebsd.org Thu Jun 21 18:40:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91A7E1026103; Thu, 21 Jun 2018 18:40:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4555789C34; Thu, 21 Jun 2018 18:40:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 26F401595A; Thu, 21 Jun 2018 18:40:16 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LIeGc4074540; Thu, 21 Jun 2018 18:40:16 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LIeGMM074539; Thu, 21 Jun 2018 18:40:16 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806211840.w5LIeGMM074539@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 21 Jun 2018 18:40:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335500 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335500 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 18:40:16 -0000 Author: mmacy Date: Thu Jun 21 18:40:15 2018 New Revision: 335500 URL: https://svnweb.freebsd.org/changeset/base/335500 Log: in_pcblookup_hash: validate inp before return Post r335356 it is possible to have an inpcb on the hash lists that is partially torn down. Validate before using. Also as a side effect of this change the lock ordering issue between hash lock and inpcb no longer exists allowing some simplification. Reported by: pho@ Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Thu Jun 21 18:13:04 2018 (r335499) +++ head/sys/netinet/in_pcb.c Thu Jun 21 18:40:15 2018 (r335500) @@ -2214,7 +2214,6 @@ found: INP_WUNLOCK(inp); else INP_RUNLOCK(inp); - INP_HASH_RUNLOCK(pcbinfo); return (NULL); } else if (!locked) in_pcbref(inp); @@ -2386,40 +2385,35 @@ in_pcblookup_hash(struct inpcbinfo *pcbinfo, struct in struct ifnet *ifp) { struct inpcb *inp; - bool locked; INP_HASH_RLOCK(pcbinfo); inp = in_pcblookup_hash_locked(pcbinfo, faddr, fport, laddr, lport, (lookupflags & ~(INPLOOKUP_RLOCKPCB | INPLOOKUP_WLOCKPCB)), ifp); if (inp != NULL) { - if (lookupflags & INPLOOKUP_WLOCKPCB) - locked = INP_TRY_WLOCK(inp); - else if (lookupflags & INPLOOKUP_RLOCKPCB) - locked = INP_TRY_RLOCK(inp); - else - panic("%s: locking bug", __func__); - if (!locked) - in_pcbref(inp); - INP_HASH_RUNLOCK(pcbinfo); - if (!locked) { - if (lookupflags & INPLOOKUP_WLOCKPCB) { - INP_WLOCK(inp); - if (in_pcbrele_wlocked(inp)) - return (NULL); - } else { - INP_RLOCK(inp); - if (in_pcbrele_rlocked(inp)) - return (NULL); + if (lookupflags & INPLOOKUP_WLOCKPCB) { + INP_WLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_WUNLOCK(inp); + inp = NULL; } - } + } else if (lookupflags & INPLOOKUP_RLOCKPCB) { + INP_RLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) { + INP_RUNLOCK(inp); + inp = NULL; + } + } else + panic("%s: locking bug", __func__); #ifdef INVARIANTS - if (lookupflags & INPLOOKUP_WLOCKPCB) - INP_WLOCK_ASSERT(inp); - else - INP_RLOCK_ASSERT(inp); + if (inp != NULL) { + if (lookupflags & INPLOOKUP_WLOCKPCB) + INP_WLOCK_ASSERT(inp); + else + INP_RLOCK_ASSERT(inp); + } #endif - } else - INP_HASH_RUNLOCK(pcbinfo); + } + INP_HASH_RUNLOCK(pcbinfo); return (inp); } From owner-svn-src-all@freebsd.org Thu Jun 21 19:03:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 560A1102667C; Thu, 21 Jun 2018 19:03:00 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from mail.soaustin.net (mail.soaustin.net [18.222.6.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.soaustin.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F21268AA20; Thu, 21 Jun 2018 19:02:59 +0000 (UTC) (envelope-from linimon@lonesome.com) Received: from lonesome.com (unknown [18.188.142.31]) by mail.soaustin.net (Postfix) with ESMTPSA id 158C724933; Thu, 21 Jun 2018 19:02:59 +0000 (UTC) Date: Thu, 21 Jun 2018 19:02:57 +0000 From: Mark Linimon To: Ian Lepore Cc: cem@freebsd.org, Stephen Kiernan , svn-src-head@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, src-committers Subject: Re: svn commit: r335402 - head/sbin/veriexecctl Message-ID: <20180621190256.GE3654@lonesome.com> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <1529606006.24573.30.camel@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1529606006.24573.30.camel@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 19:03:00 -0000 On Thu, Jun 21, 2018 at 12:33:26PM -0600, Ian Lepore wrote: > Hiding work in patchsets and reviews and alternate branches and other > shadowy places because it's not perfect I do not consider bugzilla and phabricator to be "shadowy places"; therefore, I reject this argument. Although I don't have statistics, AFAICT phabricator patches have a better-than-even chance of going in. But, in any case, a middle position would have been to commit this to a vendor branch and publish instructions on how to grab it from there and enable it. I understand that -current will have regressions in it. However, the pendulum has recently swung in the direction of "free-for-all". This slows down (e.g.) my own work on -currernt such as testing arm boards and trying to fix ports there. ATM I'm not even *attempting* to do the latter because I have little faith that any -current I bring in past the one I'm locked down to (r333619 May 16 UTC 2018) will do anything but burn my time trying to track down regressions. tl:dr; I have enough work to do without trying to fix other people's stuff. If that's harsh, so be it. mcl From owner-svn-src-all@freebsd.org Thu Jun 21 19:35:36 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB5C41026D95 for ; Thu, 21 Jun 2018 19:35:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 67C638B8B0 for ; Thu, 21 Jun 2018 19:35:35 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: 3e2d89d8-758a-11e8-b829-b3adae557cda X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id 3e2d89d8-758a-11e8-b829-b3adae557cda; Thu, 21 Jun 2018 19:35:27 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5LJZOZ5085541; Thu, 21 Jun 2018 13:35:24 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529609724.24573.40.camel@freebsd.org> Subject: Re: svn commit: r335402 - head/sbin/veriexecctl From: Ian Lepore To: Mark Linimon Cc: cem@freebsd.org, Stephen Kiernan , svn-src-head@freebsd.org, Eitan Adler , svn-src-all@freebsd.org, src-committers Date: Thu, 21 Jun 2018 13:35:24 -0600 In-Reply-To: <20180621190256.GE3654@lonesome.com> References: <201806200108.w5K18sIR050132@repo.freebsd.org> <1529606006.24573.30.camel@freebsd.org> <20180621190256.GE3654@lonesome.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 19:35:36 -0000 On Thu, 2018-06-21 at 19:02 +0000, Mark Linimon wrote: > On Thu, Jun 21, 2018 at 12:33:26PM -0600, Ian Lepore wrote: > > > > Hiding work in patchsets and reviews and alternate branches and > > other > > shadowy places because it's not perfect > I do not consider bugzilla and phabricator to be "shadowy places"; > therefore, I reject this argument. > > Although I don't have statistics, AFAICT phabricator patches have a > better-than-even chance of going in. > > But, in any case, a middle position would have been to commit this to > a vendor branch and publish instructions on how to grab it from there > and enable it. > > I understand that -current will have regressions in it.  However, the > pendulum has recently swung in the direction of "free-for-all".  This > slows down (e.g.) my own work on -currernt such as testing arm boards > and trying to fix ports there.  ATM I'm not even *attempting* to do > the > latter because I have little faith that any -current I bring in past > the one I'm locked down to (r333619 May 16 UTC 2018) will do anything > but burn my time trying to track down regressions. > > tl:dr; I have enough work to do without trying to fix other people's > stuff.  If that's harsh, so be it. > > mcl > I guess you missed the part about all of this new code being optional and compiled-in only if you add the new options to your kernel config? -- Ian From owner-svn-src-all@freebsd.org Thu Jun 21 20:18:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 93C4610276E4; Thu, 21 Jun 2018 20:18:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 493B58CABF; Thu, 21 Jun 2018 20:18:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A5F216A55; Thu, 21 Jun 2018 20:18:24 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LKIO8s025491; Thu, 21 Jun 2018 20:18:24 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LKIO2h025490; Thu, 21 Jun 2018 20:18:24 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806212018.w5LKIO2h025490@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Thu, 21 Jun 2018 20:18:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335501 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335501 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 20:18:24 -0000 Author: mmacy Date: Thu Jun 21 20:18:23 2018 New Revision: 335501 URL: https://svnweb.freebsd.org/changeset/base/335501 Log: raw_ip: validate inp in both loops Continuation of r335497. Also move the lock acquisition up to validate before referencing inp_cred. Reported by: pho Modified: head/sys/netinet/raw_ip.c Modified: head/sys/netinet/raw_ip.c ============================================================================== --- head/sys/netinet/raw_ip.c Thu Jun 21 18:40:15 2018 (r335500) +++ head/sys/netinet/raw_ip.c Thu Jun 21 20:18:23 2018 (r335501) @@ -312,29 +312,31 @@ rip_input(struct mbuf **mp, int *offp, int proto) continue; if (inp->inp_faddr.s_addr != ip->ip_src.s_addr) continue; - if (jailed_without_vnet(inp->inp_cred)) { - /* - * XXX: If faddr was bound to multicast group, - * jailed raw socket will drop datagram. - */ - if (prison_check_ip4(inp->inp_cred, &ip->ip_dst) != 0) - continue; - } if (last != NULL) { struct mbuf *n; n = m_copym(m, 0, M_COPYALL, M_NOWAIT); if (n != NULL) - (void) rip_append(last, ip, n, &ripsrc); + (void) rip_append(last, ip, n, &ripsrc); /* XXX count dropped packet */ INP_RUNLOCK(last); + last = NULL; } INP_RLOCK(inp); - last = inp; - if (__predict_false(inp->inp_flags2 & INP_FREED)) { - last = NULL; - INP_RUNLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) + goto skip_1; + if (jailed_without_vnet(inp->inp_cred)) { + /* + * XXX: If faddr was bound to multicast group, + * jailed raw socket will drop datagram. + */ + if (prison_check_ip4(inp->inp_cred, &ip->ip_dst) != 0) + goto skip_1; } + last = inp; + continue; + skip_1: + INP_RUNLOCK(inp); } CK_LIST_FOREACH(inp, &V_ripcbinfo.ipi_hashbase[0], inp_hash) { if (inp->inp_ip_p && inp->inp_ip_p != proto) @@ -350,6 +352,19 @@ rip_input(struct mbuf **mp, int *offp, int proto) if (!in_nullhost(inp->inp_faddr) && !in_hosteq(inp->inp_faddr, ip->ip_src)) continue; + if (last != NULL) { + struct mbuf *n; + + n = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (n != NULL) + (void) rip_append(last, ip, n, &ripsrc); + /* XXX count dropped packet */ + INP_RUNLOCK(last); + last = NULL; + } + INP_RLOCK(inp); + if (__predict_false(inp->inp_flags2 & INP_FREED)) + goto skip_2; if (jailed_without_vnet(inp->inp_cred)) { /* * Allow raw socket in jail to receive multicast; @@ -358,7 +373,7 @@ rip_input(struct mbuf **mp, int *offp, int proto) */ if (!IN_MULTICAST(ntohl(ip->ip_dst.s_addr)) && prison_check_ip4(inp->inp_cred, &ip->ip_dst) != 0) - continue; + goto skip_2; } /* * If this raw socket has multicast state, and we @@ -399,20 +414,13 @@ rip_input(struct mbuf **mp, int *offp, int proto) if (blocked != MCAST_PASS) { IPSTAT_INC(ips_notmember); - continue; + goto skip_2; } } - if (last != NULL) { - struct mbuf *n; - - n = m_copym(m, 0, M_COPYALL, M_NOWAIT); - if (n != NULL) - (void) rip_append(last, ip, n, &ripsrc); - /* XXX count dropped packet */ - INP_RUNLOCK(last); - } - INP_RLOCK(inp); last = inp; + continue; + skip_2: + INP_RUNLOCK(inp); } INP_INFO_RUNLOCK(&V_ripcbinfo); if (last != NULL) { From owner-svn-src-all@freebsd.org Thu Jun 21 21:03:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08146100043E; Thu, 21 Jun 2018 21:03:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1ED88E26A; Thu, 21 Jun 2018 21:03:58 +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 93120172A1; Thu, 21 Jun 2018 21:03:58 +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 w5LL3wM4051762; Thu, 21 Jun 2018 21:03:58 GMT (envelope-from rrs@FreeBSD.org) Received: (from rrs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LL3wlo051761; Thu, 21 Jun 2018 21:03:58 GMT (envelope-from rrs@FreeBSD.org) Message-Id: <201806212103.w5LL3wlo051761@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rrs set sender to rrs@FreeBSD.org using -f From: Randall Stewart Date: Thu, 21 Jun 2018 21:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335502 - head/sys/netinet X-SVN-Group: head X-SVN-Commit-Author: rrs X-SVN-Commit-Paths: head/sys/netinet X-SVN-Commit-Revision: 335502 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:03:59 -0000 Author: rrs Date: Thu Jun 21 21:03:58 2018 New Revision: 335502 URL: https://svnweb.freebsd.org/changeset/base/335502 Log: This adds in an optimization so that we only walk one time through the mbuf chain during copy and TSO limiting. It is used by both Rack and now the FreeBSD stack. Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D15937 Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Thu Jun 21 20:18:23 2018 (r335501) +++ head/sys/netinet/tcp_output.c Thu Jun 21 21:03:58 2018 (r335502) @@ -209,6 +209,8 @@ tcp_output(struct tcpcb *tp) int32_t len; uint32_t recwin, sendwin; int off, flags, error = 0; /* Keep compiler happy */ + u_int if_hw_tsomaxsegcount = 0; + u_int if_hw_tsomaxsegsize; struct mbuf *m; struct ip *ip = NULL; #ifdef TCPDEBUG @@ -879,9 +881,6 @@ send: if (tso) { u_int if_hw_tsomax; - u_int if_hw_tsomaxsegcount; - u_int if_hw_tsomaxsegsize; - struct mbuf *mb; u_int moff; int max_len; @@ -913,66 +912,7 @@ send: len = max_len; } } - /* - * Check if we should limit by maximum segment - * size and count: - */ - if (if_hw_tsomaxsegcount != 0 && - if_hw_tsomaxsegsize != 0) { - /* - * Subtract one segment for the LINK - * and TCP/IP headers mbuf that will - * be prepended to this mbuf chain - * after the code in this section - * limits the number of mbufs in the - * chain to if_hw_tsomaxsegcount. - */ - if_hw_tsomaxsegcount -= 1; - max_len = 0; - mb = sbsndmbuf(&so->so_snd, off, &moff); - - while (mb != NULL && max_len < len) { - u_int mlen; - u_int frags; - - /* - * Get length of mbuf fragment - * and how many hardware frags, - * rounded up, it would use: - */ - mlen = (mb->m_len - moff); - frags = howmany(mlen, - if_hw_tsomaxsegsize); - - /* Handle special case: Zero Length Mbuf */ - if (frags == 0) - frags = 1; - - /* - * Check if the fragment limit - * will be reached or exceeded: - */ - if (frags >= if_hw_tsomaxsegcount) { - max_len += min(mlen, - if_hw_tsomaxsegcount * - if_hw_tsomaxsegsize); - break; - } - max_len += mlen; - if_hw_tsomaxsegcount -= frags; - moff = 0; - mb = mb->m_next; - } - if (max_len <= 0) { - len = 0; - } else if (len > max_len) { - sendalot = 1; - len = max_len; - } - } - - /* * Prevent the last segment from being * fractional unless the send sockbuf can be * emptied: @@ -1006,7 +946,6 @@ send: */ if (tp->t_flags & TF_NEEDFIN) sendalot = 1; - } else { len = tp->t_maxseg - optlen - ipoptlen; sendalot = 1; @@ -1041,6 +980,7 @@ send: */ if (len) { struct mbuf *mb; + struct sockbuf *msb; u_int moff; if ((tp->t_flags & TF_FORCEDATA) && len == 1) @@ -1074,14 +1014,30 @@ send: * Start the m_copy functions from the closest mbuf * to the offset in the socket buffer chain. */ - mb = sbsndptr(&so->so_snd, off, len, &moff); - + mb = sbsndptr_noadv(&so->so_snd, off, &moff); if (len <= MHLEN - hdrlen - max_linkhdr) { m_copydata(mb, moff, len, mtod(m, caddr_t) + hdrlen); + if (SEQ_LT(tp->snd_nxt, tp->snd_max)) + sbsndptr_adv(&so->so_snd, mb, len); m->m_len += len; } else { - m->m_next = m_copym(mb, moff, len, M_NOWAIT); + if (SEQ_LT(tp->snd_nxt, tp->snd_max)) + msb = NULL; + else + msb = &so->so_snd; + m->m_next = tcp_m_copym(mb, moff, + &len, if_hw_tsomaxsegcount, + if_hw_tsomaxsegsize, msb); + if (len <= (tp->t_maxseg - optlen)) { + /* + * Must have ran out of mbufs for the copy + * shorten it to no longer need tso. Lets + * not put on sendalot since we are low on + * mbufs. + */ + tso = 0; + } if (m->m_next == NULL) { SOCKBUF_UNLOCK(&so->so_snd); (void) m_free(m); From owner-svn-src-all@freebsd.org Thu Jun 21 21:07:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECD1C1000502; Thu, 21 Jun 2018 21:07:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A00DD8E446; Thu, 21 Jun 2018 21:07:26 +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 81026172BF; Thu, 21 Jun 2018 21:07:26 +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 w5LL7Q6q051960; Thu, 21 Jun 2018 21:07:26 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LL7Qoe051958; Thu, 21 Jun 2018 21:07:26 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806212107.w5LL7Qoe051958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:07:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335503 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 335503 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:07:27 -0000 Author: kib Date: Thu Jun 21 21:07:25 2018 New Revision: 335503 URL: https://svnweb.freebsd.org/changeset/base/335503 Log: Update proc->p_ptevents annotation to reflect the actual locking. Submitted by: Yanko Yankulov Reviewed by: jhb MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15954 Modified: head/sys/kern/sys_process.c head/sys/sys/proc.h Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Thu Jun 21 21:03:58 2018 (r335502) +++ head/sys/kern/sys_process.c Thu Jun 21 21:07:25 2018 (r335503) @@ -688,6 +688,7 @@ void proc_set_traced(struct proc *p, bool stop) { + sx_assert(&proctree_lock, SX_XLOCKED); PROC_LOCK_ASSERT(p, MA_OWNED); p->p_flag |= P_TRACED; if (stop) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 21 21:03:58 2018 (r335502) +++ head/sys/sys/proc.h Thu Jun 21 21:07:25 2018 (r335503) @@ -633,7 +633,7 @@ struct proc { u_int p_stype; /* (c) Stop event type. */ char p_step; /* (c) Process is stopped. */ u_char p_pfsflags; /* (c) Procfs flags. */ - u_int p_ptevents; /* (c) ptrace() event mask. */ + u_int p_ptevents; /* (c + e) ptrace() event mask. */ struct nlminfo *p_nlminfo; /* (?) Only used by/for lockd. */ struct kaioinfo *p_aioinfo; /* (y) ASYNC I/O info. */ struct thread *p_singlethread;/* (c + j) If single threading this is it */ From owner-svn-src-all@freebsd.org Thu Jun 21 21:10:38 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 566D710005B5; Thu, 21 Jun 2018 21:10:38 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (br1.CN84in.dnsmgr.net [69.59.192.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A80028E61E; Thu, 21 Jun 2018 21:10:37 +0000 (UTC) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: from pdx.rh.CN85.dnsmgr.net (localhost [127.0.0.1]) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3) with ESMTP id w5LLAX2N081258; Thu, 21 Jun 2018 14:10:34 -0700 (PDT) (envelope-from freebsd@pdx.rh.CN85.dnsmgr.net) Received: (from freebsd@localhost) by pdx.rh.CN85.dnsmgr.net (8.13.3/8.13.3/Submit) id w5LLAXXS081257; Thu, 21 Jun 2018 14:10:33 -0700 (PDT) (envelope-from freebsd) From: "Rodney W. Grimes" Message-Id: <201806212110.w5LLAXXS081257@pdx.rh.CN85.dnsmgr.net> Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: <1529606006.24573.30.camel@freebsd.org> To: Ian Lepore Date: Thu, 21 Jun 2018 14:10:33 -0700 (PDT) CC: cem@freebsd.org, Stephen Kiernan , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Reply-To: rgrimes@freebsd.org X-Mailer: ELM [version 2.4ME+ PL121h (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:10:38 -0000 ... > > Hi, > > > > While the code is out of HEAD, it can be posted to a github branch > > (or > > a projects/ branch if you prefer SVN) for people to try. > > > > Best regards, > > Conrad > > > > Yeah, put it on a branch where it'll get ignored for another two years. > > If this code had been committed long ago, as it probably should have > been, then people would have been playing with it, and by time I needed > it a few months ago there would have been all kinds of useful info in > mailing lists and blogs about how to set it up and what was good and > bad about it and so on. ?Iterative refinement would have been underway. > > Instead what I found was a bunch of patches and a big steep learning > curve with no existing information about using it in the real world. > With that info available, I/we ($work) would have been in a position to > quickly adopt it and begin contributing to the ongoing refinement. > Instead I had to conclude that product deadlines just didn't allow us > to even try to get it working from a standing start as first-adopters, > so we had to move in a different direction. Even though this is a > better solution than what we did, business practicalities will likely > prevent us from circling back and changing everything over to this > scheme in the future, so now we'll end up never contributing much to > this work. > > So, IMO, all this calling for things to be reverted isn't just > inappropriate, it's actively harmful. This is -current where > development happens and imperfection is expected. Hiding work in > patchsets and reviews and alternate branches and other shadowy places > because it's not perfect is just a way of ensuring it never gets any > better. I am with Ian on this one, we have far too much code sitting out of tree and rotting faster than anyone can maintain said code out of tree, meaning we are litterly cutting our own developement efforts off, not at just the foot but up closer to the hip. The veriexec code landed, its in tree, fix it, polish it, cut out the ugly bits, but for sake of sanity do not whole sale revert it so it can generally rot some more. Officially this code is on the 12.0 target path, it needs to be in the tree sooner where many eyes can work on it. -- Rod Grimes rgrimes@freebsd.org From owner-svn-src-all@freebsd.org Thu Jun 21 21:12:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4850010007C4; Thu, 21 Jun 2018 21:12:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E05628EAAB; Thu, 21 Jun 2018 21:12:50 +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 BE7C917453; Thu, 21 Jun 2018 21:12:50 +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 w5LLConq056900; Thu, 21 Jun 2018 21:12:50 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLCnVV056896; Thu, 21 Jun 2018 21:12:49 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806212112.w5LLCnVV056896@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:12:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335504 - in head/sys: kern sys X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in head/sys: kern sys X-SVN-Commit-Revision: 335504 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:12:51 -0000 Author: kib Date: Thu Jun 21 21:12:49 2018 New Revision: 335504 URL: https://svnweb.freebsd.org/changeset/base/335504 Log: fork: avoid endless wait with PTRACE_FORK and RFSTOPPED. An RFSTOPPED thread can't clean TDB_STOPATFORK, which is done in the fork_return() in its context, so parent is stuck forever. Triggered when trying to ptrace linux process. Instead of waiting for the new thread to clear TDB_STOPATFORK, tag it as traced and reparent to the debugger in do_fork(), and let it only notify the debugger when run. Submitted by: Yanko Yankulov Reviewed by: jhb MFC after: 1 week X-MFC-Note: keep p_dbgwait placeholder intact Differential revision: https://reviews.freebsd.org/D15857 Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_sig.c head/sys/sys/proc.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Thu Jun 21 21:07:25 2018 (r335503) +++ head/sys/kern/kern_fork.c Thu Jun 21 21:12:49 2018 (r335504) @@ -721,18 +721,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct * but before we wait for the debugger. */ _PHOLD(p2); - if (p1->p_ptevents & PTRACE_FORK) { - /* - * Arrange for debugger to receive the fork event. - * - * We can report PL_FLAG_FORKED regardless of - * P_FOLLOWFORK settings, but it does not make a sense - * for runaway child. - */ - td->td_dbgflags |= TDB_FORK; - td->td_dbg_forked = p2->p_pid; - td2->td_dbgflags |= TDB_STOPATFORK; - } if (fr->fr_flags & RFPPWAIT) { td->td_pflags |= TDP_RFPPWAIT; td->td_rfppwait_p = p2; @@ -756,7 +744,42 @@ do_fork(struct thread *td, struct fork_req *fr, struct procdesc_finit(p2->p_procdesc, fp_procdesc); fdrop(fp_procdesc, td); } - + + /* + * Speculative check for PTRACE_FORK. PTRACE_FORK is not + * synced with forks in progress so it is OK if we miss it + * if being set atm. + */ + if ((p1->p_ptevents & PTRACE_FORK) != 0) { + sx_xlock(&proctree_lock); + PROC_LOCK(p2); + + /* + * p1->p_ptevents & p1->p_pptr are protected by both + * process and proctree locks for modifications, + * so owning proctree_lock allows the race-free read. + */ + if ((p1->p_ptevents & PTRACE_FORK) != 0) { + /* + * Arrange for debugger to receive the fork event. + * + * We can report PL_FLAG_FORKED regardless of + * P_FOLLOWFORK settings, but it does not make a sense + * for runaway child. + */ + td->td_dbgflags |= TDB_FORK; + td->td_dbg_forked = p2->p_pid; + td2->td_dbgflags |= TDB_STOPATFORK; + proc_set_traced(p2, true); + CTR2(KTR_PTRACE, + "do_fork: attaching to new child pid %d: oppid %d", + p2->p_pid, p2->p_oppid); + proc_reparent(p2, p1->p_pptr); + } + PROC_UNLOCK(p2); + sx_xunlock(&proctree_lock); + } + if ((fr->fr_flags & RFSTOPPED) == 0) { /* * If RFSTOPPED not requested, make child runnable and @@ -773,11 +796,6 @@ do_fork(struct thread *td, struct fork_req *fr, struct } PROC_LOCK(p2); - /* - * Wait until debugger is attached to child. - */ - while (td2->td_proc == p2 && (td2->td_dbgflags & TDB_STOPATFORK) != 0) - cv_wait(&p2->p_dbgwait, &p2->p_mtx); _PRELE(p2); racct_proc_fork_done(p2); PROC_UNLOCK(p2); @@ -1063,24 +1081,15 @@ fork_exit(void (*callout)(void *, struct trapframe *), void fork_return(struct thread *td, struct trapframe *frame) { - struct proc *p, *dbg; + struct proc *p; p = td->td_proc; if (td->td_dbgflags & TDB_STOPATFORK) { - sx_xlock(&proctree_lock); PROC_LOCK(p); - if (p->p_pptr->p_ptevents & PTRACE_FORK) { + if ((p->p_flag & P_TRACED) != 0) { /* - * If debugger still wants auto-attach for the - * parent's children, do it now. + * Inform the debugger if one is still present. */ - dbg = p->p_pptr->p_pptr; - proc_set_traced(p, true); - CTR2(KTR_PTRACE, - "fork_return: attaching to new child pid %d: oppid %d", - p->p_pid, p->p_oppid); - proc_reparent(p, dbg); - sx_xunlock(&proctree_lock); td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; ptracestop(td, SIGSTOP, NULL); td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); @@ -1088,9 +1097,7 @@ fork_return(struct thread *td, struct trapframe *frame /* * ... otherwise clear the request. */ - sx_xunlock(&proctree_lock); td->td_dbgflags &= ~TDB_STOPATFORK; - cv_broadcast(&p->p_dbgwait); } PROC_UNLOCK(p); } else if (p->p_flag & P_TRACED || td->td_dbgflags & TDB_BORN) { Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Thu Jun 21 21:07:25 2018 (r335503) +++ head/sys/kern/kern_proc.c Thu Jun 21 21:12:49 2018 (r335504) @@ -266,7 +266,6 @@ proc_init(void *mem, int size, int flags) mtx_init(&p->p_itimmtx, "pitiml", NULL, MTX_SPIN | MTX_NEW); mtx_init(&p->p_profmtx, "pprofl", NULL, MTX_SPIN | MTX_NEW); cv_init(&p->p_pwait, "ppwait"); - cv_init(&p->p_dbgwait, "dbgwait"); TAILQ_INIT(&p->p_threads); /* all threads in proc */ EVENTHANDLER_DIRECT_INVOKE(process_init, p); p->p_stats = pstats_alloc(); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Thu Jun 21 21:07:25 2018 (r335503) +++ head/sys/kern/kern_sig.c Thu Jun 21 21:12:49 2018 (r335504) @@ -2581,7 +2581,6 @@ ptracestop(struct thread *td, int sig, ksiginfo_t *si) } if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { td->td_dbgflags &= ~TDB_STOPATFORK; - cv_broadcast(&p->p_dbgwait); } stopme: thread_suspend_switch(td, p); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Thu Jun 21 21:07:25 2018 (r335503) +++ head/sys/sys/proc.h Thu Jun 21 21:12:49 2018 (r335504) @@ -685,8 +685,6 @@ struct proc { LIST_HEAD(, mqueue_notifier) p_mqnotifier; /* (c) mqueue notifiers.*/ struct kdtrace_proc *p_dtrace; /* (*) DTrace-specific data. */ struct cv p_pwait; /* (*) wait cv for exit/exec. */ - struct cv p_dbgwait; /* (*) wait cv for debugger attach - after fork. */ uint64_t p_prev_runtime; /* (c) Resource usage accounting. */ struct racct *p_racct; /* (b) Resource accounting. */ int p_throttled; /* (c) Flag for racct pcpu throttling */ From owner-svn-src-all@freebsd.org Thu Jun 21 21:15:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D69AC100086D; Thu, 21 Jun 2018 21:15:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 856F78EC1C; Thu, 21 Jun 2018 21:15:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 583AE17458; Thu, 21 Jun 2018 21:15:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LLF5Xb057048; Thu, 21 Jun 2018 21:15:05 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLF5Mj057047; Thu, 21 Jun 2018 21:15:05 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806212115.w5LLF5Mj057047@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335505 - head/sys/compat/linux X-SVN-Group: head X-SVN-Commit-Author: kib X-SVN-Commit-Paths: head/sys/compat/linux X-SVN-Commit-Revision: 335505 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:15:06 -0000 Author: kib Date: Thu Jun 21 21:15:04 2018 New Revision: 335505 URL: https://svnweb.freebsd.org/changeset/base/335505 Log: linux_clone_thread: mark new thread as TDB_BORN. So that the ptrace code will catch it and report it to attached debugger. Enables debugging of threaded Linux binaries with FreeBSD debugger. Submitted by: Yanko Yankulov MFC after: 1 week Differential revision: https://reviews.freebsd.org/D15880 Modified: head/sys/compat/linux/linux_fork.c Modified: head/sys/compat/linux/linux_fork.c ============================================================================== --- head/sys/compat/linux/linux_fork.c Thu Jun 21 21:12:49 2018 (r335504) +++ head/sys/compat/linux/linux_fork.c Thu Jun 21 21:15:04 2018 (r335505) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -352,6 +353,9 @@ linux_clone_thread(struct thread *td, struct linux_clo thread_unlock(td); if (P_SHOULDSTOP(p)) newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK; + + if (p->p_ptevents & PTRACE_LWP) + newtd->td_dbgflags |= TDB_BORN; PROC_UNLOCK(p); tidhash_add(newtd); From owner-svn-src-all@freebsd.org Thu Jun 21 21:16:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BC7B10008FB; Thu, 21 Jun 2018 21:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EFF18EDE2; Thu, 21 Jun 2018 21:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 111231748A; Thu, 21 Jun 2018 21:16:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LLGQOx057146; Thu, 21 Jun 2018 21:16:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLGQfH057142; Thu, 21 Jun 2018 21:16:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806212116.w5LLGQfH057142@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Thu, 21 Jun 2018 21:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335506 - in head/sys: conf dev/spibus X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: conf dev/spibus X-SVN-Commit-Revision: 335506 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:16:27 -0000 Author: ian Date: Thu Jun 21 21:16:26 2018 New Revision: 335506 URL: https://svnweb.freebsd.org/changeset/base/335506 Log: Incorporate bus and chip select numbers into spigen(4) cdev names. Rather than assigning spigen device names in order of creation, this uses a device name that corresponds to the owning spibus and chip-select index. Example: /dev/spigen0.1 would be a child of spibus0, and use cs = 1 The intent is for systems like Raspberry Pi to have a consistent way of using an SPI interface with a specific cs value from a user application. Otherwise, there is no consistent way of knowing which cs pin will be assigned to a particular spigen device. The alternative is to specify everything in "the right order" in an overlay file, which is less than ideal. Additionally, this duplicates (to some extent) the way Linux handles a similar situation with their 'spidev' device, so it would be somewhat familiar to those who also use Linux. A new kernel config option, SPIGEN_LEGACY_CDEVNAME, causes the driver to also create /dev/spigenN device name aliases, with N incrementing in the order of device instantiation. This is provided to ease the transition for existing systems using the original naming convention (particularly when these changes are MFC'd to stable branches). Differential Revision: https://reviews.freebsd.org/D15301 Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/spibus/spibus.c head/sys/dev/spibus/spigen.c Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Jun 21 21:15:04 2018 (r335505) +++ head/sys/conf/NOTES Thu Jun 21 21:16:26 2018 (r335506) @@ -3044,3 +3044,6 @@ options UINPUT_DEBUG # enable uinput debug msgs # Encrypted kernel crash dumps. options EKCD + +# Enable legacy /dev/spigenN name aliases for /dev/spigenX.Y devices. +options SPIGEN_LEGACY_CDEVNAME # legacy device names for spigen Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Jun 21 21:15:04 2018 (r335505) +++ head/sys/conf/options Thu Jun 21 21:16:26 2018 (r335506) @@ -992,6 +992,9 @@ BHND_LOGLEVEL opt_global.h # GPIO and child devices GPIO_SPI_DEBUG opt_gpio.h +# SPI devices +SPIGEN_LEGACY_CDEVNAME opt_spi.h + # etherswitch(4) driver RTL8366_SOFT_RESET opt_etherswitch.h Modified: head/sys/dev/spibus/spibus.c ============================================================================== --- head/sys/dev/spibus/spibus.c Thu Jun 21 21:15:04 2018 (r335505) +++ head/sys/dev/spibus/spibus.c Thu Jun 21 21:16:26 2018 (r335506) @@ -122,8 +122,10 @@ spibus_child_location_str(device_t bus, device_t child size_t buflen) { struct spibus_ivar *devi = SPIBUS_IVAR(child); + int cs; - snprintf(buf, buflen, "cs=%d", devi->cs); + cs = devi->cs & ~SPIBUS_CS_HIGH; /* trim 'cs high' bit */ + snprintf(buf, buflen, "bus=%d cs=%d", device_get_unit(bus), cs); return (0); } Modified: head/sys/dev/spibus/spigen.c ============================================================================== --- head/sys/dev/spibus/spigen.c Thu Jun 21 21:15:04 2018 (r335505) +++ head/sys/dev/spibus/spigen.c Thu Jun 21 21:16:26 2018 (r335506) @@ -26,6 +26,7 @@ __FBSDID("$FreeBSD$"); #include "opt_platform.h" +#include "opt_spi.h" #include #include @@ -64,6 +65,9 @@ __FBSDID("$FreeBSD$"); struct spigen_softc { device_t sc_dev; struct cdev *sc_cdev; +#ifdef SPIGEN_LEGACY_CDEVNAME + struct cdev *sc_adev; /* alias device */ +#endif struct mtx sc_mtx; uint32_t sc_command_length_max; /* cannot change while mmapped */ uint32_t sc_data_length_max; /* cannot change while mmapped */ @@ -186,15 +190,46 @@ spigen_attach(device_t dev) { struct spigen_softc *sc; const int unit = device_get_unit(dev); + int cs, res; + struct make_dev_args mda; + spibus_get_cs(dev, &cs); + cs &= ~SPIBUS_CS_HIGH; /* trim 'cs high' bit */ + sc = device_get_softc(dev); sc->sc_dev = dev; - sc->sc_cdev = make_dev(&spigen_cdevsw, unit, - UID_ROOT, GID_OPERATOR, 0660, "spigen%d", unit); - sc->sc_cdev->si_drv1 = dev; sc->sc_command_length_max = PAGE_SIZE; sc->sc_data_length_max = PAGE_SIZE; + mtx_init(&sc->sc_mtx, device_get_nameunit(dev), NULL, MTX_DEF); + + make_dev_args_init(&mda); + mda.mda_flags = MAKEDEV_WAITOK; + mda.mda_devsw = &spigen_cdevsw; + mda.mda_cr = NULL; + mda.mda_uid = UID_ROOT; + mda.mda_gid = GID_OPERATOR; + mda.mda_mode = 0660; + mda.mda_unit = unit; + mda.mda_si_drv1 = dev; + + res = make_dev_s(&mda, &(sc->sc_cdev), "spigen%d.%d", + device_get_unit(device_get_parent(dev)), cs); + if (res) { + return res; + } + +#ifdef SPIGEN_LEGACY_CDEVNAME + res = make_dev_alias_p(0, &sc->sc_adev, sc->sc_cdev, "spigen%d", unit); + if (res) { + if (sc->sc_cdev) { + destroy_dev(sc->sc_cdev); + sc->sc_cdev = NULL; + } + return res; + } +#endif + spigen_sysctl_init(sc); return (0); @@ -429,8 +464,13 @@ spigen_detach(device_t dev) mtx_destroy(&sc->sc_mtx); - if (sc->sc_cdev) - destroy_dev(sc->sc_cdev); +#ifdef SPIGEN_LEGACY_CDEVNAME + if (sc->sc_adev) + destroy_dev(sc->sc_adev); +#endif + + if (sc->sc_cdev) + destroy_dev(sc->sc_cdev); return (0); } From owner-svn-src-all@freebsd.org Thu Jun 21 21:19:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 500F310009AE; Thu, 21 Jun 2018 21:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 022FD8EFAA; Thu, 21 Jun 2018 21:19:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D41CF1749E; Thu, 21 Jun 2018 21:19:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5LLJmYm057324; Thu, 21 Jun 2018 21:19:48 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLJmSA057323; Thu, 21 Jun 2018 21:19:48 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806212119.w5LLJmSA057323@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:19:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335507 - stable/11/sys/amd64/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/amd64/linux X-SVN-Commit-Revision: 335507 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:19:49 -0000 Author: kib Date: Thu Jun 21 21:19:48 2018 New Revision: 335507 URL: https://svnweb.freebsd.org/changeset/base/335507 Log: MFC r335135: linuxolator/amd64: Don't mangle %r10 on return from syscall for EJUSTRETURN. Modified: stable/11/sys/amd64/linux/linux_sysvec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/linux/linux_sysvec.c ============================================================================== --- stable/11/sys/amd64/linux/linux_sysvec.c Thu Jun 21 21:16:26 2018 (r335506) +++ stable/11/sys/amd64/linux/linux_sysvec.c Thu Jun 21 21:19:48 2018 (r335507) @@ -257,7 +257,8 @@ linux_set_syscall_retval(struct thread *td, int error) * So, do not clobber %rdx and %r10 */ td->td_retval[1] = frame->tf_rdx; - frame->tf_r10 = frame->tf_rcx; + if (error != EJUSTRETURN) + frame->tf_r10 = frame->tf_rcx; cpu_set_syscall_retval(td, error); From owner-svn-src-all@freebsd.org Thu Jun 21 21:21:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 569211000A51; Thu, 21 Jun 2018 21:21:17 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A7138F17E; Thu, 21 Jun 2018 21:21:17 +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 DFB59174E0; Thu, 21 Jun 2018 21:21:16 +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 w5LLLGjC060356; Thu, 21 Jun 2018 21:21:16 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLLG9r060355; Thu, 21 Jun 2018 21:21:16 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806212121.w5LLLG9r060355@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 Jun 2018 21:21:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335508 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 335508 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:21:17 -0000 Author: kib Date: Thu Jun 21 21:21:16 2018 New Revision: 335508 URL: https://svnweb.freebsd.org/changeset/base/335508 Log: MFC r335171: Handle the race between fork/vm_object_split() and faults. Modified: stable/11/sys/vm/swap_pager.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/swap_pager.c ============================================================================== --- stable/11/sys/vm/swap_pager.c Thu Jun 21 21:19:48 2018 (r335507) +++ stable/11/sys/vm/swap_pager.c Thu Jun 21 21:21:16 2018 (r335508) @@ -1096,21 +1096,24 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, int *rahead) { struct buf *bp; - vm_page_t mpred, msucc, p; + vm_page_t bm, mpred, msucc, p; vm_pindex_t pindex; daddr_t blk; - int i, j, maxahead, maxbehind, reqcount, shift; + int i, maxahead, maxbehind, reqcount; reqcount = count; - VM_OBJECT_WUNLOCK(object); - bp = getpbuf(&nsw_rcount); - VM_OBJECT_WLOCK(object); - - if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) { - relpbuf(bp, &nsw_rcount); + /* + * Determine the final number of read-behind pages and + * allocate them BEFORE releasing the object lock. Otherwise, + * there can be a problematic race with vm_object_split(). + * Specifically, vm_object_split() might first transfer pages + * that precede ma[0] in the current object to a new object, + * and then this function incorrectly recreates those pages as + * read-behind pages in the current object. + */ + if (!swap_pager_haspage(object, ma[0]->pindex, &maxbehind, &maxahead)) return (VM_PAGER_FAIL); - } /* * Clip the readahead and readbehind ranges to exclude resident pages. @@ -1132,35 +1135,31 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, *rbehind = pindex - mpred->pindex - 1; } + bm = ma[0]; + for (i = 0; i < count; i++) + ma[i]->oflags |= VPO_SWAPINPROG; + /* * Allocate readahead and readbehind pages. */ - shift = rbehind != NULL ? *rbehind : 0; - if (shift != 0) { - for (i = 1; i <= shift; i++) { + if (rbehind != NULL) { + for (i = 1; i <= *rbehind; i++) { p = vm_page_alloc(object, ma[0]->pindex - i, VM_ALLOC_NORMAL); - if (p == NULL) { - /* Shift allocated pages to the left. */ - for (j = 0; j < i - 1; j++) - bp->b_pages[j] = - bp->b_pages[j + shift - i + 1]; + if (p == NULL) break; - } - bp->b_pages[shift - i] = p; + p->oflags |= VPO_SWAPINPROG; + bm = p; } - shift = i - 1; - *rbehind = shift; + *rbehind = i - 1; } - for (i = 0; i < reqcount; i++) - bp->b_pages[i + shift] = ma[i]; if (rahead != NULL) { for (i = 0; i < *rahead; i++) { p = vm_page_alloc(object, ma[reqcount - 1]->pindex + i + 1, VM_ALLOC_NORMAL); if (p == NULL) break; - bp->b_pages[shift + reqcount + i] = p; + p->oflags |= VPO_SWAPINPROG; } *rahead = i; } @@ -1171,15 +1170,18 @@ swap_pager_getpages(vm_object_t object, vm_page_t *ma, vm_object_pip_add(object, count); - for (i = 0; i < count; i++) - bp->b_pages[i]->oflags |= VPO_SWAPINPROG; - - pindex = bp->b_pages[0]->pindex; + pindex = bm->pindex; blk = swp_pager_meta_ctl(object, pindex, 0); KASSERT(blk != SWAPBLK_NONE, ("no swap blocking containing %p(%jx)", object, (uintmax_t)pindex)); VM_OBJECT_WUNLOCK(object); + bp = getpbuf(&nsw_rcount); + /* Pages cannot leave the object while busy. */ + for (i = 0, p = bm; i < count; i++, p = TAILQ_NEXT(p, listq)) { + MPASS(p->pindex == bm->pindex + i); + bp->b_pages[i] = p; + } bp->b_flags |= B_PAGING; bp->b_iocmd = BIO_READ; From owner-svn-src-all@freebsd.org Thu Jun 21 21:45:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A8F01001150 for ; Thu, 21 Jun 2018 21:45:34 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BB17C8FE33 for ; Thu, 21 Jun 2018 21:45:33 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x231.google.com with SMTP id r24-v6so4343883ioh.9 for ; Thu, 21 Jun 2018 14:45:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=KMFkxN28CMf4OOcSDvzzuMlhK6J7IP89uhrHbZHk/H0=; b=XY0OZH8a8TRbxnw42BK72YuiemsMIX6CBxU18maFYOgXKKuW2f15oXSaIuHKrltPe0 65rEUgnB0bfY/u32OfVAzM0LwmS/BsHurYDfabYsoFRyu7EzFMfNr9yVfOv+Yau8RDL7 g2HT6wN8BrYycBfN2fJbcm2p1vkBlqc03R5kfxiqpTJWkEy3BV4HJqn0m0+VHvPpC/l/ WrcXk+tGSLNtfHcjYUq4i/gZqmIWNXagH/83qSlzmGIdghLXheuaahSfuNJSWSEj8dau /zMDkv2Ndw3BDtFPNr8Ddogjm61KYFaq5d2EjzovuQYxcfA7gaXHUsM5c2tr6AXPYB5Q 4kWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=KMFkxN28CMf4OOcSDvzzuMlhK6J7IP89uhrHbZHk/H0=; b=KsnNoQXYS64NkqW7axVcnMOqHJb7mW1EP1ujwQqu/prtoZ4BOLJWSueNtAiPsk6OBn OwvzGsCTuS+6jHi+K+BBPwmVVTlWMANlKRAeb5HHp7JgnlfVrXqcHtzTlV0aA6Y4nBVs IgKAaXrCgKdu0DsCYA7toWefNahIZkXhXvaE68K66wB+que/+DiW8gc/4RFR0edCU8Gp EwcNOlfpJIqF+x+SevVp9Ab7MOmRWo7VnpL23bTNg3sukL95/ZnFucM7SkTAk7fHOdX3 +QSE5iMAqfc+MWw8PtXsQjsaFIzSDEASW7+nAzxZKsyFwQQY7w0RLRmRrQCYTUsUSlr5 UZNQ== X-Gm-Message-State: APt69E2WoB/A6pETN27OMN1uDLalmzETyOjgKXHbx9a/OzAsLmhg8eDQ 5onUnvas0Yj2rNc4mVWFYEeIZ82L+O/nv3l11Rtytw== X-Google-Smtp-Source: ADUXVKKBW8AtQnrfQ1d/6JXxqcPPMf1544H8EtNYPFsifOAKfJzbGgiT5KeGx6ANNe5ogpztyEYQbSevSLep9wYG7/A= X-Received: by 2002:a6b:284b:: with SMTP id o72-v6mr22137211ioo.168.1529617533024; Thu, 21 Jun 2018 14:45:33 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 2002:a4f:5945:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 14:45:32 -0700 (PDT) X-Originating-IP: [50.227.106.226] In-Reply-To: <201806212110.w5LLAXXS081257@pdx.rh.CN85.dnsmgr.net> References: <1529606006.24573.30.camel@freebsd.org> <201806212110.w5LLAXXS081257@pdx.rh.CN85.dnsmgr.net> From: Warner Losh Date: Thu, 21 Jun 2018 15:45:32 -0600 X-Google-Sender-Auth: HWrEsduuil6NL14-MuPmVQw06QE Message-ID: Subject: Re: svn commit: r335402 - head/sbin/veriexecctl To: "Rodney W. Grimes" Cc: Ian Lepore , "Conrad E. Meyer" , Stephen Kiernan , Eitan Adler , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:45:34 -0000 On Thu, Jun 21, 2018 at 3:10 PM, Rodney W. Grimes < freebsd@pdx.rh.cn85.dnsmgr.net> wrote: > ... > > > > Hi, > > > > > > While the code is out of HEAD, it can be posted to a github branch > > > (or > > > a projects/ branch if you prefer SVN) for people to try. > > > > > > Best regards, > > > Conrad > > > > > > > Yeah, put it on a branch where it'll get ignored for another two years. > > > > If this code had been committed long ago, as it probably should have > > been, then people would have been playing with it, and by time I needed > > it a few months ago there would have been all kinds of useful info in > > mailing lists and blogs about how to set it up and what was good and > > bad about it and so on. ?Iterative refinement would have been underway. > > > > Instead what I found was a bunch of patches and a big steep learning > > curve with no existing information about using it in the real world. > > With that info available, I/we ($work) would have been in a position to > > quickly adopt it and begin contributing to the ongoing refinement. > > Instead I had to conclude that product deadlines just didn't allow us > > to even try to get it working from a standing start as first-adopters, > > so we had to move in a different direction. Even though this is a > > better solution than what we did, business practicalities will likely > > prevent us from circling back and changing everything over to this > > scheme in the future, so now we'll end up never contributing much to > > this work. > > > > So, IMO, all this calling for things to be reverted isn't just > > inappropriate, it's actively harmful. This is -current where > > development happens and imperfection is expected. Hiding work in > > patchsets and reviews and alternate branches and other shadowy places > > because it's not perfect is just a way of ensuring it never gets any > > better. > > I am with Ian on this one, we have far too much code sitting > out of tree and rotting faster than anyone can maintain said > code out of tree, meaning we are litterly cutting our own > developement efforts off, not at just the foot but up closer > to the hip. > > The veriexec code landed, its in tree, fix it, polish it, > cut out the ugly bits, but for sake of sanity do not whole > sale revert it so it can generally rot some more. > > Officially this code is on the 12.0 target path, it needs > to be in the tree sooner where many eyes can work on it. > I concur here. Let's give it until 12 to get sorted. If it's mostly sorted by then, we're good. If not we can have the discussion then. There's also some manifest signing stuff in the works that was recently approved to go in. Simon was talking about that. Maybe that will help fill the gaps? Warner From owner-svn-src-all@freebsd.org Thu Jun 21 21:50:01 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F4C110012B6; Thu, 21 Jun 2018 21:50:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3BF4700FA; Thu, 21 Jun 2018 21:50:00 +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 B5856179A8; Thu, 21 Jun 2018 21:50:00 +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 w5LLo0Wg072798; Thu, 21 Jun 2018 21:50:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LLo0d3072797; Thu, 21 Jun 2018 21:50:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201806212150.w5LLo0d3072797@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 Jun 2018 21:50:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335509 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335509 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:50:01 -0000 Author: kevans Date: Thu Jun 21 21:50:00 2018 New Revision: 335509 URL: https://svnweb.freebsd.org/changeset/base/335509 Log: subr_hints: Fix acpi unit hinting (at the very least) The refactoring in r335479 overlooked the fact that the dynamic kenv can also be switched to if hintmode == 0. This is problematic because the checkmethod bits are only ever ran once, but it worked previously because the use_kenv was a global state and the first lookup would enable it if occurring after the dynamic environment has been setup. Extending our local definition of use_kenv to include all non-STATIC hintmodes as long as the dynamic_kenv is setup fixes this. We still have potential issues if the dynamic kenv comes up while we're doing an anchored search through the environment, but this is not much of a concern right now because: 1.) The dynamic environment comes up super early in boot, just after kmem 2.) This is going to get rewritten to provide a safer mechanism for the anchored searches, ensuring that we continue using the same environment chain (dynamic env or static fallback) for all anchored search invocations Reported by: mmamcy X-MFC-With: r335479 Modified: head/sys/kern/subr_hints.c Modified: head/sys/kern/subr_hints.c ============================================================================== --- head/sys/kern/subr_hints.c Thu Jun 21 21:21:16 2018 (r335508) +++ head/sys/kern/subr_hints.c Thu Jun 21 21:50:00 2018 (r335509) @@ -123,7 +123,7 @@ res_find(int *line, int *startln, { int n = 0, hit, i = 0; char r_name[32]; - int r_unit, use_kenv = (hintmode == HINTMODE_FALLBACK); + int r_unit, use_kenv = (hintmode != HINTMODE_STATIC && dynamic_kenv); char r_resname[32]; char r_value[128]; const char *s, *cp; From owner-svn-src-all@freebsd.org Thu Jun 21 21:52:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D52C10015A7; Thu, 21 Jun 2018 21:52:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E33570604; Thu, 21 Jun 2018 21:52:06 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id C061F9FAE; Thu, 21 Jun 2018 21:52:05 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-lf0-f47.google.com with SMTP id t2-v6so6473160lfd.6; Thu, 21 Jun 2018 14:52:05 -0700 (PDT) X-Gm-Message-State: APt69E2elRnvORdTsnD0/VRGGb4erQ44kzyd9PKb8Hmv6XrEKzRDd4wz W7sDRTYBclJT6ZA8dBUBpsRewdWRK1xUpKvZD0E= X-Google-Smtp-Source: ADUXVKIb9AjidK6xOrdVyiydWOy7xaRXWCImHnuRfQGUBwjRr5qVIuAGtYry8whkESXyvHk6x5+8bpm4YzxcS4maZ7s= X-Received: by 2002:a2e:575c:: with SMTP id r28-v6mr17311885ljd.51.1529617924365; Thu, 21 Jun 2018 14:52:04 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a2e:8582:0:0:0:0:0 with HTTP; Thu, 21 Jun 2018 14:51:43 -0700 (PDT) In-Reply-To: <201806212150.w5LLo0d3072797@repo.freebsd.org> References: <201806212150.w5LLo0d3072797@repo.freebsd.org> From: Kyle Evans Date: Thu, 21 Jun 2018 16:51:43 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335509 - head/sys/kern To: Kyle Evans Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 21:52:06 -0000 On Thu, Jun 21, 2018 at 4:50 PM, Kyle Evans wrote: > Author: kevans > Date: Thu Jun 21 21:50:00 2018 > New Revision: 335509 > URL: https://svnweb.freebsd.org/changeset/base/335509 > > Log: > subr_hints: Fix acpi unit hinting (at the very least) > > The refactoring in r335479 overlooked the fact that the dynamic kenv can > also be switched to if hintmode == 0. This is problematic because the > checkmethod bits are only ever ran once, but it worked previously because > the use_kenv was a global state and the first lookup would enable it if > occurring after the dynamic environment has been setup. > > Extending our local definition of use_kenv to include all non-STATIC > hintmodes as long as the dynamic_kenv is setup fixes this. We still have > potential issues if the dynamic kenv comes up while we're doing an anchored > search through the environment, but this is not much of a concern right now > because: > > 1.) The dynamic environment comes up super early in boot, just after kmem > > 2.) This is going to get rewritten to provide a safer mechanism for the > anchored searches, ensuring that we continue using the same environment > chain (dynamic env or static fallback) for all anchored search invocations > > Reported by: mmamcy > X-MFC-With: r335479 > Reported by: mmacy* From owner-svn-src-all@freebsd.org Thu Jun 21 22:05:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 939E51001A76; Thu, 21 Jun 2018 22:05:52 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from mx0b-00273201.pphosted.com (mx0b-00273201.pphosted.com [67.231.152.164]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.pphosted.com", Issuer "thawte SHA256 SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC82B70CEF; Thu, 21 Jun 2018 22:05:51 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from pps.filterd (m0108160.ppops.net [127.0.0.1]) by mx0b-00273201.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5LM3fUJ028716; Thu, 21 Jun 2018 15:05:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=juniper.net; h=to : cc : subject : in-reply-to : references : from : mime-version : content-type : content-id : date : message-id; s=PPS1017; bh=pfRyR5bR3xv4vM+GmwnY6oeMqKUJepgJOqnOUNufVuc=; b=zVVmxvjhRlABXbgOUdUnu5OSGmZ9SvoE+yIFCxowW5tP7yKZLY4FVEUq0D08Ce4RRzC0 qSbLQVvJMy5aEh40E6TzrS1fgnjPRB+31EWTVRbGDCbH6Am+dGTf9asVcesh69w33Z/w WBS56ijmheJZd02vPZTnrML+MH2Nx3DVjdfGOTWp6JylrYvlaI4ZQHVBFFXH+I6YbEgA PKP7ojasCNesRRlo82KtyTPVGCtOz2Ba/+22x1qpLAcJB/HEOSJSxS3V0B2Wy2pdjGFy 5zZKKLZIoUiTi7OGjeq4jYPfTtiKUpVVMVHkRAlp8q6lceCHkZ2TyuLFdOVEi+WrDoMi HA== Received: from nam02-bl2-obe.outbound.protection.outlook.com (mail-bl2nam02lp0081.outbound.protection.outlook.com [207.46.163.81]) by mx0b-00273201.pphosted.com with ESMTP id 2jrjjjg6qp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 21 Jun 2018 15:05:45 -0700 Received: from BY1PR0501CA0007.namprd05.prod.outlook.com (2a01:111:e400:4821::17) by CY4PR05MB3112.namprd05.prod.outlook.com (2603:10b6:903:fc::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.16; Thu, 21 Jun 2018 22:05:44 +0000 Received: from DM3NAM05FT005.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e51::208) by BY1PR0501CA0007.outlook.office365.com (2a01:111:e400:4821::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.776.4 via Frontend Transport; Thu, 21 Jun 2018 22:05:43 +0000 Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.15 as permitted sender) Received: from P-EMFE01C-SAC.jnpr.net (66.129.239.15) by DM3NAM05FT005.mail.protection.outlook.com (10.152.98.110) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.906.10 via Frontend Transport; Thu, 21 Jun 2018 22:05:42 +0000 Received: from p-mailhub01.juniper.net (10.47.226.20) by P-EMFE01C-SAC.jnpr.net (172.24.192.21) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 21 Jun 2018 15:03:22 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.30.60]) by p-mailhub01.juniper.net (8.14.4/8.11.3) with ESMTP id w5LM3L1C015976; Thu, 21 Jun 2018 15:03:22 -0700 (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 6493364AA8; Thu, 21 Jun 2018 15:03:12 -0700 (PDT) To: Warner Losh CC: "Rodney W. Grimes" , Ian Lepore , "Conrad E. Meyer" , Stephen Kiernan , Eitan Adler , src-committers , , , Subject: Re: svn commit: r335402 - head/sbin/veriexecctl In-Reply-To: References: <1529606006.24573.30.camel@freebsd.org> <201806212110.w5LLAXXS081257@pdx.rh.CN85.dnsmgr.net> Comments: In-reply-to: Warner Losh message dated "Thu, 21 Jun 2018 15:45:32 -0600." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 25.3.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <49198.1529618592.1@kaos.jnpr.net> Date: Thu, 21 Jun 2018 15:03:12 -0700 Message-ID: <53990.1529618592@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:66.129.239.15; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(376002)(346002)(396003)(39860400002)(39380400002)(2980300002)(199004)(189003)(59450400001)(186003)(446003)(117636001)(11346002)(81156014)(2810700001)(305945005)(316002)(2906002)(478600001)(54906003)(16586007)(336012)(356003)(26005)(6346003)(126002)(229853002)(476003)(77096007)(23726003)(486006)(55016002)(50466002)(47776003)(97876018)(7126003)(86362001)(6266002)(97756001)(69596002)(76176011)(7696005)(8936002)(6916009)(6246003)(106466001)(53416004)(105596002)(8676002)(5660300001)(39060400002)(81166006)(107886003)(97736004)(46406003)(4326008)(68736007)(50226002)(53936002)(76506005)(9686003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR05MB3112; H:P-EMFE01C-SAC.jnpr.net; FPR:; SPF:SoftFail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM05FT005; 1:paoADRck9Bw1bzYAQkzI7duyuSV6RU2y3v+pUttyMFzlpbyaCJUe3IOxiSfAcN0WieEyYfEIvcL7XrpMrx1NJ7eelvzHdKDuyxX+TaA+tZ85CSl6rAGuxtsQoQoHt1eb X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db58c96b-3370-49f4-7dc5-08d5d7c3222a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(2017052603328)(7153060); SRVR:CY4PR05MB3112; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3112; 3:SAVEVaY3qBaoqCuLTMFXJiHMRipqig5gqnVtXb4nQK2dnJ2m05Ugqj4Uha/LhjnUjufu2ZpkrHCA+krdRWiwIG+gPlFPgE2ej81oIMHrVCzBQYgI14rhQADsctB9T7nsTvdBzFcOO/AI7rIVde4ljtlCklcM0+9rRkoZknWnm5I7JO+6AzbZ5GDnmCREg2Up+Q+eIHfe4B8NVmStG7QvhYCABwhlpL1vvF2A3bllo3+cy6WbPs3gyIbgtHKdxr+lluDGDVXcDDsSgbqiFnDDoJiCQsn7ljcPvSZb1YRXb0YtO+bmFwtKMfJ7nGJ7h2eKT5S/2S1ymdmiEYEyeAjDxp2inCeGu1Qigbz1bJH7j8Q=; 25:xxc/fyrsRhlwajZkPBNvIxukb5vgmFQ3wpqPPW1ovToq1XlNT/0GLxegv4IYHd459RVBRkJf6RcHon+LhsPNeSaB0quzt4EasbEDqfBMynMouGJ/MzKFShAfl1ROOuLfy1rnc3+xPgza75phAM+htGKaJxCGEiF6MxmrBgjoRhMAbtpWVGUOB/fp2GMvRXuEA7Uwy2HijxfWUHlyC5ESFiKhl4IuBR3CrZ7lcSUVFMTD6losdKklsPicj+ulYglO6fXy3sn9r7Bh+I4Dwt+cRWNmjiLf9D39ffuzv9SnZVAwy7oVwy12v40nG1N43m+4+zav6GwzrWpV1sy0QW3xQg== X-MS-TrafficTypeDiagnostic: CY4PR05MB3112: X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3112; 31:B3YFIrrOu3A1WPYbuKaVaybpI6Knadsqgc80NT+QuxUmAPQ8fIxGh6iD+ftnoLUz2+ovSRhbbRBsFRy2hvxZhWs/8KwIwL1V8a7jBk/UBWrrTC7Nprq/8YrhdbauhvpcmJ4jabYHvcsYhJlzrh6MPiG/uVUyqjEhvPjpZhw7EomE6o7X6ca9H89cO+3zhuURU0JA++MkpmwDEWoFHiW/Fdow1DatoHTONbyhxOQbIJY=; 20:4lJIZZO4k+KdDbT4tzayDdOeIIRVmYirzSo2lAqeFn6+Oq12AI5TLvXJrxwqes+GXps935rgWD49/0VsDuSaji55lexH05e1GdU9iB6Tmrui8xIMOEheAbayVpUXqa7svPQ9URyvlMij9e7nKAMwULaON3CMVIXgDo/GP5ZlEqv/WLMhIm28NHvEzQgy2bBNSNqm3QvUIzPGckkR+xC5uLb4qN54aqe8CkwZz2OvxWs1+/u5LFYIXWKeBlDO49+/x05ohJwSdt+P30kpaJ0MFTYdgWVuT8B0wh6M41MXPdaBiHhwLv+U9WVlP9zEaQviuObiIDHwgNGedNmAL/2tF/Yd0M+sU7k2mm6zD4owYInFy6wzlUcdvovakTL3UBQgnVSJeWRwPNsZBg9fPDdbo/RRUwvw+OLwfb0cMCGyPx4VBS4WIg7aOqvU+iCWaFJgqhSBpePHPSPYNdqXeZO6wppnoJkLuaXF4CCnE5Zr6CFsEpHkx4OhfKMWg4AmngZY X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:CY4PR05MB3112; BCL:0; PCL:0; RULEID:; SRVR:CY4PR05MB3112; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3112; 4:h6TUU0wtV0bXUPLXQ3w73UyQWWEyZuACR41dSOr/N7mEpORj2gOs2aczpVmmGl2Y1yw3WG4KwcJo2EJ6HGAwaP/9xco2bMkqXl+SIXwf79KHSKLCJvFeTHPTvCUwvNE/8udjmtfYPVV4WA7QxqR1KI5g+7hwFLwbmFGHwVJFUiNQCEPePnAGsBj1KJ8lovjhPayxwB06PwAQ65yHZ+RfyJuQlpPXpAqNj3isqJa1yE3uiubD4fL9c0Lw0d03QRA5UFMgjpN9r9Ke5te7Kja8iA== X-Forefront-PRVS: 07106EF9B9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR05MB3112; 23:yeT/zqC8iB+abkCiBDwqUHPYvRzrKYds8F8gk4UwR?= =?us-ascii?Q?Ks3YsHC6jQgp2ir7oEEgLtnhepQqYYNCtzOwGyhNVX/lNH/HCgg1EjBp0WmH?= =?us-ascii?Q?pxQfvk8Y3SlrpYxjXVrNppNmblH+PDqrgb9hHMQb7wlg/OlEn1WLnwGbPFJC?= =?us-ascii?Q?Ny92YKcW9ge0JhZC5SzWLHM0Heu6bv5rdf3CCulPn7rbMO1unmuLEBnC7GxQ?= =?us-ascii?Q?/72SPSB2gqE5LoQF5sMFQrZPVL2h6mSiw6pP+zNYm8tgBv9FvRMQGbGiCB9+?= =?us-ascii?Q?imI9frt3dr83uHOiJUkU1zAOxIB42h9rcDvqonyOZSrCLKGN6s72VEYtyBlN?= =?us-ascii?Q?NlCS0GS9RXWs9jyijKYJ/QeGFeM0wzwhUDpzybVJQSejfrJOrfL4jymAJEVn?= =?us-ascii?Q?14YXXLw9AWzlbLgnAXWI2GDcMkwvmmgnGe4HmLh8Q0mm8dDn7Ys/Y76gfo43?= =?us-ascii?Q?mmADuY+5xfKF6HL/svQu0iFDuwzCpekAxJti/2F6b5ruJSAdup01EGmHL975?= =?us-ascii?Q?47yCaPzgvLeA86LBGsefc57vwYu44O0hYMsXvhXFblxrko+8twDOFRUvfEw/?= =?us-ascii?Q?tfQWLrqAx4LSaPUBLWI/g+ykNrXIrUHFgiFr6Hdb38R+nIET3Tk430i20jJM?= =?us-ascii?Q?y1+w2mU0Hxuasg62fNrsYZw9FwmHSuEzEVhHjh2KIMvbTLfs94EZJmCNpABI?= =?us-ascii?Q?eGjmGYyqCMhuzG7DW2SHVO6mxhRXX+uGAwsWjqWy6oXiKTUJmifyCcEpPfmt?= =?us-ascii?Q?pbvpT5N8oyna+IU/68cEPkWJjclWrIAKHeXxu1o7yCDQc3vmdxXnOB9sJkKl?= =?us-ascii?Q?016wxXTMVEVOmrSmJo3DC4KW7YT6/8emEMOImg84OITdeOR7WiQgomU/mL9n?= =?us-ascii?Q?MCespuwC51d6asrkopcMbOREql8xMA60H9jTnaCqIWSpY60kN55l2D2X4wyz?= =?us-ascii?Q?LMHboVlIgaG5OjvC8JJ+glYYUbJkIWyDNgaG5tzR6fQgKlOcHSmjUrr/lZyD?= =?us-ascii?Q?OSFkS1AN21ZbHJzf/UbhF6N4pJxIdBCDDX6buZJsoq0bT+98teOZe5GesEB4?= =?us-ascii?Q?ZcOL2qIqR7AYCj+qMCYQUn5OHQ+tWakZ7q7l+SRk+h/pc+9ZiFXhE22E+vzP?= =?us-ascii?Q?Lgwg1vWNjIdkv9H7bmGqMsDcgt4PTpBskQQnuVZBdsKnxfLKxYojw0fQoSUF?= =?us-ascii?Q?2NfAKmzofaI13+9VOQA21wma7luvxwjp73qBg6KsVomLT7399C74czC1Gbg/?= =?us-ascii?Q?DPTGX8gBNrzRIicVhjoo8KeWeGtStaxMxAZcSqDq7cGreatuZJiuqXTOMO9i?= =?us-ascii?Q?rDXi6rOfA7x3Wi4qv9PLWnK+/vlGMEG6UVANJQV89qFIfGm8MEdZVpys4u0C?= =?us-ascii?Q?TqtDQ+5dc/ficxl7/UuZMnrCw0KipET+tTQG3D6XPuZjTmZ?= X-Microsoft-Antispam-Message-Info: T6JpgEXAhML7wRG8mL+AAi1tI0CAt8CESJ9yKmSCRFhwTm4ElDnvzIgkiQaUgIVW3hjYVSusho9REd/7HLQiBdqE5FSravZTzXtJ8WTCTuTxrmiP+Px0PZSDo96rBxYUFGVcj2CpvxehXxrc9EpmInQjAVZMjV8t9VCes+3pklA2AHmjjqzt7tPRnuvvTMlNKbUI6T8qkeH+4fzBpF+078tU8viR4YTDq8oJtnvLB75lWkA/DcP1vi/mMbwtmDn58Vkix6u5CJMWdaQ5MCHCBVVZKZOAorRQnFqHOm78K/LNRZvM1UCCDXyrzg5MHBwJQxzD5i2sgqipeXgI8Ou47Q== X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3112; 6:prffqdYOPQnBRJJKzMY/uckcOAvX3I5pIJEV164S7qi7MA23yFWLGkN/HO2NB7Mx5gYL8a8wFlnl1yfN1a8YZ/c6BgO9TsGUDDbrDdnrtDvY3/5bKuJn8WqbjsiCt528z0mcvXJ52JLbWafDBVtXGHsPKVQ1XtinkMdOqrHUkBEsU5AemgKSks22I2V9ZCrEnYYGDJskLNMerBJVADxUPIi2YKin1QC5owmZFDryepCRJBaLWIbtsLcph0JXdx+G820QV/z6uILiqEGELwtINw5VPkdU7vAIEWKONDkqXKAa7fTBvYspW92MbLLaInjnAFo/kEs4IiiITZGmnVxEQPSPyGxxiRGkAsSQMrZCXQR1Og4xg/S0O0EalFsxngTrTLO7K5/8tl9hf9L6SVmR0kW1iIQVs0DfGxcdbtM3aLdrPLRxLgQMvdM77lJnzyTHL+bxi78L/cHoSscTqna8lg==; 5:/rtUov8RaYiNRMxLSU8oN/41YdgqugCGIKJG8hfoNlJLWRXdPQ7CrONabo3b27vN6NriIi+kxG1I+lRL8NdOrURbPrvjwI9AiAoDxTVbpT1F7V3l+hN4nnOZ7+SOsNPcEmPob9lz/Gpn3IzG97ZMg32MP0zpG9QQtqJ186X9sEo=; 24:DNKwe9nqVK5TAOwQM55F2dN6bc8gq9cpKpQTU4lQzU2HXdzxZ644uc4WJ0EhaYkwFh8b/yAvDvKi6BkGZCxJV9ZBLmD92+cuZJVunHM5Tjk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3112; 7:SKG7umwC7lTlyyX7LGIZDEObqxxMCnGNwI9gMrzPuBlanXdpwveRRrQ/nhfnR5YLmW9O8jZ2GfG+xqpSjMDQkSOxEvacU/CdEcrg0Bmc9v7nlPFvJ0d1CFNbKqdeQQW5+48QuKLhw00RgsQN72+7PoFj48PAhJyYLJB8JiaPrVZ8CFzOMWcCR5st7i/BB0Lgym9YMM//rjMEJ+wxuE5M9f+17xN+6k0ixcOkXbFbzNalz/93TlpuWDB9uM0peP1U X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2018 22:05:42.8660 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db58c96b-3370-49f4-7dc5-08d5d7c3222a X-MS-Exchange-CrossTenant-Id: bea78b3c-4cdb-4130-854a-1d193232e5f4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=bea78b3c-4cdb-4130-854a-1d193232e5f4; Ip=[66.129.239.15]; Helo=[P-EMFE01C-SAC.jnpr.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR05MB3112 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-06-21_10:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_spam_notspam policy=outbound_spam score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806210237 X-Mailman-Approved-At: Thu, 21 Jun 2018 22:12:48 +0000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 22:05:52 -0000 Warner Losh wrote: > > Officially this code is on the 12.0 target path, it needs > > to be in the tree sooner where many eyes can work on it. > > > > I concur here. Let's give it until 12 to get sorted. If it's mostly sorted > by then, we're good. > If not we can have the discussion then. > There's also some manifest signing stuff in the works that was recently > approved to go in. Simon was talking about that. Maybe that will help fill > the gaps? I think so. The work I've done for loader supports both X.509 and OpenPGP based signatures, I need to tweak the library a bit so it is useful for userland app too. FWIW I'd meant to suggest to steve not to commit the veriexecctl tool which I think we all agree is useless as is (never used by us). I believe he'll back that bit out when he can get access to his keys - he's travelling this week. Thanks --sjg From owner-svn-src-all@freebsd.org Thu Jun 21 22:59:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3FBC11003929; Thu, 21 Jun 2018 22:59:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB4F72488; Thu, 21 Jun 2018 22:59: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 AFCC2185B3; Thu, 21 Jun 2018 22:59: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 w5LMxoWR008512; Thu, 21 Jun 2018 22:59:50 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LMxodm008510; Thu, 21 Jun 2018 22:59:50 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806212259.w5LMxodm008510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 22:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org Subject: svn commit: r335510 - in releng/11.2: . lib/csu/common sys/conf X-SVN-Group: releng X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in releng/11.2: . lib/csu/common sys/conf X-SVN-Commit-Revision: 335510 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 22:59:51 -0000 Author: gjb Date: Thu Jun 21 22:59:49 2018 New Revision: 335510 URL: https://svnweb.freebsd.org/changeset/base/335510 Log: - Switch releng/11.2 to -RELEASE. - Add the anticipated 11.2-RELEASE date to UPDATING. - Set a static __FreeBSD_version. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: releng/11.2/UPDATING releng/11.2/lib/csu/common/crtbrand.c releng/11.2/sys/conf/newvers.sh Modified: releng/11.2/UPDATING ============================================================================== --- releng/11.2/UPDATING Thu Jun 21 21:50:00 2018 (r335509) +++ releng/11.2/UPDATING Thu Jun 21 22:59:49 2018 (r335510) @@ -16,6 +16,9 @@ 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. +20180627: + 11.2-RELEASE. + 20180504: The tz database (tzdb) has been updated to 2018e. This version more correctly models time stamps in time zones with negative DST such as Modified: releng/11.2/lib/csu/common/crtbrand.c ============================================================================== --- releng/11.2/lib/csu/common/crtbrand.c Thu Jun 21 21:50:00 2018 (r335509) +++ releng/11.2/lib/csu/common/crtbrand.c Thu Jun 21 22:59:49 2018 (r335510) @@ -62,5 +62,5 @@ static const struct { .descsz = sizeof(int32_t), .type = ABI_NOTETYPE, .name = NOTE_FREEBSD_VENDOR, - .desc = __FreeBSD_version + .desc = 1102000 }; Modified: releng/11.2/sys/conf/newvers.sh ============================================================================== --- releng/11.2/sys/conf/newvers.sh Thu Jun 21 21:50:00 2018 (r335509) +++ releng/11.2/sys/conf/newvers.sh Thu Jun 21 22:59:49 2018 (r335510) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="RC3" +BRANCH="RELEASE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Thu Jun 21 23:09:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 545D61003D61; Thu, 21 Jun 2018 23:09:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F044D72A84; Thu, 21 Jun 2018 23:09:40 +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 CC7E618763; Thu, 21 Jun 2018 23:09:40 +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 w5LN9ePB013832; Thu, 21 Jun 2018 23:09:40 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LN9eZM013831; Thu, 21 Jun 2018 23:09:40 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806212309.w5LN9eZM013831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 23:09:40 +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: r335511 - 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: 335511 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 23:09:41 -0000 Author: gjb Date: Thu Jun 21 23:09:40 2018 New Revision: 335511 URL: https://svnweb.freebsd.org/changeset/base/335511 Log: Update version entities in release.ent. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation 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 Thu Jun 21 22:59:49 2018 (r335510) +++ stable/11/release/doc/share/xml/release.ent Thu Jun 21 23:09:40 2018 (r335511) @@ -6,23 +6,23 @@ - + - + - + - + - + From owner-svn-src-all@freebsd.org Thu Jun 21 23:10:59 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6638A1003FAB; Thu, 21 Jun 2018 23:10:59 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1784972C4B; Thu, 21 Jun 2018 23:10:59 +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 ED2C11887F; Thu, 21 Jun 2018 23:10:58 +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 w5LNAwZv013992; Thu, 21 Jun 2018 23:10:58 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LNAw1x013991; Thu, 21 Jun 2018 23:10:58 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806212310.w5LNAw1x013991@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 23:10: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: r335512 - stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/release/doc/en_US.ISO8859-1/errata X-SVN-Commit-Revision: 335512 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 23:10:59 -0000 Author: gjb Date: Thu Jun 21 23:10:58 2018 New Revision: 335512 URL: https://svnweb.freebsd.org/changeset/base/335512 Log: Synchronize the stable/11 errata page with releng/11.2 in preparation for creating the 11.2-RELEASE errata.html page. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Modified: stable/11/release/doc/en_US.ISO8859-1/errata/article.xml ============================================================================== --- stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 23:09:40 2018 (r335511) +++ stable/11/release/doc/en_US.ISO8859-1/errata/article.xml Thu Jun 21 23:10:58 2018 (r335512) @@ -57,7 +57,7 @@ Introduction This errata document contains late-breaking - news about &os; &release; Before installing this + news about &os; &release;. Before installing this version, it is important to consult this document to learn about any post-release discoveries or problems that may already have been found and fixed. @@ -121,19 +121,6 @@ boot - [2017-07-21] Due to a bug in earlier versions of - &man.clang.1; that is difficult to work around in the - upgrade process, to upgrade the system from sources via - buildworld to -CURRENT or &release;, it is necessary to - upgrade machines running 9.x to at least revision r286035, - or machines running 10.x to revision r286033. Source-based - upgrades from 10.3-RELEASE are not affected. This differs - from the historical situation where one could generally - upgrade from anywhere on earlier stable branches, so caution - should be exercised. - - - [2017-07-25] &os;/&arch.arm64; currently lacks EFI real-time clock (RTC) support, which may cause the system @@ -154,51 +141,6 @@ boot - [2017-07-26] Note for those upgrading from 11.1-RC2 in - VirtualBox: - - If system panics were experienced when upgrading from - 11.1-RC1 to 11.1-RC2, and the emulators/virtualbox-ose-additions{,-nox11} - port was built locally as a resolution, the port will either - need to be rebuilt when upgrading from 11.1-RC2 to - 11.1-RELEASE, or reinstall the package from the pkg(8) - mirrors using either: - - &prompt.root; pkg install -f virtualbox-ose-additions - - or - - &prompt.root; pkg install -f virtualbox-ose-additions-nox11 - - To ensure the system does not panic after rebooting into - the updated kernel, it is recommended to disable the - vboxguest service in &man.rc.conf.5; - prior to rebooting the system if possible, or use - &man.pkg.8; to forcefully reinstall the package. - - Systems being upgraded from 11.1-RC1 and earlier and - 11.1-RC3 to 11.1-RELEASE should be unaffected. - - - - [2017-07-27] The release notes erroneously state - revision r315330 was sponsored by Rubicon - Communications, LLC (Netgate), when in fact this work was - done by Hiroki Mori independently. - - - - [2017-08-09] The release notes stated the - &man.ruptime.1;, &man.rwho.1;, and &man.rwhod.8; utilities - have been marked "deprecated", however this change - was reversed in 12.0-CURRENT. - - The other utilities mentioned in the entry in the - release notes, however, are unchanged. - - - [2017-11-06] An issue with &os; virtual machines with vagrant was discovered that affects the VirtualBox where the @@ -213,6 +155,23 @@ boot invocation of vagrant up will allow the virtual machine to successfully boot, allowing access via vagrant ssh. + + + + [2018-06-21] An issue had been discovered late in the + release cycle where removing ZFS vdevs + from a pool under certain conditions would cause a system + crash when &man.zfsd.8; is enabled in + &man.rc.conf.5;. + + At present, it is believed to be limited to removal of + a mirror vdev from a pool consisting of + multiple mirror vdevs. + + See PR 228750 + for more information and updates as the issue is + investigated. From owner-svn-src-all@freebsd.org Thu Jun 21 23:13:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7CFC10040FB; Thu, 21 Jun 2018 23:13: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6984C72FD3; Thu, 21 Jun 2018 23:13: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 469FF188F5; Thu, 21 Jun 2018 23:13:35 +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 w5LNDZsp018562; Thu, 21 Jun 2018 23:13:35 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LNDYQM018561; Thu, 21 Jun 2018 23:13:34 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806212313.w5LNDYQM018561@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 23:13:34 +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: r335513 - 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: 335513 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 23:13:36 -0000 Author: gjb Date: Thu Jun 21 23:13:34 2018 New Revision: 335513 URL: https://svnweb.freebsd.org/changeset/base/335513 Log: Prune SAs and ENs from 11.1-RELEASE in preparation for creating the 11.2-RELEASE errata page. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation 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 Thu Jun 21 23:10:58 2018 (r335512) +++ stable/11/release/doc/share/xml/errata.xml Thu Jun 21 23:13:34 2018 (r335513) @@ -19,81 +19,9 @@ - FreeBSD-EN-17:07.vnet - 10 August 2017 - VNET kernel panic with asynchronous - I/O - - - - FreeBSD-EN-17:08.pf - 10 August 2017 - &man.pf.4; housekeeping thread causes kernel - panic - - - - FreeBSD-EN-17:09.tzdata - 2 November 2017 - Timezone database information - update - - - - FreeBSD-EN-18:01.tzdata - 07 March 2018 - Timezone database information - update - - - - FreeBSD-EN-18:02.file - 07 March 2018 - Stack-based buffer overflow - - - - FreeBSD-EN-18:03.tzdata - 04 April 2018 - Update timezone database - information - - - - FreeBSD-EN-18:04.mem - 04 April 2018 - Multiple small kernel memory - disclosures - - - - FreeBSD-EN-18:05.mem - 08 May 2018 - Multiple small kernel memory - disclosures - - - - FreeBSD-EN-18:06.tzdata - 08 May 2018 - Update timezone database - information - - - - FreeBSD-EN-18:07.pmap - 21 June 2018 - Fix TLB for Xen guests + No erratas +   +   Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Thu Jun 21 23:10:58 2018 (r335512) +++ stable/11/release/doc/share/xml/security.xml Thu Jun 21 23:13:34 2018 (r335513) @@ -19,108 +19,9 @@ - FreeBSD-SA-17:06.openssh - 10 August 2017 - Denial of Service vulnerability - - - - FreeBSD-SA-17:07.wpa - 16 October 2017 - WPA2 protocol vulnerability - - - - FreeBSD-SA-17:08.ptrace - 15 November 2017 - Kernel data leak via - ptrace(PT_LWPINFO) - - - - FreeBSD-SA-17:10.kldstat - 15 November 2017 - Information leak - - - - FreeBSD-SA-17:11.openssl - 29 November 2017 - Multiple vulnerabilities - - - - FreeBSD-SA-17:12.openssl - 09 December 2017 - Multiple vulnerabilities - - - - FreeBSD-SA-18:01.ipsec - 07 March 2018 - Fix IPSEC validation and - use-after-free - - - - FreeBSD-SA-18:02.ntp - 07 March 2018 - Multiple vulnerabilities - - - - FreeBSD-SA-18:03.speculative_execution - 14 March 2018 - - Speculative Execution Vulnerabilities - - This advisory addresses the most significant issues - for &os; 11.1 on &arch.amd64; CPUs. We expect to - update this advisory to include 10.x for &arch.amd64; - CPUs. Future &os; releases will address this issue on - &arch.i386; and other CPUs. - - - - - - FreeBSD-SA-18:04.vt - 04 April 2018 - Fix &man.vt.4; console memory - disclosure - - - - FreeBSD-SA-18:05.ipsec - 04 April 2018 - Fix denial of service - - - - FreeBSD-SA-18:06.debugreg - 08 May 2018 - Mishandling of x86 debug - exceptions - - - - FreeBSD-SA-18:07.lazyfpu - 21 June 2018 - Fix Lazy FPU information - disclosure + No advisories +   +   From owner-svn-src-all@freebsd.org Thu Jun 21 23:29:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 270AE10047FC; Thu, 21 Jun 2018 23:29:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C66D5736EC; Thu, 21 Jun 2018 23:29:17 +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 A432518AA9; Thu, 21 Jun 2018 23:29:17 +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 w5LNTHdt024182; Thu, 21 Jun 2018 23:29:17 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5LNTH0K024181; Thu, 21 Jun 2018 23:29:17 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806212329.w5LNTH0K024181@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 21 Jun 2018 23:29:17 +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: r335514 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 335514 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.26 Precedence: list List-Id: "SVN commit messages 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, 21 Jun 2018 23:29:18 -0000 Author: gjb Date: Thu Jun 21 23:29:17 2018 New Revision: 335514 URL: https://svnweb.freebsd.org/changeset/base/335514 Log: Set stable/11 from -PRERELEASE back to -STABLE. Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/newvers.sh Modified: stable/11/sys/conf/newvers.sh ============================================================================== --- stable/11/sys/conf/newvers.sh Thu Jun 21 23:13:34 2018 (r335513) +++ stable/11/sys/conf/newvers.sh Thu Jun 21 23:29:17 2018 (r335514) @@ -44,7 +44,7 @@ TYPE="FreeBSD" REVISION="11.2" -BRANCH="PRERELEASE" +BRANCH="STABLE" if [ -n "${BRANCH_OVERRIDE}" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@freebsd.org Fri Jun 22 00:02:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A83810054FF; Fri, 22 Jun 2018 00:02:05 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3D32746B6; Fri, 22 Jun 2018 00:02:04 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9682418FE8; Fri, 22 Jun 2018 00:02:04 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M024ZO042166; Fri, 22 Jun 2018 00:02:04 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M023tW042162; Fri, 22 Jun 2018 00:02:03 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201806220002.w5M023tW042162@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 22 Jun 2018 00:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335515 - in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: in head/sys: amd64/linux amd64/linux32 compat/linux i386/linux X-SVN-Commit-Revision: 335515 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:02:05 -0000 Author: chuck Date: Fri Jun 22 00:02:03 2018 New Revision: 335515 URL: https://svnweb.freebsd.org/changeset/base/335515 Log: Fix the Linux kernel version number calculation The Linux compatibility code was converting the version number (e.g. 2.6.32) in two different ways and then comparing the results. The linux_map_osrel() function converted MAJOR.MINOR.PATCH similar to what FreeBSD does natively. I.e. where major=v0, minor=v1, and patch=v2 v = v0 * 1000000 + v1 * 1000 + v2; The LINUX_KERNVER() macro, on the other hand, converted the value with bit shifts. I.e. where major=a, minor=b, and patch=c v = (((a) << 16) + ((b) << 8) + (c)) The Linux kernel uses the later format via the KERNEL_VERSION() macro in include/generated/uapi/linux/version.h Fix is to use the LINUX_KERNVER() macro in linux_map_osrel() as well as in the .trans_osrel functions. PR: 229209 Reviewed by: emaste, cem, imp (mentor) Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15952 Modified: head/sys/amd64/linux/linux_sysvec.c head/sys/amd64/linux32/linux32_sysvec.c head/sys/compat/linux/linux_mib.c head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux/linux_sysvec.c ============================================================================== --- head/sys/amd64/linux/linux_sysvec.c Thu Jun 21 23:29:17 2018 (r335514) +++ head/sys/amd64/linux/linux_sysvec.c Fri Jun 22 00:02:03 2018 (r335515) @@ -799,10 +799,11 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } Modified: head/sys/amd64/linux32/linux32_sysvec.c ============================================================================== --- head/sys/amd64/linux32/linux32_sysvec.c Thu Jun 21 23:29:17 2018 (r335514) +++ head/sys/amd64/linux32/linux32_sysvec.c Fri Jun 22 00:02:03 2018 (r335515) @@ -993,10 +993,11 @@ linux32_trans_osrel(const Elf_Note *note, int32_t *osr return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } Modified: head/sys/compat/linux/linux_mib.c ============================================================================== --- head/sys/compat/linux/linux_mib.c Thu Jun 21 23:29:17 2018 (r335514) +++ head/sys/compat/linux/linux_mib.c Fri Jun 22 00:02:03 2018 (r335515) @@ -149,8 +149,8 @@ linux_map_osrel(char *osrelease, int *osrel) if (osrelease == sep || sep != eosrelease) return (EINVAL); - v = v0 * 1000000 + v1 * 1000 + v2; - if (v < 1000000) + v = LINUX_KERNVER(v0, v1, v2); + if (v < LINUX_KERNVER(1, 0, 0)) return (EINVAL); if (osrel != NULL) Modified: head/sys/i386/linux/linux_sysvec.c ============================================================================== --- head/sys/i386/linux/linux_sysvec.c Thu Jun 21 23:29:17 2018 (r335514) +++ head/sys/i386/linux/linux_sysvec.c Fri Jun 22 00:02:03 2018 (r335515) @@ -970,10 +970,11 @@ linux_trans_osrel(const Elf_Note *note, int32_t *osrel return (false); /* - * For Linux we encode osrel as follows (see linux_mib.c): - * VVVMMMIII (version, major, minor), see linux_mib.c. + * For Linux we encode osrel using the Linux convention of + * (version << 16) | (major << 8) | (minor) + * See macro in linux_mib.h */ - *osrel = desc[1] * 1000000 + desc[2] * 1000 + desc[3]; + *osrel = LINUX_KERNVER(desc[1], desc[2], desc[3]); return (true); } From owner-svn-src-all@freebsd.org Fri Jun 22 00:02:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9AC4D1005505; Fri, 22 Jun 2018 00:02:06 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 483E6746BF; Fri, 22 Jun 2018 00:02:06 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2A36018FEB; Fri, 22 Jun 2018 00:02:06 +0000 (UTC) (envelope-from chuck@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M026pj042225; Fri, 22 Jun 2018 00:02:06 GMT (envelope-from chuck@FreeBSD.org) Received: (from chuck@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0262D042224; Fri, 22 Jun 2018 00:02:06 GMT (envelope-from chuck@FreeBSD.org) Message-Id: <201806220002.w5M0262D042224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: chuck set sender to chuck@FreeBSD.org using -f From: Chuck Tuffli Date: Fri, 22 Jun 2018 00:02:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335516 - head/sys/compat/linprocfs X-SVN-Group: head X-SVN-Commit-Author: chuck X-SVN-Commit-Paths: head/sys/compat/linprocfs X-SVN-Commit-Revision: 335516 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:02:07 -0000 Author: chuck Date: Fri Jun 22 00:02:05 2018 New Revision: 335516 URL: https://svnweb.freebsd.org/changeset/base/335516 Log: Fix output of linprocfs stat entry The Linux /proc/stat entry has grown over time v2.5.41 < user, nice, system, idle v2.5.41 user, nice, system, idle, iowait, irq v2.6.11 user, nice, system, idle, iowait, irq, softirq, steal v2.6.24 user, nice, system, idle, iowait, irq, softirq, steal, guest v2.6.32 > user, nice, system, idle, iowait, irq, softirq, steal, guest, guest_nice Some applications (e.g. nodejs) depend on the correct number of entries and will abort otherwise. Fix is to print the correct number of entries based on the value of osrelease set either in sysctl or the jail settings. Change is similar to approach used by illumos. Reviewed by: emaste, imp (mentor) Approved by: imp (mentor) Differential Revision: https://reviews.freebsd.org/D15858 Modified: head/sys/compat/linprocfs/linprocfs.c Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Fri Jun 22 00:02:03 2018 (r335515) +++ head/sys/compat/linprocfs/linprocfs.c Fri Jun 22 00:02:05 2018 (r335516) @@ -469,9 +469,21 @@ linprocfs_dopartitions(PFS_FILL_ARGS) return (0); } - /* * Filler function for proc/stat + * + * Output depends on kernel version: + * + * v2.5.40 <= + * user nice system idle + * v2.5.41 + * user nice system idle iowait + * v2.6.11 + * user nice system idle iowait irq softirq steal + * v2.6.24 + * user nice system idle iowait irq softirq steal guest + * v2.6.33 >= + * user nice system idle iowait irq softirq steal guest guest_nice */ static int linprocfs_dostat(PFS_FILL_ARGS) @@ -481,22 +493,54 @@ linprocfs_dostat(PFS_FILL_ARGS) long *cp; struct timeval boottime; int i; + char *zero_pad; + bool has_intr = true; + if (linux_kernver(td) >= LINUX_KERNVER(2,6,33)) { + zero_pad = " 0 0 0 0\n"; + } else if (linux_kernver(td) >= LINUX_KERNVER(2,6,24)) { + zero_pad = " 0 0 0\n"; + } else if (linux_kernver(td) >= LINUX_KERNVER(2,6,11)) { + zero_pad = " 0 0\n"; + } else if (linux_kernver(td) >= LINUX_KERNVER(2,5,41)) { + has_intr = false; + zero_pad = " 0\n"; + } else { + has_intr = false; + zero_pad = "\n"; + } + read_cpu_time(cp_time); getboottime(&boottime); - sbuf_printf(sb, "cpu %ld %ld %ld %ld\n", + /* Parameters common to all versions */ + sbuf_printf(sb, "cpu %lu %lu %lu %lu", T2J(cp_time[CP_USER]), T2J(cp_time[CP_NICE]), - T2J(cp_time[CP_SYS] /*+ cp_time[CP_INTR]*/), + T2J(cp_time[CP_SYS]), T2J(cp_time[CP_IDLE])); + + /* Print interrupt stats if available */ + if (has_intr) { + sbuf_printf(sb, " 0 %lu", T2J(cp_time[CP_INTR])); + } + + /* Pad out remaining fields depending on version */ + sbuf_printf(sb, "%s", zero_pad); + CPU_FOREACH(i) { pcpu = pcpu_find(i); cp = pcpu->pc_cp_time; - sbuf_printf(sb, "cpu%d %ld %ld %ld %ld\n", i, + sbuf_printf(sb, "cpu%d %lu %lu %lu %lu", i, T2J(cp[CP_USER]), T2J(cp[CP_NICE]), - T2J(cp[CP_SYS] /*+ cp[CP_INTR]*/), + T2J(cp[CP_SYS]), T2J(cp[CP_IDLE])); + + if (has_intr) { + sbuf_printf(sb, " 0 %lu", T2J(cp[CP_INTR])); + } + + sbuf_printf(sb, "%s", zero_pad); } sbuf_printf(sb, "disk 0 0 0 0\n" From owner-svn-src-all@freebsd.org Fri Jun 22 00:02:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 52D1C10056FB; Fri, 22 Jun 2018 00:02:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AB2D674957; Fri, 22 Jun 2018 00:02:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DAFB1912E; Fri, 22 Jun 2018 00:02:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M02aEn044484; Fri, 22 Jun 2018 00:02:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M02agp044483; Fri, 22 Jun 2018 00:02:36 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220002.w5M02agp044483@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 00:02:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335517 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335517 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:02:37 -0000 Author: eadler Date: Fri Jun 22 00:02:36 2018 New Revision: 335517 URL: https://svnweb.freebsd.org/changeset/base/335517 Log: top(1): behave as documented for -t Show top itself by default, unless -t is specified. Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Jun 22 00:02:05 2018 (r335516) +++ head/usr.bin/top/top.c Fri Jun 22 00:02:36 2018 (r335517) @@ -281,7 +281,7 @@ main(int argc, char *argv[]) /* get our name */ /* initialize some selection options */ ps.idle = true; - ps.self = false; + ps.self = true; ps.system = false; reset_uids(); ps.thread = false; From owner-svn-src-all@freebsd.org Fri Jun 22 00:27:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2F681006177; Fri, 22 Jun 2018 00:27:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 65C16754D8; Fri, 22 Jun 2018 00:27:32 +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 46C5219468; Fri, 22 Jun 2018 00:27:32 +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 w5M0RWFW054908; Fri, 22 Jun 2018 00:27:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0RWxK054907; Fri, 22 Jun 2018 00:27:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806220027.w5M0RWxK054907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Jun 2018 00:27:32 +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: r335518 - stable/11/usr.sbin/asf X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.sbin/asf X-SVN-Commit-Revision: 335518 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:27:32 -0000 Author: emaste Date: Fri Jun 22 00:27:31 2018 New Revision: 335518 URL: https://svnweb.freebsd.org/changeset/base/335518 Log: MFC r335221: Add deprecation notice in asf.8 PR: 229046 Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.sbin/asf/asf.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/asf/asf.8 ============================================================================== --- stable/11/usr.sbin/asf/asf.8 Fri Jun 22 00:02:36 2018 (r335517) +++ stable/11/usr.sbin/asf/asf.8 Fri Jun 22 00:27:31 2018 (r335518) @@ -37,6 +37,15 @@ .Op Fl o Ar outfile .Op Fl X Ar suffix .Op Ar modules-path Op Ar outfile +.Sh DEPRECATION NOTICE +The +.Nm +utility is not present in +.Fx 12.0 +and later. +The +.Xr kgdb 1 +debugger handles kernel module state internally. .Sh DESCRIPTION By default, .Nm From owner-svn-src-all@freebsd.org Fri Jun 22 00:28:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7349B1006373; Fri, 22 Jun 2018 00:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 20E29756D7; Fri, 22 Jun 2018 00:28: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 02FFC1946A; Fri, 22 Jun 2018 00:28: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 w5M0SSBU055022; Fri, 22 Jun 2018 00:28:28 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0SSw0055021; Fri, 22 Jun 2018 00:28:28 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806220028.w5M0SSw0055021@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Jun 2018 00:28:28 +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: r335519 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 335519 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:28:29 -0000 Author: emaste Date: Fri Jun 22 00:28:28 2018 New Revision: 335519 URL: https://svnweb.freebsd.org/changeset/base/335519 Log: MFC r335214: Correct kern.pre.mk comment: objcopy copies objects. (Not objdump.) PR: 229046 Sponsored by: The FreeBSD Foundation Modified: stable/11/sys/conf/kern.pre.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/kern.pre.mk ============================================================================== --- stable/11/sys/conf/kern.pre.mk Fri Jun 22 00:27:31 2018 (r335518) +++ stable/11/sys/conf/kern.pre.mk Fri Jun 22 00:28:28 2018 (r335519) @@ -229,7 +229,7 @@ MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" MKMODULESENV+= __MPATH="${__MPATH}" .endif -# Architecture and output format arguments for objdump to convert image to +# Architecture and output format arguments for objcopy to convert image to # object file .if ${MFS_IMAGE:Uno} != "no" From owner-svn-src-all@freebsd.org Fri Jun 22 00:29:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 39F71100644A; Fri, 22 Jun 2018 00:29:30 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DDEC475844; Fri, 22 Jun 2018 00:29: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 BEFD91946C; Fri, 22 Jun 2018 00:29: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 w5M0TTus055130; Fri, 22 Jun 2018 00:29:29 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0TT8U055129; Fri, 22 Jun 2018 00:29:29 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806220029.w5M0TT8U055129@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Jun 2018 00:29: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: r335520 - stable/11/share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/share/man/man5 X-SVN-Commit-Revision: 335520 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:29:30 -0000 Author: emaste Date: Fri Jun 22 00:29:29 2018 New Revision: 335520 URL: https://svnweb.freebsd.org/changeset/base/335520 Log: MFC r335209: elf.5: add readelf cross-reference objdump is sometimes used in cases where readelf is more appropriate, but the obsolete GNU objdump we have in the base system will be removed in the future. .Xr readelf from elf.5 to improve the odds the more appropriate tool will be found. PR: 229046 Sponsored by: The FreeBSD Foundation Modified: stable/11/share/man/man5/elf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man5/elf.5 ============================================================================== --- stable/11/share/man/man5/elf.5 Fri Jun 22 00:28:28 2018 (r335519) +++ stable/11/share/man/man5/elf.5 Fri Jun 22 00:29:29 2018 (r335520) @@ -1281,6 +1281,7 @@ stored into the relocatable field. .Xr gdb 1 , .Xr ld 1 , .Xr objdump 1 , +.Xr readelf 1 , .Xr execve 2 , .Xr ar 5 , .Xr core 5 From owner-svn-src-all@freebsd.org Fri Jun 22 00:30:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ED0F4100666E; Fri, 22 Jun 2018 00:30:25 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4675975A7C; Fri, 22 Jun 2018 00:30:25 +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 27BB419481; Fri, 22 Jun 2018 00:30:25 +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 w5M0UP1a055261; Fri, 22 Jun 2018 00:30:25 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0UPTh055260; Fri, 22 Jun 2018 00:30:25 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201806220030.w5M0UPTh055260@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 22 Jun 2018 00:30: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: r335521 - stable/11/usr.bin/ldd X-SVN-Group: stable-11 X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: stable/11/usr.bin/ldd X-SVN-Commit-Revision: 335521 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:30:26 -0000 Author: emaste Date: Fri Jun 22 00:30:24 2018 New Revision: 335521 URL: https://svnweb.freebsd.org/changeset/base/335521 Log: MFC r335213: ldd: reference readelf instead of objdump in warning message We have an obsolete GNU objdump 2.17.50 in the base system, which will be removed in the future. Suggest readelf(1) for examining ELF files instead; for most use cases it is the preferred tool anyhow. PR: 229046 Sponsored by: The FreeBSD Foundation Modified: stable/11/usr.bin/ldd/sods.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/ldd/sods.c ============================================================================== --- stable/11/usr.bin/ldd/sods.c Fri Jun 22 00:29:29 2018 (r335520) +++ stable/11/usr.bin/ldd/sods.c Fri Jun 22 00:30:24 2018 (r335521) @@ -203,7 +203,7 @@ dump_file(const char *fname) file_base = (const char *) objbase; /* Makes address arithmetic easier */ if (IS_ELF(*(const Elf32_Ehdr*) align_struct(file_base))) { - warnx("%s: this is an ELF program; use objdump to examine", fname); + warnx("%s: this is an ELF program; use readelf to examine", fname); ++error_count; munmap(objbase, sb.st_size); return; From owner-svn-src-all@freebsd.org Fri Jun 22 00:47:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 038511006FAE; Fri, 22 Jun 2018 00:47:19 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A665476642; Fri, 22 Jun 2018 00:47:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 877A2197BA; Fri, 22 Jun 2018 00:47:18 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M0lI7V065555; Fri, 22 Jun 2018 00:47:18 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0lIeC065554; Fri, 22 Jun 2018 00:47:18 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806220047.w5M0lIeC065554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Fri, 22 Jun 2018 00:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335524 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335524 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:47:19 -0000 Author: mmacy Date: Fri Jun 22 00:47:18 2018 New Revision: 335524 URL: https://svnweb.freebsd.org/changeset/base/335524 Log: epoch(9): make non-preemptible variant work early boot Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Fri Jun 22 00:41:36 2018 (r335523) +++ head/sys/kern/subr_epoch.c Fri Jun 22 00:47:18 2018 (r335524) @@ -307,6 +307,7 @@ epoch_enter(epoch_t epoch) struct thread *td; MPASS(cold || epoch != NULL); + INIT_CHECK(epoch); td = curthread; critical_enter(); @@ -344,6 +345,7 @@ epoch_exit(epoch_t epoch) ck_epoch_record_t *record; struct thread *td; + INIT_CHECK(epoch); td = curthread; td->td_epochnest--; record = &epoch->e_pcpu[curcpu]->eps_record.er_record; From owner-svn-src-all@freebsd.org Fri Jun 22 00:55:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 100FC10072A3; Fri, 22 Jun 2018 00:55:40 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B663776B84; Fri, 22 Jun 2018 00:55:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CD801999E; Fri, 22 Jun 2018 00:55:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M0tdOv070440; Fri, 22 Jun 2018 00:55:39 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M0tdlK070439; Fri, 22 Jun 2018 00:55:39 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806220055.w5M0tdlK070439@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 22 Jun 2018 00:55:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335525 - head/sys/fs/nfsserver X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfsserver X-SVN-Commit-Revision: 335525 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 00:55:40 -0000 Author: rmacklem Date: Fri Jun 22 00:55:39 2018 New Revision: 335525 URL: https://svnweb.freebsd.org/changeset/base/335525 Log: Add a counter to limit the number of disabled DSs for a mirrored pNFS MDS. This patch adds a counter that limits the number of disabled mirrored DSs to mirror level - 1. It also makes a small change that keeps a Write that has failed with EACCES when attempted by a client to a DS from disabling the DS. This patch only affects the pNFS server. Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c Modified: head/sys/fs/nfsserver/nfs_nfsdstate.c ============================================================================== --- head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jun 22 00:47:18 2018 (r335524) +++ head/sys/fs/nfsserver/nfs_nfsdstate.c Fri Jun 22 00:55:39 2018 (r335525) @@ -128,6 +128,7 @@ static int nfsrv_returnoldstateid = 0, nfsrv_clients = static int nfsrv_clienthighwater = NFSRV_CLIENTHIGHWATER; static int nfsrv_nogsscallback = 0; static volatile int nfsrv_writedelegcnt = 0; +static int nfsrv_faildscnt; /* local functions */ static void nfsrv_dumpaclient(struct nfsclient *clp, @@ -6748,10 +6749,9 @@ nfsrv_flexlayouterr(struct nfsrv_descript *nd, uint32_ NFSD_DEBUG(4, "flexlayouterr op=%d stat=%d\n", opnum, stat); /* - * Except for NFSERR_ACCES errors for Reading, - * shut the mirror down. + * Except for NFSERR_ACCES errors, disable the mirror. */ - if (opnum != NFSV4OP_READ || stat != NFSERR_ACCES) + if (stat != NFSERR_ACCES) nfsrv_delds(devid, p); } } @@ -7514,6 +7514,10 @@ nfsrv_deldsnmp(struct nfsmount *nmp, NFSPROC_T *p) NFSD_DEBUG(4, "deldsdvp\n"); NFSDDSLOCK(); + if (nfsrv_faildscnt <= 0) { + NFSDDSUNLOCK(); + return (NULL); + } fndds = nfsv4_findmirror(nmp); if (fndds != NULL) nfsrv_deleteds(fndds); @@ -7547,6 +7551,10 @@ nfsrv_delds(char *devid, NFSPROC_T *p) nmp = NULL; fndmirror = 0; NFSDDSLOCK(); + if (nfsrv_faildscnt <= 0) { + NFSDDSUNLOCK(); + return (ENXIO); + } TAILQ_FOREACH(ds, &nfsrv_devidhead, nfsdev_list) { if (NFSBCMP(ds->nfsdev_deviceid, devid, NFSX_V4DEVICEID) == 0 && ds->nfsdev_nmp != NULL) { @@ -7593,6 +7601,7 @@ nfsrv_deleteds(struct nfsdevice *fndds) NFSD_DEBUG(4, "deleteds: deleting a mirror\n"); fndds->nfsdev_nmp = NULL; + nfsrv_faildscnt--; } /* @@ -7714,6 +7723,8 @@ nfsrv_createdevids(struct nfsd_nfsd_args *args, NFSPRO nfsrv_maxpnfsmirror = 1; return (ENXIO); } + /* We can fail at most one less DS than the mirror level. */ + nfsrv_faildscnt = nfsrv_maxpnfsmirror - 1; /* * Allocate the nfslayout hash table now, since this is a pNFS server. From owner-svn-src-all@freebsd.org Fri Jun 22 01:10:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6CF891007795; Fri, 22 Jun 2018 01:10:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 227E6772C9; Fri, 22 Jun 2018 01:10:06 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F40D219B68; Fri, 22 Jun 2018 01:10:05 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M1A54r075797; Fri, 22 Jun 2018 01:10:05 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M1A56p075796; Fri, 22 Jun 2018 01:10:05 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806220110.w5M1A56p075796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 22 Jun 2018 01:10:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335526 - head/usr.sbin/config X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/usr.sbin/config X-SVN-Commit-Revision: 335526 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 01:10:06 -0000 Author: bdrewery Date: Fri Jun 22 01:10:05 2018 New Revision: 335526 URL: https://svnweb.freebsd.org/changeset/base/335526 Log: Let -s actually work. MFC after: 2 weeks Sponsored by: Dell EMC Modified: head/usr.sbin/config/main.c Modified: head/usr.sbin/config/main.c ============================================================================== --- head/usr.sbin/config/main.c Fri Jun 22 00:55:39 2018 (r335525) +++ head/usr.sbin/config/main.c Fri Jun 22 01:10:05 2018 (r335526) @@ -118,7 +118,7 @@ main(int argc, char **argv) printmachine = 0; kernfile = NULL; SLIST_INIT(&includepath); - while ((ch = getopt(argc, argv, "CI:d:gmpsVx:")) != -1) + while ((ch = getopt(argc, argv, "CI:d:gmps:Vx:")) != -1) switch (ch) { case 'C': filebased = 1; From owner-svn-src-all@freebsd.org Fri Jun 22 01:59:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A9EA100A214; Fri, 22 Jun 2018 01:59:21 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EFE52792B7; Fri, 22 Jun 2018 01:59:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCDA21A391; Fri, 22 Jun 2018 01:59:20 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M1xKPX001704; Fri, 22 Jun 2018 01:59:20 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M1xKBk001701; Fri, 22 Jun 2018 01:59:20 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806220159.w5M1xKBk001701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 22 Jun 2018 01:59:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335527 - in head/usr.sbin: . spi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/usr.sbin: . spi X-SVN-Commit-Revision: 335527 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 01:59:21 -0000 Author: ian Date: Fri Jun 22 01:59:19 2018 New Revision: 335527 URL: https://svnweb.freebsd.org/changeset/base/335527 Log: Add spi(8), a utility for communicating with a device on a SPI bus from userland, conceptually similar to what i2c(8) provides for i2c devices. Submitted by: Bob Frazier Differential Revision: https://reviews.freebsd.org/D15029 Added: head/usr.sbin/spi/ head/usr.sbin/spi/Makefile (contents, props changed) head/usr.sbin/spi/spi.8 (contents, props changed) head/usr.sbin/spi/spi.c (contents, props changed) Modified: head/usr.sbin/Makefile Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Fri Jun 22 01:10:05 2018 (r335526) +++ head/usr.sbin/Makefile Fri Jun 22 01:59:19 2018 (r335527) @@ -84,6 +84,7 @@ SUBDIR= adduser \ setpmac \ smbmsg \ snapinfo \ + spi \ spray \ syslogd \ sysrc \ Added: head/usr.sbin/spi/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/spi/Makefile Fri Jun 22 01:59:19 2018 (r335527) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +#.include + +PROG= spi + +MAN8= spi.8 + +.include Added: head/usr.sbin/spi/spi.8 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.sbin/spi/spi.8 Fri Jun 22 01:59:19 2018 (r335527) @@ -0,0 +1,197 @@ +.\" Copyright (c) 2018 by S.F.T. Inc. +.\" +.\" 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 "15 April 2018" +.Dt spi 8 +.Os +.Sh NAME +.Nm spi +.Nd communicate on SPI bus with slave devices +.Sh SYNOPSIS +.Nm +.Op Fl f Ar device +.Op Fl d Ar r|w|rw +.Op Fl m Ar mode +.Op Fl s Ar max-speed +.Op Fl c Ar count +.Op Fl C Ar cmd_bytes +.Op Fl A +.Op Fl b +.Op Fl L +.Op Fl v +.Nm +.Op Fl i +.Op Fl f Ar device +.Op Fl v +.Nm +.Op Fl h +.Sh DESCRIPTION +The +.Nm +utility can be used to perform raw data transfers +.Pq read, write, or simultaneous read/write +with devices on the SPI bus, via the +.Xr spigen 4 +device. +.Pp +Each +.Xr spigen 4 +device is associated with a specific +.Sq chip select +.Pq cs +pin on the spibus, and therefore needs to be specified. +If no device name is specified on the command line, +.Nm +assumes +.Sq spigen0.0 . +.Pp +For more information on the spigen device, see +.Xr spigen 4 . +.Pp +The options are as follows: +.Bl -tag -width ".Fl f Ar device" +.It Fl A +Specifies ASCII mode. +Both read and write data is input and output as +2-character hexadecimal values, optionally separated by white space, +such as 00 01 02 etc. +When combined with the +.Sq -b +flag, the data on stdin remains a sequence of ASCII hexadecimal +byte values, but the output reverts to binary mode. +.It Fl b +Binary +.Pq output +mode. +Only has an effect when +.Sq -A +has been specified. +Reverts the output back to binary +.Pq rather than ASCII , +while leaving the input format as-is. +Use in combination with +.Sq -A +to allow using something like +.Sq echo +to pass hexadecimal values to the SPI device, but output the received data +on stdout as binary. +.It Fl C Ar command bytes +Sends one or more +.Sq command +bytes, skipping any bytes read-in during the transfer. +The byte values should be specified as a quoted parameter, similar to the +format for data on stdin for +.Sq -A , +that is, 2 character hexadecimal values, optionally separated by white space. +An SPI device will typically require that a command be sent, followed by +bytes of data. +You can use this option to send the command without receiving any data bytes +during the command sequence. +.It Fl c Ar count +The total number of bytes to transfer as a decimal integer. +If a write or a read/write transaction is being performed, and fewer than +this number of bytes are read in from stdin, the remaining bytes will be +sent with a value of +.Sq 0 . +If the length can be determined from the input file size, you can use a +.Sq count +value of +.Sq -1 +to base the transfer on the input file's size. +.It Fl d Ar r|w|rw +Transfer direction: Use +.Sq r +for read, +.Sq w for write, and +.Sq rw +for simultaneous read and write. +.It Fl f Ar device +SPI device to use +.Pq default is /dev/spigen0 . +.It Fl h +Print help text to stderr, explaining the command line options. +.It Fl i +Displays information about the SPI device to stderr. +Whenever this flag is specified, no data is read or written, and the mode +and clock speed are not changed. +.It Fl L +LSB bit order. +The default is MSB, i.e., the highest order bit is +transmitted first. +Specifying -L caused the LSB to be transmitted and read first. +.It Fl m Ar 0 - 3 +SPI mode, 0 through 3. +This defines the clock phase and timing with respect to reading and writing +data, as per the SPI specification. +.It Fl s Ar speed +Specify the maximum speed, in Hz, for the SPI clock. +The bus will operate at its highest available speed which does not +exceed this maximum. +.It Fl v +Specifies Verbose mode. +Diagnostics and information are written to stderr. +You can specify +.Sq -v +more than once to increase verbosity. +.El +.Sh EXAMPLES +Here are a few examples of using the spi utility: +.Bl -bullet +.It +Get information about the default SPI device +.Pp +spi -i +.It +Set the maximum clock speed to 200Khz and the mode to 3 on spigen0.1, but do +not transmit nor receive any data +.Pp +spi -f spigen0.1 -s 200000 -m 3 +.It +Send a command sequence consisting of 2 bytes, and read 2 additional bytes +from the SPI device, using the current mode and speed on the default device +.Pp +spi -d r -C "00 01" -c 2 +.It +Transmit a byte value of 5, and receive 2 bytes, displaying their values as +2-byte ASCII hexadecimal, with mode 2, and a maximum clock speed of 500khz. +.Pp +echo "05" | spi -A -d rw -m 2 -s 500000 -c 2 +.It +Send a binary file, and output the SPI result through +.Sq od +as hexadecimal bytes, using the current maximum clock speed and SPI mode. +.Pp +spi -d rw -c -1 +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_DEVICE_NAME "/dev/spigen0.0" + +#define DEFAULT_BUFFER_SIZE 8192 + +#define DIR_READ 0 +#define DIR_WRITE 1 +#define DIR_READWRITE 2 +#define DIR_NONE -1 + +struct spi_options { + int mode; /* mode (0,1,2,3, -1 == use default) */ + int speed; /* speed (in Hz, -1 == use default) */ + int count; /* count (0 through 'n' bytes, negative for + * stdin length) */ + int binary; /* non-zero for binary output or zero for + * ASCII output when ASCII != 0 */ + int ASCII; /* zero for binary input and output. + * non-zero for ASCII input, 'binary' + * determines output */ + int lsb; /* non-zero for LSB order (default order is + * MSB) */ + int verbose; /* non-zero for verbosity */ + int ncmd; /* bytes to skip for incoming data */ + uint8_t *pcmd; /* command data (NULL if none) */ +}; + +static void usage(void); +static int interpret_command_bytes(const char *parg, struct spi_options *popt); +static void * prep_write_buffer(struct spi_options *popt); +static int _read_write(int hdev, void *bufw, void *bufr, int cbrw, int lsb); +static int _do_data_output(void *pr, struct spi_options *popt); +static int get_info(int hdev, const char *dev_name); +static int set_mode(int hdev, struct spi_options *popt); +static int set_speed(int hdev, struct spi_options *popt); +static int hexval(char c); +static int perform_read(int hdev, struct spi_options *popt); +static int perform_write(int hdev, struct spi_options *popt); +static int perform_readwrite(int hdev, struct spi_options *popt); +static void verbose_dump_buffer(void *pbuf, int icount, int lsb); + +/* + * LSB array - reversebits[n] is the LSB value of n as an MSB. Use this array + * to obtain a reversed bit pattern of the index value when bits must + * be sent/received in an LSB order vs the default MSB + */ +static uint8_t reversebits[256] = { + 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, + 0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0, + 0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8, + 0x18, 0x98, 0x58, 0xd8, 0x38, 0xb8, 0x78, 0xf8, + 0x04, 0x84, 0x44, 0xc4, 0x24, 0xa4, 0x64, 0xe4, + 0x14, 0x94, 0x54, 0xd4, 0x34, 0xb4, 0x74, 0xf4, + 0x0c, 0x8c, 0x4c, 0xcc, 0x2c, 0xac, 0x6c, 0xec, + 0x1c, 0x9c, 0x5c, 0xdc, 0x3c, 0xbc, 0x7c, 0xfc, + 0x02, 0x82, 0x42, 0xc2, 0x22, 0xa2, 0x62, 0xe2, + 0x12, 0x92, 0x52, 0xd2, 0x32, 0xb2, 0x72, 0xf2, + 0x0a, 0x8a, 0x4a, 0xca, 0x2a, 0xaa, 0x6a, 0xea, + 0x1a, 0x9a, 0x5a, 0xda, 0x3a, 0xba, 0x7a, 0xfa, + 0x06, 0x86, 0x46, 0xc6, 0x26, 0xa6, 0x66, 0xe6, + 0x16, 0x96, 0x56, 0xd6, 0x36, 0xb6, 0x76, 0xf6, + 0x0e, 0x8e, 0x4e, 0xce, 0x2e, 0xae, 0x6e, 0xee, + 0x1e, 0x9e, 0x5e, 0xde, 0x3e, 0xbe, 0x7e, 0xfe, + 0x01, 0x81, 0x41, 0xc1, 0x21, 0xa1, 0x61, 0xe1, + 0x11, 0x91, 0x51, 0xd1, 0x31, 0xb1, 0x71, 0xf1, + 0x09, 0x89, 0x49, 0xc9, 0x29, 0xa9, 0x69, 0xe9, + 0x19, 0x99, 0x59, 0xd9, 0x39, 0xb9, 0x79, 0xf9, + 0x05, 0x85, 0x45, 0xc5, 0x25, 0xa5, 0x65, 0xe5, + 0x15, 0x95, 0x55, 0xd5, 0x35, 0xb5, 0x75, 0xf5, + 0x0d, 0x8d, 0x4d, 0xcd, 0x2d, 0xad, 0x6d, 0xed, + 0x1d, 0x9d, 0x5d, 0xdd, 0x3d, 0xbd, 0x7d, 0xfd, + 0x03, 0x83, 0x43, 0xc3, 0x23, 0xa3, 0x63, 0xe3, + 0x13, 0x93, 0x53, 0xd3, 0x33, 0xb3, 0x73, 0xf3, + 0x0b, 0x8b, 0x4b, 0xcb, 0x2b, 0xab, 0x6b, 0xeb, + 0x1b, 0x9b, 0x5b, 0xdb, 0x3b, 0xbb, 0x7b, 0xfb, + 0x07, 0x87, 0x47, 0xc7, 0x27, 0xa7, 0x67, 0xe7, + 0x17, 0x97, 0x57, 0xd7, 0x37, 0xb7, 0x77, 0xf7, + 0x0f, 0x8f, 0x4f, 0xcf, 0x2f, 0xaf, 0x6f, 0xef, + 0x1f, 0x9f, 0x5f, 0xdf, 0x3f, 0xbf, 0x7f, 0xff +}; + + +static void +usage(void) +{ + fputs(getprogname(), stderr); + fputs(" - communicate on SPI bus with slave devices\n" + "Usage:\n" + " spi [-f device] [-d r|w|rw] [-m mode] [-s max-speed] [-c count]\n" + " [-C \"command bytes\"] [-A] [-b] [-L] [-v]\n" + " spi -i [-f device] [-v]\n" + " spi -h\n" + " where\n" + " -f specifies the device (default is spigen0.0)\n" + " -d specifies the operation (r, w, or rw; default is rw)\n" + " -m specifies the mode (0, 1, 2, or 3)\n" + " -s specifies the maximum speed (default is 0, device default)\n" + " -c specifies the number of data bytes to transfer (default 0, i.e. none)\n" + " A negative value uses the length of the input data\n" + " -C specifies 'command bytes' to be sent, as 2 byte hexadecimal values\n" + " (these should be quoted, separated by optional white space)\n" + " -L specifies 'LSB' order on the SPI bus (default is MSB)\n" + " -i query information about the device\n" + " -A uses ASCII for input/output as 2-digit hex values\n" + " -b Override output format as binary (only valid with '-A')\n" + " -v verbose output\n" + " -h prints this message\n" + "\n" + "NOTE: setting the mode and/or speed is 'sticky'. Subsequent transactions\n" + " on that device will, by default, use the previously set values.\n" + "\n", + stderr); +} + +int +main(int argc, char *argv[], char *envp[] __unused) +{ + struct spi_options opt; + int err, ch, hdev, finfo, fdir; + char *pstr; + char dev_name[PATH_MAX * 2 + 5]; + + finfo = 0; + fdir = DIR_NONE; + + hdev = -1; + err = 0; + + dev_name[0] = 0; + + opt.mode = -1; + opt.speed = -1; + opt.count = 0; + opt.ASCII = 0; + opt.binary = 0; + opt.lsb = 0; + opt.verbose = 0; + opt.ncmd = 0; + opt.pcmd = NULL; + + while (!err && (ch = getopt(argc, argv, "f:d:m:s:c:C:AbLvih")) != -1) { + switch (ch) { + case 'd': + if (optarg[0] == 'r') { + if (optarg[1] == 'w' && optarg[2] == 0) { + fdir = DIR_READWRITE; + } + else if (optarg[1] == 0) { + fdir = DIR_READ; + } + } + else if (optarg[0] == 'w' && optarg[1] == 0) { + fdir = DIR_WRITE; + } + else { + err = 1; + } + break; + + case 'f': + if (!optarg[0]) { /* unlikely */ + fputs("error - missing device name\n", stderr); + err = 1; + } + else { + if (optarg[0] == '/') + strlcpy(dev_name, optarg, + sizeof(dev_name)); + else + snprintf(dev_name, sizeof(dev_name), + "/dev/%s", optarg); + } + break; + + case 'm': + opt.mode = (int)strtol(optarg, &pstr, 10); + + if (!pstr || *pstr || opt.mode < 0 || opt.mode > 3) { + fprintf(stderr, "Invalid mode specified: %s\n", + optarg); + err = 1; + } + break; + + case 's': + opt.speed = (int)strtol(optarg, &pstr, 10); + + if (!pstr || *pstr || opt.speed < 0) { + fprintf(stderr, "Invalid speed specified: %s\n", + optarg); + err = 1; + } + break; + + case 'c': + opt.count = (int)strtol(optarg, &pstr, 10); + + if (!pstr || *pstr) { + fprintf(stderr, "Invalid count specified: %s\n", + optarg); + err = 1; + } + break; + + case 'C': + if(opt.pcmd) /* specified more than once */ + err = 1; + else { + /* get malloc'd buffer or error */ + if (interpret_command_bytes(optarg, &opt)) + err = 1; + } + + break; + + case 'A': + opt.ASCII = 1; + break; + + case 'b': + opt.binary = 1; + break; + + case 'L': + opt.lsb = 1; + break; + + case 'v': + opt.verbose++; + break; + + case 'i': + finfo = 1; + break; + + default: + err = 1; + /* FALLTHROUGH */ + case 'h': + usage(); + goto the_end; + } + } + + argc -= optind; + argv += optind; + + if (err || + (fdir == DIR_NONE && !finfo && opt.mode == -1 && opt.speed == -1 && opt.count == 0)) { + /* + * if any of the direction, mode, speed, or count not specified, + * print usage + */ + + usage(); + goto the_end; + } + + if ((opt.count != 0 || opt.ncmd != 0) && fdir == DIR_NONE) { + /* + * count was specified, but direction was not. default is + * read/write + */ + /* + * this includes a negative count, which implies write from + * stdin + */ + if (opt.count == 0) + fdir = DIR_WRITE; + else + fdir = DIR_READWRITE; + } + + if (opt.count < 0 && fdir != DIR_READWRITE && fdir != DIR_WRITE) { + fprintf(stderr, "Invalid length %d when not writing data\n", + opt.count); + + err = 1; + usage(); + goto the_end; + } + + + if (!dev_name[0]) /* no device name specified */ + strlcpy(dev_name, DEFAULT_DEVICE_NAME, sizeof(dev_name)); + + hdev = open(dev_name, O_RDWR); + + if (hdev == -1) { + fprintf(stderr, "Error - unable to open '%s', errno=%d\n", + dev_name, errno); + err = 1; + goto the_end; + } + + if (finfo) { + err = get_info(hdev, dev_name); + goto the_end; + } + + /* check and assign mode, speed */ + + if (opt.mode != -1) { + err = set_mode(hdev, &opt); + + if (err) + goto the_end; + } + + if (opt.speed != -1) { + err = set_speed(hdev, &opt); + + if (err) + goto the_end; + } + + /* do data transfer */ + + if (fdir == DIR_READ) { + err = perform_read(hdev, &opt); + } + else if (fdir == DIR_WRITE) { + err = perform_write(hdev, &opt); + } + else if (fdir == DIR_READWRITE) { + err = perform_readwrite(hdev, &opt); + } + +the_end: + + if (hdev != -1) + close(hdev); + + free(opt.pcmd); + + return (err); +} + +static int +interpret_command_bytes(const char *parg, struct spi_options *popt) +{ + int ch, ch2, ctr, cbcmd, err; + const char *ppos; + void *ptemp; + uint8_t *pcur; + + err = 0; + cbcmd = DEFAULT_BUFFER_SIZE; /* initial cmd buffer size */ + popt->pcmd = (uint8_t *)malloc(cbcmd); + + if (!popt->pcmd) + return 1; + + pcur = popt->pcmd; + + ctr = 0; + ppos = parg; + + while (*ppos) { + while (*ppos && *ppos <= ' ') { + ppos++; /* skip (optional) leading white space */ + } + + if (!*ppos) + break; /* I am done */ + + ch = hexval(*(ppos++)); + if (ch < 0 || !*ppos) { /* must be valid pair of hex characters */ + err = 1; + goto the_end; + } + + ch2 = hexval(*(ppos++)); + if (ch2 < 0) { + err = 1; + goto the_end; + } + + ch = (ch * 16 + ch2) & 0xff; /* convert to byte */ + + if (ctr >= cbcmd) { /* need re-alloc buffer? (unlikely) */ + cbcmd += 8192; /* increase by additional 8k */ + ptemp = realloc(popt->pcmd, cbcmd); + + if (!ptemp) { + err = 1; + fprintf(stderr, + "Not enough memory to interpret command bytes, errno=%d\n", + errno); + goto the_end; + } + + popt->pcmd = (uint8_t *)ptemp; + pcur = popt->pcmd + ctr; + } + + if (popt->lsb) + *pcur = reversebits[ch]; + else + *pcur = (uint8_t)ch; + + pcur++; + ctr++; + } + + popt->ncmd = ctr; /* record num bytes in '-C' argument */ + +the_end: + + /* at this point popt->pcmd is NULL or a valid pointer */ + + return err; +} + +static int +get_info(int hdev, const char *dev_name) +{ + uint32_t fmode, fspeed; + int err; + char temp_buf[PATH_MAX], cpath[PATH_MAX]; + + if (!realpath(dev_name, cpath)) /* get canonical name for info purposes */ + strlcpy(cpath, temp_buf, sizeof(cpath)); /* this shouldn't happen */ + + err = ioctl(hdev, SPIGENIOC_GET_SPI_MODE, &fmode); + + if (err == 0) + err = ioctl(hdev, SPIGENIOC_GET_CLOCK_SPEED, &fspeed); + + if (err == 0) { + fprintf(stderr, + "Device name: %s\n" + "Device mode: %d\n" + "Device speed: %d\n", + cpath, fmode, fspeed);//, max_cmd, max_data, temp_buf); + } + else + fprintf(stderr, "Unable to query info (err=%d), errno=%d\n", + err, errno); + + return err; +} + +static int +set_mode(int hdev, struct spi_options *popt) +{ + uint32_t fmode = popt->mode; + + if (popt->mode < 0) /* use default? */ + return 0; + + return ioctl(hdev, SPIGENIOC_SET_SPI_MODE, &fmode); +} + +static int +set_speed(int hdev, struct spi_options *popt) +{ + uint32_t clock_speed = popt->speed; + + if (popt->speed < 0) + return 0; + + return ioctl(hdev, SPIGENIOC_SET_CLOCK_SPEED, &clock_speed); +} + +static int +hexval(char c) +{ + if (c >= '0' && c <= '9') { + return c - '0'; + } else if (c >= 'A' && c <= 'F') { + return c - 'A' + 10; + } else if (c >= 'a' && c <= 'f') { + return c - 'a' + 10; + } + return -1; +} + +static void * +prep_write_buffer(struct spi_options *popt) +{ + int ch, ch2, ch3, ncmd, lsb, err; + uint8_t *pdata, *pdat2; + size_t cbdata, cbread; + const char *szbytes; + + ncmd = popt->ncmd; /* num command bytes (can be zero) */ + + if (ncmd == 0 && popt->count == 0) + return NULL; /* always since it's an error if it happens + * now */ + + if (popt->count < 0) { + cbdata = DEFAULT_BUFFER_SIZE; + } + else { + cbdata = popt->count; + } + + lsb = popt->lsb; /* non-zero if LSB order; else MSB */ + + pdata = malloc(cbdata + ncmd + 1); + cbread = 0; + + err = 0; + + if (!pdata) + return NULL; + + if (popt->pcmd && ncmd > 0) { + memcpy(pdata, popt->pcmd, ncmd); /* copy command bytes */ + pdat2 = pdata + ncmd; + } + else + pdat2 = pdata; /* no prepended command data */ + + /* + * read up to 'cbdata' bytes. If I get an EOF, do one of two things: + * a) change the data count to match how many bytes I read in b) fill + * the rest of the input buffer with zeros + * + * If the specified length is negative, I do 'a', else 'b' + */ + + while (!err && cbread < cbdata && (ch = fgetc(stdin)) != EOF) { + if (popt->ASCII) { + /* skip consecutive white space */ + + while (ch <= ' ') { + if ((ch = fgetc(stdin)) == EOF) + break; + } + + if (ch != EOF) { + ch2 = hexval(ch); + + if (ch2 < 0) { +invalid_character: + fprintf(stderr, + "Invalid input character '%c'\n", ch); + err = 1; + break; + } + + ch = fgetc(stdin); + + if (ch != EOF) { + ch3 = hexval(ch); + + if (ch3 < 0) + goto invalid_character; + + ch = ch2 * 16 + ch3; + } + } + + if (err || ch == EOF) + break; + } + + /* for LSB, flip the bits - otherwise, just copy the value */ + if (lsb) + pdat2[cbread] = reversebits[ch]; + else + pdat2[cbread] = (uint8_t) ch; + + cbread++; /* increment num bytes read so far */ + } + + /* if it was an error, not an EOF, that ended the I/O, return NULL */ + + if (err || ferror(stdin)) { + free(pdata); + return NULL; + } + + if (popt->verbose > 0) { + const char *sz_bytes; + + if (cbread != 1) + sz_bytes = "bytes"; /* correct plurality of 'byte|bytes' */ + else + sz_bytes = "byte"; + + if (popt->ASCII) + fprintf(stderr, "ASCII input of %zd %s\n", cbread, + sz_bytes); + else + fprintf(stderr, "Binary input of %zd %s\n", cbread, + sz_bytes); + } + + /* + * if opt.count is negative, copy actual byte count to opt.count which does + * not include any of the 'command' bytes that are being sent. Can be zero. + */ + if (popt->count < 0) { + popt->count = cbread; + } + /* + * for everything else, fill the rest of the read buffer with '0' + * bytes, as per the standard practice for SPI + */ + else { + while (cbread < cbdata) + pdat2[cbread++] = 0; + } + + /* + * popt->count bytes will be sent and read from the SPI, preceded by the + * 'popt->ncmd' command bytes (if any). + * So we must use 'popt->count' and 'popt->ncmd' from this point on in + * the code. + */ + + if (popt->verbose > 0 && popt->count + popt->ncmd) { + if ((popt->count + popt->ncmd) == 1) + szbytes = "byte"; + else + szbytes = "bytes"; + + fprintf(stderr, "Writing %d %s to SPI device\n", + popt->count + popt->ncmd, szbytes); + + verbose_dump_buffer(pdata, popt->count + popt->ncmd, lsb); + } + + return pdata; +} + +static int +_read_write(int hdev, void *bufw, void *bufr, int cbrw, int lsb) +{ + int err, ctr; + struct spigen_transfer spi; + + if (!cbrw) + return 0; + + if (!bufr) + bufr = bufw; + else + memcpy(bufr, bufw, cbrw); /* transaction uses bufr for + * both R and W */ + + bzero(&spi, sizeof(spi)); /* zero structure first */ + + /* spigen code seems to suggest there must be at least 1 command byte */ + + spi.st_command.iov_base = bufr; + spi.st_command.iov_len = cbrw; + + /* + * The remaining members for spi.st_data are zero - all bytes are + * 'command' for this. The driver doesn't really do anything different + * for 'command' vs 'data' and at least one command byte must be sent in + * the transaction. + */ + + err = ioctl(hdev, SPIGENIOC_TRANSFER, &spi) < 0 ? -1 : 0; + + if (!err && lsb) { + /* flip the bits for 'lsb' mode */ + for (ctr = 0; ctr < cbrw; ctr++) { + ((uint8_t *) bufr)[ctr] = + reversebits[((uint8_t *)bufr)[ctr]]; + } + } + + if (err) + fprintf(stderr, "Error performing SPI transaction, errno=%d\n", + errno); + + return err; +} + +static int +_do_data_output(void *pr, struct spi_options *popt) +{ + int err, index, icount; + const char *sz_bytes, *sz_byte2; + const uint8_t *pbuf; + + pbuf = (uint8_t *)pr + popt->ncmd; /* only the data we want */ + icount = popt->count; + err = 0; + + if (icount <= 0) { + return -1; /* should not but could happen */ + } + + if (icount != 1) + sz_bytes = "bytes"; /* correct plurality of 'byte|bytes' */ + else + sz_bytes = "byte"; + + if (popt->ncmd != 1) + sz_byte2 = "bytes"; + else + sz_byte2 = "byte"; + + /* binary on stdout */ + if (popt->binary || !popt->ASCII) { + if (popt->verbose > 0) + fprintf(stderr, "Binary output of %d %s\n", icount, + sz_bytes); + + err = (int)fwrite(pbuf, 1, icount, stdout) != icount; + } + else if (icount > 0) { + if (popt->verbose > 0) + fprintf(stderr, "ASCII output of %d %s\n", icount, + sz_bytes); + + /* ASCII output */ + for (index = 0; !err && index < icount; index++) { + if (index) { + /* + * not the first time, insert separating space + */ + err = fputc(' ', stdout) == EOF; + } + + if (!err) + err = fprintf(stdout, "%02hhx", pbuf[index]) < 0; + } + + if (!err) + err = fputc('\n', stdout) == EOF; + } *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@freebsd.org Fri Jun 22 02:56:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D8D3F100B581; Fri, 22 Jun 2018 02:56:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8C91B7AA63; Fri, 22 Jun 2018 02:56:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6D8961AD42; Fri, 22 Jun 2018 02:56:03 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M2u3DX031613; Fri, 22 Jun 2018 02:56:03 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M2u3wx031612; Fri, 22 Jun 2018 02:56:03 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <201806220256.w5M2u3wx031612@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Fri, 22 Jun 2018 02:56:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335528 - head/tests/sys/audit X-SVN-Group: head X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: head/tests/sys/audit X-SVN-Commit-Revision: 335528 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 02:56:04 -0000 Author: asomers Date: Fri Jun 22 02:56:03 2018 New Revision: 335528 URL: https://svnweb.freebsd.org/changeset/base/335528 Log: audit(4): add tests for Sys V semaphore operations Submitted by: aniketp MFC after: 2 weeks Sponsored by: Google, Inc. (GSoC 2018) Differential Revision: https://reviews.freebsd.org/D15897 Modified: head/tests/sys/audit/inter-process.c Modified: head/tests/sys/audit/inter-process.c ============================================================================== --- head/tests/sys/audit/inter-process.c Fri Jun 22 01:59:19 2018 (r335527) +++ head/tests/sys/audit/inter-process.c Fri Jun 22 02:56:03 2018 (r335528) @@ -30,6 +30,8 @@ #include #include #include +#define _WANT_SEMUN +#include #include #include @@ -45,13 +47,17 @@ struct msgstr { }; typedef struct msgstr msgstr_t; + static pid_t pid; -static int msqid, shmid; +static int msqid, shmid, semid; +static union semun semarg; static struct pollfd fds[1]; static struct msqid_ds msgbuff; static struct shmid_ds shmbuff; +static struct semid_ds sembuff; static char ipcregex[BUFFSIZE]; static const char *auclass = "ip"; +static unsigned short semvals[BUFFSIZE]; ATF_TC_WITH_CLEANUP(msgget_success); @@ -729,6 +735,669 @@ ATF_TC_CLEANUP(shmctl_illegal_command, tc) } +ATF_TC_WITH_CLEANUP(semget_success); +ATF_TC_HEAD(semget_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semget(2) call"); +} + +ATF_TC_BODY(semget_success, tc) +{ + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + /* Check the presence of semaphore set ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semget.*return,success,%d", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semget_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semget_failure); +ATF_TC_HEAD(semget_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semget(2) call"); +} + +ATF_TC_BODY(semget_failure, tc) +{ + pid = getpid(); + snprintf(ipcregex, sizeof(ipcregex), "semget.*%d.*return,failure", pid); + + FILE *pipefd = setup(fds, auclass); + /* Failure reason: nsems is a negative number */ + ATF_REQUIRE_EQ(-1, semget(IPC_PRIVATE, -1, 0)); + check_audit(fds, ipcregex, pipefd); +} + +ATF_TC_CLEANUP(semget_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semop_success); +ATF_TC_HEAD(semop_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semop(2) call"); +} + +ATF_TC_BODY(semop_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + /* Initialize a sembuf structure to operate on semaphore set */ + struct sembuf sop[1] = {{0, 1, 0}}; + /* Check the presence of semaphore set ID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semop.*Semaphore IPC.*%d.*return,success", semid); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semop(semid, sop, sizeof(sop)/sizeof(struct sembuf))); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semop_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semop_failure); +ATF_TC_HEAD(semop_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semop(2) call"); +} + +ATF_TC_BODY(semop_failure, tc) +{ + const char *regex = "semop.*0xffff.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semop(-1, NULL, 0)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semop_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getval_success); +ATF_TC_HEAD(semctl_getval_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for GETVAL command"); +} + +ATF_TC_BODY(semctl_getval_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, GETVAL)); + /* Check the presence of semaphore ID and GETVAL in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*GETVAL.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_getval_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getval_failure); +ATF_TC_HEAD(semctl_getval_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for GETVAL command"); +} + +ATF_TC_BODY(semctl_getval_failure, tc) +{ + const char *regex = "semctl.*GETVAL.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, GETVAL)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_getval_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_setval_success); +ATF_TC_HEAD(semctl_setval_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for SETVAL command"); +} + +ATF_TC_BODY(semctl_setval_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.val = 1; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, SETVAL, semarg)); + /* Check the presence of semaphore ID and SETVAL in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*SETVAL.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_setval_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_setval_failure); +ATF_TC_HEAD(semctl_setval_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for SETVAL command"); +} + +ATF_TC_BODY(semctl_setval_failure, tc) +{ + const char *regex = "semctl.*SETVAL.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, SETVAL, semarg)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_setval_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getpid_success); +ATF_TC_HEAD(semctl_getpid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for GETPID command"); +} + +ATF_TC_BODY(semctl_getpid_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, GETPID)); + /* Check the presence of semaphore ID and GETVAL in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*GETPID.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_getpid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getpid_failure); +ATF_TC_HEAD(semctl_getpid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for GETPID command"); +} + +ATF_TC_BODY(semctl_getpid_failure, tc) +{ + const char *regex = "semctl.*GETPID.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, GETPID)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_getpid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getncnt_success); +ATF_TC_HEAD(semctl_getncnt_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for GETNCNT command"); +} + +ATF_TC_BODY(semctl_getncnt_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, GETNCNT)); + /* Check the presence of semaphore ID and GETNCNT in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*GETNCNT.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_getncnt_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getncnt_failure); +ATF_TC_HEAD(semctl_getncnt_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for GETNCNT command"); +} + +ATF_TC_BODY(semctl_getncnt_failure, tc) +{ + const char *regex = "semctl.*GETNCNT.*return,failure.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, GETNCNT)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_getncnt_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getzcnt_success); +ATF_TC_HEAD(semctl_getzcnt_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for GETZCNT command"); +} + +ATF_TC_BODY(semctl_getzcnt_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, GETZCNT)); + /* Check the presence of semaphore ID and GETZCNT in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*GETZCNT.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_getzcnt_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getzcnt_failure); +ATF_TC_HEAD(semctl_getzcnt_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for GETZCNT command"); +} + +ATF_TC_BODY(semctl_getzcnt_failure, tc) +{ + const char *regex = "semctl.*GETZCNT.*return,failure.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, GETZCNT)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_getzcnt_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getall_success); +ATF_TC_HEAD(semctl_getall_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for GETALL command"); +} + +ATF_TC_BODY(semctl_getall_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.array = semvals; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE(semctl(semid, 0, GETALL, semarg) != -1); + /* Check the presence of semaphore ID and GETALL in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*GETALL.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_getall_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_getall_failure); +ATF_TC_HEAD(semctl_getall_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for GETALL command"); +} + +ATF_TC_BODY(semctl_getall_failure, tc) +{ + const char *regex = "semctl.*GETALL.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, GETALL, semarg)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_getall_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_setall_success); +ATF_TC_HEAD(semctl_setall_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for SETALL command"); +} + +ATF_TC_BODY(semctl_setall_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.array = semvals; + /* Initialize semvals to be used with SETALL */ + ATF_REQUIRE(semctl(semid, 0, GETALL, semarg) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, SETALL, semarg)); + /* Check the presence of semaphore ID and SETALL in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*SETALL.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_setall_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_setall_failure); +ATF_TC_HEAD(semctl_setall_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for SETALL command"); +} + +ATF_TC_BODY(semctl_setall_failure, tc) +{ + const char *regex = "semctl.*SETALL.*return,failure : Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, SETALL, semarg)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_setall_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_stat_success); +ATF_TC_HEAD(semctl_stat_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(semctl_stat_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.buf = &sembuff; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_STAT, semarg)); + /* Check the presence of semaphore ID and IPC_STAT in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*IPC_STAT.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_stat_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_stat_failure); +ATF_TC_HEAD(semctl_stat_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for IPC_STAT command"); +} + +ATF_TC_BODY(semctl_stat_failure, tc) +{ + const char *regex = "semctl.*IPC_STAT.*return,fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, IPC_STAT, semarg)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_stat_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_set_success); +ATF_TC_HEAD(semctl_set_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(semctl_set_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.buf = &sembuff; + /* Fill up the sembuff structure to be used with IPC_SET */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_STAT, semarg)); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_SET, semarg)); + /* Check the presence of semaphore ID and IPC_SET in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*IPC_SET.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_set_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_set_failure); +ATF_TC_HEAD(semctl_set_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for IPC_SET command"); +} + +ATF_TC_BODY(semctl_set_failure, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + semarg.buf = &sembuff; + /* Fill up the sembuff structure to be used with IPC_SET */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_STAT, semarg)); + + const char *regex = "semctl.*IPC_SET.*return,failure.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, IPC_SET, semarg)); + check_audit(fds, regex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_set_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_rmid_success); +ATF_TC_HEAD(semctl_rmid_success, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of a successful " + "semctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(semctl_rmid_success, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID, semarg)); + /* Check the presence of semaphore ID and IPC_RMID in audit record */ + snprintf(ipcregex, sizeof(ipcregex), + "semctl.*IPC_RMID.*%d.*return,success", semid); + check_audit(fds, ipcregex, pipefd); +} + +ATF_TC_CLEANUP(semctl_rmid_success, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_rmid_failure); +ATF_TC_HEAD(semctl_rmid_failure, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for IPC_RMID command"); +} + +ATF_TC_BODY(semctl_rmid_failure, tc) +{ + const char *regex = "semctl.*IPC_RMID.*return,fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(-1, 0, IPC_RMID, semarg)); + check_audit(fds, regex, pipefd); +} + +ATF_TC_CLEANUP(semctl_rmid_failure, tc) +{ + cleanup(); +} + + +ATF_TC_WITH_CLEANUP(semctl_illegal_command); +ATF_TC_HEAD(semctl_illegal_command, tc) +{ + atf_tc_set_md_var(tc, "descr", "Tests the audit of an unsuccessful " + "semctl(2) call for illegal cmd value"); +} + +ATF_TC_BODY(semctl_illegal_command, tc) +{ + /* Create a semaphore set and obtain the set identifier */ + ATF_REQUIRE((semid = + semget(IPC_PRIVATE, 1, IPC_CREAT | S_IRUSR)) != -1); + + const char *regex = "semctl.*illegal command.*fail.*Invalid argument"; + FILE *pipefd = setup(fds, auclass); + ATF_REQUIRE_EQ(-1, semctl(semid, 0, -1)); + check_audit(fds, regex, pipefd); + + /* Destroy the semaphore set with ID = semid */ + ATF_REQUIRE_EQ(0, semctl(semid, 0, IPC_RMID)); +} + +ATF_TC_CLEANUP(semctl_illegal_command, tc) +{ + cleanup(); +} + + ATF_TP_ADD_TCS(tp) { ATF_TP_ADD_TC(tp, msgget_success); @@ -760,6 +1429,33 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, shmctl_set_success); ATF_TP_ADD_TC(tp, shmctl_set_failure); ATF_TP_ADD_TC(tp, shmctl_illegal_command); + + ATF_TP_ADD_TC(tp, semget_success); + ATF_TP_ADD_TC(tp, semget_failure); + ATF_TP_ADD_TC(tp, semop_success); + ATF_TP_ADD_TC(tp, semop_failure); + + ATF_TP_ADD_TC(tp, semctl_getval_success); + ATF_TP_ADD_TC(tp, semctl_getval_failure); + ATF_TP_ADD_TC(tp, semctl_setval_success); + ATF_TP_ADD_TC(tp, semctl_setval_failure); + ATF_TP_ADD_TC(tp, semctl_getpid_success); + ATF_TP_ADD_TC(tp, semctl_getpid_failure); + ATF_TP_ADD_TC(tp, semctl_getncnt_success); + ATF_TP_ADD_TC(tp, semctl_getncnt_failure); + ATF_TP_ADD_TC(tp, semctl_getzcnt_success); + ATF_TP_ADD_TC(tp, semctl_getzcnt_failure); + ATF_TP_ADD_TC(tp, semctl_getall_success); + ATF_TP_ADD_TC(tp, semctl_getall_failure); + ATF_TP_ADD_TC(tp, semctl_setall_success); + ATF_TP_ADD_TC(tp, semctl_setall_failure); + ATF_TP_ADD_TC(tp, semctl_stat_success); + ATF_TP_ADD_TC(tp, semctl_stat_failure); + ATF_TP_ADD_TC(tp, semctl_set_success); + ATF_TP_ADD_TC(tp, semctl_set_failure); + ATF_TP_ADD_TC(tp, semctl_rmid_success); + ATF_TP_ADD_TC(tp, semctl_rmid_failure); + ATF_TP_ADD_TC(tp, semctl_illegal_command); return (atf_no_error()); } From owner-svn-src-all@freebsd.org Fri Jun 22 03:40:04 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9877100C2C5; Fri, 22 Jun 2018 03:40:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6C38A7BF16; Fri, 22 Jun 2018 03:40:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D6CE1B458; Fri, 22 Jun 2018 03:40:04 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M3e4lC053286; Fri, 22 Jun 2018 03:40:04 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M3e4Q1053285; Fri, 22 Jun 2018 03:40:04 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806220340.w5M3e4Q1053285@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 22 Jun 2018 03:40:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335529 - head/usr.sbin/spi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/spi X-SVN-Commit-Revision: 335529 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 03:40:05 -0000 Author: ian Date: Fri Jun 22 03:40:03 2018 New Revision: 335529 URL: https://svnweb.freebsd.org/changeset/base/335529 Log: Eliminate gcc "shadowed declaration" warnings by using idx rather than index as a variable name. Reported by: manu@ Modified: head/usr.sbin/spi/spi.c Modified: head/usr.sbin/spi/spi.c ============================================================================== --- head/usr.sbin/spi/spi.c Fri Jun 22 02:56:03 2018 (r335528) +++ head/usr.sbin/spi/spi.c Fri Jun 22 03:40:03 2018 (r335529) @@ -722,7 +722,7 @@ _read_write(int hdev, void *bufw, void *bufr, int cbrw static int _do_data_output(void *pr, struct spi_options *popt) { - int err, index, icount; + int err, idx, icount; const char *sz_bytes, *sz_byte2; const uint8_t *pbuf; @@ -758,8 +758,8 @@ _do_data_output(void *pr, struct spi_options *popt) sz_bytes); /* ASCII output */ - for (index = 0; !err && index < icount; index++) { - if (index) { + for (idx = 0; !err && idx < icount; idx++) { + if (idx) { /* * not the first time, insert separating space */ @@ -767,7 +767,7 @@ _do_data_output(void *pr, struct spi_options *popt) } if (!err) - err = fprintf(stdout, "%02hhx", pbuf[index]) < 0; + err = fprintf(stdout, "%02hhx", pbuf[idx]) < 0; } if (!err) @@ -902,7 +902,7 @@ static void verbose_dump_buffer(void *pbuf, int icount, int lsb) { uint8_t ch; - int ictr, ictr2, index; + int ictr, ictr2, idx; fputs(" | 0 1 2 3 4 5 6 7 8 9 A B C D E F " "| |\n", stderr); @@ -911,10 +911,10 @@ verbose_dump_buffer(void *pbuf, int icount, int lsb) fprintf(stderr, " %6x | ", ictr & 0xfffff0); for (ictr2 = 0; ictr2 < 16; ictr2++) { - index = ictr + ictr2; + idx = ictr + ictr2; - if (index < icount) { - ch = ((uint8_t *) pbuf)[index]; + if (idx < icount) { + ch = ((uint8_t *) pbuf)[idx]; if (lsb) ch = reversebits[ch]; @@ -929,10 +929,10 @@ verbose_dump_buffer(void *pbuf, int icount, int lsb) fputs("| ", stderr); for (ictr2 = 0; ictr2 < 16; ictr2++) { - index = ictr + ictr2; + idx = ictr + ictr2; - if (index < icount) { - ch = ((uint8_t *) pbuf)[index]; + if (idx < icount) { + ch = ((uint8_t *) pbuf)[idx]; if (lsb) ch = reversebits[ch]; @@ -942,7 +942,7 @@ verbose_dump_buffer(void *pbuf, int icount, int lsb) fprintf(stderr, "%c", ch); } - else if (index < icount) { + else if (idx < icount) { out_of_range: fputc('.', stderr); } From owner-svn-src-all@freebsd.org Fri Jun 22 04:54:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BDD44100E2C5; Fri, 22 Jun 2018 04:54:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 698117E067; Fri, 22 Jun 2018 04:54:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 474361C134; Fri, 22 Jun 2018 04:54:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M4sqar093229; Fri, 22 Jun 2018 04:54:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M4sqUV093228; Fri, 22 Jun 2018 04:54:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220454.w5M4sqUV093228@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 04:54:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335530 - stable/11/usr.sbin/service X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.sbin/service X-SVN-Commit-Revision: 335530 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 04:54:53 -0000 Author: eadler Date: Fri Jun 22 04:54:51 2018 New Revision: 335530 URL: https://svnweb.freebsd.org/changeset/base/335530 Log: MFC r334472: service(1): Improve manual page * Sort options.. * Fix some typos. * Use one Bd macro for code blocks instead of a bunch of Dl * macros. * Improve formatting. * Clarify 'jail' argument PR: 228552 Modified: stable/11/usr.sbin/service/service.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/service/service.8 ============================================================================== --- stable/11/usr.sbin/service/service.8 Fri Jun 22 03:40:03 2018 (r335529) +++ stable/11/usr.sbin/service/service.8 Fri Jun 22 04:54:51 2018 (r335530) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2018 +.Dd May 31, 2018 .Dt SERVICE 8 .Os .Sh NAME @@ -32,19 +32,24 @@ .Nd "control (start/stop/etc.) or list system services" .Sh SYNOPSIS .Nm -.Op Fl j Ao jail name or id Ac +.Op Fl j Ar jail .Fl e .Nm -.Op Fl j Ao jail name or id Ac +.Op Fl j Ar jail .Fl R .Nm -.Op Fl j Ao jail name or id Ac +.Op Fl j Ar jail .Op Fl v -.Fl l | r +.Fl l .Nm -.Op Fl j Ao jail name or id Ac +.Op Fl j Ar jail .Op Fl v -.Ar start|stop|etc. +.Fl r +.Nm +.Op Fl j Ar jail +.Op Fl v +.Ar script +.Ar command .Sh DESCRIPTION The .Nm @@ -52,14 +57,16 @@ command is an easy interface to the rc.d system. Its primary purpose is to start and stop services provided by the rc.d scripts. When used for this purpose it will set the same restricted -environment that is in use at boot time (see below). +environment that is in use at boot time +.Po +see +.Sx ENVIRONMENT +.Pc . It can also be used to list the scripts using various criteria. .Pp The options are as follows: .Bl -tag -width F1 -.It Fl j Ao jail name or id Ac -Perform the given actions under the named jail. .It Fl e List services that are enabled. The list of scripts to check is compiled using @@ -70,8 +77,11 @@ then that list of scripts is checked for an .Qq rcvar assignment. If present the script is checked to see if it is enabled. -.It Fl R -Restart all enabled local services. +.It Fl j Ar jail +Perform the given actions under the named jail. +The +.Ar jail +argument can be either a jail ID or a jail name. .It Fl l List all files in .Pa /etc/rc.d @@ -88,8 +98,10 @@ Generate the as in .Fl e above, but list all of the files, not just what is enabled. +.It Fl R +Restart all enabled local services. .It Fl v -Be slightly more verbose +Be slightly more verbose. .El .Sh ENVIRONMENT When used to run rc.d scripts the @@ -111,21 +123,24 @@ at boot time. The following are examples of typical usage of the .Nm command: +.Bd -literal -offset -ident +service named status +service -j dns named status +service -rv +.Ed .Pp -.Dl "service named status" -.Dl "service -j dns named status" -.Dl "service -rv" -.Pp The following programmable completion entry can be use in .Xr bash 1 for the names of the rc.d scripts: -.Dl "_service () {" -.Dl " local cur" -.Dl " cur=${COMP_WORDS[COMP_CWORD]}" -.Dl " COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) )" -.Dl " return 0" -.Dl "}" -.Dl "complete -F _service service" +.Bd -literal -offset -ident +_service () { + local cur + cur=${COMP_WORDS[COMP_CWORD]} + COMPREPLY=( $( compgen -W '$( service -l )' -- $cur ) ) + return 0 +} +complete -F _service service +.Ed .Sh SEE ALSO .Xr bash 1 Pq Pa ports/shells/bash , .Xr rc.conf 5 , From owner-svn-src-all@freebsd.org Fri Jun 22 06:04:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8897F100F74F; Fri, 22 Jun 2018 06:04:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 39751800CF; Fri, 22 Jun 2018 06:04:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0F10C1CC6D; Fri, 22 Jun 2018 06:04:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M64MHC028574; Fri, 22 Jun 2018 06:04:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M64MrA028573; Fri, 22 Jun 2018 06:04:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220604.w5M64MrA028573@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 06:04:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335531 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335531 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 06:04:23 -0000 Author: eadler Date: Fri Jun 22 06:04:22 2018 New Revision: 335531 URL: https://svnweb.freebsd.org/changeset/base/335531 Log: epoch.9: fix some style and speeling issues Reported by: Yutaro Hayakawa (spelling) Differential Revision: https://reviews.freebsd.org/D15961 Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Fri Jun 22 04:54:51 2018 (r335530) +++ head/share/man/man9/epoch.9 Fri Jun 22 06:04:22 2018 (r335531) @@ -1,5 +1,5 @@ .\" -.\" Copyright (C) 2018 Matthew Macy . +.\" Copyright (C) 2018 Matthew Macy . .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions @@ -65,15 +65,15 @@ .Sh DESCRIPTION Epochs are used to guarantee liveness and immutability of data by deferring reclamation and mutation until a grace period has elapsed. -Epochs do not have any lock ordering issues. Entering and leaving -an epoch section will never block. +Epochs do not have any lock ordering issues. +Entering and leaving an epoch section will never block. .Pp Epochs are allocated with .Fn epoch_alloc and freed with .Fn epoch_free . The flags passed to epoch_alloc determine whether preemption is -allowed during a section or not (the dafult), as specified by +allowed during a section or not (the default), as specified by EPOCH_PREEMPT. Threads indicate the start of an epoch critical section by calling .Fn epoch_enter . @@ -104,16 +104,17 @@ INVARIANTS can assert that a thread is in an epoch by .Fn in_epoch . .Pp The epoch API currently does not support sleeping in epoch_preempt sections. -A caller cannot do epoch_enter recursively on different preemptible epochs. A -caller should never call +A caller cannot do epoch_enter recursively on different preemptible epochs. +A caller should never call .Fn epoch_wait in the middle of an epoch section as this will lead to a deadlock. .Pp -Note that epochs are not a straight replacement for read locks. Callers -must use safe list and tailq traversal routines in an epoch (see ck_queue). +Note that epochs are not a straight replacement for read locks. +Callers must use safe list and tailq traversal routines in an epoch (see ck_queue). When modifying a list referenced from an epoch section safe removal routines must be used and the caller can no longer modify a list entry -in place. An item to be modified must be handled with copy on write +in place. +An item to be modified must be handled with copy on write and frees must be deferred until after a grace period has elapsed. .Sh RETURN VALUES .Fn in_epoch @@ -123,11 +124,11 @@ One must be cautious when using .Fn epoch_wait_preempt threads are pinned during epoch sections so if a thread in a section is then preempted by a higher priority compute bound thread on that CPU it can be -prevented from leaving the section. Thus the wait time for the waiter is +prevented from leaving the section. +Thus the wait time for the waiter is potentially unbounded. .Sh EXAMPLES Async free example: - Thread 1: .Bd -literal int @@ -164,7 +165,7 @@ void if_purgeaddrs(struct ifnet *ifp) { - /* .... */ + /* .... * IF_ADDR_WLOCK(ifp); CK_STAILQ_REMOVE(&ifp->if_addrhead, ifa, ifaddr, ifa_link); IF_ADDR_WUNLOCK(ifp); @@ -172,10 +173,11 @@ if_purgeaddrs(struct ifnet *ifp) } .Ed .Pp -Thread 1 traverses the ifaddr list in an epoch. Thread 2 unlinks -with the corresponding epoch safe macro, marks as logically free, -and then defers deletion. More general mutation or a synchronous -free would have to follow a a call to +Thread 1 traverses the ifaddr list in an epoch. +Thread 2 unlinks with the corresponding epoch safe macro, marks as logically free, +and then defers deletion. +More general mutation or a synchronous +free would have to follow a call to .Fn epoch_wait . .Sh ERRORS None. From owner-svn-src-all@freebsd.org Fri Jun 22 06:05:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2CF3100F7B8; Fri, 22 Jun 2018 06:05:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 85BB080243; Fri, 22 Jun 2018 06:05:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 675011CC7F; Fri, 22 Jun 2018 06:05:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M65KZF028661; Fri, 22 Jun 2018 06:05:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M65Khq028660; Fri, 22 Jun 2018 06:05:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220605.w5M65Khq028660@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 06:05:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335532 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335532 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 06:05:21 -0000 Author: eadler Date: Fri Jun 22 06:05:19 2018 New Revision: 335532 URL: https://svnweb.freebsd.org/changeset/base/335532 Log: epoch.9: bump Dd ref D15961 Modified: head/share/man/man9/epoch.9 Modified: head/share/man/man9/epoch.9 ============================================================================== --- head/share/man/man9/epoch.9 Fri Jun 22 06:04:22 2018 (r335531) +++ head/share/man/man9/epoch.9 Fri Jun 22 06:05:19 2018 (r335532) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 13, 2018 +.Dd June 21, 2018 .Dt EPOCH 9 .Os .Sh NAME From owner-svn-src-all@freebsd.org Fri Jun 22 09:08:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9E8F1013C6E; Fri, 22 Jun 2018 09:08:39 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8ACEE85C60; Fri, 22 Jun 2018 09:08:39 +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 6BFDE1E9CD; Fri, 22 Jun 2018 09:08:39 +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 w5M98dn1023061; Fri, 22 Jun 2018 09:08:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M98d78023060; Fri, 22 Jun 2018 09:08:39 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220908.w5M98d78023060@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:08:39 +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: r335533 - stable/11/sys/dev/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/acpica X-SVN-Commit-Revision: 335533 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:08:40 -0000 Author: avg Date: Fri Jun 22 09:08:38 2018 New Revision: 335533 URL: https://svnweb.freebsd.org/changeset/base/335533 Log: MFC r333209: hpet: use macros instead of magic values for the timer mode Modified: stable/11/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/11/sys/dev/acpica/acpi_hpet.c Fri Jun 22 06:05:19 2018 (r335532) +++ stable/11/sys/dev/acpica/acpi_hpet.c Fri Jun 22 09:08:38 2018 (r335533) @@ -97,6 +97,9 @@ struct hpet_softc { struct hpet_softc *sc; int num; int mode; +#define TIMER_STOPPED 0 +#define TIMER_PERIODIC 1 +#define TIMER_ONESHOT 2 int intr_rid; int irq; int pcpu_cpu; @@ -207,10 +210,10 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; if (period != 0) { - t->mode = 1; + t->mode = TIMER_PERIODIC; t->div = (sc->freq * period) >> 32; } else { - t->mode = 2; + t->mode = TIMER_ONESHOT; t->div = 0; } if (first != 0) @@ -223,7 +226,7 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); restart: t->next = now + fdiv; - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps | HPET_TCNF_VAL_SET); @@ -254,7 +257,7 @@ hpet_stop(struct eventtimer *et) struct hpet_softc *sc = mt->sc; t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; - t->mode = 0; + t->mode = TIMER_STOPPED; t->caps &= ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE); bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); return (0); @@ -268,7 +271,7 @@ hpet_intr_single(void *arg) struct hpet_softc *sc = t->sc; uint32_t now; - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) return (FILTER_STRAY); /* Check that per-CPU timer interrupt reached right CPU. */ if (t->pcpu_cpu >= 0 && t->pcpu_cpu != curcpu) { @@ -282,8 +285,9 @@ hpet_intr_single(void *arg) * Reload timer, hoping that next time may be more lucky * (system will manage proper interrupt binding). */ - if ((t->mode == 1 && (t->caps & HPET_TCAP_PER_INT) == 0) || - t->mode == 2) { + if ((t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) == 0) || + t->mode == TIMER_ONESHOT) { t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER) + sc->freq / 8; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), @@ -291,7 +295,7 @@ hpet_intr_single(void *arg) } return (FILTER_HANDLED); } - if (t->mode == 1 && + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT) == 0) { t->next += t->div; now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); @@ -299,8 +303,8 @@ hpet_intr_single(void *arg) t->next = now + t->div / 2; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), t->next); - } else if (t->mode == 2) - t->mode = 0; + } else if (t->mode == TIMER_ONESHOT) + t->mode = TIMER_STOPPED; mt = (t->pcpu_master < 0) ? t : &sc->t[t->pcpu_master]; if (mt->et.et_active) mt->et.et_event_cb(&mt->et, mt->et.et_arg); @@ -529,7 +533,7 @@ hpet_attach(device_t dev) t = &sc->t[i]; t->sc = sc; t->num = i; - t->mode = 0; + t->mode = TIMER_STOPPED; t->intr_rid = -1; t->irq = -1; t->pcpu_cpu = -1; @@ -879,10 +883,11 @@ hpet_resume(device_t dev) } } #endif - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) continue; t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) != 0) { t->caps |= HPET_TCNF_TYPE; t->next += t->div; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), From owner-svn-src-all@freebsd.org Fri Jun 22 09:10:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A077D1013D70; Fri, 22 Jun 2018 09:10:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F94385DB5; Fri, 22 Jun 2018 09:10:00 +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 2F50B1E9D2; Fri, 22 Jun 2018 09:10:00 +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 w5M9A0qU023225; Fri, 22 Jun 2018 09:10:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9A0MI023224; Fri, 22 Jun 2018 09:10:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220910.w5M9A0MI023224@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:10:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335534 - stable/10/sys/dev/acpica X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/acpica X-SVN-Commit-Revision: 335534 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:10:00 -0000 Author: avg Date: Fri Jun 22 09:09:59 2018 New Revision: 335534 URL: https://svnweb.freebsd.org/changeset/base/335534 Log: MFC r333209: hpet: use macros instead of magic values for the timer mode Modified: stable/10/sys/dev/acpica/acpi_hpet.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/acpica/acpi_hpet.c ============================================================================== --- stable/10/sys/dev/acpica/acpi_hpet.c Fri Jun 22 09:08:38 2018 (r335533) +++ stable/10/sys/dev/acpica/acpi_hpet.c Fri Jun 22 09:09:59 2018 (r335534) @@ -93,6 +93,9 @@ struct hpet_softc { struct hpet_softc *sc; int num; int mode; +#define TIMER_STOPPED 0 +#define TIMER_PERIODIC 1 +#define TIMER_ONESHOT 2 int intr_rid; int irq; int pcpu_cpu; @@ -171,10 +174,10 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; if (period != 0) { - t->mode = 1; + t->mode = TIMER_PERIODIC; t->div = (sc->freq * period) >> 32; } else { - t->mode = 2; + t->mode = TIMER_ONESHOT; t->div = 0; } if (first != 0) @@ -187,7 +190,7 @@ hpet_start(struct eventtimer *et, sbintime_t first, sb now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); restart: t->next = now + fdiv; - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps | HPET_TCNF_VAL_SET); @@ -218,7 +221,7 @@ hpet_stop(struct eventtimer *et) struct hpet_softc *sc = mt->sc; t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; - t->mode = 0; + t->mode = TIMER_STOPPED; t->caps &= ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE); bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), t->caps); return (0); @@ -232,7 +235,7 @@ hpet_intr_single(void *arg) struct hpet_softc *sc = t->sc; uint32_t now; - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) return (FILTER_STRAY); /* Check that per-CPU timer interrupt reached right CPU. */ if (t->pcpu_cpu >= 0 && t->pcpu_cpu != curcpu) { @@ -246,8 +249,9 @@ hpet_intr_single(void *arg) * Reload timer, hoping that next time may be more lucky * (system will manage proper interrupt binding). */ - if ((t->mode == 1 && (t->caps & HPET_TCAP_PER_INT) == 0) || - t->mode == 2) { + if ((t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) == 0) || + t->mode == TIMER_ONESHOT) { t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER) + sc->freq / 8; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), @@ -255,7 +259,7 @@ hpet_intr_single(void *arg) } return (FILTER_HANDLED); } - if (t->mode == 1 && + if (t->mode == TIMER_PERIODIC && (t->caps & HPET_TCAP_PER_INT) == 0) { t->next += t->div; now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); @@ -263,8 +267,8 @@ hpet_intr_single(void *arg) t->next = now + t->div / 2; bus_write_4(sc->mem_res, HPET_TIMER_COMPARATOR(t->num), t->next); - } else if (t->mode == 2) - t->mode = 0; + } else if (t->mode == TIMER_ONESHOT) + t->mode = TIMER_STOPPED; mt = (t->pcpu_master < 0) ? t : &sc->t[t->pcpu_master]; if (mt->et.et_active) mt->et.et_event_cb(&mt->et, mt->et.et_arg); @@ -483,7 +487,7 @@ hpet_attach(device_t dev) t = &sc->t[i]; t->sc = sc; t->num = i; - t->mode = 0; + t->mode = TIMER_STOPPED; t->intr_rid = -1; t->irq = -1; t->pcpu_cpu = -1; @@ -822,10 +826,11 @@ hpet_resume(device_t dev) } } #endif - if (t->mode == 0) + if (t->mode == TIMER_STOPPED) continue; t->next = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); - if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { + if (t->mode == TIMER_PERIODIC && + (t->caps & HPET_TCAP_PER_INT) != 0) { t->caps |= HPET_TCNF_TYPE; t->next += t->div; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), From owner-svn-src-all@freebsd.org Fri Jun 22 09:10:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7BDD21013E00; Fri, 22 Jun 2018 09:10:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3161E85F0E; Fri, 22 Jun 2018 09:10:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 145391E9E6; Fri, 22 Jun 2018 09:10:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M9AoXK024796; Fri, 22 Jun 2018 09:10:50 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9Aorg024795; Fri, 22 Jun 2018 09:10:50 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220910.w5M9Aorg024795@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 09:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335535 - head/usr.bin/su X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/su X-SVN-Commit-Revision: 335535 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:10:51 -0000 Author: eadler Date: Fri Jun 22 09:10:50 2018 New Revision: 335535 URL: https://svnweb.freebsd.org/changeset/base/335535 Log: su(1): build with WARNS=6 Tested with full make universe Modified: head/usr.bin/su/Makefile Modified: head/usr.bin/su/Makefile ============================================================================== --- head/usr.bin/su/Makefile Fri Jun 22 09:09:59 2018 (r335534) +++ head/usr.bin/su/Makefile Fri Jun 22 09:10:50 2018 (r335535) @@ -5,8 +5,6 @@ PROG= su -WARNS?= 5 - LIBADD= util pam .if ${MK_AUDIT} != "no" From owner-svn-src-all@freebsd.org Fri Jun 22 09:18:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D95010140B5; Fri, 22 Jun 2018 09:18:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D01B086382; Fri, 22 Jun 2018 09:18:39 +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 924081EB61; Fri, 22 Jun 2018 09:18:39 +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 w5M9IdX3028062; Fri, 22 Jun 2018 09:18:39 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9Iclp028057; Fri, 22 Jun 2018 09:18:38 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220918.w5M9Iclp028057@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:18: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: r335536 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 335536 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:18:40 -0000 Author: avg Date: Fri Jun 22 09:18:38 2018 New Revision: 335536 URL: https://svnweb.freebsd.org/changeset/base/335536 Log: MFC r332816: call racct_proc_ucred_changed() under the proc lock Modified: stable/11/sys/kern/kern_jail.c stable/11/sys/kern/kern_loginclass.c stable/11/sys/kern/kern_prot.c stable/11/sys/kern/kern_racct.c stable/11/sys/kern/kern_rctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_jail.c ============================================================================== --- stable/11/sys/kern/kern_jail.c Fri Jun 22 09:10:50 2018 (r335535) +++ stable/11/sys/kern/kern_jail.c Fri Jun 22 09:18:38 2018 (r335536) @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -2409,10 +2410,15 @@ do_jail_attach(struct thread *td, struct prison *pr) newcred->cr_prison = pr; proc_set_cred(p, newcred); setsugid(p); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif prison_deref(oldcred->cr_prison, PD_DEREF | PD_DEUREF); crfree(oldcred); return (0); @@ -3959,6 +3965,7 @@ prison_racct_modify(struct prison *pr) */ racct_move(pr->pr_prison_racct->prr_racct, oldprr->prr_racct); +#ifdef RCTL /* * Force rctl to reattach rules to processes. */ @@ -3966,9 +3973,10 @@ prison_racct_modify(struct prison *pr) PROC_LOCK(p); cred = crhold(p->p_ucred); PROC_UNLOCK(p); - racct_proc_ucred_changed(p, cred, cred); + rctl_proc_ucred_changed(p, cred); crfree(cred); } +#endif sx_sunlock(&allproc_lock); prison_racct_free_locked(oldprr); Modified: stable/11/sys/kern/kern_loginclass.c ============================================================================== --- stable/11/sys/kern/kern_loginclass.c Fri Jun 22 09:10:50 2018 (r335535) +++ stable/11/sys/kern/kern_loginclass.c Fri Jun 22 09:18:38 2018 (r335536) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -222,9 +223,14 @@ sys_setloginclass(struct thread *td, struct setlogincl oldcred = crcopysafe(p, newcred); newcred->cr_loginclass = newlc; proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); +#endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); #endif loginclass_free(oldcred->cr_loginclass); crfree(oldcred); Modified: stable/11/sys/kern/kern_prot.c ============================================================================== --- stable/11/sys/kern/kern_prot.c Fri Jun 22 09:10:50 2018 (r335535) +++ stable/11/sys/kern/kern_prot.c Fri Jun 22 09:18:38 2018 (r335536) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -579,10 +580,15 @@ sys_setuid(struct thread *td, struct setuid_args *uap) setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif uifree(uip); crfree(oldcred); return (0); @@ -927,10 +933,15 @@ sys_setreuid(struct thread *td, struct setreuid_args * setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); #endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); +#endif uifree(ruip); uifree(euip); crfree(oldcred); @@ -1068,9 +1079,14 @@ sys_setresuid(struct thread *td, struct setresuid_args setsugid(p); } proc_set_cred(p, newcred); - PROC_UNLOCK(p); #ifdef RACCT racct_proc_ucred_changed(p, oldcred, newcred); + crhold(newcred); +#endif + PROC_UNLOCK(p); +#ifdef RCTL + rctl_proc_ucred_changed(p, newcred); + crfree(newcred); #endif uifree(ruip); uifree(euip); Modified: stable/11/sys/kern/kern_racct.c ============================================================================== --- stable/11/sys/kern/kern_racct.c Fri Jun 22 09:10:50 2018 (r335535) +++ stable/11/sys/kern/kern_racct.c Fri Jun 22 09:18:38 2018 (r335536) @@ -1048,7 +1048,7 @@ racct_proc_ucred_changed(struct proc *p, struct ucred if (!racct_enable) return; - PROC_LOCK_ASSERT(p, MA_NOTOWNED); + PROC_LOCK_ASSERT(p, MA_OWNED); newuip = newcred->cr_ruidinfo; olduip = oldcred->cr_ruidinfo; @@ -1075,10 +1075,6 @@ racct_proc_ucred_changed(struct proc *p, struct ucred p->p_racct); } RACCT_UNLOCK(); - -#ifdef RCTL - rctl_proc_ucred_changed(p, newcred); -#endif } void Modified: stable/11/sys/kern/kern_rctl.c ============================================================================== --- stable/11/sys/kern/kern_rctl.c Fri Jun 22 09:10:50 2018 (r335535) +++ stable/11/sys/kern/kern_rctl.c Fri Jun 22 09:18:38 2018 (r335536) @@ -1954,12 +1954,15 @@ rctl_proc_ucred_changed(struct proc *p, struct ucred * struct prison_racct *newprr; int rulecnt, i; - ASSERT_RACCT_ENABLED(); + if (!racct_enable) + return; + PROC_LOCK_ASSERT(p, MA_NOTOWNED); + newuip = newcred->cr_ruidinfo; newlc = newcred->cr_loginclass; newprr = newcred->cr_prison->pr_prison_racct; - + LIST_INIT(&newrules); again: From owner-svn-src-all@freebsd.org Fri Jun 22 09:20:00 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E05AD101413F; Fri, 22 Jun 2018 09:20:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 922D0864D5; Fri, 22 Jun 2018 09:20:00 +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 7339C1EB65; Fri, 22 Jun 2018 09:20:00 +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 w5M9K0kv028213; Fri, 22 Jun 2018 09:20:00 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9K0Zi028212; Fri, 22 Jun 2018 09:20:00 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220920.w5M9K0Zi028212@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:20:00 +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: r335537 - stable/11/sys/dev/amdsbwd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/amdsbwd X-SVN-Commit-Revision: 335537 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:20:01 -0000 Author: avg Date: Fri Jun 22 09:20:00 2018 New Revision: 335537 URL: https://svnweb.freebsd.org/changeset/base/335537 Log: MFC r333212: amdsbwd: add suspend and resume methods Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/11/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:18:38 2018 (r335536) +++ stable/11/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:20:00 2018 (r335537) @@ -100,12 +100,16 @@ static void amdsbwd_identify(driver_t *driver, device_ static int amdsbwd_probe(device_t dev); static int amdsbwd_attach(device_t dev); static int amdsbwd_detach(device_t dev); +static int amdsbwd_suspend(device_t dev); +static int amdsbwd_resume(device_t dev); static device_method_t amdsbwd_methods[] = { DEVMETHOD(device_identify, amdsbwd_identify), DEVMETHOD(device_probe, amdsbwd_probe), DEVMETHOD(device_attach, amdsbwd_attach), DEVMETHOD(device_detach, amdsbwd_detach), + DEVMETHOD(device_suspend, amdsbwd_suspend), + DEVMETHOD(device_resume, amdsbwd_resume), #if 0 DEVMETHOD(device_shutdown, amdsbwd_detach), #endif @@ -549,3 +553,30 @@ amdsbwd_detach(device_t dev) return (0); } +static int +amdsbwd_suspend(device_t dev) +{ + struct amdsbwd_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = wdctrl_read(sc); + val &= ~AMDSB_WD_RUN; + wdctrl_write(sc, val); + return (0); +} + +static int +amdsbwd_resume(device_t dev) +{ + struct amdsbwd_softc *sc; + + sc = device_get_softc(dev); + wdctrl_write(sc, AMDSB_WD_FIRED); + if (sc->active) { + amdsbwd_tmr_set(sc, sc->timeout); + amdsbwd_tmr_enable(sc); + amdsbwd_tmr_reload(sc); + } + return (0); +} From owner-svn-src-all@freebsd.org Fri Jun 22 09:20:51 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA0BD10141B8; Fri, 22 Jun 2018 09:20:51 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D9148663D; Fri, 22 Jun 2018 09:20:51 +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 6031B1EB7E; Fri, 22 Jun 2018 09:20:51 +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 w5M9KpFV030717; Fri, 22 Jun 2018 09:20:51 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9KpXL030716; Fri, 22 Jun 2018 09:20:51 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220920.w5M9KpXL030716@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:20:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335538 - stable/10/sys/dev/amdsbwd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/amdsbwd X-SVN-Commit-Revision: 335538 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:20:52 -0000 Author: avg Date: Fri Jun 22 09:20:50 2018 New Revision: 335538 URL: https://svnweb.freebsd.org/changeset/base/335538 Log: MFC r333212: amdsbwd: add suspend and resume methods Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:20:00 2018 (r335537) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:20:50 2018 (r335538) @@ -100,12 +100,16 @@ static void amdsbwd_identify(driver_t *driver, device_ static int amdsbwd_probe(device_t dev); static int amdsbwd_attach(device_t dev); static int amdsbwd_detach(device_t dev); +static int amdsbwd_suspend(device_t dev); +static int amdsbwd_resume(device_t dev); static device_method_t amdsbwd_methods[] = { DEVMETHOD(device_identify, amdsbwd_identify), DEVMETHOD(device_probe, amdsbwd_probe), DEVMETHOD(device_attach, amdsbwd_attach), DEVMETHOD(device_detach, amdsbwd_detach), + DEVMETHOD(device_suspend, amdsbwd_suspend), + DEVMETHOD(device_resume, amdsbwd_resume), #if 0 DEVMETHOD(device_shutdown, amdsbwd_detach), #endif @@ -549,3 +553,30 @@ amdsbwd_detach(device_t dev) return (0); } +static int +amdsbwd_suspend(device_t dev) +{ + struct amdsbwd_softc *sc; + uint32_t val; + + sc = device_get_softc(dev); + val = wdctrl_read(sc); + val &= ~AMDSB_WD_RUN; + wdctrl_write(sc, val); + return (0); +} + +static int +amdsbwd_resume(device_t dev) +{ + struct amdsbwd_softc *sc; + + sc = device_get_softc(dev); + wdctrl_write(sc, AMDSB_WD_FIRED); + if (sc->active) { + amdsbwd_tmr_set(sc, sc->timeout); + amdsbwd_tmr_enable(sc); + amdsbwd_tmr_reload(sc); + } + return (0); +} From owner-svn-src-all@freebsd.org Fri Jun 22 09:21:03 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BCB2C1014204; Fri, 22 Jun 2018 09:21:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66A3D8674F; Fri, 22 Jun 2018 09:21:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4928C1EB8C; Fri, 22 Jun 2018 09:21:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M9L3Sf031799; Fri, 22 Jun 2018 09:21:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9L21k031794; Fri, 22 Jun 2018 09:21:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220921.w5M9L21k031794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 09:21:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335539 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335539 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:21:04 -0000 Author: eadler Date: Fri Jun 22 09:21:01 2018 New Revision: 335539 URL: https://svnweb.freebsd.org/changeset/base/335539 Log: top(1): reimplement header formatting as sbuf The current header formatting is a giant format string that changes global state during the format process. Make the following changes: - use sbuf to build up the header rather than use the above pseudo-dynamic one - Change name length to 10 - Reduce size of RES and SIZE by making humanize more aggressive - Restore a version number line to the copyright. This may be required by the copyright (and may not be; its unclear) This is also a pre-req to implementing TOPCOLOR from newer versions of top(1) Discussed with: allanjude, rpolka, danfe, rgrimes Differential Revision: https://reviews.freebsd.org/D15801 Modified: head/usr.bin/top/Makefile head/usr.bin/top/commands.c head/usr.bin/top/machine.c head/usr.bin/top/machine.h head/usr.bin/top/utils.c Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Fri Jun 22 09:20:50 2018 (r335538) +++ head/usr.bin/top/Makefile Fri Jun 22 09:21:01 2018 (r335539) @@ -16,5 +16,5 @@ NO_WERROR= .endif CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual -LIBADD= ncursesw m kvm jail util +LIBADD= ncursesw m kvm jail util sbuf .include Modified: head/usr.bin/top/commands.c ============================================================================== --- head/usr.bin/top/commands.c Fri Jun 22 09:20:50 2018 (r335538) +++ head/usr.bin/top/commands.c Fri Jun 22 09:21:01 2018 (r335539) @@ -1,5 +1,6 @@ /* * Top users/processes display for Unix + * Version 3 * * This program may be freely redistributed, * but this entire comment MUST remain intact. Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 22 09:20:50 2018 (r335538) +++ head/usr.bin/top/machine.c Fri Jun 22 09:21:01 2018 (r335539) @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -49,18 +50,14 @@ #include "layout.h" #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) -#define SMPUNAMELEN 13 -#define UPUNAMELEN 15 extern struct timeval timeout; static int smpmode; enum displaymodes displaymode; -static int namelength = 8; +static const int namelength = 10; /* TOP_JID_LEN based on max of 999999 */ -#define TOP_JID_LEN 7 -#define TOP_SWAP_LEN 6 -static int jidlength; -static int swaplength; +#define TOP_JID_LEN 6 +#define TOP_SWAP_LEN 5 static int cmdlengthdelta; /* get_process_info passes back a handle. This is what it looks like: */ @@ -92,24 +89,12 @@ static const char io_header[] = static const char io_Proc_format[] = "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; -/* XXX: build up header instead of statically defining them. - * This will also allow for a "format string" to be supplied - * as an argument to top(1) instead of having predefined options */ -static const char smp_header_thr_and_pid[] = - " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; -static const char smp_header_id_only[] = - " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE C TIME %7s COMMAND"; static const char smp_Proc_format[] = - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; + "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; -static char up_header_thr_and_pid[] = - " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; -static char up_header_id_only[] = - " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAND"; static char up_Proc_format[] = - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; + "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; - /* process state names for the "STATE" column of the display */ /* the extra nulls in the string "run" are for adding a slash and the processor number when needed */ @@ -325,12 +310,6 @@ machine_init(struct statics *statics) NULL, 0) == 0 && carc_en == 1) carc_enabled = 1; - namelength = MAXLOGNAME; - if (smpmode && namelength > SMPUNAMELEN) - namelength = SMPUNAMELEN; - else if (namelength > UPUNAMELEN) - namelength = UPUNAMELEN; - kd = kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); if (kd == NULL) return (-1); @@ -407,63 +386,46 @@ machine_init(struct statics *statics) return (0); } -const char * +char * format_header(const char *uname_field) { - static char Header[128]; - const char *prehead; + static struct sbuf* header = NULL; - if (ps.jail) - jidlength = TOP_JID_LEN + 1; /* +1 for extra left space. */ - else - jidlength = 0; + /* clean up from last time. */ + if (header != NULL) { + sbuf_delete(header); + } + header = sbuf_new_auto(); - if (ps.swap) - swaplength = TOP_SWAP_LEN + 1; /* +1 for extra left space */ - else - swaplength = 0; - switch (displaymode) { - case DISP_CPU: - /* - * The logic of picking the right header is confusing, and - * depends on too much. We should instead have a struct of - * "header name", and "header format" which we build up. - * This would also fix the duplicate of effort into up vs smp - * mode. - */ - if (smpmode) { - prehead = ps.thread ? - smp_header_id_only : smp_header_thr_and_pid; - snprintf(Header, sizeof(Header), prehead, - ps.thread_id ? " THR" : "PID", - jidlength, ps.jail ? " JID" : "", - namelength, namelength, uname_field, - swaplength, ps.swap ? " SWAP" : "", - ps.wcpu ? "WCPU" : "CPU"); - } else { - prehead = ps.thread ? - up_header_id_only : up_header_thr_and_pid; - snprintf(Header, sizeof(Header), prehead, - ps.thread_id ? " THR" : "PID", - jidlength, ps.jail ? " JID" : "", - namelength, namelength, uname_field, - swaplength, ps.swap ? " SWAP" : "", - ps.wcpu ? "WCPU" : "CPU"); - } + case DISP_CPU: { + sbuf_printf(header, " %s", ps.thread_id ? " THR" : "PID"); + sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0, + ps.jail ? " JID" : ""); + sbuf_printf(header, " %-*.*s", namelength, namelength, uname_field); + sbuf_cat(header, " THR PRI NICE SIZE RES"); + sbuf_printf(header, "%*s", ps.swap ? TOP_SWAP_LEN : 0, + ps.swap ? " SWAP" : ""); + sbuf_printf(header, "%s", smpmode ? " STATE C " : " STATE "); + sbuf_cat(header, "TIME"); + sbuf_printf(header, " %7s", ps.wcpu ? "WCPU" : "CPU"); + sbuf_cat(header, " COMMAND"); + sbuf_finish(header); break; - case DISP_IO: - prehead = io_header; - snprintf(Header, sizeof(Header), prehead, + } + case DISP_IO: { + sbuf_printf(header, io_header, ps.thread_id ? " THR" : "PID", - jidlength, ps.jail ? " JID" : "", + ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : "", namelength, namelength, uname_field); break; + } case DISP_MAX: assert("displaymode must not be set to DISP_MAX"); } - cmdlengthdelta = strlen(Header) - 7; - return (Header); + + cmdlengthdelta = sbuf_len(header) - 7; + return sbuf_data(header); } static int swappgsin = -1; @@ -923,7 +885,7 @@ format_next_process(void* xhandle, char *(*get_userid) long p_tot, s_tot; const char *proc_fmt; char thr_buf[6]; - char jid_buf[TOP_JID_LEN + 1], swap_buf[TOP_SWAP_LEN + 1]; + char jid_buf[TOP_JID_LEN], swap_buf[TOP_SWAP_LEN]; char *cmdbuf = NULL; char **args; const int cmdlen = 128; @@ -1081,13 +1043,13 @@ format_next_process(void* xhandle, char *(*get_userid) jid_buf[0] = '\0'; else snprintf(jid_buf, sizeof(jid_buf), "%*d", - jidlength - 1, pp->ki_jid); + TOP_JID_LEN - 1, pp->ki_jid); if (ps.swap == 0) swap_buf[0] = '\0'; else snprintf(swap_buf, sizeof(swap_buf), "%*s", - swaplength - 1, + TOP_SWAP_LEN - 1, format_k(pagetok(ki_swap(pp)))); /* XXX */ if (displaymode == DISP_IO) { @@ -1109,7 +1071,7 @@ format_next_process(void* xhandle, char *(*get_userid) snprintf(fmt, sizeof(fmt), io_Proc_format, pp->ki_pid, - jidlength, jid_buf, + ps.jail ? TOP_JID_LEN : 0, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), rup->ru_nvcsw, rup->ru_nivcsw, @@ -1142,16 +1104,17 @@ format_next_process(void* xhandle, char *(*get_userid) snprintf(thr_buf, sizeof(thr_buf), "%*d ", (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); + snprintf(fmt, sizeof(fmt), proc_fmt, (ps.thread_id) ? pp->ki_tid : pp->ki_pid, - jidlength, jid_buf, + ps.jail ? TOP_JID_LEN : 0, jid_buf, namelength, namelength, (*get_userid)(pp->ki_ruid), thr_buf, pp->ki_pri.pri_level - PZERO, format_nice(pp), format_k(PROCSIZE(pp)), format_k(pagetok(pp->ki_rssize)), - swaplength, swaplength, swap_buf, + ps.swap ? TOP_SWAP_LEN : 0, ps.swap ? TOP_SWAP_LEN : 0, swap_buf, status, cpu, format_time(cputime), Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Fri Jun 22 09:20:50 2018 (r335538) +++ head/usr.bin/top/machine.h Fri Jun 22 09:21:01 2018 (r335539) @@ -78,7 +78,7 @@ struct process_select /* routines defined by the machine dependent module */ -const char *format_header(const char *uname_field); +char *format_header(const char *uname_field); char *format_next_process(void* handle, char *(*get_userid)(int), int flags); void toggle_pcpustats(void); Modified: head/usr.bin/top/utils.c ============================================================================== --- head/usr.bin/top/utils.c Fri Jun 22 09:20:50 2018 (r335538) +++ head/usr.bin/top/utils.c Fri Jun 22 09:21:01 2018 (r335539) @@ -268,10 +268,8 @@ format_time(long seconds) /* * format_k(amt) - format a kilobyte memory value, returning a string * suitable for display. Returns a pointer to a static - * area that changes each call. "amt" is converted to a - * string with a trailing "K". If "amt" is 10000 or greater, - * then it is formatted as megabytes (rounded) with a - * trailing "M". + * area that changes each call. "amt" is converted to a fixed + * size humanize_number call */ /* @@ -299,7 +297,7 @@ format_k(int64_t amt) ret = retarray[index]; index = (index + 1) % NUM_STRINGS; - humanize_number(ret, 6, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); + humanize_number(ret, 5, amt * 1024, "", HN_AUTOSCALE, HN_NOSPACE); return (ret); } From owner-svn-src-all@freebsd.org Fri Jun 22 09:22:31 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B38310144F0; Fri, 22 Jun 2018 09:22: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3F13C86C24; Fri, 22 Jun 2018 09:22: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 209041ED39; Fri, 22 Jun 2018 09:22: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 w5M9MUQe033331; Fri, 22 Jun 2018 09:22:30 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9MUMI033330; Fri, 22 Jun 2018 09:22:30 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220922.w5M9MUMI033330@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:22: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: r335540 - stable/11/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 335540 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:22:31 -0000 Author: avg Date: Fri Jun 22 09:22:30 2018 New Revision: 335540 URL: https://svnweb.freebsd.org/changeset/base/335540 Log: MFC r333243: opensolaris system_taskq does not need to run at maximum priority Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 22 09:21:01 2018 (r335539) +++ stable/11/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 22 09:22:30 2018 (r335540) @@ -48,7 +48,8 @@ system_taskq_init(void *arg) taskq_zone = uma_zcreate("taskq_zone", sizeof(taskq_ent_t), NULL, NULL, NULL, NULL, 0, 0); - system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0); + system_taskq = taskq_create("system_taskq", mp_ncpus, minclsyspri, + 0, 0, 0); } SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); From owner-svn-src-all@freebsd.org Fri Jun 22 09:23:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 372AD1014569; Fri, 22 Jun 2018 09:23:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E006E86D53; Fri, 22 Jun 2018 09:23:06 +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 C11DE1ED3C; Fri, 22 Jun 2018 09:23:06 +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 w5M9N6DX033424; Fri, 22 Jun 2018 09:23:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9N6ii033423; Fri, 22 Jun 2018 09:23:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220923.w5M9N6ii033423@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:23:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335541 - stable/10/sys/cddl/compat/opensolaris/kern X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/compat/opensolaris/kern X-SVN-Commit-Revision: 335541 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:23:07 -0000 Author: avg Date: Fri Jun 22 09:23:06 2018 New Revision: 335541 URL: https://svnweb.freebsd.org/changeset/base/335541 Log: MFC r333243: opensolaris system_taskq does not need to run at maximum priority Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c ============================================================================== --- stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 22 09:22:30 2018 (r335540) +++ stable/10/sys/cddl/compat/opensolaris/kern/opensolaris_taskq.c Fri Jun 22 09:23:06 2018 (r335541) @@ -48,7 +48,8 @@ system_taskq_init(void *arg) taskq_zone = uma_zcreate("taskq_zone", sizeof(taskq_ent_t), NULL, NULL, NULL, NULL, 0, 0); - system_taskq = taskq_create("system_taskq", mp_ncpus, 0, 0, 0, 0); + system_taskq = taskq_create("system_taskq", mp_ncpus, minclsyspri, + 0, 0, 0); } SYSINIT(system_taskq_init, SI_SUB_CONFIGURE, SI_ORDER_ANY, system_taskq_init, NULL); From owner-svn-src-all@freebsd.org Fri Jun 22 09:25:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 137AC1014656; Fri, 22 Jun 2018 09:25:26 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B714186EF8; Fri, 22 Jun 2018 09:25:25 +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 919311ED3D; Fri, 22 Jun 2018 09:25:25 +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 w5M9PPEc033587; Fri, 22 Jun 2018 09:25:25 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9PPSW033585; Fri, 22 Jun 2018 09:25:25 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220925.w5M9PPSW033585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:25: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: r335542 - stable/11/sys/dev/amdsbwd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/dev/amdsbwd X-SVN-Commit-Revision: 335542 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:25:26 -0000 Author: avg Date: Fri Jun 22 09:25:24 2018 New Revision: 335542 URL: https://svnweb.freebsd.org/changeset/base/335542 Log: MFC r333269: amdsbwd: fix reboot status reporting Modified: stable/11/sys/dev/amdsbwd/amd_chipset.h stable/11/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/amdsbwd/amd_chipset.h ============================================================================== --- stable/11/sys/dev/amdsbwd/amd_chipset.h Fri Jun 22 09:23:06 2018 (r335541) +++ stable/11/sys/dev/amdsbwd/amd_chipset.h Fri Jun 22 09:25:24 2018 (r335542) @@ -95,9 +95,10 @@ #define AMDSB8_WDT_32KHZ 0x00 #define AMDSB8_WDT_1HZ 0x03 #define AMDSB8_WDT_RES_MASK 0x03 -#define AMDSB8_PM_RESET_STATUS0 0xc0 -#define AMDSB8_PM_RESET_STATUS1 0xc1 -#define AMDSB8_WD_RST_STS 0x20 +#define AMDSB8_PM_RESET_STATUS 0xc0 /* 32 bit wide */ +#define AMDSB8_WD_RST_STS 0x2000000 +#define AMDSB8_PM_RESET_CTRL 0xc4 +#define AMDSB8_RST_STS_DIS 0x04 /* * Newer FCH registers in the PMIO space. Modified: stable/11/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/11/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:23:06 2018 (r335541) +++ stable/11/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:25:24 2018 (r335542) @@ -317,16 +317,23 @@ amdsbwd_probe_sb7xx(device_t dev, struct resource *pmr static void amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr) { - uint8_t val; - int i; + uint32_t val; + int i; /* Report cause of previous reset for user's convenience. */ - val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0); + + val = pmio_read(pmres, AMDSB8_PM_RESET_CTRL); + if ((val & AMDSB8_RST_STS_DIS) != 0) { + val &= ~AMDSB8_RST_STS_DIS; + pmio_write(pmres, AMDSB8_PM_RESET_CTRL, val); + } + val = 0; + for (i = 3; i >= 0; i--) { + val <<= 8; + val |= pmio_read(pmres, AMDSB8_PM_RESET_STATUS + i); + } if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); - val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + amdsbwd_verbose_printf(dev, "ResetStatus = 0x%08x\n", val); if ((val & AMDSB8_WD_RST_STS) != 0) device_printf(dev, "Previous Reset was caused by Watchdog\n"); From owner-svn-src-all@freebsd.org Fri Jun 22 09:26:07 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0AF110146AB; Fri, 22 Jun 2018 09:26:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 93CF38701B; Fri, 22 Jun 2018 09:26:06 +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 7516A1ED3E; Fri, 22 Jun 2018 09:26:06 +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 w5M9Q6E1033688; Fri, 22 Jun 2018 09:26:06 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9Q6p3033686; Fri, 22 Jun 2018 09:26:06 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220926.w5M9Q6p3033686@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:26:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335543 - stable/10/sys/dev/amdsbwd X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/dev/amdsbwd X-SVN-Commit-Revision: 335543 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:26:07 -0000 Author: avg Date: Fri Jun 22 09:26:05 2018 New Revision: 335543 URL: https://svnweb.freebsd.org/changeset/base/335543 Log: MFC r333269: amdsbwd: fix reboot status reporting Modified: stable/10/sys/dev/amdsbwd/amd_chipset.h stable/10/sys/dev/amdsbwd/amdsbwd.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/amdsbwd/amd_chipset.h ============================================================================== --- stable/10/sys/dev/amdsbwd/amd_chipset.h Fri Jun 22 09:25:24 2018 (r335542) +++ stable/10/sys/dev/amdsbwd/amd_chipset.h Fri Jun 22 09:26:05 2018 (r335543) @@ -95,9 +95,10 @@ #define AMDSB8_WDT_32KHZ 0x00 #define AMDSB8_WDT_1HZ 0x03 #define AMDSB8_WDT_RES_MASK 0x03 -#define AMDSB8_PM_RESET_STATUS0 0xc0 -#define AMDSB8_PM_RESET_STATUS1 0xc1 -#define AMDSB8_WD_RST_STS 0x20 +#define AMDSB8_PM_RESET_STATUS 0xc0 /* 32 bit wide */ +#define AMDSB8_WD_RST_STS 0x2000000 +#define AMDSB8_PM_RESET_CTRL 0xc4 +#define AMDSB8_RST_STS_DIS 0x04 /* * Newer FCH registers in the PMIO space. Modified: stable/10/sys/dev/amdsbwd/amdsbwd.c ============================================================================== --- stable/10/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:25:24 2018 (r335542) +++ stable/10/sys/dev/amdsbwd/amdsbwd.c Fri Jun 22 09:26:05 2018 (r335543) @@ -317,16 +317,23 @@ amdsbwd_probe_sb7xx(device_t dev, struct resource *pmr static void amdsbwd_probe_sb8xx(device_t dev, struct resource *pmres, uint32_t *addr) { - uint8_t val; - int i; + uint32_t val; + int i; /* Report cause of previous reset for user's convenience. */ - val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS0); + + val = pmio_read(pmres, AMDSB8_PM_RESET_CTRL); + if ((val & AMDSB8_RST_STS_DIS) != 0) { + val &= ~AMDSB8_RST_STS_DIS; + pmio_write(pmres, AMDSB8_PM_RESET_CTRL, val); + } + val = 0; + for (i = 3; i >= 0; i--) { + val <<= 8; + val |= pmio_read(pmres, AMDSB8_PM_RESET_STATUS + i); + } if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus0 = %#04x\n", val); - val = pmio_read(pmres, AMDSB8_PM_RESET_STATUS1); - if (val != 0) - amdsbwd_verbose_printf(dev, "ResetStatus1 = %#04x\n", val); + amdsbwd_verbose_printf(dev, "ResetStatus = 0x%08x\n", val); if ((val & AMDSB8_WD_RST_STS) != 0) device_printf(dev, "Previous Reset was caused by Watchdog\n"); From owner-svn-src-all@freebsd.org Fri Jun 22 09:29:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D24AE10147B4; Fri, 22 Jun 2018 09:29:35 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 78BAE871BB; Fri, 22 Jun 2018 09:29:35 +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 53CB21ED41; Fri, 22 Jun 2018 09:29:35 +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 w5M9TZql033892; Fri, 22 Jun 2018 09:29:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9TZrh033891; Fri, 22 Jun 2018 09:29:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220929.w5M9TZrh033891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:29: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: r335544 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 335544 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:29:36 -0000 Author: avg Date: Fri Jun 22 09:29:34 2018 New Revision: 335544 URL: https://svnweb.freebsd.org/changeset/base/335544 Log: MFC r334785: expand descriptions of x86 panic_on_nmi and kdb_on_nmi sysctls Modified: stable/11/sys/x86/x86/cpu_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/cpu_machdep.c ============================================================================== --- stable/11/sys/x86/x86/cpu_machdep.c Fri Jun 22 09:26:05 2018 (r335543) +++ stable/11/sys/x86/x86/cpu_machdep.c Fri Jun 22 09:29:34 2018 (r335544) @@ -756,7 +756,7 @@ SYSINIT(cpu_idle_tun, SI_SUB_CPU, SI_ORDER_MIDDLE, cpu static int panic_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, panic_on_nmi, CTLFLAG_RWTUN, &panic_on_nmi, 0, - "Panic on NMI"); + "Panic on NMI raised by hardware failure"); int nmi_is_broadcast = 1; SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFLAG_RWTUN, &nmi_is_broadcast, 0, @@ -765,7 +765,7 @@ SYSCTL_INT(_machdep, OID_AUTO, nmi_is_broadcast, CTLFL int kdb_on_nmi = 1; SYSCTL_INT(_machdep, OID_AUTO, kdb_on_nmi, CTLFLAG_RWTUN, &kdb_on_nmi, 0, - "Go to KDB on NMI"); + "Go to KDB on NMI with unknown source"); #endif #ifdef DEV_ISA From owner-svn-src-all@freebsd.org Fri Jun 22 09:37:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5079F1014C57; Fri, 22 Jun 2018 09:37:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F1AE0882C9; Fri, 22 Jun 2018 09:37:26 +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 D2B5E1EF09; Fri, 22 Jun 2018 09:37:26 +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 w5M9bQCK039341; Fri, 22 Jun 2018 09:37:26 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9bQvu039340; Fri, 22 Jun 2018 09:37:26 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220937.w5M9bQvu039340@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:37: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: r335545 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 335545 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:37:27 -0000 Author: avg Date: Fri Jun 22 09:37:26 2018 New Revision: 335545 URL: https://svnweb.freebsd.org/changeset/base/335545 Log: MFC r333630: Fix 'zpool create -t ' Creating a pool with a temporary name fails when we also specify custom dataset properties: this is because we mistakenly call zfs_set_prop_nvlist() on the "real" pool name which, as expected, cannot be found because the SPA is present in the namespace with the temporary name. Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 09:29:34 2018 (r335544) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 09:37:26 2018 (r335545) @@ -1557,6 +1557,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) nvlist_t *config, *props = NULL; nvlist_t *rootprops = NULL; nvlist_t *zplprops = NULL; + char *spa_name = zc->zc_name; if (error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, zc->zc_iflags, &config)) @@ -1572,6 +1573,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) if (props) { nvlist_t *nvl = NULL; uint64_t version = SPA_VERSION; + char *tname; (void) nvlist_lookup_uint64(props, zpool_prop_to_name(ZPOOL_PROP_VERSION), &version); @@ -1594,6 +1596,10 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) zplprops, NULL); if (error != 0) goto pool_props_bad; + + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_TNAME), &tname) == 0) + spa_name = tname; } error = spa_create(zc->zc_name, config, props, zplprops); @@ -1601,9 +1607,9 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) /* * Set the remaining root properties */ - if (!error && (error = zfs_set_prop_nvlist(zc->zc_name, + if (!error && (error = zfs_set_prop_nvlist(spa_name, ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) - (void) spa_destroy(zc->zc_name); + (void) spa_destroy(spa_name); pool_props_bad: nvlist_free(rootprops); From owner-svn-src-all@freebsd.org Fri Jun 22 09:41:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A2251014E03; Fri, 22 Jun 2018 09:41:14 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1AB9884F7; Fri, 22 Jun 2018 09:41:13 +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 92D5C1F02E; Fri, 22 Jun 2018 09:41:13 +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 w5M9fDHV039559; Fri, 22 Jun 2018 09:41:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9fDOu039558; Fri, 22 Jun 2018 09:41:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806220941.w5M9fDOu039558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 09:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335546 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 335546 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:41:14 -0000 Author: avg Date: Fri Jun 22 09:41:13 2018 New Revision: 335546 URL: https://svnweb.freebsd.org/changeset/base/335546 Log: MFC r333630: Fix 'zpool create -t ' Creating a pool with a temporary name fails when we also specify custom dataset properties: this is because we mistakenly call zfs_set_prop_nvlist() on the "real" pool name which, as expected, cannot be found because the SPA is present in the namespace with the temporary name. Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 09:37:26 2018 (r335545) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 09:41:13 2018 (r335546) @@ -1529,6 +1529,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) nvlist_t *config, *props = NULL; nvlist_t *rootprops = NULL; nvlist_t *zplprops = NULL; + char *spa_name = zc->zc_name; if (error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, zc->zc_iflags, &config)) @@ -1544,6 +1545,7 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) if (props) { nvlist_t *nvl = NULL; uint64_t version = SPA_VERSION; + char *tname; (void) nvlist_lookup_uint64(props, zpool_prop_to_name(ZPOOL_PROP_VERSION), &version); @@ -1566,6 +1568,10 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) zplprops, NULL); if (error != 0) goto pool_props_bad; + + if (nvlist_lookup_string(props, + zpool_prop_to_name(ZPOOL_PROP_TNAME), &tname) == 0) + spa_name = tname; } error = spa_create(zc->zc_name, config, props, zplprops); @@ -1573,9 +1579,9 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) /* * Set the remaining root properties */ - if (!error && (error = zfs_set_prop_nvlist(zc->zc_name, + if (!error && (error = zfs_set_prop_nvlist(spa_name, ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) - (void) spa_destroy(zc->zc_name); + (void) spa_destroy(spa_name); pool_props_bad: nvlist_free(rootprops); From owner-svn-src-all@freebsd.org Fri Jun 22 09:45:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4900810150B7; Fri, 22 Jun 2018 09:45:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F31BF888BA; Fri, 22 Jun 2018 09:45:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D431C1F0A3; Fri, 22 Jun 2018 09:45:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5M9jIdp044407; Fri, 22 Jun 2018 09:45:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5M9jI5H044405; Fri, 22 Jun 2018 09:45:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806220945.w5M9jI5H044405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 09:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335547 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335547 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 09:45:19 -0000 Author: eadler Date: Fri Jun 22 09:45:18 2018 New Revision: 335547 URL: https://svnweb.freebsd.org/changeset/base/335547 Log: top(1): remove special handling of load > 5 When the load is "high" (an arbitrary value) top(1) previously moved the cursor to the top-left of the screen as an acknowledgment. In practice, on modern machines, even relatively slow ones, it looked more like a glitch. Remove the logic. Modified: head/usr.bin/top/screen.c head/usr.bin/top/screen.h head/usr.bin/top/top.c Modified: head/usr.bin/top/screen.c ============================================================================== --- head/usr.bin/top/screen.c Fri Jun 22 09:41:13 2018 (r335546) +++ head/usr.bin/top/screen.c Fri Jun 22 09:45:18 2018 (r335547) @@ -55,7 +55,7 @@ static struct termios new_settings; static char is_a_terminal = false; void -init_termcap(int interactive) +init_termcap(bool interactive) { char *bufptr; char *PCptr; @@ -138,7 +138,7 @@ init_termcap(int interactive) /* get "ce", clear to end */ if (!overstrike) { - clear_line = tgetstr("ce", &bufptr); + clear_line = tgetstr("ce", &bufptr); } /* get necessary capabilities */ @@ -312,13 +312,4 @@ clear_eol(int len) } } return(-1); -} - -void -go_home(void) -{ - if (smart_terminal) - { - putcap(home); - } } Modified: head/usr.bin/top/screen.h ============================================================================== --- head/usr.bin/top/screen.h Fri Jun 22 09:41:13 2018 (r335546) +++ head/usr.bin/top/screen.h Fri Jun 22 09:45:18 2018 (r335547) @@ -28,10 +28,9 @@ extern int screen_width; int clear_eol(int len); void top_standout(const char *msg); void top_clear(void); -void go_home(void); void reinit_screen(void); void get_screensize(void); -void init_termcap(int interactive); +void init_termcap(bool interactive); void end_screen(void); void init_screen(void); Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Fri Jun 22 09:41:13 2018 (r335546) +++ head/usr.bin/top/top.c Fri Jun 22 09:45:18 2018 (r335547) @@ -852,13 +852,6 @@ restart: break; case CMD_update: /* merely update display */ - /* is the load average high? */ - if (system_info.load_avg[0] > LoadMax) - { - /* yes, go home for visual feedback */ - go_home(); - fflush(stdout); - } break; case CMD_quit: From owner-svn-src-all@freebsd.org Fri Jun 22 10:07:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8C6881015BAF; Fri, 22 Jun 2018 10:07:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4102E89463; Fri, 22 Jun 2018 10:07:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 221D91F3D0; Fri, 22 Jun 2018 10:07:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MA7M7m054449; Fri, 22 Jun 2018 10:07:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MA7MD9054448; Fri, 22 Jun 2018 10:07:22 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806221007.w5MA7MD9054448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Jun 2018 10:07:22 +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: r335548 - stable/11/sys/compat/linprocfs X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/compat/linprocfs X-SVN-Commit-Revision: 335548 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:07:22 -0000 Author: kib Date: Fri Jun 22 10:07:21 2018 New Revision: 335548 URL: https://svnweb.freebsd.org/changeset/base/335548 Log: MFC r335199: linprocfs: add TracerPid to /proc/pid/status. Modified: stable/11/sys/compat/linprocfs/linprocfs.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linprocfs/linprocfs.c ============================================================================== --- stable/11/sys/compat/linprocfs/linprocfs.c Fri Jun 22 09:45:18 2018 (r335547) +++ stable/11/sys/compat/linprocfs/linprocfs.c Fri Jun 22 10:07:21 2018 (r335548) @@ -754,8 +754,8 @@ linprocfs_doprocstatus(PFS_FILL_ARGS) * Credentials */ sbuf_printf(sb, "Pid:\t%d\n", p->p_pid); - sbuf_printf(sb, "PPid:\t%d\n", p->p_pptr ? - p->p_pptr->p_pid : 0); + sbuf_printf(sb, "PPid:\t%d\n", kp.ki_ppid ); + sbuf_printf(sb, "TracerPid:\t%d\n", kp.ki_tracer ); sbuf_printf(sb, "Uid:\t%d %d %d %d\n", p->p_ucred->cr_ruid, p->p_ucred->cr_uid, p->p_ucred->cr_svuid, From owner-svn-src-all@freebsd.org Fri Jun 22 10:13:17 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F33C11015EDB; Fri, 22 Jun 2018 10:13:16 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 909A189911; Fri, 22 Jun 2018 10:13:16 +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 6C51A1F57B; Fri, 22 Jun 2018 10:13:16 +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 w5MADGMh059378; Fri, 22 Jun 2018 10:13:16 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MADGdg059377; Fri, 22 Jun 2018 10:13:16 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806221013.w5MADGdg059377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 10:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335549 - stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 335549 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:13:17 -0000 Author: avg Date: Fri Jun 22 10:13:15 2018 New Revision: 335549 URL: https://svnweb.freebsd.org/changeset/base/335549 Log: Revert r335546 as temporary pool name feature has not been merged Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 10:07:21 2018 (r335548) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Jun 22 10:13:15 2018 (r335549) @@ -1529,7 +1529,6 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) nvlist_t *config, *props = NULL; nvlist_t *rootprops = NULL; nvlist_t *zplprops = NULL; - char *spa_name = zc->zc_name; if (error = get_nvlist(zc->zc_nvlist_conf, zc->zc_nvlist_conf_size, zc->zc_iflags, &config)) @@ -1545,7 +1544,6 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) if (props) { nvlist_t *nvl = NULL; uint64_t version = SPA_VERSION; - char *tname; (void) nvlist_lookup_uint64(props, zpool_prop_to_name(ZPOOL_PROP_VERSION), &version); @@ -1568,10 +1566,6 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) zplprops, NULL); if (error != 0) goto pool_props_bad; - - if (nvlist_lookup_string(props, - zpool_prop_to_name(ZPOOL_PROP_TNAME), &tname) == 0) - spa_name = tname; } error = spa_create(zc->zc_name, config, props, zplprops); @@ -1579,9 +1573,9 @@ zfs_ioc_pool_create(zfs_cmd_t *zc) /* * Set the remaining root properties */ - if (!error && (error = zfs_set_prop_nvlist(spa_name, + if (!error && (error = zfs_set_prop_nvlist(zc->zc_name, ZPROP_SRC_LOCAL, rootprops, NULL)) != 0) - (void) spa_destroy(spa_name); + (void) spa_destroy(zc->zc_name); pool_props_bad: nvlist_free(rootprops); From owner-svn-src-all@freebsd.org Fri Jun 22 10:17:14 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCC2E1015FF9; Fri, 22 Jun 2018 10:17:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889EA89AAB; Fri, 22 Jun 2018 10:17:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 50EA91F57F; Fri, 22 Jun 2018 10:17:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MAHD8N059663; Fri, 22 Jun 2018 10:17:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAHDoh059662; Fri, 22 Jun 2018 10:17:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806221017.w5MAHDoh059662@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 10:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335551 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335551 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:17:14 -0000 Author: eadler Date: Fri Jun 22 10:17:12 2018 New Revision: 335551 URL: https://svnweb.freebsd.org/changeset/base/335551 Log: top(1): garbage collect - remove a now-unused function - remove needless indirection of handle type Modified: head/usr.bin/top/machine.c head/usr.bin/top/machine.h Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 22 10:17:10 2018 (r335550) +++ head/usr.bin/top/machine.c Fri Jun 22 10:17:12 2018 (r335551) @@ -871,13 +871,12 @@ get_process_info(struct system_info *si, struct proces static char fmt[512]; /* static area where result is built */ char * -format_next_process(void* xhandle, char *(*get_userid)(int), int flags) +format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags) { struct kinfo_proc *pp; const struct kinfo_proc *oldp; long cputime; double pct; - struct handle *hp; char status[22]; int cpu; size_t state; @@ -891,9 +890,8 @@ format_next_process(void* xhandle, char *(*get_userid) const int cmdlen = 128; /* find and remember the next proc structure */ - hp = (struct handle *)xhandle; - pp = *(hp->next_proc++); - hp->remaining--; + pp = *(xhandle->next_proc++); + xhandle->remaining--; /* get the process's command name */ if ((pp->ki_flag & P_INMEM) == 0) { @@ -1544,28 +1542,6 @@ int (*compares[])(const void *arg1, const void *arg2) NULL }; - -/* - * proc_owner(pid) - returns the uid that owns process "pid", or -1 if - * the process does not exist. - */ - -int -proc_owner(int pid) -{ - int cnt; - struct kinfo_proc **prefp; - struct kinfo_proc *pp; - - prefp = pref; - cnt = pref_len; - while (--cnt >= 0) { - pp = *prefp++; - if (pp->ki_pid == (pid_t)pid) - return ((int)pp->ki_ruid); - } - return (-1); -} static int swapmode(int *retavail, int *retfree) Modified: head/usr.bin/top/machine.h ============================================================================== --- head/usr.bin/top/machine.h Fri Jun 22 10:17:10 2018 (r335550) +++ head/usr.bin/top/machine.h Fri Jun 22 10:17:12 2018 (r335551) @@ -78,13 +78,14 @@ struct process_select /* routines defined by the machine dependent module */ +struct handle; + char *format_header(const char *uname_field); -char *format_next_process(void* handle, char *(*get_userid)(int), +char *format_next_process(struct handle* handle, char *(*get_userid)(int), int flags); void toggle_pcpustats(void); void get_system_info(struct system_info *si); int machine_init(struct statics *statics); -int proc_owner(int pid); /* non-int routines typically used by the machine dependent module */ extern struct process_select ps; From owner-svn-src-all@freebsd.org Fri Jun 22 10:17:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 562471015FE7; Fri, 22 Jun 2018 10:17:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 902CD89AAA; Fri, 22 Jun 2018 10:17:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7111D1F57E; Fri, 22 Jun 2018 10:17:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MAHAmI059616; Fri, 22 Jun 2018 10:17:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAHAox059615; Fri, 22 Jun 2018 10:17:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806221017.w5MAHAox059615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 10:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335550 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335550 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:17:11 -0000 Author: eadler Date: Fri Jun 22 10:17:10 2018 New Revision: 335550 URL: https://svnweb.freebsd.org/changeset/base/335550 Log: top(1): increase size of 'C' column On machines with more than 99 CPUs make room to display the entire number. Requested by: cperciva Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Fri Jun 22 10:13:15 2018 (r335549) +++ head/usr.bin/top/machine.c Fri Jun 22 10:17:10 2018 (r335550) @@ -90,7 +90,7 @@ static const char io_Proc_format[] = "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; static const char smp_Proc_format[] = - "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; + "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s %3d%7s %6.2f%% %.*s"; static char up_Proc_format[] = "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; @@ -406,7 +406,7 @@ format_header(const char *uname_field) sbuf_cat(header, " THR PRI NICE SIZE RES"); sbuf_printf(header, "%*s", ps.swap ? TOP_SWAP_LEN : 0, ps.swap ? " SWAP" : ""); - sbuf_printf(header, "%s", smpmode ? " STATE C " : " STATE "); + sbuf_printf(header, "%s", smpmode ? " STATE C " : " STATE "); sbuf_cat(header, "TIME"); sbuf_printf(header, " %7s", ps.wcpu ? "WCPU" : "CPU"); sbuf_cat(header, " COMMAND"); From owner-svn-src-all@freebsd.org Fri Jun 22 10:20:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0576F1016271; Fri, 22 Jun 2018 10:20:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A606D89E12; Fri, 22 Jun 2018 10:20:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8765D1F589; Fri, 22 Jun 2018 10:20:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MAKLvb059849; Fri, 22 Jun 2018 10:20:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAKL9L059848; Fri, 22 Jun 2018 10:20:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806221020.w5MAKL9L059848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Fri, 22 Jun 2018 10:20:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335552 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335552 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:20:22 -0000 Author: eadler Date: Fri Jun 22 10:20:21 2018 New Revision: 335552 URL: https://svnweb.freebsd.org/changeset/base/335552 Log: top(1): increase warnings top(1) now builds without cast-qual warnings, so remove the exemption for that. Tested with clang, gcc7, gcc9 Modified: head/usr.bin/top/Makefile Modified: head/usr.bin/top/Makefile ============================================================================== --- head/usr.bin/top/Makefile Fri Jun 22 10:17:12 2018 (r335551) +++ head/usr.bin/top/Makefile Fri Jun 22 10:20:21 2018 (r335552) @@ -9,12 +9,12 @@ MAN= top.1 .if ${COMPILER_TYPE} == "gcc" .if ${COMPILER_VERSION} >= 50000 -CFLAGS.gcc=-Wno-error=cast-qual -Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types +CFLAGS.gcc=-Wno-error=discarded-qualifiers -Wno-error=incompatible-pointer-types .else #base gcc NO_WERROR= .endif .endif -CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers -Wno-error=cast-qual +CFLAGS.clang=-Wno-error=incompatible-pointer-types-discards-qualifiers LIBADD= ncursesw m kvm jail util sbuf .include From owner-svn-src-all@freebsd.org Fri Jun 22 10:23:33 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D9EF101651F; Fri, 22 Jun 2018 10:23:33 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E25938A258; Fri, 22 Jun 2018 10:23:32 +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 BE08E1F718; Fri, 22 Jun 2018 10:23:32 +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 w5MANWRZ064628; Fri, 22 Jun 2018 10:23:32 GMT (envelope-from cperciva@FreeBSD.org) Received: (from cperciva@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MANWSk064627; Fri, 22 Jun 2018 10:23:32 GMT (envelope-from cperciva@FreeBSD.org) Message-Id: <201806221023.w5MANWSk064627@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cperciva set sender to cperciva@FreeBSD.org using -f From: Colin Percival Date: Fri, 22 Jun 2018 10:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335553 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cperciva X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335553 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:23:33 -0000 Author: cperciva Date: Fri Jun 22 10:23:32 2018 New Revision: 335553 URL: https://svnweb.freebsd.org/changeset/base/335553 Log: Improve the accuracy of the POSIX "process CPU-time" clocks by adding the used portion of the current thread's time slice if the current thread belongs to the process being queried (i.e., if clock_gettime is invoked with a clock ID of CLOCK_PROCESS_CPUTIME_ID or the value provided by passing getpid(2) to clock_getcpuclockid(3)). The CLOCK_VIRTUAL and CLOCK_PROF timers already make this adjustment via long-standing code in calcru(), but since those timers are not specified by POSIX it seems useful to add it here so that the higher accuracy is available to code which aims to be portable. PR: 228669 Reported by: Graham Percival Reviewed by: kib MFC after: 1 week Modified: head/sys/kern/kern_time.c Modified: head/sys/kern/kern_time.c ============================================================================== --- head/sys/kern/kern_time.c Fri Jun 22 10:20:21 2018 (r335552) +++ head/sys/kern/kern_time.c Fri Jun 22 10:23:32 2018 (r335553) @@ -280,6 +280,8 @@ get_process_cputime(struct proc *targetp, struct times PROC_STATLOCK(targetp); rufetch(targetp, &ru); runtime = targetp->p_rux.rux_runtime; + if (curthread->td_proc == targetp) + runtime += cpu_ticks() - PCPU_GET(switchtime); PROC_STATUNLOCK(targetp); cputick2timespec(runtime, ats); } From owner-svn-src-all@freebsd.org Fri Jun 22 10:39:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 00E00101681F; Fri, 22 Jun 2018 10:39:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 953008A7A6; Fri, 22 Jun 2018 10:39:23 +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 722DF1F8B2; Fri, 22 Jun 2018 10:39:23 +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 w5MAdNEW070047; Fri, 22 Jun 2018 10:39:23 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAdMm5070044; Fri, 22 Jun 2018 10:39:22 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806221039.w5MAdMm5070044@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 10:39:22 +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: r335554 - in stable/11/sys: dev/acpica dev/acpica/Osd x86/acpica X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys: dev/acpica dev/acpica/Osd x86/acpica X-SVN-Commit-Revision: 335554 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:39:24 -0000 Author: avg Date: Fri Jun 22 10:39:22 2018 New Revision: 335554 URL: https://svnweb.freebsd.org/changeset/base/335554 Log: MFC r332918, r333222: go deeper for ACPI suspend bounce test debug.acpi.suspend_bounce sysctl now allows a deeper dive into the sleep abyss. The system will execute the suspend sequence up to the call to AcpiEnterSleepState(). That includes saving processor contexts and parking APs. Then, instead of actually entering the sleep state, the BSP will call resumectx() to emulate the wakeup. The APs should get restarted by the sequence of Init and Startup IPIs that BSP sends to them. AcpiOsEnterSleep() is used to implement this feature. Joint work with jkim. Modified: stable/11/sys/dev/acpica/Osd/OsdHardware.c stable/11/sys/dev/acpica/acpi.c stable/11/sys/x86/acpica/acpi_wakeup.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/acpica/Osd/OsdHardware.c ============================================================================== --- stable/11/sys/dev/acpica/Osd/OsdHardware.c Fri Jun 22 10:23:32 2018 (r335553) +++ stable/11/sys/dev/acpica/Osd/OsdHardware.c Fri Jun 22 10:39:22 2018 (r335554) @@ -37,9 +37,15 @@ __FBSDID("$FreeBSD$"); #include #include +extern int acpi_susp_bounce; + ACPI_STATUS AcpiOsEnterSleep(UINT8 SleepState, UINT32 RegaValue, UINT32 RegbValue) { + + /* If testing device suspend only, back out of everything here. */ + if (acpi_susp_bounce) + return (AE_CTRL_TERMINATE); return (AE_OK); } Modified: stable/11/sys/dev/acpica/acpi.c ============================================================================== --- stable/11/sys/dev/acpica/acpi.c Fri Jun 22 10:23:32 2018 (r335553) +++ stable/11/sys/dev/acpica/acpi.c Fri Jun 22 10:39:22 2018 (r335554) @@ -291,7 +291,7 @@ SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); -static int acpi_susp_bounce; +int acpi_susp_bounce; SYSCTL_INT(_debug_acpi, OID_AUTO, suspend_bounce, CTLFLAG_RW, &acpi_susp_bounce, 0, "Don't actually suspend, just test devices."); @@ -2897,10 +2897,6 @@ acpi_EnterSleepState(struct acpi_softc *sc, int state) goto backout; } slp_state = ACPI_SS_DEV_SUSPEND; - - /* If testing device suspend only, back out of everything here. */ - if (acpi_susp_bounce) - goto backout; status = AcpiEnterSleepStatePrep(state); if (ACPI_FAILURE(status)) { Modified: stable/11/sys/x86/acpica/acpi_wakeup.c ============================================================================== --- stable/11/sys/x86/acpica/acpi_wakeup.c Fri Jun 22 10:23:32 2018 (r335553) +++ stable/11/sys/x86/acpica/acpi_wakeup.c Fri Jun 22 10:39:22 2018 (r335554) @@ -77,6 +77,7 @@ CTASSERT(sizeof(wakecode) < PAGE_SIZE - 1024); extern int acpi_resume_beep; extern int acpi_reset_video; +extern int acpi_susp_bounce; #ifdef SMP extern struct susppcb **susppcbs; @@ -257,6 +258,9 @@ acpi_sleep_machdep(struct acpi_softc *sc, int state) AcpiFormatException(status)); return (0); /* couldn't sleep */ } + + if (acpi_susp_bounce) + resumectx(pcb); for (;;) ia32_pause(); From owner-svn-src-all@freebsd.org Fri Jun 22 10:44:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 336C21016BBD; Fri, 22 Jun 2018 10:44:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DA16B8ACF7; Fri, 22 Jun 2018 10:44:33 +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 9CE9E1FA47; Fri, 22 Jun 2018 10:44:33 +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 w5MAiXFF074968; Fri, 22 Jun 2018 10:44:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAiX16074967; Fri, 22 Jun 2018 10:44:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806221044.w5MAiX16074967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 10:44:33 +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: r335555 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 335555 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:44:34 -0000 Author: avg Date: Fri Jun 22 10:44:33 2018 New Revision: 335555 URL: https://svnweb.freebsd.org/changeset/base/335555 Log: MFC r333321,r333707: x86 cpususpend_handler: call wbinvd after setting suspend state bits Without a subsequent wbinvd the changes to suspended_cpus (and resuming_cpus) can be lost at least on AMD systems that use MOESI cache coherency protocol. That can happen because one of APs ends up as an Owner of the corresponding cache line(s) and the changes may never reach the main memory before the AP is reset. This change fixed suspend to RAM a previously broken AMD-based system. Modified: stable/11/sys/x86/x86/mp_x86.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/mp_x86.c ============================================================================== --- stable/11/sys/x86/x86/mp_x86.c Fri Jun 22 10:39:22 2018 (r335554) +++ stable/11/sys/x86/x86/mp_x86.c Fri Jun 22 10:44:33 2018 (r335555) @@ -1317,15 +1317,33 @@ cpususpend_handler(void) #else npxsuspend(susppcbs[cpu]->sp_fpususpend); #endif - wbinvd(); - CPU_SET_ATOMIC(cpu, &suspended_cpus); /* - * Hack for xen, which does not use resumectx() so never - * uses the next clause: set resuming_cpus early so that - * resume_cpus() can wait on the same bitmap for acpi and - * xen. resuming_cpus now means eventually_resumable_cpus. + * suspended_cpus is cleared shortly after each AP is restarted + * by a Startup IPI, so that the BSP can proceed to restarting + * the next AP. + * + * resuming_cpus gets cleared when the AP completes + * initialization after having been released by the BSP. + * resuming_cpus is probably not the best name for the + * variable, because it is actually a set of processors that + * haven't resumed yet and haven't necessarily started resuming. + * + * Note that suspended_cpus is meaningful only for ACPI suspend + * as it's not really used for Xen suspend since the APs are + * automatically restored to the running state and the correct + * context. For the same reason resumectx is never called in + * that case. */ + CPU_SET_ATOMIC(cpu, &suspended_cpus); CPU_SET_ATOMIC(cpu, &resuming_cpus); + + /* + * Invalidate the cache after setting the global status bits. + * The last AP to set its bit may end up being an Owner of the + * corresponding cache line in MOESI protocol. The AP may be + * stopped before the cache line is written to the main memory. + */ + wbinvd(); } else { #ifdef __amd64__ fpuresume(susppcbs[cpu]->sp_fpususpend); @@ -1337,7 +1355,7 @@ cpususpend_handler(void) PCPU_SET(switchtime, 0); PCPU_SET(switchticks, ticks); - /* Indicate that we are resuming */ + /* Indicate that we have restarted and restored the context. */ CPU_CLR_ATOMIC(cpu, &suspended_cpus); } From owner-svn-src-all@freebsd.org Fri Jun 22 10:49:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A05661016E45; Fri, 22 Jun 2018 10:49:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DD0F8B208; Fri, 22 Jun 2018 10:49:22 +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 2B5391FA49; Fri, 22 Jun 2018 10:49:22 +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 w5MAnMjT075245; Fri, 22 Jun 2018 10:49:22 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MAnLOT075240; Fri, 22 Jun 2018 10:49:21 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806221049.w5MAnLOT075240@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 10:49: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: r335556 - in stable/11/sys: arm/arm arm64/arm64 mips/mips X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys: arm/arm arm64/arm64 mips/mips X-SVN-Commit-Revision: 335556 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 10:49:22 -0000 Author: avg Date: Fri Jun 22 10:49:21 2018 New Revision: 335556 URL: https://svnweb.freebsd.org/changeset/base/335556 Log: MFC r333667: followup to r332730/r332752: set kdb_why to "trap" for fatal traps This change updates arm, arm64 and mips achitectures. Additionally, it removes redundant checks for kdb_active where it already results in kdb_reenter() and adds kdb_reenter() calls where they were missing. Some architectures check the return value of kdb_trap(), but some don't. I haven't changed any of that. Some trap handling routines have a return code. I am not sure if I provided correct ones for returns after kdb_reenter(). kdb_reenter should never return unless kdb_jmpbufp is NULL for some reason. Modified: stable/11/sys/arm/arm/trap-v4.c stable/11/sys/arm/arm/trap-v6.c stable/11/sys/arm64/arm64/trap.c stable/11/sys/mips/mips/trap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/arm/arm/trap-v4.c ============================================================================== --- stable/11/sys/arm/arm/trap-v4.c Fri Jun 22 10:44:33 2018 (r335555) +++ stable/11/sys/arm/arm/trap-v4.c Fri Jun 22 10:49:21 2018 (r335556) @@ -404,7 +404,16 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct ksig *ksig) { const char *mode; +#ifdef KDB + bool handled; +#endif +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif #ifdef KDTRACE_HOOKS if (!TRAP_USERMODE(tf)) { if (dtrace_trap_func != NULL && (*dtrace_trap_func)(tf, far & FAULT_TYPE_MASK)) @@ -447,9 +456,13 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(fsr, 0, tf)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + if (handled) return (0); + } #endif panic("Fatal abort"); /*NOTREACHED*/ Modified: stable/11/sys/arm/arm/trap-v6.c ============================================================================== --- stable/11/sys/arm/arm/trap-v6.c Fri Jun 22 10:44:33 2018 (r335555) +++ stable/11/sys/arm/arm/trap-v6.c Fri Jun 22 10:49:21 2018 (r335556) @@ -599,8 +599,11 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + } #endif panic("Fatal abort"); /*NOTREACHED*/ Modified: stable/11/sys/arm64/arm64/trap.c ============================================================================== --- stable/11/sys/arm64/arm64/trap.c Fri Jun 22 10:44:33 2018 (r335555) +++ stable/11/sys/arm64/arm64/trap.c Fri Jun 22 10:49:21 2018 (r335556) @@ -155,6 +155,9 @@ data_abort(struct thread *td, struct trapframe *frame, vm_prot_t ftype; vm_offset_t va; int error, sig, ucode; +#ifdef KDB + bool handled; +#endif /* * According to the ARMv8-A rev. A.g, B2.10.5 "Load-Exclusive @@ -232,9 +235,14 @@ data_abort(struct thread *td, struct trapframe *frame, printf(" esr: %.8lx\n", esr); #ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(ESR_ELx_EXCEPTION(esr), 0, frame)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(ESR_ELx_EXCEPTION(esr), 0, + frame); + kdb_why = KDB_WHY_UNSET; + if (handled) return; + } #endif panic("vm_fault failed: %lx", frame->tf_elr); } Modified: stable/11/sys/mips/mips/trap.c ============================================================================== --- stable/11/sys/mips/mips/trap.c Fri Jun 22 10:44:33 2018 (r335555) +++ stable/11/sys/mips/mips/trap.c Fri Jun 22 10:49:21 2018 (r335556) @@ -533,7 +533,12 @@ trap(struct trapframe *trapframe) register_t *frame_regs; trapdebug_enter(trapframe, 0); - +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; if (TRAPF_USERMODE(trapframe)) { type |= T_USER; @@ -1104,8 +1109,10 @@ err: #endif #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(type, 0, trapframe); + kdb_why = KDB_WHY_UNSET; } #endif panic("trap"); From owner-svn-src-all@freebsd.org Fri Jun 22 11:02:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFE0A10173BF; Fri, 22 Jun 2018 11:02:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6279E8BA2E; Fri, 22 Jun 2018 11:02:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from ivaldir.etoilebsd.net (etoilebsd.net [178.32.217.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 03EDEF0B2; Fri, 22 Jun 2018 11:02:40 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: by ivaldir.etoilebsd.net (Postfix, from userid 1001) id 7FC4D896FF; Fri, 22 Jun 2018 13:02:38 +0200 (CEST) Date: Fri, 22 Jun 2018 13:02:38 +0200 From: Baptiste Daroussin To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335539 - head/usr.bin/top Message-ID: <20180622110238.v7gwug4hebuclwb6@ivaldir.net> References: <201806220921.w5M9L21k031794@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="pab43qwvq364jsma" Content-Disposition: inline In-Reply-To: <201806220921.w5M9L21k031794@repo.freebsd.org> User-Agent: NeoMutt/20180512 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 11:02:40 -0000 --pab43qwvq364jsma Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 22, 2018 at 09:21:02AM +0000, Eitan Adler wrote: > Author: eadler > Date: Fri Jun 22 09:21:01 2018 > New Revision: 335539 > URL: https://svnweb.freebsd.org/changeset/base/335539 >=20 > Log: > top(1): reimplement header formatting as sbuf > =20 > The current header formatting is a giant format string that changes > global state during the format process. > =20 > Make the following changes: > - use sbuf to build up the header rather than use the above > pseudo-dynamic one > - Change name length to 10 > - Reduce size of RES and SIZE by making humanize more aggressive > - Restore a version number line to the copyright. This may be required > by the copyright (and may not be; its unclear) > =20 > This is also a pre-req to implementing TOPCOLOR from newer versions of > top(1) > =20 > Discussed with: allanjude, rpolka, danfe, rgrimes > Differential Revision: https://reviews.freebsd.org/D15801 >=20 > Modified: > head/usr.bin/top/Makefile > head/usr.bin/top/commands.c > head/usr.bin/top/machine.c > head/usr.bin/top/machine.h > head/usr.bin/top/utils.c >=20 > Modified: head/usr.bin/top/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.bin/top/Makefile Fri Jun 22 09:20:50 2018 (r335538) > +++ head/usr.bin/top/Makefile Fri Jun 22 09:21:01 2018 (r335539) > @@ -16,5 +16,5 @@ NO_WERROR=3D > .endif > CFLAGS.clang=3D-Wno-error=3Dincompatible-pointer-types-discards-qualifie= rs -Wno-error=3Dcast-qual > =20 > -LIBADD=3D ncursesw m kvm jail util > +LIBADD=3D ncursesw m kvm jail util sbuf > .include >=20 > Modified: head/usr.bin/top/commands.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/commands.c Fri Jun 22 09:20:50 2018 (r335538) > +++ head/usr.bin/top/commands.c Fri Jun 22 09:21:01 2018 (r335539) > @@ -1,5 +1,6 @@ > /* > * Top users/processes display for Unix > + * Version 3 > * > * This program may be freely redistributed, > * but this entire comment MUST remain intact. >=20 > Modified: head/usr.bin/top/machine.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/usr.bin/top/machine.c Fri Jun 22 09:20:50 2018 (r335538) > +++ head/usr.bin/top/machine.c Fri Jun 22 09:21:01 2018 (r335539) > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -49,18 +50,14 @@ > #include "layout.h" > =20 > #define GETSYSCTL(name, var) getsysctl(name, &(var), sizeof(var)) > -#define SMPUNAMELEN 13 > -#define UPUNAMELEN 15 > =20 > extern struct timeval timeout; > static int smpmode; > enum displaymodes displaymode; > -static int namelength =3D 8; > +static const int namelength =3D 10; > /* TOP_JID_LEN based on max of 999999 */ > -#define TOP_JID_LEN 7 > -#define TOP_SWAP_LEN 6 > -static int jidlength; > -static int swaplength; > +#define TOP_JID_LEN 6 > +#define TOP_SWAP_LEN 5 > static int cmdlengthdelta; > =20 > /* get_process_info passes back a handle. This is what it looks like: */ > @@ -92,24 +89,12 @@ static const char io_header[] =3D > static const char io_Proc_format[] =3D > "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; > =20 > -/* XXX: build up header instead of statically defining them. > - * This will also allow for a "format string" to be supplied > - * as an argument to top(1) instead of having predefined options */ > -static const char smp_header_thr_and_pid[] =3D > - " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE C TIME %7s = COMMAND"; > -static const char smp_header_id_only[] =3D > - " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE C TIME %7s COMM= AND"; > static const char smp_Proc_format[] =3D > - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; > + "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s %2d%7s %6.2f%% %.*s"; > =20 > -static char up_header_thr_and_pid[] =3D > - " %s%*s %-*.*s THR PRI NICE SIZE RES%*s STATE TIME %7s COM= MAND"; > -static char up_header_id_only[] =3D > - " %s%*s %-*.*s PRI NICE SIZE RES%*s STATE TIME %7s COMMAN= D"; > static char up_Proc_format[] =3D > - "%5d%*s %-*.*s %s%3d %4s%7s %6s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; > + "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; > =20 > - > /* process state names for the "STATE" column of the display */ > /* the extra nulls in the string "run" are for adding a slash and > the processor number when needed */ > @@ -325,12 +310,6 @@ machine_init(struct statics *statics) > NULL, 0) =3D=3D 0 && carc_en =3D=3D 1) > carc_enabled =3D 1; > =20 > - namelength =3D MAXLOGNAME; > - if (smpmode && namelength > SMPUNAMELEN) > - namelength =3D SMPUNAMELEN; > - else if (namelength > UPUNAMELEN) > - namelength =3D UPUNAMELEN; > - > kd =3D kvm_open(NULL, _PATH_DEVNULL, NULL, O_RDONLY, "kvm_open"); > if (kd =3D=3D NULL) > return (-1); > @@ -407,63 +386,46 @@ machine_init(struct statics *statics) > return (0); > } > =20 > -const char * > +char * > format_header(const char *uname_field) > { > - static char Header[128]; > - const char *prehead; > + static struct sbuf* header =3D NULL; > =20 > - if (ps.jail) > - jidlength =3D TOP_JID_LEN + 1; /* +1 for extra left space. */ > - else > - jidlength =3D 0; > + /* clean up from last time. */ > + if (header !=3D NULL) { > + sbuf_delete(header); wouldn't it be better with a sbuf_clear here? if !=3D null: clear else new_auto Best regards, Bapt --pab43qwvq364jsma Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEgOTj3suS2urGXVU3Y4mL3PG3PloFAlss1zMACgkQY4mL3PG3 Plr3+xAAy3vP0xawm6PnS98anYh1xgp4tCa1GODxnyw7CiNHk0qFONiI3hsh/y/y Nvn7HOQhz3B42RM1J83aMC/PAK/THHw991Jld8jdbiQKfF2FitGod9NpqP8UL50W KjhKh6smHGLq3+weMcSA9zrBYPHSlTwspL11AzDVfyIdwBOwNL0iGtw7nrC0P4us cuY9nSbFk37Ex4tCQ5fgAuqZ14+ms29Y23CsTqOZ5Ov7bwGYQ9JLtOoo9QsnL3cm /VYibmbCchpIVgCteMUFvyMP/Wun4IeBPuDud7101nwxDuZMytaVSwLbNrY/cncD V/deMa3em63oGE6C374kH+/gDTaxLiPlEkrwXgf0DPXJYbqiwO01EBfiAGyde99p 8K2wYyOOWEf5bvo9xejF4E28aLd/7LZ1OndF9RZtyWP9EVl3GyUW5WP9cv/UyTHs aXxp6WkKw1i27tF/0EnXpTQIm84o19S7cTd7KK3gfR/tO30ogLQktR0l8YKEF3hF Zpr28qzBMI1wB+/FhLgQx63wfJEnb9BOM0Ys7M24CO5kXGWYeRw13dyRc9opa+4Q GtDO8tUfV8+2ZUT5/rLiTGeN0Ei5Z+mhn8/PqgZjRMHoT6hWG462mmPBLOhmov0I oWoZ2NiYjlgojwxszHlk1q4d+C+3jtNei9Ug7cMaUHVxwzOSIK4= =gju3 -----END PGP SIGNATURE----- --pab43qwvq364jsma-- From owner-svn-src-all@freebsd.org Fri Jun 22 11:16:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFC6F1017A94; Fri, 22 Jun 2018 11:16:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D5FE8C259; Fri, 22 Jun 2018 11:16:18 +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 549B01FF1C; Fri, 22 Jun 2018 11:16:18 +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 w5MBGINX090640; Fri, 22 Jun 2018 11:16:18 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MBGHjP090637; Fri, 22 Jun 2018 11:16:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201806221116.w5MBGHjP090637@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Fri, 22 Jun 2018 11:16:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r335557 - in stable/10/sys: arm/arm mips/mips X-SVN-Group: stable-10 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/10/sys: arm/arm mips/mips X-SVN-Commit-Revision: 335557 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 11:16:19 -0000 Author: avg Date: Fri Jun 22 11:16:17 2018 New Revision: 335557 URL: https://svnweb.freebsd.org/changeset/base/335557 Log: MFC r333667: followup to r332730/r332752: set kdb_why to "trap" for fatal traps This change updates arm, arm64 and mips achitectures. Additionally, it removes redundant checks for kdb_active where it already results in kdb_reenter() and adds kdb_reenter() calls where they were missing. Some architectures check the return value of kdb_trap(), but some don't. I haven't changed any of that. Some trap handling routines have a return code. I am not sure if I provided correct ones for returns after kdb_reenter(). kdb_reenter should never return unless kdb_jmpbufp is NULL for some reason. Modified: stable/10/sys/arm/arm/trap-v6.c stable/10/sys/arm/arm/trap.c stable/10/sys/mips/mips/trap.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/arm/arm/trap-v6.c ============================================================================== --- stable/10/sys/arm/arm/trap-v6.c Fri Jun 22 10:49:21 2018 (r335556) +++ stable/10/sys/arm/arm/trap-v6.c Fri Jun 22 11:16:17 2018 (r335557) @@ -592,8 +592,11 @@ abort_fatal(struct trapframe *tf, u_int idx, u_int fsr printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + } #endif panic("Fatal abort"); /*NOTREACHED*/ Modified: stable/10/sys/arm/arm/trap.c ============================================================================== --- stable/10/sys/arm/arm/trap.c Fri Jun 22 10:49:21 2018 (r335556) +++ stable/10/sys/arm/arm/trap.c Fri Jun 22 11:16:17 2018 (r335557) @@ -422,7 +422,16 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, struct ksig *ksig) { const char *mode; +#ifdef KDB + bool handled; +#endif +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif mode = TRAP_USERMODE(tf) ? "user" : "kernel"; disable_interrupts(PSR_I|PSR_F); @@ -458,9 +467,13 @@ dab_fatal(struct trapframe *tf, u_int fsr, u_int far, printf(", pc =%08x\n\n", tf->tf_pc); #ifdef KDB - if (debugger_on_panic || kdb_active) - if (kdb_trap(fsr, 0, tf)) + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; + handled = kdb_trap(fsr, 0, tf); + kdb_why = KDB_WHY_UNSET; + if (handled) return (0); + } #endif panic("Fatal abort"); /*NOTREACHED*/ @@ -749,4 +762,4 @@ badaddr_read(void *addr, size_t size, void *rptr) /* Return EFAULT if the address was invalid, else zero */ return (rv); -} \ No newline at end of file +} Modified: stable/10/sys/mips/mips/trap.c ============================================================================== --- stable/10/sys/mips/mips/trap.c Fri Jun 22 10:49:21 2018 (r335556) +++ stable/10/sys/mips/mips/trap.c Fri Jun 22 11:16:17 2018 (r335557) @@ -529,7 +529,12 @@ trap(struct trapframe *trapframe) register_t *frame_regs; trapdebug_enter(trapframe, 0); - +#ifdef KDB + if (kdb_active) { + kdb_reenter(); + return (0); + } +#endif type = (trapframe->cause & MIPS_CR_EXC_CODE) >> MIPS_CR_EXC_CODE_SHIFT; if (TRAPF_USERMODE(trapframe)) { type |= T_USER; @@ -1104,8 +1109,10 @@ err: #endif #ifdef KDB - if (debugger_on_panic || kdb_active) { + if (debugger_on_panic) { + kdb_why = KDB_WHY_TRAP; kdb_trap(type, 0, trapframe); + kdb_why = KDB_WHY_UNSET; } #endif panic("trap"); From owner-svn-src-all@freebsd.org Fri Jun 22 15:00:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DCCBE101E37F; Fri, 22 Jun 2018 15:00: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8E933736EF; Fri, 22 Jun 2018 15:00:05 +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 70660222CB; Fri, 22 Jun 2018 15:00:05 +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 w5MF05CQ003242; Fri, 22 Jun 2018 15:00:05 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MF00KD003220; Fri, 22 Jun 2018 15:00:00 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201806221500.w5MF00KD003220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Fri, 22 Jun 2018 15:00:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335558 - in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Group: head X-SVN-Commit-Author: dim X-SVN-Commit-Paths: in head: lib/clang lib/clang/include/llvm/Config lib/clang/libllvm share/man/man5 share/mk tools/build/options X-SVN-Commit-Revision: 335558 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 15:00:06 -0000 Author: dim Date: Fri Jun 22 15:00:00 2018 New Revision: 335558 URL: https://svnweb.freebsd.org/changeset/base/335558 Log: Add support for selectively enabling LLVM targets This makes it possible, through src.conf(5) settings, to select which LLVM targets you want to build during buildworld. The current list is: * (WITH|WITHOUT)_LLVM_TARGET_AARCH64 * (WITH|WITHOUT)_LLVM_TARGET_ARM * (WITH|WITHOUT)_LLVM_TARGET_MIPS * (WITH|WITHOUT)_LLVM_TARGET_POWERPC * (WITH|WITHOUT)_LLVM_TARGET_SPARC * (WITH|WITHOUT)_LLVM_TARGET_X86 To not influence anything right now, all of these are on by default, in situations where clang is enabled. Selectively turning a few targets off manually should work. Turning on only one target should work too, even if that target does not correspond to the build architecture. (In that case, LLVM_NATIVE_ARCH will not be defined, and you can only use the resulting clang executable for cross-compiling.) I performed a few measurements on one of the FreeBSD.org reference machines, building clang from scratch, with all targets enabled, and with only the x86 target enabled. The latter was ~12% faster in real time (on a 32-core box), and ~14% faster in user time. For a full buildworld the difference will probably be less pronounced, though. Reviewed by: bdrewery MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D11077 Added: head/tools/build/options/WITHOUT_LLVM_TARGET_AARCH64 (contents, props changed) head/tools/build/options/WITHOUT_LLVM_TARGET_ARM (contents, props changed) head/tools/build/options/WITHOUT_LLVM_TARGET_MIPS (contents, props changed) head/tools/build/options/WITHOUT_LLVM_TARGET_POWERPC (contents, props changed) head/tools/build/options/WITHOUT_LLVM_TARGET_SPARC (contents, props changed) head/tools/build/options/WITHOUT_LLVM_TARGET_X86 (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_AARCH64 (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_ARM (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_MIPS (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_POWERPC (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_SPARC (contents, props changed) head/tools/build/options/WITH_LLVM_TARGET_X86 (contents, props changed) Modified: head/lib/clang/include/llvm/Config/AsmParsers.def head/lib/clang/include/llvm/Config/AsmPrinters.def head/lib/clang/include/llvm/Config/Disassemblers.def head/lib/clang/include/llvm/Config/Targets.def head/lib/clang/include/llvm/Config/llvm-config.h head/lib/clang/libllvm/Makefile head/lib/clang/llvm.build.mk head/share/man/man5/src.conf.5 head/share/mk/src.opts.mk Modified: head/lib/clang/include/llvm/Config/AsmParsers.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmParsers.def Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/include/llvm/Config/AsmParsers.def Fri Jun 22 15:00:00 2018 (r335558) @@ -4,11 +4,23 @@ # error Please define the macro LLVM_ASM_PARSER(TargetName) #endif +#ifdef LLVM_TARGET_ENABLE_AARCH64 LLVM_ASM_PARSER(AArch64) +#endif +#ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PARSER(ARM) +#endif +#ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PARSER(Mips) +#endif +#ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PARSER(PowerPC) +#endif +#ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PARSER(Sparc) +#endif +#ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PARSER(X86) +#endif #undef LLVM_ASM_PARSER Modified: head/lib/clang/include/llvm/Config/AsmPrinters.def ============================================================================== --- head/lib/clang/include/llvm/Config/AsmPrinters.def Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/include/llvm/Config/AsmPrinters.def Fri Jun 22 15:00:00 2018 (r335558) @@ -4,11 +4,23 @@ # error Please define the macro LLVM_ASM_PRINTER(TargetName) #endif +#ifdef LLVM_TARGET_ENABLE_AARCH64 LLVM_ASM_PRINTER(AArch64) +#endif +#ifdef LLVM_TARGET_ENABLE_ARM LLVM_ASM_PRINTER(ARM) +#endif +#ifdef LLVM_TARGET_ENABLE_MIPS LLVM_ASM_PRINTER(Mips) +#endif +#ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_ASM_PRINTER(PowerPC) +#endif +#ifdef LLVM_TARGET_ENABLE_SPARC LLVM_ASM_PRINTER(Sparc) +#endif +#ifdef LLVM_TARGET_ENABLE_X86 LLVM_ASM_PRINTER(X86) +#endif #undef LLVM_ASM_PRINTER Modified: head/lib/clang/include/llvm/Config/Disassemblers.def ============================================================================== --- head/lib/clang/include/llvm/Config/Disassemblers.def Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/include/llvm/Config/Disassemblers.def Fri Jun 22 15:00:00 2018 (r335558) @@ -4,11 +4,23 @@ # error Please define the macro LLVM_DISASSEMBLER(TargetName) #endif +#ifdef LLVM_TARGET_ENABLE_AARCH64 LLVM_DISASSEMBLER(AArch64) +#endif +#ifdef LLVM_TARGET_ENABLE_ARM LLVM_DISASSEMBLER(ARM) +#endif +#ifdef LLVM_TARGET_ENABLE_MIPS LLVM_DISASSEMBLER(Mips) +#endif +#ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_DISASSEMBLER(PowerPC) +#endif +#ifdef LLVM_TARGET_ENABLE_SPARC LLVM_DISASSEMBLER(Sparc) +#endif +#ifdef LLVM_TARGET_ENABLE_X86 LLVM_DISASSEMBLER(X86) +#endif #undef LLVM_DISASSEMBLER Modified: head/lib/clang/include/llvm/Config/Targets.def ============================================================================== --- head/lib/clang/include/llvm/Config/Targets.def Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/include/llvm/Config/Targets.def Fri Jun 22 15:00:00 2018 (r335558) @@ -4,11 +4,23 @@ # error Please define the macro LLVM_TARGET(TargetName) #endif +#ifdef LLVM_TARGET_ENABLE_AARCH64 LLVM_TARGET(AArch64) +#endif +#ifdef LLVM_TARGET_ENABLE_ARM LLVM_TARGET(ARM) +#endif +#ifdef LLVM_TARGET_ENABLE_MIPS LLVM_TARGET(Mips) +#endif +#ifdef LLVM_TARGET_ENABLE_POWERPC LLVM_TARGET(PowerPC) +#endif +#ifdef LLVM_TARGET_ENABLE_SPARC LLVM_TARGET(Sparc) +#endif +#ifdef LLVM_TARGET_ENABLE_X86 LLVM_TARGET(X86) +#endif #undef LLVM_TARGET Modified: head/lib/clang/include/llvm/Config/llvm-config.h ============================================================================== --- head/lib/clang/include/llvm/Config/llvm-config.h Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/include/llvm/Config/llvm-config.h Fri Jun 22 15:00:00 2018 (r335558) @@ -34,25 +34,25 @@ /* #undef LLVM_HOST_TRIPLE */ /* LLVM architecture name for the native architecture, if available */ -#define LLVM_NATIVE_ARCH X86 +/* #undef LLVM_NATIVE_ARCH */ /* LLVM name for the native AsmParser init function, if available */ -#define LLVM_NATIVE_ASMPARSER LLVMInitializeX86AsmParser +/* #undef LLVM_NATIVE_ASMPARSER */ /* LLVM name for the native AsmPrinter init function, if available */ -#define LLVM_NATIVE_ASMPRINTER LLVMInitializeX86AsmPrinter +/* #undef LLVM_NATIVE_ASMPRINTER */ /* LLVM name for the native Disassembler init function, if available */ -#define LLVM_NATIVE_DISASSEMBLER LLVMInitializeX86Disassembler +/* #undef LLVM_NATIVE_DISASSEMBLER */ /* LLVM name for the native Target init function, if available */ -#define LLVM_NATIVE_TARGET LLVMInitializeX86Target +/* #undef LLVM_NATIVE_TARGET */ /* LLVM name for the native TargetInfo init function, if available */ -#define LLVM_NATIVE_TARGETINFO LLVMInitializeX86TargetInfo +/* #undef LLVM_NATIVE_TARGETINFO */ /* LLVM name for the native target MC init function, if available */ -#define LLVM_NATIVE_TARGETMC LLVMInitializeX86TargetMC +/* #undef LLVM_NATIVE_TARGETMC */ /* Define if this is Unixish platform */ #define LLVM_ON_UNIX 1 Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/libllvm/Makefile Fri Jun 22 15:00:00 2018 (r335558) @@ -7,8 +7,19 @@ LIB= llvm INTERNALLIB= CFLAGS+= -I${.OBJDIR} + +.if ${MK_LLVM_TARGET_AARCH64} == "no" && ${MK_LLVM_TARGET_ARM} == "no" && \ + ${MK_LLVM_TARGET_MIPS} == "no" && ${MK_LLVM_TARGET_POWERPC} == "no" && \ + ${MK_LLVM_TARGET_SPARC} == "no" && ${MK_LLVM_TARGET_X86} == "no" +.error Please enable at least one of: MK_LLVM_TARGET_AARCH64,\ + MK_LLVM_TARGET_ARM, MK_LLVM_TARGET_MIPS, MK_LLVM_TARGET_POWERPC,\ + MK_LLVM_TARGET_SPARC, or MK_LLVM_TARGET_X86 +.endif + .for arch in AArch64 ARM Mips PowerPC Sparc X86 +. if ${MK_LLVM_TARGET_${arch:tu}} != "no" CFLAGS+= -I${LLVM_SRCS}/lib/Target/${arch} +. endif .endfor SRCDIR= lib @@ -784,6 +795,7 @@ SRCS_MIN+= TableGen/StringMatcher.cpp SRCS_MIN+= TableGen/TGLexer.cpp SRCS_MIN+= TableGen/TGParser.cpp SRCS_MIN+= TableGen/TableGenBackend.cpp +.if ${MK_LLVM_TARGET_AARCH64} != "no" SRCS_MIN+= Target/AArch64/AArch64A53Fix835769.cpp SRCS_MIN+= Target/AArch64/AArch64A57FPLoadBalancing.cpp SRCS_MIN+= Target/AArch64/AArch64AdvSIMDScalarPass.cpp @@ -836,6 +848,8 @@ SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64WinCOFFO SRCS_MIN+= Target/AArch64/MCTargetDesc/AArch64WinCOFFStreamer.cpp SRCS_MIN+= Target/AArch64/TargetInfo/AArch64TargetInfo.cpp SRCS_MIN+= Target/AArch64/Utils/AArch64BaseInfo.cpp +.endif # MK_LLVM_TARGET_AARCH64 +.if ${MK_LLVM_TARGET_ARM} != "no" SRCS_MIN+= Target/ARM/A15SDOptimizer.cpp SRCS_MIN+= Target/ARM/ARMAsmPrinter.cpp SRCS_MIN+= Target/ARM/ARMBaseInstrInfo.cpp @@ -890,6 +904,8 @@ SRCS_MIN+= Target/ARM/Thumb2InstrInfo.cpp SRCS_MIN+= Target/ARM/Thumb2SizeReduction.cpp SRCS_MIN+= Target/ARM/ThumbRegisterInfo.cpp SRCS_MIN+= Target/ARM/Utils/ARMBaseInfo.cpp +.endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_MIPS} != "no" SRCS_MIN+= Target/Mips/AsmParser/MipsAsmParser.cpp SRCS_XDW+= Target/Mips/Disassembler/MipsDisassembler.cpp SRCS_MIN+= Target/Mips/InstPrinter/MipsInstPrinter.cpp @@ -940,6 +956,8 @@ SRCS_MIN+= Target/Mips/MipsSubtarget.cpp SRCS_MIN+= Target/Mips/MipsTargetMachine.cpp SRCS_MIN+= Target/Mips/MipsTargetObjectFile.cpp SRCS_MIN+= Target/Mips/TargetInfo/MipsTargetInfo.cpp +.endif # MK_LLVM_TARGET_MIPS +.if ${MK_LLVM_TARGET_POWERPC} != "no" SRCS_MIN+= Target/PowerPC/AsmParser/PPCAsmParser.cpp SRCS_MIN+= Target/PowerPC/Disassembler/PPCDisassembler.cpp SRCS_MIN+= Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -983,6 +1001,8 @@ SRCS_MIN+= Target/PowerPC/PPCVSXCopy.cpp SRCS_MIN+= Target/PowerPC/PPCVSXFMAMutate.cpp SRCS_MIN+= Target/PowerPC/PPCVSXSwapRemoval.cpp SRCS_MIN+= Target/PowerPC/TargetInfo/PowerPCTargetInfo.cpp +.endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_SPARC} != "no" SRCS_MIN+= Target/Sparc/AsmParser/SparcAsmParser.cpp SRCS_MIN+= Target/Sparc/DelaySlotFiller.cpp SRCS_XDW+= Target/Sparc/Disassembler/SparcDisassembler.cpp @@ -1007,11 +1027,13 @@ SRCS_MIN+= Target/Sparc/SparcSubtarget.cpp SRCS_MIN+= Target/Sparc/SparcTargetMachine.cpp SRCS_MIN+= Target/Sparc/SparcTargetObjectFile.cpp SRCS_MIN+= Target/Sparc/TargetInfo/SparcTargetInfo.cpp +.endif # MK_LLVM_TARGET_SPARC SRCS_MIN+= Target/Target.cpp SRCS_MIN+= Target/TargetIntrinsicInfo.cpp SRCS_MIN+= Target/TargetLoweringObjectFile.cpp SRCS_MIN+= Target/TargetMachine.cpp SRCS_MIN+= Target/TargetMachineC.cpp +.if ${MK_LLVM_TARGET_X86} != "no" SRCS_MIN+= Target/X86/AsmParser/X86AsmInstrumentation.cpp SRCS_MIN+= Target/X86/AsmParser/X86AsmParser.cpp SRCS_XDW+= Target/X86/Disassembler/X86Disassembler.cpp @@ -1069,6 +1091,7 @@ SRCS_MIN+= Target/X86/X86TargetTransformInfo.cpp SRCS_MIN+= Target/X86/X86VZeroUpper.cpp SRCS_MIN+= Target/X86/X86WinAllocaExpander.cpp SRCS_MIN+= Target/X86/X86WinEHState.cpp +.endif # MK_LLVM_TARGET_X86 SRCS_EXT+= ToolDrivers/llvm-dlltool/DlltoolDriver.cpp SRCS_EXL+= ToolDrivers/llvm-lib/LibDriver.cpp SRCS_MIN+= Transforms/Coroutines/CoroCleanup.cpp @@ -1375,6 +1398,7 @@ ${arch:T}Gen${hdr:H}.inc: ${LLVM_SRCS}/lib/Target/${ar ${LLVM_SRCS}/lib/Target/${arch:H}/${arch:T}.td . endfor .endfor +.if ${MK_LLVM_TARGET_AARCH64} != "no" TGHDRS+= AArch64GenAsmMatcher.inc TGHDRS+= AArch64GenAsmWriter.inc TGHDRS+= AArch64GenAsmWriter1.inc @@ -1390,6 +1414,8 @@ TGHDRS+= AArch64GenRegisterBank.inc TGHDRS+= AArch64GenRegisterInfo.inc TGHDRS+= AArch64GenSubtargetInfo.inc TGHDRS+= AArch64GenSystemOperands.inc +.endif # MK_LLVM_TARGET_AARCH64 +.if ${MK_LLVM_TARGET_ARM} != "no" TGHDRS+= ARMGenAsmMatcher.inc TGHDRS+= ARMGenAsmWriter.inc TGHDRS+= ARMGenCallingConv.inc @@ -1404,6 +1430,8 @@ TGHDRS+= ARMGenRegisterBank.inc TGHDRS+= ARMGenRegisterInfo.inc TGHDRS+= ARMGenSubtargetInfo.inc TGHDRS+= ARMGenSystemRegister.inc +.endif # MK_LLVM_TARGET_ARM +.if ${MK_LLVM_TARGET_MIPS} != "no" TGHDRS+= MipsGenAsmMatcher.inc TGHDRS+= MipsGenAsmWriter.inc TGHDRS+= MipsGenCallingConv.inc @@ -1415,6 +1443,8 @@ TGHDRS+= MipsGenMCCodeEmitter.inc TGHDRS+= MipsGenMCPseudoLowering.inc TGHDRS+= MipsGenRegisterInfo.inc TGHDRS+= MipsGenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_MIPS +.if ${MK_LLVM_TARGET_POWERPC} != "no" TGHDRS+= PPCGenAsmMatcher.inc TGHDRS+= PPCGenAsmWriter.inc TGHDRS+= PPCGenCallingConv.inc @@ -1425,6 +1455,8 @@ TGHDRS+= PPCGenInstrInfo.inc TGHDRS+= PPCGenMCCodeEmitter.inc TGHDRS+= PPCGenRegisterInfo.inc TGHDRS+= PPCGenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_POWERPC +.if ${MK_LLVM_TARGET_SPARC} != "no" TGHDRS+= SparcGenAsmMatcher.inc TGHDRS+= SparcGenAsmWriter.inc TGHDRS+= SparcGenCallingConv.inc @@ -1434,6 +1466,8 @@ TGHDRS+= SparcGenInstrInfo.inc TGHDRS+= SparcGenMCCodeEmitter.inc TGHDRS+= SparcGenRegisterInfo.inc TGHDRS+= SparcGenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_SPARC +.if ${MK_LLVM_TARGET_X86} != "no" TGHDRS+= X86GenAsmMatcher.inc TGHDRS+= X86GenAsmWriter.inc TGHDRS+= X86GenAsmWriter1.inc @@ -1447,6 +1481,7 @@ TGHDRS+= X86GenInstrInfo.inc TGHDRS+= X86GenRegisterBank.inc TGHDRS+= X86GenRegisterInfo.inc TGHDRS+= X86GenSubtargetInfo.inc +.endif # MK_LLVM_TARGET_X86 DEPENDFILES+= ${TGHDRS:C/$/.d/} DPSRCS+= ${TGHDRS} Modified: head/lib/clang/llvm.build.mk ============================================================================== --- head/lib/clang/llvm.build.mk Fri Jun 22 11:16:17 2018 (r335557) +++ head/lib/clang/llvm.build.mk Fri Jun 22 15:00:00 2018 (r335558) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .ifndef LLVM_SRCS .error Please define LLVM_SRCS before including this file .endif @@ -39,6 +41,52 @@ LLVM_BUILD_TRIPLE?= ${BUILD_ARCH:C/amd64/x86_64/:C/arm CFLAGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=\"${LLVM_TARGET_TRIPLE}\" CFLAGS+= -DLLVM_HOST_TRIPLE=\"${LLVM_BUILD_TRIPLE}\" CFLAGS+= -DDEFAULT_SYSROOT=\"${TOOLS_PREFIX}\" + +.if ${MK_LLVM_TARGET_AARCH64} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_AARCH64 +. if ${MACHINE_CPUARCH} == "aarch64" +LLVM_NATIVE_ARCH= AArch64 +. endif +.endif +.if ${MK_LLVM_TARGET_ARM} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_ARM +. if ${MACHINE_CPUARCH} == "arm" +LLVM_NATIVE_ARCH= ARM +. endif +.endif +.if ${MK_LLVM_TARGET_MIPS} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_MIPS +. if ${MACHINE_CPUARCH} == "mips" +LLVM_NATIVE_ARCH= Mips +. endif +.endif +.if ${MK_LLVM_TARGET_POWERPC} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_POWERPC +. if ${MACHINE_CPUARCH} == "powerpc" +LLVM_NATIVE_ARCH= PowerPC +. endif +.endif +.if ${MK_LLVM_TARGET_SPARC} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_SPARC +. if ${MACHINE_CPUARCH} == "sparc64" +LLVM_NATIVE_ARCH= Sparc +. endif +.endif +.if ${MK_LLVM_TARGET_X86} != "no" +CFLAGS+= -DLLVM_TARGET_ENABLE_X86 +. if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +LLVM_NATIVE_ARCH= X86 +. endif +.endif + +.ifdef LLVM_NATIVE_ARCH +CFLAGS+= -DLLVM_NATIVE_ASMPARSER=LLVMInitialize${LLVM_NATIVE_ARCH}AsmParser +CFLAGS+= -DLLVM_NATIVE_ASMPRINTER=LLVMInitialize${LLVM_NATIVE_ARCH}AsmPrinter +CFLAGS+= -DLLVM_NATIVE_DISASSEMBLER=LLVMInitialize${LLVM_NATIVE_ARCH}Disassembler +CFLAGS+= -DLLVM_NATIVE_TARGET=LLVMInitialize${LLVM_NATIVE_ARCH}Target +CFLAGS+= -DLLVM_NATIVE_TARGETINFO=LLVMInitialize${LLVM_NATIVE_ARCH}TargetInfo +CFLAGS+= -DLLVM_NATIVE_TARGETMC=LLVMInitialize${LLVM_NATIVE_ARCH}TargetMC +.endif CFLAGS+= -ffunction-sections CFLAGS+= -fdata-sections Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Fri Jun 22 11:16:17 2018 (r335557) +++ head/share/man/man5/src.conf.5 Fri Jun 22 15:00:00 2018 (r335558) @@ -1,6 +1,6 @@ .\" DO NOT EDIT-- this file is @generated by tools/build/options/makeman. .\" $FreeBSD$ -.Dd June 20, 2018 +.Dd June 22, 2018 .Dt SRC.CONF 5 .Os .Sh NAME @@ -1019,6 +1019,66 @@ Set to use LLVM's libunwind stack unwinder (instead of .Pp This is a default setting on amd64/amd64, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, riscv/riscv64 and riscv/riscv64sf. +.It Va WITHOUT_LLVM_TARGET_AARCH64 +Set to not build LLVM target support for AArch64. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_AARCH64 +Set to build LLVM target support for AArch64. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_ARM +Set to not build LLVM target support for ARM. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_ARM +Set to build LLVM target support for ARM. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_MIPS +Set to not build LLVM target support for MIPS. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_MIPS +Set to build LLVM target support for MIPS. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_POWERPC +Set to not build LLVM target support for PowerPC. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_POWERPC +Set to build LLVM target support for PowerPC. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_SPARC +Set to not build LLVM target support for SPARC. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_SPARC +Set to build LLVM target support for SPARC. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. +.It Va WITHOUT_LLVM_TARGET_X86 +Set to not build LLVM target support for X86. +.Pp +This is a default setting on +riscv/riscv64, riscv/riscv64sf and sparc64/sparc64. +.It Va WITH_LLVM_TARGET_X86 +Set to build LLVM target support for X86. +.Pp +This is a default setting on +amd64/amd64, arm/arm, arm/armeb, arm/armv6, arm/armv7, arm64/aarch64, i386/i386, mips/mipsel, mips/mips, mips/mips64el, mips/mips64, mips/mipsn32, mips/mipselhf, mips/mipshf, mips/mips64elhf, mips/mips64hf, powerpc/powerpc, powerpc/powerpc64 and powerpc/powerpcspe. .It Va WITH_LOADER_FIREWIRE Enable firewire support in /boot/loader and /boot/zfsloader on x86. This option is a nop on all other platforms. Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Fri Jun 22 11:16:17 2018 (r335557) +++ head/share/mk/src.opts.mk Fri Jun 22 15:00:00 2018 (r335558) @@ -237,17 +237,23 @@ __TT=${MACHINE} ${__T} == "amd64" || ${__TT} == "arm" || ${__T} == "i386") # Clang is enabled, and will be installed as the default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC LLD +__DEFAULT_YES_OPTIONS+=LLVM_TARGET_AARCH64 LLVM_TARGET_ARM LLVM_TARGET_MIPS +__DEFAULT_YES_OPTIONS+=LLVM_TARGET_POWERPC LLVM_TARGET_SPARC LLVM_TARGET_X86 __DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC .elif ${COMPILER_FEATURES:Mc++11} && ${__T:Mriscv*} == "" && ${__T} != "sparc64" # If an external compiler that supports C++11 is used as ${CC} and Clang # supports the target, then Clang is enabled but GCC is installed as the # default /usr/bin/cc. __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL GCC GCC_BOOTSTRAP GNUCXX GPL_DTC LLD +__DEFAULT_YES_OPTIONS+=LLVM_TARGET_AARCH64 LLVM_TARGET_ARM LLVM_TARGET_MIPS +__DEFAULT_YES_OPTIONS+=LLVM_TARGET_POWERPC LLVM_TARGET_SPARC LLVM_TARGET_X86 __DEFAULT_NO_OPTIONS+=CLANG_BOOTSTRAP CLANG_IS_CC .else # Everything else disables Clang, and uses GCC instead. __DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP GNUCXX GPL_DTC __DEFAULT_NO_OPTIONS+=CLANG CLANG_BOOTSTRAP CLANG_FULL CLANG_IS_CC LLD +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_AARCH64 LLVM_TARGET_ARM LLVM_TARGET_MIPS +__DEFAULT_NO_OPTIONS+=LLVM_TARGET_POWERPC LLVM_TARGET_SPARC LLVM_TARGET_X86 .endif # In-tree binutils/gcc are older versions without modern architecture support. .if ${__T} == "aarch64" || ${__T:Mriscv*} != "" Added: head/tools/build/options/WITHOUT_LLVM_TARGET_AARCH64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_AARCH64 Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for AArch64. Added: head/tools/build/options/WITHOUT_LLVM_TARGET_ARM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_ARM Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for ARM. Added: head/tools/build/options/WITHOUT_LLVM_TARGET_MIPS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_MIPS Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for MIPS. Added: head/tools/build/options/WITHOUT_LLVM_TARGET_POWERPC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_POWERPC Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for PowerPC. Added: head/tools/build/options/WITHOUT_LLVM_TARGET_SPARC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_SPARC Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for SPARC. Added: head/tools/build/options/WITHOUT_LLVM_TARGET_X86 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITHOUT_LLVM_TARGET_X86 Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to not build LLVM target support for X86. Added: head/tools/build/options/WITH_LLVM_TARGET_AARCH64 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_AARCH64 Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for AArch64. Added: head/tools/build/options/WITH_LLVM_TARGET_ARM ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_ARM Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for ARM. Added: head/tools/build/options/WITH_LLVM_TARGET_MIPS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_MIPS Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for MIPS. Added: head/tools/build/options/WITH_LLVM_TARGET_POWERPC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_POWERPC Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for PowerPC. Added: head/tools/build/options/WITH_LLVM_TARGET_SPARC ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_SPARC Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for SPARC. Added: head/tools/build/options/WITH_LLVM_TARGET_X86 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_LLVM_TARGET_X86 Fri Jun 22 15:00:00 2018 (r335558) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build LLVM target support for X86. From owner-svn-src-all@freebsd.org Fri Jun 22 16:18:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C7D81020238; Fri, 22 Jun 2018 16:18:20 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DF130760F3; Fri, 22 Jun 2018 16:18:19 +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 BC3DC22FD7; Fri, 22 Jun 2018 16:18:19 +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 w5MGIJTx043987; Fri, 22 Jun 2018 16:18:19 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MGIJpM043986; Fri, 22 Jun 2018 16:18:19 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201806221618.w5MGIJpM043986@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 Jun 2018 16:18:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335559 - head/sbin/fsck_msdosfs X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/sbin/fsck_msdosfs X-SVN-Commit-Revision: 335559 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 16:18:20 -0000 Author: delphij Date: Fri Jun 22 16:18:19 2018 New Revision: 335559 URL: https://svnweb.freebsd.org/changeset/base/335559 Log: Don't bail out when we find primary and secondary bootblocks miscompare. We do not have code to fix this situation, and the mismatch does not prevent the kernel driver from consuming the file system, and some factory formatted SD cards seem to have a garbage backup block. This makes the code match to its comments (replacing pfatal with pwarn). Inspired by: NetBSD r1.13 Inspired by: https://android.googlesource.com/platform/external/fsck_msdos/+/b47b16353f3db228711dded9f7c975b820059ddc MFC after: 2 weeks Modified: head/sbin/fsck_msdosfs/boot.c Modified: head/sbin/fsck_msdosfs/boot.c ============================================================================== --- head/sbin/fsck_msdosfs/boot.c Fri Jun 22 15:00:00 2018 (r335558) +++ head/sbin/fsck_msdosfs/boot.c Fri Jun 22 16:18:19 2018 (r335559) @@ -167,11 +167,11 @@ readboot(int dosfs, struct bootblock *boot) * requirement is suspect. For now, just * print out useful information and continue. */ - pfatal("backup (block %d) mismatch with primary bootblock:\n", + pwarn("backup (block %d) mismatch with primary bootblock:\n", boot->bpbBackup); for (i = 11; i < 11 + 90; i++) { if (block[i] != backup[i]) - pfatal("\ti=%d\tprimary 0x%02x\tbackup 0x%02x\n", + pwarn("\ti=%d\tprimary 0x%02x\tbackup 0x%02x\n", i, block[i], backup[i]); } } From owner-svn-src-all@freebsd.org Fri Jun 22 17:58:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 40A1210229A5; Fri, 22 Jun 2018 17:58:57 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E78AA799BB; Fri, 22 Jun 2018 17:58:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C4B5424033; Fri, 22 Jun 2018 17:58:56 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MHwuxJ095326; Fri, 22 Jun 2018 17:58:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MHwu78095325; Fri, 22 Jun 2018 17:58:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201806221758.w5MHwu78095325@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Fri, 22 Jun 2018 17:58:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335560 - head/lib/clang/libllvm X-SVN-Group: head X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: head/lib/clang/libllvm X-SVN-Commit-Revision: 335560 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 17:58:57 -0000 Author: bdrewery Date: Fri Jun 22 17:58:56 2018 New Revision: 335560 URL: https://svnweb.freebsd.org/changeset/base/335560 Log: Revert r335449 and add needed MK_LLD_BOOTSTRAP check for SRCS_MIW. This effectively reverts r335449 and changes the previous MK_LLD_IS_LD to a MK_LLD_BOOTSTRAP check. If !TOOLS_PREFIX then these sources are always built for llvm-objdump, lld, and llvm-cov. When TOOLS_PREFIX is set then they are only needed if lld is being bootstrapped. Reported by: dim Pointyhat to: bdrewery Sponsored by: Dell EMC Modified: head/lib/clang/libllvm/Makefile Modified: head/lib/clang/libllvm/Makefile ============================================================================== --- head/lib/clang/libllvm/Makefile Fri Jun 22 16:18:19 2018 (r335559) +++ head/lib/clang/libllvm/Makefile Fri Jun 22 17:58:56 2018 (r335560) @@ -382,30 +382,30 @@ SRCS_MIN+= DebugInfo/CodeView/TypeIndexDiscovery.cpp SRCS_MIN+= DebugInfo/CodeView/TypeRecordMapping.cpp SRCS_MIN+= DebugInfo/CodeView/TypeStreamMerger.cpp SRCS_MIN+= DebugInfo/CodeView/TypeTableCollection.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFCompileUnit.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFContext.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDataExtractor.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugAranges.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugFrame.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugLine.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugLoc.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugMacro.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugPubTable.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDebugRangeList.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFDie.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFExpression.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFFormValue.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFGdbIndex.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFTypeUnit.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFUnit.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFUnitIndex.cpp -SRCS_XDL+= DebugInfo/DWARF/DWARFVerifier.cpp -SRCS_XDL+= DebugInfo/DWARF/SyntaxHighlighting.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAbbreviationDeclaration.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFAcceleratorTable.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFCompileUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFContext.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDataExtractor.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAbbrev.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugArangeSet.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugAranges.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugFrame.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugInfoEntry.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLine.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugLoc.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugMacro.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugPubTable.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDebugRangeList.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFDie.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFExpression.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFFormValue.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFGdbIndex.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFTypeUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnit.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFUnitIndex.cpp +SRCS_MIW+= DebugInfo/DWARF/DWARFVerifier.cpp +SRCS_MIW+= DebugInfo/DWARF/SyntaxHighlighting.cpp SRCS_MIN+= DebugInfo/MSF/MSFBuilder.cpp SRCS_MIN+= DebugInfo/MSF/MSFCommon.cpp SRCS_MIN+= DebugInfo/MSF/MSFError.cpp @@ -1298,7 +1298,7 @@ SRCS_EXT+= Transforms/Vectorize/Vectorize.cpp SRCS_EXT+= XRay/InstrumentationMap.cpp SRCS_ALL+= ${SRCS_MIN} -.if !defined(TOOLS_PREFIX) +.if !defined(TOOLS_PREFIX) || ${MK_LLD_BOOTSTRAP} != "no" SRCS_ALL+= ${SRCS_MIW} .endif .if ${MK_CLANG_EXTRAS} != "no" From owner-svn-src-all@freebsd.org Fri Jun 22 20:19:34 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2CC81025FC7; Fri, 22 Jun 2018 20:19:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A321F7F890; Fri, 22 Jun 2018 20:19:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8430E25775; Fri, 22 Jun 2018 20:19:33 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MKJXZS068754; Fri, 22 Jun 2018 20:19:33 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKJX3u068753; Fri, 22 Jun 2018 20:19:33 GMT (envelope-from np@FreeBSD.org) Message-Id: <201806222019.w5MKJX3u068753@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 22 Jun 2018 20:19:33 +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: r335561 - stable/11/sys/dev/cxgbe X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgbe X-SVN-Commit-Revision: 335561 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:19:34 -0000 Author: np Date: Fri Jun 22 20:19:33 2018 New Revision: 335561 URL: https://svnweb.freebsd.org/changeset/base/335561 Log: cxgbe(4): Determine early in the ioctl whether it is allowed to sleep or not, instead of always starting a non-sleepable operation and re-adjusting later. This ensures that an operation that is allowed to sleep (ifconfig up/down) never fails with EBUSY on the initial attempt to start a synchronized operation. This is a direct commit to stable/11. The driver ioctl is always allowed to sleep in head. Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgbe/t4_main.c Modified: stable/11/sys/dev/cxgbe/t4_main.c ============================================================================== --- stable/11/sys/dev/cxgbe/t4_main.c Fri Jun 22 17:58:56 2018 (r335560) +++ stable/11/sys/dev/cxgbe/t4_main.c Fri Jun 22 20:19:33 2018 (r335561) @@ -1607,7 +1607,7 @@ cxgbe_init(void *arg) static int cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, caddr_t data) { - int rc = 0, mtu, flags, can_sleep; + int rc = 0, mtu, can_sleep, if_flags, if_drv_flags, vi_if_flags; struct vi_info *vi = ifp->if_softc; struct port_info *pi = vi->pi; struct adapter *sc = pi->adapter; @@ -1633,48 +1633,57 @@ cxgbe_ioctl(struct ifnet *ifp, unsigned long cmd, cadd break; case SIOCSIFFLAGS: - can_sleep = 0; -redo_sifflags: + /* + * Decide what to do, with the port lock held. + */ + PORT_LOCK(pi); + if_flags = ifp->if_flags; + if_drv_flags = ifp->if_drv_flags; + vi_if_flags = vi->if_flags; + if (if_flags & IFF_UP && if_drv_flags & IFF_DRV_RUNNING && + (vi_if_flags ^ if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) { + can_sleep = 0; + } else { + can_sleep = 1; + } + PORT_UNLOCK(pi); + + /* + * ifp/vi flags may change here but we'll just do what our local + * copy of the flags indicates and then update the driver owned + * ifp/vi flags (in a synch-op and with the port lock held) to + * reflect what we did. + */ + rc = begin_synchronized_op(sc, vi, can_sleep ? (SLEEP_OK | INTR_OK) : HOLD_LOCK, "t4flg"); if (rc) { if_printf(ifp, "%ssleepable synch operation failed: %d." " if_flags 0x%08x, if_drv_flags 0x%08x\n", - can_sleep ? "" : "non-", rc, ifp->if_flags, - ifp->if_drv_flags); + can_sleep ? "" : "non-", rc, if_flags, + if_drv_flags); return (rc); } - if (ifp->if_flags & IFF_UP) { - if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - flags = vi->if_flags; - if ((ifp->if_flags ^ flags) & + if (if_flags & IFF_UP) { + if (if_drv_flags & IFF_DRV_RUNNING) { + if ((if_flags ^ vi_if_flags) & (IFF_PROMISC | IFF_ALLMULTI)) { - if (can_sleep == 1) { - end_synchronized_op(sc, 0); - can_sleep = 0; - goto redo_sifflags; - } + MPASS(can_sleep == 0); rc = update_mac_settings(ifp, XGMAC_PROMISC | XGMAC_ALLMULTI); } } else { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } + MPASS(can_sleep == 1); rc = cxgbe_init_synchronized(vi); } - vi->if_flags = ifp->if_flags; - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { - if (can_sleep == 0) { - end_synchronized_op(sc, LOCK_HELD); - can_sleep = 1; - goto redo_sifflags; - } + } else if (if_drv_flags & IFF_DRV_RUNNING) { + MPASS(can_sleep == 1); rc = cxgbe_uninit_synchronized(vi); } + PORT_LOCK(pi); + vi->if_flags = if_flags; + PORT_UNLOCK(pi); end_synchronized_op(sc, can_sleep ? 0 : LOCK_HELD); break; From owner-svn-src-all@freebsd.org Fri Jun 22 20:22:27 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3720210261A6; Fri, 22 Jun 2018 20:22:27 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D344B7FC5F; Fri, 22 Jun 2018 20:22:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B5D5F258F5; Fri, 22 Jun 2018 20:22:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MKMQLR074124; Fri, 22 Jun 2018 20:22:26 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKMQim074123; Fri, 22 Jun 2018 20:22:26 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806222022.w5MKMQim074123@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 22 Jun 2018 20:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335562 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335562 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:22:27 -0000 Author: ian Date: Fri Jun 22 20:22:26 2018 New Revision: 335562 URL: https://svnweb.freebsd.org/changeset/base/335562 Log: Eliminate a spurious panic on non-SMP systems (occurred on shutdown/reboot). Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Fri Jun 22 20:19:33 2018 (r335561) +++ head/sys/vm/uma_core.c Fri Jun 22 20:22:26 2018 (r335562) @@ -2258,7 +2258,9 @@ void uma_zfree_pcpu_arg(uma_zone_t zone, void *item, void *udata) { +#ifdef SMP MPASS(zone->uz_flags & UMA_ZONE_PCPU); +#endif uma_zfree_arg(zone, item, udata); } From owner-svn-src-all@freebsd.org Fri Jun 22 20:27:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BD38B10262EC; Fri, 22 Jun 2018 20:27:41 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6AF657FF98; Fri, 22 Jun 2018 20:27:41 +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 2E28125916; Fri, 22 Jun 2018 20:27:41 +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 w5MKRf87074578; Fri, 22 Jun 2018 20:27:41 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKRfSZ074577; Fri, 22 Jun 2018 20:27:41 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201806222027.w5MKRfSZ074577@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Fri, 22 Jun 2018 20:27:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-release@freebsd.org Subject: svn commit: r335563 - release/11.2.0 X-SVN-Group: release X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: release/11.2.0 X-SVN-Commit-Revision: 335563 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:27:41 -0000 Author: gjb Date: Fri Jun 22 20:27:40 2018 New Revision: 335563 URL: https://svnweb.freebsd.org/changeset/base/335563 Log: Tag releng/11.2@r335510 as release/11.2.0 (11.2-RELEASE). Approved by: re (implicit) Sponsored by: The FreeBSD Foundation Added: release/11.2.0/ - copied from r335510, releng/11.2/ From owner-svn-src-all@freebsd.org Fri Jun 22 20:45:41 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84BA01026CE0; Fri, 22 Jun 2018 20:45:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 37F4A80FC6; Fri, 22 Jun 2018 20:45:41 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F322325C38; Fri, 22 Jun 2018 20:45:40 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MKje3u084918; Fri, 22 Jun 2018 20:45:40 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKjePq084915; Fri, 22 Jun 2018 20:45:40 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806222045.w5MKjePq084915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 22 Jun 2018 20:45:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335564 - in head/sys: dts/arm/overlays modules/dtb/rpi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: in head/sys: dts/arm/overlays modules/dtb/rpi X-SVN-Commit-Revision: 335564 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:45:41 -0000 Author: ian Date: Fri Jun 22 20:45:40 2018 New Revision: 335564 URL: https://svnweb.freebsd.org/changeset/base/335564 Log: Add spigen(4) fdt data overlays for RPI-B, RPI-2. By adding spigen-rpi{2,-b}.dtso to fdt_overlays= in loader.conf, the fdt data will set up the correct pinmux and device nodes to create a spigen(4) device for each available chipselect pin. Submitted by: Bob Frazier Differential Revision: https://reviews.freebsd.org/D15067 Added: head/sys/dts/arm/overlays/spigen-rpi-b.dtso (contents, props changed) head/sys/dts/arm/overlays/spigen-rpi2.dtso (contents, props changed) Modified: head/sys/modules/dtb/rpi/Makefile Added: head/sys/dts/arm/overlays/spigen-rpi-b.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/spigen-rpi-b.dtso Fri Jun 22 20:45:40 2018 (r335564) @@ -0,0 +1,29 @@ +/* $FreeBSD$ */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2835"; +}; + +&{/soc/spi@7e204000} { + status = "okay"; + + spigen0: spigen0 { + compatible = "freebsd,spigen"; + reg = <0>; + status = "okay"; + }; + spigen1: spigen1 { + compatible = "freebsd,spigen"; + reg = <1>; + status = "okay"; + }; +}; + +&{/soc/gpio@7e200000/spi0_cs_pins} { + brcm,pins = <8 7>; + brcm,function = <4>; /* ALT0 */ +}; + Added: head/sys/dts/arm/overlays/spigen-rpi2.dtso ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dts/arm/overlays/spigen-rpi2.dtso Fri Jun 22 20:45:40 2018 (r335564) @@ -0,0 +1,37 @@ +/* $FreeBSD$ */ + +/dts-v1/; +/plugin/; + +/ { + compatible = "brcm,bcm2836"; +}; + +&{/soc/spi@7e204000} { + status = "okay"; + spigen0: spigen0 { + compatible = "freebsd,spigen"; + reg = <0>; + status = "okay"; + }; + spigen1: spigen1 { + compatible = "freebsd,spigen"; + reg = <1>; + status = "okay"; + }; + spigen2: spigen2 { + compatible = "freebsd,spigen"; + reg = <2>; + status = "okay"; + }; +}; + +&{/soc/gpio@7e200000/spi0_cs_pins} { + brcm,pins = <8 7 16>; + brcm,function = <4>; /* ALT0 */ +}; + +&{/soc/gpio@7e200000/spi0_gpio7} { + brcm,pins = <7 8 16 9 10 11>; +}; + Modified: head/sys/modules/dtb/rpi/Makefile ============================================================================== --- head/sys/modules/dtb/rpi/Makefile Fri Jun 22 20:27:40 2018 (r335563) +++ head/sys/modules/dtb/rpi/Makefile Fri Jun 22 20:45:40 2018 (r335564) @@ -2,6 +2,10 @@ # DTS files for the Raspberry Pi-B DTS=rpi.dts rpi2.dts +DTSO= \ + spigen-rpi-b.dtso \ + spigen-rpi2.dtso \ + LINKS= \ ${DTBDIR}/rpi.dtb ${DTBDIR}/bcm2835-rpi-b.dtb \ ${DTBDIR}/rpi.dtb ${DTBDIR}/bcm2835-rpi-b-rev2.dtb \ From owner-svn-src-all@freebsd.org Fri Jun 22 20:53:40 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 08B30102722D; Fri, 22 Jun 2018 20:53:40 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B1B1E81864; Fri, 22 Jun 2018 20:53:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9373425DF6; Fri, 22 Jun 2018 20:53:39 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MKrdSH090014; Fri, 22 Jun 2018 20:53:39 GMT (envelope-from ed@FreeBSD.org) Received: (from ed@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKrdkl090013; Fri, 22 Jun 2018 20:53:39 GMT (envelope-from ed@FreeBSD.org) Message-Id: <201806222053.w5MKrdkl090013@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ed set sender to ed@FreeBSD.org using -f From: Ed Schouten Date: Fri, 22 Jun 2018 20:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335565 - head/usr.sbin/syslogd X-SVN-Group: head X-SVN-Commit-Author: ed X-SVN-Commit-Paths: head/usr.sbin/syslogd X-SVN-Commit-Revision: 335565 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:53:40 -0000 Author: ed Date: Fri Jun 22 20:53:39 2018 New Revision: 335565 URL: https://svnweb.freebsd.org/changeset/base/335565 Log: Still parse messages that don't contain an RFC 3164 timestamp. The changes made in r326573 required that messages always start with an RFC 3164 timestamp. It looks like certain devices, but also certain logging libraries (Python 3's "logging" package) simply don't generate RFC 3164 formatted messages containing a timestamp. Make timestamps optional again. When the timestamp is missing, also assume that the message contains no hostname. The first word of the message likely already belongs to the message payload. PR: 229236 Reported by: Michael Grimm & Marek Zarychta Reviewed by: glebius (cursory) MFC after: 1 week Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Jun 22 20:45:40 2018 (r335564) +++ head/usr.sbin/syslogd/syslogd.c Fri Jun 22 20:53:39 2018 (r335565) @@ -1172,68 +1172,70 @@ parsemsg_rfc3164(const char *from, int pri, char *msg) size_t i, msglen; char line[MAXLINE + 1]; - /* Parse the timestamp provided by the remote side. */ - if (strptime(msg, RFC3164_DATEFMT, &tm_parsed) != - msg + RFC3164_DATELEN || msg[RFC3164_DATELEN] != ' ') { - dprintf("Failed to parse TIMESTAMP from %s: %s\n", from, msg); - return; - } - msg += RFC3164_DATELEN + 1; + /* + * Parse the TIMESTAMP provided by the remote side. If none is + * found, assume this is not an RFC 3164 formatted message, + * only containing a TAG and a MSG. + */ + timestamp = NULL; + if (strptime(msg, RFC3164_DATEFMT, &tm_parsed) == + msg + RFC3164_DATELEN && msg[RFC3164_DATELEN] == ' ') { + msg += RFC3164_DATELEN + 1; + if (!RemoteAddDate) { + struct tm tm_now; + time_t t_now; + int year; - if (!RemoteAddDate) { - struct tm tm_now; - time_t t_now; - int year; + /* + * As the timestamp does not contain the year + * number, daylight saving time information, nor + * a time zone, attempt to infer it. Due to + * clock skews, the timestamp may even be part + * of the next year. Use the last year for which + * the timestamp is at most one week in the + * future. + * + * This loop can only run for at most three + * iterations before terminating. + */ + t_now = time(NULL); + localtime_r(&t_now, &tm_now); + for (year = tm_now.tm_year + 1;; --year) { + assert(year >= tm_now.tm_year - 1); + timestamp_remote.tm = tm_parsed; + timestamp_remote.tm.tm_year = year; + timestamp_remote.tm.tm_isdst = -1; + timestamp_remote.usec = 0; + if (mktime(×tamp_remote.tm) < + t_now + 7 * 24 * 60 * 60) + break; + } + timestamp = ×tamp_remote; + } /* - * As the timestamp does not contain the year number, - * daylight saving time information, nor a time zone, - * attempt to infer it. Due to clock skews, the - * timestamp may even be part of the next year. Use the - * last year for which the timestamp is at most one week - * in the future. - * - * This loop can only run for at most three iterations - * before terminating. + * A single space character MUST also follow the HOSTNAME field. */ - t_now = time(NULL); - localtime_r(&t_now, &tm_now); - for (year = tm_now.tm_year + 1;; --year) { - assert(year >= tm_now.tm_year - 1); - timestamp_remote.tm = tm_parsed; - timestamp_remote.tm.tm_year = year; - timestamp_remote.tm.tm_isdst = -1; - timestamp_remote.usec = 0; - if (mktime(×tamp_remote.tm) < - t_now + 7 * 24 * 60 * 60) + msglen = strlen(msg); + for (i = 0; i < MIN(MAXHOSTNAMELEN, msglen); i++) { + if (msg[i] == ' ') { + if (RemoteHostname) { + msg[i] = '\0'; + from = msg; + } + msg += i + 1; break; - } - timestamp = ×tamp_remote; - } else - timestamp = NULL; - - /* - * A single space character MUST also follow the HOSTNAME field. - */ - msglen = strlen(msg); - for (i = 0; i < MIN(MAXHOSTNAMELEN, msglen); i++) { - if (msg[i] == ' ') { - if (RemoteHostname) { - msg[i] = '\0'; - from = msg; } - msg += i + 1; - break; + /* + * Support non RFC compliant messages, without hostname. + */ + if (msg[i] == ':') + break; } - /* - * Support non RFC compliant messages, without hostname. - */ - if (msg[i] == ':') - break; - } - if (i == MIN(MAXHOSTNAMELEN, msglen)) { - dprintf("Invalid HOSTNAME from %s: %s\n", from, msg); - return; + if (i == MIN(MAXHOSTNAMELEN, msglen)) { + dprintf("Invalid HOSTNAME from %s: %s\n", from, msg); + return; + } } /* Remove the TAG, if present. */ From owner-svn-src-all@freebsd.org Fri Jun 22 20:58:52 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C4EA102743B; Fri, 22 Jun 2018 20:58:52 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ED6BD81C2D; Fri, 22 Jun 2018 20:58:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CAA6725DF9; Fri, 22 Jun 2018 20:58:51 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MKwpLr090427; Fri, 22 Jun 2018 20:58:51 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MKwplk090426; Fri, 22 Jun 2018 20:58:51 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806222058.w5MKwplk090426@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 22 Jun 2018 20:58:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335566 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 335566 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 20:58:52 -0000 Author: rmacklem Date: Fri Jun 22 20:58:51 2018 New Revision: 335566 URL: https://svnweb.freebsd.org/changeset/base/335566 Log: Add "mountcritremote" to the REQUIRE line for nfsd. For a pNFS MDS server, there must be mounts done to the DSs before the nfsd is started. Adding the REQUIRE line makes sure these are done. If there are NFS mounts in /etc/fstab that cannot be completed before the nfsd starts, the "bg" mount option can still be used to handle that. I do not believe this should cause problems for non-pNFS NFS servers. (I have requested a review by rc@, but it is still pending.) Modified: head/etc/rc.d/nfsd Modified: head/etc/rc.d/nfsd ============================================================================== --- head/etc/rc.d/nfsd Fri Jun 22 20:53:39 2018 (r335565) +++ head/etc/rc.d/nfsd Fri Jun 22 20:58:51 2018 (r335566) @@ -4,7 +4,7 @@ # # PROVIDE: nfsd -# REQUIRE: mountd hostname gssd nfsuserd +# REQUIRE: mountcritremote mountd hostname gssd nfsuserd # KEYWORD: nojail shutdown . /etc/rc.subr From owner-svn-src-all@freebsd.org Fri Jun 22 21:25:29 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 642A41027F51; Fri, 22 Jun 2018 21:25:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 056868314E; Fri, 22 Jun 2018 21:25:29 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BAE69262DE; Fri, 22 Jun 2018 21:25:28 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MLPSH4006870; Fri, 22 Jun 2018 21:25:28 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MLPSdK006866; Fri, 22 Jun 2018 21:25:28 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806222125.w5MLPSdK006866@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 22 Jun 2018 21:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335567 - in head/sys/fs: nfs nfsclient X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: in head/sys/fs: nfs nfsclient X-SVN-Commit-Revision: 335567 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 21:25:29 -0000 Author: rmacklem Date: Fri Jun 22 21:25:27 2018 New Revision: 335567 URL: https://svnweb.freebsd.org/changeset/base/335567 Log: Change the NFSv4.1 pNFS client so that it returns the DS error in layoutreturn. When the NFSv4.1 pNFS client gets an error for a DS I/O operation using a Flexible File layout, it returns the layout with an error. This patch changes the code slightly, so that it returns the layout for all errors except EACCES and lets the MDS decide what to do based on the error. It also makes a couple of changes to nfscl_layoutrecall() to ensure that the first layoutreturn(s) will have the error in the reply. Plus, the patch adds a wakeup() so that the "nfscl" thread won't wait 1sec before doing the LayoutReturn. Tested against the pNFS service. This patch should not affect non-pNFS use of the client. The unused "dsp" argument will be used by a future patch that disables the connection to the DS when possible. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_var.h head/sys/fs/nfsclient/nfs_clrpcops.c head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfs/nfs_var.h ============================================================================== --- head/sys/fs/nfs/nfs_var.h Fri Jun 22 20:58:51 2018 (r335566) +++ head/sys/fs/nfs/nfs_var.h Fri Jun 22 21:25:27 2018 (r335567) @@ -601,7 +601,8 @@ int nfscl_layout(struct nfsmount *, vnode_t, u_int8_t NFSPROC_T *); struct nfscllayout *nfscl_getlayout(struct nfsclclient *, uint8_t *, int, uint64_t, struct nfsclflayout **, int *); -void nfscl_dserr(uint32_t, struct nfscldevinfo *, struct nfscllayout *); +void nfscl_dserr(uint32_t, uint32_t, struct nfscldevinfo *, + struct nfscllayout *, struct nfsclds *); void nfscl_rellayout(struct nfscllayout *, int); struct nfscldevinfo *nfscl_getdevinfo(struct nfsclclient *, uint8_t *, struct nfscldevinfo *); Modified: head/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jun 22 20:58:51 2018 (r335566) +++ head/sys/fs/nfsclient/nfs_clrpcops.c Fri Jun 22 21:25:27 2018 (r335567) @@ -6040,10 +6040,11 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * *dspp, fhp, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); NFSCL_DEBUG(4, "commitds=%d\n", error); - if (nfsds_failerr(error)) { + if (error != 0 && error != EACCES) { NFSCL_DEBUG(4, "DS layreterr for commit\n"); - nfscl_dserr(NFSV4OP_COMMIT, dp, lyp); + nfscl_dserr(NFSV4OP_COMMIT, error, dp, + lyp, *dspp); } } NFSCL_DEBUG(4, "aft nfsio_commitds=%d\n", error); @@ -6064,9 +6065,10 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * off, xfer, fhp, 1, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); NFSCL_DEBUG(4, "readds=%d\n", error); - if (nfsds_failerr(error)) { + if (error != 0 && error != EACCES) { NFSCL_DEBUG(4, "DS layreterr for read\n"); - nfscl_dserr(NFSV4OP_READ, dp, lyp); + nfscl_dserr(NFSV4OP_READ, error, dp, lyp, + *dspp); } } else { if (flp->nfsfl_mirrorcnt == 1) { @@ -6099,10 +6101,11 @@ nfscl_dofflayoutio(vnode_t vp, struct uio *uiop, int * xfer, fhp, m, dp->nfsdi_vers, dp->nfsdi_minorvers, tcred, p); NFSCL_DEBUG(4, "nfsio_writedsmir=%d\n", error); - if (nfsds_failerr(error)) { + if (error != 0 && error != EACCES) { NFSCL_DEBUG(4, "DS layreterr for write\n"); - nfscl_dserr(NFSV4OP_WRITE, dp, lyp); + nfscl_dserr(NFSV4OP_WRITE, error, dp, + lyp, *dspp); } } } Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Fri Jun 22 20:58:51 2018 (r335566) +++ head/sys/fs/nfsclient/nfs_clstate.c Fri Jun 22 21:25:27 2018 (r335567) @@ -4973,11 +4973,13 @@ nfscl_retoncloselayout(vnode_t vp, struct nfsclclient * Mark the layout to be recalled and with an error. */ void -nfscl_dserr(uint32_t op, struct nfscldevinfo *dp, struct nfscllayout *lyp) +nfscl_dserr(uint32_t op, uint32_t stat, struct nfscldevinfo *dp, + struct nfscllayout *lyp, __unused struct nfsclds *dsp) { struct nfsclrecalllayout *recallp; uint32_t iomode; + /* Set up the return of the layout. */ recallp = malloc(sizeof(*recallp), M_NFSLAYRECALL, M_WAITOK); iomode = 0; NFSLOCKCLSTATE(); @@ -4987,10 +4989,10 @@ nfscl_dserr(uint32_t op, struct nfscldevinfo *dp, stru if (!LIST_EMPTY(&lyp->nfsly_flayrw)) iomode |= NFSLAYOUTIOMODE_RW; (void)nfscl_layoutrecall(NFSLAYOUTRETURN_FILE, lyp, iomode, - 0, UINT64_MAX, lyp->nfsly_stateid.seqid, NFSERR_IO, op, + 0, UINT64_MAX, lyp->nfsly_stateid.seqid, stat, op, dp->nfsdi_deviceid, recallp); NFSUNLOCKCLSTATE(); - NFSCL_DEBUG(4, "retoncls recall iomode=%d\n", iomode); + NFSCL_DEBUG(4, "nfscl_dserr recall iomode=%d\n", iomode); } else { NFSUNLOCKCLSTATE(); free(recallp, M_NFSLAYRECALL); @@ -5247,6 +5249,19 @@ nfscl_layoutrecall(int recalltype, struct nfscllayout LIST_INSERT_BEFORE(rp, recallp, nfsrecly_list); break; } + + /* + * Put any error return on all the file returns that will + * preceed this one. + */ + if (rp->nfsrecly_recalltype == NFSLAYOUTRETURN_FILE && + stat != 0 && rp->nfsrecly_stat == 0) { + rp->nfsrecly_stat = stat; + rp->nfsrecly_op = op; + if (devid != NULL) + NFSBCOPY(devid, rp->nfsrecly_devid, + NFSX_V4DEVICEID); + } } if (rp == NULL) { if (orp == NULL) @@ -5256,6 +5271,7 @@ nfscl_layoutrecall(int recalltype, struct nfscllayout LIST_INSERT_AFTER(orp, recallp, nfsrecly_list); } lyp->nfsly_flags |= NFSLY_RECALL; + wakeup(lyp->nfsly_clp); return (0); } From owner-svn-src-all@freebsd.org Fri Jun 22 21:37:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 429CC100021A; Fri, 22 Jun 2018 21:37:21 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E813B837BB; Fri, 22 Jun 2018 21:37:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C52A52648C; Fri, 22 Jun 2018 21:37:20 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MLbKIc012486; Fri, 22 Jun 2018 21:37:20 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MLbKef012485; Fri, 22 Jun 2018 21:37:20 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806222137.w5MLbKef012485@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Fri, 22 Jun 2018 21:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335568 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 335568 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 21:37:21 -0000 Author: rmacklem Date: Fri Jun 22 21:37:20 2018 New Revision: 335568 URL: https://svnweb.freebsd.org/changeset/base/335568 Log: Fix the handling of NFSv4.1 sessions for "soft" mounts. When a "soft" mount is used for NFSv4.1, an RPC that fails without completing will leave a slot in the NFSv4.1 session in an indeterminate state. As such, all that can be done is free up the slot while making is no longer usable. A "soft" NFSv4.1 mount is not recommended in general, since it will leave Open/Lock state in an indeterminate state. An exception is a pNFS mount of a DS, since there are no Opens/Locks done for them except file creates where loss of the Open state does not matter. The patch also makes connections to DSs soft, so that they will fail when a DS is non-functional or network partitioned, allowing the pNFS MDS to disable the DS for a mirrored configuration. This patch should not affect normal "hard" NFSv4.1 mounts. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonkrpc.c Modified: head/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- head/sys/fs/nfs/nfs_commonkrpc.c Fri Jun 22 21:25:27 2018 (r335567) +++ head/sys/fs/nfs/nfs_commonkrpc.c Fri Jun 22 21:37:20 2018 (r335568) @@ -157,6 +157,9 @@ static int nfsv2_procid[NFS_V3NPROCS] = { /* * Initialize sockets and congestion for a new NFS connection. * We do not free the sockaddr if error. + * Which arguments are set to NULL indicate what kind of call it is. + * cred == NULL --> a call to connect to a pNFS DS + * nmp == NULL --> indicates an upcall to userland or a NFSv4.0 callback */ int newnfs_connect(struct nfsmount *nmp, struct nfssockreq *nrp, @@ -293,24 +296,38 @@ newnfs_connect(struct nfsmount *nmp, struct nfssockreq retries = nmp->nm_retry; } else retries = INT_MAX; - /* cred == NULL for DS connects. */ - if (NFSHASNFSV4N(nmp) && cred != NULL) { - /* - * Make sure the nfscbd_pool doesn't get destroyed - * while doing this. - */ - NFSD_LOCK(); - if (nfs_numnfscbd > 0) { - nfs_numnfscbd++; - NFSD_UNLOCK(); - xprt = svc_vc_create_backchannel(nfscbd_pool); - CLNT_CONTROL(client, CLSET_BACKCHANNEL, xprt); + if (NFSHASNFSV4N(nmp)) { + if (cred != NULL) { + /* + * Make sure the nfscbd_pool doesn't get + * destroyed while doing this. + */ NFSD_LOCK(); - nfs_numnfscbd--; - if (nfs_numnfscbd == 0) - wakeup(&nfs_numnfscbd); + if (nfs_numnfscbd > 0) { + nfs_numnfscbd++; + NFSD_UNLOCK(); + xprt = svc_vc_create_backchannel( + nfscbd_pool); + CLNT_CONTROL(client, CLSET_BACKCHANNEL, + xprt); + NFSD_LOCK(); + nfs_numnfscbd--; + if (nfs_numnfscbd == 0) + wakeup(&nfs_numnfscbd); + } + NFSD_UNLOCK(); + } else { + /* + * cred == NULL for a DS connect. + * For connects to a DS, set a retry limit + * so that failed DSs will be detected. + * This is ok for NFSv4.1, since a DS does + * not maintain open/lock state and is the + * only case where using a "soft" mount is + * recommended for NFSv4. + */ + retries = 2; } - NFSD_UNLOCK(); } } else { /* @@ -762,6 +779,7 @@ tryagain: else stat = CLNT_CALL_MBUF(nrp->nr_client, &ext, procnum, nd->nd_mreq, &nd->nd_mrep, timo); + NFSCL_DEBUG(2, "clnt call=%d\n", stat); if (rep != NULL) { /* @@ -789,6 +807,36 @@ tryagain: error = EPROTONOSUPPORT; } else if (stat == RPC_INTR) { error = EINTR; + } else if (stat == RPC_CANTSEND || stat == RPC_CANTRECV || + stat == RPC_SYSTEMERROR) { + /* Check for a session slot that needs to be free'd. */ + if ((nd->nd_flag & (ND_NFSV41 | ND_HASSLOTID)) == + (ND_NFSV41 | ND_HASSLOTID) && nmp != NULL && + nd->nd_procnum != NFSPROC_NULL) { + /* + * This should only occur when either the MDS or + * a client has an RPC against a DS fail. + * This happens because these cases use "soft" + * connections that can time out and fail. + * The slot used for this RPC is now in a + * non-deterministic state, but if the slot isn't + * free'd, threads can get stuck waiting for a slot. + */ + if (sep == NULL) + sep = nfsmnt_mdssession(nmp); + /* + * Bump the sequence# out of range, so that reuse of + * this slot will result in an NFSERR_SEQMISORDERED + * error and not a bogus cached RPC reply. + */ + mtx_lock(&sep->nfsess_mtx); + sep->nfsess_slotseq[nd->nd_slotid] += 10; + mtx_unlock(&sep->nfsess_mtx); + /* And free the slot. */ + nfsv4_freeslot(sep, nd->nd_slotid); + } + NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); + error = ENXIO; } else { NFSINCRGLOBAL(nfsstatsv1.rpcinvalid); error = EACCES; From owner-svn-src-all@freebsd.org Fri Jun 22 21:59:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B1221000EF9; Fri, 22 Jun 2018 21:59:32 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1DCD284868; Fri, 22 Jun 2018 21:59:32 +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 F035F267C7; Fri, 22 Jun 2018 21:59:31 +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 w5MLxVj0023252; Fri, 22 Jun 2018 21:59:31 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MLxVR6023249; Fri, 22 Jun 2018 21:59:31 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201806222159.w5MLxVR6023249@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Fri, 22 Jun 2018 21:59:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335569 - in head: sbin/pfctl share/man/man5 sys/netpfil/pf X-SVN-Group: head X-SVN-Commit-Author: kp X-SVN-Commit-Paths: in head: sbin/pfctl share/man/man5 sys/netpfil/pf X-SVN-Commit-Revision: 335569 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 21:59:32 -0000 Author: kp Date: Fri Jun 22 21:59:30 2018 New Revision: 335569 URL: https://svnweb.freebsd.org/changeset/base/335569 Log: pf: Support "return" statements in passing rules when they fail. Normally pf rules are expected to do one of two things: pass the traffic or block it. Blocking can be silent - "drop", or loud - "return", "return-rst", "return-icmp". Yet there is a 3rd category of traffic passing through pf: Packets matching a "pass" rule but when applying the rule fails. This happens when redirection table is empty or when src node or state creation fails. Such rules always fail silently without notifying the sender. Allow users to configure this behaviour too, so that pf returns an error packet in these cases. PR: 226850 Submitted by: Kajetan Staszkiewicz MFC after: 1 week Sponsored by: InnoGames GmbH Modified: head/sbin/pfctl/parse.y head/share/man/man5/pf.conf.5 head/sys/netpfil/pf/pf.c Modified: head/sbin/pfctl/parse.y ============================================================================== --- head/sbin/pfctl/parse.y Fri Jun 22 21:37:20 2018 (r335568) +++ head/sbin/pfctl/parse.y Fri Jun 22 21:59:30 2018 (r335569) @@ -79,6 +79,7 @@ static u_int16_t returnicmpdefault = static u_int16_t returnicmp6default = (ICMP6_DST_UNREACH << 8) | ICMP6_DST_UNREACH_NOPORT; static int blockpolicy = PFRULE_DROP; +static int failpolicy = PFRULE_DROP; static int require_order = 1; static int default_statelock; @@ -455,8 +456,8 @@ int parseport(char *, struct range *r, int); %token MINTTL ERROR ALLOWOPTS FASTROUTE FILENAME ROUTETO DUPTO REPLYTO NO LABEL %token NOROUTE URPFFAILED FRAGMENT USER GROUP MAXMSS MAXIMUM TTL TOS DROP TABLE %token REASSEMBLE FRAGDROP FRAGCROP ANCHOR NATANCHOR RDRANCHOR BINATANCHOR -%token SET OPTIMIZATION TIMEOUT LIMIT LOGINTERFACE BLOCKPOLICY RANDOMID -%token REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID +%token SET OPTIMIZATION TIMEOUT LIMIT LOGINTERFACE BLOCKPOLICY FAILPOLICY +%token RANDOMID REQUIREORDER SYNPROXY FINGERPRINTS NOSYNC DEBUG SKIP HOSTID %token ANTISPOOF FOR INCLUDE %token BITMASK RANDOM SOURCEHASH ROUNDROBIN STATICPORT PROBABILITY %token ALTQ CBQ CODEL PRIQ HFSC FAIRQ BANDWIDTH TBRSIZE LINKSHARE REALTIME @@ -640,6 +641,20 @@ option : SET OPTIMIZATION STRING { YYERROR; blockpolicy = PFRULE_RETURN; } + | SET FAILPOLICY DROP { + if (pf->opts & PF_OPT_VERBOSE) + printf("set fail-policy drop\n"); + if (check_rulestate(PFCTL_STATE_OPTION)) + YYERROR; + failpolicy = PFRULE_DROP; + } + | SET FAILPOLICY RETURN { + if (pf->opts & PF_OPT_VERBOSE) + printf("set fail-policy return\n"); + if (check_rulestate(PFCTL_STATE_OPTION)) + YYERROR; + failpolicy = PFRULE_RETURN; + } | SET REQUIREORDER yesno { if (pf->opts & PF_OPT_VERBOSE) printf("set require-order %s\n", @@ -2636,7 +2651,12 @@ probability : STRING { ; -action : PASS { $$.b1 = PF_PASS; $$.b2 = $$.w = 0; } +action : PASS { + $$.b1 = PF_PASS; + $$.b2 = failpolicy; + $$.w = returnicmpdefault; + $$.w2 = returnicmp6default; + } | BLOCK blockspec { $$ = $2; $$.b1 = PF_DROP; } ; @@ -5471,6 +5491,7 @@ lookup(char *s) { "drop", DROP}, { "drop-ovl", FRAGDROP}, { "dup-to", DUPTO}, + { "fail-policy", FAILPOLICY}, { "fairq", FAIRQ}, { "fastroute", FASTROUTE}, { "file", FILENAME}, @@ -5935,6 +5956,7 @@ parse_config(char *filename, struct pfctl *xpf) returnicmp6default = (ICMP6_DST_UNREACH << 8) | ICMP6_DST_UNREACH_NOPORT; blockpolicy = PFRULE_DROP; + failpolicy = PFRULE_DROP; require_order = 1; if ((file = pushfile(filename, 0)) == NULL) { Modified: head/share/man/man5/pf.conf.5 ============================================================================== --- head/share/man/man5/pf.conf.5 Fri Jun 22 21:37:20 2018 (r335568) +++ head/share/man/man5/pf.conf.5 Fri Jun 22 21:59:30 2018 (r335569) @@ -498,6 +498,31 @@ For example: .Bd -literal -offset indent set block-policy return .Ed + +.It Ar set fail-policy +The +.Ar fail-policy +option sets the behaviour of rules which should pass a packet but were unable to +do so. This might happen when a nat or route-to rule uses an empty table as list +of targets or if a rule fails to create state or source node. +The following +.Ar block +actions are possible: +.Pp +.Bl -tag -width xxxxxxxx -compact +.It Ar drop +Incoming packet is silently dropped. +.It Ar return +Incoming packet is dropped and TCP RST is returned for TCP packets, +an ICMP UNREACHABLE is returned for UDP packets, +and no response is sent for other packets. +.El +.Pp +For example: +.Bd -literal -offset indent +set fail-policy return +.Ed + .It Ar set state-policy The .Ar state-policy Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Fri Jun 22 21:37:20 2018 (r335568) +++ head/sys/netpfil/pf/pf.c Fri Jun 22 21:59:30 2018 (r335569) @@ -2499,6 +2499,81 @@ pf_send_tcp(struct mbuf *replyto, const struct pf_rule pf_send(pfse); } +static void +pf_return(struct pf_rule *r, struct pf_rule *nr, struct pf_pdesc *pd, + struct pf_state_key *sk, int off, struct mbuf *m, struct tcphdr *th, + struct pfi_kif *kif, u_int16_t bproto_sum, u_int16_t bip_sum, int hdrlen, + u_short *reason) +{ + struct pf_addr * const saddr = pd->src; + struct pf_addr * const daddr = pd->dst; + sa_family_t af = pd->af; + + /* undo NAT changes, if they have taken place */ + if (nr != NULL) { + PF_ACPY(saddr, &sk->addr[pd->sidx], af); + PF_ACPY(daddr, &sk->addr[pd->didx], af); + if (pd->sport) + *pd->sport = sk->port[pd->sidx]; + if (pd->dport) + *pd->dport = sk->port[pd->didx]; + if (pd->proto_sum) + *pd->proto_sum = bproto_sum; + if (pd->ip_sum) + *pd->ip_sum = bip_sum; + m_copyback(m, off, hdrlen, pd->hdr.any); + } + if (pd->proto == IPPROTO_TCP && + ((r->rule_flag & PFRULE_RETURNRST) || + (r->rule_flag & PFRULE_RETURN)) && + !(th->th_flags & TH_RST)) { + u_int32_t ack = ntohl(th->th_seq) + pd->p_len; + int len = 0; +#ifdef INET + struct ip *h4; +#endif +#ifdef INET6 + struct ip6_hdr *h6; +#endif + + switch (af) { +#ifdef INET + case AF_INET: + h4 = mtod(m, struct ip *); + len = ntohs(h4->ip_len) - off; + break; +#endif +#ifdef INET6 + case AF_INET6: + h6 = mtod(m, struct ip6_hdr *); + len = ntohs(h6->ip6_plen) - (off - sizeof(*h6)); + break; +#endif + } + + if (pf_check_proto_cksum(m, off, len, IPPROTO_TCP, af)) + REASON_SET(reason, PFRES_PROTCKSUM); + else { + if (th->th_flags & TH_SYN) + ack++; + if (th->th_flags & TH_FIN) + ack++; + pf_send_tcp(m, r, af, pd->dst, + pd->src, th->th_dport, th->th_sport, + ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, + r->return_ttl, 1, 0, kif->pfik_ifp); + } + } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && + r->return_icmp) + pf_send_icmp(m, r->return_icmp >> 8, + r->return_icmp & 255, af, r); + else if (pd->proto != IPPROTO_ICMPV6 && af == AF_INET6 && + r->return_icmp6) + pf_send_icmp(m, r->return_icmp6 >> 8, + r->return_icmp6 & 255, af, r); +} + + static int pf_ieee8021q_setpcp(struct mbuf *m, u_int8_t prio) { @@ -3463,68 +3538,8 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm ((r->rule_flag & PFRULE_RETURNRST) || (r->rule_flag & PFRULE_RETURNICMP) || (r->rule_flag & PFRULE_RETURN))) { - /* undo NAT changes, if they have taken place */ - if (nr != NULL) { - PF_ACPY(saddr, &sk->addr[pd->sidx], af); - PF_ACPY(daddr, &sk->addr[pd->didx], af); - if (pd->sport) - *pd->sport = sk->port[pd->sidx]; - if (pd->dport) - *pd->dport = sk->port[pd->didx]; - if (pd->proto_sum) - *pd->proto_sum = bproto_sum; - if (pd->ip_sum) - *pd->ip_sum = bip_sum; - m_copyback(m, off, hdrlen, pd->hdr.any); - } - if (pd->proto == IPPROTO_TCP && - ((r->rule_flag & PFRULE_RETURNRST) || - (r->rule_flag & PFRULE_RETURN)) && - !(th->th_flags & TH_RST)) { - u_int32_t ack = ntohl(th->th_seq) + pd->p_len; - int len = 0; -#ifdef INET - struct ip *h4; -#endif -#ifdef INET6 - struct ip6_hdr *h6; -#endif - - switch (af) { -#ifdef INET - case AF_INET: - h4 = mtod(m, struct ip *); - len = ntohs(h4->ip_len) - off; - break; -#endif -#ifdef INET6 - case AF_INET6: - h6 = mtod(m, struct ip6_hdr *); - len = ntohs(h6->ip6_plen) - (off - sizeof(*h6)); - break; -#endif - } - - if (pf_check_proto_cksum(m, off, len, IPPROTO_TCP, af)) - REASON_SET(&reason, PFRES_PROTCKSUM); - else { - if (th->th_flags & TH_SYN) - ack++; - if (th->th_flags & TH_FIN) - ack++; - pf_send_tcp(m, r, af, pd->dst, - pd->src, th->th_dport, th->th_sport, - ntohl(th->th_ack), ack, TH_RST|TH_ACK, 0, 0, - r->return_ttl, 1, 0, kif->pfik_ifp); - } - } else if (pd->proto != IPPROTO_ICMP && af == AF_INET && - r->return_icmp) - pf_send_icmp(m, r->return_icmp >> 8, - r->return_icmp & 255, af, r); - else if (pd->proto != IPPROTO_ICMPV6 && af == AF_INET6 && - r->return_icmp6) - pf_send_icmp(m, r->return_icmp6 >> 8, - r->return_icmp6 & 255, af, r); + pf_return(r, nr, pd, sk, off, m, th, kif, bproto_sum, + bip_sum, hdrlen, &reason); } if (r->action == PF_DROP) @@ -3543,8 +3558,11 @@ pf_test_rule(struct pf_rule **rm, struct pf_state **sm action = pf_create_state(r, nr, a, pd, nsn, nk, sk, m, off, sport, dport, &rewrite, kif, sm, tag, bproto_sum, bip_sum, hdrlen); - if (action != PF_PASS) + if (action != PF_PASS && r->rule_flag & PFRULE_RETURN) { + pf_return(r, nr, pd, sk, off, m, th, kif, + bproto_sum, bip_sum, hdrlen, &reason); return (action); + } } else { if (sk != NULL) uma_zfree(V_pf_state_key_z, sk); From owner-svn-src-all@freebsd.org Fri Jun 22 23:52:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E4C1004631; Fri, 22 Jun 2018 23:52:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB48890B2; Fri, 22 Jun 2018 23:52:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7CFEF279F2; Fri, 22 Jun 2018 23:52:22 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5MNqMRU084975; Fri, 22 Jun 2018 23:52:22 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5MNqKJg084967; Fri, 22 Jun 2018 23:52:20 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806222352.w5MNqKJg084967@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 Jun 2018 23:52:20 +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: r335570 - in stable/11/sys/amd64: amd64 include X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/amd64: amd64 include X-SVN-Commit-Revision: 335570 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.26 Precedence: list List-Id: "SVN commit messages 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, 22 Jun 2018 23:52:23 -0000 Author: kib Date: Fri Jun 22 23:52:20 2018 New Revision: 335570 URL: https://svnweb.freebsd.org/changeset/base/335570 Log: MFC r333059 (by tychon): Expand the checks for UCR3 == PMAP_NO_CR3 to enable processes to be excluded from PTI. Modified: stable/11/sys/amd64/amd64/cpu_switch.S stable/11/sys/amd64/amd64/exception.S stable/11/sys/amd64/amd64/genassym.c stable/11/sys/amd64/amd64/machdep.c stable/11/sys/amd64/amd64/mp_machdep.c stable/11/sys/amd64/amd64/pmap.c stable/11/sys/amd64/amd64/trap.c stable/11/sys/amd64/include/asmacros.h stable/11/sys/amd64/include/pcpu.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/amd64/cpu_switch.S ============================================================================== --- stable/11/sys/amd64/amd64/cpu_switch.S Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/cpu_switch.S Fri Jun 22 23:52:20 2018 (r335570) @@ -210,10 +210,13 @@ done_tss: movq %r8,PCPU(RSP0) movq %r8,PCPU(CURPCB) /* Update the TSS_RSP0 pointer for the next interrupt */ - cmpb $0,pti(%rip) - jne 1f - movq %r8,TSS_RSP0(%rdx) -1: movq %r12,PCPU(CURTHREAD) /* into next thread */ + cmpq $~0,PCPU(UCR3) + je 1f + movq PCPU(PTI_RSP0),%rax + movq %rax,TSS_RSP0(%rdx) + jmp 2f +1: movq %r8,TSS_RSP0(%rdx) +2: movq %r12,PCPU(CURTHREAD) /* into next thread */ /* Test if debug registers should be restored. */ testl $PCB_DBREGS,PCB_FLAGS(%r8) @@ -292,12 +295,7 @@ do_tss: movq %rdx,PCPU(TSSP) shrq $8,%rcx movl %ecx,8(%rax) movb $0x89,5(%rax) /* unset busy */ - cmpb $0,pti(%rip) - je 1f - movq PCPU(PRVSPACE),%rax - addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8,%rax - movq %rax,TSS_RSP0(%rdx) -1: movl $TSSSEL,%eax + movl $TSSSEL,%eax ltr %ax jmp done_tss Modified: stable/11/sys/amd64/amd64/exception.S ============================================================================== --- stable/11/sys/amd64/amd64/exception.S Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/exception.S Fri Jun 22 23:52:20 2018 (r335570) @@ -298,11 +298,15 @@ IDTVEC(page_pti) jz Xpage swapgs pushq %rax - pushq %rdx movq %cr3,%rax movq %rax,PCPU(SAVED_UCR3) + cmpq $~0,PCPU(UCR3) + jne 1f + popq %rax + jmp 2f +1: pushq %rdx PTI_UUENTRY has_err=1 - subq $TF_ERR,%rsp +2: subq $TF_ERR,%rsp movq %rdi,TF_RDI(%rsp) movq %rax,TF_RAX(%rsp) movq %rdx,TF_RDX(%rsp) @@ -347,9 +351,11 @@ page_cr2: */ .macro PROTF_ENTRY name,trapno \name\()_pti_doreti: + swapgs + cmpq $~0,PCPU(UCR3) + je 1f pushq %rax pushq %rdx - swapgs movq PCPU(KCR3),%rax movq %rax,%cr3 movq PCPU(RSP0),%rax @@ -362,7 +368,7 @@ page_cr2: movq %rax,%rsp popq %rdx popq %rax - swapgs +1: swapgs jmp X\name IDTVEC(\name\()_pti) cmpq $doreti_iret,PTI_RIP-2*8(%rsp) @@ -438,6 +444,8 @@ prot_addrf: IDTVEC(fast_syscall_pti) swapgs movq %rax,PCPU(SCRATCH_RAX) + cmpq $~0,PCPU(UCR3) + je fast_syscall_common movq PCPU(KCR3),%rax movq %rax,%cr3 jmp fast_syscall_common @@ -503,7 +511,7 @@ fast_syscall_common: movq TF_RFLAGS(%rsp),%r11 /* original %rflags */ movq TF_RIP(%rsp),%rcx /* original %rip */ movq TF_RSP(%rsp),%rsp /* user stack pointer */ - cmpb $0,pti + cmpq $~0,PCPU(UCR3) je 2f movq PCPU(UCR3),%r9 movq %r9,%cr3 @@ -1126,11 +1134,11 @@ ld_regs: jz 2f /* keep running with kernel GS.base */ cli call handle_ibrs_exit_rs - cmpb $0,pti + cmpq $~0,PCPU(UCR3) je 1f pushq %rdx - movq PCPU(PRVSPACE),%rdx - addq $PC_PTI_STACK+PC_PTI_STACK_SZ*8-PTI_SIZE,%rdx + movq PCPU(PTI_RSP0),%rdx + subq $PTI_SIZE,%rdx movq %rax,PTI_RAX(%rdx) popq %rax movq %rax,PTI_RDX(%rdx) Modified: stable/11/sys/amd64/amd64/genassym.c ============================================================================== --- stable/11/sys/amd64/amd64/genassym.c Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/genassym.c Fri Jun 22 23:52:20 2018 (r335570) @@ -229,6 +229,7 @@ ASSYM(PC_UCR3, offsetof(struct pcpu, pc_ucr3)); ASSYM(PC_SAVED_UCR3, offsetof(struct pcpu, pc_saved_ucr3)); ASSYM(PC_PTI_STACK, offsetof(struct pcpu, pc_pti_stack)); ASSYM(PC_PTI_STACK_SZ, PC_PTI_STACK_SZ); +ASSYM(PC_PTI_RSP0, offsetof(struct pcpu, pc_pti_rsp0)); ASSYM(PC_IBPB_SET, offsetof(struct pcpu, pc_ibpb_set)); ASSYM(LA_EOI, LAPIC_EOI * LAPIC_MEM_MUL); Modified: stable/11/sys/amd64/amd64/machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/machdep.c Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/machdep.c Fri Jun 22 23:52:20 2018 (r335570) @@ -1817,9 +1817,10 @@ hammer_time(u_int64_t modulep, u_int64_t physfree) rsp0 = (vm_offset_t)thread0.td_pcb; /* Ensure the stack is aligned to 16 bytes */ rsp0 &= ~0xFul; - common_tss[0].tss_rsp0 = pti ? ((vm_offset_t)PCPU_PTR(pti_stack) + - PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : rsp0; + common_tss[0].tss_rsp0 = rsp0; PCPU_SET(rsp0, rsp0); + PCPU_SET(pti_rsp0, ((vm_offset_t)PCPU_PTR(pti_stack) + + PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful); PCPU_SET(curpcb, thread0.td_pcb); /* transfer to user mode */ Modified: stable/11/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/11/sys/amd64/amd64/mp_machdep.c Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/mp_machdep.c Fri Jun 22 23:52:20 2018 (r335570) @@ -255,6 +255,8 @@ init_secondary(void) pc->pc_tssp = &common_tss[cpu]; pc->pc_commontssp = &common_tss[cpu]; pc->pc_rsp0 = 0; + pc->pc_pti_rsp0 = ((vm_offset_t)&pc->pc_pti_stack + + PC_PTI_STACK_SZ * sizeof(uint64_t) & ~0xful); pc->pc_tss = (struct system_segment_descriptor *)&gdt[NGDT * cpu + GPROC0_SEL]; pc->pc_fs32p = &gdt[NGDT * cpu + GUFS32_SEL]; @@ -264,8 +266,7 @@ init_secondary(void) pc->pc_curpmap = kernel_pmap; pc->pc_pcid_gen = 1; pc->pc_pcid_next = PMAP_PCID_KERN + 1; - common_tss[cpu].tss_rsp0 = pti ? ((vm_offset_t)&pc->pc_pti_stack + - PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful : 0; + common_tss[cpu].tss_rsp0 = 0; /* Save the per-cpu pointer for use by the NMI handler. */ np = ((struct nmi_pcpu *) &nmi_stack[PAGE_SIZE]) - 1; Modified: stable/11/sys/amd64/amd64/pmap.c ============================================================================== --- stable/11/sys/amd64/amd64/pmap.c Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/pmap.c Fri Jun 22 23:52:20 2018 (r335570) @@ -2560,8 +2560,10 @@ pmap_pinit0(pmap_t pmap) CPU_FOREACH(i) { pmap->pm_pcids[i].pm_pcid = PMAP_PCID_NONE; pmap->pm_pcids[i].pm_gen = 0; - if (!pti) + if (!pti) { __pcpu[i].pc_kcr3 = PMAP_NO_CR3; + __pcpu[i].pc_ucr3 = PMAP_NO_CR3; + } } PCPU_SET(curpmap, kernel_pmap); pmap_activate(curthread); @@ -2736,7 +2738,8 @@ _pmap_allocpte(pmap_t pmap, vm_pindex_t ptepindex, str * the kernel-mode page table active on return * to user space. */ - *pml4 |= pg_nx; + if (pmap->pm_ucr3 != PMAP_NO_CR3) + *pml4 |= pg_nx; pml4u = &pmap->pm_pml4u[pml4index]; *pml4u = VM_PAGE_TO_PHYS(m) | PG_U | PG_RW | PG_V | @@ -7337,9 +7340,10 @@ pmap_activate_sw(struct thread *td) { pmap_t oldpmap, pmap; struct invpcid_descr d; - uint64_t cached, cr3, kcr3, kern_pti_cached, ucr3; + uint64_t cached, cr3, kcr3, kern_pti_cached, rsp0, ucr3; register_t rflags; u_int cpuid; + struct amd64tss *tssp; oldpmap = PCPU_GET(curpmap); pmap = vmspace_pmap(td->td_proc->p_vmspace); @@ -7429,6 +7433,12 @@ pmap_activate_sw(struct thread *td) PCPU_SET(kcr3, pmap->pm_cr3); PCPU_SET(ucr3, pmap->pm_ucr3); } + } + if (pmap->pm_ucr3 != PMAP_NO_CR3) { + rsp0 = ((vm_offset_t)PCPU_PTR(pti_stack) + + PC_PTI_STACK_SZ * sizeof(uint64_t)) & ~0xful; + tssp = PCPU_GET(tssp); + tssp->tss_rsp0 = rsp0; } #ifdef SMP CPU_CLR_ATOMIC(cpuid, &oldpmap->pm_active); Modified: stable/11/sys/amd64/amd64/trap.c ============================================================================== --- stable/11/sys/amd64/amd64/trap.c Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/amd64/trap.c Fri Jun 22 23:52:20 2018 (r335570) @@ -463,11 +463,13 @@ trap(struct trapframe *frame) */ if (frame->tf_rip == (long)doreti_iret) { frame->tf_rip = (long)doreti_iret_fault; - if (pti && frame->tf_rsp == (uintptr_t)PCPU_PTR( - pti_stack) + (PC_PTI_STACK_SZ - 5) * - sizeof(register_t)) + if ((PCPU_GET(curpmap)->pm_ucr3 != + PMAP_NO_CR3) && + (frame->tf_rsp == (uintptr_t)PCPU_GET( + pti_rsp0) - 5 * sizeof(register_t))) { frame->tf_rsp = PCPU_GET(rsp0) - 5 * sizeof(register_t); + } return; } if (frame->tf_rip == (long)ld_ds) { Modified: stable/11/sys/amd64/include/asmacros.h ============================================================================== --- stable/11/sys/amd64/include/asmacros.h Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/include/asmacros.h Fri Jun 22 23:52:20 2018 (r335570) @@ -194,9 +194,12 @@ .macro PTI_UENTRY has_err swapgs + cmpq $~0,PCPU(UCR3) + je 1f pushq %rax pushq %rdx PTI_UUENTRY \has_err +1: .endm .macro PTI_ENTRY name, cont, has_err=0 Modified: stable/11/sys/amd64/include/pcpu.h ============================================================================== --- stable/11/sys/amd64/include/pcpu.h Fri Jun 22 21:59:30 2018 (r335569) +++ stable/11/sys/amd64/include/pcpu.h Fri Jun 22 23:52:20 2018 (r335570) @@ -67,13 +67,14 @@ u_int pc_cmci_mask; /* MCx banks for CMCI */ \ uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ uint64_t pc_pti_stack[PC_PTI_STACK_SZ]; \ + register_t pc_pti_rsp0; \ int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ u_int pc_vcpu_id; /* Xen vCPU ID */ \ uint32_t pc_pcid_next; \ uint32_t pc_pcid_gen; \ uint32_t pc_smp_tlb_done; /* TLB op acknowledgement */ \ uint32_t pc_ibpb_set; \ - char __pad[96] /* be divisor of PAGE_SIZE \ + char __pad[88] /* be divisor of PAGE_SIZE \ after cache alignment */ #define PC_DBREG_CMD_NONE 0 From owner-svn-src-all@freebsd.org Sat Jun 23 00:37:16 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4471005C7C; Sat, 23 Jun 2018 00:37:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2FD5A8AD2A; Sat, 23 Jun 2018 00:37:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 10EB51B3; Sat, 23 Jun 2018 00:37:16 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N0bFwA007249; Sat, 23 Jun 2018 00:37:15 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N0bFpA007248; Sat, 23 Jun 2018 00:37:15 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806230037.w5N0bFpA007248@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 23 Jun 2018 00:37:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335571 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 335571 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 00:37:16 -0000 Author: rmacklem Date: Sat Jun 23 00:37:15 2018 New Revision: 335571 URL: https://svnweb.freebsd.org/changeset/base/335571 Log: Define ND_HASSLOTID needed by r335568. r335568 uses a flag called ND_HASSLOTID to indicate that the slotid is set, so it can free and invalidate it. This flag needs to be set, which will be done in a subsequent commit. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs.h Modified: head/sys/fs/nfs/nfs.h ============================================================================== --- head/sys/fs/nfs/nfs.h Fri Jun 22 23:52:20 2018 (r335570) +++ head/sys/fs/nfs/nfs.h Sat Jun 23 00:37:15 2018 (r335571) @@ -681,6 +681,7 @@ struct nfsrv_descript { #define ND_DSSERVER 0x40000000 #define ND_CURSTATEID 0x80000000 #define ND_SAVEDCURSTATEID 0x100000000 +#define ND_HASSLOTID 0x200000000 /* * ND_GSS should be the "or" of all GSS type authentications. From owner-svn-src-all@freebsd.org Sat Jun 23 00:38:45 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F071005D4A; Sat, 23 Jun 2018 00:38:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D6278AE94; Sat, 23 Jun 2018 00:38:45 +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 15D2C1B5; Sat, 23 Jun 2018 00:38:45 +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 w5N0ciac007358; Sat, 23 Jun 2018 00:38:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N0ciZq007357; Sat, 23 Jun 2018 00:38:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201806230038.w5N0ciZq007357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 Jun 2018 00:38: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: r335572 - stable/11/lib/libthr/support X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libthr/support X-SVN-Commit-Revision: 335572 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 00:38:45 -0000 Author: kib Date: Sat Jun 23 00:38:44 2018 New Revision: 335572 URL: https://svnweb.freebsd.org/changeset/base/335572 Log: MFC r335258: Remove unused file. Deleted: stable/11/lib/libthr/support/ Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-all@freebsd.org Sat Jun 23 00:48:46 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 196041006134; Sat, 23 Jun 2018 00:48:46 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5EA18B2C1; Sat, 23 Jun 2018 00:48:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B7C134D; Sat, 23 Jun 2018 00:48:45 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N0mjO1012449; Sat, 23 Jun 2018 00:48:45 GMT (envelope-from rmacklem@FreeBSD.org) Received: (from rmacklem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N0mjRu012448; Sat, 23 Jun 2018 00:48:45 GMT (envelope-from rmacklem@FreeBSD.org) Message-Id: <201806230048.w5N0mjRu012448@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rmacklem set sender to rmacklem@FreeBSD.org using -f From: Rick Macklem Date: Sat, 23 Jun 2018 00:48:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335573 - head/sys/fs/nfs X-SVN-Group: head X-SVN-Commit-Author: rmacklem X-SVN-Commit-Paths: head/sys/fs/nfs X-SVN-Commit-Revision: 335573 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 00:48:46 -0000 Author: rmacklem Date: Sat Jun 23 00:48:45 2018 New Revision: 335573 URL: https://svnweb.freebsd.org/changeset/base/335573 Log: Set the slotid and ND_HASSLOTID flag for NFSv4.1 sequenced operations. Most NFSv4.1 compound RPCs start with a Sequence operation. For these cases, save the slotid and note that it is saved by setting ND_HASSLOTID. This is used by r335568 to free up the session slot and disable it. MFC after: 2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c Modified: head/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- head/sys/fs/nfs/nfs_commonsubs.c Sat Jun 23 00:38:44 2018 (r335572) +++ head/sys/fs/nfs/nfs_commonsubs.c Sat Jun 23 00:48:45 2018 (r335573) @@ -4587,6 +4587,8 @@ nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_d tl += NFSX_V4SESSIONID / NFSX_UNSIGNED; nd->nd_slotseq = tl; if (error == 0) { + nd->nd_flag |= ND_HASSLOTID; + nd->nd_slotid = slotpos; *tl++ = txdr_unsigned(slotseq); *tl++ = txdr_unsigned(slotpos); *tl++ = txdr_unsigned(maxslot); From owner-svn-src-all@freebsd.org Sat Jun 23 01:42:35 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C08B10092FF; Sat, 23 Jun 2018 01:42:35 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 06FB98CEB9; Sat, 23 Jun 2018 01:42:35 +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 DC60BD46; Sat, 23 Jun 2018 01:42:34 +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 w5N1gYjM042636; Sat, 23 Jun 2018 01:42:34 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N1gY4U042635; Sat, 23 Jun 2018 01:42:34 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201806230142.w5N1gY4U042635@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Sat, 23 Jun 2018 01:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335574 - head/sys/powerpc/aim X-SVN-Group: head X-SVN-Commit-Author: jhibbits X-SVN-Commit-Paths: head/sys/powerpc/aim X-SVN-Commit-Revision: 335574 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 01:42:35 -0000 Author: jhibbits Date: Sat Jun 23 01:42:34 2018 New Revision: 335574 URL: https://svnweb.freebsd.org/changeset/base/335574 Log: powerpc64: Fix stack setup in dbtrap r330610 relocated the DMAP from the base of memory to the base of the fourth quadrant of memory. This broke synthetic traps, such as KDB forced breakpoints. Use GET_TOCBASE() so the DMAP offset is handled. Submitted by: git_bdragon.rkt0.net Differential Revision: https://reviews.freebsd.org/D15973 Modified: head/sys/powerpc/aim/trap_subr64.S Modified: head/sys/powerpc/aim/trap_subr64.S ============================================================================== --- head/sys/powerpc/aim/trap_subr64.S Sat Jun 23 00:48:45 2018 (r335573) +++ head/sys/powerpc/aim/trap_subr64.S Sat Jun 23 01:42:34 2018 (r335574) @@ -896,7 +896,7 @@ dbtrap: andi. %r1,%r1,0xff00 mtsprg3 %r1 - ld %r1,TRAP_TOCBASE(0) /* get new SP */ + GET_TOCBASE(%r1) /* get new SP */ ld %r1,TOC_REF(tmpstk)(%r1) addi %r1,%r1,(TMPSTKSZ-48) From owner-svn-src-all@freebsd.org Sat Jun 23 02:17:11 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A576E100AE18 for ; Sat, 23 Jun 2018 02:17:11 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DC848E322 for ; Sat, 23 Jun 2018 02:17:11 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: from mail-yb0-f173.google.com (mail-yb0-f173.google.com [209.85.213.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) (Authenticated sender: eadler) by smtp.freebsd.org (Postfix) with ESMTPSA id A971414D08 for ; Sat, 23 Jun 2018 02:17:10 +0000 (UTC) (envelope-from eadler@freebsd.org) Received: by mail-yb0-f173.google.com with SMTP id n23-v6so3235877ybg.1 for ; Fri, 22 Jun 2018 19:17:10 -0700 (PDT) X-Gm-Message-State: APt69E2+bYGkwB84d+tZZpv7LbkdT78PvSf0sqPB1Ri+DJIq0PnQ48be b5hnN1qMmRBAOWpmwq5x+RHP1rtVCvXCs+ivezC1Hw== X-Google-Smtp-Source: ADUXVKLomeByZs6X2KiWpB5nd1AbDcwxZxvsKbFyfVP3j0h5D8xrbUxxDJlVxDd5FGQsTVfonwkKzUpyF4i4KCIzG4k= X-Received: by 2002:a25:9b09:: with SMTP id y9-v6mr2105427ybn.194.1529720230079; Fri, 22 Jun 2018 19:17:10 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:ef50:0:0:0:0:0 with HTTP; Fri, 22 Jun 2018 19:16:39 -0700 (PDT) In-Reply-To: <20180622110238.v7gwug4hebuclwb6@ivaldir.net> References: <201806220921.w5M9L21k031794@repo.freebsd.org> <20180622110238.v7gwug4hebuclwb6@ivaldir.net> From: Eitan Adler Date: Fri, 22 Jun 2018 19:16:39 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r335539 - head/usr.bin/top To: Baptiste Daroussin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 02:17:11 -0000 On 22 June 2018 at 04:02, Baptiste Daroussin wrote: > wouldn't it be better with a sbuf_clear here? > > if != null: clear else new_auto I did that originally and undid that for reasons I can't remember. Will try it again, if it works, its more correct. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-all@freebsd.org Sat Jun 23 02:42:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05D88100C2E1; Sat, 23 Jun 2018 02:42:09 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A74868F2A7; Sat, 23 Jun 2018 02:42:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 88B2C17EC; Sat, 23 Jun 2018 02:42:08 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N2g83K073036; Sat, 23 Jun 2018 02:42:08 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N2g8S3073035; Sat, 23 Jun 2018 02:42:08 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806230242.w5N2g8S3073035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 Jun 2018 02:42:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335575 - head/etc/rc.d X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/etc/rc.d X-SVN-Commit-Revision: 335575 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 02:42:09 -0000 Author: ian Date: Sat Jun 23 02:42:08 2018 New Revision: 335575 URL: https://svnweb.freebsd.org/changeset/base/335575 Log: Use 'mv -f' in rc.d/ntpd to avoid spuriously halting the boot. The final 'mv' to install a fetched leap-list file can fail (due to a readonly fs, or schg flags, for example), and that leads to mv(1) prompting the user, stopping the boot process. Instead, use mv -f to supress the prompting, and if verbose mode is on, emit a warning that the existing file cannot be replaced. PR: 219255 Modified: head/etc/rc.d/ntpd Modified: head/etc/rc.d/ntpd ============================================================================== --- head/etc/rc.d/ntpd Sat Jun 23 01:42:34 2018 (r335574) +++ head/etc/rc.d/ntpd Sat Jun 23 02:42:08 2018 (r335575) @@ -148,7 +148,8 @@ ntpd_fetch_leapfile() { "$ntp_expiry_tmp" -eq "$ntp_expiry_db" -a \ "$ntp_ver_no_tmp" -gt "$ntp_ver_no_db" ]; then $verbose using $url as $ntp_db_leapfile - mv $ntp_tmp_leapfile $ntp_db_leapfile + mv -f $ntp_tmp_leapfile $ntp_db_leapfile || + $verbose "warning: cannot replace $ntp_db_leapfile (read-only fs?)" else $verbose using existing $ntp_db_leapfile fi From owner-svn-src-all@freebsd.org Sat Jun 23 03:17:12 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B681E100DDC7; Sat, 23 Jun 2018 03:17:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C428D7083C; Sat, 23 Jun 2018 03:17:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A23BB1DB1; Sat, 23 Jun 2018 03:17:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N3HBms089406; Sat, 23 Jun 2018 03:17:11 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N3HBQX089405; Sat, 23 Jun 2018 03:17:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806230317.w5N3HBQX089405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Jun 2018 03:17:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335576 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335576 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 03:17:12 -0000 Author: eadler Date: Sat Jun 23 03:17:11 2018 New Revision: 335576 URL: https://svnweb.freebsd.org/changeset/base/335576 Log: top(1): show CPU state breakdown on first run There is no documented reason for this not to be shown on the first run. I can't find any good reason, and it breaks batch mode. PR: 218889 Submitted by: "Jeremy C. Reed" Modified: head/usr.bin/top/top.c Modified: head/usr.bin/top/top.c ============================================================================== --- head/usr.bin/top/top.c Sat Jun 23 02:42:08 2018 (r335575) +++ head/usr.bin/top/top.c Sat Jun 23 03:17:11 2018 (r335576) @@ -243,7 +243,6 @@ main(int argc, char *argv[]) int preset_argc = 0; const char **av = NULL; int ac = -1; - bool dostates = false; bool do_unames = true; char interactive = 2; char warnings = 0; @@ -641,25 +640,7 @@ restart: /* display process state breakdown */ (*d_procstates)(system_info.p_total, system_info.procstates); - - /* display the cpu state percentage breakdown */ - if (dostates) /* but not the first time */ - { - (*d_cpustates)(system_info.cpustates); - } - else - { - /* we'll do it next time */ - if (smart_terminal) - { - z_cpustates(); - } - else - { - putchar('\n'); - } - dostates = true; - } + (*d_cpustates)(system_info.cpustates); /* display memory stats */ (*d_memory)(system_info.memory); From owner-svn-src-all@freebsd.org Sat Jun 23 06:53:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 096561015953; Sat, 23 Jun 2018 06:53:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB7777557; Sat, 23 Jun 2018 06:53:54 +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 763A546BA; Sat, 23 Jun 2018 06:53:54 +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 w5N6rs7V000933; Sat, 23 Jun 2018 06:53:54 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N6rrP7000929; Sat, 23 Jun 2018 06:53:53 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201806230653.w5N6rrP7000929@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Sat, 23 Jun 2018 06:53:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335577 - in head/sys/netinet: . tcp_stacks X-SVN-Group: head X-SVN-Commit-Author: glebius X-SVN-Commit-Paths: in head/sys/netinet: . tcp_stacks X-SVN-Commit-Revision: 335577 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 06:53:55 -0000 Author: glebius Date: Sat Jun 23 06:53:53 2018 New Revision: 335577 URL: https://svnweb.freebsd.org/changeset/base/335577 Log: Revert r334843, and partially revert r335180. tcp_outflags[] were defined since 4BSD and are defined nowadays in all its descendants. Removing them breaks third party application. Modified: head/sys/netinet/tcp_fsm.h head/sys/netinet/tcp_offload.c head/sys/netinet/tcp_output.c head/sys/netinet/tcp_stacks/rack.c Modified: head/sys/netinet/tcp_fsm.h ============================================================================== --- head/sys/netinet/tcp_fsm.h Sat Jun 23 03:17:11 2018 (r335576) +++ head/sys/netinet/tcp_fsm.h Sat Jun 23 06:53:53 2018 (r335577) @@ -78,8 +78,27 @@ #define TCPS_HAVERCVDFIN(s) \ ((s) == TCPS_CLOSE_WAIT || ((s) >= TCPS_CLOSING && (s) != TCPS_FIN_WAIT_2)) - -extern u_char tcp_outflags[TCP_NSTATES]; +#ifdef TCPOUTFLAGS +/* + * Flags used when sending segments in tcp_output. Basic flags (TH_RST, + * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso + * that TH_FIN is sent only if all data queued for output is included in the + * segment. + */ +static u_char tcp_outflags[TCP_NSTATES] = { + TH_RST|TH_ACK, /* 0, CLOSED */ + 0, /* 1, LISTEN */ + TH_SYN, /* 2, SYN_SENT */ + TH_SYN|TH_ACK, /* 3, SYN_RECEIVED */ + TH_ACK, /* 4, ESTABLISHED */ + TH_ACK, /* 5, CLOSE_WAIT */ + TH_FIN|TH_ACK, /* 6, FIN_WAIT_1 */ + TH_FIN|TH_ACK, /* 7, CLOSING */ + TH_FIN|TH_ACK, /* 8, LAST_ACK */ + TH_ACK, /* 9, FIN_WAIT_2 */ + TH_ACK, /* 10, TIME_WAIT */ +}; +#endif #ifdef KPROF int tcp_acounts[TCP_NSTATES][PRU_NREQ]; Modified: head/sys/netinet/tcp_offload.c ============================================================================== --- head/sys/netinet/tcp_offload.c Sat Jun 23 03:17:11 2018 (r335576) +++ head/sys/netinet/tcp_offload.c Sat Jun 23 06:53:53 2018 (r335577) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define TCPOUTFLAGS #include #include #include Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sat Jun 23 03:17:11 2018 (r335576) +++ head/sys/netinet/tcp_output.c Sat Jun 23 06:53:53 2018 (r335577) @@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$"); #include #endif #include +#define TCPOUTFLAGS #include #include #include @@ -166,26 +167,6 @@ hhook_run_tcp_est_out(struct tcpcb *tp, struct tcphdr } } #endif - -/* - * Flags used when sending segments in tcp_output. Basic flags (TH_RST, - * TH_ACK,TH_SYN,TH_FIN) are totally determined by state, with the proviso - * that TH_FIN is sent only if all data queued for output is included in the - * segment. - */ -u_char tcp_outflags[TCP_NSTATES] = { - TH_RST|TH_ACK, /* 0, CLOSED */ - 0, /* 1, LISTEN */ - TH_SYN, /* 2, SYN_SENT */ - TH_SYN|TH_ACK, /* 3, SYN_RECEIVED */ - TH_ACK, /* 4, ESTABLISHED */ - TH_ACK, /* 5, CLOSE_WAIT */ - TH_FIN|TH_ACK, /* 6, FIN_WAIT_1 */ - TH_FIN|TH_ACK, /* 7, CLOSING */ - TH_FIN|TH_ACK, /* 8, LAST_ACK */ - TH_ACK, /* 9, FIN_WAIT_2 */ - TH_ACK, /* 10, TIME_WAIT */ -}; /* * CC wrapper hook functions Modified: head/sys/netinet/tcp_stacks/rack.c ============================================================================== --- head/sys/netinet/tcp_stacks/rack.c Sat Jun 23 03:17:11 2018 (r335576) +++ head/sys/netinet/tcp_stacks/rack.c Sat Jun 23 06:53:53 2018 (r335577) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#define TCPOUTFLAGS #include #include #include From owner-svn-src-all@freebsd.org Sat Jun 23 07:14:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B6AF1015F4F; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2808A77D20; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0394C49ED; Sat, 23 Jun 2018 07:14:09 +0000 (UTC) (envelope-from mmacy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N7E8jD011034; Sat, 23 Jun 2018 07:14:08 GMT (envelope-from mmacy@FreeBSD.org) Received: (from mmacy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N7E8NO011033; Sat, 23 Jun 2018 07:14:08 GMT (envelope-from mmacy@FreeBSD.org) Message-Id: <201806230714.w5N7E8NO011033@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmacy set sender to mmacy@FreeBSD.org using -f From: Matt Macy Date: Sat, 23 Jun 2018 07:14:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335578 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: mmacy X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 335578 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 07:14:09 -0000 Author: mmacy Date: Sat Jun 23 07:14:08 2018 New Revision: 335578 URL: https://svnweb.freebsd.org/changeset/base/335578 Log: epoch(9): Don't trigger taskq enqueue before the grouptaskqs are setup If EARLY_AP_STARTUP is not defined it is possible for an epoch to be allocated prior to it being possible to call epoch_call without issue. Based on patch by andrew@ PR: 229014 Reported by: andrew Modified: head/sys/kern/subr_epoch.c Modified: head/sys/kern/subr_epoch.c ============================================================================== --- head/sys/kern/subr_epoch.c Sat Jun 23 06:53:53 2018 (r335577) +++ head/sys/kern/subr_epoch.c Sat Jun 23 07:14:08 2018 (r335578) @@ -176,10 +176,19 @@ done: global_epoch = epoch_alloc(0); global_epoch_preempt = epoch_alloc(EPOCH_PREEMPT); } - SYSINIT(epoch, SI_SUB_TASKQ + 1, SI_ORDER_FIRST, epoch_init, NULL); +#if !defined(EARLY_AP_STARTUP) static void +epoch_init_smp(void *dummy __unused) +{ + inited = 2; +} +SYSINIT(epoch_smp, SI_SUB_SMP + 1, SI_ORDER_FIRST, epoch_init_smp, NULL); +#endif + + +static void epoch_init_numa(epoch_t epoch) { int domain, cpu_offset; @@ -570,6 +579,10 @@ epoch_call(epoch_t epoch, epoch_context_t ctx, void (* /* too early in boot to have epoch set up */ if (__predict_false(epoch == NULL)) goto boottime; +#if !defined(EARLY_AP_STARTUP) + if (__predict_false(inited < 2)) + goto boottime; +#endif critical_enter(); *DPCPU_PTR(epoch_cb_count) += 1; From owner-svn-src-all@freebsd.org Sat Jun 23 08:10:10 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B539310171DD; Sat, 23 Jun 2018 08:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 602597951F; Sat, 23 Jun 2018 08:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E3A951ED; Sat, 23 Jun 2018 08:10:10 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5N8AApp037441; Sat, 23 Jun 2018 08:10:10 GMT (envelope-from jeff@FreeBSD.org) Received: (from jeff@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5N8AAr2037440; Sat, 23 Jun 2018 08:10:10 GMT (envelope-from jeff@FreeBSD.org) Message-Id: <201806230810.w5N8AAr2037440@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jeff set sender to jeff@FreeBSD.org using -f From: Jeff Roberson Date: Sat, 23 Jun 2018 08:10:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335579 - head/sys/vm X-SVN-Group: head X-SVN-Commit-Author: jeff X-SVN-Commit-Paths: head/sys/vm X-SVN-Commit-Revision: 335579 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 08:10:10 -0000 Author: jeff Date: Sat Jun 23 08:10:09 2018 New Revision: 335579 URL: https://svnweb.freebsd.org/changeset/base/335579 Log: Sort uma_zone fields according to 64 byte cache line with adjacent line prefetch on 64bit architectures. Prior to this, two lines were needed for the fast path and each line may fetch an unused adjacent neighbor. - Move fields used by the fast path into a single line. - Move constants into the adjacent line which is mostly used for the spare bucket alloc 'medium path'. - Unpad the mtx which is only used by the fast path and place it in a line with rarely used data. This aligns the cachelines better and eliminates 128 bytes of wasted space. This gives a 45% improvement on a will-it-scale test on a 24 core machine. Reviewed by: mmacy Modified: head/sys/vm/uma_int.h Modified: head/sys/vm/uma_int.h ============================================================================== --- head/sys/vm/uma_int.h Sat Jun 23 07:14:08 2018 (r335578) +++ head/sys/vm/uma_int.h Sat Jun 23 08:10:09 2018 (r335579) @@ -222,9 +222,8 @@ typedef struct uma_domain * uma_domain_t; * */ struct uma_keg { - struct mtx_padalign uk_lock; /* Lock for the keg */ + struct mtx uk_lock; /* Lock for the keg */ struct uma_hash uk_hash; - LIST_HEAD(,uma_zone) uk_zones; /* Keg's zones */ uint32_t uk_cursor; /* Domain alloc cursor. */ @@ -315,40 +314,48 @@ typedef struct uma_zone_domain * uma_zone_domain_t; * */ struct uma_zone { - struct mtx_padalign uz_lock; /* Lock for the zone */ - struct mtx_padalign *uz_lockptr; - const char *uz_name; /* Text name of the zone */ - - LIST_ENTRY(uma_zone) uz_link; /* List of all zones in keg */ + /* Offset 0, used in alloc/free fast/medium fast path and const. */ + struct mtx *uz_lockptr; + const char *uz_name; /* Text name of the zone */ struct uma_zone_domain *uz_domain; /* per-domain buckets */ - - LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */ - struct uma_klink uz_klink; /* klink for first keg. */ - - uma_slaballoc uz_slab; /* Allocate a slab from the backend. */ + uint32_t uz_flags; /* Flags inherited from kegs */ + uint32_t uz_size; /* Size inherited from kegs */ uma_ctor uz_ctor; /* Constructor for each allocation */ uma_dtor uz_dtor; /* Destructor */ uma_init uz_init; /* Initializer for each item */ uma_fini uz_fini; /* Finalizer for each item. */ + + /* Offset 64, used in bucket replenish. */ uma_import uz_import; /* Import new memory to cache. */ uma_release uz_release; /* Release memory from cache. */ void *uz_arg; /* Import/release argument. */ - - uint32_t uz_flags; /* Flags inherited from kegs */ - uint32_t uz_size; /* Size inherited from kegs */ - - volatile u_long uz_allocs UMA_ALIGN; /* Total number of allocations */ - volatile u_long uz_fails; /* Total number of alloc failures */ - volatile u_long uz_frees; /* Total number of frees */ - uint64_t uz_sleeps; /* Total number of alloc sleeps */ + uma_slaballoc uz_slab; /* Allocate a slab from the backend. */ uint16_t uz_count; /* Amount of items in full bucket */ uint16_t uz_count_min; /* Minimal amount of items there */ + /* 32bit pad on 64bit. */ + LIST_ENTRY(uma_zone) uz_link; /* List of all zones in keg */ + LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */ + /* Offset 128 Rare. */ + /* + * The lock is placed here to avoid adjacent line prefetcher + * in fast paths and to take up space near infrequently accessed + * members to reduce alignment overhead. + */ + struct mtx uz_lock; /* Lock for the zone */ + struct uma_klink uz_klink; /* klink for first keg. */ /* The next two fields are used to print a rate-limited warnings. */ const char *uz_warning; /* Warning to print on failure */ struct timeval uz_ratecheck; /* Warnings rate-limiting */ - struct task uz_maxaction; /* Task to run when at limit */ + + /* 16 bytes of pad. */ + + /* Offset 256, atomic stats. */ + volatile u_long uz_allocs UMA_ALIGN; /* Total number of allocations */ + volatile u_long uz_fails; /* Total number of alloc failures */ + volatile u_long uz_frees; /* Total number of frees */ + uint64_t uz_sleeps; /* Total number of alloc sleeps */ /* * This HAS to be the last item because we adjust the zone size From owner-svn-src-all@freebsd.org Sat Jun 23 09:10:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A3461018B6C for ; Sat, 23 Jun 2018 09:10:48 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8E737ADEC for ; Sat, 23 Jun 2018 09:10:47 +0000 (UTC) (envelope-from jroberson@jroberson.net) Received: by mail-pf0-x22f.google.com with SMTP id c22-v6so4288087pfi.2 for ; Sat, 23 Jun 2018 02:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jroberson-net.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=UgZpLhkgSVowC84/7kIySMPKwKtYbcRXcA/Kn8aRiWM=; b=EVaj7WgvNA9oOPXewhWPJRIuXNuWkDewcDrctOn4eDjvpaJgCeeJjBr66YHkzDVpbC tZjS+xJ7eZhSXJ6afvTJhtA0TY6/C8QwYm8pvpxG/Q+rpPgJpxNg2dIuvrRGVl3/S0Qb t7R/jIFvmbl0TBuDI2Vw8NZ13zpRvB02VUPoLbH5c+A6iv4hnthHgCULIYft3ZD99HQM AgwMxbKbPXEOYwcSRGs2rTJN8EPUl04jftbFTzYz5cjFsKpibLSf4+z54I0p1FZn7wiE pfEvlUwt1Wu/qSj8FZm7ynn771U1vCTdh3THQkCHr7klOqAMiA1rob+vMGGRyJX2TT6G 8iNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=UgZpLhkgSVowC84/7kIySMPKwKtYbcRXcA/Kn8aRiWM=; b=unQFkXb7YoNE7q6wxplgMlELNyKAL4jDP4CHZfmaSDI5nKVtxQ5ad0fkGTHVdTqf2q vQeLTZbzeyLWrdyWQhTcbJOVshY+4qyhthalMtytq+15wtkMcXd1rHrVfPN90yCxjeqk md3nx/Uce4D9fROxmLRIblNbVwF2v74wANf+pg0rEpe9woa7J8ajM9rzKUuuZQ34a7D6 chQ/y6yLlehXV35ZkCNU+gCZ7N4vOkztRVpcIN4vEE4j979fg1HPHoMS/1PWUcBWfRoc NaoxXJ9cPqJCNVFUkODD4XPQ41/Vnf6SYyS++TqJ064LEXSn4w77Ss3322ix/nt7KkAl RFOw== X-Gm-Message-State: APt69E106wuWNyV1eDM3NYAA7cC20BP93LznpxHmdJptCgOASGLED638 zHxrUoJU5XkHSumEVNY4tl/xrg== X-Google-Smtp-Source: ADUXVKKIzVylAYhkfb24zpuPO9Fa6Fdg7C6x1YgjEtluq7xb+0En/Jwptpy2IdGx9hwKzLfyzocyfA== X-Received: by 2002:aa7:864d:: with SMTP id a13-v6mr5023727pfo.247.1529745046334; Sat, 23 Jun 2018 02:10:46 -0700 (PDT) Received: from rrcs-66-91-135-210.west.biz.rr.com (rrcs-66-91-135-210.west.biz.rr.com. [66.91.135.210]) by smtp.gmail.com with ESMTPSA id b4-v6sm12996802pgq.51.2018.06.23.02.10.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Jun 2018 02:10:45 -0700 (PDT) Date: Fri, 22 Jun 2018 23:08:28 -1000 (HST) From: Jeff Roberson X-X-Sender: jroberson@desktop To: Jeff Roberson cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335579 - head/sys/vm In-Reply-To: <201806230810.w5N8AAr2037440@repo.freebsd.org> Message-ID: References: <201806230810.w5N8AAr2037440@repo.freebsd.org> User-Agent: Alpine 2.21.999 (BSF 260 2018-02-26) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 09:10:48 -0000 On Sat, 23 Jun 2018, Jeff Roberson wrote: > Author: jeff > Date: Sat Jun 23 08:10:09 2018 > New Revision: 335579 > URL: https://svnweb.freebsd.org/changeset/base/335579 > > Log: > Sort uma_zone fields according to 64 byte cache line with adjacent line > prefetch on 64bit architectures. Prior to this, two lines were needed > for the fast path and each line may fetch an unused adjacent neighbor. > - Move fields used by the fast path into a single line. > - Move constants into the adjacent line which is mostly used for > the spare bucket alloc 'medium path'. > - Unpad the mtx which is only used by the fast path and place it in I got a little overexcited about fast. The mtx is only used by the slow path. Jeff > a line with rarely used data. This aligns the cachelines better and > eliminates 128 bytes of wasted space. > > This gives a 45% improvement on a will-it-scale test on a 24 core machine. > > Reviewed by: mmacy > > Modified: > head/sys/vm/uma_int.h > > Modified: head/sys/vm/uma_int.h > ============================================================================== > --- head/sys/vm/uma_int.h Sat Jun 23 07:14:08 2018 (r335578) > +++ head/sys/vm/uma_int.h Sat Jun 23 08:10:09 2018 (r335579) > @@ -222,9 +222,8 @@ typedef struct uma_domain * uma_domain_t; > * > */ > struct uma_keg { > - struct mtx_padalign uk_lock; /* Lock for the keg */ > + struct mtx uk_lock; /* Lock for the keg */ > struct uma_hash uk_hash; > - > LIST_HEAD(,uma_zone) uk_zones; /* Keg's zones */ > > uint32_t uk_cursor; /* Domain alloc cursor. */ > @@ -315,40 +314,48 @@ typedef struct uma_zone_domain * uma_zone_domain_t; > * > */ > struct uma_zone { > - struct mtx_padalign uz_lock; /* Lock for the zone */ > - struct mtx_padalign *uz_lockptr; > - const char *uz_name; /* Text name of the zone */ > - > - LIST_ENTRY(uma_zone) uz_link; /* List of all zones in keg */ > + /* Offset 0, used in alloc/free fast/medium fast path and const. */ > + struct mtx *uz_lockptr; > + const char *uz_name; /* Text name of the zone */ > struct uma_zone_domain *uz_domain; /* per-domain buckets */ > - > - LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */ > - struct uma_klink uz_klink; /* klink for first keg. */ > - > - uma_slaballoc uz_slab; /* Allocate a slab from the backend. */ > + uint32_t uz_flags; /* Flags inherited from kegs */ > + uint32_t uz_size; /* Size inherited from kegs */ > uma_ctor uz_ctor; /* Constructor for each allocation */ > uma_dtor uz_dtor; /* Destructor */ > uma_init uz_init; /* Initializer for each item */ > uma_fini uz_fini; /* Finalizer for each item. */ > + > + /* Offset 64, used in bucket replenish. */ > uma_import uz_import; /* Import new memory to cache. */ > uma_release uz_release; /* Release memory from cache. */ > void *uz_arg; /* Import/release argument. */ > - > - uint32_t uz_flags; /* Flags inherited from kegs */ > - uint32_t uz_size; /* Size inherited from kegs */ > - > - volatile u_long uz_allocs UMA_ALIGN; /* Total number of allocations */ > - volatile u_long uz_fails; /* Total number of alloc failures */ > - volatile u_long uz_frees; /* Total number of frees */ > - uint64_t uz_sleeps; /* Total number of alloc sleeps */ > + uma_slaballoc uz_slab; /* Allocate a slab from the backend. */ > uint16_t uz_count; /* Amount of items in full bucket */ > uint16_t uz_count_min; /* Minimal amount of items there */ > + /* 32bit pad on 64bit. */ > + LIST_ENTRY(uma_zone) uz_link; /* List of all zones in keg */ > + LIST_HEAD(,uma_klink) uz_kegs; /* List of kegs. */ > > + /* Offset 128 Rare. */ > + /* > + * The lock is placed here to avoid adjacent line prefetcher > + * in fast paths and to take up space near infrequently accessed > + * members to reduce alignment overhead. > + */ > + struct mtx uz_lock; /* Lock for the zone */ > + struct uma_klink uz_klink; /* klink for first keg. */ > /* The next two fields are used to print a rate-limited warnings. */ > const char *uz_warning; /* Warning to print on failure */ > struct timeval uz_ratecheck; /* Warnings rate-limiting */ > - > struct task uz_maxaction; /* Task to run when at limit */ > + > + /* 16 bytes of pad. */ > + > + /* Offset 256, atomic stats. */ > + volatile u_long uz_allocs UMA_ALIGN; /* Total number of allocations */ > + volatile u_long uz_fails; /* Total number of alloc failures */ > + volatile u_long uz_frees; /* Total number of frees */ > + uint64_t uz_sleeps; /* Total number of alloc sleeps */ > > /* > * This HAS to be the last item because we adjust the zone size > From owner-svn-src-all@freebsd.org Sat Jun 23 10:41:54 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7B8F101BC21; Sat, 23 Jun 2018 10:41:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 98EE67D946; Sat, 23 Jun 2018 10:41:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B1AA6B1D; Sat, 23 Jun 2018 10:41:53 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NAfrOU019911; Sat, 23 Jun 2018 10:41:53 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NAfrAq019909; Sat, 23 Jun 2018 10:41:53 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201806231041.w5NAfrAq019909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sat, 23 Jun 2018 10:41:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335580 - in head/sys: amd64/amd64 arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in head/sys: amd64/amd64 arm64/arm64 X-SVN-Commit-Revision: 335580 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 10:41:54 -0000 Author: markj Date: Sat Jun 23 10:41:52 2018 New Revision: 335580 URL: https://svnweb.freebsd.org/changeset/base/335580 Log: Re-count available PV entries after reclaiming a PV chunk. The call to reclaim_pv_chunk() in reserve_pv_entries() may free a PV chunk with free entries belonging to the current pmap. In this case we must account for the free entries that were reclaimed, or reserve_pv_entries() may return without having reserved the requested number of entries. Reviewed by: alc, kib Tested by: pho (previous version) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D15911 Modified: head/sys/amd64/amd64/pmap.c head/sys/arm64/arm64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Jun 23 08:10:09 2018 (r335579) +++ head/sys/amd64/amd64/pmap.c Sat Jun 23 10:41:52 2018 (r335580) @@ -3539,8 +3539,9 @@ reserve_pv_entries(pmap_t pmap, int needed, struct rwl { struct pch new_tail; struct pv_chunk *pc; - int avail, free; vm_page_t m; + int avail, free; + bool reclaimed; PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); @@ -3568,13 +3569,14 @@ retry: if (avail >= needed) break; } - for (; avail < needed; avail += _NPCPV) { + for (reclaimed = false; avail < needed; avail += _NPCPV) { m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) goto retry; + reclaimed = true; } PV_STAT(atomic_add_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); @@ -3587,6 +3589,14 @@ retry: TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV)); + + /* + * The reclaim might have freed a chunk from the current pmap. + * If that chunk contained available entries, we need to + * re-count the number of available entries. + */ + if (reclaimed) + goto retry; } if (!TAILQ_EMPTY(&new_tail)) { mtx_lock(&pv_chunks_mutex); Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Sat Jun 23 08:10:09 2018 (r335579) +++ head/sys/arm64/arm64/pmap.c Sat Jun 23 10:41:52 2018 (r335580) @@ -2083,8 +2083,9 @@ reserve_pv_entries(pmap_t pmap, int needed, struct rwl { struct pch new_tail; struct pv_chunk *pc; - int avail, free; vm_page_t m; + int avail, free; + bool reclaimed; PMAP_LOCK_ASSERT(pmap, MA_OWNED); KASSERT(lockp != NULL, ("reserve_pv_entries: lockp is NULL")); @@ -2107,13 +2108,14 @@ retry: if (avail >= needed) break; } - for (; avail < needed; avail += _NPCPV) { + for (reclaimed = false; avail < needed; avail += _NPCPV) { m = vm_page_alloc(NULL, 0, VM_ALLOC_NORMAL | VM_ALLOC_NOOBJ | VM_ALLOC_WIRED); if (m == NULL) { m = reclaim_pv_chunk(pmap, lockp); if (m == NULL) goto retry; + reclaimed = true; } PV_STAT(atomic_add_int(&pc_chunk_count, 1)); PV_STAT(atomic_add_int(&pc_chunk_allocs, 1)); @@ -2126,6 +2128,14 @@ retry: TAILQ_INSERT_HEAD(&pmap->pm_pvchunk, pc, pc_list); TAILQ_INSERT_TAIL(&new_tail, pc, pc_lru); PV_STAT(atomic_add_int(&pv_entry_spare, _NPCPV)); + + /* + * The reclaim might have freed a chunk from the current pmap. + * If that chunk contained available entries, we need to + * re-count the number of available entries. + */ + if (reclaimed) + goto retry; } if (!TAILQ_EMPTY(&new_tail)) { mtx_lock(&pv_chunks_mutex); From owner-svn-src-all@freebsd.org Sat Jun 23 15:03:55 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB93A1024219; Sat, 23 Jun 2018 15:03:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 66FA085AB7; Sat, 23 Jun 2018 15:03:55 +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 42F9F11704; Sat, 23 Jun 2018 15:03:55 +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 w5NF3tTA053056; Sat, 23 Jun 2018 15:03:55 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NF3sN0053054; Sat, 23 Jun 2018 15:03:54 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806231503.w5NF3sN0053054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 Jun 2018 15:03:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335581 - head/sys/arm/allwinner/clkng X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner/clkng X-SVN-Commit-Revision: 335581 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 15:03:56 -0000 Author: manu Date: Sat Jun 23 15:03:54 2018 New Revision: 335581 URL: https://svnweb.freebsd.org/changeset/base/335581 Log: allwinner: clkng: Correct mux width and flags The test for checking if the clock have a mux was inverted and the mask to calculate the parent index was wrong was wrong too. It means that upon creation the incorrect parent was resolved as the current one and upon reparent the switch was never made. Pointy hat (lots of them): manu Modified: head/sys/arm/allwinner/clkng/aw_clk_nkmp.c head/sys/arm/allwinner/clkng/aw_clk_nm.c Modified: head/sys/arm/allwinner/clkng/aw_clk_nkmp.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nkmp.c Sat Jun 23 10:41:52 2018 (r335580) +++ head/sys/arm/allwinner/clkng/aw_clk_nkmp.c Sat Jun 23 15:03:54 2018 (r335581) @@ -128,12 +128,12 @@ aw_clk_nkmp_set_mux(struct clknode *clk, int index) sc = clknode_get_softc(clk); - if ((sc->flags & AW_CLK_HAS_MUX) != 0) + if ((sc->flags & AW_CLK_HAS_MUX) == 0) return (0); DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); - val &= ~(sc->mux_mask >> sc->mux_shift); + val &= ~sc->mux_mask; val |= index << sc->mux_shift; WRITE4(clk, sc->offset, val); DEVICE_UNLOCK(clk); Modified: head/sys/arm/allwinner/clkng/aw_clk_nm.c ============================================================================== --- head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Jun 23 10:41:52 2018 (r335580) +++ head/sys/arm/allwinner/clkng/aw_clk_nm.c Sat Jun 23 15:03:54 2018 (r335581) @@ -125,12 +125,12 @@ aw_clk_nm_set_mux(struct clknode *clk, int index) sc = clknode_get_softc(clk); - if ((sc->flags & AW_CLK_HAS_MUX) != 0) + if ((sc->flags & AW_CLK_HAS_MUX) == 0) return (0); DEVICE_LOCK(clk); READ4(clk, sc->offset, &val); - val &= ~(sc->mux_mask >> sc->mux_shift); + val &= ~sc->mux_mask; val |= index << sc->mux_shift; WRITE4(clk, sc->offset, val); DEVICE_UNLOCK(clk); From owner-svn-src-all@freebsd.org Sat Jun 23 15:05:22 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D4AD810242EE; Sat, 23 Jun 2018 15:05:22 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8663185C37; Sat, 23 Jun 2018 15:05:22 +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 6767511708; Sat, 23 Jun 2018 15:05:22 +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 w5NF5MKZ053178; Sat, 23 Jun 2018 15:05:22 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NF5MVP053177; Sat, 23 Jun 2018 15:05:22 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201806231505.w5NF5MVP053177@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Sat, 23 Jun 2018 15:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335582 - head/sys/arm/allwinner X-SVN-Group: head X-SVN-Commit-Author: manu X-SVN-Commit-Paths: head/sys/arm/allwinner X-SVN-Commit-Revision: 335582 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 15:05:23 -0000 Author: manu Date: Sat Jun 23 15:05:21 2018 New Revision: 335582 URL: https://svnweb.freebsd.org/changeset/base/335582 Log: aw_mmc: Fix style(9) after r335476 Modified: head/sys/arm/allwinner/aw_mmc.c Modified: head/sys/arm/allwinner/aw_mmc.c ============================================================================== --- head/sys/arm/allwinner/aw_mmc.c Sat Jun 23 15:03:54 2018 (r335581) +++ head/sys/arm/allwinner/aw_mmc.c Sat Jun 23 15:05:21 2018 (r335582) @@ -529,21 +529,21 @@ aw_mmc_attach(device_t dev) &sc->sim_mtx, 1, 1, sc->devq); if (sc->sim == NULL) { - cam_simq_free(sc->devq); - device_printf(dev, "cannot allocate CAM SIM\n"); - goto fail; - } + cam_simq_free(sc->devq); + device_printf(dev, "cannot allocate CAM SIM\n"); + goto fail; + } mtx_lock(&sc->sim_mtx); - if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { - device_printf(dev, "cannot register SCSI pass-through bus\n"); - cam_sim_free(sc->sim, FALSE); - cam_simq_free(sc->devq); - mtx_unlock(&sc->sim_mtx); - goto fail; - } + if (xpt_bus_register(sc->sim, sc->aw_dev, 0) != 0) { + device_printf(dev, "cannot register SCSI pass-through bus\n"); + cam_sim_free(sc->sim, FALSE); + cam_simq_free(sc->devq); + mtx_unlock(&sc->sim_mtx); + goto fail; + } - mtx_unlock(&sc->sim_mtx); + mtx_unlock(&sc->sim_mtx); #else /* !MMCCAM */ child = device_add_child(dev, "mmc", -1); if (child == NULL) { @@ -566,14 +566,14 @@ fail: #ifdef MMCCAM if (sc->sim != NULL) { - mtx_lock(&sc->sim_mtx); - xpt_bus_deregister(cam_sim_path(sc->sim)); - cam_sim_free(sc->sim, FALSE); - mtx_unlock(&sc->sim_mtx); - } + mtx_lock(&sc->sim_mtx); + xpt_bus_deregister(cam_sim_path(sc->sim)); + cam_sim_free(sc->sim, FALSE); + mtx_unlock(&sc->sim_mtx); + } - if (sc->devq != NULL) - cam_simq_free(sc->devq); + if (sc->devq != NULL) + cam_simq_free(sc->devq); #endif return (ENXIO); } From owner-svn-src-all@freebsd.org Sat Jun 23 16:16:57 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C73D10267B5; Sat, 23 Jun 2018 16:16:57 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 03A33891DE; Sat, 23 Jun 2018 16:16:57 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id EC616135BC; Sat, 23 Jun 2018 16:16:56 +0000 (UTC) Date: Sat, 23 Jun 2018 16:16:56 +0000 From: Alexey Dokuchaev To: Eitan Adler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335547 - head/usr.bin/top Message-ID: <20180623161656.GB91517@FreeBSD.org> References: <201806220945.w5M9jI5H044405@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201806220945.w5M9jI5H044405@repo.freebsd.org> User-Agent: Mutt/1.9.5 (2018-04-13) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 16:16:57 -0000 On Fri, Jun 22, 2018 at 09:45:18AM +0000, Eitan Adler wrote: > New Revision: 335547 > URL: https://svnweb.freebsd.org/changeset/base/335547 > > Log: > top(1): remove special handling of load > 5 > > ... > Modified: head/usr.bin/top/screen.c > ============================================================================== > --- head/usr.bin/top/screen.c Fri Jun 22 09:41:13 2018 (r335546) > +++ head/usr.bin/top/screen.c Fri Jun 22 09:45:18 2018 (r335547) > @@ -55,7 +55,7 @@ static struct termios new_settings; > static char is_a_terminal = false; > > void > -init_termcap(int interactive) > +init_termcap(bool interactive) > { > char *bufptr; > char *PCptr; > @@ -138,7 +138,7 @@ init_termcap(int interactive) > /* get "ce", clear to end */ > if (!overstrike) > { > - clear_line = tgetstr("ce", &bufptr); > + clear_line = tgetstr("ce", &bufptr); > } (I've seen it before, and replying to this commit as an example): would you mind separating style and functional changes into different commits? I know that top(1) is full of style bugs and it's very tempting to fix them when you see them, but that's not really the best way to go. ./danfe From owner-svn-src-all@freebsd.org Sat Jun 23 16:56:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E5D31027552; Sat, 23 Jun 2018 16:56:37 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from smtp-out-no.shaw.ca (smtp-out-no.shaw.ca [64.59.134.13]) (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 4E3FD8A6AB; Sat, 23 Jun 2018 16:56:36 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from spqr.komquats.com ([70.67.125.17]) by shaw.ca with ESMTPA id Wlpqf4puK8PStWlprfJUh5; Sat, 23 Jun 2018 10:56:29 -0600 X-Authority-Analysis: v=2.3 cv=QP1GuDDL c=1 sm=1 tr=0 a=VFtTW3WuZNDh6VkGe7fA3g==:117 a=VFtTW3WuZNDh6VkGe7fA3g==:17 a=kj9zAlcOel0A:10 a=7mUfYlMuFuIA:10 a=6I5d2MoRAAAA:8 a=YxBL1-UpAAAA:8 a=jLMqdMmYszieh_CrYh4A:9 a=CjuIK1q_8ugA:10 a=IjZwj45LgO3ly-622nXo:22 a=Ia-lj3WSrqcvXOmTRaiG:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTPS id 8881B24D; Sat, 23 Jun 2018 09:56:25 -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 w5NGuPlf005396; Sat, 23 Jun 2018 09:56:25 -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 w5NGuPwm005393; Sat, 23 Jun 2018 09:56:25 -0700 (PDT) (envelope-from Cy.Schubert@cschubert.com) Message-Id: <201806231656.w5NGuPwm005393@slippy.cwsent.com> X-Authentication-Warning: slippy.cwsent.com: cy owned process doing -bs X-Mailer: exmh version 2.8.0 04/21/2012 with nmh-1.7.1 Reply-to: Cy Schubert From: Cy Schubert X-os: FreeBSD X-Sender: cy@cwsent.com X-URL: http://www.cschubert.com/ To: Alexey Dokuchaev cc: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r335547 - head/usr.bin/top In-Reply-To: Message from Alexey Dokuchaev of "Sat, 23 Jun 2018 16:16:56 -0000." <20180623161656.GB91517@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 23 Jun 2018 09:56:25 -0700 X-CMAE-Envelope: MS4wfPNZYF46bpF+qYJMABkVKnxACFN1UYpJ+orH3xQScl6zvwmoUglxoguOYUxI01VtUxP5PqW7clpKdVgeKltBcNs0jDhobV+r+XnmYleKYs3/dAo8G51G IPQJmIWPxmrYjFY44Zk8ISyba8l1wVLH96EKCHtxrZR00Z3BSQcB4e1TV5S4kNJ6SvYeJryhdKWdvlmdpfewILdevLDWPKP6+N46yCnzsusI9J1yZKV5Zadv LklwVn7ayitE2VhUZ6LNJiTPod80hBT9+jGI2wpIPG1kcsnVzLzqlEH7oePvHKzJhizoAqpUCg0o+5DVr8A/PX8vvH8iajG3Sh5Vqq5hxeU= X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 16:56:37 -0000 In message <20180623161656.GB91517@FreeBSD.org>, Alexey Dokuchaev writes: > On Fri, Jun 22, 2018 at 09:45:18AM +0000, Eitan Adler wrote: > > New Revision: 335547 > > URL: https://svnweb.freebsd.org/changeset/base/335547 > > > > Log: > > top(1): remove special handling of load > 5 > > > > ... > > Modified: head/usr.bin/top/screen.c > > =========================================================================== > === > > --- head/usr.bin/top/screen.c Fri Jun 22 09:41:13 2018 (r33554 > 6) > > +++ head/usr.bin/top/screen.c Fri Jun 22 09:45:18 2018 (r33554 > 7) > > @@ -55,7 +55,7 @@ static struct termios new_settings; > > static char is_a_terminal = false; > > > > void > > -init_termcap(int interactive) > > +init_termcap(bool interactive) > > { > > char *bufptr; > > char *PCptr; > > @@ -138,7 +138,7 @@ init_termcap(int interactive) > > /* get "ce", clear to end */ > > if (!overstrike) > > { > > - clear_line = tgetstr("ce", &bufptr); > > + clear_line = tgetstr("ce", &bufptr); > > } > > (I've seen it before, and replying to this commit as an example): would > you mind separating style and functional changes into different commits? > I know that top(1) is full of style bugs and it's very tempting to fix > them when you see them, but that's not really the best way to go. Agreed. My src commit bit mentor made sure I separated functional from style commits. Having been a prior ports committer, we on the ports side batch commits all the time but when glebius pointed this out to me I understood the reason why and I now try to do the same on the ports side of the fence too. It's more difficult it but IMO well worth it. I find that git helps separate these types of commits -- if I make a mistake it's easy enough to back out a git commit and do it again before git svn dcommit. Just my $0.02. -- Cheers, Cy Schubert FreeBSD UNIX: Web: http://www.FreeBSD.org The need of the many outweighs the greed of the few. From owner-svn-src-all@freebsd.org Sat Jun 23 17:24:20 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87B361027FF6; Sat, 23 Jun 2018 17:24:20 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 394A58B545; Sat, 23 Jun 2018 17:24:20 +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 1901312DBE; Sat, 23 Jun 2018 17:24:20 +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 w5NHOJ8d024886; Sat, 23 Jun 2018 17:24:19 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NHOJWV024885; Sat, 23 Jun 2018 17:24:19 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806231724.w5NHOJWV024885@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 Jun 2018 17:24:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335583 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 335583 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 17:24:20 -0000 Author: cem Date: Sat Jun 23 17:24:19 2018 New Revision: 335583 URL: https://svnweb.freebsd.org/changeset/base/335583 Log: aesni(4): Support CRD_F_KEY_EXPLICIT OCF mode PR: 227788 Reported by: eadler@ Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Sat Jun 23 15:05:21 2018 (r335582) +++ head/sys/crypto/aesni/aesni.c Sat Jun 23 17:24:19 2018 (r335583) @@ -555,24 +555,36 @@ MODULE_VERSION(aesni, 1); MODULE_DEPEND(aesni, crypto, 1, 1, 1); static int +aesni_authprepare(struct aesni_session *ses, int klen, const void *cri_key) +{ + int keylen; + + if (klen % 8 != 0) + return (EINVAL); + keylen = klen / 8; + if (keylen > sizeof(ses->hmac_key)) + return (EINVAL); + if (ses->auth_algo == CRYPTO_SHA1 && keylen > 0) + return (EINVAL); + memcpy(ses->hmac_key, cri_key, keylen); + return (0); +} + +static int aesni_cipher_setup(struct aesni_session *ses, struct cryptoini *encini, struct cryptoini *authini) { struct fpu_kern_ctx *ctx; - int kt, ctxidx, keylen, error; + int kt, ctxidx, error; switch (ses->auth_algo) { case CRYPTO_SHA1: case CRYPTO_SHA1_HMAC: case CRYPTO_SHA2_256_HMAC: - if (authini->cri_klen % 8 != 0) - return (EINVAL); - keylen = authini->cri_klen / 8; - if (keylen > sizeof(ses->hmac_key)) - return (EINVAL); - if (ses->auth_algo == CRYPTO_SHA1 && keylen > 0) - return (EINVAL); - memcpy(ses->hmac_key, authini->cri_key, keylen); + error = aesni_authprepare(ses, authini->cri_klen, + authini->cri_key); + if (error != 0) + return (error); ses->mlen = authini->cri_mlen; } @@ -899,10 +911,18 @@ aesni_cipher_mac(struct aesni_session *ses, struct cry struct sha1_ctxt sha1 __aligned(16); } sctx; uint32_t res[SHA2_256_HASH_LEN / sizeof(uint32_t)]; - int hashlen; + int hashlen, error; - if (crd->crd_flags != 0) + if ((crd->crd_flags & ~CRD_F_KEY_EXPLICIT) != 0) { + CRYPTDEB("%s: Unsupported MAC flags: 0x%x", __func__, + (crd->crd_flags & ~CRD_F_KEY_EXPLICIT)); return (EINVAL); + } + if ((crd->crd_flags & CRD_F_KEY_EXPLICIT) != 0) { + error = aesni_authprepare(ses, crd->crd_klen, crd->crd_key); + if (error != 0) + return (error); + } switch (ses->auth_algo) { case CRYPTO_SHA1_HMAC: From owner-svn-src-all@freebsd.org Sat Jun 23 18:20:18 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A1A410016BA; Sat, 23 Jun 2018 18:20:18 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C04908CF3E; Sat, 23 Jun 2018 18:20:17 +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 9D152135C1; Sat, 23 Jun 2018 18:20:17 +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 w5NIKHrd051053; Sat, 23 Jun 2018 18:20:17 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NIKHaS051052; Sat, 23 Jun 2018 18:20:17 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201806231820.w5NIKHaS051052@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Sat, 23 Jun 2018 18:20:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335584 - head/sys/crypto/aesni X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/crypto/aesni X-SVN-Commit-Revision: 335584 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 18:20:18 -0000 Author: cem Date: Sat Jun 23 18:20:17 2018 New Revision: 335584 URL: https://svnweb.freebsd.org/changeset/base/335584 Log: aesni(4): Fix {de,en}crypt operations that allocated a buffer aesni(4) allocates a contiguous buffer for the data it processes if the provided input was not already virtually contiguous, and copies the input there. It performs encryption or decryption in-place. r324037 removed the logic that then copied the processed data back to the user-provided input buffer, breaking {de,enc}crypt for mbuf chains or iovecs with more than a single descriptor. PR: 228094 (probably, not confirmed) Submitted by: Sean Fagan Reported by: Emeric POUPON X-MFC-With: 324037 Security: could result in plaintext being output by "encrypt" operation Modified: head/sys/crypto/aesni/aesni.c Modified: head/sys/crypto/aesni/aesni.c ============================================================================== --- head/sys/crypto/aesni/aesni.c Sat Jun 23 17:24:19 2018 (r335583) +++ head/sys/crypto/aesni/aesni.c Sat Jun 23 18:20:17 2018 (r335584) @@ -890,6 +890,10 @@ aesni_cipher_crypt(struct aesni_session *ses, struct c break; } + if (allocated) + crypto_copyback(crp->crp_flags, crp->crp_buf, enccrd->crd_skip, + enccrd->crd_len, buf); + out: if (allocated) { explicit_bzero(buf, enccrd->crd_len); From owner-svn-src-all@freebsd.org Sat Jun 23 19:01:06 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B72210029ED; Sat, 23 Jun 2018 19:01:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1EC3E8E58C; Sat, 23 Jun 2018 19:01:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0128A13CA9; Sat, 23 Jun 2018 19:01:06 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NJ15qq071511; Sat, 23 Jun 2018 19:01:05 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NJ155b071510; Sat, 23 Jun 2018 19:01:05 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201806231901.w5NJ155b071510@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Jun 2018 19:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335585 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335585 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 19:01:06 -0000 Author: gonzo Date: Sat Jun 23 19:01:05 2018 New Revision: 335585 URL: https://svnweb.freebsd.org/changeset/base/335585 Log: Fix invalid OF_getencprop_alloc usage in fdt_pinctrl(9) r332341 introduced OF_getencprop_alloc_multi that should be used instead of OF_getencprop_alloc to get multi-cell properties. Fix example to reflect this change. Modified: head/share/man/man9/fdt_pinctrl.9 Modified: head/share/man/man9/fdt_pinctrl.9 ============================================================================== --- head/share/man/man9/fdt_pinctrl.9 Sat Jun 23 18:20:17 2018 (r335584) +++ head/share/man/man9/fdt_pinctrl.9 Sat Jun 23 19:01:05 2018 (r335585) @@ -116,10 +116,10 @@ foo_configure_pins(device_t dev, phandle_t cfgxref) cfgnode = OF_node_from_xref(cfgxref); pins = NULL; - npins = OF_getencprop_alloc(cfgnode, "foo,pins", sizeof(*pins), + npins = OF_getencprop_alloc_multi(cfgnode, "foo,pins", sizeof(*pins), (void **)&pins); functions = NULL; - nfunctions = OF_getencprop_alloc(cfgnode, "foo,functions", + nfunctions = OF_getencprop_alloc_multi(cfgnode, "foo,functions", sizeof(*functions), (void **)&functions); ... } From owner-svn-src-all@freebsd.org Sat Jun 23 19:30:30 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2530510039BC; Sat, 23 Jun 2018 19:30:30 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B728D8F994; Sat, 23 Jun 2018 19:30:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 932261415D; Sat, 23 Jun 2018 19:30:29 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NJUTKo087230; Sat, 23 Jun 2018 19:30:29 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NJUTx2087229; Sat, 23 Jun 2018 19:30:29 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201806231930.w5NJUTx2087229@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Jun 2018 19:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335586 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335586 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 19:30:30 -0000 Author: gonzo Date: Sat Jun 23 19:30:29 2018 New Revision: 335586 URL: https://svnweb.freebsd.org/changeset/base/335586 Log: Bump .Dd value after r335585 Modified: head/share/man/man9/fdt_pinctrl.9 Modified: head/share/man/man9/fdt_pinctrl.9 ============================================================================== --- head/share/man/man9/fdt_pinctrl.9 Sat Jun 23 19:01:05 2018 (r335585) +++ head/share/man/man9/fdt_pinctrl.9 Sat Jun 23 19:30:29 2018 (r335586) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2018 +.Dd June 23, 2018 .Dt fdt_pinctrl 9 .Os .Sh NAME From owner-svn-src-all@freebsd.org Sat Jun 23 20:05:09 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA398100458C; Sat, 23 Jun 2018 20:05:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B70C90D16; Sat, 23 Jun 2018 20:05:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4CC42147D5; Sat, 23 Jun 2018 20:05:08 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NK58hF008218; Sat, 23 Jun 2018 20:05:08 GMT (envelope-from gonzo@FreeBSD.org) Received: (from gonzo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NK57E1008216; Sat, 23 Jun 2018 20:05:07 GMT (envelope-from gonzo@FreeBSD.org) Message-Id: <201806232005.w5NK57E1008216@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gonzo set sender to gonzo@FreeBSD.org using -f From: Oleksandr Tymoshenko Date: Sat, 23 Jun 2018 20:05:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335587 - head/share/man/man9 X-SVN-Group: head X-SVN-Commit-Author: gonzo X-SVN-Commit-Paths: head/share/man/man9 X-SVN-Commit-Revision: 335587 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 20:05:09 -0000 Author: gonzo Date: Sat Jun 23 20:05:07 2018 New Revision: 335587 URL: https://svnweb.freebsd.org/changeset/base/335587 Log: Document multi variants of *prop_alloc functions Add documentation and symlinks for OF_getprop_alloc_multi and OF_getencprop_alloc_multi functions. Also while here fix copy-pasted .Dt value and add one more failure condition for OF_getencprop_alloc. Modified: head/share/man/man9/Makefile head/share/man/man9/OF_getprop.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Sat Jun 23 19:30:29 2018 (r335586) +++ head/share/man/man9/Makefile Sat Jun 23 20:05:07 2018 (r335587) @@ -1540,7 +1540,9 @@ MLINKS+=OF_device_from_xref.9 OF_device_register_xref. OF_device_from_xref.9 OF_xref_from_device.9 MLINKS+=OF_getprop.9 OF_getencprop.9 \ OF_getprop.9 OF_getencprop_alloc.9 \ + OF_getprop.9 OF_getencprop_alloc_multi.9 \ OF_getprop.9 OF_getprop_alloc.9 \ + OF_getprop.9 OF_getprop_alloc_multi.9 \ OF_getprop.9 OF_getproplen.9 \ OF_getprop.9 OF_hasprop.9 \ OF_getprop.9 OF_nextprop.9 \ Modified: head/share/man/man9/OF_getprop.9 ============================================================================== --- head/share/man/man9/OF_getprop.9 Sat Jun 23 19:30:29 2018 (r335586) +++ head/share/man/man9/OF_getprop.9 Sat Jun 23 20:05:07 2018 (r335587) @@ -25,8 +25,8 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2018 -.Dt OF_CHILD 9 +.Dd June 23, 2018 +.Dt OF_GETPROP 9 .Os .Sh NAME .Nm OF_getprop , @@ -37,6 +37,8 @@ .Nm OF_searchencprop , .Nm OF_getprop_alloc , .Nm OF_getencprop_alloc , +.Nm OF_getprop_alloc_multi , +.Nm OF_getencprop_alloc_multi , .Nm OF_prop_free , .Nm OF_nextprop , .Nm OF_setprop @@ -66,6 +68,12 @@ .Ft ssize_t .Fn OF_getencprop_alloc "phandle_t node" "const char *propname" \ "pcell_t **buf" +.Ft ssize_t +.Fn OF_getprop_alloc_multi "phandle_t node" "const char *propname" \ +"int elsz" "void **buf" +.Ft ssize_t +.Fn OF_getencprop_alloc_multi "phandle_t node" "const char *propname" \ +"int elsz" "pcell_t **buf" .Ft void .Fn OF_prop_free "void *buf" .Ft int @@ -204,19 +212,73 @@ If the property has zero-length value, .Fa *buf is set to NULL. Returns -1 if the property does not exist or -memory allocation failed. +memory allocation failed or the size of the value is not +divisible by a cell size (4 bytes). Allocated memory should be released when no longer required by calling .Fn OF_prop_free . The function might sleep when allocating memory. .Pp +.Fn OF_getprop_alloc_multi +allocates memory large enough to hold the +value associated with the property +.Fa propname +of the device node +.Fa node +and copies the value into the newly allocated memory region. +The value is expected to be an array of zero or more elements +.Fa elsz +bytes long. +Returns the number of elements in the value and stores +the address of the allocated memory in +.Fa *buf . +If the property has a zero-sized value +.Fa *buf +is set NULL. +Returns -1 if the property does not exist or +memory allocation failed or the size of the value is not +divisible by +.Fa elsz . +Allocated memory should be released when no longer required +by calling +.Fn OF_prop_free . +The function might sleep when allocating memory. +.Pp +.Fn OF_getencprop_alloc_multi +allocates memory large enough to hold the +value associated with the property +.Fa propname +of the device node +.Fa node +and copies the value into the newly allocated memory region, and +then converts cell values from big-endian to host byte +order. +The value is expected to be an array of zero or more elements +.Fa elsz +bytes long. +Returns the number of elements in the value and stores +the address of the allocated memory in +.Fa *buf . +If the property has a zero-sized value +.Fa *buf +is set NULL. +Returns -1 if the property does not exist or +memory allocation failed or the size of the value is not +divisible by +.Fa elsz . +Allocated memory should be released when no longer required +by calling +.Fn OF_prop_free . +The function might sleep when allocating memory. +.Pp .Fn OF_prop_free releases memory at .Fa buf that was allocated by -.Fn OF_getprop_alloc -or -.Fn OF_getencprop_alloc . +.Fn OF_getprop_alloc , +.Fn OF_getencprop_alloc , +.Fn OF_getprop_alloc_multi , +.Fn OF_getencprop_alloc_multi . .Pp .Fn OF_nextprop copies a maximum of From owner-svn-src-all@freebsd.org Sat Jun 23 20:12:32 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B30410048E6; Sat, 23 Jun 2018 20:12:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 016CA911A6; Sat, 23 Jun 2018 20:12:32 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC9C514974; Sat, 23 Jun 2018 20:12:31 +0000 (UTC) (envelope-from oshogbo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NKCV7r013204; Sat, 23 Jun 2018 20:12:31 GMT (envelope-from oshogbo@FreeBSD.org) Received: (from oshogbo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NKCV3c013202; Sat, 23 Jun 2018 20:12:31 GMT (envelope-from oshogbo@FreeBSD.org) Message-Id: <201806232012.w5NKCV3c013202@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: oshogbo set sender to oshogbo@FreeBSD.org using -f From: Mariusz Zaborski Date: Sat, 23 Jun 2018 20:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335588 - head/lib/libcasper/libcasper X-SVN-Group: head X-SVN-Commit-Author: oshogbo X-SVN-Commit-Paths: head/lib/libcasper/libcasper X-SVN-Commit-Revision: 335588 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 20:12:32 -0000 Author: oshogbo Date: Sat Jun 23 20:12:30 2018 New Revision: 335588 URL: https://svnweb.freebsd.org/changeset/base/335588 Log: Document libcasper_service. Reviewed by: bcr@ Differential Revision: https://reviews.freebsd.org/D15766 Added: head/lib/libcasper/libcasper/libcasper_service.3 (contents, props changed) Modified: head/lib/libcasper/libcasper/Makefile head/lib/libcasper/libcasper/libcasper.3 Modified: head/lib/libcasper/libcasper/Makefile ============================================================================== --- head/lib/libcasper/libcasper/Makefile Sat Jun 23 20:05:07 2018 (r335587) +++ head/lib/libcasper/libcasper/Makefile Sat Jun 23 20:12:30 2018 (r335588) @@ -25,6 +25,7 @@ LIBADD= nv CFLAGS+=-I${.CURDIR} MAN+= libcasper.3 +MAN+= libcasper_service.3 MLINKS+=libcasper.3 cap_init.3 MLINKS+=libcasper.3 cap_wrap.3 @@ -38,5 +39,7 @@ MLINKS+=libcasper.3 cap_send_nvlist.3 MLINKS+=libcasper.3 cap_recv_nvlist.3 MLINKS+=libcasper.3 cap_xfer_nvlist.3 MLINKS+=libcasper.3 cap_service_open.3 + +MLINKS+=libcasper_service.3 CREATE_SERVICE.3 .include Modified: head/lib/libcasper/libcasper/libcasper.3 ============================================================================== --- head/lib/libcasper/libcasper/libcasper.3 Sat Jun 23 20:05:07 2018 (r335587) +++ head/lib/libcasper/libcasper/libcasper.3 Sat Jun 23 20:12:30 2018 (r335588) @@ -265,6 +265,7 @@ functions always succeed. .Xr cap_ranodm 3 , .Xr cap_sysctl 3 , .Xr cap_syslog 3 , +.Xr libcasper_service 3 , .Xr capsicum 4 , .Xr unix 4 , .Xr nv 9 Added: head/lib/libcasper/libcasper/libcasper_service.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libcasper/libcasper/libcasper_service.3 Sat Jun 23 20:12:30 2018 (r335588) @@ -0,0 +1,116 @@ +.\" Copyright (c) 2018 Mariusz Zaborski +.\" 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 AUTHORS 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 AUTHORS 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 June 23, 2018 +.Dt LIBCASPER 3 +.Os +.Sh NAME +.Nm CREATE_SERVICE +.Nd "casper service declaration macro" +.Sh LIBRARY +.Lb libcasper +.Sh SYNOPSIS +.In sys/nv.h +.In libcasper.h +.In libcasper_service.h +.Bd -literal +typedef int service_limit_func_t(const nvlist_t *, const nvlist_t *); + +typedef int service_command_func_t(const char *, const nvlist_t *, nvlist_t *, + nvlist_t *); + +.Ed +.Fn CREATE_SERVICE "name" "limit_func" "command_func" "flags" +.Sh DESCRIPTION +The +.Nm CREATE_SERVICE +macro to create a new Casper service. +The +.Fa name +is a string containing the service name, which will be used in the +.Xr cap_service_open 3, +function to identify it. +.Pp +The +.Fa limit_func +is a function of type +.Li service_limit_func_t . +The first argument of the function contains +.Xr nvlist 9 , +old service limits and second one the new limits. +If the services wasn't limited the old limits will be set to +.Dv NULL . +This function should not allow to extend service limits and only limit it +further. +The +.Fa command_func +is a function of type +.Li service_command_func_t . +First argument is the name of the command that should be executed. +The first +.Xr nvlist 9 +contains the current limits. +Next one contains a +.Xr nvlist 9 +with current request. +The last one contains an output +.Xr nvlist 9 +which contains the response from Casper. +.Pp +The +.Fa flags +argument defines limits of the service. +The supported flags are: +.Bl -ohang -offset indent +.It CASPER_SERVICE_STDIO +The Casper service has access to the stdio descriptors from the process it was +spawned from. +.It CASPER_SERVICE_FD +The Casper service has access to all descriptors besides stdio descriptors from +the process it was spawned from. +.It CASPER_SERVICE_NO_UNIQ_LIMITS +The whole Casper communication is using +.Xr nvlist 9 +with +.Xr NVLIST_NO_UNIQ 9 +flag. +.El +.Sh SEE ALSO +.Xr cap_enter 2 , +.Xr libcasper 3 , +.Xr capsicum 4 , +.Xr nv 9 +.Sh AUTHORS +The +.Nm libcasper +library was implemented by +.An Pawel Jakub Dawidek Aq Mt pawel@dawidek.net +under sponsorship from the FreeBSD Foundation. +The +.Nm libcasper +new architecture was implemented by +.An Mariusz Zaborski Aq Mt oshogbo@FreeBSD.org +. From owner-svn-src-all@freebsd.org Sat Jun 23 22:45:19 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 145FA10094A2; Sat, 23 Jun 2018 22:45:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B103E95230; Sat, 23 Jun 2018 22:45:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8E3E016172; Sat, 23 Jun 2018 22:45:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NMjIah089408; Sat, 23 Jun 2018 22:45:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NMjIqP089407; Sat, 23 Jun 2018 22:45:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806232245.w5NMjIqP089407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Jun 2018 22:45:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335589 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335589 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 22:45:19 -0000 Author: eadler Date: Sat Jun 23 22:45:18 2018 New Revision: 335589 URL: https://svnweb.freebsd.org/changeset/base/335589 Log: top(1): Use basename instead of a homegrown alternative Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 23 20:12:30 2018 (r335588) +++ head/usr.bin/top/machine.c Sat Jun 23 22:45:18 2018 (r335589) @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -992,11 +993,7 @@ format_next_process(struct handle * xhandle, char *(*g dst = argbuf; /* Extract cmd name from argv */ - cmd = strrchr(*args, '/'); - if (cmd == NULL) - cmd = *args; - else - cmd++; + cmd = basename(*args); for (; (src = *args++) != NULL; ) { if (*src == '\0') From owner-svn-src-all@freebsd.org Sat Jun 23 22:45:24 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C11710094D1; Sat, 23 Jun 2018 22:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 288659528B; Sat, 23 Jun 2018 22:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C55CA16174; Sat, 23 Jun 2018 22:45:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NMjMmu089494; Sat, 23 Jun 2018 22:45:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NMjMFj089493; Sat, 23 Jun 2018 22:45:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806232245.w5NMjMFj089493@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Jun 2018 22:45:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335591 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335591 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 22:45:24 -0000 Author: eadler Date: Sat Jun 23 22:45:22 2018 New Revision: 335591 URL: https://svnweb.freebsd.org/changeset/base/335591 Log: top(1): Restructure printing of process states This avoids the need to have separate buffers and calls to sprintf for various calls. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 23 22:45:20 2018 (r335590) +++ head/usr.bin/top/machine.c Sat Jun 23 22:45:22 2018 (r335591) @@ -388,14 +388,18 @@ format_header(const char *uname_field) sbuf_printf(header, " %s", ps.thread_id ? " THR" : "PID"); sbuf_printf(header, "%*s", ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : ""); - sbuf_printf(header, " %-*.*s", namelength, namelength, uname_field); - sbuf_cat(header, " THR PRI NICE SIZE RES"); - sbuf_printf(header, "%*s", ps.swap ? TOP_SWAP_LEN : 0, - ps.swap ? " SWAP" : ""); - sbuf_printf(header, "%s", smpmode ? " STATE C " : " STATE "); - sbuf_cat(header, "TIME"); - sbuf_printf(header, " %7s", ps.wcpu ? "WCPU" : "CPU"); - sbuf_cat(header, " COMMAND"); + sbuf_printf(header, " %-*.*s ", namelength, namelength, uname_field); + sbuf_cat(header, "THR PRI NICE SIZE RES "); + if (ps.swap) { + sbuf_printf(header, "%*s ", TOP_SWAP_LEN - 1, "SWAP"); + } + sbuf_cat(header, "STATE "); + if (smpmode) { + sbuf_cat(header, "C "); + } + sbuf_cat(header, "TIME "); + sbuf_printf(header, "%6s ", ps.wcpu ? "WCPU" : "CPU"); + sbuf_cat(header, "COMMAND"); sbuf_finish(header); break; } @@ -861,14 +865,10 @@ format_next_process(struct handle * xhandle, char *(*g struct kinfo_proc *pp; const struct kinfo_proc *oldp; long cputime; - double pct; char status[22]; - int cpu; size_t state; struct rusage ru, *rup; long p_tot, s_tot; - char thr_buf[6]; - char jid_buf[TOP_JID_LEN], swap_buf[TOP_SWAP_LEN]; char *cmdbuf = NULL; char **args; const int cmdlen = 128; @@ -909,9 +909,6 @@ format_next_process(struct handle * xhandle, char *(*g */ cputime = (pp->ki_runtime + 500000) / 1000000; - /* calculate the base for cpu percentages */ - pct = PCTCPU(pp); - /* generate "STATE" field */ switch (state = pp->ki_stat) { case SRUN: @@ -1026,19 +1023,6 @@ format_next_process(struct handle * xhandle, char *(*g } } - if (ps.jail == 0) - jid_buf[0] = '\0'; - else - snprintf(jid_buf, sizeof(jid_buf), "%*d", - TOP_JID_LEN - 1, pp->ki_jid); - - if (ps.swap == 0) - swap_buf[0] = '\0'; - else - snprintf(swap_buf, sizeof(swap_buf), "%*s", - TOP_SWAP_LEN - 1, - format_k(pagetok(ki_swap(pp)))); /* XXX */ - if (displaymode == DISP_IO) { oldp = get_old_proc(pp); if (oldp != NULL) { @@ -1056,58 +1040,58 @@ format_next_process(struct handle * xhandle, char *(*g p_tot = rup->ru_inblock + rup->ru_oublock + rup->ru_majflt; s_tot = total_inblock + total_oublock + total_majflt; - free(cmdbuf); + sbuf_printf(procbuf, "%5d ", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); - sbuf_printf(procbuf, "%5d", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); - sbuf_printf(procbuf, "%*s", ps.jail ? TOP_JID_LEN : 0, jid_buf); - sbuf_printf(procbuf, " %-*.*s", namelength, namelength, (*get_userid)(pp->ki_ruid)); - sbuf_printf(procbuf, " %6ld", rup->ru_nvcsw); - sbuf_printf(procbuf, " %6ld", rup->ru_nivcsw); - sbuf_printf(procbuf, " %6ld", rup->ru_inblock); - sbuf_printf(procbuf, " %6ld", rup->ru_oublock); - sbuf_printf(procbuf, " %6ld", rup->ru_majflt); - sbuf_printf(procbuf, " %6ld", p_tot); - sbuf_printf(procbuf, " %6.2f%%", s_tot == 0 ? 0.0 : (p_tot * 100.0 / s_tot)); - sbuf_printf(procbuf, " %.*s", - screen_width > cmdlengthdelta ? - screen_width - cmdlengthdelta : 0, - printable(cmdbuf)); + if (ps.jail) { + sbuf_printf(procbuf, "%*d ", TOP_JID_LEN - 1, pp->ki_jid); + } + sbuf_printf(procbuf, "%-*.*s", namelength, namelength, (*get_userid)(pp->ki_ruid)); + sbuf_printf(procbuf, "%6ld ", rup->ru_nvcsw); + sbuf_printf(procbuf, "%6ld ", rup->ru_nivcsw); + sbuf_printf(procbuf, "%6ld ", rup->ru_inblock); + sbuf_printf(procbuf, "%6ld ", rup->ru_oublock); + sbuf_printf(procbuf, "%6ld ", rup->ru_majflt); + sbuf_printf(procbuf, "%6ld ", p_tot); + sbuf_printf(procbuf, "%6.2f%% ", s_tot == 0 ? 0.0 : (p_tot * 100.0 / s_tot)); - return (sbuf_data(procbuf)); - } + } else { + sbuf_printf(procbuf, "%5d ", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); + if (ps.jail) { + sbuf_printf(procbuf, "%*d ", TOP_JID_LEN - 1, pp->ki_jid); + } + sbuf_printf(procbuf, "%-*.*s ", namelength, namelength, (*get_userid)(pp->ki_ruid)); - /* format this entry */ - if (smpmode) { - if (state == SRUN && pp->ki_oncpu != NOCPU) - cpu = pp->ki_oncpu; - else - cpu = pp->ki_lastcpu; - } else - cpu = 0; - if (ps.thread != 0) - thr_buf[0] = '\0'; - else - snprintf(thr_buf, sizeof(thr_buf), "%*d ", - (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); + if (!ps.thread) { + sbuf_printf(procbuf, "%4d ", pp->ki_numthreads); + } + sbuf_printf(procbuf, "%3d ", pp->ki_pri.pri_level - PZERO); + sbuf_printf(procbuf, "%4s", format_nice(pp)); + sbuf_printf(procbuf, "%6s ", format_k(PROCSIZE(pp))); + sbuf_printf(procbuf, "%5s ", format_k(pagetok(pp->ki_rssize))); + if (ps.swap) { + sbuf_printf(procbuf, "%*s ", + TOP_SWAP_LEN - 1, + format_k(pagetok(ki_swap(pp)))); + } + sbuf_printf(procbuf, "%-6.6s ", status); + if (smpmode) { + int cpu; + if (state == SRUN && pp->ki_oncpu != NOCPU) { + cpu = pp->ki_oncpu; + } else { + cpu = pp->ki_lastcpu; + } + sbuf_printf(procbuf, "%3d ", cpu); + } + sbuf_printf(procbuf, "%6s", format_time(cputime)); + sbuf_printf(procbuf, "%6.2f%% ", ps.wcpu ? 100.0 * weighted_cpu(PCTCPU(pp), pp) : 100.0 * PCTCPU(pp)); + } + sbuf_printf(procbuf, "%.*s", + screen_width > cmdlengthdelta ? + screen_width - cmdlengthdelta : 0, + printable(cmdbuf)); free(cmdbuf); - - sbuf_printf(procbuf, "%5d", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); - sbuf_printf(procbuf, "%*s", ps.jail ? TOP_JID_LEN : 0, jid_buf); - sbuf_printf(procbuf, " %-*.*s", namelength, namelength, (*get_userid)(pp->ki_ruid)); - sbuf_printf(procbuf, " %s", thr_buf); - sbuf_printf(procbuf, "%3d", pp->ki_pri.pri_level - PZERO); - sbuf_printf(procbuf, " %4s", format_nice(pp)); - sbuf_printf(procbuf, "%6s", format_k(PROCSIZE(pp))); - sbuf_printf(procbuf, " %5s", format_k(pagetok(pp->ki_rssize))); - sbuf_printf(procbuf, "%*.*s", ps.swap ? TOP_SWAP_LEN : 0, ps.swap ? TOP_SWAP_LEN : 0, swap_buf); - sbuf_printf(procbuf, " %-6.6s", status); - sbuf_printf(procbuf, (smpmode) ? " %3d" : "%.0d", cpu); - sbuf_printf(procbuf, "%7s", format_time(cputime)); - sbuf_printf(procbuf, " %6.2f%%", ps.wcpu ? 100.0 * weighted_cpu(pct, pp) : 100.0 * pct); - sbuf_printf(procbuf, " %.*s", screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0, printable(cmdbuf)); - - /* return the result */ return (sbuf_data(procbuf)); } @@ -1557,6 +1541,8 @@ swapmode(int *retavail, int *retfree) *retavail = CONVERT(swapary[0].ksw_total); *retfree = CONVERT(swapary[0].ksw_total - swapary[0].ksw_used); + +#undef CONVERT n = (int)(swapary[0].ksw_used * 100.0 / swapary[0].ksw_total); return (n); From owner-svn-src-all@freebsd.org Sat Jun 23 22:45:21 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0981310094BC; Sat, 23 Jun 2018 22:45:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AE2A895231; Sat, 23 Jun 2018 22:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8F27A16173; Sat, 23 Jun 2018 22:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NMjKnN089451; Sat, 23 Jun 2018 22:45:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NMjKMj089450; Sat, 23 Jun 2018 22:45:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201806232245.w5NMjKMj089450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 23 Jun 2018 22:45:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335590 - head/usr.bin/top X-SVN-Group: head X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: head/usr.bin/top X-SVN-Commit-Revision: 335590 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 22:45:21 -0000 Author: eadler Date: Sat Jun 23 22:45:20 2018 New Revision: 335590 URL: https://svnweb.freebsd.org/changeset/base/335590 Log: top(1): Convert process listing to sbuf too This also fixes -mio with 'T' set (thread-id instead of process-id). This can go further by removing the existing sprintf, and using sbuf directly. This will be done in a followup commit. Modified: head/usr.bin/top/machine.c Modified: head/usr.bin/top/machine.c ============================================================================== --- head/usr.bin/top/machine.c Sat Jun 23 22:45:18 2018 (r335589) +++ head/usr.bin/top/machine.c Sat Jun 23 22:45:20 2018 (r335590) @@ -80,22 +80,6 @@ struct handle { #define PCTCPU(pp) (pcpu[pp - pbase]) -/* - * These definitions control the format of the per-process area - */ - -static const char io_header[] = - " %s%*s %-*.*s VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"; - -static const char io_Proc_format[] = - "%5d%*s %-*.*s %6ld %6ld %6ld %6ld %6ld %6ld %6.2f%% %.*s"; - -static const char smp_Proc_format[] = - "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s %3d%7s %6.2f%% %.*s"; - -static char up_Proc_format[] = - "%5d%*s %-*.*s %s%3d %4s%6s %5s%*.*s %-6.6s%.0d%7s %6.2f%% %.*s"; - /* process state names for the "STATE" column of the display */ /* the extra nulls in the string "run" are for adding a slash and the processor number when needed */ @@ -394,9 +378,10 @@ format_header(const char *uname_field) /* clean up from last time. */ if (header != NULL) { - sbuf_delete(header); + sbuf_clear(header); + } else { + header = sbuf_new_auto(); } - header = sbuf_new_auto(); switch (displaymode) { case DISP_CPU: { @@ -415,10 +400,11 @@ format_header(const char *uname_field) break; } case DISP_IO: { - sbuf_printf(header, io_header, + sbuf_printf(header, " %s%*s %-*.*s", ps.thread_id ? " THR" : "PID", ps.jail ? TOP_JID_LEN : 0, ps.jail ? " JID" : "", namelength, namelength, uname_field); + sbuf_cat(header, " VCSW IVCSW READ WRITE FAULT TOTAL PERCENT COMMAND"); break; } case DISP_MAX: @@ -869,8 +855,6 @@ get_process_info(struct system_info *si, struct proces return (&handle); } -static char fmt[512]; /* static area where result is built */ - char * format_next_process(struct handle * xhandle, char *(*get_userid)(int), int flags) { @@ -883,13 +867,21 @@ format_next_process(struct handle * xhandle, char *(*g size_t state; struct rusage ru, *rup; long p_tot, s_tot; - const char *proc_fmt; char thr_buf[6]; char jid_buf[TOP_JID_LEN], swap_buf[TOP_SWAP_LEN]; char *cmdbuf = NULL; char **args; const int cmdlen = 128; + static struct sbuf* procbuf = NULL; + /* clean up from last time. */ + if (procbuf != NULL) { + sbuf_clear(procbuf); + } else { + procbuf = sbuf_new_auto(); + } + + /* find and remember the next proc structure */ pp = *(xhandle->next_proc++); xhandle->remaining--; @@ -1064,24 +1056,24 @@ format_next_process(struct handle * xhandle, char *(*g p_tot = rup->ru_inblock + rup->ru_oublock + rup->ru_majflt; s_tot = total_inblock + total_oublock + total_majflt; - snprintf(fmt, sizeof(fmt), io_Proc_format, - pp->ki_pid, - ps.jail ? TOP_JID_LEN : 0, jid_buf, - namelength, namelength, (*get_userid)(pp->ki_ruid), - rup->ru_nvcsw, - rup->ru_nivcsw, - rup->ru_inblock, - rup->ru_oublock, - rup->ru_majflt, - p_tot, - s_tot == 0 ? 0.0 : (p_tot * 100.0 / s_tot), - screen_width > cmdlengthdelta ? + free(cmdbuf); + + sbuf_printf(procbuf, "%5d", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); + sbuf_printf(procbuf, "%*s", ps.jail ? TOP_JID_LEN : 0, jid_buf); + sbuf_printf(procbuf, " %-*.*s", namelength, namelength, (*get_userid)(pp->ki_ruid)); + sbuf_printf(procbuf, " %6ld", rup->ru_nvcsw); + sbuf_printf(procbuf, " %6ld", rup->ru_nivcsw); + sbuf_printf(procbuf, " %6ld", rup->ru_inblock); + sbuf_printf(procbuf, " %6ld", rup->ru_oublock); + sbuf_printf(procbuf, " %6ld", rup->ru_majflt); + sbuf_printf(procbuf, " %6ld", p_tot); + sbuf_printf(procbuf, " %6.2f%%", s_tot == 0 ? 0.0 : (p_tot * 100.0 / s_tot)); + sbuf_printf(procbuf, " %.*s", + screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0, printable(cmdbuf)); - free(cmdbuf); - - return (fmt); + return (sbuf_data(procbuf)); } /* format this entry */ @@ -1092,35 +1084,31 @@ format_next_process(struct handle * xhandle, char *(*g cpu = pp->ki_lastcpu; } else cpu = 0; - proc_fmt = smpmode ? smp_Proc_format : up_Proc_format; if (ps.thread != 0) thr_buf[0] = '\0'; else snprintf(thr_buf, sizeof(thr_buf), "%*d ", (int)(sizeof(thr_buf) - 2), pp->ki_numthreads); - - snprintf(fmt, sizeof(fmt), proc_fmt, - (ps.thread_id) ? pp->ki_tid : pp->ki_pid, - ps.jail ? TOP_JID_LEN : 0, jid_buf, - namelength, namelength, (*get_userid)(pp->ki_ruid), - thr_buf, - pp->ki_pri.pri_level - PZERO, - format_nice(pp), - format_k(PROCSIZE(pp)), - format_k(pagetok(pp->ki_rssize)), - ps.swap ? TOP_SWAP_LEN : 0, ps.swap ? TOP_SWAP_LEN : 0, swap_buf, - status, - cpu, - format_time(cputime), - ps.wcpu ? 100.0 * weighted_cpu(pct, pp) : 100.0 * pct, - screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0, - printable(cmdbuf)); - free(cmdbuf); + sbuf_printf(procbuf, "%5d", (ps.thread_id) ? pp->ki_tid : pp->ki_pid); + sbuf_printf(procbuf, "%*s", ps.jail ? TOP_JID_LEN : 0, jid_buf); + sbuf_printf(procbuf, " %-*.*s", namelength, namelength, (*get_userid)(pp->ki_ruid)); + sbuf_printf(procbuf, " %s", thr_buf); + sbuf_printf(procbuf, "%3d", pp->ki_pri.pri_level - PZERO); + sbuf_printf(procbuf, " %4s", format_nice(pp)); + sbuf_printf(procbuf, "%6s", format_k(PROCSIZE(pp))); + sbuf_printf(procbuf, " %5s", format_k(pagetok(pp->ki_rssize))); + sbuf_printf(procbuf, "%*.*s", ps.swap ? TOP_SWAP_LEN : 0, ps.swap ? TOP_SWAP_LEN : 0, swap_buf); + sbuf_printf(procbuf, " %-6.6s", status); + sbuf_printf(procbuf, (smpmode) ? " %3d" : "%.0d", cpu); + sbuf_printf(procbuf, "%7s", format_time(cputime)); + sbuf_printf(procbuf, " %6.2f%%", ps.wcpu ? 100.0 * weighted_cpu(pct, pp) : 100.0 * pct); + sbuf_printf(procbuf, " %.*s", screen_width > cmdlengthdelta ? screen_width - cmdlengthdelta : 0, printable(cmdbuf)); + /* return the result */ - return (fmt); + return (sbuf_data(procbuf)); } static void From owner-svn-src-all@freebsd.org Sat Jun 23 22:55:23 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B3D1009C78; Sat, 23 Jun 2018 22:55:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 11E4A95A77; Sat, 23 Jun 2018 22:55:23 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E1ED71631B; Sat, 23 Jun 2018 22:55:22 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NMtMNg094576; Sat, 23 Jun 2018 22:55:22 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NMtMLb094575; Sat, 23 Jun 2018 22:55:22 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806232255.w5NMtMLb094575@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 Jun 2018 22:55:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335592 - head/sys/dts/arm/overlays X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/dts/arm/overlays X-SVN-Commit-Revision: 335592 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 22:55:23 -0000 Author: ian Date: Sat Jun 23 22:55:22 2018 New Revision: 335592 URL: https://svnweb.freebsd.org/changeset/base/335592 Log: Add spi-max-frequency properties to all spigen nodes. This is a required property for spi devices, although in the spigen case it's expected that the speed will be overridden at runtime via the ioctl interface. A very conservative 500khz speed is used (I've never seen a spi device that couldn't run at 1mhz). Modified: head/sys/dts/arm/overlays/spigen-rpi-b.dtso head/sys/dts/arm/overlays/spigen-rpi2.dtso Modified: head/sys/dts/arm/overlays/spigen-rpi-b.dtso ============================================================================== --- head/sys/dts/arm/overlays/spigen-rpi-b.dtso Sat Jun 23 22:45:22 2018 (r335591) +++ head/sys/dts/arm/overlays/spigen-rpi-b.dtso Sat Jun 23 22:55:22 2018 (r335592) @@ -13,11 +13,13 @@ spigen0: spigen0 { compatible = "freebsd,spigen"; reg = <0>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; spigen1: spigen1 { compatible = "freebsd,spigen"; reg = <1>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; }; Modified: head/sys/dts/arm/overlays/spigen-rpi2.dtso ============================================================================== --- head/sys/dts/arm/overlays/spigen-rpi2.dtso Sat Jun 23 22:45:22 2018 (r335591) +++ head/sys/dts/arm/overlays/spigen-rpi2.dtso Sat Jun 23 22:55:22 2018 (r335592) @@ -17,11 +17,13 @@ spigen1: spigen1 { compatible = "freebsd,spigen"; reg = <1>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; spigen2: spigen2 { compatible = "freebsd,spigen"; reg = <2>; + spi-max-frequency = <500000>; /* Req'd property, override with spi(8) */ status = "okay"; }; }; From owner-svn-src-all@freebsd.org Sat Jun 23 23:08:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15EB7100A0AB; Sat, 23 Jun 2018 23:08:26 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B304A95EE7; Sat, 23 Jun 2018 23:08:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90C7C164AC; Sat, 23 Jun 2018 23:08:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NN8PWC099849; Sat, 23 Jun 2018 23:08:25 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NN8PwH099848; Sat, 23 Jun 2018 23:08:25 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806232308.w5NN8PwH099848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 Jun 2018 23:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335593 - head/usr.sbin/spi X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/spi X-SVN-Commit-Revision: 335593 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 23:08:26 -0000 Author: ian Date: Sat Jun 23 23:08:25 2018 New Revision: 335593 URL: https://svnweb.freebsd.org/changeset/base/335593 Log: Add an example for displaying the manufacturer and size info from a standard spiflash chip. Modified: head/usr.sbin/spi/spi.8 Modified: head/usr.sbin/spi/spi.8 ============================================================================== --- head/usr.sbin/spi/spi.8 Sat Jun 23 22:55:22 2018 (r335592) +++ head/usr.sbin/spi/spi.8 Sat Jun 23 23:08:25 2018 (r335593) @@ -191,6 +191,12 @@ as binary data, piped through displaying it as two hexadecimal unsigned short integer values. .Pp echo "00 01" | spi -A -b -d rw -c 4 | od -t x2 +.It +Query the manufacturer ID and size from a standard spiflash device, by +sending the command byte 0x9f and displaying the 3-byte reply in ASCII hex. +.Pp +spi -f spigen0.0 -m 0 -s 1000000 -d r -c 3 -A -C 9f + .El .Pp .Sh SEE ALSO From owner-svn-src-all@freebsd.org Sat Jun 23 23:44:37 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3D11100AB8A; Sat, 23 Jun 2018 23:44:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DE3796D27; Sat, 23 Jun 2018 23:44:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2EFA216B25; Sat, 23 Jun 2018 23:44:37 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5NNib4E019943; Sat, 23 Jun 2018 23:44:37 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5NNibaq019942; Sat, 23 Jun 2018 23:44:37 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201806232344.w5NNibaq019942@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sat, 23 Jun 2018 23:44:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335594 - head/sys/arm/broadcom/bcm2835 X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/sys/arm/broadcom/bcm2835 X-SVN-Commit-Revision: 335594 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.26 Precedence: list List-Id: "SVN commit messages 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, 23 Jun 2018 23:44:37 -0000 Author: ian Date: Sat Jun 23 23:44:36 2018 New Revision: 335594 URL: https://svnweb.freebsd.org/changeset/base/335594 Log: Retrieve the bus clock speed and mode (polarity/phase) from the child device and set up the hardware accordingly on each transfer. This replaces the old configuration done via sysctl, and allows both fdt configuration data and userland control via the spigen device to work. Submitted by: Bob Frazier Differential Revision: https://reviews.freebsd.org/D15031 Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_spi.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sat Jun 23 23:08:25 2018 (r335593) +++ head/sys/arm/broadcom/bcm2835/bcm2835_spi.c Sat Jun 23 23:44:36 2018 (r335594) @@ -132,17 +132,6 @@ bcm_spi_clock_proc(SYSCTL_HANDLER_ARGS) if (error != 0 || req->newptr == NULL) return (error); - clk = SPI_CORE_CLK / clk; - if (clk <= 1) - clk = 2; - else if (clk % 2) - clk--; - if (clk > 0xffff) - clk = 0; - BCM_SPI_LOCK(sc); - BCM_SPI_WRITE(sc, SPI_CLK, clk); - BCM_SPI_UNLOCK(sc); - return (0); } @@ -163,12 +152,6 @@ bcm_spi_cs_bit_proc(SYSCTL_HANDLER_ARGS, uint32_t bit) if (error != 0 || req->newptr == NULL) return (error); - if (reg) - reg = bit; - BCM_SPI_LOCK(sc); - bcm_spi_modifyreg(sc, SPI_CS, bit, reg); - BCM_SPI_UNLOCK(sc); - return (0); } @@ -200,6 +183,13 @@ bcm_spi_cspol1_proc(SYSCTL_HANDLER_ARGS) return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL1)); } +static int +bcm_spi_cspol2_proc(SYSCTL_HANDLER_ARGS) +{ + + return (bcm_spi_cs_bit_proc(oidp, arg1, arg2, req, SPI_CS_CSPOL2)); +} + static void bcm_spi_sysctl_init(struct bcm_spi_softc *sc) { @@ -214,20 +204,23 @@ bcm_spi_sysctl_init(struct bcm_spi_softc *sc) tree_node = device_get_sysctl_tree(sc->sc_dev); tree = SYSCTL_CHILDREN(tree_node); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "clock", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), bcm_spi_clock_proc, "IU", "SPI BUS clock frequency"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpol", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), bcm_spi_cpol_proc, "IU", "SPI BUS clock polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cpha", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), bcm_spi_cpha_proc, "IU", "SPI BUS clock phase"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol0", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), bcm_spi_cspol0_proc, "IU", "SPI BUS chip select 0 polarity"); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol1", - CTLFLAG_RW | CTLTYPE_UINT, sc, sizeof(*sc), + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), bcm_spi_cspol1_proc, "IU", "SPI BUS chip select 1 polarity"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "cspol2", + CTLFLAG_RD | CTLTYPE_UINT, sc, sizeof(*sc), + bcm_spi_cspol2_proc, "IU", "SPI BUS chip select 2 polarity"); } static int @@ -303,9 +296,6 @@ bcm_spi_attach(device_t dev) */ BCM_SPI_WRITE(sc, SPI_CS, SPI_CS_CLEAR_RXFIFO | SPI_CS_CLEAR_TXFIFO); - /* Set the SPI clock to 500Khz. */ - BCM_SPI_WRITE(sc, SPI_CLK, SPI_CORE_CLK / 500000); - #ifdef BCM_SPI_DEBUG bcm_spi_printr(dev); #endif @@ -412,7 +402,7 @@ static int bcm_spi_transfer(device_t dev, device_t child, struct spi_command *cmd) { struct bcm_spi_softc *sc; - uint32_t cs; + uint32_t cs, mode, clock; int err; sc = device_get_softc(dev); @@ -422,21 +412,34 @@ bcm_spi_transfer(device_t dev, device_t child, struct KASSERT(cmd->tx_data_sz == cmd->rx_data_sz, ("TX/RX data sizes should be equal")); - /* Get the proper chip select for this child. */ + /* Get the bus speed, mode, and chip select for this child. */ + spibus_get_cs(child, &cs); + if ((cs & (~SPIBUS_CS_HIGH)) > 2) { + device_printf(dev, + "Invalid chip select %u requested by %s\n", cs, + device_get_nameunit(child)); + return (EINVAL); + } - cs &= ~SPIBUS_CS_HIGH; + spibus_get_clock(child, &clock); + if (clock == 0) { + device_printf(dev, + "Invalid clock %uHz requested by %s\n", clock, + device_get_nameunit(child)); + return (EINVAL); + } - if (cs > 2) { + spibus_get_mode(child, &mode); + if (mode > 3) { device_printf(dev, - "Invalid chip select %d requested by %s\n", cs, + "Invalid mode %u requested by %s\n", mode, device_get_nameunit(child)); return (EINVAL); } - BCM_SPI_LOCK(sc); - /* If the controller is in use wait until it is available. */ + BCM_SPI_LOCK(sc); while (sc->sc_flags & BCM_SPI_BUSY) mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", 0); @@ -454,13 +457,63 @@ bcm_spi_transfer(device_t dev, device_t child, struct sc->sc_written = 0; sc->sc_len = cmd->tx_cmd_sz + cmd->tx_data_sz; +#ifdef BCM2835_SPI_USE_CS_HIGH /* TODO: for when behavior is correct */ /* + * Assign CS polarity first, while the CS indicates 'inactive'. + * This will need to set the correct polarity bit based on the 'cs', and + * the polarity bit will remain in this state, even after the transaction + * is complete. + */ + if((cs & ~SPIBUS_CS_HIGH) == 0) { + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CSPOL0, + ((cs & (SPIBUS_CS_HIGH)) ? SPI_CS_CSPOL0 : 0)); + } + else if((cs & ~SPIBUS_CS_HIGH) == 1) { + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CSPOL1, + ((cs & (SPIBUS_CS_HIGH)) ? SPI_CS_CSPOL1 : 0)); + } + else if((cs & ~SPIBUS_CS_HIGH) == 2) { + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CSPOL2, + ((cs & (SPIBUS_CS_HIGH)) ? SPI_CS_CSPOL2 : 0)); + } +#endif + + /* + * Set the mode in 'SPI_CS' (clock phase and polarity bits). + * This must happen before CS output pin is active. + * Otherwise, you might glitch and drop the first bit. + */ + bcm_spi_modifyreg(sc, SPI_CS, + SPI_CS_CPOL | SPI_CS_CPHA, + ((mode & SPIBUS_MODE_CPHA) ? SPI_CS_CPHA : 0) | + ((mode & SPIBUS_MODE_CPOL) ? SPI_CS_CPOL : 0)); + + /* + * Set the clock divider in 'SPI_CLK - see 'bcm_spi_clock_proc()'. + */ + + /* calculate 'clock' as a divider value from freq */ + clock = SPI_CORE_CLK / clock; + if (clock <= 1) + clock = 2; + else if (clock % 2) + clock--; + if (clock > 0xffff) + clock = 0; + + BCM_SPI_WRITE(sc, SPI_CLK, clock); + + /* * Set the CS for this transaction, enable interrupts and announce * we're ready to tx. This will kick off the first interrupt. */ bcm_spi_modifyreg(sc, SPI_CS, SPI_CS_MASK | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD, - cs | SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD); + (cs & (~SPIBUS_CS_HIGH)) | /* cs is the lower 2 bits of the reg */ + SPI_CS_TA | SPI_CS_INTR | SPI_CS_INTD); /* Wait for the transaction to complete. */ err = mtx_sleep(dev, &sc->sc_mtx, 0, "bcm_spi", hz * 2); @@ -478,7 +531,7 @@ bcm_spi_transfer(device_t dev, device_t child, struct * return errors. */ if (err == EWOULDBLOCK) { - device_printf(sc->sc_dev, "SPI error\n"); + device_printf(sc->sc_dev, "SPI error (timeout)\n"); err = EIO; }